On Wed, Oct 17, 2018 at 3:24 PM, Christian Ehrhardt <lk@xxxxxxx> wrote: >> if (vcpu->arch.dr6 != DR6_RESERVED) >> set_debugreg(DR6_RESERVED, 6); > > I don't like this idea. It works as long as DR6_RESERVED > includes a non-reserved bit (RTM). However, someone is bound to change > that in the future. And when DR6_RESERVED does not include RTM > anymore (as its name suggests), the if(...) above will always return > false on machines without RTM support (as RTM will always be set in > vcpu->arch.dr6). I suspect that DR6_RESERVED can't be changed without breaking things, but you could always use DR6_INIT, which really shouldn't change: if (vcpu->arch.dr6 != DR6_INIT) set_debugreg(DR6_INIT, 6);