Skip to content

Some fixes and a test for KVM_CAP_ENFORCE_PV_CPUID

Oliver Upton kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6selftests: kvm: add tsc_msrs_test binary to gitignoretools/testing/selftests/kvm/.gitignore+1 -00 replies
2/6Documentation: kvm: fix ordering of msr filter, pv documentationDocumentation/virt/kvm/api.rst+2 -20 replies
3/6kvm: x86: reads of restricted pv msrs should also result in #GParch/x86/kvm/x86.c+34 -00 replies
4/6kvm: x86: ensure pv_cpuid.features is initialized when enabling caparch/x86/kvm/cpuid.c arch/x86/kvm/cpuid.h arch/x86/kvm/x86.c+19 -70 replies
5/6kvm: x86: request masterclock update any time guest uses different msrarch/x86/kvm/x86.c+1 -11 reply
6/6selftests: kvm: test enforcement of paravirtual cpuid featurestools/testing/selftests/kvm/.gitignore tools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/include/kvm_util.h +4 more+307 -00 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchPeter ShierAaron Lewis
1/6
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b R-b

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

Read the v1 thread

Cover letter [PATCH 0/6] Some fixes and a test for KVM_CAP_ENFORCE_PV_CPUID

Patches 1-2 address some small issues with documentation and the kvm selftests, unrelated to the overall intent of this series.

Patch 3 applies the same PV MSR filtering mechanism to guest reads of KVM paravirt msrs.

Patch 4 makes enabling KVM_CAP_ENFORCE_PV_FEATURE_CPUID idempotent with regards to when userspace sets the guest's CPUID, ensuring that the cached copy of KVM_CPUID_FEATURES.EAX is always current.

Patch 5 fixes a regression introduced with KVM_CAP_ENFORCE_PV_CPUID, wherein the kvm masterclock isn't updated every time the guest uses a different system time msr than before.

Lastly, Patch 6 introduces a test for the overall paravirtual restriction mechanism, verifying that guests GP when touching MSRs they shouldn't and get -KVM_ENOSYS when using restricted kvm hypercalls. Please note that this test is dependent upon patches 1-3 of Aaron's userspace MSR test, which add support for guest handling of the IDT in KVM selftests [1].

This series (along with Aaron's aforementioned changes) applies to commit 77377064c3a9 ("KVM: ioapic: break infinite recursion on lazy EOI").

[1] http://lore.kernel.org/r/[email protected]

Oliver Upton (6):
selftests: kvm: add tsc_msrs_test binary to gitignore
Documentation: kvm: fix ordering of msr filter, pv documentation
kvm: x86: reads of restricted pv msrs should also result in #GP
kvm: x86: ensure pv_cpuid.features is initialized when enabling cap
kvm: x86: request masterclock update any time guest uses different msr
selftests: kvm: test enforcement of paravirtual cpuid features

 Documentation/virt/kvm/api.rst                |   4 +-
 arch/x86/kvm/cpuid.c                          |  23 +-
 arch/x86/kvm/cpuid.h                          |   1 +
 arch/x86/kvm/x86.c                            |  38 ++-
 tools/testing/selftests/kvm/.gitignore        |   2 +
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../testing/selftests/kvm/include/kvm_util.h  |   2 +
 .../selftests/kvm/include/x86_64/processor.h  |  12 +
 tools/testing/selftests/kvm/lib/kvm_util.c    |  28 +++
 .../selftests/kvm/lib/x86_64/processor.c      |  29 +++
 .../selftests/kvm/x86_64/kvm_pv_test.c        | 234 ++++++++++++++++++
 11 files changed, 364 insertions(+), 10 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/kvm_pv_test.c
Signature · 1 line
2.29.0.rc2.309.g374f81d7ae-goog