Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e286e86e authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: Make EFER reads safe when EFER does not exist



Some processors don't have EFER; don't oops if userspace wants us to
read EFER when we check NX.

Cc: stable@kernel.org
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 334b8ad7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1121,9 +1121,9 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)

static int is_efer_nx(void)
{
	u64 efer;
	unsigned long long efer = 0;

	rdmsrl(MSR_EFER, efer);
	rdmsrl_safe(MSR_EFER, &efer);
	return efer & EFER_NX;
}