Re: [PATCH v3 00/20] RTAS maintenance

2023-02-15 Thread Michael Ellerman
On Fri, 10 Feb 2023 12:41:48 -0600, Nathan Lynch wrote:
> Proposed changes for the RTAS subsystem and client code.
> 
> Fixes that are subject to backporting are at the front of the queue.
> The rest of the queue is roughly ordered with respect to maturity:
> i.e. patches that have already garnered some review and discussion
> precede newer, more experimental changes.
> 
> [...]

Applied to powerpc/next.

[01/20] powerpc/rtas: handle extended delays safely in early boot

https://git.kernel.org/powerpc/c/09d1ea72c88198ef5a9e6b8208f544fe18acbff1
[02/20] powerpc/perf/hv-24x7: add missing RTAS retry status handling

https://git.kernel.org/powerpc/c/cc4b26eab1859fa1a70711872caaf6414809973f
[03/20] powerpc/pseries/lpar: add missing RTAS retry status handling

https://git.kernel.org/powerpc/c/daa8ab59044610aa8ef2ee45a6c157b5e11635e9
[04/20] powerpc/pseries/lparcfg: add missing RTAS retry status handling

https://git.kernel.org/powerpc/c/5d08633e5f6564b60f1cbe09af3af40a74d66431
[05/20] powerpc/pseries/setup: add missing RTAS retry status handling

https://git.kernel.org/powerpc/c/b7d5333c48a21fd6a20f54b6887bcc191d21c273
[06/20] powerpc/rtas: ensure 4KB alignment for rtas_data_buf

https://git.kernel.org/powerpc/c/836b5b9fcc8e09cea7e8a59a070349a00e818308
[07/20] powerpc/pseries: drop RTAS-based timebase synchronization

https://git.kernel.org/powerpc/c/d6f7fe3b25f26213953066ce8109ea47dbd33cfa
[08/20] powerpc/rtas: improve function information lookups

https://git.kernel.org/powerpc/c/8252b88294d2a744df6e3c6d85909ade403a5f2c
[09/20] powerpc/rtas: strengthen do_enter_rtas() type safety, drop inline

https://git.kernel.org/powerpc/c/77f85f69a97ac5f24537261a893436926c3e0cdc
[10/20] powerpc/tracing: tracepoints for RTAS entry and exit

https://git.kernel.org/powerpc/c/2c81ca7fbaea06c2aed1aec66a88208d67e1e2de
[11/20] powerpc/rtas: add tracepoints around RTAS entry

https://git.kernel.org/powerpc/c/24098f580e2b5ceb2cec4f02833e0a0bb5d46d2e
[12/20] powerpc/pseries: add RTAS work area allocator

https://git.kernel.org/powerpc/c/43033bc62d349d8d852855a336c91d046de819bd
[13/20] powerpc/pseries/dlpar: use RTAS work area API

https://git.kernel.org/powerpc/c/e27e14231eb541899efc11c33d6eeddcb74767c3
[14/20] powerpc/pseries: PAPR system parameter API

https://git.kernel.org/powerpc/c/419e27f32b6dc13c3e6f443d1ad104f2845c444b
[15/20] powerpc/pseries: convert CMO probe to papr_sysparm API

https://git.kernel.org/powerpc/c/b8dc71774a51182185ae197ed2f8bd085ce6c848
[16/20] powerpc/pseries/lparcfg: convert to papr_sysparm API

https://git.kernel.org/powerpc/c/fff9846be00c467b4a277492af5be8487b6540e9
[17/20] powerpc/pseries/hv-24x7: convert to papr_sysparm API

https://git.kernel.org/powerpc/c/69b9f5a5b2c04ce5993fe43da938f065571bdb25
[18/20] powerpc/pseries/lpar: convert to papr_sysparm API

https://git.kernel.org/powerpc/c/e58d9e17b11b776e32b1d3d80bdc63d39de3463d
[19/20] powerpc/rtas: introduce rtas_function_token() API

https://git.kernel.org/powerpc/c/716bfc97bd5fb7b442cdd06081f49df097f2e27b
[20/20] powerpc/rtas: arch-wide function token lookup conversions

https://git.kernel.org/powerpc/c/08273c9f619cb32fb041935724f576e607101f3b

cheers


[PATCH v3 00/20] RTAS maintenance

2023-02-10 Thread Nathan Lynch via B4 Submission Endpoint
Proposed changes for the RTAS subsystem and client code.

Fixes that are subject to backporting are at the front of the queue.
The rest of the queue is roughly ordered with respect to maturity:
i.e. patches that have already garnered some review and discussion
precede newer, more experimental changes.

Major features:

* Static tracepoints around RTAS entry/exit.
* An allocator for work area buffers.
* A new client of the work area allocator in the form of a
  higher-level API for PAPR system parameter retrieval.
* Constant-time symbolic RTAS function token lookups.

