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 hypercall doc #22

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

add hypercall doc #22

wants to merge 1 commit into from

Conversation

KouweiLee
Copy link
Contributor

No description provided.

@enkerewpo
Copy link
Member

enkerewpo commented Dec 4, 2024

for loongarch64 there's a new exclusive hypercall - clear injected irq https://github.com/syswonder/hvisor/blob/6c4babf6a7210f7c4932cae380b46d78d91ede39/src/hypercall/mod.rs#L29

the reasons of needing this new hypercall:

  1. when using LVZ's GINTC to inject irq, it requires to remove the injection bit to stop it or it will inject irq forever
  2. in KVM this is done by frequent vCPU timer interrupt trap-in to KVM, but hvisor doesn't have timer interrupt traps so we need to stop the injection manually after when injected it
  3. after nonroot's virtio-mmio driver ack the irq and access the corresponding mmio registers, root linux's hvisor-tool will ask hvisor to send an IPI to clear other CPU's GINTC injection bits to stop injecting manually, and this is issued by the CLEAR INJECT IRQ hypercall in hvisor-tool(loongarch64 port: https://github.com/enkerewpo/hvisor-tool/blob/00759d19f41134df3d48a0557baf514f2c1a0ce8/driver/hvisor.c#L200)

@KouweiLee
Copy link
Contributor Author

for loongarch64 there's a new exclusive hypercall - clear injected irq https://github.com/syswonder/hvisor/blob/6c4babf6a7210f7c4932cae380b46d78d91ede39/src/hypercall/mod.rs#L29

the reasons of needing this new hypercall:

  1. when using LVZ's GINTC to inject irq, it requires to remove the injection bit to stop it or it will inject irq forever
  2. in KVM this is done by frequent vCPU timer interrupt trap-in to KVM, but hvisor doesn't have timer interrupt traps so we need to stop the injection manually after when injected it
  3. after nonroot's virtio-mmio driver ack the irq and access the corresponding mmio registers, root linux's hvisor-tool will ask hvisor to send an IPI to clear other CPU's GINTC injection bits to stop injecting manually, and this is issued by the CLEAR INJECT IRQ hypercall in hvisor-tool(loongarch64 port: https://github.com/enkerewpo/hvisor-tool/blob/00759d19f41134df3d48a0557baf514f2c1a0ce8/driver/hvisor.c#L200)

you can commit your hypercall to this pr.

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.

2 participants