Skip to content

RFC VM introspection - EPT Views and Virtualization Exceptions

Adalbert Lazăr kvm virtualization 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest34 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34KVM: x86: export .get_vmfunc_status()arch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/vmx.c+7 -00 replies
2/34KVM: x86: export .get_eptp_switching_status()arch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/capabilities.h arch/x86/kvm/vmx/vmx.c +1 more+21 -00 replies
3/34KVM: x86: add kvm_get_ept_view()arch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h +1 more+24 -00 replies
4/34KVM: x86: mmu: reindent to avoid lines longer than 80 charsarch/x86/kvm/mmu/mmu.c+3 -10 replies
5/34KVM: x86: mmu: add EPT view parameter to kvm_mmu_get_page()arch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/paging_tmpl.h+36 -200 replies
6/34KVM: x86: mmu: add support for EPT switchingarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/vmx/vmx.c +1 more+108 -40 replies
7/34KVM: x86: mmu: increase mmu_memory_cache sizearch/x86/kvm/mmu/mmu.c+4 -20 replies
8/34KVM: x86: add .set_ept_view()arch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/vmx.c+35 -10 replies
9/34KVM: x86: add .control_ept_view()arch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+20 -10 replies
10/34KVM: x86: page track: allow page tracking for different EPT viewsarch/x86/include/asm/kvm_host.h arch/x86/include/asm/kvm_page_track.h arch/x86/kvm/kvmi.c +4 more+86 -590 replies
11/34KVM: x86: mmu: allow zapping shadow pages for specific EPT viewsarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/x86.c+7 -30 replies
12/34KVM: introspection: extend struct kvmi_features with the EPT views status supportDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +1 more+13 -30 replies
13/34KVM: introspection: add KVMI_VCPU_GET_EPT_VIEWDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +4 more+89 -00 replies
14/34KVM: introspection: add 'view' field to struct kvmi_event_archarch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c+4 -10 replies
15/34KVM: introspection: add KVMI_VCPU_SET_EPT_VIEWDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +4 more+121 -00 replies
16/34KVM: introspection: add KVMI_VCPU_CONTROL_EPT_VIEWDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +4 more+193 -00 replies
17/34KVM: introspection: extend the access rights database with EPT view infoarch/x86/include/asm/kvmi_host.h arch/x86/kvm/kvmi.c include/linux/kvmi_host.h +2 more+71 -520 replies
18/34KVM: introspection: extend KVMI_VM_SET_PAGE_ACCESS with EPT view infoDocumentation/virt/kvm/kvmi.rst include/uapi/linux/kvmi.h virt/kvm/introspection/kvmi.c+15 -70 replies
19/34KVM: introspection: clean non-default EPTs on unhookarch/x86/include/asm/kvm_host.h arch/x86/kvm/kvmi.c virt/kvm/introspection/kvmi.c+27 -10 replies
20/34KVM: x86: vmx: add support for virtualization exceptionsarch/x86/include/asm/kvm_host.h arch/x86/include/asm/vmx.h arch/x86/kvm/vmx/capabilities.h +3 more+55 -00 replies
21/34KVM: VMX: Define EPT suppress #VE bit (bit 63 in EPT leaf entries)arch/x86/include/asm/vmx.h+1 -00 replies
22/34KVM: VMX: Suppress EPT violation #VE by default (when enabled)arch/x86/include/asm/kvm_host.h arch/x86/kvm/Makefile arch/x86/kvm/mmu.h +3 more+50 -110 replies
23/34KVM: x86: mmu: fix: update present_mask in spte_read_protect()arch/x86/kvm/mmu/mmu.c+7 -10 replies
24/34KVM: vmx: trigger vm-exits for mmio sptes by default when #VE is enabledarch/x86/kvm/vmx/vmx.c+9 -10 replies
25/34KVM: x86: svm: set .clear_page()arch/x86/kvm/svm/svm.c+1 -00 replies
26/34KVM: x86: add .set_ve_info()arch/x86/include/asm/kvm_host.h arch/x86/include/asm/vmx.h arch/x86/kvm/vmx/vmx.c+43 -00 replies
27/34KVM: x86: add .disable_ve()arch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/vmx.c+11 -00 replies
28/34KVM: x86: page_track: add support for suppress #VE bitarch/x86/include/asm/kvm_page_track.h arch/x86/kvm/mmu.h arch/x86/kvm/mmu/mmu.c +1 more+48 -00 replies
29/34KVM: vmx: make use of EPTP_INDEX in vmx_handle_exit()arch/x86/kvm/vmx/vmx.c+14 -80 replies
30/34KVM: vmx: make use of EPTP_INDEX in vmx_set_ept_view()arch/x86/kvm/vmx/vmx.c+7 -00 replies
31/34KVM: introspection: add #VE host capability checkerDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +1 more+7 -30 replies
32/34KVM: introspection: add KVMI_VCPU_SET_VE_INFO/KVMI_VCPU_DISABLE_VEDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +4 more+177 -00 replies
33/34KVM: introspection: mask out non-rwx flags when reading/writing from/to the internal databasevirt/kvm/introspection/kvmi.c+25 -110 replies
34/34KVM: introspection: add KVMI_VM_SET_PAGE_SVEDocumentation/virt/kvm/kvmi.rst arch/x86/include/uapi/asm/kvmi.h arch/x86/kvm/kvmi.c +5 more+196 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH v1 00/34] VM introspection - EPT Views and Virtualization Exceptions

