From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Brook Subject: Re: =?iso-8859-1?q?=5BQemu-devel=5D_expose_host_CPU_featu?= =?iso-8859-1?q?res=09to=09guests=3A_Take_3?= Date: Tue, 25 Sep 2007 13:51:54 +0100 Message-ID: <200709251351.55481.paul@codesourcery.com> References: <20070905174530.GA3945@karma.qumranet.com> <1190711970.30193.15.camel@rapid> <46F8D577.3020306@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , "J. Mayer" , Avi Kivity To: qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org Return-path: In-Reply-To: <46F8D577.3020306-atKUWr5tajBWk0Htik3J/w@public.gmane.org> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Tuesday 25 September 2007, Avi Kivity wrote: > J. Mayer wrote: > > On Tue, 2007-09-25 at 11:01 +0200, Avi Kivity wrote: > >> Dan Kenigsberg wrote: > >>> On Tue, Sep 25, 2007 at 03:28:24AM +0200, andrzej zaborowski wrote: > >>>> Hi, > >>>> > >>>> On 24/09/2007, Dan Kenigsberg wrote: > >>>>> As with previous "Takes" of this patch, its purpose is to expose host > >>>>> +{ > >>>>> + asm("cpuid" > >>>>> + : "=a" (*ax), > >>>>> + "=b" (*bx), > >>>>> + "=c" (*cx), > >>>>> + "=d" (*dx) > >>>>> + : "a" (function)); > >>>>> +} > >>>> > Indeed for regular qemu this is useless. But it is useful for kqemu > (for which there is support in mainline qemu), and for kvm (which we > hope to merge one day). And, as discussed before, it should be asking the hypervisor what features it supports instead of trying to guess from the cpuid output. Paul ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ia9tW-0004Xe-HV for qemu-devel@nongnu.org; Tue, 25 Sep 2007 08:52:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ia9tS-0004W8-Vx for qemu-devel@nongnu.org; Tue, 25 Sep 2007 08:52:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ia9tR-0004Vr-8w for qemu-devel@nongnu.org; Tue, 25 Sep 2007 08:52:01 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ia9tQ-00011W-Nh for qemu-devel@nongnu.org; Tue, 25 Sep 2007 08:52:01 -0400 From: Paul Brook Subject: Re: [kvm-devel] [Qemu-devel] expose host CPU =?iso-8859-1?q?features=09to=09guests=3A_Take?= 3 Date: Tue, 25 Sep 2007 13:51:54 +0100 References: <20070905174530.GA3945@karma.qumranet.com> <1190711970.30193.15.camel@rapid> <46F8D577.3020306@qumranet.com> In-Reply-To: <46F8D577.3020306@qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709251351.55481.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel , "J. Mayer" On Tuesday 25 September 2007, Avi Kivity wrote: > J. Mayer wrote: > > On Tue, 2007-09-25 at 11:01 +0200, Avi Kivity wrote: > >> Dan Kenigsberg wrote: > >>> On Tue, Sep 25, 2007 at 03:28:24AM +0200, andrzej zaborowski wrote: > >>>> Hi, > >>>> > >>>> On 24/09/2007, Dan Kenigsberg wrote: > >>>>> As with previous "Takes" of this patch, its purpose is to expose host > >>>>> +{ > >>>>> + asm("cpuid" > >>>>> + : "=a" (*ax), > >>>>> + "=b" (*bx), > >>>>> + "=c" (*cx), > >>>>> + "=d" (*dx) > >>>>> + : "a" (function)); > >>>>> +} > >>>> > Indeed for regular qemu this is useless. But it is useful for kqemu > (for which there is support in mainline qemu), and for kvm (which we > hope to merge one day). And, as discussed before, it should be asking the hypervisor what features it supports instead of trying to guess from the cpuid output. Paul