Skip to content

Commit 958e8e1

Browse files
author
Marc Zyngier
committed
KVM: arm64: vgic-v4: Initialize GICv4.1 even in the absence of a virtual ITS
KVM now expects to be able to use HW-accelerated delivery of vSGIs as soon as the guest has enabled thm. Unfortunately, we only initialize the GICv4 context if we have a virtual ITS exposed to the guest. Fix it by always initializing the GICv4.1 context if it is available on the host. Fixes: 2291ff2 ("KVM: arm64: GICv4.1: Plumb SGI implementation selection in the distributor") Reviewed-by: Zenghui Yu <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 6e97798 commit 958e8e1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

virt/kvm/arm/vgic/vgic-init.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,15 @@ int vgic_init(struct kvm *kvm)
294294
}
295295
}
296296

297-
if (vgic_has_its(kvm)) {
297+
if (vgic_has_its(kvm))
298298
vgic_lpi_translation_cache_init(kvm);
299+
300+
/*
301+
* If we have GICv4.1 enabled, unconditionnaly request enable the
302+
* v4 support so that we get HW-accelerated vSGIs. Otherwise, only
303+
* enable it if we present a virtual ITS to the guest.
304+
*/
305+
if (vgic_supports_direct_msis(kvm)) {
299306
ret = vgic_v4_init(kvm);
300307
if (ret)
301308
goto out;

virt/kvm/arm/vgic/vgic-mmio-v3.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ bool vgic_has_its(struct kvm *kvm)
5050

5151
bool vgic_supports_direct_msis(struct kvm *kvm)
5252
{
53-
return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm);
53+
return (kvm_vgic_global_state.has_gicv4_1 ||
54+
(kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm)));
5455
}
5556

5657
/*

0 commit comments

Comments
 (0)