aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-05-03 18:50:55 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-18 16:35:19 -0700
commit21616cb7a37a63b9f33ea2e45ab6d29910b43fd2 (patch)
tree827e496d90983666abc0400a73cf2f7fc374510c
parenta6ddabcdf09bf394de04ca5c772129cb8fc6e179 (diff)
KVM: Make EFER reads safe when EFER does not exist
commit e286e86e6d2042d67d09244aa0e05ffef75c9d54 upstream. Some processors don't have EFER; don't oops if userspace wants us to read EFER when we check NX. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 425423eff48..92f0457ebe5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1075,9 +1075,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;
}