aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7c1ce5ac6131..49079a46687b 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)
1121 1121
1122static int is_efer_nx(void) 1122static int is_efer_nx(void)
1123{ 1123{
1124 u64 efer; 1124 unsigned long long efer = 0;
1125 1125
1126 rdmsrl(MSR_EFER, efer); 1126 rdmsrl_safe(MSR_EFER, &efer);
1127 return efer & EFER_NX; 1127 return efer & EFER_NX;
1128} 1128}
1129 1129
@@ -1259,7 +1259,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1259 bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) | 1259 bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) |
1260 bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) | 1260 bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) |
1261 bit(X86_FEATURE_SYSCALL) | 1261 bit(X86_FEATURE_SYSCALL) |
1262 (bit(X86_FEATURE_NX) && is_efer_nx()) | 1262 (is_efer_nx() ? bit(X86_FEATURE_NX) : 0) |
1263#ifdef CONFIG_X86_64 1263#ifdef CONFIG_X86_64
1264 bit(X86_FEATURE_LM) | 1264 bit(X86_FEATURE_LM) |
1265#endif 1265#endif