Re: [PATCH v2 0/2] x86/traps: Fix DR6/DR7 initialization
From: Sohil Mehta
Date: Tue Jun 17 2025 - 13:55:39 EST
On 6/17/2025 12:32 AM, Xin Li (Intel) wrote:
> Sohil reported seeing a split lock warning when running a test that
> generates userspace #DB:
>
> x86/split lock detection: #DB: sigtrap_loop_64/4614 took a bus_lock trap at address: 0x4011ae
>
The following patches fix the issue for me.
Tested-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
>
> Xin Li (Intel) (2):
> x86/traps: Initialize DR6 by writing its architectural reset value
> x86/traps: Initialize DR7 by writing its architectural reset value
>
> arch/x86/include/asm/debugreg.h | 14 ++++++++----
> arch/x86/include/asm/kvm_host.h | 2 +-
> arch/x86/include/uapi/asm/debugreg.h | 7 +++++-
> arch/x86/kernel/cpu/common.c | 17 ++++++--------
> arch/x86/kernel/kgdb.c | 2 +-
> arch/x86/kernel/process_32.c | 2 +-
> arch/x86/kernel/process_64.c | 2 +-
> arch/x86/kernel/traps.c | 34 +++++++++++++++++-----------
> arch/x86/kvm/x86.c | 4 ++--
> 9 files changed, 50 insertions(+), 34 deletions(-)
>
>
> base-commit: 594902c986e269660302f09df9ec4bf1cf017b77