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

Interrupt behaviour in debug mode #1090

Open
jackwdandrew opened this issue Dec 2, 2024 · 1 comment
Open

Interrupt behaviour in debug mode #1090

jackwdandrew opened this issue Dec 2, 2024 · 1 comment

Comments

@jackwdandrew
Copy link

jackwdandrew commented Dec 2, 2024

My understanding of the intent of the specification is that:

  • Interrupts are pended in the various interrupt controllers.
  • Interrupts are masked in debug mode.
  • Interrupts can be optionally masked in stepping.

The spec is not 100% clear / correct:

  • This line only applies to abstract commands, should it be program buffer too?
  • This line is missing a cross reference to stepie
  • There is no statement about whether interrupts continue to pend.
pdonahue-ventana added a commit to pdonahue-ventana/riscv-debug-spec that referenced this issue Dec 2, 2024
@pdonahue-ventana
Copy link
Collaborator

This line only applies to abstract commands, should it be program buffer too?

The program buffer only executes as part of an abstract command:

A debugger can write a small program to the Program Buffer, and then execute it exactly once with the Access Register Abstract Command

In fact, executing the program buffer is the only way to architecturally execute code in Debug Mode. (Many implementations choose to execute code to communicate with the DM, to perform abstract commands besides the program buffer, etc. However, this is should be done in a way that is indistinguishable from implementing hardware state machines and wires to/from DM.)

This line is missing a cross reference to stepie

You're right. That looks like a latex->asciidoc conversion problem. I created #1091.

There is no statement about whether interrupts continue to pend.

I believe that the debug spec uses "disabled" in the same sense that the privileged spec uses enabled/disabled when describing interrupts. A hart in debug mode couldn't possibly reach out to an interrupt controller to lower a pending interrupt. That's normally done by a software handler and it involves more than just writing to some hart-local state. (Even clearing the eip bit in a local IMSIC would leave the interrupt pending at the source.)

rtwfroody added a commit that referenced this issue Dec 5, 2024
Fix asciidoc conversion problem for #1090.
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

No branches or pull requests

2 participants