Re: [RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

From: Michael Neuling
Date: Tue Jul 17 2018 - 19:24:58 EST



> DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER);
> diff --git a/arch/powerpc/kernel/idle_book3s.S
> b/arch/powerpc/kernel/idle_book3s.S
> index d85d551..5069d42 100644
> --- a/arch/powerpc/kernel/idle_book3s.S
> +++ b/arch/powerpc/kernel/idle_book3s.S
> @@ -120,6 +120,9 @@ power9_save_additional_sprs:
> mfspr r4, SPRN_MMCR2
> std r3, STOP_MMCR1(r13)
> std r4, STOP_MMCR2(r13)
> +
> + mfspr r3, SPRN_SPRG3
> + std r3, STOP_SPRG3(r13)

We don't need to save it. Just restore it from paca->sprg_vdso which should
never change.

How can we do better at catching these missing SPRGs?

We missed this one and looking at c1b25a17d249 we missed the AMOR a couple of
months back. I'd rather we had some systematic way of finding the ones we are
missing, rather than playing wake-a-mole.

Mikey

> blr
>
> power9_restore_additional_sprs:
> @@ -144,7 +147,9 @@ power9_restore_additional_sprs:
> mtspr SPRN_MMCR1, r4
>
> ld r3, STOP_MMCR2(r13)
> + ld r4, STOP_SPRG3(r13)
> mtspr SPRN_MMCR2, r3
> + mtspr SPRN_SPRG3, r4
> blr
>
> /*