Skip to content

Add character devices for indices, platform-dump and physical-attestation RTAS

Haren Myneni linuxppc-dev 10 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest7 patches 0 repliesNew
  2. v97 patches 1 replySuperseded
  3. v87 patches 3 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v77 patches0 repliesSuperseded
v67 patches0 repliesSuperseded
v57 patches0 repliesSuperseded
v47 patches0 repliesSuperseded
v36 patches0 repliesSuperseded
v26 patches8 repliesSuperseded
v16 patches2 repliesSuperseded

Changes in v10 from the cover letter

- Rebase to 6.15-rc2: Use anon_inode_getfile_fmode() instead of anon_inode_getfile()

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7powerpc/pseries: Define common functions for RTAS sequence callsarch/powerpc/platforms/pseries/Makefile arch/powerpc/platforms/pseries/papr-rtas-common.c arch/powerpc/platforms/pseries/papr-rtas-common.h +1 more+418 -3080 replies
2/7powerpc/pseries: Define papr_indices_io_block for papr-indices ioctlsDocumentation/userspace-api/ioctl/ioctl-number.rst arch/powerpc/include/uapi/asm/papr-indices.h+43 -00 replies
3/7powerpc/pseries: Add papr-indices char driver for ibm,get-indicesarch/powerpc/include/asm/rtas.h arch/powerpc/kernel/rtas.c arch/powerpc/platforms/pseries/Makefile +1 more+304 -20 replies
4/7powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call supportarch/powerpc/include/asm/rtas.h arch/powerpc/kernel/rtas.c arch/powerpc/platforms/pseries/papr-indices.c+122 -10 replies
5/7powerpc/pseries: Add ibm,get-dynamic-sensor-state RTAS call supportarch/powerpc/include/asm/rtas.h arch/powerpc/kernel/rtas.c arch/powerpc/platforms/pseries/papr-indices.c+69 -10 replies
6/7powerpc/pseries: Add papr-platform-dump character driver for dump retrievalDocumentation/userspace-api/ioctl/ioctl-number.rst arch/powerpc/include/uapi/asm/papr-platform-dump.h arch/powerpc/platforms/pseries/Makefile +1 more+429 -00 replies
7/7powerpc/pseries: Add a char driver for physical-attestation RTASDocumentation/userspace-api/ioctl/ioctl-number.rst arch/powerpc/include/asm/rtas.h arch/powerpc/include/uapi/asm/papr-physical-attestation.h +3 more+324 -20 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by.

PatchSathvika Vasireddy
1/7T-b
2/7T-b
3/7T-b
4/7T-b
5/7T-b
6/7T-b
7/7

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

Read the v10 thread

Cover letter [PATCH v10 0/7] Add character devices for indices, platform-dump and physical-attestation RTAS

Several APIs such as rtas_get_indices(), rtas_get_dynamic_sensor(), rtas_set_dynamic_indicator(), rtas_platform_dump() and rtas_physical_attestation() provided by librtas library are implemented in user space using rtas syscall in combination with writable mappings of /dev/mem. But this implementation is not compatible with system lockdown which prohibits /dev/mem access. The current kernel already provides char based driver interfaces for several RTAS calls such as VPD and system parameters to support lockdown feature.

This patch series adds new char based drivers, /dev/papr-indices for ibm,get-indices, ibm,get-dynamic-sensor-state and ibm,set-dynamic-indicator RTAS Calls. /dev/papr-platform-dump for ibm,platform-dump and /dev/papr-physical-attestation fir ibm,physical-attestation. Providing the similar open/ioctl/read interfaces to the user space as in the case of VPD and system parameters.

I have made changes to librtas library to use the new kernel interfaces if the corresponding device entry is available.

This patch series has the following patches:
powerpc/pseries: Define common functions for RTAS sequence calls
- For some of sequence based RTAS calls, the OS should not start another sequence with different input until the previous sequence is completed. So the sequence should be completed during ioctl() and expose the entire buffer during read(). ibm,get-indices is sequence based RTAS function similar to ibm,get-vpd and we already have the corresponding implementation for VPD driver. So update papr_rtas_sequence struct for RTAS call specific functions and move the top level sequence functions in to a separate file.

powerpc/pseries: Define papr_indices_io_block for papr-indices ioctls
- /dev/papr-indices driver supports ibm,get-indices, ibm,get-dynamic-sensor-state and ibm,set-dynamic-indicator RTAS Calls. papr-indices.h introduces 3 different ioctls for these RTAS calls and the corresponding ioctl input buffer.

powerpc/pseries: Add papr-indices char driver for ibm,get-indices
- Introduce /dev/papr-indices char based driver and add support for get-indices RTAS function

powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call support
- Update /dev/papr-indices for set-dynamic-indicator RTAS function

powerpc/pseries: Add ibm,get-dynamic-sensor-state RTAS call support
- Update /dev/papr-indices for get-dynamic-sensor-state RTAS function

powerpc/pseries: Add papr-platform-dump character driver for dump
retrieval
- Introduce /dev/papr-platform-dump char driver and adds support for ibm,platform-dump. Received suggestions from the previous post as a separate patch - Updated the patch with invalidating the dump using a separate ioctl.

powerpc/pseries: Add a char driver for papr-physical-attestation RTAS
- Introduce /dev/papr-physical-attestation char driver to provide kernel interface for ibm,physical-attestation RTAS function.

Thanks to Sathvika Vasireddy for testing these kernel APIs with various tools.

Changelog:
v10:
- Rebase to 6.15-rc2: Use anon_inode_getfile_fmode() instead of anon_inode_getfile()

v9:
- Fixed syntax issue in papr-rtas-common.c as reported by Mukesh Kumar Chaurasiya

v8:
- Fixed build warnings for the proper function parameter descriptions (vpd_sequence_begin(), few papr_rtas_*() functions, and etc) as reported by kernel test robot <[email protected]>

v7:
- Pass the proper next value to the subsequent RTAS calls for the get-indices sequence RTAS.
(Vasireddy Sathvika found this bug).

v6:
- Define the proper command ID for PAPR_PHY_ATTEST_IOC_HANDLE ioctl
- Update ioctls description in ioctl-number.rst.

v5:
- Return with -EINPROGRESS in papr_platform_dump_invalidate_ioctl() if the complete dump is not read (Suggested by Michal Suchánek).

v4:
- Include patch "Add char driver for papr-physical-attestation RTAS" in this series. ibm,physical-attestation is sequence based RTAS call and the implementation is also similar to ibm,get-vpd and ibm,get-indices.

v3:
- put_unused_fd() only after get_unused_fd() successful for the failure case later ("Add papr-platform-dump character driver for dump retrieval" patch).

v2:
- Added unlock rtas_ibm_set_dynamic_indicator_lock and rtas_ibm_get_dynamic_sensor_state_lock mutex for failure cases as reported by Dan Carpenter
- Fixed build warnings for the proper function parameter descriptions as reported by kernel test robot <[email protected]>

Haren Myneni (7):
powerpc/pseries: Define common functions for RTAS sequence calls powerpc/pseries: Define papr_indices_io_block for papr-indices ioctls powerpc/pseries: Add papr-indices char driver for ibm,get-indices powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call support powerpc/pseries: Add ibm,get-dynamic-sensor-state RTAS call support powerpc/pseries: Add papr-platform-dump character driver for dump
retrieval
powerpc/pseries: Add a char driver for physical-attestation RTAS

 .../userspace-api/ioctl/ioctl-number.rst      |   6 +
 arch/powerpc/include/asm/rtas.h               |   4 +
 arch/powerpc/include/uapi/asm/papr-indices.h  |  41 ++
 .../uapi/asm/papr-physical-attestation.h      |  31 ++
 .../include/uapi/asm/papr-platform-dump.h     |  15 +
 arch/powerpc/kernel/rtas.c                    |   8 +-
 arch/powerpc/platforms/pseries/Makefile       |   3 +-
 arch/powerpc/platforms/pseries/papr-indices.c | 488 ++++++++++++++++++
 .../platforms/pseries/papr-phy-attest.c       | 288 +++++++++++
 .../platforms/pseries/papr-platform-dump.c    | 411 +++++++++++++++
 .../platforms/pseries/papr-rtas-common.c      | 311 +++++++++++
 .../platforms/pseries/papr-rtas-common.h      |  61 +++
 arch/powerpc/platforms/pseries/papr-vpd.c     | 352 ++-----------
 13 files changed, 1707 insertions(+), 312 deletions(-)
 create mode 100644 arch/powerpc/include/uapi/asm/papr-indices.h
 create mode 100644 arch/powerpc/include/uapi/asm/papr-physical-attestation.h
 create mode 100644 arch/powerpc/include/uapi/asm/papr-platform-dump.h
 create mode 100644 arch/powerpc/platforms/pseries/papr-indices.c
 create mode 100644 arch/powerpc/platforms/pseries/papr-phy-attest.c
 create mode 100644 arch/powerpc/platforms/pseries/papr-platform-dump.c
 create mode 100644 arch/powerpc/platforms/pseries/papr-rtas-common.c
 create mode 100644 arch/powerpc/platforms/pseries/papr-rtas-common.h
Signature · 1 line
2.43.5