From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: [PATCH] Don't try to mess with CPUID when running nested SVM Date: Fri, 15 May 2009 11:01:18 +0200 Message-ID: <1242378078-1908-2-git-send-email-agraf@suse.de> References: <1242378078-1908-1-git-send-email-agraf@suse.de> Cc: joerg.roedel@amd.com To: kvm@vger.kernel.org Return-path: Received: from cantor.suse.de ([195.135.220.2]:36274 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756960AbZEOJBS (ORCPT ); Fri, 15 May 2009 05:01:18 -0400 In-Reply-To: <1242378078-1908-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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