[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-cvs
Subject:    [xen master] x86/pv: Fix the determiniation of whether to inject #DB
From:       patchbot () xen ! org
Date:       2023-09-24 1:12:12
Message-ID: E1qkDfQ-0003C5-BH () xenbits ! xenproject ! org
[Download RAW message or body]

commit 95a8a2c123971fa805395222cd6e1c77f3d1826d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 12 22:31:43 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Sep 22 16:00:17 2023 +0100

    x86/pv: Fix the determiniation of whether to inject #DB
    
    We long ago fixed the emulator to not inject exceptions behind our back.
    Therefore, assert that that a PV event (including interrupts, because that
    would be buggy too) isn't pending, rather than skipping the #DB injection if
    one is.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 142bc4818c..0d9f84f458 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -1358,14 +1358,17 @@ int pv_emulate_privileged_op(struct cpu_user_regs *regs)
     switch ( rc )
     {
     case X86EMUL_OKAY:
+        ASSERT(!curr->arch.pv.trap_bounce.flags);
+
         if ( ctxt.ctxt.retire.singlestep )
             ctxt.bpmatch |= DR_STEP;
+
         if ( ctxt.bpmatch )
         {
             curr->arch.dr6 |= ctxt.bpmatch | DR_STATUS_RESERVED_ONE;
-            if ( !(curr->arch.pv.trap_bounce.flags & TBF_EXCEPTION) )
-                pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
+            pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
         }
+
         /* fall through */
     case X86EMUL_RETRY:
         return EXCRET_fault_fixed;
--
generated by git-patchbot for /home/xen/git/xen.git#master

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic