From patchwork Fri May 15 09:01:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 24022 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4F91OQP023190 for ; Fri, 15 May 2009 09:01:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757095AbZEOJBU (ORCPT ); Fri, 15 May 2009 05:01:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757423AbZEOJBT (ORCPT ); Fri, 15 May 2009 05:01:19 -0400 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 Received: from relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 4F76D8E8CC; Fri, 15 May 2009 11:01:19 +0200 (CEST) From: Alexander Graf 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 Message-Id: <1242378078-1908-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1242378078-1908-1-git-send-email-agraf@suse.de> References: <1242378078-1908-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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: