Skip to content

Commit

Permalink
powerpc: Only pad struct pt_regs when needed
Browse files Browse the repository at this point in the history
If neither KUAP nor PPC64 is selected, there is nothing in the second
union of struct pt_regs, so the alignment padding is waste of memory.

Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/d536bbc46094f66b24d3017343be25164f232933.1620307840.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed May 17, 2021
1 parent 8af8d72 commit b09049c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct pt_regs
unsigned long result;
};
};

#if defined(CONFIG_PPC64) || defined(CONFIG_PPC_KUAP)
union {
struct {
#ifdef CONFIG_PPC64
Expand All @@ -67,6 +67,7 @@ struct pt_regs
};
unsigned long __pad[4]; /* Maintain 16 byte interrupt stack alignment */
};
#endif
};
#endif

Expand Down

0 comments on commit b09049c

Please sign in to comment.