Skip to content

Restrict PV features to only enabled guests

Oliver Upton kvm 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 2 repliesIn review
  2. v34 patches 4 repliesSuperseded
  3. v24 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches0 repliesSuperseded

Changes in v4 from the cover letter

- Address Wanpeng's concerns regarding cpuid lookup

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4kvm: x86: encapsulate wrmsr(MSR_KVM_SYSTEM_TIME) emulation in helper fnarch/x86/kvm/x86.c+32 -260 replies
2/4kvm: x86: set wall_clock in kvm_write_wall_clock()arch/x86/kvm/x86.c+2 -11 reply
3/4kvm: x86: only provide PV features if enabled in guest's CPUIDDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/kvm/cpuid.c +3 more+106 -51 reply
4/4Documentation: kvm: fix some typos in cpuid.rstDocumentation/virt/kvm/cpuid.rst+44 -440 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJim MattsonPeter ShierWanpeng Li
1/4R-b R-b R-b
2/4R-b R-b R-b
3/4R-b R-b R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/4] Restrict PV features to only enabled guests

To date, KVM has allowed guests to use paravirtual interfaces regardless of the configured CPUID. While almost any guest will consult the KVM_CPUID_FEATURES leaf _before_ using PV features, it is still undesirable to have such interfaces silently present.

This series aims to address the issue by adding explicit checks against the guest's CPUID when servicing any paravirtual feature. Since this effectively changes the guest/hypervisor ABI, a KVM_CAP is warranted to guard the new behavior.

Patches 1-2 refactor some of the PV code in anticipation of the change. Patch 3 introduces the checks + KVM_CAP. Finally, patch 4 fixes some doc typos that were noticed when working on this series.

v1 => v2:
- Strip Change-Id footers (checkpatch is your friend!)

v2 => v3:
- Mark kvm_write_system_time() as static

v3 => v4:
- Address Wanpeng's concerns regarding cpuid lookup

Parent commit: e792415c5d3e ("KVM: MIPS/VZ: Fix build error caused by 'kvm_run' cleanup")

Oliver Upton (4):
kvm: x86: encapsulate wrmsr(MSR_KVM_SYSTEM_TIME) emulation in helper
fn
kvm: x86: set wall_clock in kvm_write_wall_clock()
kvm: x86: only provide PV features if enabled in guest's CPUID
Documentation: kvm: fix some typos in cpuid.rst

 Documentation/virt/kvm/api.rst   |  11 +++
 Documentation/virt/kvm/cpuid.rst |  88 +++++++++++-----------
 arch/x86/include/asm/kvm_host.h  |  15 ++++
 arch/x86/kvm/cpuid.c             |   7 ++
 arch/x86/kvm/cpuid.h             |  10 +++
 arch/x86/kvm/x86.c               | 122 +++++++++++++++++++++++--------
 include/uapi/linux/kvm.h         |   1 +
 7 files changed, 181 insertions(+), 73 deletions(-)
Signature · 1 line
2.28.0.220.ged08abb693-goog