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

Commit 16b59005 authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Merge android11-5.4.61+ (0d36496b) into msm-5.4



* refs/heads/tmp-0d36496b:
  BACKPORT: FROMLIST: firmware_loader: fix memory leak for paged buffer
  BACKPORT: cfg80211: Adjust 6 GHz frequency to channel conversion
  ANDROID: db845c_gki.fragment: Remove CONFIG_USB_NET_AX88*
  ANDROID: GKI: enable CONFIG_MTK_TIMER
  ANDROID: ABI: Update ABI description after symbol list updates
  ANDROID: ABI: Added symbols for allwinner
  ANDROID: ABI: Update allowed list for QCOM
  UPSTREAM: scsi: ufs: ufs-mediatek: Modify the minimum RX/TX lane count to 2
  UPSTREAM: scsi: ufs: Fix possible infinite loop in ufshcd_hold
  UPSTREAM: scsi: ufs-mediatek: Fix incorrect time to wait link status
  UPSTREAM: scsi: ufs-mediatek: Apply DELAY_AFTER_LPM quirk to Micron devices
  UPSTREAM: scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM"
  UPSTREAM: scsi: ufs-mediatek: Prevent LPM operation on undeclared VCC
  BACKPORT: scsi: ufs-mediatek: Add inline encryption support
  ANDROID: Update ABI
  ANDROID: net: enable wireless core features with GKI_LEGACY_WEXT_ALLCONFIG
  Revert "binder: Prevent context manager from incrementing ref 0"
  FROMLIST: ufs: skip manual flush for write booster
  ANDROID: ion: export some ion symbols
  ANDROID: gki_defconfig: enable CONFIG_ARCH_SUNXI.
  FROMLIST: clk: sunxi-ng: add support for the Allwinner A100 CCU
  FROMLIST: pinctrl: sunxi: add support for the Allwinner A100 pin controller
  ANDROID: vendor_hooks: Add new android vendor hooks for ipi stop
  ANDROID: Incremental fs: fix magic compatibility again
  Linux 5.4.61
  KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set
  KVM: Pass MMU notifier range flags to kvm_unmap_hva_range()
  xen: don't reschedule in preemption off sections
  mm/hugetlb: fix calculation of adjust_range_if_pmd_sharing_possible
  do_epoll_ctl(): clean the failure exits up a bit
  epoll: Keep a reference on files added to the check list
  efi: add missed destroy_workqueue when efisubsys_init fails
  powerpc/pseries: Do not initiate shutdown when system is running on UPS
  net: dsa: b53: check for timeout
  hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit()
  net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe()
  net: ena: Prevent reset after device destruction
  bonding: fix active-backup failover for current ARP slave
  ARM64: vdso32: Install vdso32 from vdso_install
  afs: Fix NULL deref in afs_dynroot_depopulate()
  RDMA/bnxt_re: Do not add user qps to flushlist
  Fix build error when CONFIG_ACPI is not set/enabled:
  efi: avoid error message when booting under Xen
  kconfig: qconf: fix signal connection to invalid slots
  kconfig: qconf: do not limit the pop-up menu to the first row
  Revert "scsi: qla2xxx: Disable T10-DIF feature with FC-NVMe during probe"
  kvm: x86: Toggling CR4.PKE does not load PDPTEs in PAE mode
  kvm: x86: Toggling CR4.SMAP does not load PDPTEs in PAE mode
  vfio/type1: Add proper error unwind for vfio_iommu_replay()
  ASoC: intel: Fix memleak in sst_media_open
  ASoC: msm8916-wcd-analog: fix register Interrupt offset
  s390/ptrace: fix storage key handling
  s390/runtime_instrumentation: fix storage key handling
  bonding: fix a potential double-unregister
  can: j1939: add rxtimer for multipacket broadcast session
  can: j1939: abort multipacket broadcast session when timeout occurs
  can: j1939: cancel rxtimer on multipacket broadcast session complete
  can: j1939: fix support for multipacket broadcast message
  bonding: show saner speed for broadcast mode
  net: fec: correct the error path for regulator disable in probe
  i40e: Fix crash during removing i40e driver
  i40e: Set RX_ONLY mode for unicast promiscuous on VLAN
  can: j1939: transport: add j1939_session_skb_find_by_offset() function
  can: j1939: transport: j1939_simple_recv(): ignore local J1939 messages send not by J1939 stack
  can: j1939: fix kernel-infoleak in j1939_sk_sock2sockaddr_can()
  bpf: sock_ops sk access may stomp registers when dst_reg = src_reg
  ASoC: q6routing: add dummy register read/write function
  ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM
  spi: stm32: fixes suspend/resume management
  netfilter: nf_tables: nft_exthdr: the presence return value should be little-endian
  ext4: don't allow overlapping system zones
  ext4: fix potential negative array index in do_split()
  fs/signalfd.c: fix inconsistent return codes for signalfd4
  alpha: fix annotation of io{read,write}{16,32}be()
  xfs: Fix UBSAN null-ptr-deref in xfs_sysfs_init
  tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference
  media: camss: fix memory leaks on error handling paths in probe
  virtio_ring: Avoid loop when vq is broken in virtqueue_poll
  scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases
  cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0
  swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses
  ceph: fix use-after-free for fsc->mdsc
  jffs2: fix UAF problem
  drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
  xfs: fix inode quota reservation checks
  svcrdma: Fix another Receive buffer leak
  m68knommu: fix overwriting of bits in ColdFire V3 cache control
  MIPS: Fix unable to reserve memory for Crash kernel
  Input: psmouse - add a newline when printing 'proto' by sysfs
  media: vpss: clean up resources in init
  rtc: goldfish: Enable interrupt in set_alarm() when necessary
  media: budget-core: Improve exception handling in budget_register()
  scsi: target: tcmu: Fix crash in tcmu_flush_dcache_range on ARM
  scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
  opp: Enable resources again if they were disabled earlier
  kthread: Do not preempt current task if it is going to call schedule()
  drm/amd/display: fix pow() crashing when given base 0
  drm/amd/display: Fix EDID parsing after resume from suspend
  drm/amdgpu/display: use GFP_ATOMIC in dcn20_validate_bandwidth_internal
  scsi: zfcp: Fix use-after-free in request timeout handlers
  jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()
  ext4: fix checking of directory entry validity for inline directories
  RDMA/hfi1: Correct an interlock issue for TID RDMA WRITE request
  mm, page_alloc: fix core hung in free_pcppages_bulk()
  mm: include CMA pages in lowmem_reserve at boot
  uprobes: __replace_page() avoid BUG in munlock_vma_page()
  kernel/relay.c: fix memleak on destroy relay channel
  romfs: fix uninitialized memory leak in romfs_dev_read()
  spi: Prevent adding devices below an unregistering controller
  can: j1939: socket: j1939_sk_bind(): make sure ml_priv is allocated
  can: j1939: transport: j1939_session_tx_dat(): fix use-after-free read in j1939_tp_txtimer()
  ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion
  ALSA: hda/realtek: Add quirk for Samsung Galaxy Flex Book
  btrfs: add wrapper for transaction abort predicate
  btrfs: return EROFS for BTRFS_FS_STATE_ERROR cases
  btrfs: don't show full path of bind mounts in subvol=
  btrfs: export helpers for subvolume name/id resolution
  bcache: avoid nr_stripes overflow in bcache_device_init()
  khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter()
  khugepaged: khugepaged_test_exit() check mmget_still_valid()
  perf probe: Fix memory leakage when the probe point is not found
  gfs2: Never call gfs2_block_zero_range with an open transaction
  gfs2: Improve mmap write vs. punch_hole consistency
  drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset()
  kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
  kbuild: replace AS=clang with LLVM_IAS=1
  kbuild: remove AS variable
  kbuild: remove PYTHON2 variable
  x86/boot: kbuild: allow readelf executable to be specified
  net: wan: wanxl: use $(M68KCC) instead of $(M68KAS) for rebuilding firmware
  net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware
  Documentation/llvm: fix the name of llvm-size
  Documentation/llvm: add documentation on building w/ Clang/LLVM
  ANDROID: ABI: Added symbols for db845c and hikey960
  ANDROID: Update abi_gki_aarch64_hikey960
  ANDROID: Update abi_gki_aarch64_db845c
  ANDROID: build.config.hikey960: Set KMI_SYMBOL_LIST
  ANDROID: build.config.d845c: Set KMI_SYMBOL_LIST
  ANDROID: hikey960_gki.fragment: Remove unused CONFIG_SERIAL_8250_DW
  BACKPORT: FROMLIST: clk: Export clk_register_composite
  ANDROID: power: Export log_{suspend_abort,abnormal_wakeup}_reason
  ANDROID: ABI: add already existing __arm_smccc_smc to unisoc
  ANDROID: ion: Remove unused local variable 'vaddr'
  ANDROID: ion: remove kmap from begin[end]_cpu_access

