On Tue, Mar 16, 2010 at 11:37:35AM +0200, Avi Kivity wrote: > 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. > Yes, indeed there is cpuid for that. It looks like our decoder needs one more layer of transformation to distinguish between regular prefixes and prefixes that modifies opcode meaning. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html