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

[xen staging] x86/pv: Fix breakpoint reporting



commit d965e2ee07c56c341d8896852550914d87ea5374
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon May 26 21:34:10 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue May 27 12:21:38 2025 +0100

    x86/pv: Fix breakpoint reporting
    
    x86_merge_dr6() is not a no-op when 0 is passed in; it will discard the
    previously latched breakpoint bits.
    
    The combination of do_debug()'s manual call to x86_merge_dr6() for external
    debuggers, and pv_inject_DB() calling pv_inject_event(), results in two
    x86_merge_dr6() calls.
    
    Feed the same pending_dbg in the second time.  This makes 
pv_inject_event()'s
    update of dr6 effectively a no-op, retaining the correct breakpoint bits.
    
    Fixes: db39fa4b27ea ("x86/pv: Fix merging of new status bits into %dr6")
    Reported-by: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Tested-by: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 559bb1d202..f9e17e0159 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1840,7 +1840,7 @@ void asmlinkage do_debug(struct cpu_user_regs *regs)
         return;
     }
 
-    pv_inject_DB(0 /* N/A, already merged */);
+    pv_inject_DB(dr6 ^ X86_DR6_DEFAULT);
 }
 
 void asmlinkage do_entry_CP(struct cpu_user_regs *regs)
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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