Liu, Eric E
2007-Dec-20 02:58 UTC
[Xen-devel] x86_emulate(): Upon LOCK prefix for MOV, should inject #UD rather than #GP?
Hi all,
The Intel SDM(2A) says that if the LOCK prefix is used with some
instructions such as "mov" and the souce operand is a memory operand,
a
#UD may be generated, but in the x86_emulate.c there are places such as
:
942 /* Lock prefix is allowed only on RMW instructions.
*/
943 generate_exception_if((d & Mov) && lock_prefix,
EXC_GP);
here we inject EXC_GP but not EXC_UD, is it a bug?
--Eric (Liu, Feng)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Keir Fraser
2007-Dec-20 09:42 UTC
Re: [Xen-devel] x86_emulate(): Upon LOCK prefix for MOV, should inject #UD rather than #GP?
Strictly speaking we don''t actually generate exceptions yet. We return X86EMUL_UNHANDLEABLE to the caller, and they will often inject #UD as a result. But yes, it really should be EXC_UD. -- Keir On 20/12/07 02:58, "Liu, Eric E" <eric.e.liu@intel.com> wrote:> Hi all, > The Intel SDM(2A) says that if the LOCK prefix is used with some > instructions such as "mov" and the souce operand is a memory operand, a > #UD may be generated, but in the x86_emulate.c there are places such as > : > 942 /* Lock prefix is allowed only on RMW instructions. > */ > 943 generate_exception_if((d & Mov) && lock_prefix, > EXC_GP); > here we inject EXC_GP but not EXC_UD, is it a bug? > > --Eric (Liu, Feng) > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel