Skip to content

KVM: selftests: Implement ucall "pool" (for SEV)

Sean Christopherson kvm kvm-riscv kvmarm linux-arm-kernel linux-kselftest linux-riscv lkml llvm 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 0 repliesNew
  2. v57 patches 6 repliesSuperseded
  3. v46 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches7 repliesSuperseded

Changes in v6 from the cover letter

- Collect tags. [Andrew, Peter]
- Drop an unnecessary NULL check on in_use. [Andrew]

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7KVM: selftests: Consolidate common code for populating ucall structtools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/include/ucall_common.h tools/testing/selftests/kvm/lib/aarch64/ucall.c +4 more+61 -740 replies
2/7KVM: selftests: Consolidate boilerplate code in get_ucall()tools/testing/selftests/kvm/include/ucall_common.h tools/testing/selftests/kvm/lib/aarch64/ucall.c tools/testing/selftests/kvm/lib/riscv/ucall.c +3 more+33 -590 replies
3/7KVM: selftests: Automatically do init_ucall() for non-barebones VMstools/testing/selftests/kvm/aarch64/arch_timer.c tools/testing/selftests/kvm/aarch64/debug-exceptions.c tools/testing/selftests/kvm/aarch64/hypercalls.c +16 more+20 -730 replies
4/7tools: Add atomic_test_and_set_bit()tools/arch/x86/include/asm/atomic.h tools/include/asm-generic/atomic-gcc.h+19 -00 replies
5/7KVM: selftests: Make arm64's MMIO ucall multi-VM friendlytools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/aarch64/ucall.c+29 -50 replies
6/7KVM: selftest: Drop now-unnecessary ucall_uninit()tools/testing/selftests/kvm/dirty_log_test.c tools/testing/selftests/kvm/include/ucall_common.h tools/testing/selftests/kvm/kvm_page_table_test.c +5 more+2 -330 replies
7/7KVM: selftests: Add ucall pool based implementationtools/testing/selftests/kvm/include/ucall_common.h tools/testing/selftests/kvm/lib/aarch64/ucall.c tools/testing/selftests/kvm/lib/riscv/ucall.c +3 more+77 -170 replies

Reviews trailers per patch

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

PatchAndrew JonesPeter Gonda
1/7R-b T-b
2/7R-b T-b
3/7R-b T-b
4/7
5/7R-b T-b
6/7R-b T-b
7/7R-b

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

Read the v6 thread

Cover letter [PATCH v6 0/7] KVM: selftests: Implement ucall "pool" (for SEV)

Rework the ucall infrastructure to use a pool of ucall structs to pass memory instead of using the guest's stack. For confidential VMs with encrypted memory, e.g. SEV, the guest's stack "needs" to be private memory and so can't be used to communicate with the host.

Convert all implementations to the pool as all of the complexity is hidden in common code, and supporting multiple interfaces adds its own kind of complexity.

v6:
- Collect tags. [Andrew, Peter]
- Drop an unnecessary NULL check on in_use. [Andrew]

v5:
- Use less convoluted method of writing per-VM "globals". [Oliver]
- Add patch to drop ucall_uninit().

v4: https://lore.kernel.org/all/20220824032115.3563686-1-seanjc at google.com

Peter Gonda (2):
tools: Add atomic_test_and_set_bit()
KVM: selftests: Add ucall pool based implementation

Sean Christopherson (5):
KVM: selftests: Consolidate common code for populating ucall struct
KVM: selftests: Consolidate boilerplate code in get_ucall()
KVM: selftests: Automatically do init_ucall() for non-barebones VMs
KVM: selftests: Make arm64's MMIO ucall multi-VM friendly
KVM: selftest: Drop now-unnecessary ucall_uninit()

 tools/arch/x86/include/asm/atomic.h           |   7 ++
 tools/include/asm-generic/atomic-gcc.h        |  12 ++
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../selftests/kvm/aarch64/arch_timer.c        |   1 -
 .../selftests/kvm/aarch64/debug-exceptions.c  |   1 -
 .../selftests/kvm/aarch64/hypercalls.c        |   1 -
 .../testing/selftests/kvm/aarch64/psci_test.c |   1 -
 .../testing/selftests/kvm/aarch64/vgic_init.c |   2 -
 .../testing/selftests/kvm/aarch64/vgic_irq.c  |   1 -
 tools/testing/selftests/kvm/dirty_log_test.c  |   3 -
 .../selftests/kvm/include/kvm_util_base.h     |  15 +++
 .../selftests/kvm/include/ucall_common.h      |  10 +-
 .../selftests/kvm/kvm_page_table_test.c       |   2 -
 .../testing/selftests/kvm/lib/aarch64/ucall.c | 102 +++--------------
 tools/testing/selftests/kvm/lib/kvm_util.c    |  11 ++
 .../selftests/kvm/lib/perf_test_util.c        |   3 -
 tools/testing/selftests/kvm/lib/riscv/ucall.c |  42 +------
 tools/testing/selftests/kvm/lib/s390x/ucall.c |  39 +------
 .../testing/selftests/kvm/lib/ucall_common.c  | 103 ++++++++++++++++++
 .../testing/selftests/kvm/lib/x86_64/ucall.c  |  39 +------
 .../testing/selftests/kvm/memslot_perf_test.c |   1 -
 tools/testing/selftests/kvm/rseq_test.c       |   1 -
 tools/testing/selftests/kvm/steal_time.c      |   1 -
 .../kvm/system_counter_offset_test.c          |   1 -
 24 files changed, 190 insertions(+), 210 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/lib/ucall_common.c

base-commit: e18d6152ff0f41b7f01f9817372022df04e0d354

Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog