50 Commits

Author SHA1 Message Date
Nicholas Piggin
048594d477 BACKPORT: kbuild: add arch specific post-link Makefile
Allow architectures to create arch/xxx/Makefile.postlink with targets
for vmlinux, modules.ko, and clean, which will be invoked after final
linking of vmlinux and modules.

powerpc will use this to check vmlinux linker relocations for sanity,
and may use it to fix up alternate instruction patch branch addresses.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
(cherry picked from commit fbe6e37dab974dd0fc3660c001895f7bfd771c9a)

Change-Id: Ic312087b1dc0e19797ea1bde54e61e84b300c45b
Signed-off-by: Dan Aloni <daloni@magicleap.com>
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
2022-11-15 21:35:30 +01:00
Nathan Chancellor
0a9e3a1ce1 Merge branch 'android-msm-wahoo-4.4-q-preview' into android-msm-wahoo-4.4
* android-msm-wahoo-4.4-q-preview:
  soc: qcom: smem: Add secure device check for smem dump
  qcacld-3.0: Fix buffer overflow in htt_t2h_msg_handler_fast
  qcacld-3.0: Fix possible OOB in wma_unified_radio_tx_mem_free()
  diag: dci: Validate dci client entries prior read
  msm: camera_v2: handle the error value returned during get clock
  msm: kgsl: Fix race condition while making page as dirty
  lsm: check payload size validity before using it as array index
  qcacld-3.0: Remove off-by-one write condition in sch_beacon_process
  dsp: asm: validate payload size before access
  drivers: soc: qcom: Added check to avoid opening multiple instance
  drivers: soc: Synchronize apr callback and voice svc release
  UPSTREAM: binder: check for overflow when alloc for security context
  msm: adsprpc: use same CPU address during DMA allocation and free
  msm: ADSPRPC: Update correct VA to user space
  msm: kgsl: Prevent race condition when freeing memory
  Revert "msm: kgsl: Offload mementry destroy work to separate thread"
  arm64/config: integrate hang/locking/memory debug configs into memory debug
  icnss: Not capture msa dump for modem watchdog bite reset
  lib/bug.c: make panic_on_warn available for all architectures
  arm64/config: enable CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE in debug build configs.
  arm64/config: support panic on warn by config
  misc: mnh-thermal: register a cooling device.
  arm64/configs: wahoo: Expand USB HID game controller support
  iommu: do not attempt reclaim on higher order allocs
  msm: adsprpc: allocate all remote memory in kernel
  net: ipc_router: Initialize the sockaddr in recvmsg() handler
  msm: asm: Remove redundant payload size check
  msm: asm: validate ADSP data size before access
  dts: taimen: lower fg-temp charging factor & comp on high temp
  battery: fix htc_battery_probe abort in charger mode
  subsystem_restart: Not capture ssrdump as detected specific pattern
  soc: qcom: glink: Return error in case of invalid input
  soc: qcom: Validate read and write index before calculating ptr
  dsp: q6voice: Check size of shared memory buffer before access
  msm: ice: check for crypto engine availability
  qseecom: fix kclient free issue in qseecom_remove
  dsp: codecs: fix range check for audio buffer copying
  fbdev/msm: sanitize debugfs inputs when reading mdp memory
  msm: jpegdma: Fix for ASAN issues in jpegdma module
  qdsp6v2: apr: check for packet size to header size comparison
  ARM: dts: msm: Untrusted pointer dereference
  msm: ipa: Fix to validate the buffer size
  msm: adsprpc: destroy mutex before file free
  i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA
  audio: remove static variable in capture copy
  qcacld-3.0: Return proper error on request id mapping failure
  qcacld-3.0: OOB read while processing extscan change results
  icnss: Add check on msa region
  input: misc: vl53L0 security vulnerability fix
  ANDROID: clang: upgrade wahoo to 9.0.3
  touchscreen: synaptics_dsx: prevent NULL pointer dereference
  diag: block WDSP mask transmission
  mm: mm_event: remove get/put_online_cpus call
  iommu: dma-mapping-fast: Add a check for count in fast_smmu_alloc
  ion: fix a possible memory leak in ion_cma_allocate
  input: qpnp-power-on: correct Power-off reason of PMIC FAULT cases
  qcacld-3.0: Unset sme roaming in progress after roam synch complete
  qcacld-3.0: Fix use after free of pCurRoamProfile
  ANDROID: tracing: fix race condition reading saved tgids
  qcacld-3.0: Send frames with GCMP MIC LEN if encryption is GCMP
  BACKPORT: USB: dwc3-msm: Protect enabling phy irqs with mutex
  SSM: Remove support for SSM driver
  ANDROID: drop CONFIG_INPUT_KEYCHORD from all
  msm: msm_bus: Fix error handling in msm_bus_device_probe
  msm: msm_bus: Fix error handling in msm_bus_device_init
  BACKPORT: userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
  diag: Prevent out of bound access while initializing msg mask
  diag: Update mask pointers after reallocation
  UPSTREAM: net: socket: set sock->sk to NULL after calling proto_ops::release()
  UPSTREAM: socket: close race condition between sock_close() and sockfs_setattr()
  arm64/configs: wahoo: simplify log buffer allocation
  kgsl: add GPU driver memory consumption in vmstat
  mm: add ION heap-pool allocation stat into vmstat
  BACKPORT: mm: add NR_ZSMALLOC to vmstat
  diag: Add missing protection while accessing session's info
  diag: Update mask buffer after reallocation
  diag: Fix diag msg mask buffer overflow issue
  diag: Fix possible usage of freed resource issue
  cpufreq: stats: optimize proc files
  msm: ipa3: Add mutex to prevent race condition
  lpm-levels: Remove kfree for memory allocated with devm_kzalloc
  msm: camera: cpp: Check for valid tx level
  wdsp: reset spi clk user if enable fails
  soc: qcom: Reorganize PIL code for reclaiming MSS mem during SSR
  qcacld-3.0: Update connect_timeout correctly in case of scan for ssid
  qcacld-3.0: Do not add MME for bcast non RMF action frames
  qcacld-3.0: Check channel_count in DCC_GET_STATS command
  qcacld-3.0: Fix possible integer underflow in cfg80211_rx_mgmt
  qcacld-3.0: check the data length when downloading firmware
  qcacld-3.0: Validate user input for null termination
  dm-bow: Add free list
  dm-bow: Do not block reads unnecessarily
  dm-bow: Fix crash in error handling
  ANDROID: sdcardfs: Add option to not link obb
  ANDROID: sdcardfs: Add sandbox
  ANDROID: sdcardfs: Add option to drop unused dentries
  ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero
  ANDROID: sdcardfs: Don't d_drop in d_revalidate
  ANDROID: sdcardfs: Set s_root to NULL after putting
  ANDROID: sdcardfs: d_make_root calls iput
  ANDROID: sdcardfs: Check for private data earlier
  ANDROID: sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
  ANDROID: sdcardfs: fix lock issue on 32 bit/SMP architectures
  ANDROID: sdcardfs: Set num in extension_details during make_item
  ANDROID: sdcardfs: Hold i_mutex for i_size_write
  ANDROID: sdcardfs: override credential for ioctl to lower fs
  ANDROID: sdcardfs: use mount_nodev and fix a issue in sdcardfs_kill_sb
  ANDROID: sdcardfs: remove dead function open_flags_to_access_mode()
  ANDROID: sdcardfs: d_splice_alias can return error values
  ANDROID: mnt: Propagate remount correctly
  arm64/config: wahoo: Set CONFIG_BLK_DEV_LOOP_MIN_COUNT to 16.
  qcacld-3.0: Possible OOB access in wlan_hdd_cfg80211_start_bss()
  qcacld-3.0: Fix possible integer overflow in lim
  qseecom: set rcv_req_flag to 0 when listener is just registered
  qseecom: do not wake up listener to receive request if it is not ready
  qseecom: check if listener is not ready to receive request
  qseecom: set listener id before sending registration scm_call
  qseecom: processing invalid listener request
  qseecom: change check_blocked flag to an u32 value
  qseecom: check if app is blocked when unloading app
  qseecom: abort all listener threads before listener unregistration
  mm: perproc-reclaim: do not discarding file-backed pages
  BACKPORT: mm: move lazily freed pages to inactive list
  mm: mm_event: remove unncessary comma of pgout
  Fix missing prebuilt kernels
  msm: mdss: Fix scalar LUT handling
  qcacld-3.0: Fix potential OOB read when check rx mgmt frames
  ANDROID: clang: upgrade wahoo to 8.0.9
  msm: mdss: use uaccess routines to access user space buffers
  FROMLIST: BACKPORT: overlayfs: override_creds=off option bypass creator_cred
  build.config: factor out common stuff
  BACKPORT: mm/debug.c: provide useful debugging information for VM_BUG
  qcacld-3.0: Dont pass source argument as nla_data to nla_memcpy
  qcacld-3.0: Avoid possible overflow while parsing scan ie
  qcacld-3.0: Fix possible OOB access in lim_process_assoc_req_frame
  qcacld-3.0: Fix possible OOB in lim_chk_n_process_wpa_rsn_ie
  qcacld-3.0: Validate all channels for avoid_freq channel list
  qcacld-3.0: Fix the double free for the txrx stats req
  qcacld-3.0: Implement descriptor pool for fw stats
  cfg80211: Fix use after free when process wdev events
  qcacld-3.0: OOB access may occur due to total numChannels exceeds max value
  qcacld-3.0: Fix possible heap overflow in lim_update_ext_cap_ie
  qcacld-3.0: Fix possible OOB access in lim_process_disassoc_frame
  qcacmn: Fix possible OOB access while sending NAN msg to firmware
  qcacmn: Fix possible buffer overflow in send_stats_ext_req_cmd_tlv
  qcacmn: Fix Uninitialized byte sent to FW in wmi_unified_cmd_send
  USB: rndis: Honor dl_max_packet_size value sent by host
  Add build.config.lts
  mm: fix passing active page into shrink_page_list
  msm: camera: Fix arbitrary kernel write
  ion: ensure valid start address
  ion: ensure CMO target is valid
  mm: readahead back to 128KB
  FROMGIT: loop: drop caches if offset or block_size are changed
  UPSTREAM: loop: Add LOOP_SET_BLOCK_SIZE in compat ioctl
  BACKPORT: block/loop: set hw_sectors
  UPSTREAM: loop: add ioctl for changing logical block size
  arm64/config: wahoo: enable overlayfs
  misc: mnh: check device number when stopping mipi
  FROMGIT: dm: do not allow readahead to limit IO size
  UPSTREAM: readahead: stricter check for bdi io_pages
  UPSTREAM: mm: don't cap request size based on read-ahead setting
  dm-bow: Handle TRIM mode better
  Add header version and size
  Handle variable sector sizes
  Enable dm-bow for checkpointing for wahoo kenrel
  Port dm-bow to 4.4
  [RFC] dm-bow working prototype
  wahoo_defconfig: enable CONFIG_MEMBARRIER
  thermal: create tz and cdev softlink in thermal class
  Release 5.2.1.1L
  qcacld-3.0: Enable SAE, OWE, GMAC
  qcacld-3.0: Enable SAE and GCMP by default
  qcacld-3.0: Changes to support DPP AKM
  qcacld-3.0: Reset rmfEnabled for STA VDEV during DEL BSS
  qcacld-3.0: Add suppport to forward GAS action frames to supplicant
  qcacld-3.0: Add support for GMAC offload
  qcacld-3.0: Trigger/handle SAE using cfg80211
  qcacld-3.0: Add support for SAE PMK caching
  qcacld-3.0: Add changes to handle SAE status
  qcacld-3.0: Disable roaming for SAE
  qcacld-3.0: Add SAE auth timer
  qcacld-3.0: Add changes to send SAE auth frame to user space
  qcacld-3.0: Add changes for auth in send mgmt path
  qcacld-3.0: Add changes to trigger SAE in supplicant
  qcacld-3.0: Add SAE related ini and cap exchange changes
  qcacld-3.0: Add support for SAE AKM suites
  qcacld-3.0: Add support for SuiteB AKM suites
  qcacld-3.0: Add support for GMAC cipher suite
  qcacld-3.0: Add support for GMAC MIC validation
  qcacld-3.0: Disable roaming for OWE
  qcacld-3.0: Add support for OWE
  qcacld-3.0: Add OWE IEs
  qcacld-3.0: Always send assoc req/rsp
  qcacmn: Add support for GMAC MIC calculation
  cfg80211: indicate support for external authentication
  nl80211: Fix external_auth check for offloaded authentication
  nl80211: Allow SAE Authentication for NL80211_CMD_CONNECT
  cfg80211/nl80211: Optional authentication offload to userspace
  cfg80211: NL80211_ATTR_SOCKET_OWNER support for CMD_CONNECT
  cfg80211: Updated nl80211_commands to be in sync with upstream
  mm: mm_event: comment about enum event type ordering
  mm: synchronize period update interval
  mm: mm_event supports vmstat
  power: qpnp-fg-gen3: fix soc not keeping full after charging overnight
  qcacld-3.0: Ignore special scan requests from CFG
  Revert "qcacld-3.0: Flush scan results on interface down"
  Revert "ANDROID: dm verity: add minimum prefetch size"
  qcacld-3.0: Forward NDP Indication event for NDP initiator
  reset/msm-poweroff: Fix to set reboot message
  pixel-2: enable CONFIG_PROCESS_RECLAIM
  mm: per-process reclaim
  Revert "mm: prevent to write out dirty page in CMA by may_writepage"
  Revert "mm: Per process reclaim"
  Revert "mm: make shrink_page_list with pages work from multiple zones"
  Revert "mm: Remove shrink_page"
  Revert "mm: Enhance per process reclaim to consider shared pages"
  Revert "mm: Support address range reclaim"
  Revert "mm: process reclaim: vmpressure based process reclaim"
  Revert "mm: process_reclaim: fix reclaim skip on low efficiency"
  Revert "mm: process_reclaim: do not iterate over stale task structs"
  Revert "mm: process_reclaim: use unbounded cpu workqueue"
  Make heap_name in ion trace points a copied char array
  BACKPORT: xfrm: Allow Output Mark to be Updated Using UPDSA
  ANDROID: clang: upgrade wahoo to 8.0.6
  cpufreq: times: add text versions of uid concurrent_*_time files
  qcacld: Fix compiler warning in policy mgr
  Enable CONFIG_THERMAL_EMULATION
  qcacld-3.0: Send roam_scan_mode as 0 for RSO Stop during disconnect
  sched/debug: Don't dump sched debug info in SysRq-W
  thermal: Create softlink by name for thermal_zone and cooling device
  UPSTREAM: HID: sony: remove redundant check for -ve err
  UPSTREAM: HID: sony: Make sure to unregister sensors on failure
  UPSTREAM: HID: sony: Make DS4 bt poll interval adjustable
  UPSTREAM: HID: sony: Set proper bit flags on DS4 output report
  UPSTREAM: HID: sony: DS4 use brighter LED colors
  UPSTREAM: HID: sony: Improve navigation controller axis/button mapping
  UPSTREAM: HID: sony: Use DS3 MAC address as unique identifier on USB
  UPSTREAM: HID: sony: Perform duplicate device check earlier on
  UPSTREAM: HID: sony: Expose DS3 motion sensors through separate device
  UPSTREAM: HID: sony: Print error on failure to active DS3 / Navigation controllers
  UPSTREAM: HID: sony: DS3 comply to Linux gamepad spec
  UPSTREAM: HID: sony: Mark DS4 touchpad device as a pointer
  UPSTREAM: HID: sony: Support motion sensor calibration on dongle
  UPSTREAM: HID: sony: Make work handling more generic
  UPSTREAM: HID: sony: Treat the ds4 dongle as a separate device
  UPSTREAM: HID: sony: Remove report descriptor fixup for DS4
  UPSTREAM: HID: sony: Report hardware timestamp for DS4 sensor values
  UPSTREAM: HID: sony: Calibrate DS4 motion sensors
  UPSTREAM: HID: sony: Report DS4 motion sensors through a separate device
  UPSTREAM: HID: sony: Fix input device leak when connecting a DS4 twice using USB/BT
  UPSTREAM: HID: sony: Use LED_CORE_SUSPENDRESUME
  UPSTREAM: HID: sony: Ignore DS4 dongle reports when no device is connected
  UPSTREAM: HID: sony: Use DS4 MAC address as unique identifier on USB
  UPSTREAM: HID: sony: Fix error handling bug when touchpad registration fails
  UPSTREAM: HID: sony: Comply to Linux gamepad spec for DS4
  UPSTREAM: HID: sony: Make the DS4 touchpad a separate device
  UPSTREAM: HID: sony: Fix memory issue when connecting device using both Bluetooth and USB
  UPSTREAM: HID: sony: Adjust value range for motion sensors
  UPSTREAM: HID: sony: Handle multiple touch events input record
  UPSTREAM: HID: sony: Send ds4 output reports on output end-point
  UPSTREAM: HID: sony: Perform CRC check on bluetooth input packets
  UPSTREAM: HID: sony: Adjust HID report size name definitions
  UPSTREAM: HID: sony: Fix race condition in sony_probe
  UPSTREAM: HID: sony: Update copyright and add Dualshock 4 rate control note
  UPSTREAM: HID: sony: Defer the initial USB Sixaxis output report
  UPSTREAM: HID: sony: Relax duplicate checking for USB-only devices
  UPSTREAM: HID: sony: underscores are unnecessary for u8, u16, s32
  UPSTREAM: HID: sony: fix some warnings from scripts/checkpatch.pl
  UPSTREAM: HID: sony: fix errors from scripts/checkpatch.pl
  UPSTREAM: HID: sony: fix a typo in descriptors comments s/Joystik/Joystick/
  UPSTREAM: HID: sony: Fixup output reports for the nyko core controller
  UPSTREAM: HID: sony: Remove the size check for the Dualshock 4 HID Descriptor
  UPSTREAM: HID: sony: Save and restore the controller state on suspend and resume
  UPSTREAM: HID: sony: Refactor the output report sending functions
  UPSTREAM: HID: sony: Support DS4 dongle
  UPSTREAM: HID: sony: Update device ids
  FROMLIST: ANDROID: binder: Add BINDER_GET_NODE_INFO_FOR_REF ioctl.
  FROMLIST: arm64: Build vDSO with -ffixed-x18
  usb: typec: Set min voltage as well
  scsi/ufs: print UFS health info in kernel log
  ion: add heap size change tracepoints
  clang: upgrade from clang 7.0.2 to 8.0.3
  mm: emit tracepoint when rss watermark is hit
  staging: bcm15602: Disable intentional panic by default
  arm64: untag user address in msm_cpp_copy_from_ioctl_ptr
  FROMLIST: selftests, arm64: add a selftest for passing tagged pointers to kernel
  FROMLIST: arm64: update Documentation/arm64/tagged-pointers.txt
  FROMLIST: fs, arm64: untag user address in copy_mount_options
  FROMLIST: lib, arm64: untag addrs passed to strncpy_from_user and strnlen_user
  FROMLIST: mm, arm64: untag user addresses in mm/gup.c
  FROMLIST: arm64: untag user addresses in access_ok and __uaccess_mask_ptr
  FROMLIST: uaccess: add untagged_addr definition for other arches
  FROMLIST: arm64: add type casts to untagged_addr macro
  UPSTREAM: arm64: Use pointer masking to limit uaccess speculation
  BACKPORT: arm64: barrier: Add CSDB macros to control data-value prediction
  UPSTREAM: arm64: uaccess: Formalise types for access_ok()
  BACKPORT: arm64: Make USER_DS an inclusive limit
  UPSTREAM: arm64: uaccess: Remove redundant __force from addr cast in __range_ok
  BACKPORT: arm64: move TASK_* definitions to <asm/processor.h>
  UPSTREAM: mm/gup.c: fix access_ok() argument type
  UPSTREAM: arm64: remove duplicate macro __KERNEL__ check
  UPSTREAM: arm64: print a fault message when attempting to write RO memory
  mm: enable MM_EVENT_STAT by default
  mm: mm_event: add read io stat
  mm: mm_event: add special kernel allocation stat
  mm: mm_event: add swapin stat
  mm: mm_event: add compaction stat
  mm: mm_event: add reclaim stat
  mm: mm_event: add page fault stat
  mm: mm_event: make capture period configurable
  mm: introduce per-process mm event tracking feature
  input: touchscreen: fix reported double free
  input: touchscreen: fix reported use after free
  usb: pd_engine: enable self powered device flag
  BACKPORT: usb: typec: tcpm: charge current handling for sink during hard
  BACKPORT: usb: typec: tcpm: Do not disconnect link for self powered devices
  Revert "Revert "arch/arm64/wahoo_defconfig: enable DEADLINE I/O scheduler""
  lge_battery: set ibat default current max
  PREUPLOAD: Add checkpatch hook
  wahoo_defconfig: remove unused governors
  Revert "BACKPORT: kbuild: allow archs to select link dead code/data elimination"
  Revert "UPSTREAM: kbuild: -ffunction-sections fix for archs with conflicting sections"
  Revert "UPSTREAM: kbuild: keep data tables through dead code elimination"
  Revert "UPSTREAM: kbuild: linker script do not match C names unless LD_DEAD_CODE_DATA_ELIMINATION is configured"
  Revert "kbuild: add ld-name macro and support for ld.gold"
  Revert "kbuild: fix CONFIG_LD_DEAD_CODE_DATA_ELIMINATION with ld.gold"
  Revert "arm64: keep .altinstructions and .altinstr_replacement"
  Revert "arm64: replace the mrs_s/msr_s macros for C callers"
  Revert "add build system support for clang LTO"
  Revert "add support for CONFIG_DYNAMIC_FTRACE with clang LTO"
  Revert "mod/empty.o: disable LTO"
  Revert "arch/arm64/crypto: disable LTO for aes-ce-cipher.c"
  Revert "drivers/firmware/efi/libstub: disable LTO"
  Revert "add a workaround for ld.gold crash with ARM64_MODULE_PLTS"
  Revert "add build.config.clang.lto"
  Update prebuilts-master/clang/host/linux-x86 to newer revision
  BACKPORT: sched/sysctl: Fix attributes of some extern declarations
  bcm15602: Intentionally panic on Easel PMIC reset
  Revert "Revert "misc: mnh-pwr: Update link status first on emergency shutdown""
  binder: Add instramentation to dump_ref_desc_tree()
  qcacld-3.0: Change random scan mac attributes to be optional
  Revert "misc: mnh-pwr: Update link status first on emergency shutdown"
  misc: mnh-pwr: Update link status first on emergency shutdown
  cpufreq_stats: Reset cpufreq_task_stats right after dup_task_struct
  tracing: do not leak kernel addresses
  fs/pstore/ramoops: Apply `decrypt_state' node sync for BootReceive

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2019-09-03 16:53:35 -07:00
Nathan Chancellor
c9a29e2bc4 Merge 4.4.190 into android-msm-wahoo-4.4
Changes in 4.4.190: (79 commits)
        usb: iowarrior: fix deadlock on disconnect
        sound: fix a memory leak bug
        x86/mm: Check for pfn instead of page in vmalloc_sync_one()
        x86/mm: Sync also unmappings in vmalloc_sync_all()
        mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()
        perf db-export: Fix thread__exec_comm()
        usb: yurex: Fix use-after-free in yurex_delete
        can: peak_usb: fix potential double kfree_skb()
        netfilter: nfnetlink: avoid deadlock due to synchronous request_module
        iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND
        mac80211: don't warn about CW params when not using them
        hwmon: (nct6775) Fix register address and added missed tolerance for nct6106
        cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init()
        s390/qdio: add sanity checks to the fast-requeue path
        ALSA: compress: Fix regression on compressed capture streams
        ALSA: compress: Prevent bypasses of set_params
        ALSA: compress: Be more restrictive about when a drain is allowed
        perf probe: Avoid calling freeing routine multiple times for same pointer
        ARM: davinci: fix sleep.S build error on ARMv4
        scsi: megaraid_sas: fix panic on loading firmware crashdump
        scsi: ibmvfc: fix WARN_ON during event pool release
        tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop
        perf/core: Fix creating kernel counters for PMUs that override event->cpu
        can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices
        can: peak_usb: pcan_usb_fd: Fix info-leaks to USB devices
        hwmon: (nct7802) Fix wrong detection of in4 presence
        ALSA: firewire: fix a memory leak bug
        mac80211: don't WARN on short WMM parameters from AP
        SMB3: Fix deadlock in validate negotiate hits reconnect
        smb3: send CAP_DFS capability during session setup
        mwifiex: fix 802.11n/WPA detection
        scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA
        sh: kernel: hw_breakpoint: Fix missing break in switch statement
        usb: gadget: f_midi: fail if set_alt fails to allocate requests
        USB: gadget: f_midi: fixing a possible double-free in f_midi
        mm/memcontrol.c: fix use after free in mem_cgroup_iter()
        ALSA: hda - Fix a memory leak bug
        HID: holtek: test for sanity of intfdata
        HID: hiddev: avoid opening a disconnected device
        HID: hiddev: do cleanup in failure of opening a device
        Input: kbtab - sanity check for endpoint type
        Input: iforce - add sanity checks
        net: usb: pegasus: fix improper read if get_registers() fail
        xen/pciback: remove set but not used variable 'old_state'
        irqchip/irq-imx-gpcv2: Forward irq type to parent
        perf header: Fix divide by zero error if f_header.attr_size==0
        perf header: Fix use of unitialized value warning
        libata: zpodd: Fix small read overflow in zpodd_get_mech_type()
        scsi: hpsa: correct scsi command status issue after reset
        ata: libahci: do not complain in case of deferred probe
        kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules
        IB/core: Add mitigation for Spectre V1
        ocfs2: remove set but not used variable 'last_hash'
        asm-generic: fix -Wtype-limits compiler warnings
        staging: comedi: dt3000: Fix signed integer overflow 'divider * base'
        staging: comedi: dt3000: Fix rounding up of timer divisor
        USB: core: Fix races in character device registration and deregistraion
        usb: cdc-acm: make sure a refcount is taken early enough
        USB: serial: option: add D-Link DWM-222 device ID
        USB: serial: option: Add support for ZTE MF871A
        USB: serial: option: add the BroadMobi BM818 card
        USB: serial: option: Add Motorola modem UARTs
        Backport minimal compiler_attributes.h to support GCC 9
        include/linux/module.h: copy __init/__exit attrs to init/cleanup_module
        arm64: compat: Allow single-byte watchpoints on all addresses
        Input: psmouse - fix build error of multiple definition
        asm-generic: default BUG_ON(x) to if(x)BUG()
        scsi: fcoe: Embed fc_rport_priv in fcoe_rport structure
        RDMA: Directly cast the sockaddr union to sockaddr
        IB/mlx5: Make coding style more consistent
        x86/vdso: Remove direct HPET access through the vDSO
        iommu/amd: Move iommu_init_pci() to .init section
        x86/boot: Disable the address-of-packed-member compiler warning
        net/packet: fix race in tpacket_snd()
        xen/netback: Reset nr_frags before freeing skb
        net/mlx5e: Only support tx/rx pause setting for port owner
        sctp: fix the transport error_count check
        bonding: Add vlan tx offload to hw_enc_features
        Linux 4.4.190

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Conflicts:
	sound/core/compress_offload.c
2019-08-25 08:22:16 -07:00
Masahiro Yamada
8188276206 kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules
[ Upstream commit cb4819934a7f9b87876f11ed05b8624c0114551b ]

KBUILD_EXTRA_SYMBOLS makes sense only when building external modules.
Moreover, the modpost sets 'external_module' if the -e option is given.

I replaced $(patsubst %, -e %,...) with simpler $(addprefix -e,...)
while I was here.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-25 10:53:00 +02:00
Sami Tolvanen
af6dfe0506 Revert "add build system support for clang LTO"
This reverts commit 1102ccb018.

Change-Id: I0ec5c214f620b72a5d5162c92d2737c7192ee544
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-09-10 12:06:28 -07:00
Sami Tolvanen
bfff6048aa Revert "add support for CONFIG_DYNAMIC_FTRACE with clang LTO"
This reverts commit 1d9af6fbcf.

Change-Id: I9f4887d281260913e448e3c7b6661597ff476457
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-09-10 11:50:36 -07:00
Sami Tolvanen
1d9af6fbcf add support for CONFIG_DYNAMIC_FTRACE with clang LTO
This change postpones recordmcount processing until after all LLVM IR
has been compiled into object files. In order to exclude the critical
functions in kernel/trace/ftrace.c from inspection, we add a new
code section .text..ftrace, where recordmcount doesn't look, and a
__norecordmcount attribute that allows functions to be moved to this
section.

Bug: 62093296
Change-Id: I4f79112d7c0919315ee61968890eb255d56282cf
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2017-10-25 13:42:15 -07:00
Sami Tolvanen
1102ccb018 add build system support for clang LTO
This change adds CONFIG_CLANG_LTO for clang's Link Time Optimization.

Bug: 62093296
Change-Id: Id9784f453189c02cea199437f5ff6736f2a75409
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2017-10-25 13:41:59 -07:00
Nicolas Boichat
47490ec141 modpost: Add flag -E for making section mismatches fatal
The section mismatch warning can be easy to miss during the kernel build
process. Allow it to be marked as fatal to be easily caught and prevent
bugs from slipping in.

Setting CONFIG_SECTION_MISMATCH_WARN_ONLY=y causes these warnings to be
non-fatal, since there are a number of section mismatches when using
allmodconfig on some architectures, and we do not want to break these
builds by default.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Change-Id: Ic346706e3297c9f0d790e3552aa94e5cff9897a6
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-10-06 10:46:21 +10:30
Guenter Roeck
eed380f3f5 modpost: Optionally ignore secondary errors seen if a single module build fails
Commit ea4054a23 (modpost: handle huge numbers of modules) added
support for building a large number of modules.

Unfortunately, the commit changed the semantics of the makefile: Instead of
passing only existing object files to modpost, make now passes all expected
object files. If make was started with option -i, this results in a modpost
error if a single file failed to build.

Example with the current btrfs build falure on m68k:

fs/btrfs/btrfs.o: No such file or directory
make[1]: [__modpost] Error 1 (ignored)

This error is followed by lots of errors such as:

m68k-linux-gcc: error: arch/m68k/emu/nfcon.mod.c: No such file or directory
m68k-linux-gcc: fatal error: no input files
compilation terminated.
make[1]: [arch/m68k/emu/nfcon.mod.o] Error 1 (ignored)

This doesn't matter much for normal builds, but it is annoying for builds
started with "make -i" due to the large number of secondary errors.
Those errors unnececessarily clog any error log and make it difficult
to find the real errors in the build.

Fix the problem by adding a new parameter '-n' to modpost. If this parameter
is specified, modpost reports but ignores missing object files.

With this patch, error output from above problem is (with make -i):

m68k-linux-ld: cannot find fs/btrfs/ioctl.o: No such file or directory
make[2]: [fs/btrfs/btrfs.o] Error 1 (ignored)
...
fs/btrfs/btrfs.o: No such file or directory (ignored)

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael Marek <mmarek@suse.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-09-23 15:45:03 +09:30
Rusty Russell
ea4054a238 modpost: handle huge numbers of modules.
strace shows:
72102 execve("/bin/sh", ["/bin/sh", "-c", "echo '  scripts/mod/modpost -m -a
-o /cc/wfg/sound-compiletest/Module.symvers      -s'; scripts/
mod/modpost -m -a -o /cc/wfg/sound-compiletest/Module.symvers      -s vmlinux
arch/x86/crypto/ablk_helper.o arch/x86/crypto/aes-i586.o arch
/x86/crypto/aesni-intel.o arch/x86/crypto/crc32-pclmul.o
...
drivers/ata/sata_promise.o "...], [/* 119 vars */] <unfinished ...>
71827 wait4(-1,  <unfinished ...>
72102 <... execve resumed> )            = -1 E2BIG (Argument list too long)

So we re-run the shell command which produces the list and feed it into modpost -T -.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-04-05 11:48:10 +10:30
Andreas Schwab
6543becf26 mod/file2alias: make modalias generation safe for cross compiling
Use the target compiler to compute the offsets for the fields of the
device_id structures, so that it won't be broken by different alignments
between the host and target ABIs.

This also fixes missing endian corrections for some modaliases.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-01-24 22:48:04 +01:00
Rusty Russell
e2a666d52b kbuild: sign the modules at install time
Linus deleted the old code and put signing on the install command,
I fixed it to extract the keyid and signer-name within sign-file
and cleaned up that script now it always signs in-place.

Some enthusiast should convert sign-key to perl and pull
x509keyid into it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-19 08:27:43 -07:00
Linus Torvalds
d25282d1c9 Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module signing support from Rusty Russell:
 "module signing is the highlight, but it's an all-over David Howells frenzy..."

Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.

* 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
  X.509: Fix indefinite length element skip error handling
  X.509: Convert some printk calls to pr_devel
  asymmetric keys: fix printk format warning
  MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
  MODSIGN: Make mrproper should remove generated files.
  MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
  MODSIGN: Use the same digest for the autogen key sig as for the module sig
  MODSIGN: Sign modules during the build process
  MODSIGN: Provide a script for generating a key ID from an X.509 cert
  MODSIGN: Implement module signature checking
  MODSIGN: Provide module signing public keys to the kernel
  MODSIGN: Automatically generate module signing keys if missing
  MODSIGN: Provide Kconfig options
  MODSIGN: Provide gitignore and make clean rules for extra files
  MODSIGN: Add FIPS policy
  module: signature checking hook
  X.509: Add a crypto key parser for binary (DER) X.509 certificates
  MPILIB: Provide a function to read raw data into an MPI
  X.509: Add an ASN.1 decoder
  X.509: Add simple ASN.1 grammar compiler
  ...
2012-10-14 13:39:34 -07:00
David Howells
80d65e58e9 MODSIGN: Sign modules during the build process
If CONFIG_MODULE_SIG is set, then this patch will cause all modules files to
to have signatures added.  The following steps will occur:

 (1) The module will be linked to foo.ko.unsigned instead of foo.ko

 (2) The module will be stripped using both "strip -x -g" and "eu-strip" to
     ensure minimal size for inclusion in an initramfs.

 (3) The signature will be generated on the stripped module.

 (4) The signature will be appended to the module, along with some information
     about the signature and a magic string that indicates the presence of the
     signature.

Step (3) requires private and public keys to be available.  By default these
are expected to be found in files:

	signing_key.priv
	signing_key.x509

in the base directory of the build.  The first is the private key in PEM form
and the second is the X.509 certificate in DER form as can be generated from
openssl:

	openssl req \
		-new -x509 -outform PEM -out signing_key.x509 \
		-keyout signing_key.priv -nodes \
		-subj "/CN=H2G2/O=Magrathea/CN=Slartibartfast"

If the secret key is not found then signing will be skipped and the unsigned
module from (1) will just be copied to foo.ko.

If signing occurs, lines like the following will be seen:

	LD [M]  fs/foo/foo.ko.unsigned
	STRIP [M] fs/foo/foo.ko.stripped
	SIGN [M] fs/foo/foo.ko

will appear in the build log.  If the signature step will be skipped and the
following will be seen:

	LD [M]  fs/foo/foo.ko.unsigned
	STRIP [M] fs/foo/foo.ko.stripped
	NO SIGN [M] fs/foo/foo.ko

NOTE!  After the signature step, the signed module _must_not_ be passed through
strip.  The unstripped, unsigned module is still available at the name on the
LD [M] line.  This restriction may affect packaging tools (such as rpmbuild)
and initramfs composition tools.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-10 20:06:33 +10:30
이건호
ef591a5506 scripts/Makefile.modpost: error in finding modules from .mod files.
This error may happen when the user's id or path includes .ko string.
For example, user's id is xxx.ko and building test.ko module,
the test.mod file lists ko name and all object files.
   /home/xxx.ko/kernel_dev/device/drivers/test.ko
   /home/xxx.ko/kernel_dev/device/drivers/test_main.o
/home/xxx.ko/kernel_dev/device/drivers/test_io.o ...
Current Makefile.modpost and Makefile.modinst find and list up not
only test.ko but also other object files.
because all of object file's path includes .ko string.
This is a patch to fix it.

Signed-off-by: Gunho Lee <gunho.lee@lge.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-08-31 17:37:54 +02:00
Michal Marek
2e483528ce Merge commit 'v3.0-rc1' into kbuild/kbuild 2011-06-07 15:37:51 +02:00
Geert Uytterhoeven
163d3fe6a2 kbuild: Fix reference to vermagic.h
It's "include/linux/vermagic.h", not "include/vermagic.h"

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-05-25 12:07:52 +02:00
Lucas De Marchi
25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Uwe Kleine-König
4696e2958b trivial: fix a typo in a filename
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 14:59:50 +02:00
Sam Ravnborg
6588169d51 kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line
It is now possible to assign options to AS, CC and LD
on the command line - which is only used when building modules.

{A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile
in the arch makefiles, thus users had no way to specify
additional options to AS, CC, LD when building modules
without overriding the original value.

Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE
that is used by arch specific files and free up
{A,C,LD}FLAGS_MODULE so they can be assigned on
the command line.

All arch Makefiles that used the old variables has been updated.

Note: Previously we had a MODFLAGS variable for both
AS and CC. But in favour of consistency this was dropped.
So in some cases arch Makefile has one assignmnet replaced by
two assignmnets.

Note2: MODFLAGS was not documented and is dropped
without any notice. I do not expect much/any breakage
from this.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> [avr32]
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03 14:09:45 +02:00
Christoph Hellwig
fc5377668c tracing: Remove markers
Now that the last users of markers have migrated to the event
tracer we can kill off the (now orphan) support code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090917173527.GA1699@lst.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-18 21:22:08 +02:00
Peter Volkov
92f83cc56e kbuild: fix KBUILD_EXTRA_SYMBOLS
Taken from http://bugzilla.kernel.org/show_bug.cgi?id=11567

If you even define KBUILD_EXTRA_SYMBOLS in Makefile it will not be expanded
into command line argument for modpost.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-10-29 22:02:09 +01:00
Mathieu Desnoyers
d35cb360c2 markers: fix duplicate modpost entry
When a kernel was rebuilt, the previous Module.markers was not cleared.
It caused markers with different format strings to appear as duplicates
when a markers was changed.  This problem is present since
scripts/mod/modpost.c started to generate Module.markers, commit
b2e3e658b3

It therefore applies to 2.6.25, 2.6.26 and linux-next.

I merely merged the patches from Roland, Wenji and Takashi here.

Credits to
Roland McGrath <roland@redhat.com>
Wenji Huang <wenji.huang@oracle.com>
and
Takashi Nishiie <t-nishiie@np.css.fujitsu.com>

for providing the individual fixes.

- Changelog :
  - Integrated Takashi's Makefile modification to clear Module.markers upon
    make clean.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Roland McGrath <roland@redhat.com>
Cc: Wenji Huang <wenji.huang@oracle.com>
Cc: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-22 09:59:41 -07:00
Sam Ravnborg
96d97f262a kbuild: fix $(src) assignmnet with external modules
When we introduced support for KBUILD_EXTRA_SYMBOLS
we started to include the externam module's kbuild
file when doing the final modpost step.

As external modules often do:
ccflags-y := -I$(src)

We had problems because $(src) was unassinged and
gcc then used the next parameter for -I resulting in
strange build failures.

Fix is to assign $(src) and $(obj) when building
external modules.

This fixes: http://bugzilla.kernel.org/show_bug.cgi?id=10798

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Tvrtko <tvrtko.ursulin@sophos.com>
Cc: Andrea Arcangeli <andrea@qumranet.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
2008-05-31 22:28:40 +02:00
Adrian Bunk
f5093913c0 kbuild: scripts/Makefile.modpost typo fix
-EVIUSER  ;-)

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-04-26 21:08:25 +02:00
Richard Hacker
0d96fb20b7 kbuild: Add new Kbuild variable KBUILD_EXTRA_SYMBOLS
This patch adds a new (Kbuild) Makefile variable KBUILD_EXTRA_SYMBOLS.
The space separated list of file names assigned to KBUILD_EXTRA_SYMBOLS
is used when calling scripts/mod/modpost during stage 2 of the Kbuild
process for non-kernel-tree modules.

Signed-off-by: Richard Hacker <lerichi@gmx.net>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-04-25 20:45:26 +02:00
Sam Ravnborg
4ce6efed48 kbuild: soften modpost checks when doing cross builds
The module alias support in the kernel have a consistency
check where it is checked that the size of a structure
in the kernel and on the build host are the same.
For cross builds this check does not make sense so detect
when we do cross builds and silently skip the check in these
situations.
This fixes a build bug for a wireless driver when cross building
for arm.

Acked-by: Michael Buesch <mb@bu3sch.de>
Tested-by: Gordon Farquharson <gordonfarquharson@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: stable@kernel.org
2008-03-23 21:38:54 +01:00
Mathieu Desnoyers
b2e3e658b3 Linux Kernel Markers: create modpost file
This adds some new magic in the MODPOST phase for CONFIG_MARKERS.  Analogous
to the Module.symvers file, the build will now write a Module.markers file
when CONFIG_MARKERS=y is set.  This file lists the name, defining module, and
format string of each marker, separated by \t characters.  This simple text
file can be used by offline build procedures for instrumentation code,
analogous to how System.map and Module.symvers can be useful to have for
kernels other than the one you are running right now.

The strings are made easy to extract by having the __trace_mark macro define
the name and format together in a single array called __mstrtab_* in the
__markers_strings section.  This is straightforward and reliable as long as
the marker structs are always defined by this macro.  It is an unreasonable
amount of hairy work to extract the string pointers from the __markers section
structs, which entails handling a relocation type for every machine under the
sun.

Mathieu :
- Ran through checkpatch.pl

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: David Smith <dsmith@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-13 16:21:20 -08:00
Sam Ravnborg
588ccd732b kbuild: add verbose option to Section mismatch reporting in modpost
If the config option CONFIG_SECTION_MISMATCH is not set and
we see a Section mismatch present the following to the user:

modpost: Found 1 section mismatch(es).
To see additional details select "Enable full Section mismatch analysis"
in the Kernel Hacking menu (CONFIG_SECTION_MISMATCH).

If the option CONFIG_SECTION_MISMATCH is selected
then be verbose in the Section mismatch reporting from mdopost.
Sample outputs:

WARNING: o-x86_64/vmlinux.o(.text+0x7396): Section mismatch in reference from the function discover_ebda() to the variable .init.data:ebda_addr
The function  discover_ebda() references
the variable __initdata ebda_addr.
This is often because discover_ebda lacks a __initdata
annotation or the annotation of ebda_addr is wrong.

WARNING: o-x86_64/vmlinux.o(.data+0x74d58): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
The variable pci_serial_quirks references
the function __devexit pci_plx9050_exit()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: o-x86_64/vmlinux.o(__ksymtab+0x630): Section mismatch in reference from the variable __ksymtab_arch_register_cpu to the function .cpuinit.text:arch_register_cpu()
The symbol arch_register_cpu is exported and annotated __cpuinit
Fix this by removing the __cpuinit annotation of arch_register_cpu or drop the export.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-01-28 23:21:18 +01:00
Roland McGrath
114f515777 kbuild: use LDFLAGS_MODULE only for .ko links
Sam Ravnborg pointed out that Documentation/kbuild/makefiles.txt already
says this is what it's for.  This patch makes the reality live up to the
documentation.  This fixes the problem of LDFLAGS_BUILD_ID getting into too
many places.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-07-25 21:18:19 +02:00
Sam Ravnborg
8d8d8289df kbuild: do not do section mismatch checks on vmlinux in 2nd pass
We already check and warn about section mismatches from vmlinux
(build as vmlinux.o) during first pass so skip the checks
during the 2nd pass where we process modules.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-07-25 21:14:15 +02:00
Sam Ravnborg
741f98fe29 kbuild: do section mismatch check on full vmlinux
Previously we did do the check on the .o files used to link
vmlinux but that failed to find questionable references across
the .o files.
Create a dedicated vmlinux.o file used only for section mismatch checks
that uses the defualt linker script so section does not get renamed.

The vmlinux.o may later be used as part of the the final link of vmlinux
but for now it is used fo section mismatch only.
For a defconfig build this is instant but for an allyesconfig this
add two minutes to a full build (that anyways takes ~2 hours).

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-07-17 10:54:06 +02:00
Sam Ravnborg
85bd2fddd6 kbuild: fix section mismatch check for vmlinux
vmlinux does not contain relocation entries which is
used by the section mismatch checks.
Reported by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Use the individual objects as inputs to overcome
this limitation.
In modpost check the .o files and skip non-ELF files.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-05-02 20:58:07 +02:00
Greg Banks
3f3fd3c055 [PATCH] kbuild: allow multi-word $M in Makefile.modpost
Some people want to do crazy things like pass multiple directories as the
value of $(SUBDIRS) or $M.  Mostly this kinda works, except that
Makefile.modpost constructs a modpost commandline which fails modpost's
argument parsing.  This patch fixes that little wrinkle.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-17 08:18:48 -07:00
Sam Ravnborg
ea837f1c05 kbuild: make modpost processing configurable
On request from Al Viro make modpost processing configurable.

KBUILD_MODPOST_WARN can be set to make modpost warn instead of
error out in case on unresolved symbols in final module link.

KBUILD_MODPOST_NOFINAL can be set to avoid the final and timeconsuming
.c file generation and link of .ko files. This is solely useful for
speeding up when doing compile checks with for example allmodconfig

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-10-01 11:35:24 +02:00
Kirill Korotaev
c53ddacdc0 kbuild: fail kernel compilation in case of unresolved module symbols
At stage 2 modpost utility is used to check modules.  In case of unresolved
symbols modpost only prints warning.

IMHO it is a good idea to fail compilation process in case of unresolved
symbols (at least in modules coming with kernel), since usually such errors
are left unnoticed, but kernel modules are broken.

- new option '-w' is added to modpost:
  if option is specified, modpost only warns about unresolved symbols

- modpost is called with '-w' for external modules in Makefile.modpost

Signed-off-by: Andrey Mirkin <amirkin@sw.ru>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-09-25 09:14:30 +02:00
Sam Ravnborg
12715d20af kbuild: modpost on vmlinux regardless of CONFIG_MODULES
Based on patch from: Magnus Damm <magnus@valinux.co.jp>
This has the advantage that all section mismatch checks are run regardless
of modules being enabled or not.

When running modpost on vmlinux output:
MODPOST vmlinux

When running modpost on modules output count of modules like this:
MODPOST 5 modules

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-09-25 09:01:49 +02:00
Dave Jones
0463f3c7a3 kbuild: fix typo in modpost
Reported by a Fedora user when they tried to build some out of tree module..

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-08-01 11:32:46 +02:00
Sam Ravnborg
5e8d780d74 kbuild: fix ia64 breakage after introducing make -rR
kbuild used $¤(*F to get filename of target without extension.
This was used in several places all over kbuild, but introducing
make -rR broke his for all cases where we specified full path to
target/prerequsite. It is assumed that make -rR disables old style
suffix-rules which is why is suddenly failed.

ia64 was impacted by this change because several div* routines in
arch/ia64/lib are build using explicit paths and then kbuild failed.

Thanks to David Mosberger-Tang <David.Mosberger@acm.org> for an explanation
what was the root-cause and for testing on ia64.

This patch also fixes two uses of $(*F) in arch/um

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-07-01 09:58:02 +02:00
Linus Torvalds
d38b69689c Revert "kbuild: fix make -rR breakage"
This reverts commit e5c44fd88c.

Thanks to Daniel Ritz and Michal Piotrowski for noticing the problem.

Daniel says:

  "[The] reason is a recent change that made modules always shows as
   module.mod.  it breaks modprobe and probably many scripts..besides
   lsmod looking horrible

   stuff like this in modprobe.conf:
        install pcmcia_core /sbin/modprobe --ignore-install pcmcia_core; /sbin/modprobe pcmcia
   makes modprobe fork/exec endlessly calling itself...until oom
   interrupts it"

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-26 16:59:26 -07:00
Sam Ravnborg
e5c44fd88c kbuild: fix make -rR breakage
make failed to supply the filename when using make -rR and using $(*F)
to get target filename without extension.
This bug was not reproduceable in small scale but using:
$(basename $(notdir $@)) fixes it with same functionality.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-06-24 23:13:59 +02:00
Roman Zippel
c955ccafc3 kconfig: fix .config dependencies
This fixes one of the worst kbuild warts left - the broken dependencies used
to check and regenerate the .config file.  This was done via an indirect
dependency and the .config itself had an empty command, which can cause make
not to reread the changed .config file.

Instead of this we generate now a new file include/config/auto.conf from
.config, which is used for kbuild and has the proper dependencies.  It's also
the main make target now for all files generated during this step (and thus
replaces include/linux/autoconf.h).

This also means we can now relax the syntax requirements for the .config file
and we don't have to rewrite it all the time, i.e.  silentoldconfig only
writes .config now when it's necessary to keep it in sync with the Kconfig
files and even this can be suppressed by setting the environment variable
KCONFIG_NOSILENTUPDATE, so the update can (and must) be done manually.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-06-09 07:31:30 +02:00
Linus Torvalds
2e1ca21d46 Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
* master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild: (46 commits)
  kbuild: remove obsoleted scripts/reference_* files
  kbuild: fix make help & make *pkg
  kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h
  Kconfig: remove the CONFIG_CC_ALIGN_* options
  kbuild: add -fverbose-asm to i386 Makefile
  kbuild: clean-up genksyms
  kbuild: Lindent genksyms.c
  kbuild: fix genksyms build error
  kbuild: in makefile.txt note that Makefile is preferred name for kbuild files
  kbuild: replace PHONY with FORCE
  kbuild: Fix bug in crc symbol generating of kernel and modules
  kbuild: change kbuild to not rely on incorrect GNU make behavior
  kbuild: when warning symbols exported twice now tell user this is the problem
  kbuild: fix make dir/file.xx when asm symlink is missing
  kbuild: in the section mismatch check try harder to find symbols
  kbuild: fix section mismatch check for unwind on IA64
  kbuild: kill false positives from section mismatch warnings for powerpc
  kbuild: kill trailing whitespace in modpost & friends
  kbuild: small update of allnoconfig description
  kbuild: make namespace.pl CROSS_COMPILE happy
  ...

Trivial conflict in arch/ppc/boot/Makefile manually fixed up
2006-03-25 08:48:48 -08:00
Uwe Zeisberger
c30fe7f731 fix typos "wich" -> "which"
Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-24 18:23:14 +01:00
Paul Smith
4f1933620f kbuild: change kbuild to not rely on incorrect GNU make behavior
The kbuild system takes advantage of an incorrect behavior in GNU make.
Once this behavior is fixed, all files in the kernel rebuild every time,
even if nothing has changed.  This patch ensures kbuild works with both
the incorrect and correct behaviors of GNU make.

For more details on the incorrect behavior, see:

http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html

Changes in this patch:
  - Keep all targets that are to be marked .PHONY in a variable, PHONY.
  - Add .PHONY: $(PHONY) to mark them properly.
  - Remove any $(PHONY) files from the $? list when determining whether
    targets are up-to-date or not.

Signed-off-by: Paul Smith <psmith@gnu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-03-06 00:09:51 +01:00
Sam Ravnborg
040fcc819a kbuild: improved modversioning support for external modules
With following patch a second option is enabled to obtain
symbol information from a second external module when a
external module is build.
The recommended approach is to use a common kbuild file but
that may be impractical in certain cases.
With this patch one can copy over a Module.symvers from one
external module to make symbols (and symbol versions) available
for another external module.

Updated documentation in Documentation/kbuild/modules.txt

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-02-19 09:51:18 +01:00
Adrian Bunk
943ffb587c spelling: s/retreive/retrieve/
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-01-10 00:10:13 +01:00
Sam Ravnborg
8ec4b4ff1c kbuild: introduce Kbuild.include
Kbuild.include is a placeholder for definitions originally present in
both the top-level Makefile and scripts/Makefile.build.
There were a slight difference in the filechk definition, so the most videly
used version was kept and usr/Makefile was adopted for this syntax.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
2005-07-25 20:10:36 +00:00
Linus Torvalds
1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00