From: Paolo Bonzini <pbonzini@redhat.com>
To: Chenyi Qiang <chenyi.qiang@intel.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Xiaoyao Li <xiaoyao.li@intel.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 0/4] Add bus lock VM exit support
Date: Mon, 25 Jan 2021 19:00:58 +0100 [thread overview]
Message-ID: <95477feb-b92d-8f26-fc59-11bbdcc8354b@redhat.com> (raw)
In-Reply-To: <20201106090315.18606-1-chenyi.qiang@intel.com>
On 06/11/20 10:03, Chenyi Qiang wrote:
> This patch series add the support for bus lock VM exit in KVM. It is a
> sub-feature of bus lock detection. When it is enabled by the VMM, the
> processor generates a "Bus Lock" VM exit following execution of an
> instruction if the processor detects that one or more bus locks were
> caused the instruction was being executed (due to either direct access
> by the instruction or stuffed accesses like through A/D updates).
>
> Bus lock VM exit will introduce a new modifier bit (bit 26) in
> exit_reason field in VMCS which indicates bus lock VM exit is preempted
> by a higher priority VM exit. The first patch is to apply Sean's
> refactor for vcpu_vmx.exit_reason as a preparation patch for bus lock
> VM exit support.
>
> The second patch is the refactor for vcpu->run->flags. Bus lock VM exit
> will introduce a new field in the flags to inform the userspace that
> there's a bus lock detected in guest. It's also a preparation patch.
>
> The third patch is the concrete enabling working for bus lock VM exit.
> Add the support to set the capability to enable bus lock VM exit. The
> current implementation is just exiting to userspace when handling the
> bus lock detected in guest.
>
> The detail of throttling policy in user space is still to be discussed.
> We may enforce ratelimit on bus lock in guest, inject some sleep time,
> or... We hope to get more ideas on this.
>
> Document for Bus Lock Detection is now available at the latest "Intel
> Architecture Instruction Set Extensions Programming Reference".
>
> Document Link:
> https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
>
> ---
>
> Changelogs
>
> v4->v5:
> - rebase on top on v5.10-rc2
> - add preparation patch that reset the vcpu->run->flags at the beginning
> of the vcpu_run.(Suggested by Sean)
> - set the KVM_RUN_BUS_LOCK for all bus lock exit to avoid checking both
> exit_reason and run->flags
> - add the document to introduce the new kvm capability
> (KVM_CAP_X86_BUS_LOCK_EXIT)
> - v4:https://lore.kernel.org/lkml/20201012033542.4696-1-chenyi.qiang@intel.com/
>
>
> v3->v4:
> - rebase on top of v5.9
> - some code cleanup.
> - v3:https://lore.kernel.org/lkml/20200910083751.26686-1-chenyi.qiang@intel.com/
>
> v2->v3:
> - use a bitmap to get/set the capability of bus lock detection. we support
> exit and off mode currently.
> - put the handle of exiting to userspace in vmx.c, thus no need to
> define a shadow to track vmx->exit_reason.bus_lock_detected.
> - remove the vcpu->stats.bus_locks since every bus lock exits to userspace.
> - v2:https://lore.kernel.org/lkml/20200817033604.5836-1-chenyi.qiang@intel.com/
>
> v1->v2:
> - resolve Vitaly's comment to introduce the KVM_EXIT_BUS_LOCK and a
> capability to enable it.
> - add the support to exit to user space when handling bus locks.
> - extend the vcpu->run->flags to indicate bus lock detected for other
> exit reasons when exiting to user space.
> - v1:https://lore.kernel.org/lkml/20200628085341.5107-1-chenyi.qiang@intel.com/
>
> ---
>
> Chenyi Qiang (3):
> KVM: X86: Reset the vcpu->run->flags at the beginning of vcpu_run
> KVM: VMX: Enable bus lock VM exit
> KVM: X86: Add the Document for KVM_CAP_X86_BUS_LOCK_EXIT
>
> Sean Christopherson (1):
> KVM: VMX: Convert vcpu_vmx.exit_reason to a union
>
> Documentation/virt/kvm/api.rst | 45 ++++++++++++-
> arch/x86/include/asm/kvm_host.h | 7 ++
> arch/x86/include/asm/vmx.h | 1 +
> arch/x86/include/asm/vmxfeatures.h | 1 +
> arch/x86/include/uapi/asm/kvm.h | 1 +
> arch/x86/include/uapi/asm/vmx.h | 4 +-
> arch/x86/kvm/vmx/capabilities.h | 6 ++
> arch/x86/kvm/vmx/nested.c | 42 +++++++-----
> arch/x86/kvm/vmx/vmx.c | 105 +++++++++++++++++++----------
> arch/x86/kvm/vmx/vmx.h | 25 ++++++-
> arch/x86/kvm/x86.c | 28 +++++++-
> include/uapi/linux/kvm.h | 5 ++
> 12 files changed, 214 insertions(+), 56 deletions(-)
>
Queued, thanks. I have replaced KVM_RUN_BUS_LOCK with
KVM_RUN_X86_BUS_LOCK, though.
Paolo
prev parent reply other threads:[~2021-01-25 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 9:03 [PATCH v5 0/4] Add bus lock VM exit support Chenyi Qiang
2020-11-06 9:03 ` [PATCH v5 1/4] KVM: VMX: Convert vcpu_vmx.exit_reason to a union Chenyi Qiang
2020-11-06 9:03 ` [PATCH v5 2/4] KVM: X86: Reset the vcpu->run->flags at the beginning of vcpu_run Chenyi Qiang
2020-11-06 9:03 ` [PATCH v5 3/4] KVM: VMX: Enable bus lock VM exit Chenyi Qiang
2020-11-06 9:03 ` [PATCH v5 4/4] KVM: X86: Add the Document for KVM_CAP_X86_BUS_LOCK_EXIT Chenyi Qiang
2021-01-25 18:00 ` Paolo Bonzini [this message]
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=95477feb-b92d-8f26-fc59-11bbdcc8354b@redhat.com \
--to=pbonzini@redhat.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=sean.j.christopherson@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=xiaoyao.li@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).