[Skiboot] [PATCH v4 4/9] hw/slw: Move P8 bits behind CONFIG_P8

Cédric Le Goater clg at kaod.org
Mon Dec 20 18:50:10 AEDT 2021


On 12/20/21 06:40, Nicholas Piggin wrote:
> Excerpts from Cédric Le Goater's message of December 18, 2021 1:15 am:
>> On 12/17/21 03:36, Nicholas Piggin wrote:
>>> This saves about 3kB from skiboot.lid.xz
>>>
>>> Reviewed-by: Dan Horák <dan at danny.cz>
>>> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
>>> ---
>>>    core/fast-reboot.c   |   2 +
>>>    hw/slw.c             | 176 ++++++++++++++++++++++---------------------
>>>    libpore/Makefile.inc |   8 +-
>>>    3 files changed, 100 insertions(+), 86 deletions(-)
>>
>> I think its time for P8 to have its own file. how complex would it be
>> to introduce :
>>
>>     hw/slw.c
>>     hw/slw_p8.c
>>     hw/slw_p9.c
>>     hw/slw_p10.c
>>
>> at least the first two ?
> 
> Okay I've done the first two as a subsequent patch which seems like
> quite a good cleanup. 

Yes. P8 is getting close to EOL. It's nice to be able to deactivate
the whole.

> Could possibly move p9/10 into their own file too afterwards.
>
>>> @@ -287,6 +288,7 @@ static void cleanup_cpu_state(void)
>>
>>
>> There is a comment saying :
>>
>>     P9 clears TLBs in cpu_fast_reboot_complete
>>
>> I didn't find it in the code ?
> 
> Hmm, that may have been from cpu_set_radix_mode() which was
> removed by commit 53ef0db6e2.
> 
> We might be saved in practice most of the time with OPAL_REINIT_CPUS.
> 
>>> @@ -1389,6 +1396,7 @@ void slw_init(void)
>>>    				slw_late_init_p8(chip);
>>>    		}
>>>    		p8_sbe_init_timer();
>>
>> The p8_sbe* routine are still compiled in AFAICT.
> 
> Hmm. Does the sbe timer depend on slw?

no but it's dead code with CONFIG_P8=0.

May be we should introduce a sbe.h file to hide behind generic helpers
this code :

	static inline void sbe_update_timer_expiry(uint64_t target)
	{
		if (proc_gen < proc_gen_p9)
			p8_sbe_update_timer_expiry(target);
		else
			p9_sbe_update_timer_expiry(target);
	}

and

	static inline bool sbe_is_timer_ok(void)
	{
		return p9_sbe_timer_ok() || p8_sbe_timer_ok();
	}

and introduce a #ifdef CONFIG_P8 to compile out the P8 part. It can come
with followups.

There are other parts: XSCOM, OCC, PSI, etc. A good way to tell is to
remove 'proc_gen_p8' ... For later.


Thanks,

C.


More information about the Skiboot mailing list