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

Commit 5d5e582a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 4.19.148 into android-4.19-stable



Changes in 4.19.148
	af_key: pfkey_dump needs parameter validation
	KVM: fix memory leak in kvm_io_bus_unregister_dev()
	kprobes: fix kill kprobe which has been marked as gone
	mm/thp: fix __split_huge_pmd_locked() for migration PMD
	cxgb4: Fix offset when clearing filter byte counters
	geneve: add transport ports in route lookup for geneve
	hdlc_ppp: add range checks in ppp_cp_parse_cr()
	ip: fix tos reflection in ack and reset packets
	ipv6: avoid lockdep issue in fib6_del()
	net: DCB: Validate DCB_ATTR_DCB_BUFFER argument
	net: dsa: rtl8366: Properly clear member config
	net: ipv6: fix kconfig dependency warning for IPV6_SEG6_HMAC
	net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc
	nfp: use correct define to return NONE fec
	tipc: Fix memory leak in tipc_group_create_member()
	tipc: fix shutdown() of connection oriented socket
	tipc: use skb_unshare() instead in tipc_buf_append()
	bnxt_en: return proper error codes in bnxt_show_temp
	bnxt_en: Protect bnxt_set_eee() and bnxt_set_pauseparam() with mutex.
	net: phy: Avoid NPD upon phy_detach() when driver is unbound
	net: qrtr: check skb_put_padto() return value
	net: add __must_check to skb_put_padto()
	ipv4: Update exception handling for multipath routes via same device
	MAINTAINERS: add CLANG/LLVM BUILD SUPPORT info
	kbuild: add OBJSIZE variable for the size tool
	Documentation/llvm: add documentation on building w/ Clang/LLVM
	Documentation/llvm: fix the name of llvm-size
	net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware
	net: wan: wanxl: use $(M68KCC) instead of $(M68KAS) for rebuilding firmware
	x86/boot: kbuild: allow readelf executable to be specified
	kbuild: remove AS variable
	kbuild: replace AS=clang with LLVM_IAS=1
	kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
	mm: memcg: fix memcg reclaim soft lockup
	tcp_bbr: refactor bbr_target_cwnd() for general inflight provisioning
	tcp_bbr: adapt cwnd based on ack aggregation estimation
	serial: 8250: Avoid error message on reprobe
	Linux 4.19.148

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: I5077093f58ae882547e3b23c5bbd4dfe78116071
parents e2a92b60 10ad6cfd
Loading
Loading
Loading
Loading
+87 −0
Original line number Diff line number Diff line
==============================
Building Linux with Clang/LLVM
==============================

This document covers how to build the Linux kernel with Clang and LLVM
utilities.

About
-----

The Linux kernel has always traditionally been compiled with GNU toolchains
such as GCC and binutils. Ongoing work has allowed for `Clang
<https://clang.llvm.org/>`_ and `LLVM <https://llvm.org/>`_ utilities to be
used as viable substitutes. Distributions such as `Android
<https://www.android.com/>`_, `ChromeOS
<https://www.chromium.org/chromium-os>`_, and `OpenMandriva
<https://www.openmandriva.org/>`_ use Clang built kernels.  `LLVM is a
collection of toolchain components implemented in terms of C++ objects
<https://www.aosabook.org/en/llvm.html>`_. Clang is a front-end to LLVM that
supports C and the GNU C extensions required by the kernel, and is pronounced
"klang," not "see-lang."

Clang
-----

The compiler used can be swapped out via `CC=` command line argument to `make`.
`CC=` should be set when selecting a config and during a build.

	make CC=clang defconfig

	make CC=clang

Cross Compiling
---------------

A single Clang compiler binary will typically contain all supported backends,
which can help simplify cross compiling.

	ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang

`CROSS_COMPILE` is not used to prefix the Clang compiler binary, instead
`CROSS_COMPILE` is used to set a command line flag: `--target <triple>`. For
example:

	clang --target aarch64-linux-gnu foo.c

LLVM Utilities
--------------

LLVM has substitutes for GNU binutils utilities. Kbuild supports `LLVM=1`
to enable them.

	make LLVM=1

They can be enabled individually. The full list of the parameters:

	make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \\
	  OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size \\
	  READELF=llvm-readelf HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar \\
	  HOSTLD=ld.lld

Currently, the integrated assembler is disabled by default. You can pass
`LLVM_IAS=1` to enable it.

Getting Help
------------

