From: Chenyi Qiang <chenyi.qiang@intel.com>
To: Paolo Bonzini <pbonzini@redhat.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>,
Xiaoyao Li <xiaoyao.li@intel.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v5 0/3] Introduce Notify VM exit
Date: Fri, 18 Mar 2022 15:49:52 +0800 [thread overview]
Message-ID: <20220318074955.22428-1-chenyi.qiang@intel.com> (raw)
Virtual machines can exploit Intel ISA characterstics to cause
functional denial of service to the VMM. This series introduces a new
feature named Notify VM exit, which can help mitigate such kind of
attack.
Patch 1: An extension of KVM_SET_VCPU_EVENTS ioctl to inject a
synthesized shutdown event from user space. This is also a fix for other
synthesized triple fault, e.g. the RSM patch or nested_vmx_abort(),
which could get lost when exit to userspace to do migrate.
Patch 2: The main patch to enable Notify VM exit.
Patch 3: Add document for the new KVM capability and KVM exit reason.
---
Change logs:
v4 -> v5
- rename KVM_VCPUEVENTS_SHUTDOWN to KVM_VCPUEVENTS_TRIPLE_FAULT. Make it
bidirection and add it to get_vcpu_events. (Sean)
- v4: https://lore.kernel.org/all/20220310084001.10235-1-chenyi.qiang@intel.com/
v3 -> v4
- Change this feature to per-VM scope. (Jim)
- Once VM_CONTEXT_INVALID set in exit_qualification, exit to user space
notify this fatal case, especially the notify VM exit happens in L2.
(Jim)
- extend KVM_SET_VCPU_EVENTS to allow user space to inject a shutdown
event. (Jim)
- A minor code changes.
- Add document for the new KVM capability.
- v3: https://lore.kernel.org/lkml/20220223062412.22334-1-chenyi.qiang@intel.com/
v2 -> v3
- add a vcpu state notify_window_exits to record the number of
occurence as well as a pr_warn output. (Sean)
- Add the handling in nested VM to prevent L1 bypassing the restriction
through launching a L2. (Sean)
- Only kill L2 when L2 VM is context invalid, synthesize a
EXIT_REASON_TRIPLE_FAULT to L1 (Sean)
- To ease the current implementation, make module parameter
notify_window read-only. (Sean)
- Disable notify window exit by default.
- v2: https://lore.kernel.org/lkml/20210525051204.1480610-1-tao3.xu@intel.com/
v1 -> v2
- Default set notify window to 0, less than 0 to disable.
- Add more description in commit message.
---
Chenyi Qiang (2):
KVM: X86: Save&restore the triple fault request
KVM: Add document for KVM_CAP_X86_NOTIFY_VMEXIT and KVM_EXIT_NOTIFY
Tao Xu (1):
KVM: VMX: Enable Notify VM exit
Documentation/virt/kvm/api.rst | 45 ++++++++++++++++++++++++++++++
arch/x86/include/asm/kvm_host.h | 5 ++++
arch/x86/include/asm/vmx.h | 7 +++++
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 | 17 ++++++++++-
arch/x86/kvm/vmx/vmx.c | 44 +++++++++++++++++++++++++++--
arch/x86/kvm/x86.c | 28 +++++++++++++++++--
arch/x86/kvm/x86.h | 5 ++++
include/uapi/linux/kvm.h | 7 +++++
12 files changed, 162 insertions(+), 8 deletions(-)
--
2.17.1
next reply other threads:[~2022-03-18 7:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 7:49 Chenyi Qiang [this message]
2022-03-18 7:49 ` [PATCH v5 1/3] KVM: X86: Save&restore the triple fault request Chenyi Qiang
2022-04-05 23:31 ` Sean Christopherson
2022-04-05 23:44 ` Sean Christopherson
2022-04-06 21:15 ` Sean Christopherson
2022-04-07 6:12 ` Chenyi Qiang
2022-04-08 2:48 ` Sean Christopherson
2022-04-06 21:25 ` Sean Christopherson
2022-04-06 6:46 ` Chenyi Qiang
2022-04-06 21:51 ` Sean Christopherson
2022-03-18 7:49 ` [PATCH v5 2/3] KVM: VMX: Enable Notify VM exit Chenyi Qiang
2022-04-06 0:34 ` Sean Christopherson
2022-04-06 18:54 ` Sean Christopherson
2022-03-18 7:49 ` [PATCH v5 3/3] KVM: Add document for KVM_CAP_X86_NOTIFY_VMEXIT and KVM_EXIT_NOTIFY Chenyi Qiang
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=20220318074955.22428-1-chenyi.qiang@intel.com \
--to=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 \
--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