Commit 217eee72 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - A defconfig fix (Daniel Díaz)

 - Disable relocation relaxation for the compressed kernel when not
   built as -pie as in that case kernels built with clang and linked
   with LLD fail to boot due to the linker optimizing some instructions
   in non-PIE form; the gory details in the commit message (Arvind
   Sankar)

 - A fix for the "bad bp value" warning issued by the frame-pointer
   unwinder (Josh Poimboeuf)

* tag 'x86_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/unwind/fp: Fix FP unwinding in ret_from_fork
  x86/boot/compressed: Disable relocation relaxation
  x86/defconfigs: Explicitly unset CONFIG_64BIT in i386_defconfig
parents 4a123dba 6f9885a3
...@@ -43,6 +43,8 @@ KBUILD_CFLAGS += -Wno-pointer-sign ...@@ -43,6 +43,8 @@ KBUILD_CFLAGS += -Wno-pointer-sign
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += -D__DISABLE_EXPORTS KBUILD_CFLAGS += -D__DISABLE_EXPORTS
# Disable relocation relaxation in case the link is not PIE.
KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n GCOV_PROFILE := n
......
...@@ -19,6 +19,7 @@ CONFIG_CGROUP_CPUACCT=y ...@@ -19,6 +19,7 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y CONFIG_PROFILING=y
# CONFIG_64BIT is not set
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_X86_GENERIC=y CONFIG_X86_GENERIC=y
CONFIG_HPET_TIMER=y CONFIG_HPET_TIMER=y
......
...@@ -60,12 +60,26 @@ ...@@ -60,12 +60,26 @@
#define FRAME_END "pop %" _ASM_BP "\n" #define FRAME_END "pop %" _ASM_BP "\n"
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
#define ENCODE_FRAME_POINTER \ #define ENCODE_FRAME_POINTER \
"lea 1(%rsp), %rbp\n\t" "lea 1(%rsp), %rbp\n\t"
static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
{
return (unsigned long)regs + 1;
}
#else /* !CONFIG_X86_64 */ #else /* !CONFIG_X86_64 */
#define ENCODE_FRAME_POINTER \ #define ENCODE_FRAME_POINTER \
"movl %esp, %ebp\n\t" \ "movl %esp, %ebp\n\t" \
"andl $0x7fffffff, %ebp\n\t" "andl $0x7fffffff, %ebp\n\t"
static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
{
return (unsigned long)regs & 0x7fffffff;
}
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
...@@ -83,6 +97,11 @@ ...@@ -83,6 +97,11 @@
#define ENCODE_FRAME_POINTER #define ENCODE_FRAME_POINTER
static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
{
return 0;
}
#endif #endif
#define FRAME_BEGIN #define FRAME_BEGIN
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <asm/spec-ctrl.h> #include <asm/spec-ctrl.h>
#include <asm/io_bitmap.h> #include <asm/io_bitmap.h>
#include <asm/proto.h> #include <asm/proto.h>
#include <asm/frame.h>
#include "process.h" #include "process.h"
...@@ -133,7 +134,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, ...@@ -133,7 +134,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg,
fork_frame = container_of(childregs, struct fork_frame, regs); fork_frame = container_of(childregs, struct fork_frame, regs);
frame = &fork_frame->frame; frame = &fork_frame->frame;
frame->bp = 0; frame->bp = encode_frame_pointer(childregs);
frame->ret_addr = (unsigned long) ret_from_fork; frame->ret_addr = (unsigned long) ret_from_fork;
p->thread.sp = (unsigned long) fork_frame; p->thread.sp = (unsigned long) fork_frame;
p->thread.io_bitmap = NULL; p->thread.io_bitmap = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment