Skip to content

Commit 0a2acd3

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Simplify kvm_vcpu_get_mpidr_aff()
By definition, MPIDR_EL1 cannot be modified by the guest. This means it is pointless to check whether this is loaded on the CPU. Simplify the kvm_vcpu_get_mpidr_aff() helper to directly access the in-memory value. Reviewed-by: Joey Gouly <[email protected]> Reviewed-by: Zenghui Yu <[email protected]> Tested-by: Joey Gouly <[email protected]> Tested-by: Shameer Kolothum <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 5f4bd81 commit 0a2acd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ static inline bool kvm_is_write_fault(struct kvm_vcpu *vcpu)
465465

466466
static inline unsigned long kvm_vcpu_get_mpidr_aff(struct kvm_vcpu *vcpu)
467467
{
468-
return vcpu_read_sys_reg(vcpu, MPIDR_EL1) & MPIDR_HWID_BITMASK;
468+
return __vcpu_sys_reg(vcpu, MPIDR_EL1) & MPIDR_HWID_BITMASK;
469469
}
470470

471471
static inline void kvm_vcpu_set_be(struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)