Skip to content

Commit 2a6bf51

Browse files
author
Marc Zyngier
committed
Merge branch kvm-arm64/misc-5.16 into kvmarm-master/next
* kvm-arm64/misc-5.16: : . : - Allow KVM to be disabled from the command-line : - Clean up CONFIG_KVM vs CONFIG_HAVE_KVM : - Fix endianess evaluation on MMIO access from EL0 : . KVM: arm64: Fix reporting of endianess when the access originates at EL0 Signed-off-by: Marc Zyngier <[email protected]>
2 parents cd67e9a + 69adec1 commit 2a6bf51

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ static inline bool kvm_vcpu_is_be(struct kvm_vcpu *vcpu)
396396
if (vcpu_mode_is_32bit(vcpu))
397397
return !!(*vcpu_cpsr(vcpu) & PSR_AA32_E_BIT);
398398

399-
return !!(vcpu_read_sys_reg(vcpu, SCTLR_EL1) & (1 << 25));
399+
if (vcpu_mode_priv(vcpu))
400+
return !!(vcpu_read_sys_reg(vcpu, SCTLR_EL1) & SCTLR_ELx_EE);
401+
else
402+
return !!(vcpu_read_sys_reg(vcpu, SCTLR_EL1) & SCTLR_EL1_E0E);
400403
}
401404

402405
static inline unsigned long vcpu_data_guest_to_host(struct kvm_vcpu *vcpu,

0 commit comments

Comments
 (0)