[Skiboot] [PATCH v7 18/22] fadump: Add documentation

Nicholas Piggin npiggin at gmail.com
Thu May 16 15:35:21 AEST 2019


Vasant Hegde's on May 14, 2019 9:23 pm:
> On 05/09/2019 10:28 AM, Nicholas Piggin wrote:
>> Vasant Hegde's on April 13, 2019 7:15 pm:
>>> diff --git a/doc/opal-api/opal-fadump-manage-173.rst b/doc/opal-api/opal-fadump-manage-173.rst
>>> new file mode 100644
>>> index 000000000..916167503
>>> --- /dev/null
>>> +++ b/doc/opal-api/opal-fadump-manage-173.rst
>>> @@ -0,0 +1,73 @@
>>> +.. _opal-api-fadump-manage:
>>> +
>>> +OPAL fadump manage call
>>> +=======================
>>> +::
>>> +
>>> +   #define OPAL_FADUMP_MANAGE                      173
>>> +
>>> +This call is used to manage FADUMP (aka MPIPL) on OPAL platform.
>>> +Linux kernel will use this call to register/unregister FADUMP.
>>> +
>>> +Parameters
>>> +----------
>>> +::
>>> +
>>> +   uint64_t     command
>>> +   void         *data
>>> +   uint64_t     dsize
>>> +
>>> +``command``
>>> +   ``command`` parameter supports below values:
>>> +
>>> +::
>>> +
>>> +      0x01 - Register for fadump
>>> +      0x02 - Unregister fadump
>>> +      0x03 - Invalidate existing fadump
>>> +
>>> +``data``
>>> +   ``data`` is valid when ``command`` is 0x01 (registration).
>>> +   We use fadump structure (see below) to pass Linux kernel
>>> +   memory reservation details.
>>> +
>>> +::
>>> +
>>> +
>>> +   struct fadump_section {
>>> +	u8	source_type;
>>> +	u8	reserved[7];
>>> +	u64	source_addr;
>>> +	u64	source_size;
>>> +	u64	dest_addr;
>>> +	u64	dest_size;
>>> +   } __packed;
>>> +
>>> +   struct fadump {
>>> +	u16	fadump_section_size;
>>> +	u16	section_count;
>>> +	u32	crashing_cpu;
>>> +	u64	reserved;
>>> +	struct	fadump_section section[];
>>> +   };
>> 
>> This API seems quite complicated. The kernel wants to tell firmware to
>> preserve some ranges of memory in case of reboot, and to have those
>> ranges advertised to the reboot kernel.
> 
> Kernel informs OPAL about range of memory to be preserved during MPIPL
> (source, destination, size).

Well it also contains crashing_cpu, type, and comes in this clunky
structure.

> After reboot, we will result range from hostboot . We pass that to kernel via
> device tree.
> 
>> 
>> Why not just an API which can add a range, and delete a range, and
>> that's it? Range would just be physical start, end, plus an arbitrary
>> tag (which caller can use to retrieve metadata that is used to
>> decipher the dump).
> 
> We want one to one mapping between source and destination.

Ah yes, sure that too. So two calls, one which adds or removes
(source, dest, length) entries, and another which sets a tag.

> Also we have
> to update this information in HDAT so that hostboot can access it.

That's okay though, isn't it? You can return failure if you don't
have enough room.

> Also having structure allows us to pass all these information nicely to OPAL.

I don't think OPAL needs to know about the kernel crash metadata, and
it could get its own by looking at addresses and tags that come up.
Although I'm not really convinced it's a good idea to have a
cooperative system where you have kernel and OPAL both managing crash
dumps at the same time... I really think OPAL crash information and
especially when the host is running could benefit from more thought.

> Finally this is similar concept we have in PowerVM LPAR as well. Hence I have
> added structure.

Is that a point for or against this structure? :)

Thanks,
Nick



More information about the Skiboot mailing list