# Re: \[PATCH\] powerpc: Avoid link stack corruption for MMU on exceptions

- From: Stephen Rothwell \<hidden\>
- Date: 2013-08-13 05:06:20 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2013/08/9475830
- Thread: https://ratatoskr.run/linuxppc-dev/2013/08/9475828/t.md

```text
Hi Mikey,

On Tue, 13 Aug 2013 12:20:22 +1000 Michael Neuling [ref] wrote:
>
> @@ -101,14 +102,14 @@
>   * kernel, we need to use LR to get to the 2nd level handler.  So, save/restore
                             ^^
CTR

>   * it when required.
>   */
> -#define SAVE_LR(reg, area)	mflr	reg ; 	std	reg,area+EX_LR(r13)
> -#define GET_LR(reg, area) 			ld	reg,area+EX_LR(r13)
> -#define RESTORE_LR(reg, area)	ld	reg,area+EX_LR(r13) ; mtlr reg
> +#define SAVE_CTR(reg, area)	mfctr	reg ; 	std	reg,area+EX_CTR(r13)
> +#define GET_CTR(reg, area) 			ld	reg,area+EX_CTR(r13)
> +#define RESTORE_CTR(reg, area)	ld	reg,area+EX_CTR(r13) ; mtctr reg
>  #else
>  /* ...else LR is unused and in register. */
              ^^
and again

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
```

## Attachments

- [(unnamed)](https://ratatoskr.run/linuxppc-dev/2013/08/9475830/attachment/0) (application/pgp-signature, 836 bytes)
