]> www.infradead.org Git - users/jedix/linux-maple.git/commit
powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call support
authorHaren Myneni <haren@linux.ibm.com>
Wed, 16 Apr 2025 22:57:39 +0000 (15:57 -0700)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Thu, 17 Apr 2025 06:12:29 +0000 (11:42 +0530)
commitf60a3796f84f96d21de1a4fa2b9fd0637378f026
tree8dddb95a5f0f44b66076b58844708a7de2c9a92a
parent6e9aec544682670e884f02fab910021c5d87985e
powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call support

The RTAS call ibm,set-dynamic-indicator is used to set the new
indicator state identified by a location code. The current
implementation uses rtas_set_dynamic_indicator() API provided by
librtas library which allocates RMO buffer and issue this RTAS
call in the user space. But /dev/mem access by the user space
is prohibited under system lockdown.

This patch provides an interface with new ioctl
PAPR_DYNAMIC_INDICATOR_IOC_SET to the papr-indices character
driver and expose this interface to the user space that is
compatible with lockdown.

Refer PAPR 7.3.18 ibm,set-dynamic-indicator for more
information on this RTAS call.
-  User input parameters to the RTAS call: location code
   string, indicator token and new state

Expose these interfaces to user space with a /dev/papr-indices
character device using the following programming model:
 int fd = open("/dev/papr-indices", O_RDWR);
 int ret = ioctl(fd, PAPR_DYNAMIC_INDICATOR_IOC_SET,
struct papr_indices_io_block)
  - The user space passes input parameters in papr_indices_io_block
    struct

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Tested-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250416225743.596462-5-haren@linux.ibm.com
arch/powerpc/include/asm/rtas.h
arch/powerpc/kernel/rtas.c
arch/powerpc/platforms/pseries/papr-indices.c