This patch series is based on the VM introspection patches
(https://lore.kernel.org/kvm/[email protected]/),
extending the introspection API with EPT Views and Virtualization Exceptions (#VE) support.

The purpose of this series is to get an initial feedback and to see if we are on the right track, especially because the changes made to add the EPT views are not small (even if they add support only for different access rights for now, not for different content).

One use case for these extensions is to run a guest agent, isolated in another EPT view and using Virtualization Exceptions (#VE), to reduce the number of VM-Exits caused by EPT violations.

Another case for EPT views is to single-step one vCPU on a different view (with more relaxed page access restrictions) while all the others run on a main/restricted view.

Patches 1-11 make preparatory changes for EPT views.

Patches 12-19 extend the VM introspection API with EPT-views related commands and data. The Get/Set/Control EPT view commands are added, the KVMI_VM_SET_PAGE_ACCESS command and the vCPU introspection events are extended with the EPT view.

Patches 20-30 make preparatory changes for #VE.

Patches 31-34 extend the VM introspection API with #VE related commands.

Adalbert Lazăr (2):
KVM: x86: mmu: reindent to avoid lines longer than 80 chars
KVM: introspection: mask out non-rwx flags when reading/writing
from/to the internal database

Marian Rotariu (5):
KVM: x86: export .get_vmfunc_status()
KVM: x86: export .get_eptp_switching_status()
KVM: x86: mmu: add support for EPT switching
KVM: x86: add .set_ept_view()
KVM: x86: vmx: add support for virtualization exceptions

Sean Christopherson (2):
KVM: VMX: Define EPT suppress #VE bit (bit 63 in EPT leaf entries)
KVM: VMX: Suppress EPT violation #VE by default (when enabled)

Ștefan Șicleru (25):
KVM: x86: add kvm_get_ept_view()
KVM: x86: mmu: add EPT view parameter to kvm_mmu_get_page()
KVM: x86: mmu: increase mmu_memory_cache size
KVM: x86: add .control_ept_view()
KVM: x86: page track: allow page tracking for different EPT views
KVM: x86: mmu: allow zapping shadow pages for specific EPT views
KVM: introspection: extend struct kvmi_features with the EPT views
status support
KVM: introspection: add KVMI_VCPU_GET_EPT_VIEW
KVM: introspection: add 'view' field to struct kvmi_event_arch
KVM: introspection: add KVMI_VCPU_SET_EPT_VIEW
KVM: introspection: add KVMI_VCPU_CONTROL_EPT_VIEW
KVM: introspection: extend the access rights database with EPT view
info
KVM: introspection: extend KVMI_VM_SET_PAGE_ACCESS with EPT view info
KVM: introspection: clean non-default EPTs on unhook
KVM: x86: mmu: fix: update present_mask in spte_read_protect()
KVM: vmx: trigger vm-exits for mmio sptes by default when #VE is
enabled
KVM: x86: svm: set .clear_page()
KVM: x86: add .set_ve_info()
KVM: x86: add .disable_ve()
KVM: x86: page_track: add support for suppress #VE bit
KVM: vmx: make use of EPTP_INDEX in vmx_handle_exit()
KVM: vmx: make use of EPTP_INDEX in vmx_set_ept_view()
KVM: introspection: add #VE host capability checker
KVM: introspection: add KVMI_VCPU_SET_VE_INFO/KVMI_VCPU_DISABLE_VE
KVM: introspection: add KVMI_VM_SET_PAGE_SVE

 Documentation/virt/kvm/kvmi.rst               | 227 +++++++++++-
 arch/x86/include/asm/kvm_host.h               |  27 +-
 arch/x86/include/asm/kvm_page_track.h         |   5 +-
 arch/x86/include/asm/kvmi_host.h              |   1 +
 arch/x86/include/asm/vmx.h                    |   5 +
 arch/x86/include/uapi/asm/kvmi.h              |  44 ++-
 arch/x86/kvm/Makefile                         |   2 +-
 arch/x86/kvm/kvmi.c                           |  83 ++++-
 arch/x86/kvm/mmu.h                            |  12 +-
 arch/x86/kvm/mmu/mmu.c                        | 191 +++++++---
 arch/x86/kvm/mmu/page_track.c                 |  63 ++--
 arch/x86/kvm/mmu/paging_tmpl.h                |   6 +-
 arch/x86/kvm/svm/svm.c                        |   1 +
 arch/x86/kvm/vmx/capabilities.h               |  13 +
 arch/x86/kvm/vmx/clear_page.S                 |  17 +
 arch/x86/kvm/vmx/vmx.c                        | 291 ++++++++++++++-
 arch/x86/kvm/vmx/vmx.h                        |  18 +
 arch/x86/kvm/x86.c                            |  20 +-
 drivers/gpu/drm/i915/gvt/kvmgt.c              |   8 +-
 include/linux/kvmi_host.h                     |   2 +-
 include/uapi/linux/kvmi.h                     |  12 +-
 .../testing/selftests/kvm/x86_64/kvmi_test.c  | 335 +++++++++++++++++-
 virt/kvm/introspection/kvmi.c                 | 175 ++++++---
 virt/kvm/introspection/kvmi_int.h             |  17 +-
 virt/kvm/introspection/kvmi_msg.c             | 106 ++++++
 25 files changed, 1512 insertions(+), 169 deletions(-)
 create mode 100644 arch/x86/kvm/vmx/clear_page.S

base-commit: d9da9f5842e0697564f0f3e586d858f2626e8f92
Based-on: <[email protected]>
CC: Sean Christopherson <[email protected]>