Patch series "list private v2 & luo flb", v9.
This series introduces two connected infrastructure improvements: a new
API for handling private linked lists, and the "File-Lifecycle-Bound"
(FLB) mechanism for the Live Update Orchestrator.
1. Private List Primitives (patches 1-3)
Recently, Linux introduced the ability to mark structure members as
__private and access them via ACCESS_PRIVATE(). This enforces better
encapsulation by ensuring internal details are only accessible by the
owning subsystem.
However, struct list_head is frequently used as an internal linkage
mechanism within these private sections. The standard macros in
<linux/list.h> do not support ACCESS_PRIVATE() natively. Consequently,
subsystems using private lists are forced to implement ad-hoc
workarounds or local iterator macros.
This series adds <linux/list_private.h>, providing a set of
primitives identical to those in <linux/list.h> but designed for
private list heads. It also includes a KUnit test suite to verify that
the macros correctly handle pointer offsets and qualifiers.
2. This series adds FLB (patches 4-5) support to Live Update that also
internally uses private lists.
FLB allows global kernel state (such as IOMMU domains or HugeTLB
state) to be preserved once, shared across multiple file descriptors,
and restored when needed. This is necessary for subsystems where
multiple preserved file descriptors depend on a single, shared
underlying resource. Preserving this state for each individual file
would be redundant and incorrect.
FLB uses reference counting tied to the lifecycle of preserved
files. The state is preserved when the first file depending on it is
preserved, and restored or cleaned up only when the last file is
handled.
This patch (of 5):
Linux recently added an ability to add private members to structs (i.e.
__private) and access them via ACCESS_PRIVATE(). This ensures that those
members are only accessible by the subsystem which owns the struct type,
and not to the object owner.
However, struct list_head often needs to be placed into the private
section to be manipulated privately by the subsystem.
Add macros to support private list manipulations in
<linux/list_private.h>.
[[email protected]: fix kerneldoc]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Pasha Tatashin <[email protected]>
Cc: Alexander Graf <[email protected]>
Cc: David Gow <[email protected]>
Cc: David Matlack <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: Pratyush Yadav <[email protected]>
Cc: Samiullah Khawaja <[email protected]>
Cc: Tamir Duberstein <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Add example-driven documentation for the kernel's generic linked list
data structure. This includes discussion of situations where linked
lists are likely inappropriate, and references to further reading.
Signed-off-by: Nicolas Frattaroli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>