From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: x86 emulator: reject SYSENTER in compatibility mode on AMD guests Date: Wed, 01 Feb 2012 13:03:43 +0200 Message-ID: <4F291C0F.7050803@redhat.com> References: <1328092020-18511-1-git-send-email-avi@redhat.com> <4F2917D5.2040203@tu-ilmenau.de> <4F291902.60808@redhat.com> <4F291B1A.4090009@tu-ilmenau.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Marcelo Tosatti , kvm@vger.kernel.org To: stephan.baerwolf@tu-ilmenau.de Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9999 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753845Ab2BALDs (ORCPT ); Wed, 1 Feb 2012 06:03:48 -0500 In-Reply-To: <4F291B1A.4090009@tu-ilmenau.de> Sender: kvm-owner@vger.kernel.org List-ID: On 02/01/2012 12:59 PM, Stephan B=C3=A4rwolf wrote: > On 02/01/12 11:50, Avi Kivity wrote: > > On 02/01/2012 12:45 PM, Stephan B=C3=A4rwolf wrote: > >> On 02/01/12 11:27, Avi Kivity wrote: > >>> =20 > >>> +static bool vendor_intel(struct x86_emulate_ctxt *ctxt) > >>> +{ > >>> + u32 eax, ebx, ecx, edx; > >> Just to be clean: > >> > >> Shouldn't eax and ecx be initialized to zero? > > Either get_cpuid() initializes them and returns true, or it returns > > false and we never evaluate them. > This isn't what I mean. > > CPUID will only return back the VENDOR (in ebx..edx) if you call it > with eax=3D0x00000000 and ecx=3D0x00000000 (see cpu docs). > > Of course the compiler should set these two vars to zero (?) > But what if somebody wants to read this code sometime later ?? > (The compiler will optimize the "set to zero" away...) > Ah, right of course. Will update. --=20 error compiling committee.c: too many arguments to function