Skip to content

Introduce Notify VM exit

Chenyi Qiang kvm lkml 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest4 patches 0 repliesNew
  2. v63 patches 13 repliesSuperseded
  3. v53 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v43 patches3 repliesSuperseded

Changes in v7 from the cover letter

- Introduce a new cap KVM_CAP_TRIPLE_FAULT_EVENT to guard the extension of get/set triple fault event. (Sean)
- Add patch 3 from Sean to integrate misc kvm cap/settings. (Sean)
- Add the kvm lock around the notify_window and flag setting. (Sean)
- v6: https://lore.kernel.org/lkml/[email protected]/

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: x86: Extend KVM_{G,S}ET_VCPU_EVENTS to support pending triple faultDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/include/uapi/asm/kvm.h +2 more+36 -20 replies
2/4KVM: selftests: Add a test to get/set triple fault eventtools/testing/selftests/kvm/.gitignore tools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/x86_64/triple_fault_event_test.c+103 -00 replies
3/4KVM: x86: Introduce "struct kvm_caps" to track misc caps/settingsarch/x86/include/asm/kvm_host.h arch/x86/kvm/cpuid.c arch/x86/kvm/debugfs.c +7 more+94 -1010 replies
4/4KVM: VMX: Enable Notify VM exitDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/include/asm/vmx.h +8 more+157 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 0/4] Introduce Notify VM exit

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 attacks.

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: A selftest about get/set triple fault event.

Patch 3: Introduce struct kvm_caps to track misc global KVM cap/setting.

Patch 4: The main patch to enable Notify VM exit.

---
Change logs:
v6 -> v7
- Introduce a new cap KVM_CAP_TRIPLE_FAULT_EVENT to guard the extension of get/set triple fault event. (Sean)
- Add patch 3 from Sean to integrate misc kvm cap/settings. (Sean)
- Add the kvm lock around the notify_window and flag setting. (Sean)
- v6: https://lore.kernel.org/lkml/[email protected]/

v5 -> v6
- Do some changes in document.
- Add a selftest about get/set triple fault event. (Sean)
- extend the argument to include both the notify window and some flags when enabling KVM_CAP_X86_BUS_LOCK_EXIT CAP. (Sean)
- Change to use KVM_VCPUEVENT_VALID_TRIPE_FAULT in flags field and add pending_triple_fault field in struct kvm_vcpu_events, which allows userspace to make/clear triple fault request. (Sean)
- Add a flag in kvm_x86_ops to avoid the kvm_has_notify_vmexit global varialbe and its export.(Sean)
- v5: https://lore.kernel.org/lkml/[email protected]/

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/[email protected]/

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/[email protected]/

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/[email protected]/

v1 -> v2
- Default set notify window to 0, less than 0 to disable.
- Add more description in commit message.
---

Chenyi Qiang (2):
KVM: x86: Extend KVM_{G,S}ET_VCPU_EVENTS to support pending triple
fault
KVM: selftests: Add a test to get/set triple fault event

Sean Christopherson (1):
KVM: x86: Introduce "struct kvm_caps" to track misc caps/settings

Tao Xu (1):
KVM: VMX: Enable Notify VM exit

 Documentation/virt/kvm/api.rst                |  57 +++++++
 arch/x86/include/asm/kvm_host.h               |  24 ++-
 arch/x86/include/asm/vmx.h                    |   7 +
 arch/x86/include/asm/vmxfeatures.h            |   1 +
 arch/x86/include/uapi/asm/kvm.h               |   6 +-
 arch/x86/include/uapi/asm/vmx.h               |   4 +-
 arch/x86/kvm/cpuid.c                          |   8 +-
 arch/x86/kvm/debugfs.c                        |   4 +-
 arch/x86/kvm/lapic.c                          |   2 +-
 arch/x86/kvm/svm/nested.c                     |   4 +-
 arch/x86/kvm/svm/svm.c                        |  13 +-
 arch/x86/kvm/vmx/capabilities.h               |   6 +
 arch/x86/kvm/vmx/nested.c                     |  12 +-
 arch/x86/kvm/vmx/vmx.c                        |  62 ++++++--
 arch/x86/kvm/x86.c                            | 140 +++++++++++-------
 arch/x86/kvm/x86.h                            |  33 ++++-
 include/uapi/linux/kvm.h                      |  11 ++
 tools/testing/selftests/kvm/.gitignore        |   1 +
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../kvm/x86_64/triple_fault_event_test.c      | 101 +++++++++++++
 20 files changed, 390 insertions(+), 107 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/triple_fault_event_test.c
Signature · 1 line
2.17.1