Conflicts:
	Makefile
	android/abi_gki_aarch64_qcom

Change-Id: Ia7b012d7bd15b21f918a13f3c9da29c26f68da93
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parents 4c0b234b 0d36496b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ Kernel Build System

    issues
    reproducible-builds
    llvm

.. only::  subproject and html

+5 −0
Original line number Diff line number Diff line
@@ -262,3 +262,8 @@ KBUILD_BUILD_USER, KBUILD_BUILD_HOST
These two variables allow to override the user@host string displayed during
boot and in /proc/version. The default value is the output of the commands
whoami and host, respectively.

LLVM
----
If this variable is set to 1, Kbuild will use Clang and LLVM utilities instead
of GCC and GNU binutils to build the kernel.
+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/
+1 −0
Original line number Diff line number Diff line
@@ -4028,6 +4028,7 @@ 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>
+28 −12
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 60
SUBLEVEL = 61
EXTRAVERSION =
NAME = Kleptomaniac Octopus

@@ -394,8 +394,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)
@@ -404,16 +409,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
REAL_CC		= $(CROSS_COMPILE)gcc
CPP		= $(CC) -E
ifneq ($(LLVM),)
REAL_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
REAL_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
PAHOLE		= pahole
LEX		= flex
YACC		= bison
@@ -422,7 +439,6 @@ INSTALLKERNEL := installkernel
DEPMOD		= /sbin/depmod
PERL		= perl
PYTHON		= python
PYTHON2		= python2
PYTHON3		= python3
CHECK		= sparse
BASH		= bash
@@ -479,9 +495,9 @@ KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
CLANG_FLAGS :=

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

export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
@@ -548,7 +564,7 @@ endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_FLAGS	+= --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
ifeq ($(shell $(AS) --version 2>&1 | head -n 1 | grep clang),)
ifneq ($(LLVM_IAS),1)
CLANG_FLAGS	+= -no-integrated-as
endif
CLANG_FLAGS	+= -Werror=unknown-warning-option
Loading