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

do interrupt maintenance if interrupt is set pending (ie enqueued) #53

Open
axel-h opened this issue May 11, 2022 · 0 comments
Open

do interrupt maintenance if interrupt is set pending (ie enqueued) #53

axel-h opened this issue May 11, 2022 · 0 comments
Labels

Comments

@axel-h
Copy link
Member

axel-h commented May 11, 2022

In vgic_dist_set_pending_irq() we enque an interrupt and then dequeue one

/* Enqueueing an IRQ and dequeueing it right after makes little sense
* now, but in the future this is needed to support IRQ priorities.
*/
int err = vgic_irq_enqueue(vgic, vcpu, virq_data);
if (err) {
ZF_LOGF("Failure enqueueing IRQ, increase MAX_IRQ_QUEUE_LEN");
return -1;
}
int idx = vgic_find_empty_list_reg(vgic, vcpu);
if (idx < 0) {
/* There were no empty list registers available, but that's not a big
* deal -- we have already enqueued this IRQ and eventually the vGIC
* maintenance code will load it to a list register from the queue.
*/
return 0;
}
struct virq_handle *virq = vgic_irq_dequeue(vgic, vcpu);
assert(virq);
return vgic_vcpu_load_list_reg(vgic, vcpu, idx, virq);

Since there is no guarantee that we dequeue the same interrupt we have enqueued, I wonder if this should dequeue in a loop while there are interrupts in the queue and there are list registers available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant