public inbox for linux-alpha@vger.kernel.org
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@unseen.parts>
To: Richard Henderson <richard.henderson@linaro.org>,
	Matt Turner <mattst88@gmail.com>, Oleg Nesterov <oleg@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>,
	"Paul E. McKenney" <paulmck@kernel.org>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>,
	Magnus Lindholm <linmag7@gmail.com>,
	linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] alpha: make stack 16-byte aligned (most cases)
Date: Wed, 29 Jan 2025 10:43:11 +0100	[thread overview]
Message-ID: <20250129094312.27399-4-ink@unseen.parts> (raw)
In-Reply-To: <20250129094312.27399-1-ink@unseen.parts>

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.

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


  parent reply	other threads:[~2025-01-29  9:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29  9:43 [PATCH 0/4] alpha: stack fixes Ivan Kokshaysky
2025-01-29  9:43 ` [PATCH 1/4] alpha/uapi: do not expose kernel-only stack frame structures Ivan Kokshaysky
2025-01-29 18:32   ` John Paul Adrian Glaubitz
2025-01-29 19:59     ` Ivan Kokshaysky
2025-01-29  9:43 ` [PATCH 2/4] alpha: replace hardcoded stack offsets with autogenerated ones Ivan Kokshaysky
2025-01-29  9:43 ` Ivan Kokshaysky [this message]
2025-01-29  9:43 ` [PATCH 4/4] alpha: align stack for page fault and user unaligned trap handlers Ivan Kokshaysky
2025-01-29 10:06 ` [PATCH 0/4] alpha: stack fixes John Paul Adrian Glaubitz
2025-01-29 16:02 ` Maciej W. Rozycki
2025-01-30 14:33   ` Ivan Kokshaysky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250129094312.27399-4-ink@unseen.parts \
    --to=ink@unseen.parts \
    --cc=arnd@arndb.de \
    --cc=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=mattst88@gmail.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=richard.henderson@linaro.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox