From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: [PATCH kvm-unit-tests] Honor cpuid.nx when enabling efer.nxe
Date: Tue, 21 Dec 2010 18:40:53 +0200 [thread overview]
Message-ID: <1292949653-21940-1-git-send-email-avi@redhat.com> (raw)
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
next reply other threads:[~2010-12-21 16:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-21 16:40 Avi Kivity [this message]
2010-12-23 13:50 ` [PATCH kvm-unit-tests] Honor cpuid.nx when enabling efer.nxe Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292949653-21940-1-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox