-
Notifications
You must be signed in to change notification settings - Fork 92
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
AR: Clarify itrigger and trigger number translation #903
Conversation
xml/hwbp_registers.xml
Outdated
trap is taken. For interrupts whose numbers are translated, that means | ||
the number checked is the one in the mode that the trap handler executes | ||
in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this sentence will make sense to people who aren't familiar with AIA. I would say something like:
trap is taken. For interrupts whose numbers are translated, that means | |
the number checked is the one in the mode that the trap handler executes | |
in. | |
trap is taken. For virtualized interrupts that have different interrupt numbers | |
when viewed from different modes, that means | |
the number checked is the one in the mode that the trap handler executes | |
in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also need to say something about how we don't care why the interrupt is taken? It could be that the input wire asserted, it could be that M mode wrote mie.STIE=1 in the original priv arch, it could be that the hypervisor is playing with hvip, etc. This was one of John's concerns. We don't have to spell out the cases but we should say something about how the trigger is based on the interrupt trap regardless of the original cause of the interrupt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of agree with you, but I'm not sure how to say that. Aren't interrupt traps by definition taken in response to interrupts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that John's question was whether one category of reasons for taking an interrupt would be treated differently than another category of reasons for taking an interrupt.
Rereading what's currently there, it basically says that the trigger matches/fires only if we trap but it doesn't say that it fires every time that we trap. Maybe it's as simple as saying "The trigger fires if and only if the hart takes a trap because of the interrupt." That would presumably clarify that the reason for the trap doesn't matter.
xml/hwbp_registers.xml
Outdated
|
||
Hardware may only support a subset of interrupts for this trigger. A | ||
debugger must read back \RcsrTdataTwo after writing it to confirm the | ||
requested functionality is actually supported. | ||
|
||
The trigger only fires if the hart takes a trap because of the | ||
interrupt. (E.g.\ it does not fire when a timer interrupt occurs but that | ||
interrupt is not enabled in \Rmie.) | ||
interrupt. (E.g.\ it does not fire for an interrupt that is masked.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I like to avoid "masked" because sometimes you have positive masks (A & mask)
and sometimes you have negative masks (A & ~mask)
so it can be ambiguous. What you have is probably not that ambiguous but how about using something closer to the original language? That also applies to global enable (mstatus.MIE) rather than just local enables (mie).
interrupt. (E.g.\ it does not fire for an interrupt that is masked.) | |
interrupt. (E.g.\ it does not fire for an interrupt that is not enabled.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disabled? Done.
adfd2c2
to
22b0d93
Compare
I've rewritten this, hopefully to be more clear. |
xml/hwbp_registers.xml
Outdated
For interrupts where it is enabled, this trigger fires when an interrupt | ||
trap is taken from a privilege mode where the trigger is enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure what the first "it" is. It seems like it refers to an interrupt but singular "it" doesn't match "interrupts" plural. Then I wondered if it would be clearer to just remove everything before the comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
This trigger fires when an interrupt trap is taken from a privilege mode
where the trigger is enabled and that interrupt is also enabled in the
trigger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I understand. There are a lot of enables here: the mode bits in tdata1, the interrupt number in tdata2, and the interrupt enables (both mie and mstatus.MIE). I like something more like this tweak to the earlier language:
For an interrupt where that interrupt number is enabled in tdata2, this trigger fires when an interrupt
trap is taken from a privilege mode where the trigger is enabled.
That doesn't actually talk about the interrupt enables but that's implicit when you talk about taking a trap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to explicitly call out tdata2 here, because nmi is also an option. I agree there are a lot of enables. Maybe I just need to capitulate and make a numbered list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it even simpler. We don't need to talk about the mode at all in this sentence. It's already in the bits. The only real need is to indicate what the trigger is useful for. 2 paragraphs down (When the trigger matches...) already makes it clear that it only happens when a trap is actually taken. We don't need the parenthetical about interrupts being masked or whatever. The trigger fires when the trap is taken. Done.
itrigger numbers relate to the value written to *cause when the trap is taken. Addresses #889.
b357433
to
92835a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's simpler but still conveys all the necessary information. Looks good.
itrigger numbers relate to the value written to *cause when the trap is taken.
Addresses #889.