[PATCH 1/2] powerpc: add Book E support to 64-bit hibernation

Wang Dongsheng-B40534 B40534 at freescale.com
Thu Jun 13 19:55:43 EST 2013



> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, June 13, 2013 6:04 AM
> To: Wang Dongsheng-B40534
> Cc: benh at kernel.crashing.org; johannes at sipsolutions.net; anton at enomsg.org;
> galak at kernel.crashing.org; linuxppc-dev at lists.ozlabs.org; Wang Dongsheng-
> B40534
> Subject: Re: [PATCH 1/2] powerpc: add Book E support to 64-bit
> hibernation
> 
> On 06/09/2013 05:37:39 AM, Wang Dongsheng wrote:
> >  /* these macros rely on the save area being
> >   * pointed to by r11 */
> > +
> > +#define SAVE_SPR(register)		\
> > +	mfspr	r0,SPRN_##register	;\
> > +	std	r0,SL_##register(r11)
> > +#define RESTORE_SPR(register)		\
> > +	ld	r0,SL_##register(r11)	;\
> > +	mtspr	SPRN_##register,r0
> > +#define RESTORE_SPRG(n)			\
> > +	ld	r0,SL_SPRG##n(r11)	;\
> > +	mtsprg	n,r0
> >  #define SAVE_SPECIAL(special)		\
> >  	mf##special	r0		;\
> >  	std	r0, SL_##special(r11)
> 
> Is there a particular SPR that you're trying to save, for which
> SAVE_SPECIAL doesn't work?
> 
Yes, like pid, tcr.

> > +#else
> > +	/* Save SPRGs */
> > +	RESTORE_SPRG(0)
> > +	RESTORE_SPRG(1)
> > +	RESTORE_SPRG(2)
> > +	RESTORE_SPRG(3)
> > +	RESTORE_SPRG(4)
> > +	RESTORE_SPRG(5)
> > +	RESTORE_SPRG(6)
> > +	RESTORE_SPRG(7)
> 
> Why do we need this on book3e and not on book3s?
> 
Book3e: SPRG1 used save paca, SPRG2 be defined SPRN_SPRG_TLB_EXFRAME,...
I think those register should be save, even now some SPRG register not be use.

Book3s: Sorry, I not clear why book3s not do this. I think Anton or Ben could know the reason.

> > +
> > +	RESTORE_SPECIAL(MSR)
> > +
> > +	/* Restore TCR and clear any pending bits in TSR. */
> > +	RESTORE_SPR(TCR)
> > +	lis	r0, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h
> > +	mtspr	SPRN_TSR,r0
> 
> Please be internally consistent with whitespace after commas, even if the
> rest of the file is already inconsistent. :-P
> 
Thanks.

> > +
> > +	/* Kick decrementer */
> > +	li	r0,1
> > +	mtdec	r0
> 
> Why doesn't book3s need to kick the decrementer?
> 
Sorry, I not clear why book3s not do this. I think Anton or Ben could know the reason.

> -Scott



More information about the Linuxppc-dev mailing list