All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm@vger.kernel.org
Cc: joerg.roedel@amd.com
Subject: [PATCH] Don't try to mess with CPUID when running nested SVM
Date: Fri, 15 May 2009 11:01:18 +0200	[thread overview]
Message-ID: <1242378078-1908-2-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1242378078-1908-1-git-send-email-agraf@suse.de>

When using nested SVM we usually want the guest to see the exact CPUID values
we gave it and not some mangled ones.

Hyper-V for example doesn't even start when the "hypervisor present" bit is set.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-i386/helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-i386/helper.c b/target-i386/helper.c
index 24fcea8..5f56698 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1496,7 +1496,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
          * isn't supported in compatibility mode on Intel.  so advertise the
          * actuall cpu, and say goodbye to migration between different vendors
          * is you use compatibility mode. */
-        if (kvm_enabled())
+        if (kvm_enabled() && !kvm_nested)
             host_cpuid(0, 0, NULL, ebx, ecx, edx);
         break;
     case 1:
@@ -1506,7 +1506,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
         *edx = env->cpuid_features;
 
         /* "Hypervisor present" bit required for Microsoft SVVP */
-        if (kvm_enabled())
+        if (kvm_enabled() && !kvm_nested)
             *ecx |= (1 << 31);
         break;
     case 2:
-- 
1.6.0.2


  reply	other threads:[~2009-05-15  9:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15  9:01 [PATCH] Add external-module-compat header for MSR_VM_IGNNE Alexander Graf
2009-05-15  9:01 ` Alexander Graf [this message]
2009-05-15 11:09   ` [PATCH] Don't try to mess with CPUID when running nested SVM Avi Kivity
2009-05-15 11:15     ` Alexander Graf
2009-05-15 11:19       ` Avi Kivity

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=1242378078-1908-2-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.