summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-05-03 18:50:55 +0300
committerAvi Kivity <avi@redhat.com>2009-05-11 11:19:00 +0300
commite286e86e6d2042d67d09244aa0e05ffef75c9d54 (patch)
tree6fbabd149ba7e0b2fa06a03f39cebe268de9dc8b /arch/x86
parent334b8ad7b182fc14d720acd7729afda3ab4c7e3a (diff)
downloadop-kernel-dev-e286e86e6d2042d67d09244aa0e05ffef75c9d54.zip
op-kernel-dev-e286e86e6d2042d67d09244aa0e05ffef75c9d54.tar.gz
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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 834a7bf..49079a4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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;
}
OpenPOWER on IntegriCloud