[Skiboot] [PATCH v7 09/22] hdata: Adjust various structure offset after relocation

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon May 13 21:57:38 AEST 2019


On 05/09/2019 06:35 AM, Michael Neuling wrote:
> On Sat, 2019-04-13 at 14:45 +0530, Vasant Hegde wrote:
>> ntuple addresses in SPIRAH are relative to payload base. Update various
>> addresses after relocation so that hostboot can access new address to
>> capture dump.
>>
>> Note that we update relocated SPIRAH. So if we crash before sending
>> relocated skiboot base to SBE, hostboot can still collect early
>> crash using original skiboot base.
>>
>> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
>> ---
>>   hdata/spira.c | 25 +++++++++++++++++++++++++
>>   1 file changed, 25 insertions(+)
>>
>> diff --git a/hdata/spira.c b/hdata/spira.c
>> index 3708a9de4..636bfc063 100644
>> --- a/hdata/spira.c
>> +++ b/hdata/spira.c
>> @@ -25,6 +25,7 @@
>>   #include <opal-dump.h>
>>   #include <fsp-attn.h>
>>   #include <fsp-leds.h>
>> +#include <skiboot.h>
>>   
>>   #include "hdata.h"
>>   #include "hostservices.h"
>> @@ -1738,6 +1739,28 @@ static void fixup_spira(void)
>>   	spira.ntuples.node_stb_data = spiras->ntuples.node_stb_data;
>>   }
>>   
>> +/*
>> + * All the data structure addresses are relative to payload base. Hence adjust
>> + * structures that are needed to capture OPAL dump during memory preserving IPL.
>> + */
>> +static void update_spirah_addr(void)
>> +{
>> +#if !defined(TEST)
>> +	/* NACA starts at 0x4000 (see asm/head.S) */
>> +	uint64_t *spirah_offset = (uint64_t *)((u64)SKIBOOT_BASE + 0x4000);
> 
> Just use the naca symbol then its self documenting.

Oh yes. We should use "naca". I don't recall why I hardcoded naca value here.


Thanks!

-Vasant



More information about the Skiboot mailing list