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

way to clear VSTIP and VSEIP injected by hvip.VSTIP and hvip.VSEIP from VS-mode #1798

Open
Steven-Li-Xiaogang opened this issue Jan 12, 2025 · 0 comments

Comments

@Steven-Li-Xiaogang
Copy link

it seems the privilege spec implicit that external interrupt caused pending would have a sperate register named 'E', sip.VSTIP(vsip.VSTIP)/sip.VSEIP(vsip.VSEIP) was called register 'B', and SW only was able to change the status of register 'B' by writing CSR hvip, so it seems that we could not have a way to clear pending status caused hvip.VSTIP/hvip.VSEIP while running at VS-mode.

  1. for VS-mode VSTIP, it seems it's not mentioned that hvip.VSTIP is read-only when menvcfg.STCE and henvcfg.STCE are set (mvip.VSTIP is read-only when menvcfg.STCE is set). So how could VS-mode SW get to known it's a interrupt raised by writing hvip.VSTIP or caused by timer (vstimecmp <= time + timedelta). I have found this JIRA How to clear the pending of VS-level timer interrupts which pending is set by hvip.vstip and trap to VS mode? #1589 mentioned to use ecall which makes HS-mode having changes to clear pending by writing hvip.VSTIP, but seems SW have no way to know the interrupt source.
  2. for VS-mode VSEIP, pending status of register 'E' is raised by external interrupt controller and MMIO access to claim/clear interrupt from interrupt controller (such as PLIC or IMSIC), which can't clear pending of register 'B' raised from writing hvip.VSEIP, SW also can not recognize it's a virtual interrupt injected by writing hvip.VSEIP or a real external interrupt from controller while they arrived at the same time, so we could not issue an ecall to let HS/M-mode help to clear hvip.VSEIP like what you have mentioned in How to clear the pending of VS-level timer interrupts which pending is set by hvip.vstip and trap to VS mode? #1589
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

1 participant