Skip to content

Commit c38c04c

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Misc fixes: three build fixes, an unwinder fix and a microcode loader fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode/AMD: Fix more fallout from CONFIG_RANDOMIZE_MEMORY=y x86: Fix export for mcount and __fentry__ x86/quirks: Hide maybe-uninitialized warning x86/build: Fix build with older GCC versions x86/unwind: Fix empty stack dereference in guess unwinder
2 parents a8006bd + 1c27f64 commit c38c04c

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

arch/x86/entry/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
OBJECT_FILES_NON_STANDARD_entry_$(BITS).o := y
66
OBJECT_FILES_NON_STANDARD_entry_64_compat.o := y
77

8-
CFLAGS_syscall_64.o += -Wno-override-init
9-
CFLAGS_syscall_32.o += -Wno-override-init
8+
CFLAGS_syscall_64.o += $(call cc-option,-Wno-override-init,)
9+
CFLAGS_syscall_32.o += $(call cc-option,-Wno-override-init,)
1010
obj-y := entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
1111
obj-y += common.o
1212

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ int __init save_microcode_in_initrd_amd(void)
429429
* We need the physical address of the container for both bitness since
430430
* boot_params.hdr.ramdisk_image is a physical address.
431431
*/
432-
cont = __pa(container);
432+
cont = __pa_nodebug(container);
433433
cont_va = container;
434434
#endif
435435

arch/x86/kernel/mcount_64.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
#ifdef CC_USING_FENTRY
2020
# define function_hook __fentry__
21+
EXPORT_SYMBOL(__fentry__)
2122
#else
2223
# define function_hook mcount
24+
EXPORT_SYMBOL(mcount)
2325
#endif
2426

2527
/* All cases save the original rbp (8 bytes) */
@@ -295,7 +297,6 @@ trace:
295297
jmp fgraph_trace
296298
END(function_hook)
297299
#endif /* CONFIG_DYNAMIC_FTRACE */
298-
EXPORT_SYMBOL(function_hook)
299300
#endif /* CONFIG_FUNCTION_TRACER */
300301

301302
#ifdef CONFIG_FUNCTION_GRAPH_TRACER

arch/x86/kernel/quirks.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,6 @@ static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev)
625625
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3,
626626
amd_disable_seq_and_redirect_scrub);
627627

628-
#endif
629-
630628
#if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE)
631629
#include <linux/jump_label.h>
632630
#include <asm/string_64.h>
@@ -657,3 +655,4 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_
657655
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, quirk_intel_brickland_xeon_ras_cap);
658656
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2083, quirk_intel_purley_xeon_ras_cap);
659657
#endif
658+
#endif

arch/x86/kernel/unwind_guess.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
4747
get_stack_info(first_frame, state->task, &state->stack_info,
4848
&state->stack_mask);
4949

50-
if (!__kernel_text_address(*first_frame))
50+
/*
51+
* The caller can provide the address of the first frame directly
52+
* (first_frame) or indirectly (regs->sp) to indicate which stack frame
53+
* to start unwinding at. Skip ahead until we reach it.
54+
*/
55+
if (!unwind_done(state) &&
56+
(!on_stack(&state->stack_info, first_frame, sizeof(long)) ||
57+
!__kernel_text_address(*first_frame)))
5158
unwind_next_frame(state);
5259
}
5360
EXPORT_SYMBOL_GPL(__unwind_start);

0 commit comments

Comments
 (0)