Skip to content

KVM: x86: allow compiling out SMM support

Paolo Bonzini kvm lkml oe-kbuild-all 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 1 replyIn review
  2. v28 patches 11 repliesSuperseded
  3. v11 patch 7 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10KVM: x86: start moving SMM-related functions to new filesarch/x86/include/asm/kvm_host.h arch/x86/kvm/Makefile arch/x86/kvm/emulate.c +11 more+132 -1100 replies
2/10KVM: x86: move SMM entry to a new filearch/x86/include/asm/kvm_host.h arch/x86/kvm/smm.c arch/x86/kvm/smm.h +1 more+239 -2370 replies
3/10KVM: x86: move SMM exit to a new filearch/x86/kvm/emulate.c arch/x86/kvm/kvm_emulate.h arch/x86/kvm/smm.c +2 more+351 -3700 replies
4/10KVM: x86: do not go through ctxt->ops when emulating rsmarch/x86/kvm/kvm_emulate.h arch/x86/kvm/smm.c arch/x86/kvm/x86.c+81 -1421 reply
5/10KVM: allow compiling out SMM supportarch/x86/kvm/Kconfig arch/x86/kvm/Makefile arch/x86/kvm/smm.h +4 more+50 -30 replies
6/10KVM: x86: compile out vendor-specific code if SMM is disabledarch/x86/include/asm/kvm-x86-ops.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/smm.h +4 more+18 -10 replies
7/10KVM: x86: remove SMRAM address space if SMM is not supportedarch/x86/include/asm/kvm_host.h+8 -50 replies
8/10KVM: x86: do not define KVM_REQ_SMI if SMM disabledarch/x86/include/asm/kvm_host.h arch/x86/kvm/smm.h arch/x86/kvm/x86.c+8 -10 replies
9/10KVM: zero output of KVM_GET_VCPU_EVENTS before filling in the structarch/x86/kvm/x86.c+4 -90 replies
10/10KVM: x86: do not define SMM-related constants if SMM disabledarch/x86/include/asm/kvm_host.h arch/x86/kvm/smm.c arch/x86/kvm/x86.c+7 -30 replies

Reviews trailers per patch

8 of 10 patches have a Reviewed-by or Acked-by.

PatchMaxim Levitsky
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/10] KVM: x86: allow compiling out SMM support

Some users of KVM implement the UEFI variable store through a paravirtual device that does not require the "SMM lockbox" component of edk2; allow them to compile out system management mode, which is not a full implementation especially in how it interacts with nested virtualization.

In order to limit the number and especially the size of the #ifdefs, the first 4 patches move most SMM code to a completely new file in arch/x86/kvm. Patch 5 is the main change to introduce the Kconfig symbol and key smm.c's compilation off it; patches 6-10 instead eliminate other bits of SMM code that remain outside smm.c.

Paolo

v2->v3: remove kvm_smm_changed stub as well as more code in KVM_GET_VCPU_EVENTS
leave kvm_apic_init_sipi_allowed inline
change placement Kconfig to generate the right menu hierarchy

Paolo Bonzini (9):
KVM: x86: start moving SMM-related functions to new files
KVM: x86: move SMM entry to a new file
KVM: x86: move SMM exit to a new file
KVM: x86: do not go through ctxt->ops when emulating rsm
KVM: allow compiling out SMM support
KVM: x86: compile out vendor-specific code if SMM is disabled
KVM: x86: remove SMRAM address space if SMM is not supported
KVM: x86: do not define KVM_REQ_SMI if SMM disabled
KVM: zero output of KVM_GET_VCPU_EVENTS before filling in the struct

Sean Christopherson (1):
KVM: x86: do not define SMM-related constants if SMM disabled

 arch/x86/include/asm/kvm-x86-ops.h            |   2 +
 arch/x86/include/asm/kvm_host.h               |  25 +-
 arch/x86/kvm/Kconfig                          |  11 +
 arch/x86/kvm/Makefile                         |   1 +
 arch/x86/kvm/emulate.c                        | 355 +----------
 arch/x86/kvm/kvm_cache_regs.h                 |   5 -
 arch/x86/kvm/kvm_emulate.h                    |  47 +-
 arch/x86/kvm/lapic.c                          |   8 +-
 arch/x86/kvm/lapic.h                          |   2 +-
 arch/x86/kvm/mmu/mmu.c                        |   1 +
 arch/x86/kvm/smm.c                            | 576 ++++++++++++++++++
 arch/x86/kvm/smm.h                            |  37 ++
 arch/x86/kvm/svm/nested.c                     |   3 +
 arch/x86/kvm/svm/svm.c                        |  11 +-
 arch/x86/kvm/vmx/nested.c                     |   1 +
 arch/x86/kvm/vmx/vmx.c                        |   7 +
 arch/x86/kvm/x86.c                            | 371 ++---------
 tools/testing/selftests/kvm/x86_64/smm_test.c |   2 +
 18 files changed, 741 insertions(+), 724 deletions(-)
 create mode 100644 arch/x86/kvm/smm.c
 create mode 100644 arch/x86/kvm/smm.h
Signature · 1 line
2.31.1