mirror of https://lore.kernel.org/lkml/
 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>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: [PATCH v2 3/4] alpha: make stack 16-byte aligned (most cases)
Date: Fri, 31 Jan 2025 11:41:28 +0100	[thread overview]
Message-ID: <20250131104129.11052-4-ink@unseen.parts> (raw)
In-Reply-To: <20250131104129.11052-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.

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


  parent reply	other threads:[~2025-01-31 10:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 10:41 [PATCH v2 0/4] alpha: stack fixes Ivan Kokshaysky
2025-01-31 10:41 ` [PATCH v2 1/4] alpha/uapi: do not expose kernel-only stack frame structures Ivan Kokshaysky
2025-02-02 17:39   ` Maciej W. Rozycki
2025-02-03 17:13     ` Ivan Kokshaysky
2025-02-04 13:42       ` Maciej W. Rozycki
2025-02-03 11:01   ` John Paul Adrian Glaubitz
2025-01-31 10:41 ` [PATCH v2 2/4] alpha: replace hardcoded stack offsets with autogenerated ones Ivan Kokshaysky
2025-02-02 17:40   ` Maciej W. Rozycki
2025-01-31 10:41 ` Ivan Kokshaysky [this message]
2025-02-02 17:41   ` [PATCH v2 3/4] alpha: make stack 16-byte aligned (most cases) Maciej W. Rozycki
2025-01-31 10:41 ` [PATCH v2 4/4] alpha: align stack for page fault and user unaligned trap handlers Ivan Kokshaysky
2025-02-02 17:41   ` Maciej W. Rozycki
2025-02-01  9:46 ` [PATCH v2 0/4] alpha: stack fixes John Paul Adrian Glaubitz
2025-02-01 23:12   ` Michael Cree
2025-02-02  9:43     ` Magnus Lindholm
2025-02-02 18:13       ` Michael Cree
2025-02-03 11:05   ` John Paul Adrian Glaubitz
2025-02-02 17:37 ` Maciej W. Rozycki

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=20250131104129.11052-4-ink@unseen.parts \
    --to=ink@unseen.parts \
    --cc=arnd@arndb.de \
    --cc=glaubitz@physik.fu-berlin.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=stable@vger.kernel.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

all inboxes | Powered by JetHome®