Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial notes on trap handlers #84

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

orangecms
Copy link

@orangecms orangecms commented Oct 16, 2023

initial draft on #83

just give me a while, I'm not versed in ASCII doc yet

Signed-off-by: Daniel Maslowski <[email protected]>
==== Interrupts
[%autowidth,float="center",align="center",cols=">,>,<",options="header",]
|===
| Code / Description |OpenSBI |oreboot SBI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why reference m-mode implementations? Why not call out what the expected behavior should be? And we should probably include the reasoning.

Copy link
Author

@orangecms orangecms Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for reference now, based on this suggestion #83 (comment)

my pledge is to always delegate everything that S-mode could handle, which only excludes operations involving CSRs and possibly MMIO spaces that are M-mode accessible only, AIUI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I had implied we should go into describing M mode implementations, that was not the intention. The BRS spec describes S mode behavior as it relates to booting at OS. Some implementations may not even have an M mode (think VMs).

We should come up with expected behavior (or a mechanism of conveying the necessary info). But I kinda wanna second Ved's feedback or why we ought to care - I think the assumption is that the OS will take the exception eventually for reasons that it would care about (even if the original exception went to M, as it very well might, for example due to firwmare-first error handling)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also went I mentioned "can we enumerate" I meant in the context of understanding the problem space, the github ticket, not actually enumerating in the spec. I definitely don't think this belongs in the spec itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"my pledge is to always delegate everything that S-mode could handle" we're definitely into impl-specific choices, and I don't think the BRS spec is the place to push for those choices. Like with other architectures, work-arounds and additional complexity may end up getting put into M, but in a manner generally transparent to S mode software. What matters is not what's done, but what's the measurable impact.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I had understood from this comment that BRS would supersede the platform spec:
riscvarchive/riscv-platform-specs#91 (comment)

So my intention was to get to a definition of behavior an S-mode OS would expect to avoid confusion where exceptions and/or interrupts are or are not arriving. That is what surprised me when Linux was not handling unaligned access traps, which is now being implemented in a pending patch series. Other OSes that are not part of that development history would benefit. Should this rather go into PRS, then? I would be happy to see it well-defined somewhere, not being picky where. BRS appeared to be closest to that from my current understanding. Where do you rather see it? It could also live in the wiki or in a blog post, I think.

For clarification: In which sense do you mean "transparent"?
There are two interpretations around:

  1. opaque, the other component (S-mode here) is not aware of something
  2. visible, the other component can notice and acknowledge

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, so basically you want a base set of exceptions that an S-Mode OS can expect to be delivered? (like unaligned access).

Will bring this up in the BRS call today and come back with some guidance.

@andreiw
Copy link
Collaborator

andreiw commented Apr 11, 2024

@orangecms @adurbin-rivos should revisit this.

@adurbin-rivos
Copy link
Collaborator

@orangecms @adurbin-rivos should revisit this.

Is there anything else to discuss?

@andreiw
Copy link
Collaborator

andreiw commented Apr 17, 2024

@orangecms can you rework this PR to reference the still in progress FWFT extension as a required mechanism?

@orangecms
Copy link
Author

@orangecms can you rework this PR to reference the still in progress FWFT extension as a required mechanism?

Finally getting back to wrapping my head aroubd this.

So, in the end, I would remove the table/listing, and add the FWFT reference, correct?

@andreiw
Copy link
Collaborator

andreiw commented Jul 28, 2024

I think this item is waiting on SBI 3.0, then we can reference the FWFT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants