Skip to contentSkip to conversation

Patch "alpha: make stack 16-byte aligned (most cases)" has been added to the 6.6-stable tree

PATCH New Greg KH 2 participants 5 messages Feb 18, 2025 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 2025021844-cruelness-freedom-e051@gregkh

#1 lore raw
Quoted 4 lines · On Tue, Feb 18, 2025 at 01:55:45PM +0100, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

alpha: make stack 16-byte aligned (most cases)

Hi Greg, thanks for applying this!

Quoted 4 lines

Patches currently in stable-queue which might be from [email protected] are

queue-6.6/alpha-make-stack-16-byte-aligned-most-cases.patch queue-6.6/alpha-align-stack-for-page-fault-and-user-unaligned-trap-handlers.patch

The third one (commit 77b823fa619f97d alpha: replace hardcoded stack offsets with autogenerated ones) is also needed, but it won't apply as-is to 6.6 and older kernels.

Do you want me to provide the patches?

Ivan.

author maintainer
#2 lore raw
Quoted 10 lines · Ivan Kokshaysky
Quoted 4 lines · On Tue, Feb 18, 2025 at 01:55:45PM +0100, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

alpha: make stack 16-byte aligned (most cases)

Hi Greg, thanks for applying this!

Quoted 2 lines

Patches currently in stable-queue which might be from [email protected] are

Quoted 8 lines
Quoted 2 lines

queue-6.6/alpha-make-stack-16-byte-aligned-most-cases.patch queue-6.6/alpha-align-stack-for-page-fault-and-user-unaligned-trap-handlers.patch

The third one (commit 77b823fa619f97d alpha: replace hardcoded stack offsets with autogenerated ones) is also needed, but it won't apply as-is to 6.6 and older kernels.

Do you want me to provide the patches?

Please do!

thanks,

greg k-h

#3 lore raw

PATCH 1/1 alpha: replace hardcoded stack offsets with autogenerated

[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).

---
 arch/alpha/kernel/asm-offsets.c | 4 ++++
 arch/alpha/kernel/entry.S       | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/alpha/kernel/asm-offsets.c +2 -0
index 4cfeae42c79a..e9dad60b147f 100644
@@ -32,7 +32,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);
arch/alpha/kernel/entry.S +0 -4
index dd26062d75b3..6fb38365539d 100644
@@ -15,10 +15,6 @@
 	.set noat
 	.cfi_sections	.debug_frame
 
-/* Stack offsets.  */
-#define SP_OFF			184
-#define SWITCH_STACK_SIZE	320
-
 .macro	CFI_START_OSF_FRAME	func
 	.align	4
 	.globl	\func
Signature · 1 line
2.47.2
#4 lore raw

PATCH 1/1 alpha: replace hardcoded stack offsets with autogenerated ones

In reply to Greg KH

[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).

---
 arch/alpha/kernel/asm-offsets.c | 4 ++++
 arch/alpha/kernel/entry.S       | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/alpha/kernel/asm-offsets.c +2 -0
index 4cfeae42c79a..e9dad60b147f 100644
@@ -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);
arch/alpha/kernel/entry.S +0 -4
index dd26062d75b3..6fb38365539d 100644
@@ -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
Signature · 1 line
2.47.2
author maintainer
#5 lore raw

Re: [PATCH][v6.6.x] alpha: replace hardcoded stack offsets with autogenerated ones

Quoted 1 line · Ivan Kokshaysky

[backported commit 77b823fa619f97d16409]

Nit, please use the full commit id.

Quoted 6 lines

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).

Also you dropped all the other signed-off-by here. I'll go fix this up...

thanks,

greg k-h