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

Commit 2f44069a authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

Merge remote-tracking branch 'remotes/origin/tmp-3f8d1912' into msm-4.14



* remotes/origin/tmp-3f8d1912:
  Linux 4.14.38
  ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
  s390/uprobes: implement arch_uretprobe_is_alive()
  s390/dasd: fix IO error for newly defined devices
  s390/cio: update chpid descriptor after resource accessibility event
  tracing: Fix missing tab for hwlat_detector print format
  block/swim: Fix IO error at end of medium
  block/swim: Fix array bounds check
  block/swim: Select appropriate drive on device open
  block/swim: Rename macros to avoid inconsistent inverted logic
  block/swim: Remove extra put_disk() call from error path
  block/swim: Don't log an error message for an invalid ioctl
  block/swim: Check drive type
  m68k/mac: Don't remap SWIM MMIO region
  fsnotify: Fix fsnotify_mark_connector race
  cdrom: information leak in cdrom_ioctl_media_changed()
  scsi: mptsas: Disable WRITE SAME
  commoncap: Handle memory allocation failure.
  Revert "mm/hmm: fix header file if/else/endif maze"
  arm64: dts: rockchip: remove vdd_log from rk3399-puma
  microblaze: Setup dependencies for ASM optimized lib functions
  s390: correct module section names for expoline code revert
  s390: correct nospec auto detection init order
  s390: add sysfs attributes for spectre
  s390: report spectre mitigation via syslog
  s390: add automatic detection of the spectre defense
  s390: move nobp parameter functions to nospec-branch.c
  s390/entry.S: fix spurious zeroing of r0
  s390: do not bypass BPENTER for interrupt system calls
  s390: Replace IS_ENABLED(EXPOLINE_*) with IS_ENABLED(CONFIG_EXPOLINE_*)
  KVM: s390: force bp isolation for VSIE
  s390: introduce execute-trampolines for branches
  s390: run user space and KVM guests with modified branch prediction
  s390: add options to change branch prediction behaviour for the kernel
  s390/alternative: use a copy of the facility bit mask
  s390: add optimized array_index_mask_nospec
  s390: scrub registers on kernel entry and KVM exit
  KVM: s390: wire up bpb feature
  s390: enable CPU alternatives unconditionally
  s390: introduce CPU alternatives
  virtio_net: fix adding vids on big-endian
  virtio_net: split out ctrl buffer
  net: ethernet: ti: cpsw: fix tx vlan priority mapping
  llc: fix NULL pointer deref for SOCK_ZAPPED
  llc: hold llc_sap before release_sock()
  net: sched: ife: check on metadata length
  net: sched: ife: handle malformed tlv length
  tcp: clear tp->packets_out when purging write queue
  net: sched: ife: signal not finding metaid
  strparser: Fix incorrect strp->need_bytes value.
  amd-xgbe: Only use the SFP supported transceiver signals
  strparser: Do not call mod_delayed_work with a timeout of LONG_MAX
  amd-xgbe: Improve KR auto-negotiation and training
  sctp: do not check port in sctp_inet6_cmp_addr
  amd-xgbe: Add pre/post auto-negotiation phy hooks
  vlan: Fix reading memory beyond skb->tail in skb_vlan_tagged_multi
  pppoe: check sockaddr length in pppoe_connect()
  tipc: add policy for TIPC_NLA_NET_ADDR
  packet: fix bitfield update race
  team: fix netconsole setup over team
  net/smc: fix shutdown in state SMC_LISTEN
  team: avoid adding twice the same option to the event list
  net: fix deadlock while clearing neighbor proxy table
  tcp: md5: reject TCP_MD5SIG or TCP_MD5SIG_EXT on established sockets
  net: af_packet: fix race in PACKET_{R|T}X_RING
  tcp: don't read out-of-bounds opsize
  llc: delete timers synchronously in llc_sk_free()
  net: validate attribute sizes in neigh_dump_table()
  l2tp: check sockaddr length in pppol2tp_connect()
  KEYS: DNS: limit the length of option strings
  ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts
  ipv6: add RTA_TABLE and RTA_PREFSRC to rtm_ipv6_policy
  bonding: do not set slave_dev npinfo before slave_enable_netpoll in bond_enslave
  Revert "ath10k: send (re)assoc peer command when NSS changed"
  tpm: add retry logic
  tpm: tpm-interface: fix tpm_transmit/_cmd kdoc
  tpm: cmd_ready command can be issued only after granting locality
  i40e: Fix attach VF to VM issue
  drm: bridge: dw-hdmi: Fix overflow workaround for Amlogic Meson GX SoCs
  Revert "pinctrl: intel: Initialize GPIO properly when used through irqchip"
  ANDROID: staging: lustre: fix filler function type
  ANDROID: fs: gfs2: fix filler function type
  ANDROID: fs: exofs: fix filler function type
  ANDROID: fs: afs: fix filler function type
  ANDROID: fs: nfs: fix filler function type
  ANDROID: fs: fuse: fix filler function type mismatch
  ANDROID: mm: fix filler function type mismatch
  ANDROID: media-device: fix ioctl function types
  ANDROID: v4l2-ioctl: fix function types for IOCTL_INFO_STD
  ANDROID: arch/arm64/crypto: fix CFI in SHA CE
  ANDROID: arm64: kvm: disable CFI
  ANDROID: arm64: mark kpti_install_ng_mappings as __nocfi
  ANDROID: arm64: disable CFI for cpu_replace_ttbr1
  ANDROID: kallsyms: strip the .cfi postfix from symbols with CONFIG_CFI_CLANG
  ANDROID: add support for clang Control Flow Integrity (CFI)
  ANDROID: HACK: init: ensure initcall ordering with LTO
  ANDROID: drivers/misc: disable LTO for lkdtm_rodata.o
  ANDROID: arm64: vdso: disable LTO
  FROMLIST: arm64: select ARCH_SUPPORTS_LTO_CLANG
  FROMLIST: arm64: disable RANDOMIZE_MODULE_REGION_FULL with LTO_CLANG
  ANDROID: arm64: disable ARM64_ERRATUM_843419 for clang LTO
  ANDROID: arm64: pass code model to LLVMgold
  FROMLIST: arm64: make mrs_s and msr_s macros work with LTO
  FROMLIST: efi/libstub: disable LTO
  FROMLIST: scripts/mod: disable LTO for empty.c
  FROMLIST: kbuild: fix dynamic ftrace with clang LTO
  FROMLIST: kbuild: add support for clang LTO
  FROMLIST: arm64: fix -m for GNU gold
  FROMLIST: arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS
  FROMLIST: arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold
  FROMLIST: kbuild: add __ld-ifversion and linker-specific macros
  FROMLIST: kbuild: add ld-name macro
  FROMLIST: arm64: keep .altinstructions and .altinstr_replacement
  ANDROID: arm64: fix LD_DEAD_CODE_DATA_ELIMINATION
  FROMLIST: kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION
  FROMLIST: kbuild: add __cc-ifversion and compiler-specific variants
  UPSTREAM: console: Drop added "static" for newport_con
  UPSTREAM: tracing: always define trace_{irq,preempt}_{enable_disable}

Conflicts:
	Makefile

Change-Id: Ied1a215e68f428eff9c1911491a4e364ffd1f679
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parents 5e5be2cc 3f8d1912
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2556,6 +2556,9 @@

	noalign		[KNL,ARM]

	noaltinstr	[S390] Disables alternative instructions patching
			(CPU alternatives feature).

	noapic		[SMP,APIC] Tells the kernel to not make use of any
			IOAPICs that may be present in the system.

+86 −2
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 37
SUBLEVEL = 38
EXTRAVERSION =
NAME = Petit Gorille

@@ -378,6 +378,7 @@ endif
AS		= $(CROSS_COMPILE)as
LD		= $(CROSS_COMPILE)ld
REAL_CC		= $(CROSS_COMPILE)gcc
LDGOLD		= $(CROSS_COMPILE)ld.gold
CPP		= $(CC) -E
AR		= $(CROSS_COMPILE)ar
NM		= $(CROSS_COMPILE)nm
@@ -640,6 +641,20 @@ CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disabl
CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)
export CFLAGS_GCOV CFLAGS_KCOV

# Make toolchain changes before including arch/$(SRCARCH)/Makefile to ensure
# ar/cc/ld-* macros return correct values.
ifdef CONFIG_LTO_CLANG
# use GNU gold with LLVMgold for LTO linking, and LD for vmlinux_link
LDFINAL_vmlinux := $(LD)
LD		:= $(LDGOLD)
LDFLAGS		+= -plugin LLVMgold.so
# use llvm-ar for building symbol tables from IR files, and llvm-dis instead
# of objdump for processing symbol versions and exports
LLVM_AR		:= llvm-ar
LLVM_DIS	:= llvm-dis
export LLVM_AR LLVM_DIS
endif

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables
ARCH_CPPFLAGS :=
@@ -818,6 +833,53 @@ KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
KBUILD_CFLAGS	+= $(call cc-option,-fdata-sections,)
endif

ifdef CONFIG_LTO_CLANG
lto-clang-flags	:= -flto -fvisibility=hidden

# allow disabling only clang LTO where needed
DISABLE_LTO_CLANG := -fno-lto -fvisibility=default
export DISABLE_LTO_CLANG
endif

ifdef CONFIG_LTO
lto-flags	:= $(lto-clang-flags)
KBUILD_CFLAGS	+= $(lto-flags)

