Re: [PATCH v6 01/12] KVM: x86: Preserve DR6.BLD (Bus Lock Detect) when delivering #DB payload
From: Shivansh Dhiman
Date: Wed Sep 30 2026 - 19:47:13 EST
On 01-10-26 01:06, Sean Christopherson wrote:
> Preserve Bus Lock Detect if it isn't present in the payload. Unlike RTM,
> which is explicitly modified on every #DB, DR6.BLD is modified if and only
> if the #DB is due to a (coincident) Bus Lock Detect.
>
> Per Intel's SDM:
>
> Other debug exceptions do not modify this bit.
>
> And AMD's APM
>
> All other #DB exceptions leave DR6[BLD] unmodified,
>
> Restore the explicit RTM handling that was clobbered by commit
> 9a3ecd5e2aa1 ("KVM: X86: Rename DR6_INIT to DR6_ACTIVE_LOW"), as the
> semantics of any given bit are feature specific, i.e. are obviously not
> consistent for active-high versus active-low. In other words, while the
> bug was technically introduced when support for Bus Lock Detect was added,
> it's really that attempt to genericize handling of active-low bits that set
> KVM up to fail.
>
> Fixes: e8ea85fb280e ("KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Tested on Turin with Bus Lock Detect enabled in both L1 and L2 guests. The
expected bus lock warnings show up in dmesg. Also, all the KUT tests pass
with Sean's KUT patches applied.
Tested-by: Shivansh Dhiman <shivansh.dhiman@xxxxxxx>