On 26/05/2025 7:06 pm, Andrew Cooper wrote: > On 26/05/2025 6:59 pm, Manuel Bouyer wrote: >> Hello, >> since I updated to Xen 4.18.5 (from 4.18.4), NetBSD's dbregs-related tests >> are failing. Only for PV; PVH and HVM guests are fine. They are >> failing for both 32bits and 64bits guests. >> >> I tracked it down to dr6 being 0xffff0ff0 after the trace trap, when at >> last one of the lower bits should be 1 (I think it's bit 0, from the code). >> >> I looked at the commit log between 4.18.4 and 4.18.5 but didn't see >> anything obvious. >> >> Any idea ? >> > Have you got a link to the test in question? > > We've had a couple of bugfixes in this area, although debug handling > isn't helped by the fact that both the SDM and APM are factually > incorrect on how to write a #DB handler (and the vendors are moving at a > glacial pace to correct them).
But yes, having looked between 4.18.4 and 4.18.5, I can't see anything relevant to debug handling either. Judging from your description, it looks like a breakpoint is going missing. The relevant recent change for that is https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=54ef601a66e8d812a6a6a308f02524e81201825e although it's a bit older than 4.18.4. I suppose it's possible that we call x86_merge_dr6() more than once when forwarding #DB to the guest, which might lose the breakpoint bits? ~Andrew