From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59507 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaEb4-0007Ph-JO for qemu-devel@nongnu.org; Tue, 04 Jan 2011 16:39:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaEb3-0001Hw-Dw for qemu-devel@nongnu.org; Tue, 04 Jan 2011 16:39:14 -0500 Received: from mailgw12.technion.ac.il ([132.68.225.12]:35870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaEb3-0001Gf-4O for qemu-devel@nongnu.org; Tue, 04 Jan 2011 16:39:13 -0500 Date: Tue, 4 Jan 2011 23:39:07 +0200 From: "Nadav Har'El" Subject: Re: [Qemu-devel] [PATCH] Add VMX cpuid feature to qemu64 Message-ID: <20110104213907.GA6364@fermat.math.technion.ac.il> References: <20110104150631.GA24238@fermat.math.technion.ac.il> <8153A341-349B-4A89-A737-DCF5187FFE23@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8153A341-349B-4A89-A737-DCF5187FFE23@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org, avi@redhat.com On Tue, Jan 04, 2011, Alexander Graf wrote about "Re: [Qemu-devel] [PATCH] Add VMX cpuid feature to qemu64": > > On 04.01.2011, at 16:06, Nadav Har'El wrote: > > > This patch adds the "VMX" cpuid feature to the default "qemu64" CPU type. > > If KVM doesn't support this feature (i.e., nested VMX is not in the code, > > or not enabled) it will mask out this bit. > > "qemu64" defines capabilities that qemu emulates. Qemu does not emulate VMX. So it doesn't belong there. I thought we had a "kvm64" type for your use case? I have to apologize for making such beginner's mistakes, because I am not very familiar with the inner workings of qemu. It seemed to me, but please correct me if I'm wrong, that when I use qemu-kvm, the default CPU type is "qemu64", not "kvm64", despite my using of KVM. In this is true, why shouldn't qemu64 indeed include all the bits that KVM may (perhaps) support? I wanted qemu-kvm to support nested VMX whenever the underlying KVM supports this, without needing to resort to special "-cpu ..." options. I'm not sure what you meant by Qemu emulating SVM as the reason why SVM (but not VMX) appears in qemu64's capabilities. As far as I understand, when you use KVM, qemu doesn't emulate any of the CPU capabilities - rather, any capability that KVM cannot support (such as nested SVM on an Intel processor) are removed from the CPUID capabilties list. Now that I think of it, perhaps I'm writing to the wrong mailing list? Is there a separate mailing list for the development of qemu-kvm, as opposed to the "general" qemu? I actually came here after being told by the KVM developers to write to the "qemu-devel" mailing list... > > Note that other relevant CPU types, such as "core2duo" already correctly > > include the VMX feature, and "qemu64" already includes the SVM feature > > "core2duo" really shouldn't include VMX as qemu simply can't emulate it. Qemu does emulate SVM, hence the bit in the "qemu64" type. Well, as you can see in target-i386/cpuid.c, at least in the qemu version I checked out from KVM's repository, the "core2duo" and "coreduo" cpu types do list the CPUID_EXT_VMX - and those are the only ones that list this feature. I don't understand why they should have this bit, and qemu64 not, or, alternatively - if none of those had the CPUID_EXT_VMX bit, how am I supposed to run qemu to allow KVM to do nested VMX? I can think of some tricks (the easiest is to use "-cpu host"), but why should these tricks be necessary when they aren't for nested SVM? And when real core2duo CPUs *do* have VMX, so if we try to accurately emulate them, we do need to support (nested) VMX? Thanks in advance, and again I apologize if I'm missing the obvious, or writing to the wrong mailing list. -- Nadav Har'El | Tuesday, Jan 4 2011, 29 Tevet 5771 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Sign above a shop selling burglar alarms: http://nadav.harel.org.il |"For the man who has everything"