Re: [PATCH v2 1/2] x86/traps: Initialize DR6 by writing its architectural reset value
From: Maciej W. Rozycki
Date: Thu Jun 19 2025 - 01:16:42 EST
On Tue, 17 Jun 2025, Sean Christopherson wrote:
> Yeah, the name is weird, but IMO DR6_INIT or DR6_RESET aren't great either. I'm
> admittedly very biased, but I think KVM's DR6_ACTIVE_LOW better captures the
> behavior of the bits. E.g. even if bits that are currently reserved become defined
> in the future, they'll still need to be active low so as to be backwards compatible
> with existing software.
FWIW I'd call this macro DR6_DEFAULT, to keep it simple and explicitly
express our intent here (we want to set our default after all).
I think reusing DR6_ACTIVE_LOW could be risky, regardless of its KVM use,
because there's no guarantee the semantics of a future architectural
addition will match the name, i.e. the value of 0 may actually *disable*
what we currently have always enabled and while technically this could
count as "feature active", this double-negation might just make one's head
spin unnecessarily. Plus we may actually want to have that stuff disabled
by default then.
Maciej