Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
"This update provides:

- prevent KASLR from randomizing EFI regions

- restrict the usage of -maccumulate-outgoing-args and document when
and why it is required.

- make the Global Physical Address calculation for UV4 systems work
correctly.

- address a copy->paste->forgot-edit problem in the MCE exception
table entries.

- assign a name to AMD MCA bank 3, so the sysfs file registration
works.

- add a missing include in the boot code"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/boot: Include missing header file
x86/mce/AMD: Give a name to MCA bank 3 when accessed with legacy MSRs
x86/build: Mostly disable '-maccumulate-outgoing-args'
x86/mm/KASLR: Exclude EFI region from KASLR VA space randomization
x86/mce: Fix copy/paste error in exception table entries
x86/platform/uv: Fix calculation of Global Physical Address

+53 -30
+31 -4
arch/x86/Makefile
··· 120 120 # -funit-at-a-time shrinks the kernel .text considerably 121 121 # unfortunately it makes reading oopses harder. 122 122 KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) 123 - 124 - # this works around some issues with generating unwind tables in older gccs 125 - # newer gccs do it by default 126 - KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args) 127 123 endif 128 124 129 125 ifdef CONFIG_X86_X32 ··· 141 145 # Don't unroll struct assignments with kmemcheck enabled 142 146 ifeq ($(CONFIG_KMEMCHECK),y) 143 147 KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy) 148 + endif 149 + 150 + # 151 + # If the function graph tracer is used with mcount instead of fentry, 152 + # '-maccumulate-outgoing-args' is needed to prevent a GCC bug 153 + # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109) 154 + # 155 + ifdef CONFIG_FUNCTION_GRAPH_TRACER 156 + ifndef CONFIG_HAVE_FENTRY 157 + ACCUMULATE_OUTGOING_ARGS := 1 158 + else 159 + ifeq ($(call cc-option-yn, -mfentry), n) 160 + ACCUMULATE_OUTGOING_ARGS := 1 161 + endif 162 + endif 163 + endif 164 + 165 + # 166 + # Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a 167 + # GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226). There's no way 168 + # to test for this bug at compile-time because the test case needs to execute, 169 + # which is a no-go for cross compilers. So check the GCC version instead. 170 + # 171 + ifdef CONFIG_JUMP_LABEL 172 + ifneq ($(ACCUMULATE_OUTGOING_ARGS), 1) 173 + ACCUMULATE_OUTGOING_ARGS = $(call cc-if-fullversion, -lt, 040502, 1) 174 + endif 175 + endif 176 + 177 + ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1) 178 + KBUILD_CFLAGS += -maccumulate-outgoing-args 144 179 endif 145 180 146 181 # Stackpointer is addressed different for 32 bit and 64 bit x86
-18
arch/x86/Makefile_32.cpu
··· 45 45 # cpu entries 46 46 cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686)) 47 47 48 - # Work around the pentium-mmx code generator madness of gcc4.4.x which 49 - # does stack alignment by generating horrible code _before_ the mcount 50 - # prologue (push %ebp, mov %esp, %ebp) which breaks the function graph 51 - # tracer assumptions. For i686, generic, core2 this is set by the 52 - # compiler anyway 53 - ifeq ($(CONFIG_FUNCTION_GRAPH_TRACER), y) 54 - ADD_ACCUMULATE_OUTGOING_ARGS := y 55 - endif 56 - 57 - # Work around to a bug with asm goto with first implementations of it 58 - # in gcc causing gcc to mess up the push and pop of the stack in some 59 - # uses of asm goto. 60 - ifeq ($(CONFIG_JUMP_LABEL), y) 61 - ADD_ACCUMULATE_OUTGOING_ARGS := y 62 - endif 63 - 64 - cflags-$(ADD_ACCUMULATE_OUTGOING_ARGS) += $(call cc-option,-maccumulate-outgoing-args) 65 - 66 48 # Bug fix for binutils: this option is required in order to keep 67 49 # binutils from generating NOPL instructions against our will. 68 50 ifneq ($(CONFIG_X86_P6_NOP),y)
+1
arch/x86/boot/compressed/error.c
··· 4 4 * memcpy() and memmove() are defined for the compressed boot environment. 5 5 */ 6 6 #include "misc.h" 7 + #include "error.h" 7 8 8 9 void warn(char *m) 9 10 {
+5 -3
arch/x86/include/asm/uv/uv_hub.h
··· 485 485 486 486 if (paddr < uv_hub_info->lowmem_remap_top) 487 487 paddr |= uv_hub_info->lowmem_remap_base; 488 - paddr |= uv_hub_info->gnode_upper; 489 - if (m_val) 488 + 489 + if (m_val) { 490 + paddr |= uv_hub_info->gnode_upper; 490 491 paddr = ((paddr << uv_hub_info->m_shift) 491 492 >> uv_hub_info->m_shift) | 492 493 ((paddr >> uv_hub_info->m_val) 493 494 << uv_hub_info->n_lshift); 494 - else 495 + } else { 495 496 paddr |= uv_soc_phys_ram_to_nasid(paddr) 496 497 << uv_hub_info->gpa_shift; 498 + } 497 499 return paddr; 498 500 } 499 501
+2 -1
arch/x86/kernel/apic/x2apic_uv_x.c
··· 1105 1105 node_id.v = uv_read_local_mmr(UVH_NODE_ID); 1106 1106 uv_cpuid.gnode_shift = max_t(unsigned int, uv_cpuid.gnode_shift, mn.n_val); 1107 1107 hi->gnode_extra = (node_id.s.node_id & ~((1 << uv_cpuid.gnode_shift) - 1)) >> 1; 1108 - hi->gnode_upper = (unsigned long)hi->gnode_extra << mn.m_val; 1108 + if (mn.m_val) 1109 + hi->gnode_upper = (u64)hi->gnode_extra << mn.m_val; 1109 1110 1110 1111 if (uv_gp_table) { 1111 1112 hi->global_mmr_base = uv_gp_table->mmr_base;
+1 -1
arch/x86/kernel/cpu/mcheck/mce_amd.c
··· 60 60 "load_store", 61 61 "insn_fetch", 62 62 "combined_unit", 63 - "", 63 + "decode_unit", 64 64 "northbridge", 65 65 "execution_unit", 66 66 };
+6
arch/x86/kernel/ftrace.c
··· 29 29 #include <asm/ftrace.h> 30 30 #include <asm/nops.h> 31 31 32 + #if defined(CONFIG_FUNCTION_GRAPH_TRACER) && \ 33 + !defined(CC_USING_FENTRY) && \ 34 + !defined(CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE) 35 + # error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE 36 + #endif 37 + 32 38 #ifdef CONFIG_DYNAMIC_FTRACE 33 39 34 40 int ftrace_arch_code_modify_prepare(void)
+1 -1
arch/x86/lib/memcpy_64.S
··· 290 290 _ASM_EXTABLE_FAULT(.L_copy_leading_bytes, .L_memcpy_mcsafe_fail) 291 291 _ASM_EXTABLE_FAULT(.L_cache_w0, .L_memcpy_mcsafe_fail) 292 292 _ASM_EXTABLE_FAULT(.L_cache_w1, .L_memcpy_mcsafe_fail) 293 - _ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail) 293 + _ASM_EXTABLE_FAULT(.L_cache_w2, .L_memcpy_mcsafe_fail) 294 294 _ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail) 295 295 _ASM_EXTABLE_FAULT(.L_cache_w4, .L_memcpy_mcsafe_fail) 296 296 _ASM_EXTABLE_FAULT(.L_cache_w5, .L_memcpy_mcsafe_fail)
+2 -2
arch/x86/mm/kaslr.c
··· 48 48 #if defined(CONFIG_X86_ESPFIX64) 49 49 static const unsigned long vaddr_end = ESPFIX_BASE_ADDR; 50 50 #elif defined(CONFIG_EFI) 51 - static const unsigned long vaddr_end = EFI_VA_START; 51 + static const unsigned long vaddr_end = EFI_VA_END; 52 52 #else 53 53 static const unsigned long vaddr_end = __START_KERNEL_map; 54 54 #endif ··· 105 105 */ 106 106 BUILD_BUG_ON(vaddr_start >= vaddr_end); 107 107 BUILD_BUG_ON(IS_ENABLED(CONFIG_X86_ESPFIX64) && 108 - vaddr_end >= EFI_VA_START); 108 + vaddr_end >= EFI_VA_END); 109 109 BUILD_BUG_ON((IS_ENABLED(CONFIG_X86_ESPFIX64) || 110 110 IS_ENABLED(CONFIG_EFI)) && 111 111 vaddr_end >= __START_KERNEL_map);
+4
scripts/Kbuild.include
··· 148 148 # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) 149 149 cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) 150 150 151 + # cc-if-fullversion 152 + # Usage: EXTRA_CFLAGS += $(call cc-if-fullversion, -lt, 040502, -O1) 153 + cc-if-fullversion = $(shell [ $(cc-fullversion) $(1) $(2) ] && echo $(3) || echo $(4)) 154 + 151 155 # cc-ldoption 152 156 # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) 153 157 cc-ldoption = $(call try-run,\