diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2019-03-13 18:07:50 +0000 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2019-03-19 17:56:34 +0000 |
commit | ca71228b42a96908eca7658861eafacd227856c9 (patch) | |
tree | b915c50bc72f0d568a31b392ccb89065ecbd77f1 /virt/kvm/arm/hyp | |
parent | ebff0b0e3d3c862c16c487959db5e0d879632559 (diff) | |
download | linux-stable-ca71228b42a96908eca7658861eafacd227856c9.tar.gz linux-stable-ca71228b42a96908eca7658861eafacd227856c9.tar.bz2 linux-stable-ca71228b42a96908eca7658861eafacd227856c9.zip |
arm64: KVM: Always set ICH_HCR_EL2.EN if GICv4 is enabled
The normal interrupt flow is not to enable the vgic when no virtual
interrupt is to be injected (i.e. the LRs are empty). But when a guest
is likely to use GICv4 for LPIs, we absolutely need to switch it on
at all times. Otherwise, VLPIs only get delivered when there is something
in the LRs, which doesn't happen very often.
Reported-by: Nianyao Tang <tangnianyao@huawei.com>
Tested-by: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt/kvm/arm/hyp')
-rw-r--r-- | virt/kvm/arm/hyp/vgic-v3-sr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/virt/kvm/arm/hyp/vgic-v3-sr.c b/virt/kvm/arm/hyp/vgic-v3-sr.c index 264d92da3240..370bd6c5e6cb 100644 --- a/virt/kvm/arm/hyp/vgic-v3-sr.c +++ b/virt/kvm/arm/hyp/vgic-v3-sr.c @@ -222,7 +222,7 @@ void __hyp_text __vgic_v3_save_state(struct kvm_vcpu *vcpu) } } - if (used_lrs) { + if (used_lrs || cpu_if->its_vpe.its_vm) { int i; u32 elrsr; @@ -247,7 +247,7 @@ void __hyp_text __vgic_v3_restore_state(struct kvm_vcpu *vcpu) u64 used_lrs = vcpu->arch.vgic_cpu.used_lrs; int i; - if (used_lrs) { + if (used_lrs || cpu_if->its_vpe.its_vm) { write_gicreg(cpu_if->vgic_hcr, ICH_HCR_EL2); for (i = 0; i < used_lrs; i++) |