]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
x86emul: move ARPL #UD check
authorJan Beulich <jbeulich@suse.com>
Mon, 30 Sep 2019 13:45:16 +0000 (15:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 30 Sep 2019 13:45:16 +0000 (15:45 +0200)
The #UD for being outside of protected mode gets raised for ARPL only
after having read the memory operand - correct this by moving up the
respective construct.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index f80beec502d0c2371d019913018f7e70189bc403..22c29b8280b4b51c83f8a0c8bf88b04cdbf96ab1 100644 (file)
@@ -4061,6 +4061,8 @@ x86_emulate(
             /* arpl */
             unsigned int src_rpl = dst.val & 3;
 
+            generate_exception_if(!in_protmode(ctxt, ops), EXC_UD);
+
             dst = ea;
             dst.bytes = 2;
             if ( dst.type == OP_REG )
@@ -4078,7 +4080,6 @@ x86_emulate(
                 _regs.eflags &= ~X86_EFLAGS_ZF;
                 dst.type = OP_NONE;
             }
-            generate_exception_if(!in_protmode(ctxt, ops), EXC_UD);
         }
         break;