Re: Re: [PATCH v2 2/6] KVM: x86: Prioritize DR7.GD #DB over #GP due to illegal DR6/7 value

From: Christian Ludloff

Date: Fri Jun 05 2026 - 15:47:06 EST


> [DR7.GD gets cleared]

Another crucial tidbit: the clearing happens at the
beginning of the #DB delivery attempt. So even if
something goes wrong during that attempt, you'll
end up in some other handler... with GD=0.

See https://www.sandpile.org/x86/debug.htm for
a 22 year old writeup, which – thanks to a bunch
of poking by Andy – finally got published. Back in
the old days, #DB implementations... well, let me
put it this way... they left a lot to be desired.

--
C.