Skip to content

Commit 9879b79

Browse files
author
Marc Zyngier
committed
KVM: arm64: GICv4.1: Let doorbells be auto-enabled
As GICv4.1 understands the life cycle of doorbells (instead of just randomly firing them at the most inconvenient time), just enable them at irq_request time, and be done with it. Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Zenghui Yu <yuzenghui@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Link: https://lore.kernel.org/r/20200304203330.4967-18-maz@kernel.org
1 parent 009384b commit 9879b79

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎virt/kvm/arm/vgic/vgic-v4.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,22 @@ int vgic_v4_init(struct kvm *kvm)
141141

142142
kvm_for_each_vcpu(i, vcpu, kvm) {
143143
int irq = dist->its_vm.vpes[i]->irq;
144+
unsigned long irq_flags = DB_IRQ_FLAGS;
144145

145146
/*
146147
* Don't automatically enable the doorbell, as we're
147148
* flipping it back and forth when the vcpu gets
148149
* blocked. Also disable the lazy disabling, as the
149150
* doorbell could kick us out of the guest too
150151
* early...
152+
*
153+
* On GICv4.1, the doorbell is managed in HW and must
154+
* be left enabled.
151155
*/
152-
irq_set_status_flags(irq, DB_IRQ_FLAGS);
156+
if (kvm_vgic_global_state.has_gicv4_1)
157+
irq_flags &= ~IRQ_NOAUTOEN;
158+
irq_set_status_flags(irq, irq_flags);
159+
153160
ret = request_irq(irq, vgic_v4_doorbell_handler,
154161
0, "vcpu", vcpu);
155162
if (ret) {

0 commit comments

Comments
 (0)