Signed-off-by: Avi Kivity <a...@redhat.com>
---
 x86/vmexit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/x86/vmexit.c b/x86/vmexit.c
index 551083d..67746c6 100644
--- a/x86/vmexit.c
+++ b/x86/vmexit.c
@@ -144,7 +144,8 @@ static void do_test(struct test *test)
 
 static void enable_nx(void *junk)
 {
-       wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_NX_MASK);
+       if (cpuid(0x80000001).d & (1 << 20))
+               wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_NX_MASK);
 }
 
 int main(void)
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to