From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 02/28] nVMX: Add VMX and SVM to list of supported cpuid features Date: Thu, 9 Dec 2010 12:38:14 +0100 Message-ID: <20101209113814.GA21655@8bytes.org> References: <1291827596-nyh@il.ibm.com> <201012081700.oB8H0xJw008544@rice.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, gleb@redhat.com, avi@redhat.com To: Nadav Har'El Return-path: Received: from 8bytes.org ([88.198.83.132]:42015 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754521Ab0LILiQ (ORCPT ); Thu, 9 Dec 2010 06:38:16 -0500 Content-Disposition: inline In-Reply-To: <201012081700.oB8H0xJw008544@rice.haifa.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Dec 08, 2010 at 07:00:59PM +0200, Nadav Har'El wrote: > If the "nested" module option is enabled, add the "VMX" CPU feature to the > list of CPU features KVM advertises with the KVM_GET_SUPPORTED_CPUID ioctl. > > Qemu uses this ioctl, and intersects KVM's list with its own list of desired > cpu features (depending on the -cpu option given to qemu) to determine the > final list of features presented to the guest. > > Signed-off-by: Nadav Har'El > --- > arch/x86/kvm/vmx.c | 2 ++ > 1 file changed, 2 insertions(+) > > --- .before/arch/x86/kvm/vmx.c 2010-12-08 18:56:48.000000000 +0200 > +++ .after/arch/x86/kvm/vmx.c 2010-12-08 18:56:48.000000000 +0200 > @@ -4284,6 +4284,8 @@ static void vmx_cpuid_update(struct kvm_ > > static void vmx_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) > { > + if (func == 1 && nested) > + entry->ecx |= bit(X86_FEATURE_VMX); > } > > static struct kvm_x86_ops vmx_x86_ops = { This patch should be the last one in your series because VMX should be fully supported before it is reported to userspace. Joerg