Commit Graph

229 Commits

Author SHA1 Message Date
Deokgyu Yang
f65cedb0c3 ODROID-M1: dts/dtbo: Introduce device tree overlay
Comes with the first DTBO file, fanspeed-full.dts

Signed-off-by: Steve Jeong <how2soft@gmail.com>
Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: I1e3c18d026b1ebdd9d80a7b23b383b15d568fc42
2024-03-20 10:19:26 +09:00
Tao Huang
2cf392ecb9 Merge tag 'android13-5.10-2023-02_r1' of https://android.googlesource.com/kernel/common
android13-5.10 February 2023 release 1

Artifacts:
  https://ci.android.com/builds/submitted/9611411/kernel_aarch64/latest

* tag 'android13-5.10-2023-02_r1': (5234 commits)
  ANDROID: GKI: rockchip: add symbols for drm hdcp
  BACKPORT: PCI: dwc: Support multiple ATU memory regions
  ANDROID: cpuidle-psci: Fix suspicious RCU usage
  ANDROID: Update the ABI representation
  ANDROID: fix up struct task_struct ABI change in 5.10.162
  ANDROID: struct io_uring ABI preservation hack for 5.10.162 changes
  ANDROID: add flags variable back to struct proto_ops
  UPSTREAM: io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups
  UPSTREAM: eventfd: provide a eventfd_signal_mask() helper
  UPSTREAM: eventpoll: add EPOLL_URING_WAKE poll wakeup flag
  UPSTREAM: Revert "proc: don't allow async path resolution of /proc/self components"
  UPSTREAM: Revert "proc: don't allow async path resolution of /proc/thread-self components"
  UPSTREAM: net: remove cmsg restriction from io_uring based send/recvmsg calls
  UPSTREAM: task_work: unconditionally run task_work from get_signal()
  UPSTREAM: signal: kill JOBCTL_TASK_WORK
  UPSTREAM: io_uring: import 5.15-stable io_uring
  UPSTREAM: task_work: add helper for more targeted task_work canceling
  UPSTREAM: kernel: don't call do_exit() for PF_IO_WORKER threads
  UPSTREAM: kernel: stop masking signals in create_io_thread()
  UPSTREAM: x86/process: setup io_threads more like normal user space threads
  ...

Change-Id: I470528ec3aa69693220e7c0e5b52077b60aebe81

Conflicts:
	Makefile
	drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
	drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
	drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
	drivers/gpu/drm/rockchip/rockchip_drm_vop.c
	drivers/media/usb/uvc/uvc_driver.c
	drivers/media/usb/uvc/uvcvideo.h
	drivers/mmc/core/mmc.c
	drivers/pinctrl/pinctrl-rockchip.c
	drivers/regulator/core.c
	drivers/usb/dwc3/core.h
	drivers/usb/dwc3/gadget.c
	drivers/usb/gadget/function/f_hid.c
	drivers/usb/gadget/function/f_uvc.c
	drivers/usb/gadget/function/uvc.h
	drivers/usb/gadget/function/uvc_configfs.c
	drivers/usb/gadget/function/uvc_queue.c
	drivers/usb/gadget/function/uvc_v4l2.c
	drivers/usb/gadget/function/uvc_video.c
	drivers/usb/host/xhci.h
	drivers/usb/storage/unusual_uas.h
	drivers/usb/typec/altmodes/displayport.c
	mm/cma.c
	sound/core/pcm_dmaengine.c
	include/linux/stmmac.h
	sound/drivers/aloop.c
2023-03-23 21:08:05 +08:00
Tao Huang
83af44e01c Merge tag 'ASB-2022-10-01_13-5.10' of https://android.googlesource.com/kernel/common
https://source.android.com/docs/security/bulletin/2022-10-01
CVE-2022-1786
CVE-2022-20421
CVE-2022-20422
CVE-2022-20423
CVE-2022-20409

* tag 'ASB-2022-10-01_13-5.10': (68 commits)
  UPSTREAM: crypto: jitter - add oversampling of noise source
  ANDROID: Update the ABI representation
  FROMGIT: f2fs: support recording stop_checkpoint reason into super_block
  ANDROID: Update the ABI representation
  ANDROID: Fix for kernelci !CONFIG_SMP break-breaks
  ANDROID: fuse-bpf: set error_in to ENOENT in negative lookup
  ANDROID: fuse-bpf: Add ability to run ranges of tests to fuse_test
  BACKPORT: NFC: netlink: fix sleep in atomic bug when firmware download timeout
  ANDROID: KVM: arm64: Initialize ptr auth in protected mode
  ANDROID: cgroup: Add vendor hook for rebuild_root_domains_bypass
  FROMGIT: KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available()
  ANDROID: Update the ABI symbol list and xml
  UPSTREAM: wifi: mac80211_hwsim: use 32-bit skb cookie
  UPSTREAM: wifi: mac80211_hwsim: add back erroneously removed cast
  UPSTREAM: wifi: mac80211_hwsim: fix race condition in pending packet
  ANDROID: Update the ABI representation
  ANDROID: sched: Fix off-by-one with cpupri MAX_RT_PRIO evaluation
  Revert "ANDROID: workqueue: add vendor hook for wq lockup information"
  UPSTREAM: kernel/irq: export irq_gc_set_wake
  ANDROID: Update the ABI representation
  ...

Change-Id: I0e90348befd683d679799deb2b2f0bf738dbc99f

Conflicts:
	sound/soc/codecs/hdmi-codec.c
2022-11-14 19:57:02 +08:00
Greg Kroah-Hartman
42f48afb44 Merge branch 'android13-5.10' into branch 'android13-5.10-lts'
Sync up with android13-5.10 for the following commits:

