From: Haren Myneni <haren@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
msuchanek@suse.de, mahesh@linux.ibm.com, tyreld@linux.ibm.com,
hbabu@us.ibm.com, haren@linux.ibm.com
Subject: [PATCH v2 0/6] Add character devices for indices and platform-dump RTAS
Date: Fri, 10 Jan 2025 16:30:02 -0800 [thread overview]
Message-ID: <20250111003010.2147021-1-haren@linux.ibm.com> (raw)
Several APIs such as rtas_get_indices(), rtas_get_dynamic_sensor(),
rtas_set_dynamic_indicator() and rtas_platform_dump() 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. and /dev/papr-platform-dump
for ibm,platform-dump. 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.
Changelog:
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 <lkp@intel.com>
Haren Myneni (6):
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
arch/powerpc/include/asm/rtas.h | 3 +
arch/powerpc/include/uapi/asm/papr-indices.h | 41 ++
.../include/uapi/asm/papr-platform-dump.h | 15 +
arch/powerpc/kernel/rtas.c | 6 +-
arch/powerpc/platforms/pseries/Makefile | 3 +-
arch/powerpc/platforms/pseries/papr-indices.c | 558 ++++++++++++++++++
.../platforms/pseries/papr-platform-dump.c | 408 +++++++++++++
.../platforms/pseries/papr-rtas-common.c | 243 ++++++++
.../platforms/pseries/papr-rtas-common.h | 45 ++
arch/powerpc/platforms/pseries/papr-vpd.c | 270 ++-------
10 files changed, 1364 insertions(+), 228 deletions(-)
create mode 100644 arch/powerpc/include/uapi/asm/papr-indices.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-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
--
2.43.5
next reply other threads:[~2025-01-11 0:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 0:30 Haren Myneni [this message]
2025-01-11 0:30 ` [PATCH v2 1/6] powerpc/pseries: Define common functions for RTAS sequence calls Haren Myneni
2025-01-11 0:30 ` [PATCH v2 2/6] powerpc/pseries: Define papr_indices_io_block for papr-indices ioctls Haren Myneni
2025-01-11 0:30 ` [PATCH v2 3/6] powerpc/pseries: Add papr-indices char driver for ibm,get-indices Haren Myneni
2025-01-11 0:30 ` [PATCH v2 4/6] powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call support Haren Myneni
2025-01-11 0:30 ` [PATCH v2 5/6] powerpc/pseries: Add ibm,get-dynamic-sensor-state " Haren Myneni
2025-01-11 0:30 ` [PATCH v2 6/6] powerpc/pseries: Add papr-platform-dump character driver for dump retrieval Haren Myneni
2025-02-05 14:28 ` Michal Suchánek
2025-02-06 7:51 ` Haren Myneni
2025-02-06 9:18 ` Michal Suchánek
2025-02-06 15:28 ` Haren Myneni
2025-02-06 15:32 ` Michal Suchánek
2025-02-06 18:34 ` Haren Myneni
2025-02-06 19:53 ` Michal Suchánek
2025-02-06 20:53 ` Haren Myneni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250111003010.2147021-1-haren@linux.ibm.com \
--to=haren@linux.ibm.com \
--cc=hbabu@us.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=npiggin@gmail.com \
--cc=tyreld@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.