public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/5] selftests: kvm: s390: Add ucontrol memory selftests
@ 2024-11-07 14:10 Christoph Schlameuss
  2024-11-07 14:10 ` [PATCH v7 1/5] selftests: kvm: s390: Add uc_map_unmap VM test case Christoph Schlameuss
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Christoph Schlameuss @ 2024-11-07 14:10 UTC (permalink / raw)
  To: kvm
  Cc: linux-s390, linux-kselftest, Paolo Bonzini, Shuah Khan,
	Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
	David Hildenbrand, schlameuss

This patch series adds a some not yet picked selftests to the kvm s390x
selftest suite.

The additional test cases are covering:
* Assert KVM_EXIT_S390_UCONTROL exit on not mapped memory access
* Assert functionality of storage keys in ucontrol VM
* Assert that memory region operations are rejected for ucontrol VMs

Running the test cases requires sys_admin capabilities to start the
ucontrol VM.
This can be achieved by running as root or with a command like:

    sudo setpriv --reuid nobody --inh-caps -all,+sys_admin \
      --ambient-caps -all,+sys_admin --bounding-set -all,+sys_admin \
      ./ucontrol_test

---

The patches in this series have been part of the previous patch series.
The test cases added here do depend on the fixture added in the earlier
patches.
From v5 PATCH 7-9 the segment and page table generation has been removed
and DAT
has been disabled. Since DAT is not necessary to validate the KVM code.

https://lore.kernel.org/kvm/20240807154512.316936-1-schlameuss@linux.ibm.com/

v7:
- skip uc_skey test when execution is in vsie

v6:
- add instruction intercept handling for skey specific instructions
  (iske, sske, rrbe) in addition to kss intercept to work properly on
  all machines
- reorder local variables
- fixup some method comments
- add a patch correcting the IP.b value length a debug message

v5:
- rebased to current upstream master
- corrected assertion on 0x00 to 0
- reworded fixup commit so that it can be merged on top of current
  upstream

v4:
- fix whitespaces in pointer function arguments (thanks Claudio)
- fix whitespaces in comments (thanks Janosch)

v3:
- fix skey assertion (thanks Claudio)
- introduce a wrapper around UCAS map and unmap ioctls to improve
  readability (Claudio)
- add an displacement to accessed memory to assert translation
  intercepts actually point to segments to the uc_map_unmap test
- add an misaligned failing mapping try to the uc_map_unmap test

v2:
- Reenable KSS intercept and handle it within skey test.
- Modify the checked register between storing (sske) and reading (iske)
  it within the test program to make sure the.
- Add an additional state assertion in the end of uc_skey
- Fix some typos and white spaces.

v1:
- Remove segment and page table generation and disable DAT. This is not
  necessary to validate the KVM code.

Christoph Schlameuss (5):
  selftests: kvm: s390: Add uc_map_unmap VM test case
  selftests: kvm: s390: Add uc_skey VM test case
  selftests: kvm: s390: Verify reject memory region operations for
    ucontrol VMs
  selftests: kvm: s390: Fix whitespace confusion in ucontrol test
  selftests: kvm: s390: correct IP.b length in uc_handle_sieic debug
    output

 .../selftests/kvm/include/s390x/processor.h   |   6 +
 .../selftests/kvm/s390x/ucontrol_test.c       | 321 +++++++++++++++++-
 2 files changed, 319 insertions(+), 8 deletions(-)

-- 
2.47.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-11-11 10:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 14:10 [PATCH v7 0/5] selftests: kvm: s390: Add ucontrol memory selftests Christoph Schlameuss
2024-11-07 14:10 ` [PATCH v7 1/5] selftests: kvm: s390: Add uc_map_unmap VM test case Christoph Schlameuss
2024-11-07 14:10 ` [PATCH v7 2/5] selftests: kvm: s390: Add uc_skey " Christoph Schlameuss
2024-11-08  9:16   ` Christoph Schlameuss
2024-11-11 10:15     ` Janosch Frank
2024-11-07 14:10 ` [PATCH v7 3/5] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs Christoph Schlameuss
2024-11-07 14:10 ` [PATCH v7 4/5] selftests: kvm: s390: Fix whitespace confusion in ucontrol test Christoph Schlameuss
2024-11-07 14:10 ` [PATCH v7 5/5] selftests: kvm: s390: correct IP.b length in uc_handle_sieic debug output Christoph Schlameuss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox