d82a67cbef
* refs/heads/tmp-8cf9478:
Revert "ANDROID: GKI: Enable bounds sanitizer"
ANDROID: GKI: temporarily disable LTO/CFI
ANDROID: Revert "f2fs: fix to tag FIEMAP_EXTENT_MERGED in f2fs_fiemap()"
FROMLIST: KVM: arm64: Disable FWB in host stage-2
FROMLIST: KVM: arm64: Introduce KVM_PGTABLE_S2_NOFWB Stage-2 flag
FROMLIST: KVM: arm64: Protect the .hyp sections from the host
FROMLIST: KVM: arm64: Disable PMU support in protected mode
FROMLIST: KVM: arm64: Page-align the .hyp sections
FROMLIST: KVM: arm64: Wrap the host with a stage 2
FROMLIST: KVM: arm64: Provide sanitized mmfr* registers at EL2
FROMLIST: KVM: arm64: Add kvm_pgtable_stage2_find_range()
FROMLIST: KVM: arm64: Refactor the *_map_set_prot_attr() helpers
FROMLIST: KVM: arm64: Use page-table to track page ownership
FROMLIST: KVM: arm64: Always zero invalid PTEs
FROMLIST: KVM: arm64: Sort the hypervisor memblocks
FROMLIST: KVM: arm64: Reserve memory for host stage 2
FROMLIST: KVM: arm64: Make memcache anonymous in pgtable allocator
FROMLIST: KVM: arm64: Refactor __populate_fault_info()
FROMLIST: KVM: arm64: Refactor __load_guest_stage2()
FROMLIST: KVM: arm64: Refactor kvm_arm_setup_stage2()
FROMLIST: KVM: arm64: Set host stage 2 using kvm_nvhe_init_params
FROMLIST: KVM: arm64: Use kvm_arch in kvm_s2_mmu
FROMLIST: KVM: arm64: Use kvm_arch for stage 2 pgtable
FROMLIST: KVM: arm64: Elevate hypervisor mappings creation at EL2
FROMLIST: KVM: arm64: Prepare the creation of s1 mappings at EL2
FROMLIST: arm64: asm: Provide set_sctlr_el2 macro
FROMLIST: KVM: arm64: Factor out vector address calculation
FROMLIST: KVM: arm64: Provide __flush_dcache_area at EL2
FROMLIST: KVM: arm64: Enable access to sanitized CPU features at EL2
FROMLIST: KVM: arm64: Introduce a Hyp buddy page allocator
FROMLIST: KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp
FROMLIST: KVM: arm64: Introduce an early Hyp page allocator
FROMLIST: KVM: arm64: Allow using kvm_nvhe_sym() in hyp code
FROMLIST: KVM: arm64: Make kvm_call_hyp() a function call at Hyp
FROMLIST: KVM: arm64: Introduce a BSS section for use at Hyp
FROMLIST: KVM: arm64: Factor memory allocation out of pgtable.c
FROMLIST: KVM: arm64: Avoid free_page() in page-table allocator
FROMLIST: KVM: arm64: Initialize kvm_nvhe_init_params early
FROMLIST: arm64: kvm: Add standalone ticket spinlock implementation for use at hyp
FROMLIST: KVM: arm64: Link position-independent string routines into .hyp.text
FROMLIST: arm64: lib: Annotate {clear, copy}_page() as position-independent
Revert "ANDROID: sched: cpufreq_schedutil: add sugov tracepoints"
ANDROID: Partial revert of 06881e01b5
("ANDROID: sched: Add vendor hooks for override sugov behavior")
Revert "ANDROID: sched: Add vendor hooks for skipping sugov update"
Revert "ANDROID: sched: cpufreq_schedutil: move sugov traces to sched"
ANDROID: thermal: Add logic for filter on-die tz genl event.
ANDROID: mmc: support hardware that takes key directly
UPSTREAM: zram: fix broken page writeback
UPSTREAM: zram: fix return value on writeback_store
ANDROID: sched: Add vendor hook for util_est_update
ANDROID: GKI: Enable DTPM framework
ANDROID: GKI: Add remoteproc framework symbols to symbol list
ANDROID: vendor_hooks: Add hooks for scheduler
FROMGIT: configfs: fix a use-after-free in __configfs_open_file
ANDROID: lib/plist.c: Export plist-related APIs
ANDROID: module: Add vendor hook
ANDROID: bpf: Add vendor hook
ANDROID: kernel: Add vendor hook in creds
ANDROID: security: selinux: Add vendor hook in avc
UPSTREAM: KVM: arm64: Fix exclusive limit for IPA size
UPSTREAM: KVM: arm64: Reject VM creation when the default IPA size is unsupported
ANDROID: GKI: add android_kabi.h
UPSTREAM: MAINTAINERS: add entry for KFENCE
ANDROID: Clang LTO: Comment on symbol visibility workaround
FROMLIST: mm: fs: Invalidate BH LRU during page migration
BACKPORT: FROMLIST: mm: disable LRU pagevec during the migration temporarily
FROMLIST: mm: replace migrate_prep with lru_add_drain_all
UPSTREAM: mm: migrate: initialize err in do_migrate_pages
UPSTREAM: mm: migrate: clean up migrate_prep{_local}
ANDROID: Clang LTO: Only set -fvisibility=hidden for x86
UPSTREAM: usb: typec: tcpci: Refactor tcpc_presenting_cc1_rd macro
ANDROID: mm: build alloc_contig_dump_pages in page_alloc.o
FROMLIST: mm: page_alloc: dump migrate-failed pages
ANDROID: sched: Add vendor hook for uclamp_eff_get
ANDROID: cpu/hotplug: failure to offline 2nd to last cpu
ANDROID: qcom: Add devm_blk_ksm_init to ABI
ANDROID: arm64: add vendor hooks for unusal abort cases
UPSTREAM: powercap/drivers/dtpm: Fix size of object being allocated
UPSTREAM: powercap/drivers/dtpm: Fix an IS_ERR() vs NULL check
UPSTREAM: powercap/drivers/dtpm: Fix some missing unlock bugs
UPSTREAM: powercap/drivers/dtpm: Fix a double shift bug
UPSTREAM: powercap/drivers/dtpm: Fix __udivdi3 and __aeabi_uldivmod unresolved symbols
UPSTREAM: powercap/drivers/dtpm: Add CPU energy model based support
UPSTREAM: powercap/drivers/dtpm: Add API for dynamic thermal power management
UPSTREAM: units: Add Watt units
UPSTREAM: Documentation/powercap/dtpm: Add documentation for dtpm
UPSTREAM: xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state
UPSTREAM: usb: xhci: Fix ASMedia ASM1042A and ASM3242 DMA addressing
UPSTREAM: xhci: Improve detection of device initiated wake signal.
UPSTREAM: usb: xhci: do not perform Soft Retry for some xHCI hosts
FROMGIT: rcu/tree: Add a trace event for RCU CPU stall warnings
ANDROID: GKI: Update virtual_device symbol list
ANDROID: usb: host: export additional xhci symbols for ring management
ANDROID: GKI: add fields required to enable CONFIG_READ_ONLY_THP_FOR_FS
ANDROID: vendor_hooks: Add hooks for rwsem and mutex
BACKPORT: usb: dwc3: gadget: Allow runtime suspend if UDC unbinded
FROMGIT: ASoC: codecs: wcd934x: add a sanity check in set channel map
FROMGIT: ASoC: qcom: sdm845: Fix array out of range on rx slim channels
FROMGIT: ASoC: qcom: sdm845: Fix array out of bounds access
FROMGIT: arm64: mte: Map hotplugged memory as Normal Tagged
ANDROID: KVM: arm64: Disable CFI only for nVHE hyp object
FROMGIT: KVM: arm64: Ensure I-cache isolation between vcpus of a same VM
FROMGIT: KVM: arm64: Don't use cbz/adr with external symbols
FROMGIT: KVM: arm64: Fix range alignment when walking page tables
BACKPORT: binder: move structs from core file to header file
ANDROID: dma-buf: add get_each_dmabuf function
FROMLIST: drivers: thermal: Add NULL pointer check before using cooling device stats
ANDROID: GKI: Switch to LTO_FULL
ANDROID: gki_defconfig: set CONFIG_STACK_HASH_ORDER to 12
ANDROID: sched: move vendor hook to check scheduling nice value
ANDROID: qcom: Add __cfi_slowpath
FROMGIT: usb: dwc3: qcom: Honor wakeup enabled/disabled state
FROMGIT: usb: typec: stusb160x: fix return value check in stusb160x_probe()
FROMGIT: usb: typec: tps6598x: Fix return value check in tps6598x_probe()
FROMGIT: usb: typec: tcpm: turn tcpm_ams_finish into void function
FROMGIT: usb: typec: tcpci: Check ROLE_CONTROL while interpreting CC_STATUS
ANDROID: GKI: Update abi_gki_aarch64_qcom for timer hook
ANDROID: Add vendor hooks when syscall prctl finished
ANDROID: cgroup: Add vendor hook to the cgroup
FROMGIT: usb: common: move function's kerneldoc next to its definition
FROMGIT: usb: xhci-mtk: print debug info of endpoint interval
FROMGIT: usb: common: add function to get interval expressed in us unit
FROMGIT: usb: xhci-mtk: support to build xhci-mtk-hcd.ko
FROMGIT: usb: xhci-mtk: remove declaration of xhci_mtk_setup()
FROMGIT: usb: xhci-mtk: add some schedule error number
FROMGIT: usb: xhci-mtk: rebuild the way to get bandwidth domain
FROMGIT: usb: xhci-mtk: use @tt_info to check the FS/LS device is under a HS hub
FROMGIT: usb: xhci-mtk: add a member @speed in mu3h_sch_ep_info struct
FROMGIT: usb: xhci-mtk: use clear type instead of void
FROMGIT: usb: xhci-mtk: remove unnecessary members of mu3h_sch_tt struct
FROMGIT: usb: xhci-mtk: add a function to get bandwidth boundary
FROMGIT: usb: xhci-mtk: add a function to (un)load bandwidth info
FROMGIT: usb: xhci-mtk: use @sch_tt to check whether need do TT schedule
FROMGIT: usb: xhci-mtk: add only one extra CS for FS/LS INTR
FROMGIT: usb: xhci-mtk: get the microframe boundary for ESIT
FROMGIT: usb: xhci-mtk: improve bandwidth scheduling with TT
FROMGIT: usb: xhci-mtk: remove or operator for setting schedule parameters
ANDROID: abi_gki_aarch64_qcom: Add __tracepoint_cpu_frequency_limits
ANDROID: cpufreq: Export cpu_frequency_limits tracepoint
ANDROID: kbuild: Copy out-of-tree kernel headers to INSTALL_HDR_PATH
ANDROID: build.config: Disable LTO for KASAN and Kprobes builds
ANDROID: GKI: arm64: Enable LTO+CFI
Linux 5.10.21
net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips
net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround
ALSA: hda/realtek: Apply dual codec quirks for MSI Godlike X570 board
ALSA: hda/realtek: Add quirk for Intel NUC 10
ALSA: hda/realtek: Add quirk for Clevo NH55RZQ
media: v4l: ioctl: Fix memory leak in video_usercopy
tty: teach the n_tty ICANON case about the new "cookie continuations" too
tty: teach n_tty line discipline about the new "cookie continuations"
tty: clean up legacy leftovers from n_tty line discipline
tty: fix up hung_up_tty_read() conversion
tty: fix up iterate_tty_read() EOVERFLOW handling
powerpc/sstep: Fix incorrect return from analyze_instr()
powerpc/sstep: Check instruction validity against ISA version before emulation
swap: fix swapfile read/write offset
remoteproc/mediatek: Fix kernel test robot warning
zsmalloc: account the number of compacted pages correctly
xen: fix p2m size in dom0 for disabled memory hotplug case
xen-netback: respect gnttab_map_refs()'s return value
Xen/gnttab: handle p2m update errors on a per-slot basis
scsi: iscsi: Verify lengths on passthrough PDUs
scsi: iscsi: Ensure sysfs attributes are limited to PAGE_SIZE
scsi: iscsi: Restrict sessions and handles to admin capabilities
ASoC: Intel: bytcr_rt5640: Add quirk for the Acer One S1002 tablet
ASoC: Intel: bytcr_rt5651: Add quirk for the Jumper EZpad 7 tablet
ASoC: Intel: bytcr_rt5640: Add quirk for the Voyo Winpad A15 tablet
ASoC: Intel: bytcr_rt5640: Add quirk for the Estar Beauty HD MID 7316R tablet
sched/features: Fix hrtick reprogramming
parisc: Bump 64-bit IRQ stack size to 64 KB
ASoC: Intel: sof_sdw: detect DMIC number based on mach params
ASoC: Intel: sof-sdw: indent and add quirks consistently
perf/x86/kvm: Add Cascade Lake Xeon steppings to isolation_ucodes[]
btrfs: fix error handling in commit_fs_roots
ASoC: Intel: Add DMI quirk table to soc_intel_is_byt_cr()
nvme-tcp: add clean action for failed reconnection
nvme-rdma: add clean action for failed reconnection
nvme-core: add cancel tagset helpers
f2fs: fix to set/clear I_LINKABLE under i_lock
f2fs: handle unallocated section and zone on pinned/atgc
media: uvcvideo: Allow entities with no pads
drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data
drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails
ASoC: Intel: bytcr_rt5640: Add new BYT_RT5640_NO_SPEAKERS quirk-flag
PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse
drm/amdgpu: Add check to prevent IH overflow
fs: make unlazy_walk() error handling consistent
crypto: tcrypt - avoid signed overflow in byte count
drm/hisilicon: Fix use-after-free
brcmfmac: Add DMI nvram filename quirk for Voyo winpad A15 tablet
brcmfmac: Add DMI nvram filename quirk for Predia Basic tablet
staging: bcm2835-audio: Replace unsafe strcpy() with strscpy()
staging: most: sound: add sanity check for function argument
Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data
Bluetooth: Add new HCI_QUIRK_NO_SUSPEND_NOTIFIER quirk
net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant
ath10k: fix wmi mgmt tx queue full due to race condition
pktgen: fix misuse of BUG_ON() in pktgen_thread_worker()
mt76: mt7615: reset token when mac_reset happens
Bluetooth: btusb: fix memory leak on suspend and resume
Bluetooth: hci_h5: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for btrtl
wlcore: Fix command execute failure 19 for wl12xx
vt/consolemap: do font sum unsigned
x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk
staging: fwserial: Fix error handling in fwserial_create
EDAC/amd64: Do not load on family 0x15, model 0x13
rsi: Move card interrupt handling to RX thread
rsi: Fix TX EAPOL packet handling against iwlwifi AP
ASoC: qcom: Remove useless debug print
dt-bindings: net: btusb: DT fix s/interrupt-name/interrupt-names/
dt-bindings: ethernet-controller: fix fixed-link specification
net: fix dev_ifsioc_locked() race condition
net: psample: Fix netlink skb length with tunnel info
net: hsr: add support for EntryForgetTime
net: ag71xx: remove unnecessary MTU reservation
net: dsa: tag_rtl4_a: Support also egress tags
net/sched: cls_flower: Reject invalid ct_state flags rules
net: bridge: use switchdev for port flags set through sysfs too
mptcp: do not wakeup listener for MPJ subflows
tcp: fix tcp_rmem documentation
RDMA/rtrs-srv: Do not signal REG_MR
RDMA/rtrs-clt: Use bitmask to check sess->flags
RDMA/rtrs: Do not signal for heatbeat
mm/hugetlb.c: fix unnecessary address expansion of pmd sharing
nbd: handle device refs for DESTROY_ON_DISCONNECT properly
riscv: Get rid of MAX_EARLY_MAPPING_SIZE
net: fix up truesize of cloned skb in skb_prepare_for_shift()
tomoyo: ignore data race while checking quota
smackfs: restrict bytes count in smackfs write functions
net/af_iucv: remove WARN_ONCE on malformed RX packets
xfs: Fix assert failure in xfs_setattr_size()
media: v4l2-ctrls.c: fix shift-out-of-bounds in std_validate
erofs: fix shift-out-of-bounds of blkszbits
media: mceusb: sanity check for prescaler value
udlfb: Fix memory leak in dlfb_usb_probe
sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled
JFS: more checks for invalid superblock
x86/build: Treat R_386_PLT32 relocation as R_386_PC32
drm/virtio: use kvmalloc for large allocations
Input: elan_i2c - add new trackpoint report type 0x5F
Input: elantech - fix protocol errors for some trackpoints in SMBus mode
net: usb: qmi_wwan: support ZTE P685M modem
ANDROID: GKI: Enable bounds sanitizer
ANDROID: Allow HAS_LTO_CLANG with KASAN_HW_TAGS
ANDROID: abi_gki_aarch64_qcom: Add cpufreq related symbols
ANDROID: cpufreq: Add a restricted vendor hook for freq transition
ANDROID: scsi: ufs: add hooks to track ufs commands
ANDROID: Fix compilation error when CPU_FREQ is disabled
BACKPORT: kasan, arm64: allow using KUnit tests with HW_TAGS mode
Revert "FROMGIT: kasan, arm64: allow using KUnit tests with HW_TAGS mode"
Revert "BACKPORT: kasan: remove redundant config option"
UPSTREAM: arm/kasan: fix the array size of kasan_early_shadow_pte[]
FROMGIT: KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibility
FROMGIT: KVM: arm64: Rename __vgic_v3_get_ich_vtr_el2() to __vgic_v3_get_gic_config()
FROMGIT: KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available
FROMGIT: KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key
FROMGIT: KVM: arm64: Fix nVHE hyp panic host context restore
FROMGIT: KVM: arm64: Avoid corrupting vCPU context register in guest exit
FROMLIST: arm64: cpufeatures: Fix handling of CONFIG_CMDLINE for idreg overrides
Linux 5.10.20
ARM: dts: aspeed: Add LCLK to lpc-snoop
net_sched: fix RTNL deadlock again caused by request_module()
net: qrtr: Fix memory leak in qrtr_tun_open
net: sched: fix police ext initialization
wireguard: queueing: get rid of per-peer ring buffers
wireguard: selftests: test multiple parallel streams
net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending
ipv6: silence compilation warning for non-IPV6 builds
kgdb: fix to kill breakpoints on initmem after boot
drm/i915: Reject 446-480MHz HDMI clock on GLK
dm era: only resize metadata in preresume
dm era: Reinitialize bitset cache before digesting a new writeset
dm era: Use correct value size in equality function of writeset tree
dm era: Fix bitset memory leaks
dm era: Verify the data block size hasn't changed
dm era: Update in-core bitset after committing the metadata
dm era: Recover committed writeset after crash
dm writecache: fix writing beyond end of underlying device when shrinking
dm writecache: return the exact table values that were set
dm writecache: fix performance degradation in ssd mode
dm table: fix zoned iterate_devices based device capability checks
dm table: fix DAX iterate_devices based device capability checks
dm table: fix iterate_devices based device capability checks
dm: fix deadlock when swapping to encrypted device
gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end
gfs2: Lock imbalance on error path in gfs2_recover_one
gfs2: Don't skip dlm unlock if glock has an lvb
gfs2: fix glock confusion in function signal_our_withdraw
spi: spi-synquacer: fix set_cs handling
spi: fsl: invert spisel_boot signal on MPC8309
sparc32: fix a user-triggerable oops in clear_user()
f2fs: flush data when enabling checkpoint back
f2fs: enforce the immutable flag on open files
f2fs: fix out-of-repair __setattr_copy()
irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap
um: defer killing userspace on page table update failures
um: mm: check more comprehensively for stub changes
virtio/s390: implement virtio-ccw revision 2 correctly
s390/vtime: fix inline assembly clobber list
proc: don't allow async path resolution of /proc/thread-self components
cpufreq: intel_pstate: Get per-CPU max freq via MSR_HWP_CAPABILITIES if available
cpufreq: intel_pstate: Change intel_pstate_get_hwp_max() argument
cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks
thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error
kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE
zonefs: Fix file size of zones in full condition
exfat: fix shift-out-of-bounds in exfat_fill_super()
printk: fix deadlock when kernel panic
mfd: gateworks-gsc: Fix interrupt type
gpio: pcf857x: Fix missing first interrupt
mei: me: add adler lake point LP DID
mei: me: add adler lake point S DID
mei: me: emmitsburg workstation DID
mei: fix transfer over dma with extended header
spmi: spmi-pmic-arb: Fix hw_irq overflow
powerpc/32s: Add missing call to kuep_lock on syscall entry
powerpc/kexec_file: fix FDT size estimation for kdump kernel
powerpc/32: Preserve cr1 in exception prolog stack check to fix build error
mmc: sdhci-pci-o2micro: Bug fix for SDR104 HW tuning failure
mmc: sdhci-esdhc-imx: fix kernel panic when remove module
module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols
nvmem: qcom-spmi-sdam: Fix uninitialized pdev pointer
KVM: nSVM: fix running nested guests when npt=0
mm, compaction: make fast_isolate_freepages() stay within zone
mm/vmscan: restore zone_reclaim_mode ABI
hugetlb: fix copy_huge_page_from_user contig page struct assumption
hugetlb: fix update_and_free_page contig page struct assumption
mm: memcontrol: fix get_active_memcg return value
mm: memcontrol: fix swap undercounting in cgroup2
x86: fix seq_file iteration for pat/memtype.c
seq_file: document how per-entry resources are managed.
fs/affs: release old buffer head on error path
mtd: spi-nor: hisi-sfc: Put child node np on error path
mtd: spi-nor: core: Add erase size check for erase command initialization
mtd: spi-nor: core: Fix erase type discovery for overlaid region
mtd: spi-nor: sfdp: Fix wrong erase type bitmask for overlaid region
mtd: spi-nor: sfdp: Fix last erase region marking
coresight: etm4x: Handle accesses to TRCSTALLCTLR
watchdog: mei_wdt: request stop on unregister
watchdog: qcom: Remove incorrect usage of QCOM_WDT_ENABLE_IRQ
riscv: Disable KSAN_SANITIZE for vDSO
arm64: spectre: Prevent lockdep splat on v4 mitigation enable path
arm64 module: set plt* section addresses to 0x0
arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing
arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails
iommu/arm-smmu-qcom: Fix mask extraction for bootloader programmed SMRs
arm64: Extend workaround for erratum 1024718 to all versions of Cortex-A55
kprobes: Fix to delay the kprobes jump optimization
rcu/nocb: Perform deferred wake up before last idle's need_resched() check
rcu: Pull deferred rcuog wake up to rcu_eqs_enter() callers
powerpc/prom: Fix "ibm,arch-vec-5-platform-support" scan
x86/entry: Fix instrumentation annotation
x86/fault: Fix AMD erratum #91 errata fixup for user code
x86/reboot: Force all cpus to exit VMX root if VMX is supported
x86/virt: Eat faults on VMXOFF in reboot flows
media: smipcie: fix interrupt handling and IR timeout
media: marvell-ccic: power up the device on mclk enable
media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt()
media: ir_toy: add another IR Droid device
media: i2c: max9286: fix access to unallocated memory
floppy: reintroduce O_NDELAY fix
staging: rtl8188eu: Add Edimax EW-7811UN V2 to device table
staging: gdm724x: Fix DMA from stack
staging/mt7621-dma: mtk-hsdma.c->hsdma-mt7621.c
arm64: dts: agilex: fix phy interface bit shift for gmac1 and gmac2
dts64: mt7622: fix slow sd card access
pstore: Fix typo in compression option name
drivers/misc/vmw_vmci: restrict too big queue size in qp_host_alloc_queue
misc: rtsx: init of rts522a add OCP power off when no card is present
arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL)
seccomp: Add missing return in non-void function
soc: samsung: exynos-asv: handle reading revision register error
soc: samsung: exynos-asv: don't defer early on not-supported SoCs
crypto: sun4i-ss - initialize need_fallback
crypto: sun4i-ss - handle BigEndian for cipher
crypto: sun4i-ss - IV register does not work on A10 and A13
crypto: sun4i-ss - checking sg length is not sufficient
crypto: michael_mic - fix broken misalignment handling
crypto: aesni - prevent misaligned buffers on the stack
crypto: arm64/sha - add missing module aliases
drm/i915/gt: Correct surface base address for renderclear
drm/i915/gt: Flush before changing register state
btrfs: fix extent buffer leak on failure to copy root
btrfs: account for new extents being deleted in total_bytes_pinned
btrfs: handle space_info::total_bytes_pinned inside the delayed ref itself
btrfs: splice remaining dirty_bg's onto the transaction dirty bg list
btrfs: fix reloc root leak with 0 ref reloc roots on recovery
btrfs: abort the transaction if we fail to inc ref in btrfs_copy_root
btrfs: add asserts for deleting backref cache nodes
btrfs: do not warn if we can't find the reloc root when looking up backref
btrfs: do not cleanup upper nodes in btrfs_backref_cleanup_node
KEYS: trusted: Reserve TPM for seal and unseal operations
KEYS: trusted: Fix migratable=1 failing
KEYS: trusted: Fix incorrect handling of tpm_get_random()
tpm_tis: Clean up locality release
tpm_tis: Fix check_locality for correct locality acquisition
erofs: initialized fields can only be observed after bit is set
selinux: fix inconsistency between inode_getxattr and inode_listsecurity
ASoC: siu: Fix build error by a wrong const prefix
drm/rockchip: Require the YTR modifier for AFBC
drm/panel: kd35t133: allow using non-continuous dsi clock
drm/sched: Cancel and flush all outstanding jobs before finish.
drm/modes: Switch to 64bit maths to avoid integer overflow
drm/nouveau/kms: handle mDP connectors
drm/amdgpu: Set reference clock to 100Mhz on Renoir (v2)
drm/amdkfd: Fix recursive lock warnings
drm/amd/display: Add vupdate_no_lock interrupts for DCN2.1
drm/amd/display: Remove Assert from dcn10_get_dig_frontend
drm/amd/display: Add FPU wrappers to dcn21_validate_bandwidth()
Revert "drm/amd/display: Update NV1x SR latency values"
bcache: Move journal work to new flush wq
bcache: Give btree_io_wq correct semantics again
Revert "bcache: Kill btree_io_wq"
Revert "MIPS: Octeon: Remove special handling of CONFIG_MIPS_ELF_APPENDED_DTB=y"
MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target='
MIPS: Support binutils configured with --enable-mips-fix-loongson3-llsc=yes
MIPS: Ingenic: Disable HPTLB for D0 XBurst CPUs too
ALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup
ALSA: hda/realtek: modify EAPD in the ALC886
ALSA: hda/hdmi: Drop bogus check at closing a stream
ALSA: hda: Add another CometLake-H PCI ID
ALSA: fireface: fix to parse sync status register of latter protocol
phy: lantiq: rcu-usb2: wait after clock enable
USB: serial: mos7720: fix error code in mos7720_write()
USB: serial: mos7840: fix error code in mos7840_write()
USB: serial: pl2303: fix line-speed handling on newer chips
USB: serial: ftdi_sio: fix FTX sub-integer prescaler
usb: dwc3: gadget: Fix dep->interval for fullspeed interrupt
usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1
usb: musb: Fix runtime PM race in musb_queue_resume_work
USB: serial: option: update interface mapping for ZTE P685M
media: mceusb: Fix potential out-of-bounds shift
Input: i8042 - add ASUS Zenbook Flip to noselftest list
Input: joydev - prevent potential read overflow in ioctl
Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S
Input: raydium_ts_i2c - do not send zero length
HID: wacom: Ignore attempts to overwrite the touch_max value from HID
HID: logitech-dj: add support for keyboard events in eQUAD step 4 Gaming
cpufreq: ACPI: Set cpuinfo.max_freq directly if max boost is known
ACPI: configfs: add missing check after configfs_register_default_group()
ACPI: property: Fix fwnode string properties matching
soundwire: intel: fix possible crash when no device is detected
blk-settings: align max_sectors on "logical_block_size" boundary
scsi: sd: Fix Opal support
ide/falconide: Fix module unload
block: reopen the device in blkdev_reread_part
scsi: sd: sd_zbc: Don't pass GFP_NOIO to kvcalloc
scsi: bnx2fc: Fix Kconfig warning & CNIC build errors
csky: Fix a size determination in gpr_get()
proc: use kvzalloc for our kernel buffer
mm/rmap: fix potential pte_unmap on an not mapped pte
mm: fix memory_failure() handling of dax-namespace metadata
mm,thp,shmem: make khugepaged obey tmpfs mount flags
i2c: exynos5: Preserve high speed master code
i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
arm64: Add missing ISB after invalidating TLB in __primary_switch
KVM: x86/mmu: Expand collapsible SPTE zap for TDP MMU to ZONE_DEVICE and HugeTLB pages
KVM: SVM: Intercept INVPCID when it's disabled to inject #UD
NFSv4: Fixes for nfs4_bitmask_adjust()
r8169: fix jumbo packet handling on RTL8168e
mm/compaction: fix misbehaviors of fast_find_migrateblock()
mm/hugetlb: suppress wrong warning info when alloc gigantic page
mm/hugetlb: fix potential double free in hugetlb_register_node() error path
mm/memory.c: fix potential pte_unmap_unlock pte error
mm: memcontrol: fix slub memory accounting
mm: memcontrol: fix NR_ANON_THPS accounting in charge moving
ocfs2: fix a use after free on error
wireguard: kconfig: use arm chacha even with no neon
wireguard: device: do not generate ICMP for non-IP packets
vxlan: move debug check after netdev unregister
PCI: rockchip: Make 'ep-gpios' DT property optional
net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
net: stmmac: fix CBS idleslope and sendslope calculation
ice: update the number of available RSS queues
ice: Fix state bits on LLDP mode switch
ice: Account for port VLAN in VF max packet size calculation
ice: report correct max number of TCs
vfio/type1: Use follow_pte()
pwm: iqs620a: Fix overflow and optimize calculations
octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()
i40e: Fix add TC filter for IPv6
nios2: fixed broken sys_clone syscall
Take mmap lock in cacheflush syscall
i40e: Fix VFs not created
i40e: Fix addition of RX filters after enabling FW LLDP agent
i40e: Fix overwriting flow control settings during driver loading
i40e: Add zero-initialization of AQ command structures
i40e: Fix flow for IPv6 next header (extension header)
PCI: cadence: Fix DMA range mapping early return error
PCI: pci-bridge-emul: Fix array overruns, improve safety
device-dax: Fix default return code of range_parse()
mailbox: sprd: correct definition of SPRD_OUTBOX_FIFO_FULL
ext: EXT4_KUNIT_TESTS should depend on EXT4_FS instead of selecting it
regmap: sdw: use _no_pm functions in regmap_read/write
remoteproc/mediatek: acknowledge watchdog IRQ after handled
misc: fastrpc: fix incorrect usage of dma_map_sgtable
soundwire: bus: fix confusion on device used by pm_runtime
soundwire: export sdw_write/read_no_pm functions
soundwire: bus: use sdw_write_no_pm when setting the bus scale registers
soundwire: bus: use sdw_update_no_pm when initializing a device
nvmem: core: skip child nodes not matching binding
nvmem: core: Fix a resource leak on error in nvmem_add_cells_from_of()
coresight: etm4x: Skip accessing TRCPDCR in save/restore
phy: USB_LGM_PHY should depend on X86
ext4: fix potential htree index checksum corruption
vfio-pci/zdev: fix possible segmentation fault issue
vfio/iommu_type1: Fix some sanity checks in detach group
vfio/iommu_type1: Populate full dirty when detach non-pinned group
drm/msm/dp: trigger unplug event in msm_dp_display_disable
drm/msm: Fix races managing the OOB state for timestamp vs timestamps.
drm/msm: Fix race of GPU init vs timestamp power management.
drm/msm/mdp5: Fix wait-for-commit for cmd panels
drm/msm/dsi: Correct io_start for MSM8994 (20nm PHY)
drm/msm: Fix MSM_INFO_GET_IOVA with carveout
mei: hbm: call mei_set_devstate() on hbm stop response
PCI: Align checking of syscall user config accessors
VMCI: Use set_page_dirty_lock() when unregistering guest memory
PCI: xilinx-cpm: Fix reference count leak on error path
pwm: rockchip: Eliminate potential race condition when probing
pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()
pwm: rockchip: Enable APB clock during register access while probing
soundwire: cadence: fix ACK/NAK handling
PCI: rcar: Always allocate MSI addresses in 32bit space
misc: eeprom_93xx46: Add module alias to avoid breaking support for non device tree users
phy: cadence-torrent: Fix error code in cdns_torrent_phy_probe()
phy: rockchip-emmc: emmc_phy_init() always return 0
misc: eeprom_93xx46: Fix module alias to enable module autoprobe
ARM: 9065/1: OABI compat: fix build when EPOLL is not enabled
Input: zinitix - fix return type of zinitix_init_touch()
sparc: fix led.c driver when PROC_FS is not enabled
sparc64: only select COMPAT_BINFMT_ELF if BINFMT_ELF is set
Input: elo - fix an error code in elo_connect()
perf test: Fix unaligned access in sample parsing test
perf intel-pt: Fix IPC with CYC threshold
perf intel-pt: Fix premature IPC
perf intel-pt: Fix missing CYC processing in PSB
perf record: Fix continue profiling after draining the buffer
Input: sur40 - fix an error code in sur40_probe()
RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR()
RDMA/rtrs-srv-sysfs: fix missing put_device
RDMA/rtrs-srv: fix memory leak by missing kobject free
RDMA/rtrs: Only allow addition of path to an already established session
RDMA/rtrs-srv: Fix stack-out-of-bounds
RDMA/ucma: Fix use-after-free bug in ucma_create_uevent
RDMA/hns: Fixes missing error code of CMDQ
ceph: fix flush_snap logic after putting caps
svcrdma: Hold private mutex while invoking rdma_accept()
nfsd: register pernet ops last, unregister first
perf symbols: Fix return value when loading PE DSO
printk: avoid prb_first_valid_seq() where possible
spi: Skip zero-length transfers in spi_transfer_one_message()
spi: dw: Avoid stack content exposure
regulator: bd718x7, bd71828, Fix dvs voltage levels
perf symbols: Use (long) for iterator for bfd symbols
selftests/ftrace: Update synthetic event syntax errors
clk: aspeed: Fix APLL calculate formula from ast2600-A2
regulator: qcom-rpmh: fix pm8009 ldo7
powerpc/kuap: Restore AMR after replaying soft interrupts
powerpc/uaccess: Avoid might_fault() when user access is enabled
spi: pxa2xx: Fix the controller numbering for Wildcat Point
clk: divider: fix initialization with parent_hw
RDMA/hns: Disable RQ inline by default
RDMA/hns: Fix type of sq_signal_bits
RDMA/siw: Fix calculation of tx_valid_cpus size
RDMA/hns: Fixed wrong judgments in the goto branch
kselftests: dmabuf-heaps: Fix Makefile's inclusion of the kernel's usr/include dir
kunit: tool: fix unit test cleanup handling
clk: qcom: gcc-msm8998: Fix Alpha PLL type for all GPLLs
powerpc/8xx: Fix software emulation interrupt
powerpc/pseries/dlpar: handle ibm, configure-connector delay status
mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq()
mfd: altera-sysmgr: Fix physical address storing more
spi: stm32: properly handle 0 byte transfer
RDMA/rxe: Correct skb on loopback path
RDMA/rxe: Fix coding error in rxe_rcv_mcast_pkt
RDMA/rxe: Fix coding error in rxe_recv.c
perf vendor events arm64: Fix Ampere eMag event typo
perf tools: Fix DSO filtering when not finding a map for a sampled address
rtc: zynqmp: depend on HAS_IOMEM
tracepoint: Do not fail unregistering a probe due to memory failure
IB/cm: Avoid a loop when device has 255 ports
IB/mlx5: Return appropriate error code instead of ENOMEM
iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping
iommu: Move iotlb_sync_map out from __iommu_map
amba: Fix resource leak for drivers without .remove
i2c: qcom-geni: Store DMA mapping data in geni_i2c_dev struct
ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores
mmc: renesas_sdhi_internal_dmac: Fix DMA buffer alignment from 8 to 128-bytes
mmc: usdhi6rol0: Fix a resource leak in the error handling path of the probe
mmc: sdhci-sprd: Fix some resource leaks in the remove function
mmc: owl-mmc: Fix a resource leak in an error handling path and in the remove function
powerpc/time: Enable sched clock for irqtime
powerpc/47x: Disable 256k page size
KVM: PPC: Make the VMX instruction emulation routines static
IB/umad: Return EPOLLERR in case of when device disassociated
IB/umad: Return EIO in case of when device disassociated
iommu: Switch gather->end to the inclusive end
scsi: lpfc: Fix ancient double free
objtool: Fix ".cold" section suffix check for newer versions of GCC
objtool: Fix retpoline detection in asm code
objtool: Fix error handling for STD/CLD warnings
auxdisplay: ht16k33: Fix refresh rate handling
watchdog: intel-mid_wdt: Postpone IRQ handler registration till SCU is ready
isofs: release buffer head before return
regulator: core: Avoid debugfs: Directory ... already present! error
power: supply: smb347-charger: Fix interrupt usage if interrupt is unavailable
power: supply: axp20x_usb_power: Init work before enabling IRQs
regulator: s5m8767: Drop regulators OF node reference
spi: atmel: Put allocated master before return
regulator: s5m8767: Fix reference count leak
certs: Fix blacklist flag type confusion
watch_queue: Drop references to /dev/watch_queue
regulator: axp20x: Fix reference cout leak
platform/chrome: cros_ec_proto: Add LID and BATTERY to default mask
platform/chrome: cros_ec_proto: Use EC_HOST_EVENT_MASK not BIT
clk: sunxi-ng: h6: Fix clock divider range on some clocks
IB/mlx5: Add mutex destroy call to cap_mask_mutex mutex
RDMA/mlx5: Use the correct obj_id upon DEVX TIR creation
spi: imx: Don't print error on -EPROBEDEFER
clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined
clocksource/drivers/ixp4xx: Select TIMER_OF when needed
power: supply: fix sbs-charger build, needs REGMAP_I2C
dmaengine: idxd: set DMA channel to be private
rtc: s5m: select REGMAP_I2C
power: reset: at91-sama5d2_shdwc: fix wkupdbc mask
RDMA/rtrs-srv: Init wr_cnt as 1
RDMA/rtrs-clt: Refactor the failure cases in alloc_clt
RDMA/rtrs-srv: Fix missing wr_cqe
RDMA/rtrs: Call kobject_put in the failure path
RDMA/rtrs-clt: Set mininum limit when create QP
RDMA/rtrs-srv: Use sysfs_remove_file_self for disconnect
RDMA/rtrs-srv: Release lock before call into close_sess
RDMA/rtrs: Extend ibtrs_cq_qp_create
of/fdt: Make sure no-map does not remove already reserved regions
fdt: Properly handle "no-map" field in the memory region
power: supply: cpcap-charger: Fix power_supply_put on null battery pointer
power: supply: cpcap-battery: Fix missing power_supply_put()
power: supply: cpcap-charger: Fix missing power_supply_put()
mfd: bd9571mwv: Use devm_mfd_add_devices()
dmaengine: hsu: disable spurious interrupt
dmaengine: owl-dma: Fix a resource leak in the remove function
dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function
dmaengine: fsldma: Fix a resource leak in the remove function
RDMA/siw: Fix handling of zero-sized Read and Receive Queues.
HID: core: detect and skip invalid inputs to snto32()
clk: renesas: r8a779a0: Fix parent of CBFUSA clock
clk: renesas: r8a779a0: Remove non-existent S2 clock
clk: sunxi-ng: h6: Fix CEC clock
spi: cadence-quadspi: Abort read if dummy cycles required are too many
i2c: iproc: handle master read request
i2c: iproc: update slave isr mask (ISR_MASK_SLAVE)
i2c: iproc: handle only slave interrupts which are enabled
quota: Fix memory leak when handling corrupted quota file
arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators
regulator: qcom-rpmh-regulator: add pm8009-1 chip revision
selftests/powerpc: Make the test check in eeh-basic.sh posix compliant
clk: meson: clk-pll: propagate the error from meson_clk_pll_set_rate()
clk: meson: clk-pll: make "ret" a signed integer
clk: meson: clk-pll: fix initializing the old rate (fallback) for a PLL
power: supply: cpcap: Add missing IRQF_ONESHOT to fix regression
HSI: Fix PM usage counter unbalance in ssi_hw_init
capabilities: Don't allow writing ambiguous v3 file capabilities
drm/amdgpu/display: remove hdcp_srm sysfs on device removal
smp: Process pending softirqs in flush_smp_call_function_from_idle()
irqchip/imx: IMX_INTMUX should not default to y, unconditionally
ubifs: Fix error return code in alloc_wbufs()
ubifs: replay: Fix high stack usage, again
ubifs: Fix memleak in ubifs_init_authentication
jffs2: fix use after free in jffs2_sum_write_data()
fs/jfs: fix potential integer overflow on shift of a int
ASoC: simple-card-utils: Fix device module clock
ima: Free IMA measurement buffer after kexec syscall
ima: Free IMA measurement buffer on error
ASoC: SOF: sof-pci-dev: add missing Up-Extreme quirk
nvmet: set status to 0 in case for invalid nsid
nvmet: remove extra variable in identify ns
nvme-multipath: set nr_zones for zoned namespaces
nvmet-tcp: fix potential race of tcp socket closing accept_work
nvmet-tcp: fix receive data digest calculation for multiple h2cdata PDUs
io_uring: fix possible deadlock in io_uring_poll
crypto: ecdh_helper - Ensure 'len >= secret.len' in decode_key()
hwrng: timeriomem - Fix cooldown period calculation
drm/dp_mst: Don't cache EDIDs for physical ports
drm/lima: fix reference leak in lima_pm_busy
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
drm/vc4: hdmi: Restore cec physical address on reconnect
drm/vc4: hdmi: Fix up CEC registers
drm/vc4: hdmi: Fix register offset with longer CEC messages
drm/vc4: hdmi: Move hdmi reset to bind
s390/zcrypt: return EIO when msg retry limit reached
KVM: x86: Restore all 64 bits of DR6 and DR7 during RSM on x86-64
btrfs: fix double accounting of ordered extent for subpage case in btrfs_invalidapge
btrfs: clarify error returns values in __load_free_space_cache
ASoC: SOF: debug: Fix a potential issue on string buffer termination
ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown
ASoC: qcom: lpass: Fix i2s ctl register bit map
locking/lockdep: Avoid unmatched unlock
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A3E
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A5E
Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind()
drm/mediatek: Check if fb is null
KVM: nSVM: Don't strip host's C-bit from guest's CR3 when reading PDPTRs
ASoC: qcom: Fix typo error in HDMI regmap config callbacks
f2fs: fix a wrong condition in __submit_bio
drm/amdgpu: Prevent shift wrapping in amdgpu_read_mask()
f2fs: fix to avoid inconsistent quota data
mtd: parsers: afs: Fix freeing the part name memory in failure
ASoC: codecs: add missing max_register in regmap config
ASoC: cpcap: fix microphone timeslot mask
ata: ahci_brcm: Add back regulators management
mm: proc: Invalidate TLB after clearing soft-dirty page state
drm/nouveau: bail out of nouveau_channel_new if channel init fails
crypto: talitos - Fix ctr(aes) on SEC1
crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error)
mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()
perf/arm-cmn: Move IRQs when migrating context
perf/arm-cmn: Fix PMU instance naming
ASoC: SOF: Intel: hda: cancel D0i3 work during runtime suspend
ASoC: qcom: lpass-cpu: Remove bit clock state check
f2fs: compress: fix potential deadlock
sched/eas: Don't update misfit status if the task is pinned
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values
media: pxa_camera: declare variable when DEBUG is defined
media: mtk-vcodec: fix argument used when DEBUG is defined
media: cx25821: Fix a bug when reallocating some dma memory
media: qm1d1c0042: fix error return code in qm1d1c0042_init()
media: atomisp: Fix a buffer overflow in debug code
media: vidtv: psi: fix missing crc for PMT
media: lmedm04: Fix misuse of comma
media: software_node: Fix refcounts in software_node_get_next_child()
drm/amd/display: Fix HDMI deep color output for DCE 6-11.
drm/amd/display: Fix 10/12 bpc setup in DCE output bit depth reduction.
macintosh/adb-iop: Use big-endian autopoll mask
bsg: free the request before return error code
drm/amdgpu: toggle on DF Cstate after finishing xgmi injection
drm/tegra: Fix reference leak when pm_runtime_get_sync() fails
MIPS: Compare __SYNC_loongson3_war against 0
MIPS: properly stop .eh_frame generation
media: ti-vpe: cal: fix write to unallocated memory
media: imx7: csi: Fix pad link validation
media: imx7: csi: Fix regression for parallel cameras on i.MX6UL
drm/sun4i: tcon: fix inverted DCLK polarity
sched/fair: Avoid stale CPU util_est value for schedutil in task dequeue
crypto: bcm - Rename struct device_private to bcm_device_private
evm: Fix memleak in init_desc
ASoC: qcom: qdsp6: Move frontend AIFs to q6asm-dai
ASoC: cs42l56: fix up error handling in probe
media: aspeed: fix error return code in aspeed_video_setup_video()
media: tm6000: Fix memleak in tm6000_start_stream
media: media/pci: Fix memleak in empress_init
media: em28xx: Fix use-after-free in em28xx_alloc_urbs
media: vsp1: Fix an error handling path in the probe function
media: camss: missing error code in msm_video_register()
media: mtk-vcodec: fix error return code in vdec_vp9_decode()
media: imx: Fix csc/scaler unregister
media: imx: Unregister csc/scaler only if registered
media: i2c: ov5670: Fix PIXEL_RATE minimum value
media: ipu3-cio2: Build only for x86
drm/fourcc: fix Amlogic format modifier masks
drm/virtio: make sure context is created in gem open
MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0
MIPS: c-r4k: Fix section mismatch for loongson2_sc_init
drm/amdgpu: Fix macro name _AMDGPU_TRACE_H_ in preprocessor if condition
drm: rcar-du: Fix the return check of of_parse_phandle and of_find_device_by_node
drm: rcar-du: Fix crash when using LVDS1 clock for CRTC
drm: rcar-du: Fix PM reference leak in rcar_cmm_enable()
kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state()
media: allegro: Fix use after free on error
hwrng: ingenic - Fix a resource leak in an error handling path
crypto: arm64/aes-ce - really hide slower algos when faster ones are enabled
crypto: sun4i-ss - fix kmap usage
crypto: sun4i-ss - linearize buffers content must be kept
drm/vc4: hdmi: Take into account the clock doubling flag in atomic_check
drm/panel: mantix: Tweak init sequence
drm/fb-helper: Add missed unlocks in setcmap_legacy()
gma500: clean up error handling in init
drm/gma500: Fix error return code in psb_driver_load()
fbdev: aty: SPARC64 requires FB_ATY_CT
tty: implement read_iter
tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer
net: enetc: fix destroyed phylink dereference during unbind
net: mvneta: Remove per-cpu queue mapping for Armada 3700
net: amd-xgbe: Fix network fluctuations when using 1G BELFUSE SFP
net: amd-xgbe: Reset link when the link never comes back
net: amd-xgbe: Fix NETDEV WATCHDOG transmit queue timeout warning
net: amd-xgbe: Reset the PHY rx data path when mailbox command timeout
net: phy: mscc: adding LCPLL reset to VSC8514
net: dsa: felix: don't deinitialize unused ports
net: dsa: felix: perform teardown in reverse order of setup
ibmvnic: skip send_request_unmap for timeout reset
ibmvnic: add memory barrier to protect long term buffer
bpf: Clear subreg_def for global function return values
b43: N-PHY: Fix the update of coef for the PHY revision >= 3case
cxgb4/chtls/cxgbit: Keeping the max ofld immediate data size same in cxgb4 and ulds
net: axienet: Handle deferred probe on clock properly
tcp: fix SO_RCVLOWAT related hangs under mem pressure
selftests: mptcp: fix ACKRX debug message
bpf: Fix bpf_fib_lookup helper MTU check for SKB ctx
bpf, devmap: Use GFP_KERNEL for xdp bulk queue allocation
bpf: Fix an unitialized value in bpf_iter
libbpf: Ignore non function pointer member in struct_ops
mac80211: fix potential overflow when multiplying to u32 integers
net/mlx5e: Check tunnel offload is required before setting SWP
net/mlx5e: CT: manage the lifetime of the ct entry object
net/mlx5: Disable devlink reload for lag devices
net/mlx5: Disallow RoCE on lag device
net/mlx5: Disallow RoCE on multi port slave device
net/mlx5: Disable devlink reload for multi port slave device
net/mlx5e: kTLS, Use refcounts to free kTLS RX priv context
net/mlx5e: Replace synchronize_rcu with synchronize_net
net/mlx5: Fix health error state handling
net/mlx5e: Change interrupt moderation channel params also when channels are closed
net/mlx5e: Don't change interrupt moderation params when DIM is enabled
net: phy: consider that suspend2ram may cut off PHY power
dpaa2-eth: fix memory leak in XDP_REDIRECT
xen/netback: fix spurious event detection for common event case
bnxt_en: Fix devlink info's stored fw.psid version format.
bnxt_en: reverse order of TX disable and carrier off
ibmvnic: Set to CLOSED state even on error
selftests/bpf: Convert test_xdp_redirect.sh to bash
ath9k: fix data bus crash when setting nf_override via debugfs
iwlwifi: pnvm: increment the pointer before checking the TLV
iwlwifi: pnvm: set the PNVM again if it was already loaded
bpf_lru_list: Read double-checked variable once without lock
iwlwifi: mvm: don't check if CSA event is running before removing
iwlwifi: mvm: assign SAR table revision to the command later
iwlwifi: mvm: send stored PPAG command instead of local
iwlwifi: mvm: store PPAG enabled/disabled flag properly
iwlwifi: mvm: fix the type we use in the PPAG table validity checks
soc: aspeed: snoop: Add clock control logic
ath11k: fix a locking bug in ath11k_mac_op_start()
ath10k: Fix lockdep assertion warning in ath10k_sta_statistics
ath10k: Fix suspicious RCU usage warning in ath10k_wmi_tlv_parse_peer_stats_info()
ARM: at91: use proper asm syntax in pm_suspend
staging: wfx: fix possible panic with re-queued frames
optee: simplify i2c access
ARM: s3c: fix fiq for clang IAS
iwlwifi: mvm: set enabled in the PPAG command properly
arm64: dts: meson: fix broken wifi node for Khadas VIM3L
arm64: dts: msm8916: Fix reserved and rfsa nodes unit address
soc: qcom: ocmem: don't return NULL in of_get_ocmem
Bluetooth: btusb: Fix memory leak in btusb_mtk_wmt_recv
opp: Correct debug message in _opp_add_static_v2()
arm64: dts: armada-3720-turris-mox: rename u-boot mtd partition to a53-firmware
ARM: dts: armada388-helios4: assign pinctrl to each fan
ARM: dts: armada388-helios4: assign pinctrl to LEDs
can: mcp251xfd: mcp251xfd_probe(): fix errata reference
arm64: dts: renesas: beacon: Fix EEPROM compatible value
x86/MSR: Filter MSR writes through X86_IOC_WRMSR_REGS ioctl too
staging: rtl8723bs: wifi_regd.c: Fix incorrect number of regulatory rules
usb: dwc2: Make "trimming xfer length" a debug message
usb: dwc2: Abort transaction after errors with unknown reason
usb: dwc2: Do not update data length if it is 0 on inbound transfers
ARM: dts: Configure missing thermal interrupt for 4430
memory: ti-aemif: Drop child node when jumping out loop
Bluetooth: Put HCI device if inquiry procedure interrupts
Bluetooth: drop HCI device reference before return
staging: media: atomisp: Fix size_t format specifier in hmm_alloc() debug statemenet
soc: ti: pm33xx: Fix some resource leak in the error handling paths of the probe function
soc: qcom: socinfo: Fix an off by one in qcom_show_pmic_model()
arm64: dts: qcom: sdm845-db845c: Fix reset-pin of ov8856 node
usb: gadget: u_audio: Free requests only after callback
ACPICA: Fix exception code class checks
arm64: dts: rockchip: rk3328: Add clock_in_out property to gmac2phy node
cpufreq: brcmstb-avs-cpufreq: Fix resource leaks in ->remove()
cpufreq: brcmstb-avs-cpufreq: Free resources in error path
arm64: dts: qcom: msm8916-samsung-a2015: Fix sensors
arm64: dts: allwinner: A64: Limit MMC2 bus frequency to 150 MHz
arm64: dts: allwinner: H6: Allow up to 150 MHz MMC bus frequency
arm64: dts: allwinner: Drop non-removable from SoPine/LTS SD card
arm64: dts: allwinner: H6: properly connect USB PHY to port 0
arm64: dts: allwinner: A64: properly connect USB PHY to port 0
firmware: arm_scmi: Fix call site of scmi_notification_exit
bpf: Avoid warning when re-casting __bpf_call_base into __bpf_call_base_args
bpf: Add bpf_patch_call_args prototype to include/linux/bpf.h
net: stmmac: dwmac-meson8b: fix enabling the timing-adjustment clock
arm64: dts: qcom: msm8916-samsung-a5u: Fix iris compatible
staging: vchiq: Fix bulk transfers on 64-bit builds
staging: vchiq: Fix bulk userdata handling
Bluetooth: hci_qca: Fix memleak in qca_controller_memdump
memory: mtk-smi: Fix PM usage counter unbalance in mtk_smi ops
arm64: dts: exynos: correct PMIC interrupt trigger level on Espresso
arm64: dts: exynos: correct PMIC interrupt trigger level on TM2
ARM: dts: exynos: correct PMIC interrupt trigger level on Odroid XU3 family
ARM: dts: exynos: correct PMIC interrupt trigger level on Arndale Octa
ARM: dts: exynos: correct PMIC interrupt trigger level on Spring
ARM: dts: exynos: correct PMIC interrupt trigger level on Rinato
ARM: dts: exynos: correct PMIC interrupt trigger level on Monk
ARM: dts: exynos: correct PMIC interrupt trigger level on Artik 5
arm64: dts: renesas: beacon: Fix audio-1.8V pin enable
arm64: dts: renesas: beacon kit: Fix choppy Bluetooth Audio
Bluetooth: Fix initializing response id after clearing struct
Bluetooth: hci_uart: Fix a race for write_work scheduling
Bluetooth: btqcomsmd: Fix a resource leak in error handling paths in the probe function
ath10k: Fix error handling in case of CE pipe init failure
drm/i915/gt: One more flush for Baytrail clear residuals
ALSA: pcm: Don't call sync_stop if it hasn't been stopped
ALSA: pcm: Assure sync with the pending stop operation at suspend
ALSA: pcm: Call sync_stop at disconnection
random: fix the RNDRESEEDCRNG ioctl
vmlinux.lds.h: Define SANTIZER_DISCARDS with CONFIG_GCOV_KERNEL=y
MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section
ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc mode
bfq: Avoid false bfq queue merging
virt: vbox: Do not use wait_event_interruptible when called from kernel context
PCI: Decline to resize resources if boot config must be preserved
PCI: qcom: Use PHY_REFCLK_USE_PAD only for ipq8064
w1: w1_therm: Fix conversion result for negative temperatures
kdb: Make memory allocations more robust
scsi: qla2xxx: Fix mailbox Ch erroneous error
scsi: libsas: docs: Remove notify_ha_event()
debugfs: do not attempt to create a new file before the filesystem is initalized
debugfs: be more robust at handling improper input in debugfs_lookup()
vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()
vmlinux.lds.h: add DWARF v5 sections
Conflicts:
Documentation/devicetree/bindings
Documentation/devicetree/bindings/net/btusb.txt
Documentation/devicetree/bindings/net/ethernet-controller.yaml
drivers/cpufreq/qcom-cpufreq-hw.c
drivers/nvmem/qcom-spmi-sdam.c
drivers/soc/qcom/socinfo.c
drivers/spmi/spmi-pmic-arb.c
net/qrtr/tun.c
Change-Id: I5a14e8d8d00a40af0a0e022ad85996f1351704f4
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2042 lines
66 KiB
Makefile
2042 lines
66 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
VERSION = 5
|
|
PATCHLEVEL = 10
|
|
SUBLEVEL = 21
|
|
EXTRAVERSION =
|
|
NAME = Dare mighty things
|
|
|
|
# *DOCUMENTATION*
|
|
# To see a list of typical targets execute "make help"
|
|
# More info can be located in ./README
|
|
# Comments in this file are targeted only to the developer, do not
|
|
# expect to learn how to build the kernel reading this file.
|
|
|
|
$(if $(filter __%, $(MAKECMDGOALS)), \
|
|
$(error targets prefixed with '__' are only for internal use))
|
|
|
|
# That's our default target when none is given on the command line
|
|
PHONY := __all
|
|
__all:
|
|
|
|
# We are using a recursive build, so we need to do a little thinking
|
|
# to get the ordering right.
|
|
#
|
|
# Most importantly: sub-Makefiles should only ever modify files in
|
|
# their own directory. If in some directory we have a dependency on
|
|
# a file in another dir (which doesn't happen often, but it's often
|
|
# unavoidable when linking the built-in.a targets which finally
|
|
# turn into vmlinux), we will call a sub make in that other dir, and
|
|
# after that we are sure that everything which is in that other dir
|
|
# is now up to date.
|
|
#
|
|
# The only cases where we need to modify files which have global
|
|
# effects are thus separated out and done before the recursive
|
|
# descending is started. They are now explicitly listed as the
|
|
# prepare rule.
|
|
|
|
ifneq ($(sub_make_done),1)
|
|
|
|
# Do not use make's built-in rules and variables
|
|
# (this increases performance and avoids hard-to-debug behaviour)
|
|
MAKEFLAGS += -rR
|
|
|
|
# Avoid funny character set dependencies
|
|
unexport LC_ALL
|
|
LC_COLLATE=C
|
|
LC_NUMERIC=C
|
|
export LC_COLLATE LC_NUMERIC
|
|
|
|
# Avoid interference with shell env settings
|
|
unexport GREP_OPTIONS
|
|
|
|
# Beautify output
|
|
# ---------------------------------------------------------------------------
|
|
#
|
|
# Normally, we echo the whole command before executing it. By making
|
|
# that echo $($(quiet)$(cmd)), we now have the possibility to set
|
|
# $(quiet) to choose other forms of output instead, e.g.
|
|
#
|
|
# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
|
|
# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
|
#
|
|
# If $(quiet) is empty, the whole command will be printed.
|
|
# If it is set to "quiet_", only the short version will be printed.
|
|
# If it is set to "silent_", nothing will be printed at all, since
|
|
# the variable $(silent_cmd_cc_o_c) doesn't exist.
|
|
#
|
|
# A simple variant is to prefix commands with $(Q) - that's useful
|
|
# for commands that shall be hidden in non-verbose mode.
|
|
#
|
|
# $(Q)ln $@ :<
|
|
#
|
|
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
|
|
# If KBUILD_VERBOSE equals 1 then the above command is displayed.
|
|
# If KBUILD_VERBOSE equals 2 then give the reason why each target is rebuilt.
|
|
#
|
|
# To put more focus on warnings, be less verbose as default
|
|
# Use 'make V=1' to see the full commands
|
|
|
|
ifeq ("$(origin V)", "command line")
|
|
KBUILD_VERBOSE = $(V)
|
|
endif
|
|
ifndef KBUILD_VERBOSE
|
|
KBUILD_VERBOSE = 0
|
|
endif
|
|
|
|
ifeq ($(KBUILD_VERBOSE),1)
|
|
quiet =
|
|
Q =
|
|
else
|
|
quiet=quiet_
|
|
Q = @
|
|
endif
|
|
|
|
# If the user is running make -s (silent mode), suppress echoing of
|
|
# commands
|
|
|
|
ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
|
|
quiet=silent_
|
|
endif
|
|
|
|
export quiet Q KBUILD_VERBOSE
|
|
|
|
# Kbuild will save output files in the current working directory.
|
|
# This does not need to match to the root of the kernel source tree.
|
|
#
|
|
# For example, you can do this:
|
|
#
|
|
# cd /dir/to/store/output/files; make -f /dir/to/kernel/source/Makefile
|
|
#
|
|
# If you want to save output files in a different location, there are
|
|
# two syntaxes to specify it.
|
|
#
|
|
# 1) O=
|
|
# Use "make O=dir/to/store/output/files/"
|
|
#
|
|
# 2) Set KBUILD_OUTPUT
|
|
# Set the environment variable KBUILD_OUTPUT to point to the output directory.
|
|
# export KBUILD_OUTPUT=dir/to/store/output/files/; make
|
|
#
|
|
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
|
|
# variable.
|
|
|
|
# Do we want to change the working directory?
|
|
ifeq ("$(origin O)", "command line")
|
|
KBUILD_OUTPUT := $(O)
|
|
endif
|
|
|
|
ifneq ($(KBUILD_OUTPUT),)
|
|
# Make's built-in functions such as $(abspath ...), $(realpath ...) cannot
|
|
# expand a shell special character '~'. We use a somewhat tedious way here.
|
|
abs_objtree := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && pwd)
|
|
$(if $(abs_objtree),, \
|
|
$(error failed to create output directory "$(KBUILD_OUTPUT)"))
|
|
|
|
# $(realpath ...) resolves symlinks
|
|
abs_objtree := $(realpath $(abs_objtree))
|
|
else
|
|
abs_objtree := $(CURDIR)
|
|
endif # ifneq ($(KBUILD_OUTPUT),)
|
|
|
|
ifeq ($(abs_objtree),$(CURDIR))
|
|
# Suppress "Entering directory ..." unless we are changing the work directory.
|
|
MAKEFLAGS += --no-print-directory
|
|
else
|
|
need-sub-make := 1
|
|
endif
|
|
|
|
abs_srctree := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
|
|
|
|
ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
|
|
$(error source directory cannot contain spaces or colons)
|
|
endif
|
|
|
|
ifneq ($(abs_srctree),$(abs_objtree))
|
|
# Look for make include files relative to root of kernel src
|
|
#
|
|
# This does not become effective immediately because MAKEFLAGS is re-parsed
|
|
# once after the Makefile is read. We need to invoke sub-make.
|
|
MAKEFLAGS += --include-dir=$(abs_srctree)
|
|
need-sub-make := 1
|
|
endif
|
|
|
|
this-makefile := $(lastword $(MAKEFILE_LIST))
|
|
|
|
ifneq ($(filter 3.%,$(MAKE_VERSION)),)
|
|
# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
|
|
# We need to invoke sub-make to avoid implicit rules in the top Makefile.
|
|
need-sub-make := 1
|
|
# Cancel implicit rules for this Makefile.
|
|
$(this-makefile): ;
|
|
endif
|
|
|
|
export abs_srctree abs_objtree
|
|
export sub_make_done := 1
|
|
|
|
ifeq ($(need-sub-make),1)
|
|
|
|
PHONY += $(MAKECMDGOALS) __sub-make
|
|
|
|
$(filter-out $(this-makefile), $(MAKECMDGOALS)) __all: __sub-make
|
|
@:
|
|
|
|
# Invoke a second make in the output directory, passing relevant variables
|
|
__sub-make:
|
|
$(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
|
|
|
|
endif # need-sub-make
|
|
endif # sub_make_done
|
|
|
|
# We process the rest of the Makefile if this is the final invocation of make
|
|
ifeq ($(need-sub-make),)
|
|
|
|
# Do not print "Entering directory ...",
|
|
# but we want to display it when entering to the output directory
|
|
# so that IDEs/editors are able to understand relative filenames.
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
# Call a source code checker (by default, "sparse") as part of the
|
|
# C compilation.
|
|
#
|
|
# Use 'make C=1' to enable checking of only re-compiled files.
|
|
# Use 'make C=2' to enable checking of *all* source files, regardless
|
|
# of whether they are re-compiled or not.
|
|
#
|
|
# See the file "Documentation/dev-tools/sparse.rst" for more details,
|
|
# including where to get the "sparse" utility.
|
|
|
|
ifeq ("$(origin C)", "command line")
|
|
KBUILD_CHECKSRC = $(C)
|
|
endif
|
|
ifndef KBUILD_CHECKSRC
|
|
KBUILD_CHECKSRC = 0
|
|
endif
|
|
|
|
# Use make M=dir or set the environment variable KBUILD_EXTMOD to specify the
|
|
# directory of external module to build. Setting M= takes precedence.
|
|
ifeq ("$(origin M)", "command line")
|
|
KBUILD_EXTMOD := $(M)
|
|
endif
|
|
|
|
$(if $(word 2, $(KBUILD_EXTMOD)), \
|
|
$(error building multiple external modules is not supported))
|
|
|
|
export KBUILD_CHECKSRC KBUILD_EXTMOD
|
|
|
|
extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
|
|
|
|
ifeq ($(abs_srctree),$(abs_objtree))
|
|
# building in the source tree
|
|
srctree := .
|
|
building_out_of_srctree :=
|
|
else
|
|
ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
|
|
# building in a subdirectory of the source tree
|
|
srctree := ..
|
|
else
|
|
srctree := $(abs_srctree)
|
|
endif
|
|
building_out_of_srctree := 1
|
|
endif
|
|
|
|
ifneq ($(KBUILD_ABS_SRCTREE),)
|
|
srctree := $(abs_srctree)
|
|
endif
|
|
|
|
objtree := .
|
|
VPATH := $(srctree)
|
|
|
|
export building_out_of_srctree srctree objtree VPATH
|
|
|
|
# To make sure we do not include .config for any of the *config targets
|
|
# catch them early, and hand them over to scripts/kconfig/Makefile
|
|
# It is allowed to specify more targets when calling make, including
|
|
# mixing *config targets and build targets.
|
|
# For example 'make oldconfig all'.
|
|
# Detect when mixed targets is specified, and make a second invocation
|
|
# of make so .config is not included in this case either (for *config).
|
|
|
|
version_h := include/generated/uapi/linux/version.h
|
|
old_version_h := include/linux/version.h
|
|
|
|
clean-targets := %clean mrproper cleandocs
|
|
no-dot-config-targets := $(clean-targets) \
|
|
cscope gtags TAGS tags help% %docs check% coccicheck \
|
|
$(version_h) headers headers_% archheaders archscripts \
|
|
%asm-generic kernelversion %src-pkg dt_binding_check \
|
|
outputmakefile
|
|
no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease
|
|
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
|
|
|
|
config-build :=
|
|
mixed-build :=
|
|
need-config := 1
|
|
may-sync-config := 1
|
|
single-build :=
|
|
|
|
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
|
|
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
|
|
need-config :=
|
|
endif
|
|
endif
|
|
|
|
ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
|
|
ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
|
|
may-sync-config :=
|
|
endif
|
|
endif
|
|
|
|
ifneq ($(KBUILD_EXTMOD),)
|
|
may-sync-config :=
|
|
endif
|
|
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
ifneq ($(filter %config,$(MAKECMDGOALS)),)
|
|
config-build := 1
|
|
ifneq ($(words $(MAKECMDGOALS)),1)
|
|
mixed-build := 1
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
# We cannot build single targets and the others at the same time
|
|
ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
|
|
single-build := 1
|
|
ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
|
|
mixed-build := 1
|
|
endif
|
|
endif
|
|
|
|
# For "make -j clean all", "make -j mrproper defconfig all", etc.
|
|
ifneq ($(filter $(clean-targets),$(MAKECMDGOALS)),)
|
|
ifneq ($(filter-out $(clean-targets),$(MAKECMDGOALS)),)
|
|
mixed-build := 1
|
|
endif
|
|
endif
|
|
|
|
# install and modules_install need also be processed one by one
|
|
ifneq ($(filter install,$(MAKECMDGOALS)),)
|
|
ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
|
|
mixed-build := 1
|
|
endif
|
|
endif
|
|
|
|
ifdef mixed-build
|
|
# ===========================================================================
|
|
# We're called with mixed targets (*config and build targets).
|
|
# Handle them one by one.
|
|
|
|
PHONY += $(MAKECMDGOALS) __build_one_by_one
|
|
|
|
$(MAKECMDGOALS): __build_one_by_one
|
|
@:
|
|
|
|
__build_one_by_one:
|
|
$(Q)set -e; \
|
|
for i in $(MAKECMDGOALS); do \
|
|
$(MAKE) -f $(srctree)/Makefile $$i; \
|
|
done
|
|
|
|
else # !mixed-build
|
|
|
|
include scripts/Kbuild.include
|
|
|
|
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
|
|
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
|
|
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
|
|
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
|
|
|
|
include scripts/subarch.include
|
|
|
|
# Cross compiling and selecting different set of gcc/bin-utils
|
|
# ---------------------------------------------------------------------------
|
|
#
|
|
# When performing cross compilation for other architectures ARCH shall be set
|
|
# to the target architecture. (See arch/* for the possibilities).
|
|
# ARCH can be set during invocation of make:
|
|
# make ARCH=ia64
|
|
# Another way is to have ARCH set in the environment.
|
|
# The default ARCH is the host where make is executed.
|
|
|
|
# CROSS_COMPILE specify the prefix used for all executables used
|
|
# during compilation. Only gcc and related bin-utils executables
|
|
# are prefixed with $(CROSS_COMPILE).
|
|
# CROSS_COMPILE can be set on the command line
|
|
# make CROSS_COMPILE=ia64-linux-
|
|
# Alternatively CROSS_COMPILE can be set in the environment.
|
|
# Default value for CROSS_COMPILE is not to prefix executables
|
|
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
|
|
ARCH ?= $(SUBARCH)
|
|
|
|
# Architecture as present in compile.h
|
|
UTS_MACHINE := $(ARCH)
|
|
SRCARCH := $(ARCH)
|
|
|
|
# Additional ARCH settings for x86
|
|
ifeq ($(ARCH),i386)
|
|
SRCARCH := x86
|
|
endif
|
|
ifeq ($(ARCH),x86_64)
|
|
SRCARCH := x86
|
|
endif
|
|
|
|
# Additional ARCH settings for sparc
|
|
ifeq ($(ARCH),sparc32)
|
|
SRCARCH := sparc
|
|
endif
|
|
ifeq ($(ARCH),sparc64)
|
|
SRCARCH := sparc
|
|
endif
|
|
|
|
# Additional ARCH settings for sh
|
|
ifeq ($(ARCH),sh64)
|
|
SRCARCH := sh
|
|
endif
|
|
|
|
KCONFIG_CONFIG ?= .config
|
|
export KCONFIG_CONFIG
|
|
|
|
# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
|
|
export KBUILD_DEFCONFIG := defconfig
|
|
|
|
# SHELL used by kbuild
|
|
CONFIG_SHELL := sh
|
|
|
|
HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
|
|
HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
|
|
HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
|
|
|
|
ifneq ($(LLVM),)
|
|
HOSTCC = clang
|
|
HOSTCXX = clang++
|
|
else
|
|
HOSTCC = gcc
|
|
HOSTCXX = g++
|
|
endif
|
|
|
|
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
|
-O2 -fomit-frame-pointer -std=gnu89
|
|
export KBUILD_USERLDFLAGS :=
|
|
|
|
KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
|
|
KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
|
|
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
|
|
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
|
|
|
|
# Make variables (CC, etc...)
|
|
CPP = $(CC) -E
|
|
ifneq ($(LLVM),)
|
|
CC = clang
|
|
LD = ld.lld
|
|
AR = llvm-ar
|
|
NM = llvm-nm
|
|
OBJCOPY = llvm-objcopy
|
|
OBJDUMP = llvm-objdump
|
|
READELF = llvm-readelf
|
|
STRIP = llvm-strip
|
|
KBUILD_HOSTLDFLAGS += -fuse-ld=lld --rtlib=compiler-rt
|
|
else
|
|
CC = $(CROSS_COMPILE)gcc
|
|
LD = $(CROSS_COMPILE)ld
|
|
AR = $(CROSS_COMPILE)ar
|
|
NM = $(CROSS_COMPILE)nm
|
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
OBJDUMP = $(CROSS_COMPILE)objdump
|
|
READELF = $(CROSS_COMPILE)readelf
|
|
STRIP = $(CROSS_COMPILE)strip
|
|
endif
|
|
PAHOLE = pahole
|
|
RESOLVE_BTFIDS = $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
|
|
LEX = flex
|
|
YACC = bison
|
|
AWK = awk
|
|
INSTALLKERNEL := installkernel
|
|
DEPMOD = depmod
|
|
PERL = perl
|
|
PYTHON = python
|
|
PYTHON3 = python3
|
|
CHECK = sparse
|
|
BASH = bash
|
|
KGZIP = gzip
|
|
KBZIP2 = bzip2
|
|
KLZOP = lzop
|
|
LZMA = lzma
|
|
LZ4 = lz4
|
|
XZ = xz
|
|
ZSTD = zstd
|
|
|
|
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
|
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
|
NOSTDINC_FLAGS :=
|
|
CFLAGS_MODULE =
|
|
AFLAGS_MODULE =
|
|
LDFLAGS_MODULE =
|
|
CFLAGS_KERNEL =
|
|
AFLAGS_KERNEL =
|
|
LDFLAGS_vmlinux =
|
|
|
|
# Use USERINCLUDE when you must reference the UAPI directories only.
|
|
USERINCLUDE := \
|
|
-I$(srctree)/arch/$(SRCARCH)/include/uapi \
|
|
-I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
|
|
-I$(srctree)/include/uapi \
|
|
-I$(objtree)/include/generated/uapi \
|
|
-include $(srctree)/include/linux/kconfig.h
|
|
|
|
# Use LINUXINCLUDE when you must reference the include/ directory.
|
|
# Needed to be compatible with the O= option
|
|
LINUXINCLUDE := \
|
|
-I$(srctree)/arch/$(SRCARCH)/include \
|
|
-I$(objtree)/arch/$(SRCARCH)/include/generated \
|
|
$(if $(building_out_of_srctree),-I$(srctree)/include) \
|
|
-I$(objtree)/include \
|
|
$(USERINCLUDE)
|
|
|
|
KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
|
|
KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
|
|
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
|
-Werror=implicit-function-declaration -Werror=implicit-int \
|
|
-Werror=return-type -Wno-format-security \
|
|
-std=gnu89
|
|
KBUILD_CPPFLAGS := -D__KERNEL__
|
|
KBUILD_AFLAGS_KERNEL :=
|
|
KBUILD_CFLAGS_KERNEL :=
|
|
KBUILD_AFLAGS_MODULE := -DMODULE
|
|
KBUILD_CFLAGS_MODULE := -DMODULE
|
|
KBUILD_LDFLAGS_MODULE :=
|
|
KBUILD_LDFLAGS :=
|
|
CLANG_FLAGS :=
|
|
|
|
CC := $(srctree)/scripts/gcc-wrapper.py $(CC)
|
|
|
|
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
|
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
|
export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
|
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
|
|
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
|
|
|
|
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
|
|
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
|
|
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
|
|
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
|
|
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
|
|
|
|
# Files to ignore in find ... statements
|
|
|
|
export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
|
|
-name CVS -o -name .pc -o -name .hg -o -name .git \) \
|
|
-prune -o
|
|
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
|
|
--exclude CVS --exclude .pc --exclude .hg --exclude .git
|
|
|
|
# ===========================================================================
|
|
# Rules shared between *config targets and build targets
|
|
|
|
# Basic helpers built in scripts/basic/
|
|
PHONY += scripts_basic
|
|
scripts_basic:
|
|
$(Q)$(MAKE) $(build)=scripts/basic
|
|
$(Q)rm -f .tmp_quiet_recordmcount
|
|
|
|
PHONY += outputmakefile
|
|
# Before starting out-of-tree build, make sure the source tree is clean.
|
|
# outputmakefile generates a Makefile in the output directory, if using a
|
|
# separate output directory. This allows convenient use of make in the
|
|
# output directory.
|
|
# At the same time when output Makefile generated, generate .gitignore to
|
|
# ignore whole output directory
|
|
outputmakefile:
|
|
ifdef building_out_of_srctree
|
|
$(Q)if [ -f $(srctree)/.config -o \
|
|
-d $(srctree)/include/config -o \
|
|
-d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
|
|
echo >&2 "***"; \
|
|
echo >&2 "*** The source tree is not clean, please run 'make$(if $(findstring command line, $(origin ARCH)), ARCH=$(ARCH)) mrproper'"; \
|
|
echo >&2 "*** in $(abs_srctree)";\
|
|
echo >&2 "***"; \
|
|
false; \
|
|
fi
|
|
$(Q)ln -fsn $(srctree) source
|
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
|
|
$(Q)test -e .gitignore || \
|
|
{ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
|
|
endif
|
|
|
|
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
|
|
ifneq ($(CROSS_COMPILE),)
|
|
CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
|
|
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
|
|
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
|
|
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
|
|
endif
|
|
ifneq ($(GCC_TOOLCHAIN),)
|
|
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
|
|
endif
|
|
ifneq ($(LLVM_IAS),1)
|
|
CLANG_FLAGS += -no-integrated-as
|
|
endif
|
|
CLANG_FLAGS += -Werror=unknown-warning-option
|
|
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
|
KBUILD_AFLAGS += $(CLANG_FLAGS)
|
|
export CLANG_FLAGS
|
|
endif
|
|
|
|
# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
|
|
# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
|
|
# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
|
|
# and from include/config/auto.conf.cmd to detect the compiler upgrade.
|
|
CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
|
|
|
|
ifdef config-build
|
|
# ===========================================================================
|
|
# *config targets only - make sure prerequisites are updated, and descend
|
|
# in scripts/kconfig to make the *config target
|
|
|
|
# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
|
|
# KBUILD_DEFCONFIG may point out an alternative default configuration
|
|
# used for 'make defconfig'
|
|
include arch/$(SRCARCH)/Makefile
|
|
export KBUILD_DEFCONFIG KBUILD_KCONFIG CC_VERSION_TEXT
|
|
|
|
config: outputmakefile scripts_basic FORCE
|
|
$(Q)$(MAKE) $(build)=scripts/kconfig $@
|
|
|
|
%config: outputmakefile scripts_basic FORCE
|
|
$(Q)$(MAKE) $(build)=scripts/kconfig $@
|
|
|
|
else #!config-build
|
|
# ===========================================================================
|
|
# Build targets only - this includes vmlinux, arch specific targets, clean
|
|
# targets and others. In general all targets except *config targets.
|
|
|
|
# If building an external module we do not care about the all: rule
|
|
# but instead __all depend on modules
|
|
PHONY += all
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
__all: all
|
|
else
|
|
__all: modules
|
|
endif
|
|
|
|
# Decide whether to build built-in, modular, or both.
|
|
# Normally, just do built-in.
|
|
|
|
KBUILD_MODULES :=
|
|
KBUILD_BUILTIN := 1
|
|
|
|
# If we have only "make modules", don't compile built-in objects.
|
|
ifeq ($(MAKECMDGOALS),modules)
|
|
KBUILD_BUILTIN :=
|
|
endif
|
|
|
|
# If we have "make <whatever> modules", compile modules
|
|
# in addition to whatever we do anyway.
|
|
# Just "make" or "make all" shall build modules as well
|
|
|
|
ifneq ($(filter all modules nsdeps %compile_commands.json clang-%,$(MAKECMDGOALS)),)
|
|
KBUILD_MODULES := 1
|
|
endif
|
|
|
|
ifeq ($(MAKECMDGOALS),)
|
|
KBUILD_MODULES := 1
|
|
endif
|
|
|
|
export KBUILD_MODULES KBUILD_BUILTIN
|
|
|
|
ifdef need-config
|
|
include include/config/auto.conf
|
|
endif
|
|
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
# Objects we will link into vmlinux / subdirs we need to visit
|
|
core-y := init/ usr/
|
|
drivers-y := drivers/ sound/ techpack/
|
|
drivers-$(CONFIG_SAMPLES) += samples/
|
|
drivers-y += net/ virt/
|
|
libs-y := lib/
|
|
endif # KBUILD_EXTMOD
|
|
|
|
# The all: target is the default when no target is given on the
|
|
# command line.
|
|
# This allow a user to issue only 'make' to build a kernel including modules
|
|
# Defaults to vmlinux, but the arch makefile usually adds further targets
|
|
all: vmlinux
|
|
|
|
CFLAGS_GCOV := -fprofile-arcs -ftest-coverage \
|
|
$(call cc-option,-fno-tree-loop-im) \
|
|
$(call cc-disable-warning,maybe-uninitialized,)
|
|
export CFLAGS_GCOV
|
|
|
|
# The arch Makefiles can override CC_FLAGS_FTRACE. We may also append it later.
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
CC_FLAGS_FTRACE := -pg
|
|
endif
|
|
|
|
RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
|
|
RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register
|
|
RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
|
|
RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline
|
|
RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
|
|
RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
|
|
export RETPOLINE_CFLAGS
|
|
export RETPOLINE_VDSO_CFLAGS
|
|
|
|
include arch/$(SRCARCH)/Makefile
|
|
|
|
ifdef need-config
|
|
ifdef may-sync-config
|
|
# Read in dependencies to all Kconfig* files, make sure to run syncconfig if
|
|
# changes are detected. This should be included after arch/$(SRCARCH)/Makefile
|
|
# because some architectures define CROSS_COMPILE there.
|
|
include include/config/auto.conf.cmd
|
|
|
|
$(KCONFIG_CONFIG):
|
|
@echo >&2 '***'
|
|
@echo >&2 '*** Configuration file "$@" not found!'
|
|
@echo >&2 '***'
|
|
@echo >&2 '*** Please run some configurator (e.g. "make oldconfig" or'
|
|
@echo >&2 '*** "make menuconfig" or "make xconfig").'
|
|
@echo >&2 '***'
|
|
@/bin/false
|
|
|
|
# The actual configuration files used during the build are stored in
|
|
# include/generated/ and include/config/. Update them if .config is newer than
|
|
# include/config/auto.conf (which mirrors .config).
|
|
#
|
|
# This exploits the 'multi-target pattern rule' trick.
|
|
# The syncconfig should be executed only once to make all the targets.
|
|
# (Note: use the grouped target '&:' when we bump to GNU Make 4.3)
|
|
quiet_cmd_syncconfig = SYNC $@
|
|
cmd_syncconfig = $(MAKE) -f $(srctree)/Makefile syncconfig
|
|
|
|
%/config/auto.conf %/config/auto.conf.cmd %/generated/autoconf.h: $(KCONFIG_CONFIG)
|
|
+$(call cmd,syncconfig)
|
|
else # !may-sync-config
|
|
# External modules and some install targets need include/generated/autoconf.h
|
|
# and include/config/auto.conf but do not care if they are up-to-date.
|
|
# Use auto.conf to trigger the test
|
|
PHONY += include/config/auto.conf
|
|
|
|
include/config/auto.conf:
|
|
$(Q)test -e include/generated/autoconf.h -a -e $@ || ( \
|
|
echo >&2; \
|
|
echo >&2 " ERROR: Kernel configuration is invalid."; \
|
|
echo >&2 " include/generated/autoconf.h or $@ are missing.";\
|
|
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
|
|
echo >&2 ; \
|
|
/bin/false)
|
|
|
|
endif # may-sync-config
|
|
endif # need-config
|
|
|
|
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
|
|
KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
|
|
|
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
|
|
KBUILD_CFLAGS += -O2
|
|
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
|
|
KBUILD_CFLAGS += -O3
|
|
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
|
KBUILD_CFLAGS += -Os
|
|
endif
|
|
|
|
# Tell gcc to never replace conditional load with a non-conditional one
|
|
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
|
|
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
|
|
|
|
ifdef CONFIG_READABLE_ASM
|
|
# Disable optimizations that make assembler listings hard to read.
|
|
# reorder blocks reorders the control in the function
|
|
# ipa clone creates specialized cloned functions
|
|
# partial inlining inlines only parts of functions
|
|
KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
|
|
$(call cc-option,-fno-ipa-cp-clone,) \
|
|
$(call cc-option,-fno-partial-inlining)
|
|
endif
|
|
|
|
ifneq ($(CONFIG_FRAME_WARN),0)
|
|
KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN)
|
|
endif
|
|
|
|
stackp-flags-y := -fno-stack-protector
|
|
stackp-flags-$(CONFIG_STACKPROTECTOR) := -fstack-protector
|
|
stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong
|
|
|
|
KBUILD_CFLAGS += $(stackp-flags-y)
|
|
|
|
ifdef CONFIG_CC_IS_CLANG
|
|
KBUILD_CPPFLAGS += -Qunused-arguments
|
|
KBUILD_CFLAGS += -Wno-format-invalid-specifier
|
|
KBUILD_CFLAGS += -Wno-gnu
|
|
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
|
|
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
|
|
# See modpost pattern 2
|
|
KBUILD_CFLAGS += -mno-global-merge
|
|
else
|
|
|
|
# These warnings generated too much noise in a regular build.
|
|
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
|
|
KBUILD_CFLAGS += -Wno-unused-but-set-variable
|
|
|
|
# Warn about unmarked fall-throughs in switch statement.
|
|
# Disabled for clang while comment to attribute conversion happens and
|
|
# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
|
|
KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
|
|
endif
|
|
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
|
|
ifdef CONFIG_FRAME_POINTER
|
|
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
|
else
|
|
# Some targets (ARM with Thumb2, for example), can't be built with frame
|
|
# pointers. For those, we don't have FUNCTION_TRACER automatically
|
|
# select FRAME_POINTER. However, FUNCTION_TRACER adds -pg, and this is
|
|
# incompatible with -fomit-frame-pointer with current GCC, so we don't use
|
|
# -fomit-frame-pointer with FUNCTION_TRACER.
|
|
ifndef CONFIG_FUNCTION_TRACER
|
|
KBUILD_CFLAGS += -fomit-frame-pointer
|
|
endif
|
|
endif
|
|
|
|
# Initialize all stack variables with a 0xAA pattern.
|
|
ifdef CONFIG_INIT_STACK_ALL_PATTERN
|
|
KBUILD_CFLAGS += -ftrivial-auto-var-init=pattern
|
|
endif
|
|
|
|
# Initialize all stack variables with a zero value.
|
|
ifdef CONFIG_INIT_STACK_ALL_ZERO
|
|
# Future support for zero initialization is still being debated, see
|
|
# https://bugs.llvm.org/show_bug.cgi?id=45497. These flags are subject to being
|
|
# renamed or dropped.
|
|
KBUILD_CFLAGS += -ftrivial-auto-var-init=zero
|
|
KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
|
|
endif
|
|
|
|
DEBUG_CFLAGS :=
|
|
|
|
# Workaround for GCC versions < 5.0
|
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801
|
|
ifdef CONFIG_CC_IS_GCC
|
|
DEBUG_CFLAGS += $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments))
|
|
endif
|
|
|
|
ifdef CONFIG_DEBUG_INFO
|
|
|
|
ifdef CONFIG_DEBUG_INFO_SPLIT
|
|
DEBUG_CFLAGS += -gsplit-dwarf
|
|
else
|
|
DEBUG_CFLAGS += -g
|
|
endif
|
|
|
|
ifneq ($(LLVM_IAS),1)
|
|
KBUILD_AFLAGS += -Wa,-gdwarf-2
|
|
endif
|
|
|
|
ifdef CONFIG_DEBUG_INFO_DWARF4
|
|
DEBUG_CFLAGS += -gdwarf-4
|
|
endif
|
|
|
|
ifdef CONFIG_DEBUG_INFO_REDUCED
|
|
DEBUG_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
|
|
$(call cc-option,-fno-var-tracking)
|
|
endif
|
|
|
|
ifdef CONFIG_DEBUG_INFO_COMPRESSED
|
|
DEBUG_CFLAGS += -gz=zlib
|
|
KBUILD_AFLAGS += -gz=zlib
|
|
KBUILD_LDFLAGS += --compress-debug-sections=zlib
|
|
endif
|
|
|
|
endif # CONFIG_DEBUG_INFO
|
|
|
|
KBUILD_CFLAGS += $(DEBUG_CFLAGS)
|
|
export DEBUG_CFLAGS
|
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
ifdef CONFIG_FTRACE_MCOUNT_USE_CC
|
|
CC_FLAGS_FTRACE += -mrecord-mcount
|
|
ifdef CONFIG_HAVE_NOP_MCOUNT
|
|
ifeq ($(call cc-option-yn, -mnop-mcount),y)
|
|
CC_FLAGS_FTRACE += -mnop-mcount
|
|
CC_FLAGS_USING += -DCC_USING_NOP_MCOUNT
|
|
endif
|
|
endif
|
|
endif
|
|
ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
|
|
CC_FLAGS_USING += -DCC_USING_NOP_MCOUNT
|
|
endif
|
|
ifdef CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT
|
|
ifdef CONFIG_HAVE_C_RECORDMCOUNT
|
|
BUILD_C_RECORDMCOUNT := y
|
|
export BUILD_C_RECORDMCOUNT
|
|
endif
|
|
endif
|
|
ifdef CONFIG_HAVE_FENTRY
|
|
ifeq ($(call cc-option-yn, -mfentry),y)
|
|
CC_FLAGS_FTRACE += -mfentry
|
|
CC_FLAGS_USING += -DCC_USING_FENTRY
|
|
endif
|
|
endif
|
|
export CC_FLAGS_FTRACE
|
|
KBUILD_CFLAGS += $(CC_FLAGS_FTRACE) $(CC_FLAGS_USING)
|
|
KBUILD_AFLAGS += $(CC_FLAGS_USING)
|
|
endif
|
|
|
|
# We trigger additional mismatches with less inlining
|
|
ifdef CONFIG_DEBUG_SECTION_MISMATCH
|
|
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
|
|
endif
|
|
|
|
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
|
|
KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
|
|
LDFLAGS_vmlinux += --gc-sections
|
|
endif
|
|
|
|
ifdef CONFIG_SHADOW_CALL_STACK
|
|
CC_FLAGS_SCS := -fsanitize=shadow-call-stack
|
|
KBUILD_CFLAGS += $(CC_FLAGS_SCS)
|
|
export CC_FLAGS_SCS
|
|
endif
|
|
|
|
ifdef CONFIG_LTO_CLANG
|
|
ifdef CONFIG_LTO_CLANG_THIN
|
|
CC_FLAGS_LTO += -flto=thin -fsplit-lto-unit
|
|
KBUILD_LDFLAGS += --thinlto-cache-dir=$(extmod-prefix).thinlto-cache
|
|
else
|
|
CC_FLAGS_LTO += -flto
|
|
endif
|
|
|
|
ifeq ($(SRCARCH),x86)
|
|
# TODO(b/182572011): Revert workaround for compiler / linker bug.
|
|
CC_FLAGS_LTO += -fvisibility=hidden
|
|
else
|
|
CC_FLAGS_LTO += -fvisibility=default
|
|
endif
|
|
|
|
# Limit inlining across translation units to reduce binary size
|
|
KBUILD_LDFLAGS += -mllvm -import-instr-limit=5
|
|
endif
|
|
|
|
ifdef CONFIG_LTO
|
|
KBUILD_CFLAGS += $(CC_FLAGS_LTO)
|
|
export CC_FLAGS_LTO
|
|
endif
|
|
|
|
ifdef CONFIG_CFI_CLANG
|
|
CC_FLAGS_CFI := -fsanitize=cfi \
|
|
-fsanitize-cfi-cross-dso \
|
|
-fno-sanitize-cfi-canonical-jump-tables \
|
|
-fno-sanitize-blacklist
|
|
|
|
ifdef CONFIG_CFI_PERMISSIVE
|
|
CC_FLAGS_CFI += -fsanitize-recover=cfi \
|
|
-fno-sanitize-trap=cfi
|
|
else
|
|
ifndef CONFIG_UBSAN_TRAP
|
|
CC_FLAGS_CFI += -ftrap-function=__ubsan_handle_cfi_check_fail_abort
|
|
endif
|
|
endif
|
|
|
|
# If LTO flags are filtered out, we must also filter out CFI.
|
|
CC_FLAGS_LTO += $(CC_FLAGS_CFI)
|
|
KBUILD_CFLAGS += $(CC_FLAGS_CFI)
|
|
export CC_FLAGS_CFI
|
|
endif
|
|
|
|
ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B
|
|
KBUILD_CFLAGS += -falign-functions=32
|
|
endif
|
|
|
|
# arch Makefile may override CC so keep this after arch Makefile is included
|
|
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
|
|
|
|
# warn about C99 declaration after statement
|
|
KBUILD_CFLAGS += -Wdeclaration-after-statement
|
|
|
|
# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
|
|
KBUILD_CFLAGS += -Wvla
|
|
|
|
# disable pointer signed / unsigned warnings in gcc 4.0
|
|
KBUILD_CFLAGS += -Wno-pointer-sign
|
|
|
|
# disable stringop warnings in gcc 8+
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
|
|
|
|
# We'll want to enable this eventually, but it's not going away for 5.7 at least
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds)
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
|
|
|
|
# Another good warning that we'll want to enable eventually
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
|
|
|
|
# Enabled with W=2, disabled by default as noisy
|
|
KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
|
|
|
# disable invalid "can't wrap" optimizations for signed / pointers
|
|
KBUILD_CFLAGS += -fno-strict-overflow
|
|
|
|
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
|
|
KBUILD_CFLAGS += -fno-stack-check
|
|
|
|
# conserve stack if available
|
|
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
|
|
|
|
# Prohibit date/time macros, which would make the build non-deterministic
|
|
KBUILD_CFLAGS += -Werror=date-time
|
|
|
|
# enforce correct pointer usage
|
|
KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
|
|
|
|
# Require designated initializers for all marked structures
|
|
KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
|
|
|
|
# change __FILE__ to the relative path from the srctree
|
|
KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
|
|
|
# include additional Makefiles when needed
|
|
include-y := scripts/Makefile.extrawarn
|
|
include-$(CONFIG_KASAN) += scripts/Makefile.kasan
|
|
include-$(CONFIG_KCSAN) += scripts/Makefile.kcsan
|
|
include-$(CONFIG_UBSAN) += scripts/Makefile.ubsan
|
|
include-$(CONFIG_KCOV) += scripts/Makefile.kcov
|
|
include-$(CONFIG_GCC_PLUGINS) += scripts/Makefile.gcc-plugins
|
|
|
|
include $(addprefix $(srctree)/, $(include-y))
|
|
|
|
# scripts/Makefile.gcc-plugins is intentionally included last.
|
|
# Do not add $(call cc-option,...) below this line. When you build the kernel
|
|
# from the clean source tree, the GCC plugins do not exist at this point.
|
|
|
|
# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
|
|
KBUILD_CPPFLAGS += $(KCPPFLAGS)
|
|
KBUILD_AFLAGS += $(KAFLAGS)
|
|
KBUILD_CFLAGS += $(KCFLAGS)
|
|
|
|
KBUILD_LDFLAGS_MODULE += --build-id=sha1
|
|
LDFLAGS_vmlinux += --build-id=sha1
|
|
|
|
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
|
|
LDFLAGS_vmlinux += $(call ld-option, -X,)
|
|
endif
|
|
|
|
ifeq ($(CONFIG_RELR),y)
|
|
LDFLAGS_vmlinux += --pack-dyn-relocs=relr
|
|
endif
|
|
|
|
# We never want expected sections to be placed heuristically by the
|
|
# linker. All sections should be explicitly named in the linker script.
|
|
ifdef CONFIG_LD_ORPHAN_WARN
|
|
LDFLAGS_vmlinux += --orphan-handling=warn
|
|
endif
|
|
|
|
# Align the bit size of userspace programs with the kernel
|
|
KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
|
|
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
|
|
|
|
# make the checker run with the right architecture
|
|
CHECKFLAGS += --arch=$(ARCH)
|
|
|
|
# insure the checker run with the right endianness
|
|
CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian)
|
|
|
|
# the checker needs the correct machine size
|
|
CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)
|
|
|
|
# Default kernel image to build when no specific target is given.
|
|
# KBUILD_IMAGE may be overruled on the command line or
|
|
# set in the environment
|
|
# Also any assignments in arch/$(ARCH)/Makefile take precedence over
|
|
# this default value
|
|
export KBUILD_IMAGE ?= vmlinux
|
|
|
|
#
|
|
# INSTALL_PATH specifies where to place the updated kernel and system map
|
|
# images. Default is /boot, but you can set it to other values
|
|
export INSTALL_PATH ?= /boot
|
|
|
|
#
|
|
# INSTALL_DTBS_PATH specifies a prefix for relocations required by build roots.
|
|
# Like INSTALL_MOD_PATH, it isn't defined in the Makefile, but can be passed as
|
|
# an argument if needed. Otherwise it defaults to the kernel install path
|
|
#
|
|
export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)
|
|
|
|
#
|
|
# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
|
|
# relocations required by build roots. This is not defined in the
|
|
# makefile but the argument can be passed to make if needed.
|
|
#
|
|
|
|
MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
|
|
export MODLIB
|
|
|
|
#
|
|
# INSTALL_MOD_STRIP, if defined, will cause modules to be
|
|
# stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
|
|
# the default option --strip-debug will be used. Otherwise,
|
|
# INSTALL_MOD_STRIP value will be used as the options to the strip command.
|
|
|
|
ifdef INSTALL_MOD_STRIP
|
|
ifeq ($(INSTALL_MOD_STRIP),1)
|
|
mod_strip_cmd = $(STRIP) --strip-debug
|
|
else
|
|
mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP)
|
|
endif # INSTALL_MOD_STRIP=1
|
|
else
|
|
mod_strip_cmd = true
|
|
endif # INSTALL_MOD_STRIP
|
|
export mod_strip_cmd
|
|
|
|
# CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed
|
|
# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP
|
|
# or CONFIG_MODULE_COMPRESS_XZ.
|
|
|
|
mod_compress_cmd = true
|
|
ifdef CONFIG_MODULE_COMPRESS
|
|
ifdef CONFIG_MODULE_COMPRESS_GZIP
|
|
mod_compress_cmd = $(KGZIP) -n -f
|
|
endif # CONFIG_MODULE_COMPRESS_GZIP
|
|
ifdef CONFIG_MODULE_COMPRESS_XZ
|
|
mod_compress_cmd = $(XZ) -f
|
|
endif # CONFIG_MODULE_COMPRESS_XZ
|
|
endif # CONFIG_MODULE_COMPRESS
|
|
export mod_compress_cmd
|
|
|
|
ifdef CONFIG_MODULE_SIG_ALL
|
|
$(eval $(call config_filename,MODULE_SIG_KEY))
|
|
|
|
mod_sign_cmd = scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY) certs/signing_key.x509
|
|
else
|
|
mod_sign_cmd = true
|
|
endif
|
|
export mod_sign_cmd
|
|
|
|
HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
|
|
|
|
has_libelf := $(call try-run,\
|
|
echo "int main() {}" | \
|
|
$(HOSTCC) $(KBUILD_HOSTCFLAGS) -xc -o /dev/null $(KBUILD_HOSTLDFLAGS) $(HOST_LIBELF_LIBS) -,1,0)
|
|
|
|
ifdef CONFIG_STACK_VALIDATION
|
|
ifeq ($(has_libelf),1)
|
|
objtool_target := tools/objtool FORCE
|
|
else
|
|
SKIP_STACK_VALIDATION := 1
|
|
export SKIP_STACK_VALIDATION
|
|
endif
|
|
endif
|
|
|
|
ifdef CONFIG_BPF
|
|
ifdef CONFIG_DEBUG_INFO_BTF
|
|
ifeq ($(has_libelf),1)
|
|
resolve_btfids_target := tools/bpf/resolve_btfids FORCE
|
|
else
|
|
ERROR_RESOLVE_BTFIDS := 1
|
|
endif
|
|
endif # CONFIG_DEBUG_INFO_BTF
|
|
endif # CONFIG_BPF
|
|
|
|
PHONY += prepare0
|
|
|
|
export MODORDER := $(extmod-prefix)modules.order
|
|
export MODULES_NSDEPS := $(extmod-prefix)modules.nsdeps
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Kernel headers
|
|
|
|
PHONY += headers
|
|
|
|
techpack-dirs := $(shell find $(srctree)/techpack -maxdepth 1 -mindepth 1 -type d -not -name ".*")
|
|
techpack-dirs := $(subst $(srctree)/,,$(techpack-dirs))
|
|
|
|
#Default location for installed headers
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
PHONY += archheaders archscripts
|
|
hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
|
|
headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
|
|
else
|
|
hdr-prefix = $(KBUILD_EXTMOD)/
|
|
hdr-inst := -f $(srctree)/scripts/Makefile.headersinst dst=$(KBUILD_EXTMOD)/usr/include objtree=$(objtree)/$(KBUILD_EXTMOD) obj
|
|
endif
|
|
|
|
export INSTALL_HDR_PATH = $(objtree)/$(hdr-prefix)usr
|
|
|
|
quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include
|
|
cmd_headers_install = \
|
|
mkdir -p $(INSTALL_HDR_PATH); \
|
|
rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
|
|
$(hdr-prefix)usr/include $(INSTALL_HDR_PATH);
|
|
|
|
PHONY += headers_install
|
|
headers_install: headers
|
|
$(call cmd,headers_install)
|
|
|
|
headers:
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
$(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/Kbuild),, \
|
|
$(error Headers not exportable for the $(SRCARCH) architecture))
|
|
endif
|
|
$(Q)$(MAKE) $(hdr-inst)=$(hdr-prefix)include/uapi
|
|
$(Q)$(MAKE) $(hdr-inst)=$(hdr-prefix)arch/$(SRCARCH)/include/uapi
|
|
$(Q)for d in $(techpack-dirs); do \
|
|
$(MAKE) $(hdr-inst)=$$d/include/uapi; \
|
|
done
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Devicetree files
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
|
|
dtstree := arch/$(SRCARCH)/boot/dts
|
|
endif
|
|
|
|
else # KBUILD_EXTMOD
|
|
# Devicetree source should live in $(KBUILD_EXTMOD)/arch/$(SRCARCH)/boot/dts/
|
|
# But it may live inside some other folder relative to KBUILD_EXTMOD, as specified
|
|
# by KBUILD_EXTMOD_DTS
|
|
KBUILD_EXTMOD_DTS = arch/$(SRCARCH)/boot/dts
|
|
ifneq ($(wildcard $(KBUILD_EXTMOD)/$(KBUILD_EXTMOD_DTS)/ $(srctree)/$(KBUILD_EXTMOD)/$(KBUILD_EXTMOD_DTS)/),)
|
|
dtstree := $(KBUILD_EXTMOD)/$(KBUILD_EXTMOD_DTS)
|
|
endif
|
|
endif
|
|
|
|
ifneq ($(dtstree),)
|
|
|
|
%.dtb: include/config/kernel.release scripts_dtc
|
|
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
|
|
|
|
PHONY += dtbs dtbs_install dtbs_check
|
|
dtbs: include/config/kernel.release scripts_dtc
|
|
$(Q)$(MAKE) $(build)=$(dtstree)
|
|
|
|
ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
|
|
export CHECK_DTBS=y
|
|
dtbs: dt_binding_check
|
|
endif
|
|
|
|
dtbs_check: dtbs
|
|
|
|
dtbs_install:
|
|
$(Q)$(MAKE) $(dtbinst)=$(dtstree) dst=$(INSTALL_DTBS_PATH)
|
|
|
|
ifdef CONFIG_OF_EARLY_FLATTREE
|
|
all: dtbs
|
|
endif
|
|
|
|
endif
|
|
|
|
PHONY += scripts_dtc
|
|
scripts_dtc: scripts_basic
|
|
$(Q)$(MAKE) $(build)=scripts/dtc
|
|
|
|
ifneq ($(filter dt_binding_check, $(MAKECMDGOALS)),)
|
|
export CHECK_DT_BINDING=y
|
|
endif
|
|
|
|
PHONY += dt_binding_check
|
|
dt_binding_check: scripts_dtc
|
|
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
|
|
|
|
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
|
|
|
|
vmlinux-dirs := $(patsubst %/,%,$(filter %/, \
|
|
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
|
|
$(libs-y) $(libs-m)))
|
|
|
|
vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
|
|
$(patsubst %/,%,$(filter %/, $(core-) \
|
|
$(drivers-) $(libs-))))
|
|
|
|
subdir-modorder := $(addsuffix modules.order,$(filter %/, \
|
|
$(core-y) $(core-m) $(libs-y) $(libs-m) \
|
|
$(drivers-y) $(drivers-m)))
|
|
|
|
build-dirs := $(vmlinux-dirs)
|
|
clean-dirs := $(vmlinux-alldirs)
|
|
|
|
# Externally visible symbols (used by link-vmlinux.sh)
|
|
KBUILD_VMLINUX_OBJS := $(head-y) $(patsubst %/,%/built-in.a, $(core-y))
|
|
KBUILD_VMLINUX_OBJS += $(addsuffix built-in.a, $(filter %/, $(libs-y)))
|
|
ifdef CONFIG_MODULES
|
|
KBUILD_VMLINUX_OBJS += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
|
|
KBUILD_VMLINUX_LIBS := $(filter-out %/, $(libs-y))
|
|
else
|
|
KBUILD_VMLINUX_LIBS := $(patsubst %/,%/lib.a, $(libs-y))
|
|
endif
|
|
KBUILD_VMLINUX_OBJS += $(patsubst %/,%/built-in.a, $(drivers-y))
|
|
|
|
export KBUILD_VMLINUX_OBJS KBUILD_VMLINUX_LIBS
|
|
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
|
|
# used by scripts/Makefile.package
|
|
export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) LICENSES arch include scripts tools)
|
|
|
|
vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
|
|
|
|
# Recurse until adjust_autoksyms.sh is satisfied
|
|
PHONY += autoksyms_recursive
|
|
ifdef CONFIG_TRIM_UNUSED_KSYMS
|
|
# For the kernel to actually contain only the needed exported symbols,
|
|
# we have to build modules as well to determine what those symbols are.
|
|
# (this can be evaluated only once include/config/auto.conf has been included)
|
|
KBUILD_MODULES := 1
|
|
|
|
autoksyms_recursive: descend modules.order
|
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
|
|
"$(MAKE) -f $(srctree)/Makefile vmlinux"
|
|
endif
|
|
|
|
autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
|
|
|
|
quiet_cmd_autoksyms_h = GEN $@
|
|
cmd_autoksyms_h = mkdir -p $(dir $@); \
|
|
$(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@
|
|
|
|
$(autoksyms_h):
|
|
$(call cmd,autoksyms_h)
|
|
|
|
ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
|
|
|
|
# Final link of vmlinux with optional arch pass after final link
|
|
cmd_link-vmlinux = \
|
|
$(CONFIG_SHELL) $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)"; \
|
|
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
|
|
|
|
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
|
|
+$(call if_changed,link-vmlinux)
|
|
|
|
targets := vmlinux
|
|
|
|
# The actual objects are generated when descending,
|
|
# make sure no implicit rule kicks in
|
|
$(sort $(vmlinux-deps) $(subdir-modorder)): descend ;
|
|
|
|
filechk_kernel.release = \
|
|
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion \
|
|
$(srctree) $(BRANCH) $(KMI_GENERATION))"
|
|
|
|
# Store (new) KERNELRELEASE string in include/config/kernel.release
|
|
include/config/kernel.release: FORCE
|
|
$(call filechk,kernel.release)
|
|
|
|
# Additional helpers built in scripts/
|
|
# Carefully list dependencies so we do not try to build scripts twice
|
|
# in parallel
|
|
PHONY += scripts
|
|
scripts: scripts_basic scripts_dtc
|
|
$(Q)$(MAKE) $(build)=$(@)
|
|
|
|
# Things we need to do before we recursively start building the kernel
|
|
# or the modules are listed in "prepare".
|
|
# A multi level approach is used. prepareN is processed before prepareN-1.
|
|
# archprepare is used in arch Makefiles and when processed asm symlink,
|
|
# version.h and scripts_basic is processed / created.
|
|
|
|
PHONY += prepare archprepare
|
|
|
|
archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
|
|
asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
|
|
include/generated/autoconf.h
|
|
|
|
prepare0: archprepare
|
|
$(Q)$(MAKE) $(build)=scripts/mod
|
|
$(Q)$(MAKE) $(build)=.
|
|
|
|
# All the preparing..
|
|
prepare: prepare0 prepare-objtool prepare-resolve_btfids
|
|
|
|
# Support for using generic headers in asm-generic
|
|
asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
|
|
|
|
PHONY += asm-generic uapi-asm-generic
|
|
asm-generic: uapi-asm-generic
|
|
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm \
|
|
generic=include/asm-generic
|
|
uapi-asm-generic:
|
|
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \
|
|
generic=include/uapi/asm-generic
|
|
|
|
PHONY += prepare-objtool prepare-resolve_btfids
|
|
prepare-objtool: $(objtool_target)
|
|
ifeq ($(SKIP_STACK_VALIDATION),1)
|
|
ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
|
|
@echo "error: Cannot generate __mcount_loc for CONFIG_DYNAMIC_FTRACE=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
|
|
@false
|
|
endif
|
|
ifdef CONFIG_UNWINDER_ORC
|
|
@echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
|
|
@false
|
|
else
|
|
@echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
|
|
endif
|
|
endif
|
|
|
|
prepare-resolve_btfids: $(resolve_btfids_target)
|
|
ifeq ($(ERROR_RESOLVE_BTFIDS),1)
|
|
@echo "error: Cannot resolve BTF IDs for CONFIG_DEBUG_INFO_BTF, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
|
|
@false
|
|
endif
|
|
# Generate some files
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# KERNELRELEASE can change from a few different places, meaning version.h
|
|
# needs to be updated, so this check is forced on all builds
|
|
|
|
uts_len := 64
|
|
ifneq (,$(BUILD_NUMBER))
|
|
UTS_RELEASE=$(KERNELRELEASE)-ab$(BUILD_NUMBER)
|
|
else
|
|
UTS_RELEASE=$(KERNELRELEASE)
|
|
endif
|
|
define filechk_utsrelease.h
|
|
if [ `echo -n "$(UTS_RELEASE)" | wc -c ` -gt $(uts_len) ]; then \
|
|
echo '"$(UTS_RELEASE)" exceeds $(uts_len) characters' >&2; \
|
|
exit 1; \
|
|
fi; \
|
|
echo \#define UTS_RELEASE \"$(UTS_RELEASE)\"
|
|
endef
|
|
|
|
define filechk_version.h
|
|
echo \#define LINUX_VERSION_CODE $(shell \
|
|
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
|
|
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
|
|
endef
|
|
|
|
$(version_h): FORCE
|
|
$(call filechk,version.h)
|
|
$(Q)rm -f $(old_version_h)
|
|
|
|
include/generated/utsrelease.h: include/config/kernel.release FORCE
|
|
$(call filechk,utsrelease.h)
|
|
|
|
PHONY += headerdep
|
|
headerdep:
|
|
$(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
|
|
$(srctree)/scripts/headerdep.pl -I$(srctree)/include
|
|
|
|
# Deprecated. It is no-op now.
|
|
PHONY += headers_check
|
|
headers_check:
|
|
@:
|
|
$(Q)for d in $(techpack-dirs); do \
|
|
$(MAKE) $(hdr-inst)=$$d/include/uapi HDRCHECK=1; \
|
|
done
|
|
|
|
ifdef CONFIG_HEADERS_INSTALL
|
|
prepare: headers
|
|
endif
|
|
|
|
PHONY += scripts_unifdef
|
|
scripts_unifdef: scripts_basic
|
|
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Kernel selftest
|
|
|
|
PHONY += kselftest
|
|
kselftest:
|
|
$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
|
|
|
|
kselftest-%: FORCE
|
|
$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests $*
|
|
|
|
PHONY += kselftest-merge
|
|
kselftest-merge:
|
|
$(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
|
|
$(Q)find $(srctree)/tools/testing/selftests -name config | \
|
|
xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
|
|
$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Modules
|
|
|
|
ifdef CONFIG_MODULES
|
|
|
|
# By default, build modules as well
|
|
|
|
all: modules
|
|
|
|
# When we're building modules with modversions, we need to consider
|
|
# the built-in objects during the descend as well, in order to
|
|
# make sure the checksums are up to date before we record them.
|
|
ifdef CONFIG_MODVERSIONS
|
|
KBUILD_BUILTIN := 1
|
|
endif
|
|
|
|
# Build modules
|
|
#
|
|
# A module can be listed more than once in obj-m resulting in
|
|
# duplicate lines in modules.order files. Those are removed
|
|
# using awk while concatenating to the final file.
|
|
|
|
PHONY += modules
|
|
modules: $(if $(KBUILD_BUILTIN),vmlinux) modules_check modules_prepare
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
|
|
|
PHONY += modules_check
|
|
modules_check: modules.order
|
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh $<
|
|
|
|
cmd_modules_order = $(AWK) '!x[$$0]++' $(real-prereqs) > $@
|
|
|
|
modules.order: $(subdir-modorder) FORCE
|
|
$(call if_changed,modules_order)
|
|
|
|
targets += modules.order
|
|
|
|
# Target to prepare building external modules
|
|
PHONY += modules_prepare
|
|
modules_prepare: prepare
|
|
$(Q)$(MAKE) $(build)=scripts scripts/module.lds
|
|
|
|
# Target to install modules
|
|
PHONY += modules_install
|
|
modules_install: _modinst_ _modinst_post
|
|
|
|
PHONY += _modinst_
|
|
_modinst_:
|
|
@rm -rf $(MODLIB)/kernel
|
|
@rm -f $(MODLIB)/source
|
|
@mkdir -p $(MODLIB)/kernel
|
|
@ln -s $(abspath $(srctree)) $(MODLIB)/source
|
|
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
|
|
rm -f $(MODLIB)/build ; \
|
|
ln -s $(CURDIR) $(MODLIB)/build ; \
|
|
fi
|
|
@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
|
|
@cp -f modules.builtin $(MODLIB)/
|
|
@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
|
|
|
|
# This depmod is only for convenience to give the initial
|
|
# boot a modules.dep even before / is mounted read-write. However the
|
|
# boot script depmod is the master version.
|
|
PHONY += _modinst_post
|
|
_modinst_post: _modinst_
|
|
$(call cmd,depmod)
|
|
|
|
ifeq ($(CONFIG_MODULE_SIG), y)
|
|
PHONY += modules_sign
|
|
modules_sign:
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modsign
|
|
endif
|
|
|
|
else # CONFIG_MODULES
|
|
|
|
# Modules not configured
|
|
# ---------------------------------------------------------------------------
|
|
|
|
PHONY += modules modules_install
|
|
modules modules_install:
|
|
@echo >&2
|
|
@echo >&2 "The present kernel configuration has modules disabled."
|
|
@echo >&2 "Type 'make config' and enable loadable module support."
|
|
@echo >&2 "Then build a kernel with module support enabled."
|
|
@echo >&2
|
|
@exit 1
|
|
|
|
endif # CONFIG_MODULES
|
|
|
|
###
|
|
# Cleaning is done on three levels.
|
|
# make clean Delete most generated files
|
|
# Leave enough to build external modules
|
|
# make mrproper Delete the current configuration, and all generated files
|
|
# make distclean Remove editor backup files, patch leftover files and the like
|
|
|
|
# Directories & files removed with 'make clean'
|
|
CLEAN_FILES += include/ksym vmlinux.symvers \
|
|
modules.builtin modules.builtin.modinfo modules.nsdeps \
|
|
compile_commands.json
|
|
|
|
# Directories & files removed with 'make mrproper'
|
|
MRPROPER_FILES += include/config include/generated \
|
|
arch/$(SRCARCH)/include/generated .tmp_objdiff \
|
|
debian snap tar-install \
|
|
.config .config.old .version \
|
|
Module.symvers \
|
|
signing_key.pem signing_key.priv signing_key.x509 \
|
|
x509.genkey extra_certificates signing_key.x509.keyid \
|
|
signing_key.x509.signer vmlinux-gdb.py \
|
|
*.spec
|
|
|
|
# Directories & files removed with 'make distclean'
|
|
DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS .thinlto-cache
|
|
|
|
# clean - Delete most, but leave enough to build external modules
|
|
#
|
|
clean: rm-files := $(CLEAN_FILES)
|
|
|
|
PHONY += archclean vmlinuxclean
|
|
|
|
vmlinuxclean:
|
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
|
|
$(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean)
|
|
|
|
clean: archclean vmlinuxclean
|
|
|
|
# mrproper - Delete all generated files, including .config
|
|
#
|
|
mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
|
|
mrproper-dirs := $(addprefix _mrproper_,scripts)
|
|
|
|
PHONY += $(mrproper-dirs) mrproper
|
|
$(mrproper-dirs):
|
|
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
|
|
|
|
mrproper: clean $(mrproper-dirs)
|
|
$(call cmd,rmfiles)
|
|
|
|
# distclean
|
|
#
|
|
distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))
|
|
|
|
PHONY += distclean
|
|
|
|
distclean: mrproper
|
|
$(call cmd,rmfiles)
|
|
@find $(srctree) $(RCS_FIND_IGNORE) \
|
|
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
|
-o -name '*.bak' -o -name '#*#' -o -name '*%' \
|
|
-o -name 'core' \) \
|
|
-type f -print | xargs rm -f
|
|
|
|
|
|
# Packaging of the kernel to various formats
|
|
# ---------------------------------------------------------------------------
|
|
|
|
%src-pkg: FORCE
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
|
|
%pkg: include/config/kernel.release FORCE
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
|
|
|
|
# Brief documentation of the typical targets used
|
|
# ---------------------------------------------------------------------------
|
|
|
|
boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
|
|
boards := $(sort $(notdir $(boards)))
|
|
board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
|
|
board-dirs := $(sort $(notdir $(board-dirs:/=)))
|
|
|
|
PHONY += help
|
|
help:
|
|
@echo 'Cleaning targets:'
|
|
@echo ' clean - Remove most generated files but keep the config and'
|
|
@echo ' enough build support to build external modules'
|
|
@echo ' mrproper - Remove all generated files + config + various backup files'
|
|
@echo ' distclean - mrproper + remove editor backup and patch files'
|
|
@echo ''
|
|
@echo 'Configuration targets:'
|
|
@$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
|
|
@echo ''
|
|
@echo 'Other generic targets:'
|
|
@echo ' all - Build all targets marked with [*]'
|
|
@echo '* vmlinux - Build the bare kernel'
|
|
@echo '* modules - Build all modules'
|
|
@echo ' modules_install - Install all modules to INSTALL_MOD_PATH (default: /)'
|
|
@echo ' dir/ - Build all files in dir and below'
|
|
@echo ' dir/file.[ois] - Build specified target only'
|
|
@echo ' dir/file.ll - Build the LLVM assembly file'
|
|
@echo ' (requires compiler support for LLVM assembly generation)'
|
|
@echo ' dir/file.lst - Build specified mixed source/assembly target only'
|
|
@echo ' (requires a recent binutils and recent build (System.map))'
|
|
@echo ' dir/file.ko - Build module including final link'
|
|
@echo ' modules_prepare - Set up for building external modules'
|
|
@echo ' tags/TAGS - Generate tags file for editors'
|
|
@echo ' cscope - Generate cscope index'
|
|
@echo ' gtags - Generate GNU GLOBAL index'
|
|
@echo ' kernelrelease - Output the release version string (use with make -s)'
|
|
@echo ' kernelversion - Output the version stored in Makefile (use with make -s)'
|
|
@echo ' image_name - Output the image name (use with make -s)'
|
|
@echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
|
|
echo ' (default: $(INSTALL_HDR_PATH))'; \
|
|
echo ''
|
|
@echo 'Static analysers:'
|
|
@echo ' checkstack - Generate a list of stack hogs'
|
|
@echo ' versioncheck - Sanity check on version.h usage'
|
|
@echo ' includecheck - Check for duplicate included header files'
|
|
@echo ' export_report - List the usages of all exported symbols'
|
|
@echo ' headerdep - Detect inclusion cycles in headers'
|
|
@echo ' coccicheck - Check with Coccinelle'
|
|
@echo ' clang-analyzer - Check with clang static analyzer'
|
|
@echo ' clang-tidy - Check with clang-tidy'
|
|
@echo ''
|
|
@echo 'Tools:'
|
|
@echo ' nsdeps - Generate missing symbol namespace dependencies'
|
|
@echo ''
|
|
@echo 'Kernel selftest:'
|
|
@echo ' kselftest - Build and run kernel selftest'
|
|
@echo ' Build, install, and boot kernel before'
|
|
@echo ' running kselftest on it'
|
|
@echo ' Run as root for full coverage'
|
|
@echo ' kselftest-all - Build kernel selftest'
|
|
@echo ' kselftest-install - Build and install kernel selftest'
|
|
@echo ' kselftest-clean - Remove all generated kselftest files'
|
|
@echo ' kselftest-merge - Merge all the config dependencies of'
|
|
@echo ' kselftest to existing .config.'
|
|
@echo ''
|
|
@$(if $(dtstree), \
|
|
echo 'Devicetree:'; \
|
|
echo '* dtbs - Build device tree blobs for enabled boards'; \
|
|
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
|
|
echo ' dt_binding_check - Validate device tree binding documents'; \
|
|
echo ' dtbs_check - Validate device tree source files';\
|
|
echo '')
|
|
|
|
@echo 'Userspace tools targets:'
|
|
@echo ' use "make tools/help"'
|
|
@echo ' or "cd tools; make help"'
|
|
@echo ''
|
|
@echo 'Kernel packaging:'
|
|
@$(MAKE) -f $(srctree)/scripts/Makefile.package help
|
|
@echo ''
|
|
@echo 'Documentation targets:'
|
|
@$(MAKE) -f $(srctree)/Documentation/Makefile dochelp
|
|
@echo ''
|
|
@echo 'Architecture specific targets ($(SRCARCH)):'
|
|
@$(if $(archhelp),$(archhelp),\
|
|
echo ' No architecture specific help defined for $(SRCARCH)')
|
|
@echo ''
|
|
@$(if $(boards), \
|
|
$(foreach b, $(boards), \
|
|
printf " %-27s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
|
|
echo '')
|
|
@$(if $(board-dirs), \
|
|
$(foreach b, $(board-dirs), \
|
|
printf " %-16s - Show %s-specific targets\\n" help-$(b) $(b);) \
|
|
printf " %-16s - Show all of the above\\n" help-boards; \
|
|
echo '')
|
|
|
|
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
|
|
@echo ' make V=2 [targets] 2 => give reason for rebuild of target'
|
|
@echo ' make O=dir [targets] Locate all output files in "dir", including .config'
|
|
@echo ' make C=1 [targets] Check re-compiled c source with $$CHECK'
|
|
@echo ' (sparse by default)'
|
|
@echo ' make C=2 [targets] Force check of all c source with $$CHECK'
|
|
@echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
|
|
@echo ' make W=n [targets] Enable extra build checks, n=1,2,3 where'
|
|
@echo ' 1: warnings which may be relevant and do not occur too often'
|
|
@echo ' 2: warnings which occur quite often but may still be relevant'
|
|
@echo ' 3: more obscure warnings, can most likely be ignored'
|
|
@echo ' Multiple levels can be combined with W=12 or W=123'
|
|
@echo ''
|
|
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
|
|
@echo 'For further info see the ./README file'
|
|
|
|
|
|
help-board-dirs := $(addprefix help-,$(board-dirs))
|
|
|
|
help-boards: $(help-board-dirs)
|
|
|
|
boards-per-dir = $(sort $(notdir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/$*/*_defconfig)))
|
|
|
|
$(help-board-dirs): help-%:
|
|
@echo 'Architecture specific targets ($(SRCARCH) $*):'
|
|
@$(if $(boards-per-dir), \
|
|
$(foreach b, $(boards-per-dir), \
|
|
printf " %-24s - Build for %s\\n" $*/$(b) $(subst _defconfig,,$(b));) \
|
|
echo '')
|
|
|
|
|
|
# Documentation targets
|
|
# ---------------------------------------------------------------------------
|
|
DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
|
|
linkcheckdocs dochelp refcheckdocs
|
|
PHONY += $(DOC_TARGETS)
|
|
$(DOC_TARGETS):
|
|
$(Q)$(MAKE) $(build)=Documentation $@
|
|
|
|
# Misc
|
|
# ---------------------------------------------------------------------------
|
|
|
|
PHONY += scripts_gdb
|
|
scripts_gdb: prepare0
|
|
$(Q)$(MAKE) $(build)=scripts/gdb
|
|
$(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py)
|
|
|
|
ifdef CONFIG_GDB_SCRIPTS
|
|
all: scripts_gdb
|
|
endif
|
|
|
|
else # KBUILD_EXTMOD
|
|
|
|
###
|
|
# External module support.
|
|
# When building external modules the kernel used as basis is considered
|
|
# read-only, and no consistency checks are made and the make
|
|
# system is not used on the basis kernel. If updates are required
|
|
# in the basis kernel ordinary make commands (without M=...) must
|
|
# be used.
|
|
#
|
|
# The following are the only valid targets when building external
|
|
# modules.
|
|
# make M=dir clean Delete all automatically generated files
|
|
# make M=dir modules Make all modules in specified dir
|
|
# make M=dir Same as 'make M=dir modules'
|
|
# make M=dir modules_install
|
|
# Install the modules built in the module directory
|
|
# Assumes install directory is already created
|
|
|
|
# We are always building only modules.
|
|
KBUILD_BUILTIN :=
|
|
KBUILD_MODULES := 1
|
|
|
|
build-dirs := $(KBUILD_EXTMOD)
|
|
PHONY += modules
|
|
modules: $(MODORDER)
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
|
|
|
$(MODORDER): descend
|
|
@:
|
|
|
|
PHONY += modules_install
|
|
modules_install: _emodinst_ _emodinst_post
|
|
|
|
install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
|
|
PHONY += _emodinst_
|
|
_emodinst_:
|
|
$(Q)mkdir -p $(MODLIB)/$(install-dir)
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
|
|
|
|
PHONY += _emodinst_post
|
|
_emodinst_post: _emodinst_
|
|
$(call cmd,depmod)
|
|
|
|
compile_commands.json: $(extmod-prefix)compile_commands.json
|
|
PHONY += compile_commands.json
|
|
|
|
clean-dirs := $(KBUILD_EXTMOD)
|
|
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps \
|
|
$(KBUILD_EXTMOD)/compile_commands.json $(KBUILD_EXTMOD)/.thinlto-cache
|
|
|
|
PHONY += help
|
|
help:
|
|
@echo ' Building external modules.'
|
|
@echo ' Syntax: make -C path/to/kernel/src M=$$PWD target'
|
|
@echo ''
|
|
@echo ' modules - default target, build the module(s)'
|
|
@echo ' modules_install - install the module'
|
|
@echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'
|
|
@echo ' (default: $(abspath $(INSTALL_HDR_PATH)))'
|
|
@echo ' clean - remove generated files in module directory only'
|
|
@echo ''
|
|
|
|
# no-op for external module builds
|
|
PHONY += prepare modules_prepare
|
|
|
|
endif # KBUILD_EXTMOD
|
|
|
|
# Single targets
|
|
# ---------------------------------------------------------------------------
|
|
# To build individual files in subdirectories, you can do like this:
|
|
#
|
|
# make foo/bar/baz.s
|
|
#
|
|
# The supported suffixes for single-target are listed in 'single-targets'
|
|
#
|
|
# To build only under specific subdirectories, you can do like this:
|
|
#
|
|
# make foo/bar/baz/
|
|
|
|
ifdef single-build
|
|
|
|
# .ko is special because modpost is needed
|
|
single-ko := $(sort $(filter %.ko, $(MAKECMDGOALS)))
|
|
single-no-ko := $(sort $(patsubst %.ko,%.mod, $(MAKECMDGOALS)))
|
|
|
|
$(single-ko): single_modpost
|
|
@:
|
|
$(single-no-ko): descend
|
|
@:
|
|
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
# For the single build of in-tree modules, use a temporary file to avoid
|
|
# the situation of modules_install installing an invalid modules.order.
|
|
MODORDER := .modules.tmp
|
|
endif
|
|
|
|
PHONY += single_modpost
|
|
single_modpost: $(single-no-ko) modules_prepare
|
|
$(Q){ $(foreach m, $(single-ko), echo $(extmod-prefix)$m;) } > $(MODORDER)
|
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
|
|
|
KBUILD_MODULES := 1
|
|
|
|
export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod-prefix), $(single-no-ko))
|
|
|
|
# trim unrelated directories
|
|
build-dirs := $(foreach d, $(build-dirs), \
|
|
$(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d)))
|
|
|
|
endif
|
|
|
|
ifndef CONFIG_MODULES
|
|
KBUILD_MODULES :=
|
|
endif
|
|
|
|
# Handle descending into subdirectories listed in $(build-dirs)
|
|
# Preset locale variables to speed up the build process. Limit locale
|
|
# tweaks to this spot to avoid wrong language settings when running
|
|
# make menuconfig etc.
|
|
# Error messages still appears in the original language
|
|
PHONY += descend $(build-dirs)
|
|
descend: $(build-dirs)
|
|
$(build-dirs): prepare
|
|
$(Q)$(MAKE) $(build)=$@ \
|
|
single-build=$(if $(filter-out $@/, $(filter $@/%, $(KBUILD_SINGLE_TARGETS))),1) \
|
|
need-builtin=1 need-modorder=1
|
|
|
|
clean-dirs := $(addprefix _clean_, $(clean-dirs))
|
|
PHONY += $(clean-dirs) clean
|
|
$(clean-dirs):
|
|
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
|
|
|
|
clean: $(clean-dirs)
|
|
$(call cmd,rmfiles)
|
|
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
|
|
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
|
|
-o -name '*.ko.*' \
|
|
-o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
|
|
-o -name '*.dwo' -o -name '*.lst' \
|
|
-o -name '*.su' -o -name '*.mod' \
|
|
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
|
|
-o -name '*.lex.c' -o -name '*.tab.[ch]' \
|
|
-o -name '*.asn1.[ch]' \
|
|
-o -name '*.symtypes' -o -name 'modules.order' \
|
|
-o -name '.tmp_*.o.*' \
|
|
-o -name '*.c.[012]*.*' \
|
|
-o -name '*.ll' \
|
|
-o -name '*.gcno' \
|
|
-o -name '*.*.symversions' \) -type f -print | xargs rm -f
|
|
|
|
# Generate tags for editors
|
|
# ---------------------------------------------------------------------------
|
|
quiet_cmd_tags = GEN $@
|
|
cmd_tags = $(BASH) $(srctree)/scripts/tags.sh $@
|
|
|
|
tags TAGS cscope gtags: FORCE
|
|
$(call cmd,tags)
|
|
|
|
# Script to generate missing namespace dependencies
|
|
# ---------------------------------------------------------------------------
|
|
|
|
PHONY += nsdeps
|
|
nsdeps: export KBUILD_NSDEPS=1
|
|
nsdeps: modules
|
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/nsdeps
|
|
|
|
# Clang Tooling
|
|
# ---------------------------------------------------------------------------
|
|
|
|
quiet_cmd_gen_compile_commands = GEN $@
|
|
cmd_gen_compile_commands = $(PYTHON3) $< -a $(AR) -o $@ $(filter-out $<, $(real-prereqs))
|
|
|
|
$(extmod-prefix)compile_commands.json: scripts/clang-tools/gen_compile_commands.py \
|
|
$(if $(KBUILD_EXTMOD),,$(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)) \
|
|
$(if $(CONFIG_MODULES), $(MODORDER)) FORCE
|
|
$(call if_changed,gen_compile_commands)
|
|
|
|
targets += $(extmod-prefix)compile_commands.json
|
|
|
|
PHONY += clang-tidy clang-analyzer
|
|
|
|
ifdef CONFIG_CC_IS_CLANG
|
|
quiet_cmd_clang_tools = CHECK $<
|
|
cmd_clang_tools = $(PYTHON3) $(srctree)/scripts/clang-tools/run-clang-tools.py $@ $<
|
|
|
|
clang-tidy clang-analyzer: $(extmod-prefix)compile_commands.json
|
|
$(call cmd,clang_tools)
|
|
else
|
|
clang-tidy clang-analyzer:
|
|
@echo "$@ requires CC=clang" >&2
|
|
@false
|
|
endif
|
|
|
|
# Scripts to check various things for consistency
|
|
# ---------------------------------------------------------------------------
|
|
|
|
PHONY += includecheck versioncheck coccicheck export_report
|
|
|
|
includecheck:
|
|
find $(srctree)/* $(RCS_FIND_IGNORE) \
|
|
-name '*.[hcS]' -type f -print | sort \
|
|
| xargs $(PERL) -w $(srctree)/scripts/checkincludes.pl
|
|
|
|
versioncheck:
|
|
find $(srctree)/* $(RCS_FIND_IGNORE) \
|
|
-name '*.[hcS]' -type f -print | sort \
|
|
| xargs $(PERL) -w $(srctree)/scripts/checkversion.pl
|
|
|
|
coccicheck:
|
|
$(Q)$(BASH) $(srctree)/scripts/$@
|
|
|
|
export_report:
|
|
$(PERL) $(srctree)/scripts/export_report.pl
|
|
|
|
PHONY += checkstack kernelrelease kernelversion image_name
|
|
|
|
# UML needs a little special treatment here. It wants to use the host
|
|
# toolchain, so needs $(SUBARCH) passed to checkstack.pl. Everyone
|
|
# else wants $(ARCH), including people doing cross-builds, which means
|
|
# that $(SUBARCH) doesn't work here.
|
|
ifeq ($(ARCH), um)
|
|
CHECKSTACK_ARCH := $(SUBARCH)
|
|
else
|
|
CHECKSTACK_ARCH := $(ARCH)
|
|
endif
|
|
checkstack:
|
|
$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
|
|
$(PERL) $(srctree)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
|
|
|
|
kernelrelease:
|
|
@echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion \
|
|
$(srctree) $(BRANCH) $(KMI_GENERATION))"
|
|
|
|
kernelversion:
|
|
@echo $(KERNELVERSION)
|
|
|
|
image_name:
|
|
@echo $(KBUILD_IMAGE)
|
|
|
|
# Clear a bunch of variables before executing the submake
|
|
|
|
ifeq ($(quiet),silent_)
|
|
tools_silent=s
|
|
endif
|
|
|
|
tools/: FORCE
|
|
$(Q)mkdir -p $(objtree)/tools
|
|
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
|
|
|
|
tools/%: FORCE
|
|
$(Q)mkdir -p $(objtree)/tools
|
|
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
|
|
|
|
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
|
|
cmd_rmfiles = rm -rf $(rm-files)
|
|
|
|
# Run depmod only if we have System.map and depmod is executable
|
|
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
|
|
cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
|
|
$(KERNELRELEASE)
|
|
|
|
# read saved command lines for existing targets
|
|
existing-targets := $(wildcard $(sort $(targets)))
|
|
|
|
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
|
|
|
|
endif # config-build
|
|
endif # mixed-build
|
|
endif # need-sub-make
|
|
|
|
PHONY += FORCE
|
|
FORCE:
|
|
|
|
# Declare the contents of the PHONY variable as phony. We keep that
|
|
# information in a variable so we can use it in if_changed and friends.
|
|
.PHONY: $(PHONY)
|