- `Website <https://clangbuiltlinux.github.io/>`_
- `Mailing List <https://groups.google.com/forum/#!forum/clang-built-linux>`_: <clang-built-linux@googlegroups.com>
- `Issue Tracker <https://github.com/ClangBuiltLinux/linux/issues>`_
- IRC: #clangbuiltlinux on chat.freenode.net
- `Telegram <https://t.me/ClangBuiltLinux>`_: @ClangBuiltLinux
- `Wiki <https://github.com/ClangBuiltLinux/linux/wiki>`_
- `Beginner Bugs <https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_

Getting LLVM
-------------

- http://releases.llvm.org/download.html
- https://github.com/llvm/llvm-project
- https://llvm.org/docs/GettingStarted.html
- https://llvm.org/docs/CMake.html
- https://apt.llvm.org/
- https://www.archlinux.org/packages/extra/x86_64/llvm/
- https://github.com/ClangBuiltLinux/tc-build
- https://github.com/ClangBuiltLinux/linux/wiki/Building-Clang-from-source
- https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/
+9 −0
Original line number Diff line number Diff line
@@ -3613,6 +3613,15 @@ M: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
S:	Maintained
F:	.clang-format

CLANG/LLVM BUILD SUPPORT
L:	clang-built-linux@googlegroups.com
W:	https://clangbuiltlinux.github.io/
B:	https://github.com/ClangBuiltLinux/linux/issues
C:	irc://chat.freenode.net/clangbuiltlinux
S:	Supported
K:	\b(?i:clang|llvm)\b
F:	Documentation/kbuild/llvm.rst

CLEANCACHE API
M:	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
L:	linux-kernel@vger.kernel.org
+29 −9
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 19
SUBLEVEL = 147
SUBLEVEL = 148
EXTRAVERSION =
NAME = "People's Front"

@@ -358,8 +358,13 @@ HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)

ifneq ($(LLVM),)
HOSTCC	= clang
HOSTCXX	= clang++
else
HOSTCC	= gcc
HOSTCXX	= g++
endif
KBUILD_HOSTCFLAGS   := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
		-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
		$(HOSTCFLAGS)
@@ -368,15 +373,28 @@ KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
KBUILD_HOSTLDLIBS   := $(HOST_LFS_LIBS) $(HOSTLDLIBS)

# Make variables (CC, etc...)
AS		= $(CROSS_COMPILE)as
LD		= $(CROSS_COMPILE)ld
CC		= $(CROSS_COMPILE)gcc
CPP		= $(CC) -E
ifneq ($(LLVM),)
CC		= clang
LD		= ld.lld
AR		= llvm-ar
NM		= llvm-nm
OBJCOPY		= llvm-objcopy
OBJDUMP		= llvm-objdump
READELF		= llvm-readelf
OBJSIZE		= llvm-size
STRIP		= llvm-strip
else
CC		= $(CROSS_COMPILE)gcc
LD		= $(CROSS_COMPILE)ld
AR		= $(CROSS_COMPILE)ar
NM		= $(CROSS_COMPILE)nm
STRIP		= $(CROSS_COMPILE)strip
OBJCOPY		= $(CROSS_COMPILE)objcopy
OBJDUMP		= $(CROSS_COMPILE)objdump
READELF		= $(CROSS_COMPILE)readelf
OBJSIZE		= $(CROSS_COMPILE)size
STRIP		= $(CROSS_COMPILE)strip
endif
LEX		= flex
YACC		= bison
AWK		= awk
@@ -432,8 +450,8 @@ KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
CLANG_FLAGS :=

export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS

@@ -495,7 +513,9 @@ endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_FLAGS	+= --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
ifneq ($(LLVM_IAS),1)
CLANG_FLAGS	+= -no-integrated-as
endif
CLANG_FLAGS	+= -Werror=unknown-warning-option
KBUILD_CFLAGS	+= $(CLANG_FLAGS)
KBUILD_AFLAGS	+= $(CLANG_FLAGS)
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
quiet_cmd_check_data_rel = DATAREL $@
define cmd_check_data_rel
	for obj in $(filter %.o,$^); do \
		${CROSS_COMPILE}readelf -S $$obj | grep -qF .rel.local && { \
		$(READELF) -S $$obj | grep -qF .rel.local && { \
			echo "error: $$obj has data relocations!" >&2; \
			exit 1; \
		} || true; \
+13 −7
Original line number Diff line number Diff line
@@ -452,13 +452,19 @@ int rtl8366_vlan_del(struct dsa_switch *ds, int port,
				return ret;

			if (vid == vlanmc.vid) {
				/* clear VLAN member configurations */
				/* Remove this port from the VLAN */
				vlanmc.member &= ~BIT(port);
				vlanmc.untag &= ~BIT(port);
				/*
				 * If no ports are members of this VLAN
				 * anymore then clear the whole member
				 * config so it can be reused.
				 */
				if (!vlanmc.member && vlanmc.untag) {
					vlanmc.vid = 0;
					vlanmc.priority = 0;
				vlanmc.member = 0;
				vlanmc.untag = 0;
					vlanmc.fid = 0;

				}
				ret = smi->ops->set_vlan_mc(smi, i, &vlanmc);
				if (ret) {
					dev_err(smi->dev,
Loading