Skip to content

Commit

Permalink
x86/fred: Reserve space for the FRED stack frame
Browse files Browse the repository at this point in the history
When using FRED, reserve space at the top of the stack frame, just
like i386 does.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Shan Kang <shan.kang@intel.com>
Link: https://lore.kernel.org/r/20231205105030.8698-17-xin3.li@intel.com
  • Loading branch information
H. Peter Anvin (Intel) authored and Borislav Petkov (AMD) committed Jan 31, 2024
1 parent 32b09c2 commit 65c9cc9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions arch/x86/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,22 @@
* In vm86 mode, the hardware frame is much longer still, so add 16
* bytes to make room for the real-mode segments.
*
* x86_64 has a fixed-length stack frame.
* x86-64 has a fixed-length stack frame, but it depends on whether
* or not FRED is enabled. Future versions of FRED might make this
* dynamic, but for now it is always 2 words longer.
*/
#ifdef CONFIG_X86_32
# ifdef CONFIG_VM86
# define TOP_OF_KERNEL_STACK_PADDING 16
# else
# define TOP_OF_KERNEL_STACK_PADDING 8
# endif
#else
# define TOP_OF_KERNEL_STACK_PADDING 0
#else /* x86-64 */
# ifdef CONFIG_X86_FRED
# define TOP_OF_KERNEL_STACK_PADDING (2 * 8)
# else
# define TOP_OF_KERNEL_STACK_PADDING 0
# endif
#endif

/*
Expand Down

0 comments on commit 65c9cc9

Please sign in to comment.