[COMMIT master] Honor cpuid.nx when enabling efer.nxe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Avi Kivity <avi@xxxxxxxxxx>

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>

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)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Walks]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux