[PATCH v2 3/4] alpha: make stack 16-byte aligned (most cases)

Ivan Kokshaysky posted 4 patches 1 year ago
There is a newer version of this series
[PATCH v2 3/4] alpha: make stack 16-byte aligned (most cases)
Posted by Ivan Kokshaysky 1 year ago
Add padding between the PAL-saved and kernel-saved registers
so that 'struct pt_regs' have an even number of 64-bit words.
This makes the stack properly aligned for most of the kernel
code, except two handlers which need special threatment.

Cc: stable@vger.kernel.org
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Signed-off-by: Ivan Kokshaysky <ink@unseen.parts>
---
 arch/alpha/include/asm/ptrace.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h
index 693d4c5b4dc7..694b82ca62f3 100644
--- a/arch/alpha/include/asm/ptrace.h
+++ b/arch/alpha/include/asm/ptrace.h
@@ -41,6 +41,8 @@ struct pt_regs {
 	unsigned long trap_a0;
 	unsigned long trap_a1;
 	unsigned long trap_a2;
+/* This makes the stack 16-byte aligned as GCC expects */
+	unsigned long __pad0;
 /* These are saved by PAL-code: */
 	unsigned long ps;
 	unsigned long pc;
-- 
2.39.5
Re: [PATCH v2 3/4] alpha: make stack 16-byte aligned (most cases)
Posted by Maciej W. Rozycki 1 year ago
On Fri, 31 Jan 2025, Ivan Kokshaysky wrote:

> Add padding between the PAL-saved and kernel-saved registers
> so that 'struct pt_regs' have an even number of 64-bit words.
> This makes the stack properly aligned for most of the kernel
> code, except two handlers which need special threatment.

 LGTM except for the request from 0/4 to improve the change description.

Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>

  Maciej