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

How hvictl affect vstopi? Is every value legal? #61

Open
n1240549 opened this issue Jan 9, 2024 · 1 comment
Open

How hvictl affect vstopi? Is every value legal? #61

n1240549 opened this issue Jan 9, 2024 · 1 comment

Comments

@n1240549
Copy link

n1240549 commented Jan 9, 2024

Hi @jhauser-us,
We have two question about HVICTL.

  1. There is a candidate for vstopi, if bit 9 is not one in both vsip and vsie, hvictl.VTI=1, and hvictl.IID is not 9, the major interrupt is specified by hvictl field. Is it true that vstopi will reflect the value of hvictl no matter what value it contains? For example, what if the hvictl.iid is written with IID=MEI? (Machine External Interrupt should not be in VS-level).

if hvictl fields VTI = 1 and IID ̸= 9:
the major interrupt specified by hvictl fields IID, DPR, and IPRIO.

  1. In spec, hvictl[27:16] is reserved for IID and the requirement is at least 6-bit. If the user choose to implement with 6-bit, could I say it's legal that hvictl[27:22] is always zero no matter what value is written to hvictl[27:22]?

IID is a WARL unsigned integer field with at least 6 implemented bits, while IPRIO is always the full 8 bits. If k bits are implemented for IID, then all values 0 through 2k − 1 are supported, and a write to hvictl sets IID equal to bits (15 + k):16 of the value written.

Thanks.

@jhauser-us
Copy link
Collaborator

  1. ... Is it true that vstopi will reflect the value of hvictl no matter what value it contains?

Correct.

For example, what if the hvictl.iid is written with IID=MEI?

Then vstopi will indicate an MEI.

(Machine External Interrupt should not be in VS-level).

We leave it to hypervisor software to decide what interrupts a virtual machine may see. If a VM should not see an MEI, then the hypervisor should not inject an MEI into the VM. This is just one of many responsibilities that a hypervisor has in providing a valid RISC-V execution environment for a VM.

  1. ... If the user choose to implement with 6-bit, could I say it's legal that hvictl[27:22] is always zero no matter what value is written to hvictl[27:22]?

Yes, definitely. Not only could you say it's legal; the part of the spec you quoted means to require exactly that.

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