On 26/05/2025 9:13 pm, Manuel Bouyer wrote: > On Mon, May 26, 2025 at 07:50:14PM +0100, Andrew Cooper wrote: >> [...] >> Well, that range does include the aforementioned commit. >> >> Can you bisect around d32c77f471fb8400b6512c171a14cdd58f04f0a3 which is >> the backport of ^ in 4.18 ? > Sure, > with 0d5f15e and d32c77f the test pass, with cecee35 it fails. >
Oh interesting, so the basic forwarding of #DB back into a guest (d32c77f) works fine, but the changes to emulated debug exceptions (cecee35) break. Anyway, I think I've spotted a logical error. We do indeed end up calling x86_merge_dr6() twice, because of the TODO just out of context. Does this help? ~Andrew diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 6d75b59b1e97..01b8be02b055 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1798,7 +1798,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)