Skip to content

Execute hypercalls according to host cpu

Vishal Annapurve kvm linux-kselftest lkml 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 1 replyIn review
  2. v4 posting 2/24 patches 7 repliesSuperseded
  3. v3 posting 2/22 patches 5 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v4 posting 1/23 patches6 repliesSuperseded
v3 posting 1/24 patches7 repliesSuperseded
v28 patches24 repliesSuperseded
v15 patches11 repliesSuperseded

Changes in v5 from the cover letter

1) Incorporated suggestions from Sean -
* Rename the APIs to have "this_cpu*" prefix to better convey the intent of callers to query cpu vendor of the current cpu
* Squash patches together to cache, share cpu vendor type and replace current callers of "this_cpu*" with checking the saved host cpu vendor in a single patch.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: selftests: x86: Use "this_cpu" prefix for cpu vendor queriestools/testing/selftests/kvm/include/x86_64/processor.h tools/testing/selftests/kvm/lib/x86_64/processor.c tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c +3 more+30 -330 replies
2/3KVM: selftests: x86: Cache host CPU vendor (AMD vs. Intel)tools/testing/selftests/kvm/include/x86_64/processor.h tools/testing/selftests/kvm/lib/x86_64/processor.c tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c +3 more+21 -80 replies
3/3KVM: selftests: x86: Use host's native hypercall instruction in kvm_hypercall()tools/testing/selftests/kvm/lib/x86_64/processor.c+8 -20 replies

Reviews trailers per patch

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

PatchDavid Matlack
1/3R-b
2/3R-b
3/3R-b

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

Read the v5 thread

Cover letter [V5 PATCH 0/3] Execute hypercalls according to host cpu

Confidential VMs(CVMs) need to execute hypercall instruction as per the CPU type. Normally KVM emulates the vmcall/vmmcall instruction by patching the guest code at runtime. Such a guest memory manipulation by KVM is not allowed with CVMs and is also undesirable in general.

This series adds support of executing hypercall as per the host cpu vendor. CPU vendor is queried early during selftest setup and guest setup to be reused later.

Changes in v5:
1) Incorporated suggestions from Sean -
* Rename the APIs to have "this_cpu*" prefix to better convey the intent of callers to query cpu vendor of the current cpu
* Squash patches together to cache, share cpu vendor type and replace current callers of "this_cpu*" with checking the saved host cpu vendor in a single patch.

Changes in v4:
1) Incoporated suggestions from Sean -
* Added APIs to query host cpu type
* Shared the host cpu type with guests to avoid querying the cpu type again
* Modified kvm_hypercall to execute vmcall/vmmcall according to host cpu type.
2) Dropped the separate API for kvm_hypercall.

v4:
https://lore.kernel.org/lkml/[email protected]/

Vishal Annapurve (3):
KVM: selftests: x86: Use "this_cpu" prefix for cpu vendor queries
KVM: selftests: x86: Cache host CPU vendor (AMD vs. Intel)
KVM: selftests: x86: Use host's native hypercall instruction in
kvm_hypercall()

 .../selftests/kvm/include/x86_64/processor.h  | 28 +++++++++--
 .../selftests/kvm/lib/x86_64/processor.c      | 46 ++++++++-----------
 .../selftests/kvm/x86_64/fix_hypercall_test.c |  4 +-
 .../selftests/kvm/x86_64/mmio_warning_test.c  |  2 +-
 .../kvm/x86_64/pmu_event_filter_test.c        |  4 +-
 .../vmx_exception_with_invalid_guest_state.c  |  2 +-
 6 files changed, 51 insertions(+), 35 deletions(-)
Signature · 1 line
2.39.0.314.g84b9a713c41-goog