[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] x86emul: move ARPL #UD check



commit 7cc2fe0ddcc2dacbe0cbc86be1ee6b1cfac93cc6
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Sep 30 15:45:16 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 30 15:45:16 2019 +0200

    x86emul: move ARPL #UD check
    
    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c 
b/xen/arch/x86/x86_emulate/x86_emulate.c
index f80beec502..22c29b8280 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.