> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, June 13, 2013 6:04 AM
> To: Wang Dongsheng-B40534
> Cc: b...@kernel.crashing.org; johan...@sipsolutions.net; an...@enomsg.org;
> ga...@kernel.crashing.org; linuxppc-dev@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

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to