All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Chenyi Qiang <chenyi.qiang@intel.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH 1/2] KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit
Date: Thu, 28 Jan 2021 15:41:46 +0800	[thread overview]
Message-ID: <0de5aad4-231b-e55b-2f2d-e121954742f9@intel.com> (raw)
In-Reply-To: <b4d66085-3cf9-afaf-97d0-3df2b5eb4a3c@redhat.com>

On 1/28/2021 3:25 PM, Paolo Bonzini wrote:
> 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.

Fair enough.


  reply	other threads:[~2021-01-28  7:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  6:49 [RESEND PATCH 0/2] Add KVM support for bus lock debug exception Chenyi Qiang
2021-01-08  6:49 ` [RESEND PATCH 1/2] KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit Chenyi Qiang
2021-01-08 16:38   ` kernel test robot
2021-01-08 16:38     ` kernel test robot
2021-01-26 16:31   ` Paolo Bonzini
2021-01-27  1:48     ` Chenyi Qiang
2021-01-27  3:41     ` Xiaoyao Li
2021-01-27 10:04       ` Paolo Bonzini
2021-01-28  7:17         ` Xiaoyao Li
2021-01-28  7:25           ` Paolo Bonzini
2021-01-28  7:41             ` Xiaoyao Li [this message]
2021-01-08  6:49 ` [RESEND PATCH 2/2] KVM: X86: Expose bus lock debug exception to guest Chenyi Qiang
2021-01-08 18:16   ` kernel test robot
2021-01-08 18:16     ` kernel test robot
2021-01-26 16:33     ` Paolo Bonzini
2021-01-26 16:33       ` Paolo Bonzini
2021-01-27  0:57       ` Chenyi Qiang
2021-01-27  0:57         ` Chenyi Qiang
2021-01-27 12:31         ` Paolo Bonzini
2021-01-27 12:31           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0de5aad4-231b-e55b-2f2d-e121954742f9@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=chenyi.qiang@intel.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.