Tested with ppc64le in PowerVM LPARs and QEMU's pseries
model. Obsolescent RTAS platforms (chrp, cell, maple) get build
coverage.

---
Changes in v3:

* Additions:
  - Ensure 4KB alignment for rtas_data_buf.

* Modifications to existing patches (all per Michael Ellerman)
  - Rename "ret" to "retry" in rtas_busy_delay_early().
  - Reset the stuck counter when rtas_busy_delay_early() warns.
  - Explain addition of __ref to rtas_busy_delay().
  - Spell out function index constants instead of cpp-pasting.
  - Use more conventional header inclusion guards in new heaaders.
  - Align early_work_area_buf.
  - Prevent bad arguments to rtas_work_area_alloc() with a
compile-time assertion.
  - Discard pr_devel() from rtas-work-area.c.
  - Access work area allocator state through a single struct instead
of a pointer indirection.
  - Initialize work area descriptors more conventionally.
  - Ensure rtas_function_token() returns RTAS_UNKNOWN_SERVICE on
non-RTAS platforms.
  - Move rtas-work-area.c to platforms/pseries/ and initialize it on
pseries only.
* Link to v2: 
https://lore.kernel.org/r/20230125-b4-powerpc-rtas-queue-v2-0-9aa6bd058...@linux.ibm.com

Changes in v2:

* Drop applied patches:
  - powerpc/rtas: document rtas_call()
  - powerpc/rtasd: use correct OF API for event scan rate
  - powerpc/rtas: avoid device tree lookups in rtas_os_term()
  - powerpc/rtas: avoid scheduling in rtas_os_term()
  - powerpc/pseries/eeh: use correct API for error log size
  - powerpc/rtas: clean up rtas_error_log_max initialization
  - powerpc/rtas: clean up includes
  - powerpc/rtas: define pr_fmt and convert printk call sites
  - powerpc/rtas: mandate RTAS syscall filtering

* Additions:
  - Safe early-boot fallback in rtas_busy_delay().
  - Fixes for missed RTAS function call retries in various places.
  - Remove RTAS timebase sync from pseries, previously posted
separately as "powerpc/pseries: drop RTAS-based timebase
synchronization":

https://lore.kernel.org/linuxppc-dev/20230110042845.121792-1-nath...@linux.ibm.com/T/#u
  - RTAS work area buffer allocator.
  - Conversion of pseries DLPAR code to work area allocator.
  - A pseries-specific PAPR system parameter API built on top of the
RTAS work area allocator.
  - Conversion of ibm,get-system-parameter users to papr_sysparm API.
  - New rtas_function_token() API and associated conversions.

* Modifications to existing patches:
  - Convert RTAS tracepoint definitions to unconditional
variants (TRACE_EVENT_CONDITION() -> TRACE_EVENT()), dropping a
cpu_online() check that duplicates work already done at the call
site.
  - Skip tracepoints in unsafe contexts (real mode, CPU
offline). (Nicholas Piggin)
  - Use bool bitfield for "banned on LE" function flag.
  - Better documentation for "banned on LE" function flag. (Andrew Donnellan)
  - Drop unnecessary cast for xa_load() key argument. (Nick Child)

* Link to v1: 
https://lore.kernel.org/r/20221118150751.469393-1-nath...@linux.ibm.com

---
Nathan Lynch (20):
  powerpc/rtas: handle extended delays safely in early boot
  powerpc/perf/hv-24x7: add missing RTAS retry status handling
  powerpc/pseries/lpar: add missing RTAS retry status handling
  powerpc/pseries/lparcfg: add missing RTAS retry status handling
  powerpc/pseries/setup: add missing RTAS retry status handling
  powerpc/rtas: ensure 4KB alignment for rtas_data_buf
  powerpc/pseries: drop RTAS-based timebase synchronization
  powerpc/rtas: improve function information lookups
  powerpc/rtas: strengthen do_enter_rtas() type safety, drop inline
  powerpc/tracing: tracepoints for RTAS entry and exit
  powerpc/rtas: add tracepoints around RTAS entry
  powerpc/pseries: add RTAS work area allocator
  powerpc/pseries/dlpar: use RTAS work area API
  powerpc/pseries: PAPR system parameter API
  powerpc/pseries: convert CMO probe to papr_sysparm API
  powerpc/pseries/lparcfg: convert to papr_sysparm API
  powerpc/pseries/hv-24x7: convert to papr_sysparm API
  powerpc/pseries/lpar: convert to papr_sysparm API
  powerpc/rtas: introduce rtas_function_token() API
  powerpc/rtas: arch-wide function token lookup conversions

 arch/powerpc/include/asm/papr-sysparm.h |  38 +
 arch/powerpc/include/asm/rtas-work-area.h   |  96 +++
 arch/powerpc/include/asm/rtas.h | 184 +