linux/arch/powerpc
Nathan Lynch 905b9e4878 powerpc/pseries/papr-sysparm: Expose character device to user space
Until now the papr_sysparm APIs have been kernel-internal. But user
space needs access to PAPR system parameters too. The only method
available to user space today to get or set system parameters is using
sys_rtas() and /dev/mem to pass RTAS-addressable buffers between user
space and firmware. This is incompatible with lockdown and should be
deprecated.

So provide an alternative ABI to user space in the form of a
/dev/papr-sysparm character device with just two ioctl commands (get
and set). The data payloads involved are small enough to fit in the
ioctl argument buffer, making the code relatively simple.

Exposing the system parameters through sysfs has been considered but
it would be too awkward:

* The kernel currently does not have to contain an exhaustive list of
  defined system parameters. This is a convenient property to maintain
  because we don't have to update the kernel whenever a new parameter
  is added to PAPR. Exporting a named attribute in sysfs for each
  parameter would negate this.

* Some system parameters are text-based and some are not.

* Retrieval of at least one system parameter requires input data,
  which a simple read-oriented interface can't support.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231212-papr-sys_rtas-vs-lockdown-v6-11-e9eafd0c8c6c@linux.ibm.com
2023-12-13 21:38:21 +11:00
..
boot powerpc/boot: Add version to install filenames 2023-10-20 17:34:26 +11:00
configs powerpc/configs/64s: Enable CONFIG_MEM_SOFT_DIRTY 2023-11-27 22:01:14 +11:00
crypto This push fixes a random config build failure on powerpc. 2023-09-01 15:39:25 -07:00
include powerpc/pseries/papr-sysparm: Expose character device to user space 2023-12-13 21:38:21 +11:00
kernel powerpc/rtas: Warn if per-function lock isn't held 2023-12-13 21:38:21 +11:00
kexec powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
kvm powerpc: Add PVN support for HeXin C2000 processor 2023-12-01 21:15:33 +11:00
lib powerpc/lib: Validate size for vector operations 2023-11-27 22:06:19 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/book3s/hash: Drop _PAGE_PRIVILEGED from PAGE_NONE 2023-12-07 23:34:11 +11:00
net powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] 2023-10-23 20:33:19 +11:00
perf powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function 2023-12-13 21:05:03 +11:00
platforms powerpc/pseries/papr-sysparm: Expose character device to user space 2023-12-13 21:38:21 +11:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu 2023-11-27 22:01:15 +11:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
Kbuild
Kconfig powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API 2023-10-20 17:55:56 +11:00
Kconfig.debug powerpc/ps3: move udbg_shutdown_ps3gelic prototype 2023-11-21 12:06:50 +11:00
Makefile powerpc/Makefile: Auto detect cross compiler 2023-12-07 23:34:38 +11:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00