Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 496dcc50 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 128c434a 6b1cc946
Loading
Loading
Loading
Loading
+31 −4
Original line number Original line Diff line number Diff line
@@ -120,10 +120,6 @@ else
        # -funit-at-a-time shrinks the kernel .text considerably
        # -funit-at-a-time shrinks the kernel .text considerably
        # unfortunately it makes reading oopses harder.
        # unfortunately it makes reading oopses harder.
        KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
        KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)

        # this works around some issues with generating unwind tables in older gccs
        # newer gccs do it by default
        KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args)
endif
endif


ifdef CONFIG_X86_X32
ifdef CONFIG_X86_X32
@@ -147,6 +143,37 @@ ifeq ($(CONFIG_KMEMCHECK),y)
	KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy)
	KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy)
endif
endif


#
# If the function graph tracer is used with mcount instead of fentry,
# '-maccumulate-outgoing-args' is needed to prevent a GCC bug
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109)
#
ifdef CONFIG_FUNCTION_GRAPH_TRACER
  ifndef CONFIG_HAVE_FENTRY
	ACCUMULATE_OUTGOING_ARGS := 1
  else
    ifeq ($(call cc-option-yn, -mfentry), n)
	ACCUMULATE_OUTGOING_ARGS := 1
    endif
  endif
endif

#
# Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a
# GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226).  There's no way
# to test for this bug at compile-time because the test case needs to execute,
# which is a no-go for cross compilers.  So check the GCC version instead.
#
ifdef CONFIG_JUMP_LABEL
  ifneq ($(ACCUMULATE_OUTGOING_ARGS), 1)
	ACCUMULATE_OUTGOING_ARGS = $(call cc-if-fullversion, -lt, 040502, 1)
  endif
endif

ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1)
	KBUILD_CFLAGS += -maccumulate-outgoing-args
endif

# Stackpointer is addressed different for 32 bit and 64 bit x86
# Stackpointer is addressed different for 32 bit and 64 bit x86
sp-$(CONFIG_X86_32) := esp
sp-$(CONFIG_X86_32) := esp
sp-$(CONFIG_X86_64) := rsp
sp-$(CONFIG_X86_64) := rsp
+0 −18
Original line number Original line Diff line number Diff line
@@ -45,24 +45,6 @@ cflags-$(CONFIG_MGEODE_LX) += $(call cc-option,-march=geode,-march=pentium-mmx)
# cpu entries
# cpu entries
cflags-$(CONFIG_X86_GENERIC) 	+= $(call tune,generic,$(call tune,i686))
cflags-$(CONFIG_X86_GENERIC) 	+= $(call tune,generic,$(call tune,i686))


# Work around the pentium-mmx code generator madness of gcc4.4.x which
# does stack alignment by generating horrible code _before_ the mcount
# prologue (push %ebp, mov %esp, %ebp) which breaks the function graph
# tracer assumptions. For i686, generic, core2 this is set by the
# compiler anyway
ifeq ($(CONFIG_FUNCTION_GRAPH_TRACER), y)
ADD_ACCUMULATE_OUTGOING_ARGS := y
endif

# Work around to a bug with asm goto with first implementations of it
# in gcc causing gcc to mess up the push and pop of the stack in some
# uses of asm goto.
ifeq ($(CONFIG_JUMP_LABEL), y)
ADD_ACCUMULATE_OUTGOING_ARGS := y
endif

cflags-$(ADD_ACCUMULATE_OUTGOING_ARGS) += $(call cc-option,-maccumulate-outgoing-args)

# Bug fix for binutils: this option is required in order to keep
# Bug fix for binutils: this option is required in order to keep
# binutils from generating NOPL instructions against our will.
# binutils from generating NOPL instructions against our will.
ifneq ($(CONFIG_X86_P6_NOP),y)
ifneq ($(CONFIG_X86_P6_NOP),y)
+1 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,7 @@
 * memcpy() and memmove() are defined for the compressed boot environment.
 * memcpy() and memmove() are defined for the compressed boot environment.
 */
 */
#include "misc.h"
#include "misc.h"
#include "error.h"


void warn(char *m)
void warn(char *m)
{
{
+5 −3
Original line number Original line Diff line number Diff line
@@ -485,15 +485,17 @@ static inline unsigned long uv_soc_phys_ram_to_gpa(unsigned long paddr)


	if (paddr < uv_hub_info->lowmem_remap_top)
	if (paddr < uv_hub_info->lowmem_remap_top)
		paddr |= uv_hub_info->lowmem_remap_base;
		paddr |= uv_hub_info->lowmem_remap_base;

	if (m_val) {
		paddr |= uv_hub_info->gnode_upper;
		paddr |= uv_hub_info->gnode_upper;
	if (m_val)
		paddr = ((paddr << uv_hub_info->m_shift)
		paddr = ((paddr << uv_hub_info->m_shift)
						>> uv_hub_info->m_shift) |
						>> uv_hub_info->m_shift) |
			((paddr >> uv_hub_info->m_val)
			((paddr >> uv_hub_info->m_val)
						<< uv_hub_info->n_lshift);
						<< uv_hub_info->n_lshift);
	else
	} else {
		paddr |= uv_soc_phys_ram_to_nasid(paddr)
		paddr |= uv_soc_phys_ram_to_nasid(paddr)
						<< uv_hub_info->gpa_shift;
						<< uv_hub_info->gpa_shift;
	}
	return paddr;
	return paddr;
}
}


+2 −1
Original line number Original line Diff line number Diff line
@@ -1105,7 +1105,8 @@ void __init uv_init_hub_info(struct uv_hub_info_s *hi)
	node_id.v		= uv_read_local_mmr(UVH_NODE_ID);
	node_id.v		= uv_read_local_mmr(UVH_NODE_ID);
	uv_cpuid.gnode_shift	= max_t(unsigned int, uv_cpuid.gnode_shift, mn.n_val);
	uv_cpuid.gnode_shift	= max_t(unsigned int, uv_cpuid.gnode_shift, mn.n_val);
	hi->gnode_extra		= (node_id.s.node_id & ~((1 << uv_cpuid.gnode_shift) - 1)) >> 1;
	hi->gnode_extra		= (node_id.s.node_id & ~((1 << uv_cpuid.gnode_shift) - 1)) >> 1;
	hi->gnode_upper		= (unsigned long)hi->gnode_extra << mn.m_val;
	if (mn.m_val)
		hi->gnode_upper	= (u64)hi->gnode_extra << mn.m_val;


	if (uv_gp_table) {
	if (uv_gp_table) {
		hi->global_mmr_base	= uv_gp_table->mmr_base;
		hi->global_mmr_base	= uv_gp_table->mmr_base;
Loading