[PATCH kvm-unit-tests] Honor cpuid.nx when enabling efer.nxe

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

 



Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux