Skip to content

s390: Ultravisor device

Steffen Eiden kvm linux-kselftest lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 15 repliesIn review
  2. v34 patches 9 repliesSuperseded
  3. v23 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches4 repliesSuperseded

Changes in v4 from the cover letter

* Dropped the QUI related patches, as we agreed that we do not want to expose the QUI-UVC to userspace for now.
* Kconfig option was misplaced inside the S390 TAPE group ->fixed
* Some nits fixed:
* dropped the X from S390X in the uvdevice.h guard
* fixes kernel doc style issue in uvdevice.c

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drivers/s390/char: Add Ultravisor io deviceMAINTAINERS arch/s390/include/asm/uv.h arch/s390/include/uapi/asm/uvdevice.h +3 more+350 -114 replies
2/2selftests: drivers/s390x: Add uvdevice testsMAINTAINERS tools/testing/selftests/Makefile tools/testing/selftests/drivers/.gitignore +3 more+302 -01 reply

Reviews trailers per patch

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

PatchJanosch FrankClaudio Imbrenda
1/2R-b R-b R-b
2/2A-b

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

Read the v4 thread

Cover letter [PATCH v4 0/2] s390: Ultravisor device

This series adds an Ultravisor(UV) device letting the userspace send some Ultravisor calls to the UV. Currently two calls are supported. Query Ultravisor Information (QUI) and
Receive Attestation Measurement (Attest[ation]).

The UV device is implemented as a miscdevice accepting only IOCTLs. The IOCTL cmd specifies the UV call and the IOCTL arg the request and response data depending on the UV call.
The device driver writes the UV response in the ioctl argument data.

The 'uvdevice' does no checks on the request beside faulty userspace addresses, if sizes are in a sane range before allocating in kernel space, and other tests that prevent the system from corruption. Especially, no checks are made, that will be performed by the UV anyway (E.g. 'invalid command' in case of attestation on unsupported hardware). These errors are reported back to userspace using the UV return code field.

The first patch introduces the new device as a module configured to be compiled directly into the kernel (y) similar to the s390 SCLP and CHSH miscdevice modules. The second atch introduces Kselftests which verify error paths of the ioctl.

@Greg
There is now a userspace tool "pvattest" that uses the new device:
https://github.com/ibm-s390-linux/s390-tools/tree/for-2.22

We are currently discussing some nits regarding the processing of certificates and the user interface and add the tool to s390-tools/master afterwards.
However, the interface to the kernel is fixed.
The tool (pvattest) will be in s390-tools 2.22 that accompanies linux 5.18.
You will be most interested in S390-tools/pvattest/src/uvio.{h,c} and S390-tools/pvattest/src/pvattest.c

v3->v4:
* Dropped the QUI related patches, as we agreed that we do not want to expose the QUI-UVC to userspace for now.
* Kconfig option was misplaced inside the S390 TAPE group ->fixed
* Some nits fixed:
* dropped the X from S390X in the uvdevice.h guard
* fixes kernel doc style issue in uvdevice.c

v2->v3:
The main change is that QUI is now introduced after Attestation as we might not want pick it. Also the Kselftest patch is splitted into Attestation and QUI so that they can be picked without requiring QUI support of the uvdevice.

* dropped the Kconfig dependency
* reorganized the series:
- Patch 1 now covers the introduction of the uvdevice and Attestation
- Patch 2 adds QUI to uvdevice
- Patch 3/4 add Kselftests for Attestation and QUI
* fixed some nits
* added some comments

v1->v2:
* ioctl returns -ENOIOCTLCMD in case of a invalid ioctl command
* streamlined reserved field test
* default Kconfig is y instead of m
* improved selftest documentation

Steffen Eiden (2):
drivers/s390/char: Add Ultravisor io device
selftests: drivers/s390x: Add uvdevice tests

 MAINTAINERS                                   |   3 +
 arch/s390/include/asm/uv.h                    |  23 +-
 arch/s390/include/uapi/asm/uvdevice.h         |  51 ++++
 drivers/s390/char/Kconfig                     |  10 +
 drivers/s390/char/Makefile                    |   1 +
 drivers/s390/char/uvdevice.c                  | 264 +++++++++++++++++
 tools/testing/selftests/Makefile              |   1 +
 tools/testing/selftests/drivers/.gitignore    |   1 +
 .../selftests/drivers/s390x/uvdevice/Makefile |  22 ++
 .../selftests/drivers/s390x/uvdevice/config   |   1 +
 .../drivers/s390x/uvdevice/test_uvdevice.c    | 276 ++++++++++++++++++
 11 files changed, 652 insertions(+), 1 deletion(-)
 create mode 100644 arch/s390/include/uapi/asm/uvdevice.h
 create mode 100644 drivers/s390/char/uvdevice.c
 create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/Makefile
 create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/config
 create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/test_uvdevice.c
Signature · 1 line
2.30.2