From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] expose host CPU features to guests: Take 3 Date: Tue, 25 Sep 2007 11:01:06 +0200 Message-ID: <46F8CE52.3080502@qumranet.com> References: <20070905174530.GA3945@karma.qumranet.com> <20070910074005.GA26869@karma.qumranet.com> <20070924174129.GA4507@karma.qumranet.com> <20070925084842.GA14221@karma.qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , andrzej zaborowski , qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org To: Dan Kenigsberg Return-path: In-Reply-To: <20070925084842.GA14221-iWbx9bcAnq+Hk9JtIoIkgNBPR1lH4CV8@public.gmane.org> 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 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)); >>> +} >>> >> I haven't really read through the rest of your code but this piece >> appears to be outside any #ifdef/#endif so it will only build on x86. >> > > I might be missing something here, but isn't not being on the > TARGET_PATH of Makefile.target enough? I don't see #ifdef TARGET_I386 > elsewhere under target-i386. I don't mind adding extra protection, I > just be happy to better understand the whats and whys. > target-i386 means the guest will run i386 instructions, but the host can be something else (say, powerpc). Nothing else uses host instructions in that directory, so no protection was necessary before. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- 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/