800870b6d4 ANDROID: Update the ABI representation
b6a23be181 ANDROID: Fix for kernelci !CONFIG_SMP break-breaks
9bc66fe57c ANDROID: fuse-bpf: set error_in to ENOENT in negative lookup
92fc848ef5 ANDROID: fuse-bpf: Add ability to run ranges of tests to fuse_test
cd9914280a BACKPORT: NFC: netlink: fix sleep in atomic bug when firmware download timeout
e56825d048 ANDROID: KVM: arm64: Initialize ptr auth in protected mode
ab9c52146f ANDROID: cgroup: Add vendor hook for rebuild_root_domains_bypass
8015dd49c0 FROMGIT: KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available()
5495c19c30 ANDROID: Update the ABI symbol list and xml
9c24cb8704 UPSTREAM: wifi: mac80211_hwsim: use 32-bit skb cookie
80c59100da UPSTREAM: wifi: mac80211_hwsim: add back erroneously removed cast
9fafd34f1d UPSTREAM: wifi: mac80211_hwsim: fix race condition in pending packet
d91e7b80d8 ANDROID: Update the ABI representation
14e1028389 ANDROID: sched: Fix off-by-one with cpupri MAX_RT_PRIO evaluation
7a6ea55aa0 Revert "ANDROID: workqueue: add vendor hook for wq lockup information"
7b19b0064b UPSTREAM: kernel/irq: export irq_gc_set_wake
1856a68952 ANDROID: Update the ABI representation
1bd5344779 ANDROID: fuse-bpf: Add test for lookup postfilter
494e7075c9 ANDROID: fuse-bpf: readddir postfilter fixes
8483cc3a75 ANDROID: Enable BUILD_GKI_CERTIFICATION_TOOLS for x86_64 GKI
f813694424 ANDROID: force struct cgroup_taskset to be defined in KMI
3dc6e416a1 ANDROID: force struct blk_mq_alloc_data to be defined in KMI
af4d4153ca BACKPORT: erofs: fix use-after-free of on-stack io[]
aec8f79a0f ANDROID: GKI: db845c: Update symbols list and ABI
7b87b9ddb4 ANDROID: kleaf: Explicit list of ABI files.
d25aa0dbae FROMLIST: f2fs: let FI_OPU_WRITE override FADVISE_COLD_BIT
5625e355a9 ANDROID: incfs: Add check for ATTR_KILL_SUID and ATTR_MODE in incfs_setattr
0cf7d9ce9f Revert "UPSTREAM: scsi: ufs: core: Reduce the power mode change timeout"
1d61c5b5a0 Revert "FROMLIST: scsi: ufs: Fix deadlocks between power management and error handler"
dd18c291f9 BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}
f68d040c31 FROMLIST: scsi: ufs: Fix deadlocks between power management and error handler
32934b542c UPSTREAM: ASoC: hdmi-codec: make hdmi_codec_controls static
46a21348d6 UPSTREAM: ASoC: hdmi-codec: Add a prepare hook
21e97dfa19 UPSTREAM: ASoC: hdmi-codec: Add iec958 controls
9e9d26699d UPSTREAM: ASoC: hdmi-codec: Rework to support more controls
8de9ae8605 UPSTREAM: ALSA: iec958: Split status creation and fill
92c209708a UPSTREAM: ALSA: doc: Clarify IEC958 controls iface
6cc06d03bf UPSTREAM: ASoC: hdmi-codec: remove unused spk_mask member
004a44b913 UPSTREAM: ASoC: hdmi-codec: remove useless initialization
a7633aa2d9 UPSTREAM: ASoC: codec: hdmi-codec: Support IEC958 encoded PCM format
c584eb99bb UPSTREAM: ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
f5a1cb7fd6 UPSTREAM: ASoC: hdmi-codec: Add RX support
6140082c11 UPSTREAM: ASoC: hdmi-codec: Get ELD in before reporting plugged event
185f60f2bb ANDROID: add forward declaration vm_unmapped_area_info
d1b29856ca ANDROID: net: export symbol for tracepoint_consume_skb
952141fb92 BACKPORT: dm verity: set DM_TARGET_IMMUTABLE feature flag
b5fe8c470e BACKPORT: pipe: Fix missing lock in pipe_resize_ring()
790fa51f7b BACKPORT: KVM: x86: avoid calling x86 emulator without a decoded instruction
ee742bccf6 ANDROID: power: fix vendor hook in suspend.c
7108d9d0e5 ANDROID: remove inclusions from hook definition headers
d6ab8e3ba2 Revert "ANDROID: arm64: smp: fix Lockdep warning: RCU used illegally from idle CPU."
aa381a5c71 ANDROID: remove CONFIG_TRACEPOINTS from hook definition headers
aff2309034 BACKPORT: watchqueue: make sure to serialize 'wqueue->defunct' properly
66047fb431 ANDROID: Update the ABI representation
d451b4eee2 ANDROID: Update the ABI representation
3d35c6b91d UPSTREAM: scsi: ufs: core: Reduce the power mode change timeout
5c6d73ac2c BACKPORT: scsi: ufs: core: Increase fDeviceInit poll frequency
2208908824 FROMGIT: f2fs: increase the limit for reserve_root
7af4b3ca30 FROMGIT: f2fs: complete checkpoints during remount
7a04671177 FROMGIT: f2fs: flush pending checkpoints when freezing super
f18d40369c FROMGIT: f2fs: remove gc_urgent_high_limited for cleanup
68f703b19f FROMGIT: f2fs: fix wrong continue condition in GC
8ecc3b8d53 BACKPORT: f2fs: handle decompress only post processing in softirq
23d664773f BACKPORT: f2fs: introduce memory mode
1dd8074b61 ANDROID: Update the ABI representation
9bc5a118ef Revert "ANDROID: usb: host: export additional xhci symbols for ring management"
3743e36578 Revert "ANDROID: GKI: signal: Export for __lock_task_sighand"
7219ca326a Revert "ANDROID: Sched: Add restricted vendor hooks for scheduler"
4e709a85e5 ANDROID: fix kernelci issue for allnoconfig builds
909d582d3a ANDROID: sched: Introducing PELT multiplier
9cfe2646f7 Revert "ANDROID: vendor_hooks: FPSIMD save/restore by using vendor_hooks"
c7afbeb17e Revert "ANDROID: mm: export zone_watermark_ok"
e09aff6074 ANDROID: softirq: Add EXPORT_SYMBOL_GPL for softirq and tasklet
dd04e189df ANDROID: Update the ABI representation
e3b7e41f06 ANDROID: vendor_hooks:vendor hook for __alloc_pages_slowpath.
b5bf2997c3 FROMLIST: xfrm: Ensure policy checked for nested ESP tunnels
970e02667c FROMLIST: xfrm: Skip checking of already-verified secpath entries
039f38f9aa Revert "ANDROID: mm: add vendor hook for vmpressure"
fc6f47b6fc Revert "ANDROID: module: Add vendor hook"
f509b285d7 ANDROID: Update the ABI representation
b8762fa265 BACKPORT: mm: don't be stuck to rmap lock on reclaim path
737a5314c9 ANDROID: power: Add vendor hook for suspend
19b9be6d35 ANDROID: vendor_hooks:vendor hook for mmput
4a84a59cb8 ANDROID: vendor_hooks:vendor hook for pidfd_open
571f9fff87 ANDROID: Update the ABI representation
a48ad117ec BACKPORT: f2fs: do not set compression bit if kernel doesn't support
406e9b3d0b BACKPORT: f2fs: do not count ENOENT for error case
0d59b2578a BACKPORT: f2fs: avoid infinite loop to flush node pages
6d2d344c5f BACKPORT: f2fs: replace congestion_wait() calls with io_schedule_timeout()
ffe2cbbff9 BACKPORT: f2fs: fix wrong condition check when failing metapage read
9f4fae40a9 UPSTREAM: arm64: perf: Support new DT compatibles
be08fd28ca UPSTREAM: arm64: perf: Simplify registration boilerplate
96dc76e1b1 UPSTREAM: arm64: perf: Support Denver and Carmel PMUs
5ac3e909a4 UPSTREAM: arm64: perf: add support for Cortex-A78
913113f05f UPSTREAM: binder: fix redefinition of seq_file attributes
0c79c40888 BACKPORT: drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu
0a21a3eb9f BACKPORT: usb: gadget: rndis: prevent integer overflow in rndis_set_response()
d9d8680e9f BACKPORT: KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
2f9fed9ce8 BACKPORT: Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put
bc80ea8a42 BACKPORT: io_uring: always grab file table for deferred statx
0380da7fd6 FROMGIT: io_uring: Use original task for req identity in io_identity_cow()
19bb609b45 FROMLIST: binder: fix UAF of ref->proc caused by race condition
999976097d ANDROID: binder: fix pending prio state for early exit
b5a6bcf9dc ANDROID: Remove all but top-level OWNERS
254dfc7e98 ANDROID: Update the ABI representation
feb89f3850 ANDROID: fix kernelci error in fs/fuse/dir.c
3821e5b25c ANDROID: power: add a vendor hook to log unfrozen tasks
f2cf53322f ANDROID: fuse-bpf: Fix RCU/reference issue
1f44e4411f UPSTREAM: exfat: reduce block requests when zeroing a cluster
885349f53d FROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctls
eb4344203d FROMLIST: scsi: ufs: Fix a race condition related to device management commands
561c270725 ANDROID: vendor_hooks: tune reclaim scan type for specified mem_cgroup
a6b9536c10 ANDROID: KVM: arm64: Increase size of FF-A buffer
094905c877 ANDROID: fuse-bpf: Always call revalidate for backing
a8b1cff534 ANDROID: fuse-bpf: Adjust backing handle funcs
a06f77a0dd ANDROID: fuse-bpf: Fix revalidate error path and backing handling
329650e3b9 ANDROID: fuse: Don't use readdirplus w/ nodeid 0
55f267ee04 ANDROID: fuse-bpf: Fix use of get_fuse_inode
81a1ae6b43 ANDROID: mm: unlock the page on speculative fault retry
2957657ac3 ANDROID: power: Add vendor hook for suspend
ace01eaf6b FROMGIT: Binder: add TF_UPDATE_TXN to replace outdated txn
f6acdedf61 ANDROID: GKI: forward declare struct tcpci_data in vendor hooks
037c2b81ac ANDROID: Fix warning for undeclared struct acr_info
825e1059b5 ANDROID: KVM: arm64: Free shadow data vCPUs memcache

