Re: [RFC PATCH] Introduce persistent memory pool

Arnd Bergmann
2023-08-30T23:39:49Z

On Wed, Aug 30, 2023, at 03:20, Alexander Graf wrote:
> On 30.08.23 00:07, Stanislav Kinsburskii wrote:
>> On Mon, Aug 28, 2023 at 10:50:19PM +0200, Alexander Graf wrote:

>> Device tree or ACPI are options indeed. However AFAIU in case of DT user
>> space has to involved into the picture to modify and complie it, while
>> ACPI isn't flexible or easily extendable.
>> Also, AFAIU both these standards were designed with passing
>> hardware-specific data in mind from bootstrap software to an OS kernel
>> and thus were never really intended to be used for creating a persistent
>> state accross kexec.
>> To me, an attempt to use either of them to pass kernel-specific data looks
>> like an abuse (or misuse) excused by the simplicity of implementation.
>
>
> What I was describing above is that the Linux boot protocol already has
> natural ways to pass a DT (arm) or set of ACPI tables (x86) to the
> target kernel. Whatever we do here should either piggy back on top of
> those natural mechanisms (e.g. /chosen node in DT) or be on the same
> level (e.g. pass DT in one register, pass metadata structure in another
> register).
>
> When it comes to the actual content of the metadata, I'm personally also
> leaning towards DT. We already have libfdt inside the kernel. It gives
> is a very simple, well understood structured file format that you can
> extend, version, etc etc. And the kernel has mechanisms to modify fdt
> contents.

Agreed. This also makes a lot of sense since the fdt format was
originally introduced for this exact purpose, to be a key-value
store to pass data from the running kernel to the next one after
kexec when the original source of the data (originally open
firmware) is gone. It only turned into the generic way to
describe embedded systems later on, but both the fdt binary
format and the kexec infrastructure for manipulating and
passing the blob should be easy to reuse for additional purposes
as long as the contents are put into appropriate namespaces that
don't clash with existing usage.

Arnd