[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4d66085-3cf9-afaf-97d0-3df2b5eb4a3c@redhat.com>
Date: Thu, 28 Jan 2021 08:25:16 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Xiaoyao Li <xiaoyao.li@...el.com>,
Chenyi Qiang <chenyi.qiang@...el.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH 1/2] KVM: X86: Add support for the emulation of
DR6_BUS_LOCK bit
On 28/01/21 08:17, Xiaoyao Li wrote:
>>
>> "Active low" means that the bit is usually 1 and goes to 0 when the
>> condition (such as RTM or bus lock) happens. For almost all those DR6
>> bits the value is in fact always 1, but if they are defined in the
>> future it will require no code change.
>
> Why not keep use DR6_INIT, or DR6_RESET_VALUE? or any other better name.
>
> It's just the default clear value of DR6 that no debug condition is hit.
I preferred "DR6_ACTIVE_LOW" because the value is used only once or
twice to initialize dr6, and many times to invert those bits. For example:
vcpu->arch.dr6 &= ~DR_TRAP_BITS;
vcpu->arch.dr6 |= DR6_ACTIVE_LOW;
vcpu->arch.dr6 |= payload;
vcpu->arch.dr6 ^= payload & DR6_ACTIVE_LOW;
payload = vcpu->arch.dr6;
payload &= ~DR6_BT;
payload ^= DR6_ACTIVE_LOW;
The name conveys that it's not just the initialization value; it's also
the XOR mask between the #DB exit qualification (which we also use as
the "payload") and DR6.
Paolo
Powered by blists - more mailing lists