And track more new symbols that were added to the 'android13-5.10' branch:

25 symbol(s) added
  'GKI_struct_blk_mq_alloc_data'
  'GKI_struct_cgroup_taskset'
  '__bitmap_xor'
  '__traceiter_android_vh_early_resume_begin'
  '__traceiter_android_vh_resume_end'
  '__traceiter_android_vh_try_to_freeze_todo_logging'
  '__tracepoint_android_vh_early_resume_begin'
  '__tracepoint_android_vh_resume_end'
  '__tracepoint_android_vh_try_to_freeze_todo_logging'
  '__xa_insert'
  'dev_base_lock'
  'devm_fwnode_gpiod_get_index'
  'devm_gpiod_get_array_optional'
  'drm_atomic_bridge_chain_disable'
  'drm_mode_parse_command_line_for_connector'
  'init_user_ns'
  'iommu_dma_enable_best_fit_algo'
  'kobject_rename'
  'nf_register_net_hooks'
  'nf_unregister_net_hooks'
  'ns_capable_noaudit'
  'regulator_set_active_discharge_regmap'
  'snd_pcm_create_iec958_consumer_default'
  'snd_pcm_fill_iec958_consumer'
  'snd_pcm_fill_iec958_consumer_hw_params'

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifb26d1c3de6f1ad3c3e6afc37d8acd61bdd8ac14
2022-10-05 15:42:29 +02:00
Masahiro Yamada
dd18c291f9 BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}
GZIP-compressed files end with 4 byte data that represents the size
of the original input. The decompressors (the self-extracting kernel)
exploit it to know the vmlinux size beforehand. To mimic the GZIP's
trailer, Kbuild provides cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}.
Unfortunately these macros are used everywhere despite the appended
size data is only useful for the decompressors.

There is no guarantee that such hand-crafted trailers are safely ignored.
In fact, the kernel refuses compressed initramdfs with the garbage data.
That is why usr/Makefile overrides size_append to make it no-op.

To limit the use of such broken compressed files, this commit renames
the existing macros as follows:

  cmd_bzip2   --> cmd_bzip2_with_size
  cmd_lzma    --> cmd_lzma_with_size
  cmd_lzo     --> cmd_lzo_with_size
  cmd_lz4     --> cmd_lz4_with_size
  cmd_xzkern  --> cmd_xzkern_with_size
  cmd_zstd22  --> cmd_zstd22_with_size

To keep the decompressors working, I updated the following Makefiles
accordingly:

  arch/arm/boot/compressed/Makefile
  arch/h8300/boot/compressed/Makefile
  arch/mips/boot/compressed/Makefile
  arch/parisc/boot/compressed/Makefile
  arch/s390/boot/compressed/Makefile
  arch/sh/boot/compressed/Makefile
  arch/x86/boot/compressed/Makefile

I reused the current macro names for the normal usecases; they produce
the compressed data in the proper format.

I did not touch the following:

  arch/arc/boot/Makefile
  arch/arm64/boot/Makefile
  arch/csky/boot/Makefile
  arch/mips/boot/Makefile
  arch/riscv/boot/Makefile
  arch/sh/boot/Makefile
  kernel/Makefile

This means those Makefiles will stop appending the size data.

I dropped the 'override size_append' hack from usr/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>

Bug: 135791357
(cherry picked from commit 7ce7e984ab
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)
Change-Id: I3524909ef3daab85f7d22afdebc2e5bbfd5e5cf3
[szuweilin: Resolved the conflict about non-existing zstd22 in arch/s390/boot/compressed/Makefile]
Signed-off-by: SzuWei Lin <szuweilin@google.com>
2022-09-17 11:53:58 +00:00
Tao Huang
8e8c0e1ce1 Merge commit 'a81422efff2f'
It contains the following 82894 commits:

  UPSTREAM: usb: dwc3: gadget: Move null pinter check to proper place
  UPSTREAM: dma-buf: call dma_buf_stats_setup after dmabuf is in valid list
  clk: rockchip: rk3588: Add CLK_SET_RATE_PARENT for i2s5/6 frac clk
  media: rockchip: isp: fix vicap fast stream on and off
  dt-bindings: update SPDX-License-Identifier for rockchip clock header
  dt-bindings: update SPDX-License-Identifier for rockchip power header
  ASoC: es7202: fix es7202 read & write error
  media: i2c: sc430cs support get real fps
  media: i2c: sc430cs fixed compile error
  media: i2c: sc4238 support get channel info
  media: i2c: sc4238 support get real fps
  media: i2c: sc4238 fixed compile error
  media: i2c: sc2310 support get channel info
  media: i2c: sc2310 support get real fps
  media: i2c: sc2310 fixed compile error
  media: i2c: sc2239 support get real fps
  media: i2c: sc2239 fixed compile error
  media: i2c: sc2232 support get real fps
  media: i2c: sc2232 fixed compile error
  media: i2c: sc210iot support get real fps
  ...

