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

Level-sensitive IRQ emulation support #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

elmankku
Copy link

@elmankku elmankku commented Oct 9, 2023

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.

elmankku and others added 2 commits March 19, 2024 10:45
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]>
@Ivan-Velickovic
Copy link
Collaborator

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.

@elmankku
Copy link
Author

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);
Copy link
Contributor

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

Copy link
Author

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.

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.

3 participants