[Skiboot] [PATCH v3 2/3] debug_descriptor: Claim reserved field for host kernel log buffer

Joel Stanley joel at jms.id.au
Thu May 31 14:58:02 AEST 2018


On 31 May 2018 at 14:16, Benjamin Herrenschmidt
<benh at kernel.crashing.org> wrote:
> On Thu, 2018-05-31 at 13:59 +0930, Joel Stanley wrote:
>> This will be used by the dump region opal call.
>>
>> This bumps the version of the debug descriptor to indicate this field is
>> now in use. However, any users of the descriptor should remain
>> compatible as the non-reserved fields behave in the same way as
>> previously.
>>
>> Signed-off-by: Joel Stanley <joel at jms.id.au>
>> ---
>>  include/skiboot.h | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/skiboot.h b/include/skiboot.h
>> index b4bdf37795dd..9a49bfca74a5 100644
>> --- a/include/skiboot.h
>> +++ b/include/skiboot.h
>> @@ -69,13 +69,13 @@ static inline bool is_rodata(const void *p)
>>   */
>>  struct debug_descriptor {
>>         u8      eye_catcher[8]; /* "OPALdbug" */
>> -#define DEBUG_DESC_VERSION     1
>> +#define DEBUG_DESC_VERSION     2
>>         u32     version;
>>         u8      console_log_levels;     /* high 4 bits in memory,
>>                                          * low 4 bits driver (e.g. uart). */
>>         u8      state_flags; /* various state flags - OPAL_BOOT_COMPLETE etc */
>> -       u16     reserved2;
>> -       u32     reserved[2];
>> +       u16     reserved;
>> +       u64     log_buf_phys;           /* Pointer to kernel log buffer */
>
> What about passing the size of the buffer ?

I guess something could use it to dump the entire region to be
processed later. We'd need to move things around in the descriptor to
do this, as the size is u32 and we only have a u16 left over.

If you're processing it online then we read one entry at a time, and
keep going until we find a zero length entry in the buffer to know
that it's the end.

Joel


More information about the Skiboot mailing list