@@ -121,11 +121,16 @@ struct pt_regs
#ifdef CONFIG_PPC64_ELF_ABI_V2
#define STACK_FRAME_MIN_SIZE 32
-#define STACK_USER_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_MIN_SIZE + 16)
-#define STACK_INT_FRAME_REGS (STACK_FRAME_MIN_SIZE + 16)
-#define STACK_INT_FRAME_MARKER STACK_FRAME_MIN_SIZE
-#define STACK_SWITCH_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_MIN_SIZE + 16)
-#define STACK_SWITCH_FRAME_REGS (STACK_FRAME_MIN_SIZE + 16)
+#define STACK_USER_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_MIN_SIZE)
+#define STACK_INT_FRAME_REGS STACK_FRAME_MIN_SIZE
+#define STACK_INT_FRAME_MARKER 12 /* Reserved word next to CR save word */
+
+/*
+ * The switch frame has to match the format of the int frames up to pt_regs,
+ * because fields are accessed with the int frame pt_regs offsets.
+ */
+#define STACK_SWITCH_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_MIN_SIZE)
+#define STACK_SWITCH_FRAME_REGS STACK_FRAME_MIN_SIZE
#else
/*
* The ELFv1 ABI specifies 48 bytes plus a minimum 64 byte parameter save
There are 4 unused bytes in the minimum frame in the ELFv2 ABI. At the risk of causing a future ABI incompatibility, use this and save 16 bytes from interrupt and switch frames. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- arch/powerpc/include/asm/ptrace.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)