DISABLE_LTO	:= $(DISABLE_LTO_CLANG)
export DISABLE_LTO

# LDFINAL_vmlinux and LDFLAGS_FINAL_vmlinux can be set to override
# the linker and flags for vmlinux_link.
export LDFINAL_vmlinux LDFLAGS_FINAL_vmlinux
endif

ifdef CONFIG_CFI_CLANG
cfi-clang-flags	+= -fsanitize=cfi
DISABLE_CFI_CLANG := -fno-sanitize=cfi
ifdef CONFIG_MODULES
cfi-clang-flags	+= -fsanitize-cfi-cross-dso
DISABLE_CFI_CLANG += -fno-sanitize-cfi-cross-dso
endif
ifdef CONFIG_CFI_PERMISSIVE
cfi-clang-flags	+= -fsanitize-recover=cfi -fno-sanitize-trap=cfi
endif

# also disable CFI when LTO is disabled
DISABLE_LTO_CLANG += $(DISABLE_CFI_CLANG)
# allow disabling only clang CFI where needed
export DISABLE_CFI_CLANG
endif

ifdef CONFIG_CFI
# cfi-flags are re-tested in prepare-compiler-check
cfi-flags	:= $(cfi-clang-flags)
KBUILD_CFLAGS	+= $(cfi-flags)

DISABLE_CFI	:= $(DISABLE_CFI_CLANG)
DISABLE_LTO	+= $(DISABLE_CFI)
export DISABLE_CFI
endif

# arch Makefile may override CC so keep this after arch Makefile is included
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
CHECKFLAGS     += $(NOSTDINC_FLAGS)
@@ -1135,6 +1197,22 @@ prepare-objtool: $(objtool_target)
# CC_STACKPROTECTOR_STRONG! Why did it build with _REGULAR?!")
PHONY += prepare-compiler-check
prepare-compiler-check: FORCE
# Make sure we're using a supported toolchain with LTO_CLANG
ifdef CONFIG_LTO_CLANG
  ifneq ($(call clang-ifversion, -ge, 0500, y), y)
	@echo Cannot use CONFIG_LTO_CLANG: requires clang 5.0 or later >&2 && exit 1
  endif
  ifneq ($(call gold-ifversion, -ge, 112000000, y), y)
	@echo Cannot use CONFIG_LTO_CLANG: requires GNU gold 1.12 or later >&2 && exit 1
  endif
endif
# Make sure compiler supports LTO flags
ifdef lto-flags
  ifeq ($(call cc-option, $(lto-flags)),)
	@echo Cannot use CONFIG_LTO: $(lto-flags) not supported by compiler \
		>&2 && exit 1
  endif
endif
# Make sure compiler supports requested stack protector flag.
ifdef stackp-name
  ifeq ($(call cc-option, $(stackp-flag)),)
@@ -1148,6 +1226,11 @@ ifdef stackp-check
	@echo Cannot use CONFIG_CC_STACKPROTECTOR_$(stackp-name): \
                  $(stackp-flag) available but compiler is broken >&2 && exit 1
  endif
endif
ifdef cfi-flags
  ifeq ($(call cc-option, $(cfi-flags)),)
	@echo Cannot use CONFIG_CFI: $(cfi-flags) not supported by compiler >&2 && exit 1
  endif
endif
	@:

@@ -1608,7 +1691,8 @@ clean: $(clean-dirs)
		-o -name modules.builtin -o -name '.tmp_*.o.*' \
		-o -name '*.c.[012]*.*' \
		-o -name '*.ll' \
		-o -name '*.gcno' \) -type f -print | xargs rm -f
		-o -name '*.gcno' \
		-o -name '*.*.symversions' \) -type f -print | xargs rm -f

# Generate tags for editors
# ---------------------------------------------------------------------------
+68 −0
Original line number Diff line number Diff line
@@ -605,6 +605,74 @@ config LD_DEAD_CODE_DATA_ELIMINATION
	  sections (e.g., '.text.init'). Typically '.' in section names
	  is used to distinguish them from label names / C identifiers.

config LTO
	def_bool n

config ARCH_SUPPORTS_LTO_CLANG
	bool
	help
	  An architecture should select this option it supports:
	  - compiling with clang,
	  - compiling inline assembly with clang's integrated assembler,
	  - and linking with either lld or GNU gold w/ LLVMgold.

choice
	prompt "Link-Time Optimization (LTO) (EXPERIMENTAL)"
	default LTO_NONE
	help
	  This option turns on Link-Time Optimization (LTO).

config LTO_NONE
	bool "None"

