* [PATCH kvm-unit-tests] Honor cpuid.nx when enabling efer.nxe
@ 2010-12-21 16:40 Avi Kivity
2010-12-23 13:50 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2010-12-21 16:40 UTC (permalink / raw)
To: Marcelo Tosatti, kvm
Signed-off-by: Avi Kivity <avi@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-23 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21 16:40 [PATCH kvm-unit-tests] Honor cpuid.nx when enabling efer.nxe Avi Kivity
2010-12-23 13:50 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox