]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64: Fix kernel stack 16-byte alignment
authorNicholas Piggin <npiggin@gmail.com>
Thu, 15 Nov 2018 02:34:27 +0000 (12:34 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 15 Nov 2018 03:48:43 +0000 (14:48 +1100)
commita38de6eb9b9e6f97378e91e825e00a106473c833
tree28698e7d100f525b169a199a11fa8c25a8bbf92e
parent6fc75f7f3a3aa19fe2424b353fd5f5d3e1b039dc
powerpc/64: Fix kernel stack 16-byte alignment

Commit 261e7a9c15ef ("powerpc/64: Interrupts save PPR on stack rather
than thread_struct") changed sizeof(struct pt_regs) % 16 from 0 to 8,
which causes the interrupt frame allocation on kernel entry to put the
kernel stack out of alignment.

Quadword (16-byte) alignment for the stack is required by both the
64-bit v1 ABI (v1.9 § 3.2.2) and the 64-bit v2 ABI (v1.1 § 2.2.2.1).

Add a pad field to fix alignment, and add a BUILD_BUG_ON to catch this
in future.

Fixes: 261e7a9c15ef ("powerpc/64: Interrupts save PPR on stack rather than thread_struct")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/ptrace.h
arch/powerpc/kernel/setup_64.c