summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-06-09 12:49:56 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2017-06-15 09:45:07 +0100
commit7b1dba1f7325629427c0e5bdf014159b229d16c8 (patch)
treeebc647bc897765a24c1f9d7d5d4dbb98fb728f87 /virt
parente7f1d1eef482150a64a6e6ad8faf40f8f97eed67 (diff)
downloadop-kernel-dev-7b1dba1f7325629427c0e5bdf014159b229d16c8.zip
op-kernel-dev-7b1dba1f7325629427c0e5bdf014159b229d16c8.tar.gz
KVM: arm64: Log an error if trapping a write-to-read-only GICv3 access
A write-to-read-only GICv3 access should UNDEF at EL1. But since we're in complete paranoia-land with broken CPUs, let's assume the worse and gracefully handle the case. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Christoffer Dall <cdall@linaro.org> Signed-off-by: Christoffer Dall <cdall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/hyp/vgic-v3-sr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/virt/kvm/arm/hyp/vgic-v3-sr.c b/virt/kvm/arm/hyp/vgic-v3-sr.c
index b26ce58..79e3c2d 100644
--- a/virt/kvm/arm/hyp/vgic-v3-sr.c
+++ b/virt/kvm/arm/hyp/vgic-v3-sr.c
@@ -976,6 +976,8 @@ int __hyp_text __vgic_v3_perform_cpuif_access(struct kvm_vcpu *vcpu)
switch (sysreg) {
case SYS_ICC_IAR0_EL1:
case SYS_ICC_IAR1_EL1:
+ if (unlikely(!is_read))
+ return 0;
fn = __vgic_v3_read_iar;
break;
case SYS_ICC_EOIR0_EL1:
@@ -1026,6 +1028,8 @@ int __hyp_text __vgic_v3_perform_cpuif_access(struct kvm_vcpu *vcpu)
break;
case SYS_ICC_HPPIR0_EL1:
case SYS_ICC_HPPIR1_EL1:
+ if (unlikely(!is_read))
+ return 0;
fn = __vgic_v3_read_hppir;
break;
case SYS_ICC_GRPEN0_EL1:
@@ -1046,6 +1050,8 @@ int __hyp_text __vgic_v3_perform_cpuif_access(struct kvm_vcpu *vcpu)
fn = __vgic_v3_write_dir;
break;
case SYS_ICC_RPR_EL1:
+ if (unlikely(!is_read))
+ return 0;
fn = __vgic_v3_read_rpr;
break;
case SYS_ICC_CTLR_EL1:
OpenPOWER on IntegriCloud