Subject: Re: [PATCH] Make system_reset_pSeries relocatable

From: Balbir Singh <[email-masked]>
Date: Wed, 27 Jul 2016 23:57:28 +1000

On Wed, Jul 27, 2016 at 09:50:03PM +1000, Nicholas Piggin wrote:
> On Wed, 27 Jul 2016 17:32:06 +1000
> Balbir Singh <[email-masked]> wrote:
> 
> > +#ifndef CONFIG_RELOCATABLE
> > +	b	power7_wakeup_common
> > +#else
> > +	/*
> > +	 * We can't just use a direct branch to power7_wakeup_common
> > +	 * because the distance from here to there depends on where
> > +	 * the kernel ends up being put.
> > +	 */
> > +	mfctr	r11
> > +	ld	r10, PACAKBASE(r13)
> > +	LOAD_HANDLER(r10, power7_wakeup_common)
> > +	mtctr	r10
> > +	bctr
> >  #endif
> 
> So r10 and r11 are safe to use (as well as existing registers
> being used without saving) because we are returning via the nap
> functions that caller will expect te trash volatile registers,
> yes?
>

r10, r11 are volatile as per the ABI, so yes.

> In that caie I can't see a problem with this.
>

Thanks for the review

Balbir