From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v3 16/30] KVM: x86 emulator: If LOCK prefix is used dest arg should be memory. Date: Tue, 16 Mar 2010 11:37:35 +0200 Message-ID: <4B9F515F.2050406@redhat.com> References: <1268663937-27784-1-git-send-email-gleb@redhat.com> <1268663937-27784-17-git-send-email-gleb@redhat.com> <4B9E564C.4060306@amd.com> <20100315181024.GD5406@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andre Przywara , mtosatti@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966047Ab0CPJhj (ORCPT ); Tue, 16 Mar 2010 05:37:39 -0400 In-Reply-To: <20100315181024.GD5406@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/15/2010 08:10 PM, Gleb Natapov wrote: > On Mon, Mar 15, 2010 at 04:46:20PM +0100, Andre Przywara wrote: > >> Gleb Natapov wrote: >> >>> If LOCK prefix is used dest arg should be memory, otherwise instruction >>> should generate #UD. >>> >> Well, there is one exception: >> There is an AMD specific "lock mov cr0 = mov cr8" equivalence, where >> there is no memory involved (and we intercept this). I am not sure >> if anyone actually uses this code sequence, but it is definitely >> legal. >> >> > Even without this patch "lock mov cr0" will cause #UD to be injected by > emulator since mov does not have Lock in opcode table. Also it look like > Intel does not support this extension so no portable program can use > it. > > A portable program can check for this instruction in cpuid and only issue it if it is supported. -- error compiling committee.c: too many arguments to function