46 Commits

Author SHA1 Message Date
Fangrui Song
cca33fc310 BACKPORT: bpf: Support llvm-objcopy for vmlinux BTF
commit 90ceddcb495008ac8ba7a3dce297841efcd7d584 upstream.

Simplify gen_btf logic to make it work with llvm-objcopy. The existing
'file format' and 'architecture' parsing logic is brittle and does not
work with llvm-objcopy/llvm-objdump.

'file format' output of llvm-objdump>=11 will match GNU objdump, but
'architecture' (bfdarch) may not.

.BTF in .tmp_vmlinux.btf is non-SHF_ALLOC. Add the SHF_ALLOC flag
because it is part of vmlinux image used for introspection. C code
can reference the section via linker script defined __start_BTF and
__stop_BTF. This fixes a small problem that previous .BTF had the
SHF_WRITE flag (objcopy -I binary -O elf* synthesized .data).

Additionally, `objcopy -I binary` synthesized symbols
_binary__btf_vmlinux_bin_start and _binary__btf_vmlinux_bin_stop (not
used elsewhere) are replaced with more commonplace __start_BTF and
__stop_BTF.

Add 2>/dev/null because GNU objcopy (but not llvm-objcopy) warns
"empty loadable segment detected at vaddr=0xffffffff81000000, is this intentional?"

We use a dd command to change the e_type field in the ELF header from
ET_EXEC to ET_REL so that lld will accept .btf.vmlinux.bin.o.  Accepting
ET_EXEC as an input file is an extremely rare GNU ld feature that lld
does not intend to support, because this is error-prone.

The output section description .BTF in include/asm-generic/vmlinux.lds.h
avoids potential subtle orphan section placement issues and suppresses
--orphan-handling=warn warnings.

Fixes: df786c9b9476 ("bpf: Force .BTF section start to zero when dumping from vmlinux")
Fixes: cb0cc635c7a9 ("powerpc: Include .BTF section")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Change-Id: I145b50cfe3e0e1e034fb750cf55642905382a06c
Signed-off-by: Fangrui Song <maskray@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Stanislav Fomichev <sdf@google.com>
Tested-by: Andrii Nakryiko <andriin@fb.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Link: https://github.com/ClangBuiltLinux/linux/issues/871
Link: https://lore.kernel.org/bpf/20200318222746.173648-1-maskray@google.com
Signed-off-by: Maria Teguiani <teguiani@google.com>
Tested-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-10 05:09:44 +03:00
Andrii Nakryiko
7285e0992b UPSTREAM: btf: rename /sys/kernel/btf/kernel into /sys/kernel/btf/vmlinux
Expose kernel's BTF under the name vmlinux to be more uniform with using
kernel module names as file names in the future.

Fixes: 341dfcf8d78e ("btf: expose BTF info through sysfs")
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Change-Id: I0c478e34bd67044a37b166b60c1de07025c3ec90
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2025-10-10 05:09:36 +03:00
Andrii Nakryiko
07cd55f1b5 BACKPORT: btf: expose BTF info through sysfs
Make .BTF section allocated and expose its contents through sysfs.

/sys/kernel/btf directory is created to contain all the BTFs present
inside kernel. Currently there is only kernel's main BTF, represented as
/sys/kernel/btf/kernel file. Once kernel modules' BTFs are supported,
each module will expose its BTF as /sys/kernel/btf/<module-name> file.

Current approach relies on a few pieces coming together:
1. pahole is used to take almost final vmlinux image (modulo .BTF and
   kallsyms) and generate .BTF section by converting DWARF info into
   BTF. This section is not allocated and not mapped to any segment,
   though, so is not yet accessible from inside kernel at runtime.
2. objcopy dumps .BTF contents into binary file and subsequently
   convert binary file into linkable object file with automatically
   generated symbols _binary__btf_kernel_bin_start and
   _binary__btf_kernel_bin_end, pointing to start and end, respectively,
   of BTF raw data.
3. final vmlinux image is generated by linking this object file (and
   kallsyms, if necessary). sysfs_btf.c then creates
   /sys/kernel/btf/kernel file and exposes embedded BTF contents through
   it. This allows, e.g., libbpf and bpftool access BTF info at
   well-known location, without resorting to searching for vmlinux image
   on disk (location of which is not standardized and vmlinux image
   might not be even available in some scenarios, e.g., inside qemu
   during testing).

Alternative approach using .incbin assembler directive to embed BTF
contents directly was attempted but didn't work, because sysfs_proc.o is
not re-compiled during link-vmlinux.sh stage. This is required, though,
to update embedded BTF data (initially empty data is embedded, then
pahole generates BTF info and we need to regenerate sysfs_btf.o with
updated contents, but it's too late at that point).

If BTF couldn't be generated due to missing or too old pahole,
sysfs_btf.c handles that gracefully by detecting that
_binary__btf_kernel_bin_start (weak symbol) is 0 and not creating
/sys/kernel/btf at all.

v2->v3:
- added Documentation/ABI/testing/sysfs-kernel-btf (Greg K-H);
- created proper kobject (btf_kobj) for btf directory (Greg K-H);
- undo v2 change of reusing vmlinux, as it causes extra kallsyms pass
  due to initially missing  __binary__btf_kernel_bin_{start/end} symbols;

v1->v2:
- allow kallsyms stage to re-use vmlinux generated by gen_btf();

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ife57356dd14b9ae0d2e3801eea7c602c6245952f
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2025-10-10 05:09:34 +03:00
Andrii Nakryiko
cfbe21c82a UPSTREAM: kbuild: handle old pahole more gracefully when generating BTF
When CONFIG_DEBUG_INFO_BTF is enabled but available version of pahole is too
old to support BTF generation, build script is supposed to emit warning and
proceed with the build. Due to using exit instead of return from BASH function,
existing handling code prematurely exits exit code 0, not completing some of
the build steps. This patch fixes issue by correctly returning just from
gen_btf() function only.

Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux")
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Change-Id: If817e5a03a739213cecde92b827550b1de86d296
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2025-10-10 05:09:11 +03:00
Andrii Nakryiko
3a0362fdcb UPSTREAM: kbuild: tolerate missing pahole when generating BTF
When BTF generation is enabled through CONFIG_DEBUG_INFO_BTF,
scripts/link-vmlinux.sh detects if pahole version is too old and
gracefully continues build process, skipping BTF generation build step.
But if pahole is not available, build will still fail. This patch adds
check for whether pahole exists at all and bails out gracefully, if not.

Cc: Alexei Starovoitov <ast@fb.com>
Reported-by: Yonghong Song <yhs@fb.com>
Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux")
Change-Id: I89e477f03aba8e16789b2a330469b2ac562df4d5
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2025-10-10 05:09:11 +03:00
Andrii Nakryiko
05d1fd7b25 BACKPORT: kbuild: add ability to generate BTF type info for vmlinux
This patch adds new config option to trigger generation of BTF type
information from DWARF debuginfo for vmlinux and kernel modules through
pahole, which in turn relies on libbpf for btf_dedup() algorithm.

The intent is to record compact type information of all types used
inside kernel, including all the structs/unions/typedefs/etc. This
enables BPF's compile-once-run-everywhere ([0]) approach, in which
tracing programs that are inspecting kernel's internal data (e.g.,
struct task_struct) can be compiled on a system running some kernel
version, but would be possible to run on other kernel versions (and
configurations) without recompilation, even if the layout of structs
changed and/or some of the fields were added, removed, or renamed.

This is only possible if BPF loader can get kernel type info to adjust
all the offsets correctly. This patch is a first time in this direction,
making sure that BTF type info is part of Linux kernel image in
non-loadable ELF section.

BTF deduplication ([1]) algorithm typically provides 100x savings
compared to DWARF data, so resulting .BTF section is not big as is
typically about 2MB in size.

[0] http://vger.kernel.org/lpc-bpf2018.html#session-2
[1] https://facebookmicrosites.github.io/bpf/blog/2018/11/14/btf-enhancement.html

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Change-Id: Id935f6e3ac658d9a92d55acd39e8287c644c941d
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2025-10-10 05:09:08 +03:00
Wilson Sung
dfd51df287 Merge branch 'LA.UM.8.1.C9.09.00.00.518.343' via branch 'qcom-msm-4.14' into android-msm-floral-4.14
Conflicts:
	Documentation/admin-guide/kernel-parameters.txt
	Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt
	Documentation/devicetree/bindings/pinctrl/qcom,sm8150-pinctrl
	Documentation/devicetree/bindings/regulator/qpnp-amoled-regulator.txt
	arch/arm64/include/asm/cpucaps.h
	arch/arm64/include/asm/processor.h
	arch/arm64/include/asm/ptrace.h
	arch/arm64/include/asm/sysreg.h
	arch/arm64/include/uapi/asm/hwcap.h
	arch/arm64/kernel/cpu_errata.c
	arch/arm64/kernel/cpufeature.c
	arch/arm64/kernel/cpuinfo.c
	arch/arm64/kernel/process.c
	arch/arm64/kernel/ssbd.c
	arch/arm64/mm/dma-mapping.c
	drivers/block/zram/zram_dedup.c
	drivers/char/adsprpc.c
	drivers/char/diag/diagchar_core.c
	drivers/clk/qcom/mdss/mdss-dsi-pll-7nm.c
	drivers/gpu/drm/msm/dsi-staging/dsi_display.c
	drivers/gpu/drm/msm/dsi-staging/dsi_drm.c
	drivers/gpu/drm/msm/dsi-staging/dsi_panel.c
	drivers/gpu/drm/msm/sde/sde_connector.c
	drivers/gpu/drm/msm/sde/sde_connector.h
	drivers/gpu/drm/msm/sde/sde_encoder.c
	drivers/gpu/drm/msm/sde/sde_hw_reg_dma_v1_color_proc.c
	drivers/gpu/drm/msm/sde/sde_kms.c
	drivers/gpu/msm/adreno_a6xx_gmu.c
	drivers/gpu/msm/adreno_ringbuffer.c
	drivers/gpu/msm/kgsl_events.c
	drivers/gpu/msm/kgsl_gmu_core.c
	drivers/gpu/msm/kgsl_gmu_core.h
	drivers/media/platform/msm/camera/cam_icp/cam_icp_context.c
	drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c
	drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c
	drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h
	drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c
	drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h
	drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_interface.h
	drivers/media/platform/msm/camera/cam_sensor_module/Makefile
	drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cam_cci_core.c
	drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/cam_csiphy_core.c
	drivers/media/platform/msm/camera/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h
	drivers/media/platform/msm/camera/cam_sync/cam_sync.c
	drivers/media/platform/msm/sde/rotator/sde_rotator_core.c
	drivers/mmc/host/sdhci.c
	drivers/mmc/host/sdhci.h
	drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
	drivers/pci/host/pci-msm-msi.c
	drivers/pci/host/pci-msm.c
	drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c
	drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c
	drivers/power/supply/power_supply_sysfs.c
	drivers/power/supply/qcom/qpnp-smb5.c
	drivers/power/supply/qcom/smb5-lib.c
	drivers/power/supply/qcom/smb5-lib.h
	drivers/regulator/Kconfig
	drivers/regulator/Makefile
	drivers/regulator/qpnp-amoled-regulator.c
	drivers/scsi/ufs/ufshcd.h
	drivers/spi/spi-geni-qcom.c
	drivers/thermal/qcom/bcl_pmic5.c
	drivers/tty/Kconfig
	drivers/tty/serial/msm_geni_serial.c
	drivers/usb/dwc3/dwc3-msm.c
	drivers/usb/gadget/function/f_accessory.c
	fs/ext4/move_extent.c
	fs/f2fs/file.c
	fs/f2fs/segment.c
	include/linux/power_supply.h
	include/uapi/media/cam_req_mgr.h
	include/uapi/media/cam_sensor.h
	kernel/sched/fair.c
	mm/memory.c
	mm/swapfile.c
	mm/vmscan.c
	net/ipv4/sysctl_net_ipv4.c
	net/qrtr/qrtr.c

Bug: 146759211
Bug: 146762954
Bug: 146763266
BUg: 146764016
Bug: 146913153
Change-Id: I246a3d30fb3adc4b014ab1e38a29c937eeb15d6a
Signed-off-by: Wilson Sung <wilsonsung@google.com>
2020-02-12 11:33:36 +08:00
lucaswei
c897920710 Merge android-4.14 (4.14.160) into android-msm-floral-4.14-lts
Merge 4.14.160 into android-4.14
Linux 4.14.160
    net: stmmac: don't stop NAPI processing when dropping a packet
    net: stmmac: use correct DMA buffer size in the RX descriptor
  * xhci: fix USB3 device initiated resume race with roothub autosuspend
      drivers/usb/host/xhci-hub.c
      drivers/usb/host/xhci-ring.c
    drm/radeon: fix r1xx/r2xx register checker for POT textures
    scsi: iscsi: Fix a potential deadlock in the timeout handler
    dm btree: increase rebalance threshold in __rebalance2()
  * dma-buf: Fix memory leak in sync_file_merge()
      drivers/dma-buf/sync_file.c
    vfio/pci: call irq_bypass_unregister_producer() before freeing irq
    ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
    ARM: dts: s3c64xx: Fix init order of clock providers
    CIFS: Respect O_SYNC and O_DIRECT flags during reconnect
  * rpmsg: glink: Free pending deferred work on remove
      drivers/rpmsg/qcom_glink_native.c
  * rpmsg: glink: Don't send pending rx_done during remove
      drivers/rpmsg/qcom_glink_native.c
  * rpmsg: glink: Fix rpmsg_register_device err handling
      drivers/rpmsg/qcom_glink_native.c
  * rpmsg: glink: Put an extra reference during cleanup
      drivers/rpmsg/qcom_glink_native.c
  * rpmsg: glink: Fix use after free in open_ack TIMEOUT case
      drivers/rpmsg/qcom_glink_native.c
  * rpmsg: glink: Fix reuse intents memory leak issue
      drivers/rpmsg/qcom_glink_native.c
  * rpmsg: glink: Set tail pointer to 0 at end of FIFO
      drivers/rpmsg/qcom_glink_smem.c
    xtensa: fix TLB sanity checker
  * PCI: Apply Cavium ACS quirk to ThunderX2 and ThunderX3
      drivers/pci/quirks.c
  * PCI/MSI: Fix incorrect MSI-X masking on resume
      drivers/pci/msi.c
  * PCI: Fix Intel ACS quirk UPDCR register address
      drivers/pci/quirks.c
  * PCI/PM: Always return devices to D0 when thawing
      drivers/pci/pci-driver.c
  * Revert "regulator: Defer init completion for a while after late_initcall"
      drivers/regulator/core.c
    nvme: host: core: fix precedence of ternary operator
  * inet: protect against too small mtu values.
      include/linux/netdevice.h
      include/net/ip.h
      net/core/dev.c
      net/ipv4/devinet.c
      net/ipv4/ip_output.c
  * tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()
      include/net/tcp.h
  * tcp: tighten acceptance of ACKs not matching a child socket
      include/net/tcp.h
  * tcp: fix rejected syncookies due to stale timestamps
      include/linux/time.h
      include/net/tcp.h
    tipc: fix ordering of tipc module init and exit routine
  * tcp: md5: fix potential overestimation of TCP option space
      net/ipv4/tcp_output.c
    openvswitch: support asymmetric conntrack
    net: thunderx: start phy before starting autonegotiation
    net: ethernet: ti: cpsw: fix extra rx interrupt
  * net: dsa: fix flow dissection on Tx path
      net/core/flow_dissector.c
  * net: bridge: deny dev_set_mac_address() when unregistering
      net/bridge/br_device.c
    ANDROID: cuttlefish_defconfig: Enable CONFIG_GNSS_CMDLINE_SERIAL
  * ANDROID: gnss: Add command line test driver
      drivers/gnss/Kconfig
  * ANDROID: serdev: add platform device support
      drivers/tty/serdev/core.c
    ANDROID: cuttlefish_defconfig: set BINFMT_MISC
  * UPSTREAM: binder: fix incorrect calculation for num_valid
      drivers/android/binder.c
  * ANDROID: kbuild: disable clang-specific configs with other compilers
      Makefile
    Merge 4.14.159 into android-4.14
Linux 4.14.159
    of: unittest: fix memory leak in attach_node_and_children
    raid5: need to set STRIPE_HANDLE for batch head
    gpiolib: acpi: Add Terra Pad 1061 to the run_edge_events_on_boot_blacklist
  * kernel/module.c: wakeup processes in module_wq on module unload
      kernel/module.c
    gfs2: fix glock reference problem in gfs2_trans_remove_revoke
    net/mlx5e: Fix SFF 8472 eeprom length
    sunrpc: fix crash when cache_head become valid before update
  * workqueue: Fix missing kfree(rescuer) in destroy_workqueue()
      kernel/workqueue.c
  * blk-mq: make sure that line break can be printed
      block/blk-mq-sysfs.c
    mfd: rk808: Fix RK818 ID template
  * ext4: fix a bug in ext4_wait_for_tail_page_commit
      fs/ext4/inode.c
  * mm/shmem.c: cast the type of unmap_start to u64
      mm/shmem.c
  * firmware: qcom: scm: Ensure 'a0' status code is treated as signed
      drivers/firmware/qcom_scm-64.c
  * ext4: work around deleting a file with i_nlink == 0 safely
      fs/ext4/namei.c
    powerpc: Fix vDSO clock_getres()
    powerpc: Avoid clang warnings around setjmp and longjmp
    ath10k: fix fw crash by moving chip reset after napi disabled
    media: vimc: fix component match compare
    mlxsw: spectrum_router: Refresh nexthop neighbour when it becomes dead
    power: supply: cpcap-battery: Fix signed counter sample register
    x86/MCE/AMD: Carve out the MC4_MISC thresholding quirk
    x86/MCE/AMD: Turn off MC4_MISC thresholding on all family 0x15 models
    e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait
    drbd: Change drbd_request_detach_interruptible's return type to int
    scsi: lpfc: Correct code setting non existent bits in sli4 ABORT WQE
    scsi: lpfc: Cap NPIV vports to 256
    omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251
    phy: renesas: rcar-gen3-usb2: Fix sysfs interface of "role"
    iio: adis16480: Add debugfs_reg_access entry
  * xhci: make sure interrupts are restored to correct state
      drivers/usb/host/xhci-hub.c
  * xhci: Fix memory leak in xhci_add_in_port()
      drivers/usb/host/xhci-mem.c
    scsi: qla2xxx: Fix message indicating vectors used by driver
    scsi: qla2xxx: Always check the qla2x00_wait_for_hba_online() return value
    scsi: qla2xxx: Fix qla24xx_process_bidir_cmd()
    scsi: qla2xxx: Fix session lookup in qlt_abort_work()
    scsi: qla2xxx: Fix DMA unmap leak
    scsi: zfcp: trace channel log even for FCP command responses
  * block: fix single range discard merge
      block/blk-merge.c
    reiserfs: fix extended attributes on the root directory
  * ext4: Fix credit estimate for final inode freeing
      fs/ext4/inode.c
  * quota: fix livelock in dquot_writeback_dquots
      fs/quota/dquot.c
    ext2: check err when partial != NULL
  * quota: Check that quota is not dirty before release
      fs/quota/dquot.c
      include/linux/quotaops.h
  * video/hdmi: Fix AVI bar unpack
      drivers/video/hdmi.c
    powerpc/xive: Skip ioremap() of ESB pages for LSI interrupts
    powerpc: Allow flush_icache_range to work across ranges >4GB
    powerpc/xive: Prevent page fault issues in the machine crash handler
    powerpc: Allow 64bit VDSO __kernel_sync_dicache to work across ranges >4GB
    ppdev: fix PPGETTIME/PPSETTIME ioctls
    ARM: dts: omap3-tao3530: Fix incorrect MMC card detection GPIO polarity
    mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid of pandora_wl1251_init_card
    pinctrl: samsung: Fix device node refcount leaks in S3C64xx wakeup controller init
    pinctrl: samsung: Fix device node refcount leaks in init code
    pinctrl: samsung: Fix device node refcount leaks in S3C24xx wakeup controller init
    pinctrl: samsung: Add of_node_put() before return in error path
    ACPI: PM: Avoid attaching ACPI PM domain to certain devices
    ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data()
    ACPI: OSL: only free map once in osl.c
    cpufreq: powernv: fix stack bloat and hard limit on number of CPUs
  * PM / devfreq: Lock devfreq in trans_stat_show
      drivers/devfreq/devfreq.c
    intel_th: pci: Add Tiger Lake CPU support
    intel_th: pci: Add Ice Lake CPU support
    intel_th: Fix a double put_device() in error path
  * cpuidle: Do not unset the driver if it is there already
      drivers/cpuidle/driver.c
  * media: cec.h: CEC_OP_REC_FLAG_ values were swapped
      include/uapi/linux/cec.h
    media: radio: wl1273: fix interrupt masking on release
    media: bdisp: fix memleak on release
    s390/mm: properly clear _PAGE_NOEXEC bit when it is not supported
    ar5523: check NULL before memcpy() in ar5523_cmd()
    cgroup: pids: use atomic64_t for pids->limit
  * blk-mq: avoid sysfs buffer overflow with too many CPU cores
      block/blk-mq-sysfs.c
  * ASoC: Jack: Fix NULL pointer dereference in snd_soc_jack_report
      sound/soc/soc-jack.c
  * workqueue: Fix pwq ref leak in rescuer_thread()
      kernel/workqueue.c
  * workqueue: Fix spurious sanity check failures in destroy_workqueue()
      kernel/workqueue.c
    dm zoned: reduce overhead of backing device checks
    hwrng: omap - Fix RNG wait loop timeout
    watchdog: aspeed: Fix clock behaviour for ast2600
    md/raid0: Fix an error message in raid0_make_request()
    ALSA: hda - Fix pending unsol events at shutdown
  * ovl: relax WARN_ON() on rename to self
      fs/overlayfs/dir.c
    lib: raid6: fix awk build warnings
    rtlwifi: rtl8192de: Fix missing enable interrupt flag
    rtlwifi: rtl8192de: Fix missing callback that tests for hw release of buffer
    rtlwifi: rtl8192de: Fix missing code to retrieve RX buffer address
    btrfs: record all roots for rename exchange on a subvol
    Btrfs: send, skip backreference walking for extents with many references
    btrfs: Remove btrfs_bio::flags member
    Btrfs: fix negative subv_writers counter and data space leak after buffered write
    btrfs: use refcount_inc_not_zero in kill_all_nodes
    btrfs: check page->mapping when loading free space cache
  * usb: dwc3: ep0: Clear started flag on completion
      drivers/usb/dwc3/ep0.c
    virtio-balloon: fix managed page counts when migrating pages between zones
    mtd: spear_smi: Fix Write Burst mode
    tpm: add check after commands attribs tab allocation
    usb: mon: Fix a deadlock in usbmon between mmap and read
  * usb: core: urb: fix URB structure initialization function
      drivers/usb/core/urb.c
    USB: adutux: fix interface sanity check
    USB: serial: io_edgeport: fix epic endpoint lookup
    USB: idmouse: fix interface sanity checks
    USB: atm: ueagle-atm: add missing endpoint check
    iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
    ARM: dts: pandora-common: define wl1251 as child node of mmc3
  * xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour.
      drivers/usb/host/xhci-ring.c
  * xhci: Increase STS_HALT timeout in xhci_suspend()
      drivers/usb/host/xhci.c
  * usb: xhci: only set D3hot for pci device
      drivers/usb/host/xhci-pci.c
      drivers/usb/host/xhci.c
      drivers/usb/host/xhci.h
    staging: gigaset: add endpoint-type sanity check
    staging: gigaset: fix illegal free on probe errors
    staging: gigaset: fix general protection fault on probe
    staging: rtl8712: fix interface sanity check
    staging: rtl8188eu: fix interface sanity check
  * usb: Allow USB device to be warm reset in suspended state
      drivers/usb/core/hub.c
    USB: documentation: flags on usb-storage versus UAS
    USB: uas: heed CAPACITY_HEURISTICS
    USB: uas: honor flag to avoid CAPACITY16
    media: venus: remove invalid compat_ioctl32 handler
    scsi: qla2xxx: Fix driver unload hang
    usb: gadget: pch_udc: fix use after free
  * usb: gadget: configfs: Fix missing spin_lock_init()
      drivers/usb/gadget/configfs.c
    appletalk: Set error code if register_snap_client failed
  * appletalk: Fix potential NULL pointer dereference in unregister_snap_client
      include/linux/atalk.h
    KVM: x86: fix out-of-bounds write in KVM_GET_EMULATED_CPUID (CVE-2019-19332)
    ASoC: rsnd: fixup MIX kctrl registration
  * binder: Handle start==NULL in binder_update_page_range()
      drivers/android/binder_alloc.c
  * thermal: Fix deadlock in thermal thermal_zone_device_check
      drivers/thermal/thermal_core.c
    iomap: Fix pipe page leakage during splicing
    RDMA/qib: Validate ->show()/store() callbacks before calling them
    spi: atmel: Fix CS high support
    crypto: user - fix memory leak in crypto_report
  * crypto: ecdh - fix big endian bug in ECC library
      crypto/ecc.c
    crypto: ccp - fix uninitialized list head
    crypto: af_alg - cast ki_complete ternary op to int
    crypto: crypto4xx - fix double-free in crypto4xx_destroy_sdr
    KVM: x86: fix presentation of TSX feature in ARCH_CAPABILITIES
    KVM: x86: do not modify masked bits of shared MSRs
    KVM: arm/arm64: vgic: Don't rely on the wrong pending table
    drm/i810: Prevent underflow in ioctl
  * jbd2: Fix possible overflow in jbd2_log_space_left()
      include/linux/jbd2.h
  * kernfs: fix ino wrap-around detection
      fs/kernfs/dir.c
      include/linux/kernfs.h
    can: slcan: Fix use-after-free Read in slcan_open
  * tty: vt: keyboard: reject invalid keycodes
      drivers/tty/vt/keyboard.c
    CIFS: Fix SMB2 oplock break processing
    CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
    x86/PCI: Avoid AMD FCH XHCI USB PME# from D0 defect
    Input: Fix memory leak in psxpad_spi_probe
    coresight: etm4x: Fix input validation for sysfs.
    Input: goodix - add upside-down quirk for Teclast X89 tablet
    Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers
    Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash
    Input: synaptics - switch another X1 Carbon 6 to RMI/SMbus
    ALSA: hda - Add mute led support for HP ProBook 645 G4
    ALSA: pcm: oss: Avoid potential buffer overflows
    ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236
  * fuse: verify attributes
      fs/fuse/dir.c
      fs/fuse/fuse_i.h
  * fuse: verify nlink
      fs/fuse/dir.c
  * sched/fair: Scale bandwidth quota and period without losing quota/period ratio precision
      kernel/sched/fair.c
  * tcp: exit if nothing to retransmit on RTO timeout
      net/ipv4/tcp_timer.c
    net: aquantia: fix RSS table and key sizes
    media: vimc: fix start stream when link is disabled
    ARM: dts: sunxi: Fix PMU compatible strings
    usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handler
    mlx4: Use snprintf instead of complicated strcpy
    IB/hfi1: Close VNIC sdma_progress sleep window
    IB/hfi1: Ignore LNI errors before DC8051 transitions to Polling state
    mlxsw: spectrum_router: Relax GRE decap matching check
  * firmware: qcom: scm: fix compilation error when disabled
      include/linux/qcom_scm.h
    media: stkwebcam: Bugfix for wrong return values
  * tty: Don't block on IO when ldisc change is pending
      drivers/tty/n_tty.c
      drivers/tty/tty_ldisc.c
      include/linux/tty.h
    nfsd: Return EPERM, not EACCES, in some SETATTR cases
    MIPS: OCTEON: cvmx_pko_mem_debug8: use oldest forward compatible definition
    clk: renesas: r8a77995: Correct parent clock of DU
    powerpc/math-emu: Update macros from GCC
  * pstore/ram: Avoid NULL deref in ftrace merging failure path
      fs/pstore/ram.c
    net/mlx4_core: Fix return codes of unsupported operations
    dlm: fix invalid cluster name warning
    ARM: dts: realview: Fix some more duplicate regulator nodes
    clk: sunxi-ng: h3/h5: Fix CSI_MCLK parent
    ARM: dts: pxa: clean up USB controller nodes
    mtd: fix mtd_oobavail() incoherent returned value
  * kbuild: fix single target build for external module
      Makefile
  * modpost: skip ELF local symbols during section mismatch check
      scripts/mod/modpost.c
  * tcp: fix SNMP TCP timeout under-estimation
      net/ipv4/tcp_timer.c
  * tcp: fix SNMP under-estimation on failed retransmission
      net/ipv4/tcp_output.c
  * tcp: fix off-by-one bug on aborting window-probing socket
      net/ipv4/tcp_timer.c
    ARM: dts: realview-pbx: Fix duplicate regulator nodes
    ARM: dts: mmp2: fix the gpio interrupt cell number
    net/x25: fix null_x25_address handling
    net/x25: fix called/calling length calculation in x25_parse_address_block
    arm64: dts: meson-gxl-khadas-vim: fix GPIO lines names
    arm64: dts: meson-gxbb-odroidc2: fix GPIO lines names
    arm64: dts: meson-gxbb-nanopi-k2: fix GPIO lines names
    arm64: dts: meson-gxl-libretech-cc: fix GPIO lines names
    ARM: OMAP1/2: fix SoC name printing
    ASoC: au8540: use 64-bit arithmetic instead of 32-bit
    nfsd: fix a warning in __cld_pipe_upcall()
    ARM: debug: enable UART1 for socfpga Cyclone5
    dlm: NULL check before kmem_cache_destroy is not needed
    ARM: dts: sun8i: v3s: Change pinctrl nodes to avoid warning
    ARM: dts: sun5i: a10s: Fix HDMI output DTC warning
    ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()
    lockd: fix decoding of TEST results
    i2c: imx: don't print error message on probe defer
    serial: imx: fix error handling in console_setup
    altera-stapl: check for a null key before strcasecmp'ing it
  * dma-mapping: fix return type of dma_set_max_seg_size()
      include/linux/dma-mapping.h
    sparc: Correct ctx->saw_frame_pointer logic.
  * f2fs: fix to allow node segment for GC by ioctl path
      fs/f2fs/gc.c
    ARM: dts: rockchip: Assign the proper GPIO clocks for rv1108
    ARM: dts: rockchip: Fix the PMU interrupt number for rv1108
  * f2fs: change segment to section in f2fs_ioc_gc_range
      fs/f2fs/file.c
  * f2fs: fix count of seg_freed to make sec_freed correct
      fs/f2fs/gc.c
  * ACPI: fix acpi_find_child_device() invocation in acpi_preset_companion()
      include/linux/acpi.h
  * usb: dwc3: don't log probe deferrals; but do log other error codes
      drivers/usb/dwc3/core.c
  * usb: dwc3: debugfs: Properly print/set link state for HS
      drivers/usb/dwc3/debug.h
      drivers/usb/dwc3/debugfs.c
    dmaengine: dw-dmac: implement dma protection control setting
    dmaengine: coh901318: Remove unused variable
    dmaengine: coh901318: Fix a double-lock bug
    media: cec: report Vendor ID after initialization
    media: pulse8-cec: return 0 when invalidating the logical address
    ARM: dts: exynos: Use Samsung SoC specific compatible for DWC2 module
    rtc: dt-binding: abx80x: fix resistance scale
    rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
    math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning
    net/smc: use after free fix in smc_wr_tx_put_slot()
    MIPS: OCTEON: octeon-platform: fix typing
    iomap: sub-block dio needs to zeroout beyond EOF
    net-next/hinic:fix a bug in set mac address
  * regulator: Fix return value of _set_load() stub
      include/linux/regulator/consumer.h
    clk: rockchip: fix ID of 8ch clock of I2S1 for rk3328
    clk: rockchip: fix I2S1 clock gate register for rk3328
  * mm/vmstat.c: fix NUMA statistics updates
      mm/vmstat.c
    Staging: iio: adt7316: Fix i2c data reading, set the data field
    pinctrl: qcom: ssbi-gpio: fix gpio-hog related boot issues
    crypto: bcm - fix normal/non key hash algorithm failure
  * crypto: ecc - check for invalid values in the key verification test
      crypto/ecc.c
    scsi: zfcp: drop default switch case which might paper over missing case
    net: dsa: mv88e6xxx: Work around mv886e6161 SERDES missing MII_PHYSID2
    MIPS: SiByte: Enable ZONE_DMA32 for LittleSur
    dlm: fix missing idr_destroy for recover_idr
    ARM: dts: rockchip: Fix rk3288-rock2 vcc_flash name
    clk: rockchip: fix rk3188 sclk_mac_lbtest parameter ordering
    clk: rockchip: fix rk3188 sclk_smc gate data
    i40e: don't restart nway if autoneg not supported
    rtc: s3c-rtc: Avoid using broken ALMYEAR register
    net: ethernet: ti: cpts: correct debug for expired txq skb
    extcon: max8997: Fix lack of path setting in USB device mode
    dlm: fix possible call to kfree() for non-initialized pointer
    clk: sunxi-ng: a64: Fix gate bit of DSI DPHY
    net/mlx5: Release resource on error flow
    ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+
    iwlwifi: mvm: Send non offchannel traffic via AP sta
    iwlwifi: mvm: synchronize TID queue removal
    cxgb4vf: fix memleak in mac_hlist initialization
  * serial: core: Allow processing sysrq at port unlock time
      include/linux/serial_core.h
  * i2c: core: fix use after free in of_i2c_notify
      drivers/i2c/i2c-core-of.c
    net: ep93xx_eth: fix mismatch of request_mem_region in remove
    rsxx: add missed destroy_workqueue calls in remove
  * ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed()
      sound/core/pcm_lib.c
  * sched/core: Avoid spurious lock dependencies
      kernel/sched/core.c
    Input: cyttsp4_core - fix use after free bug
  * xfrm: release device reference for invalid state
      net/xfrm/xfrm_input.c
    NFC: nxp-nci: Fix NULL pointer dereference after I2C communication error
    audit_get_nd(): don't unlock parent too early
  * exportfs_decode_fh(): negative pinned may become positive without the parent locked
      fs/exportfs/expfs.c
    iwlwifi: pcie: don't consider IV len in A-MSDU
    RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN
    autofs: fix a leak in autofs_expire_indirect()
    serial: ifx6x60: add missed pm_runtime_disable
  * serial: serial_core: Perform NULL checks for break_ctl ops
      drivers/tty/serial/serial_core.c
    serial: pl011: Fix DMA ->flush_buffer()
    tty: serial: msm_serial: Fix flow control
    tty: serial: fsl_lpuart: use the sg count from dma_map_sg
    usb: gadget: u_serial: add missing port entry locking
    arm64: tegra: Fix 'active-low' warning for Jetson TX1 regulator
    rsi: release skb if rsi_prepare_beacon fails
  * ANDROID: staging: android: ion: Fix build when CONFIG_ION_SYSTEM_HEAP=n
      drivers/staging/android/ion/ion.h
    Merge remote-tracking branch 'origin/upstream-f2fs-stable-linux-4.14.y/v5.5-rc1' into android-4.14
  * ANDROID: staging: android: ion: Expose total heap and pool sizes via sysfs
      drivers/staging/android/ion/ion.c
      drivers/staging/android/ion/ion.h
      drivers/staging/android/ion/ion_page_pool.c
  * UPSTREAM: include/linux/slab.h: fix sparse warning in kmalloc_type()
      include/linux/slab.h
  * UPSTREAM: mm, slab: shorten kmalloc cache names for large sizes
      mm/slab_common.c
  * UPSTREAM: mm, proc: add KReclaimable to /proc/meminfo
      fs/proc/meminfo.c
  * BACKPORT: mm: rename and change semantics of nr_indirectly_reclaimable_bytes
      drivers/staging/android/ion/ion_page_pool.c
      include/linux/mmzone.h
      mm/page_alloc.c
      mm/util.c
      mm/vmstat.c
  * UPSTREAM: dcache: allocate external names from reclaimable kmalloc caches
      fs/dcache.c
  * BACKPORT: mm, slab/slub: introduce kmalloc-reclaimable caches
      include/linux/slab.h
      mm/slab_common.c
  * UPSTREAM: mm, slab: combine kmalloc_caches and kmalloc_dma_caches
      include/linux/slab.h
      mm/slab_common.c
      mm/slub.c
  * ANDROID: kbuild: disable SCS by default in allmodconfig
      arch/Kconfig
      arch/arm64/Kconfig
    ANDROID: arm64: cuttlefish_defconfig: enable LTO, CFI, and SCS
  * BACKPORT: FROMLIST: arm64: implement Shadow Call Stack
      arch/arm64/Kconfig
      arch/arm64/include/asm/scs.h
      arch/arm64/include/asm/stacktrace.h
      arch/arm64/include/asm/thread_info.h
      arch/arm64/kernel/Makefile
      arch/arm64/kernel/asm-offsets.c
      arch/arm64/kernel/entry.S
      arch/arm64/kernel/head.S
      arch/arm64/kernel/irq.c
      arch/arm64/kernel/process.c
      arch/arm64/kernel/scs.c
      arch/arm64/kernel/smp.c
    FROMLIST: arm64: disable SCS for hypervisor code
  * BACKPORT: FROMLIST: arm64: vdso: disable Shadow Call Stack
      arch/arm64/kernel/vdso/Makefile
  * FROMLIST: arm64: preserve x18 when CPU is suspended
      arch/arm64/include/asm/suspend.h
      arch/arm64/mm/proc.S
  * FROMLIST: arm64: reserve x18 from general allocation with SCS
      arch/arm64/Makefile
  * FROMLIST: arm64: disable function graph tracing with SCS
      arch/arm64/Kconfig
  * FROMLIST: scs: add support for stack usage debugging
      kernel/scs.c
  * FROMLIST: scs: add accounting
      fs/proc/meminfo.c
      include/linux/mmzone.h
      kernel/scs.c
      mm/page_alloc.c
      mm/vmstat.c
  * FROMLIST: add support for Clang's Shadow Call Stack (SCS)
      Makefile
      arch/Kconfig
      include/linux/compiler-clang.h
      include/linux/compiler_types.h
      include/linux/scs.h
      init/init_task.c
      kernel/Makefile
      kernel/fork.c
      kernel/sched/core.c
      kernel/scs.c
    FROMLIST: arm64: kernel: avoid x18 in __cpu_soft_restart
    FROMLIST: arm64: kvm: stop treating register x18 as caller save
  * FROMLIST: arm64/lib: copy_page: avoid x18 register in assembler code
      arch/arm64/lib/copy_page.S
  * FROMLIST: arm64: mm: avoid x18 in idmap_kpti_install_ng_mappings
      arch/arm64/mm/proc.S
  * ANDROID: use non-canonical CFI jump tables
      Makefile
  * ANDROID: arm64: add __nocfi to __apply_alternatives
      arch/arm64/kernel/alternative.c
  * ANDROID: arm64: add __pa_function
      arch/arm64/include/asm/memory.h
      arch/arm64/include/asm/mmu_context.h
      arch/arm64/kernel/cpufeature.c
      arch/arm64/kernel/psci.c
      arch/arm64/kernel/smp_spin_table.c
  * ANDROID: arm64: allow ThinLTO to be selected
      arch/arm64/Kconfig
  * ANDROID: soc/tegra: disable ARCH_TEGRA_210_SOC with LTO
      drivers/soc/tegra/Kconfig
  * FROMLIST: arm64: fix alternatives with LLVM's integrated assembler
      arch/arm64/include/asm/alternative.h
  * ANDROID: irqchip/gic-v3: rename gic_of_init to work around a ThinLTO+CFI bug
      drivers/irqchip/irq-gic-v3.c
  * ANDROID: kbuild: limit LTO inlining
      Makefile
  * ANDROID: kbuild: merge module sections with LTO
      Makefile
  * ANDROID: init: ensure initcall ordering with LTO
      include/linux/init.h
      scripts/generate_initcall_order.pl
      scripts/link-vmlinux.sh
  * Revert "ANDROID: HACK: init: ensure initcall ordering with LTO"
      include/linux/init.h
  * ANDROID: add support for ThinLTO
      Makefile
      arch/Kconfig
      scripts/Makefile.build
    ANDROID: Switch to LLD
    ANDROID: clang: update to 10.0.1
  * ANDROID: arm64: add atomic_ll_sc.o to obj-y if using lld
      arch/arm64/lib/Makefile
  * ANDROID: enable ARM64_ERRATUM_843419 by default with LTO_CLANG
      arch/arm64/Kconfig
  * ANDROID: kbuild: allow lld to be used with CONFIG_LTO_CLANG
      Makefile
  * ANDROID: Makefile: set -Qunused-arguments sooner
      Makefile
  * BACKPORT: FROMLIST: Makefile: lld: tell clang to use lld
      Makefile
  * BACKPORT: FROMLIST: Makefile: lld: set -O2 linker flag when linking with LLD
      Makefile
  * ANDROID: scripts/Kbuild: add ld-name support for ld.lld
      scripts/Kbuild.include
  * UPSTREAM: bpf: permit multiple bpf attachments for a single perf event
      include/linux/bpf.h
      include/linux/trace_events.h
      include/trace/perf.h
      kernel/bpf/core.c
      kernel/events/core.c
      kernel/trace/bpf_trace.c
      kernel/trace/trace_uprobe.c
  * UPSTREAM: bpf: use the same condition in perf event set/free bpf handler
      kernel/events/core.c
  * UPSTREAM: bpf: multi program support for cgroup+bpf
      include/linux/bpf-cgroup.h
      include/linux/bpf.h
      include/linux/filter.h
      include/uapi/linux/bpf.h
      kernel/bpf/cgroup.c
      kernel/bpf/core.c
      kernel/bpf/syscall.c
      kernel/cgroup/cgroup.c
  * BACKPORT: serdev: make synchronous write return bytes written
      drivers/tty/serdev/core.c
    UPSTREAM: gnss: serial: fix synchronous write timeout
    UPSTREAM: gnss: fix potential error pointer dereference
    BACKPORT: gnss: add receiver type support
    UPSTREAM: dt-bindings: add generic gnss binding
  * UPSTREAM: gnss: add generic serial driver
      drivers/gnss/Kconfig
    ANDROID: cuttlefish_defconfig: Enable CONFIG_SERIAL_DEV_BUS
    ANDROID: cuttlefish_defconfig: Enable CONFIG_GNSS
  * BACKPORT: gnss: add GNSS receiver subsystem
      drivers/Kconfig
      drivers/Makefile
      drivers/gnss/Kconfig
  * UPSTREAM: arm64: Validate tagged addresses in access_ok() called from kernel threads
      arch/arm64/include/asm/uaccess.h
    BACKPORT: ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer
    Merge 4.14.158 into android-4.14
Linux 4.14.158
    net: fec: fix clock count mis-match
    platform/x86: hp-wmi: Fix ACPI errors caused by passing 0 as input size
    platform/x86: hp-wmi: Fix ACPI errors caused by too small buffer
    ASoC: stm32: i2s: fix IRQ clearing
    ASoC: stm32: i2s: fix 16 bit format support
    ASoC: stm32: i2s: fix dma configuration
    pinctrl: stm32: fix memory leak issue
    mailbox: mailbox-test: fix null pointer if no mmio
    hwrng: stm32 - fix unbalanced pm_runtime_enable
    media: stm32-dcmi: fix DMA corruption when stopping streaming
    crypto: stm32/hash - Fix hmac issue more than 256 bytes
  * HID: core: check whether Usage Page item is after Usage ID items
      drivers/hid/hid-core.c
  * futex: Prevent exit livelock
      kernel/futex.c
  * futex: Provide distinct return value when owner is exiting
      kernel/futex.c
  * futex: Add mutex around futex exit
      include/linux/futex.h
      include/linux/sched.h
      kernel/futex.c
  * futex: Provide state handling for exec() as well
      kernel/futex.c
  * futex: Sanitize exit state handling
      kernel/futex.c
  * futex: Mark the begin of futex exit explicitly
      include/linux/futex.h
      kernel/exit.c
      kernel/futex.c
  * futex: Set task::futex_state to DEAD right after handling futex exit
      kernel/exit.c
      kernel/futex.c
  * futex: Split futex_mm_release() for exit/exec
      include/linux/futex.h
      kernel/fork.c
      kernel/futex.c
  * exit/exec: Seperate mm_release()
      fs/exec.c
      include/linux/sched/mm.h
      kernel/exit.c
      kernel/fork.c
  * futex: Replace PF_EXITPIDONE with a state
      include/linux/futex.h
      include/linux/sched.h
      kernel/exit.c
      kernel/futex.c
  * futex: Move futex exit handling into futex code
      include/linux/compat.h
      include/linux/futex.h
      kernel/fork.c
      kernel/futex.c
  * futex: Prevent robust futex exit race
      kernel/futex.c
  * y2038: futex: Move compat implementation into futex.c
      include/linux/futex.h
      kernel/Makefile
      kernel/futex.c
    mtd: spi-nor: cast to u64 to avoid uint overflows
    mtd: rawnand: atmel: fix possible object reference leak
    mtd: rawnand: atmel: Fix spelling mistake in error message
    net: macb driver, check for SKBTX_HW_TSTAMP
    net: macb: Fix SUBNS increment and increase resolution
    watchdog: sama5d4: fix WDD value to be always set to max
  * ext4: add more paranoia checking in ext4_expand_extra_isize handling
      fs/ext4/inode.c
      fs/ext4/super.c
  * net: sched: fix `tc -s class show` no bstats on class with nolock subqueues
      net/sched/sch_mq.c
      net/sched/sch_multiq.c
      net/sched/sch_prio.c
  * sctp: cache netns in sctp_ep_common
      include/net/sctp/structs.h
    tipc: fix link name length check
    openvswitch: remove another BUG_ON()
    openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()
    slip: Fix use-after-free Read in slip_open
    openvswitch: fix flow command message size
    net: psample: fix skb_over_panic
    macvlan: schedule bc_work even if error
    media: atmel: atmel-isc: fix INIT_WORK misplacement
    media: atmel: atmel-isc: fix asd memory allocation
  * pwm: Clear chip_data in pwm_put()
      drivers/pwm/core.c
    net: macb: fix error format in dev_err()
  * media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE
      drivers/media/v4l2-core/v4l2-ctrls.c
  * xfrm: Fix memleak on xfrm state destroy
      net/xfrm/xfrm_state.c
    mei: bus: prefix device names on bus with the bus name
    USB: serial: ftdi_sio: add device IDs for U-Blox C099-F9P
    staging: rtl8723bs: Add 024c:0525 to the list of SDIO device-ids
    staging: rtl8723bs: Drop ACPI device ids
    staging: rtl8192e: fix potential use after free
    clk: at91: generated: set audio_pll_allowed in at91_clk_register_generated()
    clk: at91: fix update bit maps on CFG_MOR write
    mm, gup: add missing refcount overflow checks on s390
    mtd: Remove a debug trace in mtdpart.c
    powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property()
    scsi: libsas: Check SMP PHY control function result
    ACPI / APEI: Switch estatus pool to use vmalloc memory
    ACPI / APEI: Don't wait to serialise with oops messages when panic()ing
    scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery
    apparmor: delete the dentry in aafs_remove() to avoid a leak
    iommu/amd: Fix NULL dereference bug in match_hid_uid
    net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED
  * bpf: drop refcount if bpf_map_new_fd() fails in map_create()
      kernel/bpf/syscall.c
    kvm: properly check debugfs dentry before using it
  * net: dev: Use unsigned integer as an argument to left-shift
      include/linux/netdevice.h
  * bpf: decrease usercnt if bpf_map_new_fd() fails in bpf_map_get_fd_by_id()
      kernel/bpf/syscall.c
    sctp: don't compare hb_timer expire date before starting it
  * net: fix possible overflow in __sk_mem_raise_allocated()
      include/net/sock.h
      net/core/sock.c
    sfc: initialise found bitmap in efx_ef10_mtd_probe
    tipc: fix skb may be leaky in tipc_link_input
  * blktrace: Show requests without sector
      include/linux/blktrace_api.h
    net/smc: prevent races between smc_lgr_terminate() and smc_conn_free()
    decnet: fix DN_IFREQ_SIZE
  * ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel
      net/ipv4/ip_tunnel.c
    sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe
    gpu: ipu-v3: pre: don't trigger update if buffer address doesn't change
    serial: 8250: Fix serial8250 initialization crash
  * net/core/neighbour: fix kmemleak minimal reference count for hash tables
      net/core/neighbour.c
  * PCI/MSI: Return -ENOSPC from pci_alloc_irq_vectors_affinity()
      drivers/pci/msi.c
  * net/core/neighbour: tell kmemleak about hash tables
      net/core/neighbour.c
    tipc: fix memory leak in tipc_nl_compat_publ_dump
    mtd: Check add_mtd_device() ret code
  * lib/genalloc.c: include vmalloc.h
      lib/genalloc.c
  * drivers/base/platform.c: kmemleak ignore a known leak
      drivers/base/platform.c
  * fork: fix some -Wmissing-prototypes warnings
      include/linux/sched/task.h
      init/main.c
      kernel/fork.c
  * lib/genalloc.c: use vzalloc_node() to allocate the bitmap
      lib/genalloc.c
  * lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk
      include/linux/genalloc.h
      lib/genalloc.c
  * vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n
      include/linux/swap.h
      mm/internal.h
    ocfs2: clear journal dirty flag after shutdown journal
    net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe()
    tipc: fix a missing check of genlmsg_put
    atl1e: checking the status of atl1e_write_phy_reg
    net: dsa: bcm_sf2: Propagate error value from mdio_write
    net: stmicro: fix a missing check of clk_prepare
    net: (cpts) fix a missing check of clk_prepare
    um: Make GCOV depend on !KCOV
  * f2fs: fix to dirty inode synchronously
      fs/f2fs/file.c
  * net/net_namespace: Check the return value of register_pernet_subsys()
      net/core/net_namespace.c
    net/netlink_compat: Fix a missing check of nla_parse_nested
    pwm: clps711x: Fix period calculation
    crypto: mxc-scc - fix build warnings on ARM64
    powerpc/pseries: Fix node leak in update_lmb_associativity_index()
    powerpc/83xx: handle machine check caused by watchdog timer
    regulator: tps65910: fix a missing check of return value
    IB/rxe: Make counters thread safe
    drbd: fix print_st_err()'s prototype to match the definition
    drbd: do not block when adjusting "disk-options" while IO is frozen
    drbd: reject attach of unsuitable uuids even if connected
    drbd: ignore "all zero" peer volume sizes in handshake
    powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status
    vfio/spapr_tce: Get rid of possible infinite loop
    powerpc/44x/bamboo: Fix PCI range
    powerpc/mm: Make NULL pointer deferences explicit on bad page faults.
    powerpc/prom: fix early DEBUG messages
    powerpc/perf: Fix unit_sel/cache_sel checks
    ath6kl: Fix off by one error in scan completion
    ath6kl: Only use match sets when firmware supports it
    scsi: csiostor: fix incorrect dma device in case of vport
    scsi: qla2xxx: deadlock by configfs_depend_item
    RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer
    openrisc: Fix broken paths to arch/or32
    serial: max310x: Fix tx_empty() callback
    Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading
    drivers/regulator: fix a missing check of return value
    powerpc/xmon: fix dump_segments()
    powerpc/book3s/32: fix number of bats in p/v_block_mapped()
    vxlan: Fix error path in __vxlan_dev_create()
    clocksource/drivers/fttmr010: Fix invalid interrupt register access
    IB/qib: Fix an error code in qib_sdma_verbs_send()
    xfs: Fix bulkstat compat ioctls on x32 userspace.
    xfs: Align compat attrlist_by_handle with native implementation.
    gfs2: take jdata unstuff into account in do_grow
    dm flakey: Properly corrupt multi-page bios.
    HID: doc: fix wrong data structure reference for UHID_OUTPUT
    pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10
    pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration
    KVM: s390: unregister debug feature on failing arch init
    bnxt_en: query force speeds before disabling autoneg mode.
    bnxt_en: Return linux standard errors in bnxt_ethtool.c
    exofs_mount(): fix leaks on failure exits
    net/mlx5: Continue driver initialization despite debugfs failure
    pinctrl: xway: fix gpio-hog related boot issues
    vfio-mdev/samples: Use u8 instead of char for handle functions
    xen/pciback: Check dev_data before using it
    kprobes/x86/xen: blacklist non-attachable xen interrupt functions
    serial: 8250: Rate limit serial port rx interrupts during input overruns
    HID: intel-ish-hid: fixes incorrect error handling
    btrfs: only track ref_heads in delayed_ref_updates
    mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET
    mmc: meson-gx: make sure the descriptor is stopped on errors
    VSOCK: bind to random port for VMADDR_PORT_ANY
    kvm: vmx: Set IA32_TSC_AUX for legacy mode guests
  * gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB
      include/linux/gpio/consumer.h
    iwlwifi: move iwl_nvm_check_version() into dvm
    microblaze: move "... is ready" messages to arch/microblaze/Makefile
    microblaze: adjust the help to the real behavior
    ubi: Do not drop UBI device reference before using
    ubi: Put MTD device after it is not used
    xfs: require both realtime inodes to mount
    rtl818x: fix potential use after free
    mwifiex: debugfs: correct histogram spacing, formatting
    mwifiex: fix potential NULL dereference and use after free
    crypto: user - support incremental algorithm dumps
    scsi: lpfc: Enable Management features for IF_TYPE=6
    ACPI / LPSS: Ignore acpi_device_fix_up_power() return value
    ARM: ks8695: fix section mismatch warning
    PM / AVS: SmartReflex: NULL check before some freeing functions is not needed
    RDMA/vmw_pvrdma: Use atomic memory allocation in create AH
    ARM: OMAP1: fix USB configuration for device-only setups
  * arm64: smp: Handle errors reported by the firmware
      arch/arm64/kernel/smp.c
  * arm64: mm: Prevent mismatched 52-bit VA support
      arch/arm64/kernel/head.S
      arch/arm64/kernel/smp.c
    parisc: Fix HP SDC hpa address output
    parisc: Fix serio address output
    ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication
    ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed
    ARM: dts: Fix up SQ201 flash access
    scsi: lpfc: Fix dif and first burst use in write commands
    scsi: lpfc: Fix kernel Oops due to null pring pointers
    pwm: bcm-iproc: Prevent unloading the driver module while in use
    block: drbd: remove a stray unlock in __drbd_send_protocol()
    mac80211: fix station inactive_time shortly after boot
    ceph: return -EINVAL if given fsc mount option on kernel w/o support
    net: bcmgenet: reapply manual settings to the PHY
    scripts/gdb: fix debugging modules compiled with hot/cold partitioning
    watchdog: meson: Fix the wrong value of left time
    can: rx-offload: can_rx_offload_irq_offload_fifo(): continue on error
    can: rx-offload: can_rx_offload_irq_offload_timestamp(): continue on error
    can: rx-offload: can_rx_offload_offload_one(): use ERR_PTR() to propagate error value in case of errors
    can: rx-offload: can_rx_offload_offload_one(): increment rx_fifo_errors on queue overflow or OOM
    can: rx-offload: can_rx_offload_offload_one(): do not increase the skb_queue beyond skb_queue_len_max
    can: rx-offload: can_rx_offload_queue_tail(): fix error handling, avoid skb mem leak
    can: c_can: D_CAN: c_can_chip_config(): perform a sofware reset on open
    can: peak_usb: report bus recovery as well
    bridge: ebtables: don't crash when using dnat target in output chains
    net: fec: add missed clk_disable_unprepare in remove
    clk: ti: dra7-atl-clock: Remove ti_clk_add_alias call
    x86/resctrl: Prevent NULL pointer dereference when reading mondata
  * idr: Fix idr_alloc_u32 on 32-bit systems
      lib/radix-tree.c
    clk: sunxi-ng: a80: fix the zero'ing of bits 16 and 18
    clk: at91: avoid sleeping early
  * reset: fix reset_control_ops kerneldoc comment
      include/linux/reset-controller.h
    clk: samsung: exynos5420: Preserve PLL configuration during suspend/resume
    ASoC: kirkwood: fix external clock probe defer
  * reset: Fix memory leak in reset_control_array_put()
      drivers/reset/core.c
  * ASoC: compress: fix unsigned integer overflow check
      sound/core/compress_offload.c
    ASoC: msm8916-wcd-analog: Fix RX1 selection in RDAC2 MUX
    clk: meson: gxbb: let sar_adc_clk_div set the parent clock rate
    Revert "KVM: nVMX: reset cache/shadows when switching loaded VMCS"
  * fs/lock: skip lock owner pid translation in case we are in init_pid_ns
      fs/locks.c
    UPSTREAM: dt-bindings: arm: coresight: Add support for coresight-loses-context-with-cpu
  * BACKPORT: coresight: etm4x: Save/restore state across CPU low power states
      include/linux/coresight.h
  * f2fs: stop GC when the victim becomes fully valid
      fs/f2fs/gc.c
  * f2fs: expose main_blkaddr in sysfs
      fs/f2fs/sysfs.c
  * f2fs: choose hardlimit when softlimit is larger than hardlimit in f2fs_statfs_project()
      fs/f2fs/super.c
  * f2fs: Fix deadlock in f2fs_gc() context during atomic files handling
      fs/f2fs/f2fs.h
      fs/f2fs/file.c
      fs/f2fs/segment.c
  * f2fs: show f2fs instance in printk_ratelimited
      fs/f2fs/checkpoint.c
      fs/f2fs/data.c
      fs/f2fs/dir.c
      fs/f2fs/f2fs.h
      fs/f2fs/file.c
      fs/f2fs/gc.c
      fs/f2fs/inode.c
      fs/f2fs/node.c
      fs/f2fs/segment.c
  * f2fs: fix potential overflow
      fs/f2fs/data.c
      fs/f2fs/file.c
  * f2fs: fix to update dir's i_pino during cross_rename
      fs/f2fs/namei.c
  * f2fs: support aligned pinned file
      fs/f2fs/f2fs.h
      fs/f2fs/file.c
      fs/f2fs/recovery.c
      fs/f2fs/segment.c
      fs/f2fs/segment.h
      fs/f2fs/super.c
      fs/f2fs/sysfs.c
  * f2fs: avoid kernel panic on corruption test
      fs/f2fs/node.c
    f2fs: fix wrong description in document
  * f2fs: cache global IPU bio
      fs/f2fs/data.c
      fs/f2fs/f2fs.h
      fs/f2fs/segment.c
      fs/f2fs/super.c
  * f2fs: fix to avoid memory leakage in f2fs_listxattr
      fs/f2fs/xattr.c
  * f2fs: check total_segments from devices in raw_super
      fs/f2fs/super.c
  * f2fs: update multi-dev metadata in resize_fs
      fs/f2fs/gc.c
  * f2fs: mark recovery flag correctly in read_raw_super_block()
      fs/f2fs/super.c
  * f2fs: fix to update time in lazytime mode
      fs/f2fs/f2fs.h
      fs/f2fs/inode.c
  * vfs: don't allow writes to swap files
      fs/block_dev.c
      include/linux/fs.h
      mm/filemap.c
      mm/memory.c
      mm/mmap.c
      mm/swapfile.c
  * mm: set S_SWAPFILE on blockdev swap devices
      mm/swapfile.c
    BACKPORT: ARM: 8900/1: UNWINDER_FRAME_POINTER implementation for Clang
    Merge 4.14.157 into android-4.14
Linux 4.14.157
    x86/hyperv: mark hyperv_init as __init function
    KVM: PPC: Book3S HV: Flush link stack on guest exit to host kernel
    powerpc/book3s64: Fix link stack flush on context switch
    powerpc/64s: support nospectre_v2 cmdline option
    staging: comedi: usbduxfast: usbduxfast_ai_cmdtest rounding error
    USB: serial: option: add support for Foxconn T77W968 LTE modules
    USB: serial: option: add support for DW5821e with eSIM support
    USB: serial: mos7840: fix remote wakeup
    USB: serial: mos7720: fix remote wakeup
    USB: serial: mos7840: add USB ID to support Moxa UPort 2210
    appledisplay: fix error handling in the scheduled work
    USB: chaoskey: fix error case of a timeout
    usb-serial: cp201x: support Mark-10 digital force gauge
    usbip: Fix uninitialized symbol 'nents' in stub_recv_cmd_submit()
    usbip: tools: fix fd leakage in the function of read_attr_usbip_status
    virtio_ring: fix return code on DMA mapping fails
    media: imon: invalid dereference in imon_touch_event
    media: cxusb: detect cxusb_ctrl_msg error in query
    media: b2c2-flexcop-usb: add sanity checking
    media: uvcvideo: Fix error path in control parsing failure
  * cpufreq: Add NULL checks to show() and store() methods of cpufreq
      drivers/cpufreq/cpufreq.c
    media: usbvision: Fix races among open, close, and disconnect
    media: vivid: Fix wrong locking that causes race conditions on streaming stop
    media: vivid: Set vid_cap_streaming and vid_out_streaming to true
    nfc: port100: handle command failure cleanly
    nbd: prevent memory leak
    x86/speculation: Fix redundant MDS mitigation message
    x86/speculation: Fix incorrect MDS/TAA mitigation status
    x86/insn: Fix awk regexp warnings
    ARC: perf: Accommodate big-endian CPU
    ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary
    ocfs2: remove ocfs2_is_o2cb_active()
  * cpufreq: Skip cpufreq resume if it's not suspended
      drivers/cpufreq/cpufreq.c
  * arm64: fix for bad_mode() handler to always result in panic
      arch/arm64/kernel/traps.c
    net: phy: dp83867: increase SGMII autoneg timer duration
    net: phy: dp83867: fix speed 10 in sgmii mode
    mm/memory_hotplug: don't access uninitialized memmaps in shrink_zone_span()
    md/raid10: prevent access of uninitialized resync_pages offset
    ath9k_hw: fix uninitialized variable data
    ath10k: Fix a NULL-ptr-deref bug in ath10k_usb_alloc_urb_from_pipe
  * KVM: MMU: Do not treat ZONE_DEVICE pages as being reserved
      include/linux/kvm_host.h
    Bluetooth: Fix invalid-free in bcsp_close()
  * cfg80211: call disconnect_wk when AP stops
      net/wireless/ap.c
      net/wireless/core.h
      net/wireless/sme.c
  * ipv6: Fix handling of LLA with VRF and sockets bound to VRF
      net/ipv6/tcp_ipv6.c
    mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock
    i2c: uniphier-f: fix timeout error after reading 8 bytes
    spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch
    PCI: keystone: Use quirk to limit MRRS for K2G
    pinctrl: zynq: Use define directive for PIN_CONFIG_IO_STANDARD
    pinctrl: lpc18xx: Use define directive for PIN_CONFIG_GPIO_PIN_INT
  * pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
      drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
  * cfg80211: Prevent regulatory restore during STA disconnect in concurrent interfaces
      net/wireless/sme.c
    of: unittest: allow base devicetree to have symbol metadata
    net: bcmgenet: return correct value 'ret' from bcmgenet_power_down
    ACPICA: Use %d for signed int print formatting instead of %u
    vrf: mark skb for multicast or link-local as enslaved to VRF
    dlm: don't leak kernel pointer to userspace
    dlm: fix invalid free
    scsi: lpfc: Correct loss of fc4 type on remote port address change
    scsi: lpfc: fcoe: Fix link down issue after 1000+ link bounces
    scsi: megaraid_sas: Fix goto labels in error handling
    scsi: megaraid_sas: Fix msleep granularity
    scsi: mpt3sas: Fix driver modifying persistent data in Manufacturing page11
    scsi: mpt3sas: Don't modify EEDPTagMode field setting on SAS3.5 HBA devices
    scsi: mpt3sas: Fix Sync cache command failure during driver unload
    net: dsa: bcm_sf2: Turn on PHY to allow successful registration
    rtlwifi: rtl8192de: Fix misleading REG_MCUFWDL information
    wireless: airo: potential buffer overflow in sprintf()
    brcmsmac: never log "tid x is not agg'able" by default
    rtl8xxxu: Fix missing break in switch
    wlcore: Fix the return value in case of error in 'wlcore_vendor_cmd_smart_config_start()'
    wil6210: fix locking in wmi_call
    btrfs: avoid link error with CONFIG_NO_AUTO_INLINE
    audit: print empty EXECVE args
    clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
    openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS
  * sched/fair: Don't increase sd->balance_interval on newidle balance
      kernel/sched/fair.c
  * sched/topology: Fix off by one bug
      kernel/sched/topology.c
  * net: do not abort bulk send on BQL status
      net/core/dev.c
    ocfs2: fix clusters leak in ocfs2_defrag_extent()
    ocfs2: don't put and assigning null to bh allocated outside
  * arm64: makefile fix build of .i file in external module case
      arch/arm64/Makefile
    ntb: intel: fix return value for ndev_vec_mask()
    ntb_netdev: fix sleep time mismatch
    net: hns3: bugfix for buffer not free problem during resetting
    igb: shorten maximum PHC timecounter update interval
  * mm/memory_hotplug: make add_memory() take the device_hotplug_lock
      include/linux/memory_hotplug.h
    fs/hfs/extent.c: fix array out of bounds read of array extent
    hfs: update timestamp on truncate()
    hfsplus: update timestamps on truncate()
    hfs: fix return value of hfs_get_block()
    hfsplus: fix return value of hfsplus_get_block()
    hfs: prevent btree data loss on ENOSPC
    hfsplus: prevent btree data loss on ENOSPC
    hfs: fix BUG on bnode parent update
    hfsplus: fix BUG on bnode parent update
  * linux/bitmap.h: fix type of nbits in bitmap_shift_right()
      include/linux/bitmap.h
  * linux/bitmap.h: handle constant zero-size bitmaps correctly
      include/linux/bitmap.h
    selftests/powerpc/cache_shape: Fix out-of-tree build
    selftests/powerpc/switch_endian: Fix out-of-tree build
    selftests/powerpc/signal: Fix out-of-tree build
    powerpc/xmon: Relax frame size for clang
  * vfs: avoid problematic remapping requests into partial EOF block
      fs/read_write.c
    um: Make line/tty semantics use true write IRQ
    i2c: uniphier-f: fix race condition when IRQ is cleared
    i2c: uniphier-f: fix occasional timeout error
    i2c: uniphier-f: make driver robust against concurrency
  * block: fix the DISCARD request merge
      block/blk-merge.c
    macsec: let the administrator set UP state even if lowerdev is down
    macsec: update operstate when lower device changes
  * mm/page-writeback.c: fix range_cyclic writeback vs writepages deadlock
      mm/page-writeback.c
    fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle()
  * arm64: lib: use C string functions with KASAN enabled
      arch/arm64/include/asm/string.h
      arch/arm64/kernel/arm64ksyms.c
      arch/arm64/lib/memchr.S
      arch/arm64/lib/memcmp.S
      arch/arm64/lib/strchr.S
      arch/arm64/lib/strcmp.S
      arch/arm64/lib/strlen.S
      arch/arm64/lib/strncmp.S
      arch/arm64/lib/strnlen.S
      arch/arm64/lib/strrchr.S
    sparc64: Rework xchg() definition to avoid warnings.
    powerpc/process: Fix flush_all_to_thread for SPE
  * bpf: devmap: fix wrong interface selection in notifier_call
      kernel/bpf/devmap.c
    thermal: rcar_thermal: Prevent hardware access during system suspend
    selftests: watchdog: Fix error message.
    selftests: watchdog: fix message when /dev/watchdog open fails
    selftests/ftrace: Fix to test kprobe $comm arg only if available
    mfd: max8997: Enale irq-wakeup unconditionally
    mfd: intel_soc_pmic_bxtwc: Chain power button IRQs as well
    mfd: mc13xxx-core: Fix PMIC shutdown when reading ADC values
    mfd: arizona: Correct calling of runtime_put_sync
    net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
    qlcnic: fix a return in qlcnic_dcb_get_capability()
    mISDN: Fix type of switch control variable in ctrl_teimanager
  * f2fs: fix to spread clear_cold_data()
      fs/f2fs/data.c
      fs/f2fs/dir.c
      fs/f2fs/segment.c
    rtc: s35390a: Change buf's type to u8 in s35390a_init
    ceph: fix dentry leak in ceph_readdir_prepopulate
    powerpc/pseries: Export raw per-CPU VPA data via debugfs
    sparc: Fix parport build warnings.
    spi: omap2-mcspi: Set FIFO DMA trigger level to word length
    s390/perf: Return error when debug_register fails
    atm: zatm: Fix empty body Clang warnings
    sunrpc: safely reallow resvport min/max inversion
    SUNRPC: Fix a compile warning for cmpxchg64()
    dm raid: avoid bitmap with raid4/5/6 journal device
    usbip: tools: fix atoi() on non-null terminated string
    USB: misc: appledisplay: fix backlight update_status return code
    PCI: vmd: Detach resources after stopping root bus
    macintosh/windfarm_smu_sat: Fix debug output
    ALSA: i2c/cs8427: Fix int to char conversion
  * PM / Domains: Deal with multiple states but no governor in genpd
      drivers/base/power/domain.c
    kprobes, x86/ptrace.h: Make regs_get_kernel_stack_nth() not fault on bad stack
    xfs: fix use-after-free race in xfs_buf_rele
  * net: ena: Fix Kconfig dependency on X86
      drivers/net/ethernet/amazon/Kconfig
  * net: fix warning in af_unix
      net/unix/af_unix.c
    net: dsa: mv88e6xxx: Fix 88E6141/6341 2500mbps SERDES speed
    scsi: dc395x: fix DMA API usage in sg_update_list
    scsi: dc395x: fix dma API usage in srb_done
    ASoC: tegra_sgtl5000: fix device_node refcounting
    clk: at91: audio-pll: fix audio pmc type
    clk: mmp2: fix the clock id for sdh2_clk and sdh3_clk
    nvmet-fcloop: suppress a compiler warning
    crypto: ccree - avoid implicit enum conversion
    scsi: iscsi_tcp: Explicitly cast param in iscsi_sw_tcp_host_get_param
    scsi: isci: Change sci_controller_start_task's return type to sci_status
    scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler
    KVM/x86: Fix invvpid and invept register operand size in 64-bit mode
    KVM: nVMX: reset cache/shadows when switching loaded VMCS
    scsi: ips: fix missing break in switch
    qed: Align local and global PTT to propagate through the APIs.
    amiflop: clean up on errors during setup
    pwm: lpss: Only set update bit if we are actually changing the settings
    pinctrl: sunxi: Fix a memory leak in 'sunxi_pinctrl_build_state()'
    RDMA/bnxt_re: Fix qp async event reporting
    m68k: fix command-line parsing when passed from u-boot
    w1: IAD Register is yet readable trough iad sys file. Fix snprintf (%u for unsigned, count for max size).
    misc: mic: fix a DMA pool free failure
    gsmi: Fix bug in append_to_eventlog sysfs handler
    btrfs: handle error of get_old_root
    mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail
    spi: sh-msiof: fix deferred probing
    cdrom: don't attempt to fiddle with cdo->capability
    skd: fixup usage of legacy IO API
    ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem
    brcmsmac: AP mode: update beacon when TIM changes
    EDAC, thunderx: Fix memory leak in thunderx_l2c_threaded_isr()
    powerpc/eeh: Fix use of EEH_PE_KEEP on wrong field
    powerpc/boot: Disable vector instructions
    powerpc: Fix signedness bug in update_flash_db()
    synclink_gt(): fix compat_ioctl()
  * pty: fix compat ioctls
      drivers/tty/pty.c
    gfs2: Fix marking bitmaps non-full
  * printk: fix integer overflow in setup_log_buf()
      kernel/printk/printk.c
    ALSA: isight: fix leak of reference to firewire unit in error path of .probe callback
    mwifiex: Fix NL80211_TX_POWER_LIMITED
    platform/x86: asus-wmi: Only Tell EC the OS will handle display hotkeys from asus_nb_wmi
    platform/x86: asus-nb-wmi: Support ALS on the Zenbook UX430UQ
    drm/i915/userptr: Try to acquire the page lock around set_page_dirty()
    mm/ksm.c: don't WARN if page is still mapped in remove_stable_node()
    Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()"
    virtio_console: allocate inbufs in add_port() only if it is needed
    nbd:fix memory leak in nbd_get_socket()
    tools: gpio: Correctly add make dependencies for gpio_utils
    gpio: max77620: Fixup debounce delays
    vhost/vsock: split packets to send using multiple buffers
    net/sched: act_pedit: fix WARN() in the traffic path
    net/mlxfw: Verify FSM error code translation doesn't exceed array size
    net/mlx5e: Fix set vf link state error flow
    sfc: Only cancel the PPS workqueue if it exists
  * net: rtnetlink: prevent underflows in do_setvfinfo()
      net/core/rtnetlink.c
    net/mlx4_en: fix mlx4 ethtool -N insertion
    ANDROID: removed CONFIG_PM_WAKELOCKS
    Merge 4.14.156 into android-4.14
