-
Notifications
You must be signed in to change notification settings - Fork 16
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
Level-sensitive IRQ emulation support #24
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Markku Ahvenjärvi <[email protected]>
Add new virq_set_level() function to transparently emulate level sensitive interrupt semantics. The interrupt will be re-injected as long level remains high and the guest has configured interrupt to be level-sensitive to the distributor. The level is self-clearing for edge triggered interrupts. Signed-off-by: Markku Ahvenjärvi <[email protected]>
f654681
to
ff2e614
Compare
Thanks for the PR. Apologies it took so long to take a look at it. Just pushed to your branch to resolve the conflicts. Will double check the code with @erichchan999 now. |
Cool, thanks 👍 |
@@ -45,7 +72,7 @@ bool fault_handle_vgic_maintenance(size_t vcpu_id) | |||
/* Clear pending */ | |||
LOG_IRQ("Maintenance IRQ %d\n", lr_virq.virq); | |||
set_pending(vgic_get_dist(vgic.registers), lr_virq.virq, false, vcpu_id); | |||
virq_ack(vcpu_id, &lr_virq); | |||
vgic_irq_ack(&vgic, vcpu_id, &lr_virq); |
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 the virq being maintained here turns out to be level-sensitive shouldn't we skip over dequeuing the next irq and loading into list registers? Since we are reasserting the interrupt already when its level-sensitive
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.
Thank you for the comment.
Yes, we could first call ack() callback, and skip the dequeue if irq level is still set.
I can make the changes when I have the time.
The PR adds another interrupt inject function,
virq_set_level()
, which can be used to implement level-sensitive interrupt emulation e.g. for vPCI devices.