Conflicts:
	drivers/android/Kconfig
	drivers/dma-buf/dma-buf.c
	drivers/irqchip/irq-gic-v3-its.c
	drivers/usb/dwc3/gadget.c
	sound/soc/rockchip/rockchip_i2s.c

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I0aa6721d035488a1368205c0437ea2c6452c1bb0
2022-09-08 16:17:54 +08:00
Sami Tolvanen
478afd9672 Merge 5.10.133 into android13-5.10-lts
Changes in 5.10.133
	KVM/VMX: Use TEST %REG,%REG instead of CMP $0,%REG in vmenter.SKVM/nVMX: Use __vmx_vcpu_run in nested_vmx_check_vmentry_hw
	objtool: Refactor ORC section generation
	objtool: Add 'alt_group' struct
	objtool: Support stack layout changes in alternatives
	objtool: Support retpoline jump detection for vmlinux.o
	objtool: Assume only ELF functions do sibling calls
	objtool: Combine UNWIND_HINT_RET_OFFSET and UNWIND_HINT_FUNC
	x86/xen: Support objtool validation in xen-asm.S
	x86/xen: Support objtool vmlinux.o validation in xen-head.S
	x86/alternative: Merge include files
	x86/alternative: Support not-feature
	x86/alternative: Support ALTERNATIVE_TERNARY
	x86/alternative: Use ALTERNATIVE_TERNARY() in _static_cpu_has()
	x86/insn: Rename insn_decode() to insn_decode_from_regs()
	x86/insn: Add a __ignore_sync_check__ marker
	x86/insn: Add an insn_decode() API
	x86/insn-eval: Handle return values from the decoder
	x86/alternative: Use insn_decode()
	x86: Add insn_decode_kernel()
	x86/alternatives: Optimize optimize_nops()
	x86/retpoline: Simplify retpolines
	objtool: Correctly handle retpoline thunk calls
	objtool: Handle per arch retpoline naming
	objtool: Rework the elf_rebuild_reloc_section() logic
	objtool: Add elf_create_reloc() helper
	objtool: Create reloc sections implicitly
	objtool: Extract elf_strtab_concat()
	objtool: Extract elf_symbol_add()
	objtool: Add elf_create_undef_symbol()
	objtool: Keep track of retpoline call sites
	objtool: Cache instruction relocs
	objtool: Skip magical retpoline .altinstr_replacement
	objtool/x86: Rewrite retpoline thunk calls
	objtool: Support asm jump tables
	x86/alternative: Optimize single-byte NOPs at an arbitrary position
	objtool: Fix .symtab_shndx handling for elf_create_undef_symbol()
	objtool: Only rewrite unconditional retpoline thunk calls
	objtool/x86: Ignore __x86_indirect_alt_* symbols
	objtool: Don't make .altinstructions writable
	objtool: Teach get_alt_entry() about more relocation types
	objtool: print out the symbol type when complaining about it
	objtool: Remove reloc symbol type checks in get_alt_entry()
	objtool: Make .altinstructions section entry size consistent
	objtool: Introduce CFI hash
	objtool: Handle __sanitize_cov*() tail calls
	objtool: Classify symbols
	objtool: Explicitly avoid self modifying code in .altinstr_replacement
	objtool,x86: Replace alternatives with .retpoline_sites
	x86/retpoline: Remove unused replacement symbols
	x86/asm: Fix register order
	x86/asm: Fixup odd GEN-for-each-reg.h usage
	x86/retpoline: Move the retpoline thunk declarations to nospec-branch.h
	x86/retpoline: Create a retpoline thunk array
	x86/alternative: Implement .retpoline_sites support
	x86/alternative: Handle Jcc __x86_indirect_thunk_\reg
	x86/alternative: Try inline spectre_v2=retpoline,amd
	x86/alternative: Add debug prints to apply_retpolines()
	bpf,x86: Simplify computing label offsets
	bpf,x86: Respect X86_FEATURE_RETPOLINE*
	x86/lib/atomic64_386_32: Rename things
	x86: Prepare asm files for straight-line-speculation
	x86: Prepare inline-asm for straight-line-speculation
	x86/alternative: Relax text_poke_bp() constraint
	objtool: Add straight-line-speculation validation
	x86: Add straight-line-speculation mitigation
	tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy'
	kvm/emulate: Fix SETcc emulation function offsets with SLS
	objtool: Default ignore INT3 for unreachable
	crypto: x86/poly1305 - Fixup SLS
	objtool: Fix SLS validation for kcov tail-call replacement
	objtool: Fix code relocs vs weak symbols
	objtool: Fix type of reloc::addend
	objtool: Fix symbol creation
	x86/entry: Remove skip_r11rcx
	objtool: Fix objtool regression on x32 systems
	x86/realmode: build with -D__DISABLE_EXPORTS
	x86/kvm/vmx: Make noinstr clean
	x86/cpufeatures: Move RETPOLINE flags to word 11
	x86/retpoline: Cleanup some #ifdefery
	x86/retpoline: Swizzle retpoline thunk
	Makefile: Set retpoline cflags based on CONFIG_CC_IS_{CLANG,GCC}
	x86/retpoline: Use -mfunction-return
	x86: Undo return-thunk damage
	x86,objtool: Create .return_sites
	objtool: skip non-text sections when adding return-thunk sites
	x86,static_call: Use alternative RET encoding
	x86/ftrace: Use alternative RET encoding
	x86/bpf: Use alternative RET encoding
	x86/kvm: Fix SETcc emulation for return thunks
	x86/vsyscall_emu/64: Don't use RET in vsyscall emulation
	x86/sev: Avoid using __x86_return_thunk
	x86: Use return-thunk in asm code
	objtool: Treat .text.__x86.* as noinstr
	x86: Add magic AMD return-thunk
	x86/bugs: Report AMD retbleed vulnerability
	x86/bugs: Add AMD retbleed= boot parameter
	x86/bugs: Enable STIBP for JMP2RET
	x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value
	x86/entry: Add kernel IBRS implementation
	x86/bugs: Optimize SPEC_CTRL MSR writes
	x86/speculation: Add spectre_v2=ibrs option to support Kernel IBRS
	x86/bugs: Split spectre_v2_select_mitigation() and spectre_v2_user_select_mitigation()
	x86/bugs: Report Intel retbleed vulnerability
	intel_idle: Disable IBRS during long idle
	objtool: Update Retpoline validation
	x86/xen: Rename SYS* entry points
	x86/bugs: Add retbleed=ibpb
	x86/bugs: Do IBPB fallback check only once
	objtool: Add entry UNRET validation
	x86/cpu/amd: Add Spectral Chicken
	x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
	x86/speculation: Fix firmware entry SPEC_CTRL handling
	x86/speculation: Fix SPEC_CTRL write on SMT state change
	x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit
	x86/speculation: Remove x86_spec_ctrl_mask
	objtool: Re-add UNWIND_HINT_{SAVE_RESTORE}
	KVM: VMX: Flatten __vmx_vcpu_run()
	KVM: VMX: Convert launched argument to flags
	KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS
	KVM: VMX: Fix IBRS handling after vmexit
	x86/speculation: Fill RSB on vmexit for IBRS
	x86/common: Stamp out the stepping madness
	x86/cpu/amd: Enumerate BTC_NO
	x86/retbleed: Add fine grained Kconfig knobs
	x86/bugs: Add Cannon lake to RETBleed affected CPU list
	x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported
	x86/kexec: Disable RET on kexec
	x86/speculation: Disable RRSBA behavior
	x86/static_call: Serialize __static_call_fixup() properly
	tools/insn: Restore the relative include paths for cross building
	x86, kvm: use proper ASM macros for kvm_vcpu_is_preempted
	x86/xen: Fix initialisation in hypercall_page after rethunk
	x86/ftrace: Add UNWIND_HINT_FUNC annotation for ftrace_stub
	x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit
	x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current
	efi/x86: use naked RET on mixed mode call wrapper
	x86/kvm: fix FASTOP_SIZE when return thunks are enabled
	KVM: emulate: do not adjust size of fastop and setcc subroutines
	tools arch x86: Sync the msr-index.h copy with the kernel sources
	tools headers cpufeatures: Sync with the kernel sources
	x86/bugs: Remove apostrophe typo
	um: Add missing apply_returns()
	x86: Use -mindirect-branch-cs-prefix for RETPOLINE builds
	kvm: fix objtool relocation warning
	objtool: Fix elf_create_undef_symbol() endianness
	tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' - again
	tools headers: Remove broken definition of __LITTLE_ENDIAN
	Linux 5.10.133

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Change-Id: I1086d433e436ffcce67f97b76980fb8b8837776d
2022-08-16 11:36:02 -07:00
Jianqun Xu
de3a995b83 scripts/dtc: Support delete unused nodes when CONFIG_ROCKCHIP_MINI_KERNEL=y
Delete nodes in case of:
* node is null, without any property and children node
* node with 'status' property but not "okay" or "ok"

Change-Id: Ic7d2ba1cb60350c21fa6a46222c20870c74359d4
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-04-27 14:47:48 +08:00
Sugar Zhang
3e990e4794 rk: kbuild: Use standard lz4 format for Image.lz4 on ARM64
Uboot use the Standard Lz4 format to decompress kernel Image.lz4,
So, we should use the standard one for lz4 compression.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ic299314a6377e68fac477f451d1ffcae9e8466ce
2022-01-13 10:08:58 +08:00
Sugar Zhang
48e21360ab Revert "Use standard lz4 format for Image.lz4 on ARM64"
This reverts commit aa5ccab207.

Linux kernel still use Legacy lz4 format for self-decompression.
So, we should use the legacy one('lz4 -l') for lz4 compression.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ic10f9cb65bcc7fadd2071b97f8effb958f54d0a4
2022-01-13 10:08:39 +08:00
Sami Tolvanen
d7a956441f BACKPORT: kbuild: Fix TRIM_UNUSED_KSYMS with LTO_CLANG
With CONFIG_LTO_CLANG, we currently link modules into native
code just before modpost, which means with TRIM_UNUSED_KSYMS
enabled, we still look at the LLVM bitcode in the .o files when
generating the list of used symbols. As the bitcode doesn't
yet have calls to compiler intrinsics and llvm-nm doesn't see
function references that only exist in function-level inline
assembly, we currently need a whitelist for TRIM_UNUSED_KSYMS to
work with LTO.

This change moves module LTO linking to happen earlier, and
thus avoids the issue with LLVM bitcode and TRIM_UNUSED_KSYMS
entirely, allowing us to also drop the whitelist from
gen_autoksyms.sh.

Link: https://github.com/ClangBuiltLinux/linux/issues/1369
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Alexander Lobakin <alobakin@pm.me>
Tested-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

(cherry picked from commit 850ded46c6)

Conflicts:
	scripts/Makefile.modfinal
	scripts/Makefile.modpost

Bug: 189327973
Change-Id: I61c3782619e6475cfff74c270b70e01e229dc8df
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-10-11 16:09:07 +00:00
Daniel Mentz
042dd43a1b Revert "FROMLIST: kbuild: Add dtc flag test"
This reverts commit 47b5470fd1.

The variable DTC_FLAGS is a recursively expanded makefile variable which
means that it is re-expanded every time it is referenced. In other
words, a try-run is performed every time this variable is referenced
which is wasteful because the result will always be the same.  In
addition, if dtc is invoked with $(call if_changed_dep,dtc,dtb),
DTC_FLAGS is apparently expanded three times. As a result, we observe 3
try-runs per dtc-option of which there are 8. This means that every
compilation of a device tree file is preceded by 24 try-runs! Every
invocation of dtc turns into 25 invocations!  Additionally, it appears
as if Make prohibits parallelization if a recipe contains a reference to
the $(shell ....) function.

Bug: 198176779
Change-Id: Iae1a1d2266563727f1a7b67660c7b8fa7e1c7247
Signed-off-by: Daniel Mentz <danielmentz@google.com>
(cherry picked from commit e4f264787c)
2021-09-17 21:14:25 +00:00
Tao Huang
2943395673 rk: kbuild: Introduce CONFIG_DTC_SYMBOLS
dtc generation of symbols by CONFIG_DTC_SYMBOLS.
For support device tree overlay.

Change-Id: Ia10496031bc02fd3a4ff98ab0acfc6fc9a54951b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-03-31 09:56:13 +08:00
Andy Yan
aa5ccab207 Use standard lz4 format for Image.lz4 on ARM64
The lz4 Legacy format(which specified by -l) is
not supported by U-Boot.

Change-Id: I6b94881117b59384daca4efd796c933e8dc9e5a6
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-03-24 19:18:33 +08:00
Elliot Berman
21c713f8e8 FROMLIST: BACKPORT: Kbuild: Support nested composite objects
Kbuild composite objects only supports one level of composite objects.
That is, a composite object may only be composed of real compilable
source files.

As a simple example, the following Kbuild description is now supported:

bar-a-y := a/bar0.o a/bar1.o
bar-b-y := b/bar2.o b/bar3.o

foo-objs := bar-a.o bar-b.o

obj-m += foo.o

Add such support by recursively searching for composite objects and
listing them in $(multi-used-*) and $(real-obj-*).

Signed-off-by: Elliot Berman <eberman@codeaurora.org>

