Skip to content

Commit

Permalink
KVM: Make EFER reads safe when EFER does not exist
Browse files Browse the repository at this point in the history
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: Avi Kivity <avi@redhat.com>
  • Loading branch information
Avi Kivity committed May 11, 2009
1 parent 334b8ad commit e286e86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e286e86

Please sign in to comment.