Re: [PATCH v2 1/2] x86/traps: Initialize DR6 by writing its architectural reset value
From: Sohil Mehta
Date: Tue Jun 17 2025 - 19:11:16 EST
On 6/17/2025 1:47 PM, Sean Christopherson wrote:
> Ah, and now I see that DR6_RESERVED is an existing #define in a uAPI header (Xin
> said there were a few, but I somehow missed them earlier). Maybe just leave that
> thing alone, but update the comment to state that it's a historical wart? And
> then put DR6_ACTIVE_LOW and other macros in arch/x86/include/asm/debugreg.h?
>
Yeah, that's unfortunate. Updating the comment seems the best we do for now.
> /*
> * DR6_ACTIVE_LOW combines fixed-1 and active-low bits.
> * We can regard all the bits in DR6_FIXED_1 as active_low bits;
> * they will never be 0 for now, but when they are defined
> * in the future it will require no code change.
> *
> * DR6_ACTIVE_LOW is also used as the init/reset value for DR6.
> */
> #define DR6_ACTIVE_LOW 0xffff0ff0
> #define DR6_VOLATILE 0x0001e80f
> #define DR6_FIXED_1 (DR6_ACTIVE_LOW & ~DR6_VOLATILE)