From patchwork Wed Jun 17 22:11:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 30999 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 n5HMBARl022184 for ; Wed, 17 Jun 2009 22:11:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbZFQWLE (ORCPT ); Wed, 17 Jun 2009 18:11:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753345AbZFQWLD (ORCPT ); Wed, 17 Jun 2009 18:11:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43769 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752700AbZFQWLC (ORCPT ); Wed, 17 Jun 2009 18:11:02 -0400 Received: from relay1.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 mx2.suse.de (Postfix) with ESMTP id 47EDF74862 for ; Thu, 18 Jun 2009 00:11:04 +0200 (CEST) From: Alexander Graf To: kvm@vger.kernel.org Subject: [PATCH] Don't expose hypervisor bit when running nested SVM Date: Thu, 18 Jun 2009 00:11:00 +0200 Message-Id: <1245276660-11259-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hyper-V refuses to run in hypervisor mode when it finds the hypervisor bit set, because it assumes it's running as a guest. While the perfect way of not setting the hypervisor would be an option to the -cpu parameter, this is reasonable sane for now. Let's deal with the -cpu way when we get to -cpu host. Signed-off-by: Alexander Graf --- target-i386/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index 2c5af3c..7da0e24 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1513,7 +1513,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: