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

[xen stable-4.20] x86/pv: Fix breakpoint reporting



commit 60f61371906ed00d86577da686760d9009e969df
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Jun 26 08:36:08 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 26 08:36:08 2025 +0200

    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>
    master commit: d965e2ee07c56c341d8896852550914d87ea5374
    master date: 2025-05-27 12:21:38 +0100
---
 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 dca11a613d..9eb7bd2e07 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2040,7 +2040,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#stable-4.20



 


Rackspace

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