Skip to content

Commit cb17629

Browse files
author
Marc Zyngier
committed
KVM: arm64: Allow EL1 control registers to be accessed from the CPU state
As we are about to plug the SW PTW into the EL1-only code, we can no longer assume that the EL1 state is not resident on the CPU, as we don't necessarily get there from EL2 traps. Turn the __vcpu_sys_reg() access on the EL1 state into calls to the vcpu_read_sys_reg() helper, which is guaranteed to do the right thing. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 14d4802 commit cb17629

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/kvm/at.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static u64 effective_tcr2(struct kvm_vcpu *vcpu, enum trans_regime regime)
105105
!(__vcpu_sys_reg(vcpu, HCRX_EL2) & HCRX_EL2_TCR2En))
106106
return 0;
107107

108-
return __vcpu_sys_reg(vcpu, TCR2_EL1);
108+
return vcpu_read_sys_reg(vcpu, TCR2_EL1);
109109
}
110110

111111
return vcpu_read_sys_reg(vcpu, TCR2_EL2);
@@ -956,7 +956,7 @@ static void compute_s1_direct_permissions(struct kvm_vcpu *vcpu,
956956
wxn = (vcpu_read_sys_reg(vcpu, SCTLR_EL2) & SCTLR_ELx_WXN);
957957
break;
958958
case TR_EL10:
959-
wxn = (__vcpu_sys_reg(vcpu, SCTLR_EL1) & SCTLR_ELx_WXN);
959+
wxn = (vcpu_read_sys_reg(vcpu, SCTLR_EL1) & SCTLR_ELx_WXN);
960960
break;
961961
}
962962

0 commit comments

Comments
 (0)