Skip to content

Commit f1edb15

Browse files
Fuad Tabbaoupton
authored andcommitted
arm64: vgic-v2: Fix guest endianness check in hVHE mode
In hVHE when running at the hypervisor, SCTLR_EL1 refers to the hypervisor's System Control Register rather than the guest's. Make sure to access the guest's register to determine its endianness. Reported-by: Will Deacon <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 798eb59 commit f1edb15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static bool __is_be(struct kvm_vcpu *vcpu)
2020
if (vcpu_mode_is_32bit(vcpu))
2121
return !!(read_sysreg_el2(SYS_SPSR) & PSR_AA32_E_BIT);
2222

23-
return !!(read_sysreg(SCTLR_EL1) & SCTLR_ELx_EE);
23+
return !!(read_sysreg_el1(SYS_SCTLR) & SCTLR_ELx_EE);
2424
}
2525

2626
/*

0 commit comments

Comments
 (0)