summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/hyp/vgic-v3-sr.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2017-11-28 08:12:32 -0800
committerTony Lindgren <tony@atomide.com>2017-11-28 08:12:32 -0800
commitbc686442f8a601bccac1f22506ecdb4b0d62cadd (patch)
treeb224ab4aa2350b233da640f5850f48bc6bfeb2d0 /virt/kvm/arm/hyp/vgic-v3-sr.c
parent60636a5d0fa2f8bc6d0c23c4027100ba20866f9b (diff)
parentca41e244517d6d3f1600c229ff7ca615049c1e9c (diff)
downloadlinux-bc686442f8a601bccac1f22506ecdb4b0d62cadd.tar.gz
linux-bc686442f8a601bccac1f22506ecdb4b0d62cadd.tar.bz2
linux-bc686442f8a601bccac1f22506ecdb4b0d62cadd.zip
Merge branch 'dts-fixes' into omap-for-v4.15/fixes-dt
Diffstat (limited to 'virt/kvm/arm/hyp/vgic-v3-sr.c')
-rw-r--r--virt/kvm/arm/hyp/vgic-v3-sr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/virt/kvm/arm/hyp/vgic-v3-sr.c b/virt/kvm/arm/hyp/vgic-v3-sr.c
index 91728faa13fd..f5c3d6d7019e 100644
--- a/virt/kvm/arm/hyp/vgic-v3-sr.c
+++ b/virt/kvm/arm/hyp/vgic-v3-sr.c
@@ -258,7 +258,8 @@ void __hyp_text __vgic_v3_save_state(struct kvm_vcpu *vcpu)
cpu_if->vgic_ap1r[0] = __vgic_v3_read_ap1rn(0);
}
} else {
- if (static_branch_unlikely(&vgic_v3_cpuif_trap))
+ if (static_branch_unlikely(&vgic_v3_cpuif_trap) ||
+ cpu_if->its_vpe.its_vm)
write_gicreg(0, ICH_HCR_EL2);
cpu_if->vgic_elrsr = 0xffff;
@@ -337,9 +338,11 @@ void __hyp_text __vgic_v3_restore_state(struct kvm_vcpu *vcpu)
/*
* If we need to trap system registers, we must write
* ICH_HCR_EL2 anyway, even if no interrupts are being
- * injected,
+ * injected. Same thing if GICv4 is used, as VLPI
+ * delivery is gated by ICH_HCR_EL2.En.
*/
- if (static_branch_unlikely(&vgic_v3_cpuif_trap))
+ if (static_branch_unlikely(&vgic_v3_cpuif_trap) ||
+ cpu_if->its_vpe.its_vm)
write_gicreg(cpu_if->vgic_hcr, ICH_HCR_EL2);
}