config LTO_CLANG
	bool "Use clang Link Time Optimization (LTO) (EXPERIMENTAL)"
	depends on ARCH_SUPPORTS_LTO_CLANG
	depends on !FTRACE_MCOUNT_RECORD || HAVE_C_RECORDMCOUNT
	select LTO
	select THIN_ARCHIVES
	select LD_DEAD_CODE_DATA_ELIMINATION
	help
          This option enables clang's Link Time Optimization (LTO), which allows
          the compiler to optimize the kernel globally at link time. If you
          enable this option, the compiler generates LLVM IR instead of object
          files, and the actual compilation from IR occurs at the LTO link step,
          which may take several minutes.

          If you select this option, you must compile the kernel with clang >=
          5.0 (make CC=clang) and GNU gold from binutils >= 2.27, and have the
          LLVMgold plug-in in LD_LIBRARY_PATH.

endchoice

config CFI
	bool

config CFI_PERMISSIVE
	bool "Use CFI in permissive mode"
	depends on CFI
	help
	  When selected, Control Flow Integrity (CFI) violations result in a
	  warning instead of a kernel panic. This option is useful for finding
	  CFI violations in drivers during development.

config CFI_CLANG
	bool "Use clang Control Flow Integrity (CFI) (EXPERIMENTAL)"
	depends on LTO_CLANG
	depends on KALLSYMS
	select CFI
	help
	  This option enables clang Control Flow Integrity (CFI), which adds
	  runtime checking for indirect function calls.

config CFI_CLANG_SHADOW
	bool "Use CFI shadow to speed up cross-module checks"
	default y
	depends on CFI_CLANG
	help
	  If you select this option, the kernel builds a fast look-up table of
	  CFI check functions in loaded modules to reduce overhead.

config HAVE_ARCH_WITHIN_STACK_FRAMES
	bool
	help
+3 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ config ARM64
	select ARCH_HAVE_NMI_SAFE_CMPXCHG if ACPI_APEI_SEA
	select ARCH_USE_CMPXCHG_LOCKREF
	select ARCH_SUPPORTS_MEMORY_FAILURE
	select ARCH_SUPPORTS_LTO_CLANG
	select ARCH_SUPPORTS_ATOMIC_RMW
	select ARCH_SUPPORTS_NUMA_BALANCING
	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
@@ -433,7 +434,7 @@ config ARM64_ERRATUM_845719

config ARM64_ERRATUM_843419
	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
	default y
	default y if !LTO_CLANG
	select ARM64_MODULE_CMODEL_LARGE if MODULES
	help
	  This option links the kernel with '--fix-cortex-a53-843419' and
@@ -1090,7 +1091,7 @@ config RANDOMIZE_BASE

config RANDOMIZE_MODULE_REGION_FULL
	bool "Randomize the module region independently from the core kernel"
	depends on RANDOMIZE_BASE
	depends on RANDOMIZE_BASE && !LTO_CLANG
	default y
	help
	  Randomizes the location of the module region without considering the
+21 −0
Original line number Diff line number Diff line
@@ -26,8 +26,17 @@ ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
  ifeq ($(call ld-option, --fix-cortex-a53-843419),)
$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
  else
    ifeq ($(call gold-ifversion, -lt, 114000000, y), y)
$(warning This version of GNU gold may generate incorrect code with --fix-cortex-a53-843419;\
	see https://sourceware.org/bugzilla/show_bug.cgi?id=21491)
    endif
LDFLAGS_vmlinux	+= --fix-cortex-a53-843419
  endif
else
  ifeq ($(ld-name),gold)
# Pass --no-fix-cortex-a53-843419 to ensure the erratum fix is disabled
LDFLAGS	+= --no-fix-cortex-a53-843419
  endif
endif

KBUILD_DEFCONFIG := defconfig
@@ -70,14 +79,22 @@ KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS	+= -D__AARCH64EB__
AS		+= -EB
LD		+= -EB
ifeq ($(ld-name),gold)
LDFLAGS		+= -maarch64_elf64_be_vec
else
LDFLAGS		+= -maarch64linuxb
endif
UTS_MACHINE	:= aarch64_be
else
KBUILD_CPPFLAGS	+= -mlittle-endian
CHECKFLAGS	+= -D__AARCH64EL__
AS		+= -EL
LD		+= -EL
ifeq ($(ld-name),gold)
LDFLAGS		+= -maarch64_elf64_le_vec
else
LDFLAGS		+= -maarch64linux
endif
UTS_MACHINE	:= aarch64
endif

@@ -85,6 +102,10 @@ CHECKFLAGS += -D__aarch64__ -m64

ifeq ($(CONFIG_ARM64_MODULE_CMODEL_LARGE), y)
KBUILD_CFLAGS_MODULE	+= -mcmodel=large
ifeq ($(CONFIG_LTO_CLANG), y)
# Code model is not stored in LLVM IR, so we need to pass it also to LLVMgold
LDFLAGS		+= -plugin-opt=-code-model=large
endif
endif

ifeq ($(CONFIG_ARM64_MODULE_PLTS),y)
Loading