Linux 4.14.156
    mmc: tmio: fix SCC error handling to avoid false positive CRC error
    powerpc/time: Fix clockevent_decrementer initalisation for PR KVM
    tools: PCI: Fix broken pcitest compilation
    ARM: dts: omap5: Fix dual-role mode on Super-Speed port
    mlxsw: spectrum_switchdev: Check notification relevance based on upper device
    spi: rockchip: initialize dma_slave_config properly
    mac80211: minstrel: fix sampling/reporting of CCK rates in HT mode
    mac80211: minstrel: fix CCK rate group streams value
    mac80211: minstrel: fix using short preamble CCK rates on HT clients
    misc: cxl: Fix possible null pointer dereference
    netfilter: nft_compat: do not dump private area
    hwmon: (ina3221) Fix INA3221_CONFIG_MODE macros
    hwmon: (pwm-fan) Silence error on probe deferral
    pinctrl: gemini: Fix up TVC clock group
    orangefs: rate limit the client not running info message
    ARM: 8802/1: Call syscall_trace_exit even when system call skipped
  * spi: spidev: Fix OF tree warning logic
      drivers/spi/spidev.c
    pinctrl: gemini: Mask and set properly
    spi: fsl-lpspi: Prevent FIFO under/overrun by default
    gpio: syscon: Fix possible NULL ptr usage
    x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error
    media: cx231xx: fix potential sign-extension overflow on large shift
    GFS2: Flush the GFS2 delete workqueue before stopping the kernel threads
    media: isif: fix a NULL pointer dereference bug
  * printk: Give error on attempt to set log buffer length to over 2G
      kernel/printk/printk.c
    mfd: ti_am335x_tscadc: Keep ADC interface on if child is wakeup capable
    backlight: lm3639: Unconditionally call led_classdev_unregister
    proc/vmcore: Fix i386 build error of missing copy_oldmem_page_encrypted()
    s390/kasan: avoid vdso instrumentation
    media: dw9714: Fix error handling in probe function
    bcache: recal cached_dev_sectors on detach
  * reset: Fix potential use-after-free in __of_reset_control_get()
      drivers/reset/core.c
    fbdev: sbuslib: integer overflow in sbusfb_ioctl_helper()
    fbdev: sbuslib: use checked version of put_user()
    mmc: tmio: Fix SCC error detection
    x86/fsgsbase/64: Fix ptrace() to read the FS/GS base accurately
    iwlwifi: mvm: don't send keys when entering D3
    ACPI / SBS: Fix rare oops when removing modules
  * xfrm: use correct size to initialise sp->ovec
      net/xfrm/xfrm_input.c
    crypto: mxs-dcp - Fix AES issues
    crypto: mxs-dcp - Fix SHA null hashes and output length
    dmaengine: rcar-dmac: set scatter/gather max segment size
    x86/olpc: Fix build error with CONFIG_MFD_CS5535=m
    kexec: Allocate decrypted control pages for kdump if SME is enabled
    remoteproc: Check for NULL firmwares in sysfs interface
    Input: silead - try firmware reload after unsuccessful resume
    Input: st1232 - set INPUT_PROP_DIRECT property
    media: cec-gpio: select correct Signal Free Time
    dmaengine: ioat: fix prototype of ioat_enumerate_channels
    NFSv4.x: fix lock recovery during delegation recall
  * i2c: brcmstb: Allow enabling the driver on DSL SoCs
      drivers/i2c/busses/Kconfig
    clk: samsung: Use clk_hw API for calling clk framework from clk notifiers
    clk: samsung: exynos5420: Define CLK_SECKEY gate clock only or Exynos5420
    qtnfmac: drop error reports for out-of-bounds key indexes
    qtnfmac: pass sgi rate info flag to wireless core
    brcmfmac: fix full timeout waiting for action frame on-channel tx
    brcmfmac: reduce timeout for action frame scan
  * cpu/SMT: State SMT is disabled even with nosmt and without "=force"
      kernel/cpu.c
    mtd: physmap_of: Release resources on error
    USB: serial: cypress_m8: fix interrupt-out transfer length
    KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR
    ALSA: hda/sigmatel - Disable automute for Elo VuPoint
    media: i2c: adv748x: Support probing a single output
    media: pxa_camera: Fix check for pdev->dev.of_node
    media: rc: ir-rc6-decoder: enable toggle bit for Kathrein RCU-676 remote
    ata: ep93xx: Use proper enums for directions
    powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer
    ACPICA: Never run _REG on system_memory and system_IO
  * IB/mlx4: Avoid implicit enumerated type conversion
      include/rdma/ib_verbs.h
    IB/mthca: Fix error return code in __mthca_init_one()
    ixgbe: Fix crash with VFs and flow director on interface flap
    i40e: Use proper enum in i40e_ndo_set_vf_link_state
    ixgbe: Fix ixgbe TX hangs with XDP_TX beyond queue limit
    md: allow metadata updates while suspending an array - fix
    clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines
    clocksource/drivers/sh_cmt: Fixup for 64-bit machines
    tools: PCI: Fix compilation warnings
    PM / hibernate: Check the success of generating md5 digest before hibernation
    mtd: rawnand: sh_flctl: Use proper enum for flctl_dma_fifo0_transfer
    ARM: dts: at91: at91sam9x5cm: fix addressable nand flash size
    ARM: dts: at91: sama5d4_xplained: fix addressable nand flash size
    powerpc/xive: Move a dereference below a NULL test
    powerpc/pseries: Fix how we iterate over the DTL entries
    powerpc/pseries: Fix DTL buffer registration
    cxgb4: Use proper enum in IEEE_FAUX_SYNC
    cxgb4: Use proper enum in cxgb4_dcb_handle_fw_update
    mei: samples: fix a signedness bug in amt_host_if_call()
    sunrpc: Fix connect metrics
  * clk: keystone: Enable TISCI clocks if K3_ARCH
      drivers/clk/Makefile
      drivers/clk/keystone/Kconfig
  * ext4: fix build error when DX_DEBUG is defined
      fs/ext4/namei.c
    dmaengine: timb_dma: Use proper enum in td_prep_slave_sg
    dmaengine: ep93xx: Return proper enum in ep93xx_dma_chan_direction
    KVM: PPC: Inform the userspace about TCE update failures
    watchdog: w83627hf_wdt: Support NCT6796D, NCT6797D, NCT6798D
    irqchip/irq-mvebu-icu: Fix wrong private data retrieval
  * nl80211: Fix a GET_KEY reply attribute
      net/wireless/nl80211.c
  * usb: dwc3: gadget: Check ENBLSLPM before sending ep command
      drivers/usb/dwc3/gadget.c
    usb: gadget: udc: fotg210-udc: Fix a sleep-in-atomic-context bug in fotg210_get_status()
    ath9k: fix reporting calculated new FFT upper max
  * ata: ahci_brcm: Allow using driver or DSL SoCs
      drivers/ata/Kconfig
    ath10k: fix vdev-start timeout on error
    arm64/numa: Report correct memblock range for the dummy node
    kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table
  * iommu/io-pgtable-arm: Fix race handling in split_blk_unmap()
      drivers/iommu/io-pgtable-arm.c
    IB/hfi1: Ensure ucast_dlid access doesnt exceed bounds
  * SUNRPC: Fix priority queue fairness
      include/linux/sunrpc/sched.h
    ARM: dts: sun8i: h3-h5: ir register size should be the whole memory block
  * f2fs: return correct errno in f2fs_gc
      fs/f2fs/gc.c
    net: hns3: Fix for netdev not up problem when setting mtu
    ARM: dts: omap5: enable OTG role for DWC3 controller
    ARM: dts: dra7: Enable workaround for errata i870 in PCIe host mode
    net: xen-netback: fix return type of ndo_start_xmit function
    net: ovs: fix return type of ndo_start_xmit function
  * fbdev: Ditch fb_edid_add_monspecs
      drivers/video/fbdev/core/fbmon.c
      drivers/video/fbdev/core/modedb.c
      include/linux/fb.h
  * arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault
      arch/arm64/lib/clear_user.S
      arch/arm64/lib/copy_from_user.S
      arch/arm64/lib/copy_in_user.S
      arch/arm64/lib/copy_to_user.S
    mm/memory_hotplug: fix updating the node span
    mm/memory_hotplug: don't access uninitialized memmaps in shrink_pgdat_span()
  * idr: Fix idr_get_next race with idr_remove
      lib/idr.c
  * net: cdc_ncm: Signedness bug in cdc_ncm_set_dgram_size()
      drivers/net/usb/cdc_ncm.c
  * Revert "OPP: Protect dev_list with opp_table lock"
      drivers/base/power/opp/core.c
      drivers/base/power/opp/cpu.c
      drivers/base/power/opp/opp.h
    tee: optee: add missing of_node_put after of_device_is_available
    spi: mediatek: use correct mata->xfer_len when in fifo transfer
  * FROMGIT: pinctrl: devicetree: Avoid taking direct reference to device name string
      drivers/pinctrl/devicetree.c

