From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH] don't expose lm bit if kernel is not 64-bit capable.
Date: Tue, 3 Feb 2009 10:04:14 -0500 [thread overview]
Message-ID: <1233673454-14526-1-git-send-email-glommer@redhat.com> (raw)
If the kernel is not 64-bit capable (even if the host
machine is) do not expose the lm bit in guest cpuid.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/helper.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index a28ab93..997e4e1 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -24,6 +24,7 @@
#include <inttypes.h>
#include <signal.h>
#include <assert.h>
+#include <sys/utsname.h>
#include "cpu.h"
#include "exec-all.h"
@@ -1520,13 +1521,16 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
if (kvm_enabled()) {
uint32_t h_eax, h_edx;
+ struct utsname utsname;
+
+ uname(&utsname);
host_cpuid(0x80000001, &h_eax, NULL, NULL, &h_edx);
/* disable CPU features that the host does not support */
/* long mode */
- if ((h_edx & 0x20000000) == 0 /* || !lm_capable_kernel */)
+ if ((h_edx & 0x20000000) == 0 || strcmp(utsname.machine, "x86_64"))
*edx &= ~0x20000000;
/* syscall */
if ((h_edx & 0x00000800) == 0)
--
1.5.6.5
next reply other threads:[~2009-02-03 15:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 15:04 Glauber Costa [this message]
2009-02-03 15:44 ` [Qemu-devel] [PATCH] don't expose lm bit if kernel is not 64-bit capable Alexander Graf
2009-02-03 15:52 ` Glauber Costa
2009-02-03 17:58 ` Anthony Liguori
2009-02-03 19:35 ` Avi Kivity
2009-02-03 19:37 ` Avi Kivity
2009-02-03 20:00 ` Glauber Costa
2009-02-03 21:14 ` Anthony Liguori
2009-02-03 21:35 ` Glauber Costa
2009-02-03 21:42 ` Anthony Liguori
2009-02-04 8:10 ` Avi Kivity
2009-02-03 19:37 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2009-02-03 20:15 Glauber Costa
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=1233673454-14526-1-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).