Bug: 175420575
Change-Id: I08880422bc462c38b80f1a8bd85498250898c85e
Link: https://lore.kernel.org/linux-kbuild/1611343638-28206-3-git-send-email-eberman@codeaurora.org/
[eberman@codeaurora.org: Fix compile error so that multi-search does not
 recurse when foo-y contains foo.o]
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2021-03-03 15:45:49 -08:00
Elliot Berman
e52f4d9d2d FROMGIT: Kbuild: Make composite object searching more generic
Reduce repeated logic around expanding composite objects.

Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Bug: 175420575
Change-Id: I2e28126544c10c3d45bbe31c8a56efca2659d988
(cherry picked from commit 1c3fae740a
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2021-03-03 15:45:49 -08:00
Andrey Konovalov
67e914b607 BACKPORT: kasan, arm64: expand CONFIG_KASAN checks
[ Upstream commit 0fea6e9af8 ]

[ Conflict: no real conflict, adjacent lines changed ]

Some #ifdef CONFIG_KASAN checks are only relevant for software KASAN modes
(either related to shadow memory or compiler instrumentation).  Expand
those into CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS.

Link: https://lkml.kernel.org/r/e6971e432dbd72bb897ff14134ebb7e169bdcf0c.1606161801.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Branislav Rankov <Branislav.Rankov@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Marco Elver <elver@google.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bug: 172318110
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: If98ea492b3523c950d46c81c616eb284859482b5
2021-01-19 21:47:30 -08:00
Sami Tolvanen
6dd43b98c2 FROMLIST: kbuild: lto: postpone objtool
With LTO, LLVM bitcode won't be compiled into native code until
modpost_link, or modfinal for modules. This change postpones calls
to objtool until after these steps, and moves objtool_args to
Makefile.lib, so the arguments can be reused in Makefile.modfinal.

As we didn't have objects to process earlier, we use --duplicate
when processing vmlinux.o. This change also disables unreachable
instruction warnings with LTO to avoid warnings about the int3
padding between functions.

Bug: 145210207
Change-Id: I72615f7062d218bf612a5d929f2efb75a18538dd
Link: https://lore.kernel.org/lkml/20201013003203.4168817-12-samitolvanen@google.com/
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
2020-12-16 08:56:36 -08:00
Sami Tolvanen
110784e046 FROMLIST: init: lto: ensure initcall ordering
With LTO, the compiler doesn't necessarily obey the link order for
initcalls, and initcall variables need globally unique names to avoid
collisions at link time.

This change exports __KBUILD_MODNAME and adds the initcall_id() macro,
which uses it together with __COUNTER__ and __LINE__ to help ensure
these variables have unique names, and moves each variable to its own
section when LTO is enabled, so the correct order can be specified using
a linker script.

The generate_initcall_ordering.pl script uses nm to find initcalls from
the object files passed to the linker, and generates a linker script
that specifies the same order for initcalls that we would have without
LTO. With LTO enabled, the script is called in link-vmlinux.sh through
jobserver-exec to limit the number of jobs spawned.

Bug: 145210207
Change-Id: I80619eac3674acd9c6d2566443d16b3d09515351
Link: https://lore.kernel.org/lkml/20201211184633.3213045-8-samitolvanen@google.com/
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
2020-12-16 08:56:33 -08:00
Greg Kroah-Hartman
a11fd12c23 Merge 3e4fb4346c ("Merge tag 'spdx-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx") into android-mailine
Steps on the way to 5.10-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifd6acb7037073d3b8411647e2087aa0df71c8830
2020-10-26 07:05:05 +01:00
Andrei Ziureaev
b8a49399fb dt-bindings: Use json for processed-schema*
Change the format of processed-schema* from yaml to json to speed up
validation. With json output, using xargs and appending the output won't
work since json has explicit list begin and end characters. Instead,
we pass the schema files as a list in a temp file.

The parsing time for the processed schema goes down from ~2sec to 70ms.
Also, 'make dtbs_check' becomes 33% faster.

Some error messages are affected by this change. For example, "True was
expected" becomes "... is not of type 'boolean'". The order of messages
is also changed.

Signed-off-by: Andrei Ziureaev <andrei.ziureaev@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2020-08-19 14:31:57 -06:00
Elliot Berman
47b5470fd1 FROMLIST: kbuild: Add dtc flag test
Host dtc may not support the same flags as kernel's copy of dtc. Test
if dtc supports each flag when the dtc comes from host.

Bug: 162811113
Link: https://lore.kernel.org/linux-devicetree/1596650328-14869-1-git-send-email-eberman@codeaurora.org/
Change-Id: Iab4e95c7100817c8b4ad40dcaafa6e6c29a85163
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2020-08-19 00:33:42 +00:00
Greg Kroah-Hartman
c592c07327 Merge fc80c51fd4 ("Merge tag 'kbuild-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild") into android-mainline
Steps on the way to 5.9-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I75b7f1589f230e546c0f2103456fd725c8866460
2020-08-10 10:48:14 +02:00
Linus Torvalds
fc80c51fd4 Merge tag 'kbuild-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada:

 - run the checker (e.g. sparse) after the compiler

 - remove unneeded cc-option tests for old compiler flags

 - fix tar-pkg to install dtbs

 - introduce ccflags-remove-y and asflags-remove-y syntax

 - allow to trace functions in sub-directories of lib/

 - introduce hostprogs-always-y and userprogs-always-y syntax

 - various Makefile cleanups

* tag 'kbuild-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: stop filtering out $(GCC_PLUGINS_CFLAGS) from cc-option base
  kbuild: include scripts/Makefile.* only when relevant CONFIG is enabled
  kbuild: introduce hostprogs-always-y and userprogs-always-y
  kbuild: sort hostprogs before passing it to ifneq
  kbuild: move host .so build rules to scripts/gcc-plugins/Makefile
  kbuild: Replace HTTP links with HTTPS ones
  kbuild: trace functions in subdirectories of lib/
  kbuild: introduce ccflags-remove-y and asflags-remove-y
  kbuild: do not export LDFLAGS_vmlinux
  kbuild: always create directories of targets
  powerpc/boot: add DTB to 'targets'
  kbuild: buildtar: add dtbs support
  kbuild: remove cc-option test of -ffreestanding
  kbuild: remove cc-option test of -fno-stack-protector
  Revert "kbuild: Create directory for target DTB"
  kbuild: run the checker after the compiler
2020-08-09 14:10:26 -07:00
Masahiro Yamada
faabed295c kbuild: introduce hostprogs-always-y and userprogs-always-y
To build host programs, you need to add the program names to 'hostprogs'
to use the necessary build rule, but it is not enough to build them
because there is no dependency.

There are two types of host programs: built as the prerequisite of
another (e.g. gen_crc32table in lib/Makefile), or always built when
Kbuild visits the Makefile (e.g. genksyms in scripts/genksyms/Makefile).

The latter is typical in Makefiles under scripts/, which contains host
programs globally used during the kernel build. To build them, you need
to add them to both 'hostprogs' and 'always-y'.

This commit adds hostprogs-always-y as a shorthand.

The same applies to user programs. net/bpfilter/Makefile builds
bpfilter_umh on demand, hence always-y is unneeded. In contrast,
programs under samples/ are added to both 'userprogs' and 'always-y'
so they are always built when Kbuild visits the Makefiles.

userprogs-always-y works as a shorthand.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2020-08-10 01:32:59 +09:00
Masahiro Yamada
15d5761ad3 kbuild: introduce ccflags-remove-y and asflags-remove-y
CFLAGS_REMOVE_<file>.o filters out flags when compiling a particular
object, but there is no convenient way to do that for every object in
a directory.

Add ccflags-remove-y and asflags-remove-y to make it easily.

Use ccflags-remove-y to clean up some Makefiles.

The add/remove order works as follows:

 [1] KBUILD_CFLAGS specifies compiler flags used globally

 [2] ccflags-y adds compiler flags for all objects in the
     current Makefile

 [3] ccflags-remove-y removes compiler flags for all objects in the
     current Makefile (New feature)

 [4] CFLAGS_<file> adds compiler flags per file.

 [5] CFLAGS_REMOVE_<file> removes compiler flags per file.

Having [3] before [4] allows us to remove flags from most (but not all)
objects in the current Makefile.

For example, kernel/trace/Makefile removes $(CC_FLAGS_FTRACE)
from all objects in the directory, then adds it back to
trace_selftest_dynamic.o and CFLAGS_trace_kprobe_selftest.o

The same applies to lib/livepatch/Makefile.

Please note ccflags-remove-y has no effect to the sub-directories.
In contrast, the previous notation got rid of compiler flags also from
all the sub-directories.

The following are not affected because they have no sub-directories:

  arch/arm/boot/compressed/
  arch/powerpc/xmon/
  arch/sh/
  kernel/trace/

However, lib/ has several sub-directories.

To keep the behavior, I added ccflags-remove-y to all Makefiles
in subdirectories of lib/, except the following:

  lib/vdso/Makefile        - Kbuild does not descend into this Makefile
  lib/raid/test/Makefile   - This is not used for the kernel build

I think commit 2464a609de ("ftrace: do not trace library functions")
excluded too much. In the next commit, I will remove ccflags-remove-y
from the sub-directories of lib/.

Suggested-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Acked-by: Brendan Higgins <brendanhiggins@google.com> (KUnit)
Tested-by: Anders Roxell <anders.roxell@linaro.org>
2020-08-10 01:32:59 +09:00
Greg Kroah-Hartman
075d0ec13d Merge c0842fbc1b ("random32: move the pseudo-random 32-bit definitions to prandom.h") into android-mainline
Baby steps on the way to 5.9-rc1.

Resolves merge issues with:
	arch/arm64/boot/dts/qcom/sdm845-db845c.dts
	drivers/soc/qcom/Kconfig
	kernel/sched/cpufreq_schedutil.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ieb3344a22f9cf0d55ec5fc0daebe7602a248ab53
2020-08-07 14:27:37 +02:00
Nick Terrell
48f7ddf785 init: Add support for zstd compressed kernel
- Add the zstd and zstd22 cmds to scripts/Makefile.lib

- Add the HAVE_KERNEL_ZSTD and KERNEL_ZSTD options

Architecture specific support is still needed for decompression.

Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20200730190841.2071656-4-nickrterrell@gmail.com
2020-07-31 11:49:08 +02:00
Masahiro Yamada
dd7699e37f Revert "kbuild: Create directory for target DTB"
This reverts commit 77479b38e2.

Since commit 8a78756eb5 ("kbuild: create object directories simpler
and faster"), all directories for 'targets' are created.

'mkdir -p $(dir ${dtc-tmp})' is no longer needed.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-07-07 11:13:10 +09:00
Greg Kroah-Hartman
ca9814bc63 Merge 5.8-rc4 into android-mainline
Linux 5.8-rc4

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iccdf79fdb94208b33796eca02bb813482e646ab1
2020-07-06 09:05:59 +02:00
Alistair Delva
bd42f569a7 ANDROID: GKI: scripts: Makefile: update the lz4 command (#2)
When the command was switched over from 'lz4c' to 'lz4', it changed the
meaning of '-c' in a subtle way. In the older lz4c tool, this '-cX'
seems to be a different flag, meaning the compression level. In the
newer lz4 tool, it means to compress to stdout. However, since kbuild
already specifies stdout as a file name, '-c' is superfluous, and
generates a warning:

Warning : stdout won't be used ! Do you want multiple input files (-m) ?

Fix it by removing the extra stdout flag.

Bug: 159285792
Bug: 160031736
Test: build/build.sh
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I96247317ccb31f224c6a8e6e453cddde5e0c2550
2020-07-01 12:12:04 -07:00
Masahiro Yamada
dee9c0b575 dt-bindings: copy process-schema-examples.yaml to process-schema.yaml
There are two processed schema files:

 - processed-schema-examples.yaml

    Used for 'make dt_binding_check'. This is always a full schema.

 - processed-schema.yaml

    Used for 'make dtbs_check'. This may be a full schema, or a smaller
    subset if DT_SCHEMA_FILES is given by a user.

If DT_SCHEMA_FILES is not specified, they are the same. You can copy
the former to the latter instead of running dt-mk-schema twice. This
saves the cpu time a lot when you do 'make dt_binding_check dtbs_check'
because building the full schema takes a couple of seconds.

If DT_SCHEMA_FILES is specified, processed-schema.yaml is generated
based on the specified yaml files.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200625170434.635114-4-masahiroy@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
2020-06-30 08:42:26 -06:00
Rob Herring
3eb619b2f7 scripts/dtc: Update to upstream version v1.6.0-11-g9d7888cbf19c
Sync with upstream dtc primarily to pickup the I2C bus check fixes. The
interrupt_provider check is noisy, so turn it off for now.

This adds the following commits from upstream:

9d7888cbf19c dtc: Consider one-character strings as strings
8259d59f59de checks: Improve i2c reg property checking
fdabcf2980a4 checks: Remove warning for I2C_OWN_SLAVE_ADDRESS
2478b1652c8d libfdt: add extern "C" for C++
f68bfc2668b2 libfdt: trivial typo fix
7be250b4d059 libfdt: Correct condition for reordering blocks
81e0919a3e21 checks: Add interrupt provider test
85e5d839847a Makefile: when building libfdt only, do not add unneeded deps
b28464a550c5 Fix some potential unaligned accesses in dtc

Signed-off-by: Rob Herring <robh@kernel.org>
2020-06-30 08:42:26 -06:00
Alistair Delva
76a0d39293 ANDROID: GKI: scripts: Makefile: update the lz4 command
Use 'lz4' instead of 'lz4c' and increase the compression level. This
also optimizes for decompression speed at this higher level.

Bug: 159285792
Test: launch_cvd -kernel_path bzImage
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I9604cc7d1f3600dec27ceb460f7c29d977a919b1
2020-06-25 14:29:30 -07:00
Linus Torvalds
6adc19fd13 Merge tag 'kbuild-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada:

 - fix build rules in binderfs sample

 - fix build errors when Kbuild recurses to the top Makefile

 - covert '---help---' in Kconfig to 'help'

* tag 'kbuild-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  treewide: replace '---help---' in Kconfig files with 'help'
  kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables
  samples: binderfs: really compile this sample and fix build issues
2020-06-13 13:29:16 -07:00
Thomas Gleixner
37d1a04b13 Rebase locking/kcsan to locking/urgent
Merge the state of the locking kcsan branch before the read/write_once()
and the atomics modifications got merged.

Squash the fallout of the rebase on top of the read/write once and atomic
fallback work into the merge. The history of the original branch is
preserved in tag locking-kcsan-2020-06-02.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2020-06-11 20:02:46 +02:00
Denis Efremov
e4a42c82e9 kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables
Redefine GZIP, BZIP2, LZOP variables as KGZIP, KBZIP2, KLZOP resp.
GZIP, BZIP2, LZOP env variables are reserved by the tools. The original
attempt to redefine them internally doesn't work in makefiles/scripts
intercall scenarios, e.g., "make GZIP=gzip bindeb-pkg" and results in
broken builds. There can be other broken build commands because of this,
so the universal solution is to use non-reserved env variables for the
compression tools.

Fixes: 8dfb61dcba ("kbuild: add variables for compression tools")
Signed-off-by: Denis Efremov <efremov@linux.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-11 20:14:41 +09:00
Denis Efremov
8dfb61dcba kbuild: add variables for compression tools
Allow user to use alternative implementations of compression tools,
such as pigz, pbzip2, pxz. For example, multi-threaded tools to
speed up the build:
$ make GZIP=pigz BZIP2=pbzip2

Variables _GZIP, _BZIP2, _LZOP are used internally because original env
vars are reserved by the tools. The use of GZIP in gzip tool is obsolete
since 2015. However, alternative implementations (e.g., pigz) still rely
on it. BZIP2, BZIP, LZOP vars are not obsolescent.

The credit goes to @grsecurity.

As a sidenote, for multi-threaded lzma, xz compression one can use:
$ export XZ_OPT="--threads=0"

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06 23:42:01 +09:00
Masahiro Yamada
b2c8855491 kbuild: update modules.order only when contained modules are updated
Make modules.order depend on $(obj-m), and use if_changed to build it.
This will avoid unneeded update of modules.order, which will be useful
to optimize the modpost stage.

Currently, the second pass of modpost is always invoked. By checking the
timestamp of modules.order, we can avoid the unneeded modpost.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03 13:22:17 +09:00
Masahiro Yamada
0a8820e7f8 kbuild: refactor subdir-ym calculation
Remove the unneeded variables, __subdir-y and __subdir-m.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01 21:50:45 +09:00
Masahiro Yamada
454753d9f6 kbuild: make modules.order rule consistent with built-in.a
built-in.a contains the built-in object paths from the current and sub
directories.

module.order collects the module paths from the current and sub
directories.

Make their build rules look more symmetrical.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-26 00:03:16 +09:00
Masahiro Yamada
6ba3bcb013 kbuild: move subdir-obj-y to scripts/Makefile.build
Save $(addprefix ...) for subdir-obj-y.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-26 00:03:16 +09:00
Masahiro Yamada
59721d4eb7 kbuild: warn if always, hostprogs-y, or hostprogs-m is used
always, hostprogs-y, and hostprogs-m are deprecated.

There is no user in upstream code, but I will keep them for external
modules. I want to remove them entirely someday. Prompt downstream
users for the migration.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-17 18:51:28 +09:00
Masahiro Yamada
78046fabe6 kbuild: determine the output format of DTC by the target suffix
cmd_dtc takes the additional parameter $(2) to select the target
format, dtb or yaml. This makes things complicated when it is used
with cmd_and_fixdep and if_changed_rule. I actually stumbled on this.
See commit 3d4b223868 ("kbuild: fix DT binding schema rule again to
avoid needless rebuilds").

Extract the suffix part of the target instead of passing the parameter.
Fortunately, this works for both $(obj)/%.dtb and $(obj)/%.dt.yaml .

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-12 13:28:33 +09:00
Masahiro Yamada
30a7729771 kbuild: use -MMD instead of -MD to exclude system headers from dependency
This omits system headers from the generated header dependency.

System headers are not updated unless you upgrade the compiler. Nor do
they contain CONFIG options, so fixdep does not need to parse them.

Having said that, the effect of this optimization will be quite small
because the kernel code generally does not include system headers
except <stdarg.h>. Host programs include a lot of system headers,
but there are not so many in the kernel tree.

At first, keeping system headers in .*.cmd files might be useful to
detect the compiler update, but there is no guarantee that <stdarg.h>
is included from every file. So, I implemented a more reliable way in
the previous commit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-12 13:28:33 +09:00
Masahiro Yamada
3d4b223868 kbuild: fix DT binding schema rule again to avoid needless rebuilds
Since commit 7a04960560 ("kbuild: fix DT binding schema rule to detect
command line changes"), this rule is every time re-run even if you change
nothing.

cmd_dtc takes one additional parameter to pass to the -O option of dtc.

We need to pass 'yaml' to if_changed_rule. Otherwise, cmd-check invoked
from if_changed_rule is false positive.

Fixes: 7a04960560 ("kbuild: fix DT binding schema rule to detect command line changes")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-04-23 10:50:26 +09:00
Ingo Molnar
3b02a051d2 Merge tag 'v5.7-rc1' into locking/kcsan, to resolve conflicts and refresh
Resolve these conflicts:

	arch/x86/Kconfig
	arch/x86/kernel/Makefile

Do a minor "evil merge" to move the KCSAN entry up a bit by a few lines
in the Kconfig to reduce the probability of future conflicts.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2020-04-13 09:44:39 +02:00
Ingo Molnar
df10846ff2 Merge branch 'linus' into locking/kcsan, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2020-03-21 09:35:44 +01:00
Ingo Molnar
a4654e9bde Merge branch 'x86/kdump' into locking/kcsan, to resolve conflicts
Conflicts:
	arch/x86/purgatory/Makefile

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2020-03-21 09:24:41 +01:00
Rob Herring
2ba06cd856 kbuild: Always validate DT binding examples
Most folks only run dt_binding_check on the single schema they care about
by setting DT_SCHEMA_FILES. That means example is only checked against
that one schema which is not always sufficient.

Let's address this by splitting processed-schema.yaml into 2 files: one
that's always all schemas for the examples and one that's just the schema
in DT_SCHEMA_FILES for dtbs.

Co-developed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-03 20:49:21 +09:00