dect
/
linux-2.6
Archived
13
0
Fork 0

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: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity 2009-05-03 18:50:55 +03:00
parent 334b8ad7b1
commit e286e86e6d
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}