Change-Id: I9c31a0c869961bd1866ef774568945fa54f0313d
Signed-off-by: Robin Peng <robinpeng@google.com>
2020-01-06 19:02:28 +08:00
Sami Tolvanen
4ff705ab4d ANDROID: init: ensure initcall ordering with LTO
With LTO, the compiler doesn't necessarily obey link order for
initcalls, and the initcall variable needs to be globally unique
to avoid naming collisions.

In order to preserve the correct order, we add each variable
into its own section and generate a linker script (in
scripts/link-vmlinux.sh) to ensure the order remains correct.  We
also add a __COUNTER__ prefix to the name, so we can retain the
order of initcalls within each compilation unit, and __LINE__ to
make the names more unique.

Bug: 145210207
Change-Id: Iddda881a52b7942781713b188d810b6100159a2b
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-12-13 07:14:18 -08:00
Preeti Nagar
96601b1e8d ARM: Fix RTIC MP DTS failure for 32-bit target
Adding checks to ensure RTIC failure does not
cause kernel compilation to fail.

Change-Id: I07aba9607c1a8b7bc4da55e230896e69932d4c07
Signed-off-by: Preeti Nagar <pnagar@codeaurora.org>
2019-10-01 01:33:11 -07:00
Amareswar Reddy Valasa
f92471d12f arm: RTIC kernel integration to generate MP DTS
With new Boot Image header v2 the boot image header generation
decoupled from the kernel. RTIC DTS requires kernel build
environment (because of OBJDUMP, OBJCPY, and other dependencies).
The RTIC DTS will be compiled to DTB later either by
arch/arm64/boot/Makefile (for Boot Image Header v1) or by
kernel_definitions.mk (for Boot Image Header v2).

Change-Id: I299e62fa2105eb3a59df7ec9577aa2fcf193cfed
Signed-off-by: Amareswar Reddy Valasa <avalasa@codeaurora.org>
2019-09-23 00:13:28 -07:00
Preeti Nagar
4defd9d4da ARM: Fix RTIC MPGen failure for 32bit target
Adding checks to ensure rtic failure doesnot cause
kernel compilation to fail.

Change-Id: I66ec259ce3ec1c9ebce730e54ea1cbe162603126
Signed-off-by: Preeti Nagar <pnagar@codeaurora.org>
2018-11-13 23:31:17 -08:00
Naresh Maradana
45624040e6 ARM: RTIC 3.0: Enabling MPGen
Added RTIC environmental variable check. If set, this will trigger
RTIC MPGen during the kernel build. MPGen generates and embeds the
kernel MP.s (measurement parameters) to the vmlinux. It has to be
called during the kernel build, before vmlinux is generated.
RTIC MP.s to be consumed by the RTIC TA.

Acked-by: Alex Mavrin <amavrin@qti.qualcomm.com>
Change-Id: Id64ae893f750337abbecfea0b461f2d3ae508d00
Signed-off-by: Naresh Maradana <nmardana@codeaurora.org>
2018-05-04 03:30:36 -07:00
Sami Tolvanen
9abcee5156 FROMLIST: kbuild: fix dynamic ftrace with clang LTO
With CONFIG_LTO_CLANG enabled, LLVM IR won't be compiled into object
files until modpost_link. This change postpones calls to recordmcount
until after this step.

In order to exclude ftrace_process_locs from inspection, we add a new
code section .text..ftrace, which we tell recordmcount to ignore, and
a __norecordmcount attribute for moving functions to this section.

