All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@unseen.parts>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linmag7@gmail.com, macro@orcam.me.uk, mattst88@gmail.com,
	stable@vger.kernel.org
Subject: [PATCH][v6.6.x] alpha: replace hardcoded stack offsets with autogenerated ones
Date: Tue, 18 Feb 2025 15:52:20 +0100	[thread overview]
Message-ID: <Z7SepJjMmO-MucUO@minute> (raw)
In-Reply-To: <2025021849-zoning-bath-bc43@gregkh>

[backported commit 77b823fa619f97d16409]

This allows the assembly in entry.S to automatically keep in sync with
changes in the stack layout (struct pt_regs and struct switch_stack).

Cc: stable@vger.kernel.org # v6.6.x
Signed-off-by: Ivan Kokshaysky <ink@unseen.parts>
---
 arch/alpha/kernel/asm-offsets.c | 4 ++++
 arch/alpha/kernel/entry.S       | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c
index 4cfeae42c79a..e9dad60b147f 100644
--- a/arch/alpha/kernel/asm-offsets.c
+++ b/arch/alpha/kernel/asm-offsets.c
@@ -34,7 +34,9 @@ void foo(void)
         DEFINE(CRED_EGID, offsetof(struct cred, egid));
         BLANK();
 
+	DEFINE(SP_OFF, offsetof(struct pt_regs, ps));
 	DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
+	DEFINE(SWITCH_STACK_SIZE, sizeof(struct switch_stack));
 	DEFINE(PT_PTRACED, PT_PTRACED);
 	DEFINE(CLONE_VM, CLONE_VM);
 	DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index dd26062d75b3..6fb38365539d 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -15,10 +15,6 @@
 	.set noat
 	.cfi_sections	.debug_frame
 
-/* Stack offsets.  */
-#define SP_OFF			184
-#define SWITCH_STACK_SIZE	64
-
 .macro	CFI_START_OSF_FRAME	func
 	.align	4
 	.globl	\func
-- 
2.47.2


  parent reply	other threads:[~2025-02-18 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2025021844-cruelness-freedom-e051@gregkh>
2025-02-18 13:40 ` Patch "alpha: make stack 16-byte aligned (most cases)" has been added to the 6.6-stable tree Ivan Kokshaysky
2025-02-18 14:04   ` Greg KH
2025-02-18 14:50     ` [PATCH][v4.19-v6.1] alpha: replace hardcoded stack offsets with autogenerated Ivan Kokshaysky
2025-02-18 14:52     ` Ivan Kokshaysky [this message]
2025-02-18 15:12       ` [PATCH][v6.6.x] alpha: replace hardcoded stack offsets with autogenerated ones Greg KH

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=Z7SepJjMmO-MucUO@minute \
    --to=ink@unseen.parts \
    --cc=gregkh@linuxfoundation.org \
    --cc=linmag7@gmail.com \
    --cc=macro@orcam.me.uk \
    --cc=mattst88@gmail.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.