From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJZtp-0006Vg-TM for qemu-devel@nongnu.org; Wed, 24 Jun 2009 17:20:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJZtl-0006Rp-5a for qemu-devel@nongnu.org; Wed, 24 Jun 2009 17:20:57 -0400 Received: from [199.232.76.173] (port=36453 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJZtk-0006Rh-Qu for qemu-devel@nongnu.org; Wed, 24 Jun 2009 17:20:52 -0400 Received: from mail2.shareable.org ([80.68.89.115]:40964) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MJZtk-0003c1-A6 for qemu-devel@nongnu.org; Wed, 24 Jun 2009 17:20:52 -0400 Date: Wed, 24 Jun 2009 22:20:41 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [PATCH 1/2] allow hypervisor CPUID bit to be overriden Message-ID: <20090624212041.GB14121@shareable.org> References: <1245707244-743-1-git-send-email-andre.przywara@amd.com> <4A40A7EC.8070100@redhat.com> <200906231231.15206.paul@codesourcery.com> <4A40BE07.5080906@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A40BE07.5080906@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Andre Przywara , aliguori@us.ibm.com, Paul Brook , kvm@vger.kernel.org, qemu-devel@nongnu.org Avi Kivity wrote: > On 06/23/2009 02:31 PM, Paul Brook wrote: > >On Tuesday 23 June 2009, Avi Kivity wrote: > > > >>On 06/23/2009 12:47 AM, Andre Przywara wrote: > >> > >>>KVM defaults to the hypervisor CPUID bit to be set, whereas pure QEMU > >>>clears it. On some occasions one want to set or clear it the other way > >>>round (for instance to get HyperV running inside a guest). > >>>Allow the default to be overridden on the command line and fix some > >>>whitespace damage on the way. > >>> > >>It makes sense for qemu to set the hypervisor bit unconditionally. A > >>guest running under qemu is not bare metal. > >> > > > >I see no reason why a guest has to be told that it's running inside a VM. > >In principle an appropriately configured qemu should be indistinguishable > >from > >real hardware. In practice it's technically infeasible to cover absolutely > >everything, but if we set this bit we're not even trying. > > > >I have no objection to the bit being set by default for the QEMU CPU types. > > > > I agree it's pointless, but it is a Microsoft requirement for passing > their SVVP tests. Enabling it by default makes life a little easier for > users who wish to validate their hypervisor and has no drawbacks. Hold on. Do the SVVP tests fail on a real (non-virtal) machine then? Or is QEMU's machine emulation insufficiently accurate? I see a drawback in setting the bit by default. Something I expect from an emulator is that it behaves like a real machine to the extent possible. In particular, guest code which attempts to check if it's running on a real machine should get the answer "yes". Unfriendly guest code which pops up a message like "Sorry I refuse to work for you after 100 hours/ because you are attempting to run me in a virtual machine, and don't even think of trying to hide this from me now you know I look for it" should never do so. -- Jamie