Bug: 62093296
Bug: 67506682
Change-Id: Iba2c053968206acf533fadab1eb34a743b5088ee
(am from https://patchwork.kernel.org/patch/10060327/)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-04-26 16:03:36 -07:00
Sami Tolvanen
af1f94d0af FROMLIST: kbuild: add support for clang LTO
This change adds the configuration option CONFIG_LTO_CLANG, and
build system support for clang's Link Time Optimization (LTO). In
preparation for LTO support for other compilers, potentially common
parts of the changes are gated behind CONFIG_LTO instead.

With -flto, instead of object files, clang produces LLVM bitcode,
which is compiled into a native object at link time, allowing the
final binary to be optimized globally. For more details, see:

  https://llvm.org/docs/LinkTimeOptimization.html

While the kernel normally uses GNU ld for linking, LLVM supports LTO
only with lld or GNU gold linkers. This patch set assumes gold will
be used with the LLVMgold plug-in to perform the LTO link step. Due
to potential incompatibilities with GNU ld, this change also adds
LDFINAL_vmlinux for using a different linker for the vmlinux_link
step, and defaults to using GNU ld.

Assuming LLVMgold.so is in LD_LIBRARY_PATH and CONFIG_LTO_CLANG has
been selected, an LTO kernel can be built simply by running make
CC=clang. LTO requires clang >= 5.0 and gold from binutils >= 2.27.

Bug: 62093296
Bug: 67506682
Change-Id: Ibcd9fc7ec501b4f30b43b4877897615645f8655f
(am from https://patchwork.kernel.org/patch/10060329/)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-04-26 16:03:36 -07:00
Greg Kroah-Hartman
b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00
Nicholas Piggin
3a166fc2d4 kbuild: handle libs-y archives separately from built-in.o archives
The thin archives build currently puts all lib.a and built-in.o
files together and links them with --whole-archive.

This works because thin archives can recursively refer to thin
archives. However some architectures include libgcc.a, which may
not be a thin archive, or it may not be constructed with the "P"
option, in which case its contents do not get linked correctly.

So don't pull .a libs into the root built-in.o archive. These
libs should already have symbol tables and indexes built, so they
can be direct linker inputs. Move them out of the --whole-archive
option, which restore the conditional linking behaviour of lib.a
to thin archives builds.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-30 09:03:03 +09:00
Nicholas Piggin
9a6cfca4f4 kbuild: thin archives use P option to ar
The P option makes ar do full path name matching and can prevent ar
from discarding files with duplicate names in some cases of creating
thin archives from thin archives. The sh architecture in particular
loses some object files from its kernel/cpu/sh*/ directories without
this option.

This could be a bug in binutils ar, but the P option should not cause
any negative effects so it is safe to use to work around this with.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-30 09:03:03 +09:00
Nicholas Piggin
1328a1ae0e kbuild: thin archives final link close --whole-archives option
Close the --whole-archives option with --no-whole-archive. Some
architectures end up including additional .o and files multiple
times after this, and they get duplicate symbols when they are
brought under the --whole-archives option.

This matches more closely with the incremental final link.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-30 09:03:02 +09:00
Nicholas Piggin
abac4c8973 kbuild: minor improvement for thin archives build
The root built-in.o archive is currently generated before all object
files are built for the final link, due to final build of init/ after
version update. In practice it seems like it doesn't matter because
the archive symbol table does not change, but it is more logical to
create the final archive as the last step.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-11-29 15:58:57 +01:00
Nicholas Piggin
7e2b37c971 kbuild: kallsyms allow 3-pass generation if symbols size has changed
kallsyms generation is not foolproof, due to some linkers adding
symbols (e.g., branch trampolines) when a binary size changes.
Have it attempt a 3rd pass automatically if the kallsyms size changes
in the 2nd pass.

This allows powerpc64 allyesconfig to build without adding another
pass when it's not required.

This can be solved other ways by directing the linker not to add labels
on branch stubs, or to move kallsyms near the end of the image. The
former is undesirable for debugging/tracing, and the latter is a more
significant change that requires more testing and review.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-11-29 15:53:19 +01:00
Stephen Rothwell
a5967db9af kbuild: allow architectures to use thin archives instead of ld -r
ld -r is an incremental link used to create built-in.o files in build
subdirectories. It produces relocatable object files containing all
its input files, and these are are then pulled together and relocated
in the final link. Aside from the bloat, this constrains the final
link relocations, which has bitten large powerpc builds with
unresolvable relocations in the final link.

Alan Modra has recommended the kernel use thin archives for linking.
This is an alternative and means that the linker has more information
available to it when it links the kernel.

This patch enables a config option architectures can select, which
causes all built-in.o files to be built as thin archives. built-in.o
files in subdirectories do not get symbol table or index attached,
which improves speed and size. The final link pass creates a
built-in.o archive in the root output directory which includes the
symbol table and index. The linker then uses takes this file to link.

The --whole-archive linker option is required, because the linker now
has visibility to every individual object file, and it will otherwise
just completely avoid including those without external references
(consider a file with EXPORT_SYMBOL or initcall or hardware exceptions
as its only entry points). The traditional built works "by luck" as
built-in.o files are large enough that they're going to get external
references. However this optimisation is unpredictable for the kernel
(due to above external references), ineffective at culling unused, and
costly because the .o files have to be searched for references.
Superior alternatives for link-time culling should be used instead.

Build characteristics for inclink vs thinarc, on a small powerpc64le
pseries VM with a modest .config:

                                  inclink       thinarc
sizes
vmlinux                        15 618 680    15 625 028
sum of all built-in.o          56 091 808     1 054 334
sum excluding root built-in.o                   151 430

find -name built-in.o | xargs rm ; time make vmlinux
real                              22.772s       21.143s
user                              13.280s       13.430s
sys                                4.310s        2.750s

- Final kernel pulled in only about 6K more, which shows how
  ineffective the object file culling is.
- Build performance looks improved due to less pagecache activity.
  On IO constrained systems it could be a bigger win.
- Build size saving is significant.

Side note, the toochain understands archives, so there's some tricks,
$ ar t built-in.o          # list all files you linked with
$ size built-in.o          # and their sizes
$ objdump -d built-in.o    # disassembly (unrelocated) with filenames

Implementation by sfr, minor tweaks by npiggin.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-09-09 10:31:19 +02:00
Emese Revfy
6b90bd4ba4 GCC plugin infrastructure
This patch allows to build the whole kernel with GCC plugins. It was ported from
grsecurity/PaX. The infrastructure supports building out-of-tree modules and
building in a separate directory. Cross-compilation is supported too.
Currently the x86, arm, arm64 and uml architectures enable plugins.

The directory of the gcc plugins is scripts/gcc-plugins. You can use a file or a directory
there. The plugins compile with these options:
 * -fno-rtti: gcc is compiled with this option so the plugins must use it too
 * -fno-exceptions: this is inherited from gcc too
 * -fasynchronous-unwind-tables: this is inherited from gcc too
 * -ggdb: it is useful for debugging a plugin (better backtrace on internal
    errors)
 * -Wno-narrowing: to suppress warnings from gcc headers (ipa-utils.h)
 * -Wno-unused-variable: to suppress warnings from gcc headers (gcc_version
    variable, plugin-version.h)

The infrastructure introduces a new Makefile target called gcc-plugins. It
supports all gcc versions from 4.5 to 6.0. The scripts/gcc-plugin.sh script
chooses the proper host compiler (gcc-4.7 can be built by either gcc or g++).
This script also checks the availability of the included headers in
scripts/gcc-plugins/gcc-common.h.

The gcc-common.h header contains frequently included headers for GCC plugins
and it has a compatibility layer for the supported gcc versions.

The gcc-generate-*-pass.h headers automatically generate the registration
structures for GIMPLE, SIMPLE_IPA, IPA and RTL passes.

Note that 'make clean' keeps the *.so files (only the distclean or mrproper
targets clean all) because they are needed for out-of-tree modules.

Based on work created by the PaX Team.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-06-07 22:57:10 +02:00
Ard Biesheuvel
d4ffe41819 ARM: 8552/1: kallsyms: remove special lower address limit for CONFIG_ARM
Now that we no longer emit .stubs symbols into a section VMA loaded
at absolute address 0x1000, we can drop the ARM-specific override that
sets a lower limit based on CONFIG_PAGE_OFFSET, below which symbols are
filtered from the kallsyms output.

Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Chris Brandt <chris.brandt@renesas.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-04-07 21:57:15 +01:00
Linus Torvalds
2162b80fca Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek:

 - make dtbs_install fix

 - Error handling fix fixdep and link-vmlinux.sh

 - __UNIQUE_ID fix for clang

 - Fix for if_changed_* to suppress the "is up to date." message

 - The kernel is built with -Werror=incompatible-pointer-types

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Add option to turn incompatible pointer check into error
  kbuild: suppress annoying "... is up to date." message
  kbuild: fixdep: Check fstat(2) return value
  scripts/link-vmlinux.sh: force error on kallsyms failure
  Kbuild: provide a __UNIQUE_ID for clang
  dtbsinstall: don't move target directory out of the way
2016-03-24 19:26:47 -07:00
Ard Biesheuvel
2213e9a66b kallsyms: add support for relative offsets in kallsyms address table
Similar to how relative extables are implemented, it is possible to emit
the kallsyms table in such a way that it contains offsets relative to
some anchor point in the kernel image rather than absolute addresses.

On 64-bit architectures, it cuts the size of the kallsyms address table
in half, since offsets between kernel symbols can typically be expressed
in 32 bits.  This saves several hundreds of kilobytes of permanent
.rodata on average.  In addition, the kallsyms address table is no
longer subject to dynamic relocation when CONFIG_RELOCATABLE is in
effect, so the relocation work done after decompression now doesn't have
to do relocation updates for all these values.  This saves up to 24
bytes (i.e., the size of a ELF64 RELA relocation table entry) per value,
which easily adds up to a couple of megabytes of uncompressed __init
data on ppc64 or arm64.  Even if these relocation entries typically
compress well, the combined size reduction of 2.8 MB uncompressed for a
ppc64_defconfig build (of which 2.4 MB is __init data) results in a ~500
KB space saving in the compressed image.

Since it is useful for some architectures (like x86) to retain the
ability to emit absolute values as well, this patch also adds support
for capturing both absolute and relative values when
KALLSYMS_ABSOLUTE_PERCPU is in effect, by emitting absolute per-cpu
addresses as positive 32-bit values, and addresses relative to the
lowest encountered relative symbol as negative values, which are
subtracted from the runtime address of this base symbol to produce the
actual address.

Support for the above is enabled by default for all architectures except
IA-64 and Tile-GX, whose symbols are too far apart to capture in this
manner.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-15 16:55:16 -07:00
Ard Biesheuvel
4d5d5664c9 x86: kallsyms: disable absolute percpu symbols on !SMP
scripts/kallsyms.c has a special --absolute-percpu command line option
which deals with the zero based per cpu offsets that are used when
building for SMP on x86_64.  This means that the option should only be
passed in that case, so add a Kconfig symbol with the correct predicate,
and use that instead.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-15 16:55:16 -07:00
Ard Biesheuvel
a043934207 scripts/link-vmlinux.sh: force error on kallsyms failure
Since the output of the invocation of scripts/kallsyms is piped directly
into the assembler, error messages it emits are visible on stderr, but
a non-zero return code is ignored, and the build simply proceeds in that
case. However, the resulting kernel is most likely broken, and will crash
at boot.

So instead, capture the output of kallsyms in a separate .S file, and pass
that to the assembler in a separate step.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-02-08 20:45:09 +01:00
Vegard Nossum
a7df4716d1 um: link with -lpthread
Similarly to commit fb1770aa78, with gcc 5
on Ubuntu and CONFIG_STATIC_LINK=y I was seeing these linker errors:

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/librt.a(timer_create.o): In function `__timer_create_new':
(.text+0xcd): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/librt.a(timer_create.o): In function `__timer_create_new':
(.text+0x126): undefined reference to `pthread_attr_init'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/librt.a(timer_create.o): In function `__timer_create_new':
(.text+0x168): undefined reference to `pthread_attr_setdetachstate'
[...]

Obviously we also need -lpthread for librt.a.

Cc: stable@vger.kernel.org # 4.4
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2016-01-10 21:49:48 +01:00
Lorenzo Colitti
fb1770aa78 arch: um: fix error when linking vmlinux.
On gcc Ubuntu 4.8.4-2ubuntu1~14.04, linking vmlinux fails with:

arch/um/os-Linux/built-in.o: In function `os_timer_create':
/android/kernel/android/arch/um/os-Linux/time.c:51: undefined reference to `timer_create'
arch/um/os-Linux/built-in.o: In function `os_timer_set_interval':
/android/kernel/android/arch/um/os-Linux/time.c:84: undefined reference to `timer_settime'
arch/um/os-Linux/built-in.o: In function `os_timer_remain':
/android/kernel/android/arch/um/os-Linux/time.c:109: undefined reference to `timer_gettime'
arch/um/os-Linux/built-in.o: In function `os_timer_one_shot':
/android/kernel/android/arch/um/os-Linux/time.c:132: undefined reference to `timer_settime'
arch/um/os-Linux/built-in.o: In function `os_timer_disable':
/android/kernel/android/arch/um/os-Linux/time.c:145: undefined reference to `timer_settime'

This is because -lrt appears in the generated link commandline
after arch/um/os-Linux/built-in.o. Fix this by removing -lrt from
arch/um/Makefile and adding it to the UM-specific section of
scripts/link-vmlinux.sh.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2015-12-08 22:25:13 +01:00
Maxime Coquelin
cc84753052 scripts: link-vmlinux: Don't pass page offset to kallsyms if XIP Kernel
When Kernel is executed in place from ROM, the symbol addresses can be
lower than the page offset.

Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-05-21 19:17:44 +08:00
Sylvain BERTRAND
ab160dbbc4 scripts: fix link-vmlinux.sh bash-ism
While building linux with dash shell:
  LINK    vmlinux
trap: SIGHUP: bad trap
/src/linux-4.0/Makefile:933: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 1

See the following document for behavior of posix shell trap instruction:
http://pubs.opengroup.org/onlinepubs/000095399/utilities/trap.html

Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sylvain BERTRAND <sylvain.bertrand@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-05-07 12:42:03 +02:00
Michal Marek
06ed5c2bfa kbuild: Make scripts executable
The Makefiles call the respective interpreter explicitly, but this makes
it easier to use the scripts manually.

Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-20 16:03:45 +02:00
Rusty Russell
c6bda7c988 kallsyms: fix percpu vars on x86-64 with relocation.
x86-64 has a problem: per-cpu variables are actually represented by
their absolute offsets within the per-cpu area, but the symbols are
not emitted as absolute.  Thus kallsyms naively creates them as offsets
from _text, meaning their values change if the kernel is relocated
(especially noticeable with CONFIG_RANDOMIZE_BASE):

 $ egrep ' (gdt_|_(stext|_per_cpu_))' /root/kallsyms.nokaslr
 0000000000000000 D __per_cpu_start
 0000000000004000 D gdt_page
 0000000000014280 D __per_cpu_end
 ffffffff810001c8 T _stext
 ffffffff81ee53c0 D __per_cpu_offset
 $ egrep ' (gdt_|_(stext|_per_cpu_))' /root/kallsyms.kaslr1
 000000001f200000 D __per_cpu_start
 000000001f204000 D gdt_page
 000000001f214280 D __per_cpu_end
 ffffffffa02001c8 T _stext
 ffffffffa10e53c0 D __per_cpu_offset

Making them absolute symbols is the Right Thing, but requires fixes to
the relocs tool.  So for the moment, we add a --absolute-percpu option
which makes them absolute from a kallsyms perspective:

 $ egrep ' (gdt_|_(stext|_per_cpu_))' /proc/kallsyms # no KASLR
 0000000000000000 A __per_cpu_start
 000000000000a000 A gdt_page
 0000000000013040 A __per_cpu_end
 ffffffff802001c8 T _stext
 ffffffff8099b180 D __per_cpu_offset
 ffffffff809a3000 D __per_cpu_load
 $ egrep ' (gdt_|_(stext|_per_cpu_))' /proc/kallsyms # With KASLR
 0000000000000000 A __per_cpu_start
 000000000000a000 A gdt_page
 0000000000013040 A __per_cpu_end
 ffffffff89c001c8 T _stext
 ffffffff8a39d180 D __per_cpu_offset
 ffffffff8a3a5000 D __per_cpu_load

Based-on-the-original-screenplay-by: Andy Honig <ahonig@google.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Kees Cook <keescook@chromium.org>
2014-03-17 14:55:27 +10:30
Ming Lei
7122c3e915 scripts/link-vmlinux.sh: only filter kernel symbols for arm
Actually CONFIG_PAGE_OFFSET isn't same with PAGE_OFFSET, so
it isn't easy to figue out PAGE_OFFSET defined in header
file from scripts.

Because CONFIG_PAGE_OFFSET may not be defined in some ARCHs(
64bit ARCH), or defined as bogus value in !MMU case, so
this patch only applys the filter on ARM when CONFIG_PAGE_OFFSET
is defined as the original problem is only on ARM.

Cc: <stable@vger.kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Fixes: f6537f2f0e
Singed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-12-10 16:49:19 +10:30
Ming Lei
f6537f2f0e scripts/kallsyms: filter symbols not in kernel address space
This patch uses CONFIG_PAGE_OFFSET to filter symbols which
are not in kernel address space because these symbols are
generally for generating code purpose and can't be run at
kernel mode, so we needn't keep them in /proc/kallsyms.

For example, on ARM there are some symbols which may be
linked in relocatable code section, then perf can't parse
symbols any more from /proc/kallsyms, this patch fixes the
problem (introduced b9b32bf70f)

Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@vger.kernel.org
2013-11-02 09:13:02 +10:30
Rusty Russell
b92021b09d CONFIG_SYMBOL_PREFIX: cleanup.
We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
"_".  But Al Viro broke this in "consolidate cond_syscall and
SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
do so.

Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
prefix it so something.  So various places define helpers which are
defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
   CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
   for pasting.

(arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

Let's solve this properly:
1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
2) Make linux/export.h usable from asm.
3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
4) Make everyone use them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Tested-by: James Hogan <james.hogan@imgtec.com> (metag)
2013-03-15 15:09:43 +10:30
Michal Marek
423a8155fa kbuild: Fix reading of .config in link-vmlinux.sh
The shell '.' command is not required to search the current directory as
a fallback and in fact newer versions of bash in sh-mode do not do this.
Force reading the file from the current directory if $KCONFIG_CONFIG
contains no '/'.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-02-25 16:14:48 +01:00
Michael Grzeschik
03b25b47e0 scripts/link-vmlinux.sh: source variables from KCONFIG_CONFIG
Its possible to superseed the config file with KCONFIG_CONFIG and have
completely no .config in the tree. The current script is sourcing
.config in every case, so the kernel will never build succesfully. This
patch fixes that issue by sourcing KCONFIG_CONFIG instead.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-02-22 10:37:18 +01:00
Linus Torvalds
2a1497c3c4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lliubbo/blackfin
Pull blackfin updates from Bob Liu:
 "One kbuild and a smp build fix."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lliubbo/blackfin:
  kbuild: add symbol prefix arg to kallsyms
  blackfin: smp: adapt to generic smp helpers
2012-09-12 07:12:53 +08:00
James Hogan
6895f97e15 kbuild: add symbol prefix arg to kallsyms
Commit 1f2bfbd00e ("kbuild: link of
vmlinux moved to a script") introduced in v3.5-rc1 broke kallsyms on
architectures which have symbol prefixes.

The --symbol-prefix argument used to be added to the KALLSYMS command
line from the architecture Makefile, however this isn't picked up by the
new scripts/link-vmlinux.sh. This resulted in symbols like
kallsyms_addresses being added which weren't correctly overriding the
weak symbols such as _kallsyms_addresses. These could then trigger
BUG_ONs in kallsyms code.

This is fixed by removing the KALLSYMS addition from the architecture
Makefile, and using CONFIG_SYMBOL_PREFIX in the link-vmlinux.sh script
to determine whether to add the --symbol-prefix argument.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
2012-09-11 10:25:12 +08:00
Michal Marek
367e43c50d link-vmlinux.sh: Fix stray "echo" in error message
Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-08-10 11:55:11 +02:00
Michal Marek
5369f55021 kbuild: Print errors to stderr
... at least in the top-level Makefile and scripts/link-vmlinux.sh.
There are some more instances of the 'echo <error>; exit 1' pattern in
some arch Makefiles and kconfig.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-07-07 23:33:31 +02:00
Linus Torvalds
1347a2cebc Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek.

Fixed up nontrivial merge conflict in Makefile as per Stephen Rothwell
and linux-next (and trivial arch/sparc/Makefile changes due to removed
sparc32 logic).

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  mips: Fix KBUILD_CPPFLAGS definition
  kbuild: fix ia64 link
  kbuild: document KBUILD_LDS, KBUILD_VMLINUX_{INIT,MAIN} and LDFLAGS_vmlinux
  kbuild: link of vmlinux moved to a script
  kbuild: refactor final link of sparc32
  kbuild: drop unused KBUILD_VMLINUX_OBJS from top-level Makefile
  kbuild: Makefile: remove unnecessary check for m68knommu ARCH
2012-05-28 10:32:28 -07:00
Sam Ravnborg
00e6c28c68 kbuild: fix ia64 link
ia64 build failed like this:

  CC      init/version.o
  LD      init/built-in.o
  KSYM    .tmp_kallsyms1.o
ld: .tmp_kallsyms1.o: linking constant-gp files with non-constant-gp files
ld: failed to merge target specific data of file .tmp_kallsyms1.o
make: *** [vmlinux] Error 1

This was introduced when link of vmlinux was migrated to a script.
Add missing option to as to fix this.

Reported-by: Tony Luck <tony.luck@gmail.com>
Tested-by: Tony Luck <tony.luck@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-05-10 14:09:21 +02:00
Sam Ravnborg
1f2bfbd00e kbuild: link of vmlinux moved to a script
Move the final link of vmlinux to a script to improve
readability and maintainability of the code.

The Makefile fragments used to link vmlinux has over the
years seen far too many changes and the logic had become
hard to follow.

As the process by nature is serialized there was
nothing gained including this in the Makefile.

"um" has special link requirments - and the
only way to handle this was to hard-code the linking
of "um" in the script.
This was better than trying to modularize it only for the
benefit of "um" anyway.

The shell script has been improved after input from:
Arnaud Lacombe <lacombar@gmail.com>
Nick Bowler <nbowler@elliptictech.com>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Arnaud Lacombe <lacombar@gmail.com>
Cc: Nick Bowler <nbowler@elliptictech.com>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-05-05 21:19:33 +02:00