Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: KVM: Make ICC_SRE_EL1 access return the configured SRE value

When we trap ICC_SRE_EL1, we handle it as RAZ/WI. It would be
more correct to actual make it RO, and return the configured
value when read.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>

authored by

Marc Zyngier and committed by
Christoffer Dall
b34f2bcb 637d122b

+12 -1
+12 -1
arch/arm64/kvm/sys_regs.c
··· 134 134 return true; 135 135 } 136 136 137 + static bool access_gic_sre(struct kvm_vcpu *vcpu, 138 + struct sys_reg_params *p, 139 + const struct sys_reg_desc *r) 140 + { 141 + if (p->is_write) 142 + return ignore_write(vcpu, p); 143 + 144 + p->regval = vcpu->arch.vgic_cpu.vgic_v3.vgic_sre; 145 + return true; 146 + } 147 + 137 148 static bool trap_raz_wi(struct kvm_vcpu *vcpu, 138 149 struct sys_reg_params *p, 139 150 const struct sys_reg_desc *r) ··· 969 958 access_gic_sgi }, 970 959 /* ICC_SRE_EL1 */ 971 960 { Op0(0b11), Op1(0b000), CRn(0b1100), CRm(0b1100), Op2(0b101), 972 - trap_raz_wi }, 961 + access_gic_sre }, 973 962 974 963 /* CONTEXTIDR_EL1 */ 975 964 { Op0(0b11), Op1(0b000), CRn(0b1101), CRm(0b0000), Op2(0b001),