8bbb4abad0
* refs/heads/tmp-dca02b1: ANDROID: GKI: Update abi_gki_aarch64_cuttlefish ANDROID: GKI: Update abi_gki_aarch64_exynos ANDROID: GKI: Update android/abi_gki_aarch64_sonywalkman BACKPORT: blk-mq: fix is_flush_rq BACKPORT: blk-mq: clearing flush request reference in tags->rqs[] BACKPORT: blk-mq: clear stale request in tags->rq[] before freeing one request pool BACKPORT: blk-mq: grab rq->refcount before calling ->fn in blk_mq_tagset_busy_iter ANDROID: gki_defconfig: set DEFAULT_MMAP_MIN_ADDR=32768 ANDROID: GKI: upate .xml file for new symbol addtions ANDROID: xt_quota2: set usersize in xt_match registration object ANDROID: xt_quota2: clear quota2_log message before sending ANDROID: xt_quota2: remove trailing junk which might have a digit in it UPSTREAM: io_uring: Fix current->fs handling in io_sq_wq_submit_work() ANDROID: ABI: Update allowed list for QCOM UPSTREAM: arm64: vdso: Avoid ISB after reading from cntvct_el0 ANDROID: GKI: Disable X86_MCE drivers ANDROID: GKI: Add FCNT KMI symbol list ANDROID: fuse: Allocate zeroed memory for canonical path ANDROID: ABI: Update allowed list for Microsoft ANDROID: GKI: add padding to struct hid_device ANDROID: Update android/abi_gki_aarch64.xml ANDROID: Update android/abi_gki_aarch64_goldfish ANDROID: generate_initcall_order.pl: Use two dash long options for llvm-nm Linux 5.4.134 seq_file: disallow extremely large seq buffer allocations misc: alcor_pci: fix inverted branch condition scsi: scsi_dh_alua: Fix signedness bug in alua_rtpg() MIPS: vdso: Invalid GIC access through VDSO mips: disable branch profiling in boot/decompress.o mips: always link byteswap helpers into decompressor scsi: be2iscsi: Fix an error handling path in beiscsi_dev_probe() firmware: turris-mox-rwtm: fail probing when firmware does not support hwrng firmware: turris-mox-rwtm: report failures better firmware: turris-mox-rwtm: fix reply status decoding function thermal/drivers/rcar_gen3_thermal: Fix coefficient calculations ARM: dts: imx6q-dhcom: Add gpios pinctrl for i2c bus recovery ARM: dts: imx6q-dhcom: Fix ethernet plugin detection problems ARM: dts: imx6q-dhcom: Fix ethernet reset time properties ARM: dts: am437x: align ti,pindir-d0-out-d1-in property with dt-shema ARM: dts: am335x: align ti,pindir-d0-out-d1-in property with dt-shema memory: fsl_ifc: fix leak of private memory on probe failure memory: fsl_ifc: fix leak of IO mapping on probe failure reset: bail if try_module_get() fails ARM: dts: BCM5301X: Fixup SPI binding firmware: arm_scmi: Reset Rx buffer to max size during async commands firmware: tegra: Fix error return code in tegra210_bpmp_init() ARM: dts: r8a7779, marzen: Fix DU clock names arm64: dts: renesas: v3msk: Fix memory size rtc: fix snprintf() checking in is_rtc_hctosys() memory: pl353: Fix error return code in pl353_smc_probe() reset: brcmstb: Add missing MODULE_DEVICE_TABLE memory: atmel-ebi: add missing of_node_put for loop iteration ARM: dts: exynos: fix PWM LED max brightness on Odroid XU4 ARM: dts: exynos: fix PWM LED max brightness on Odroid HC1 ARM: dts: exynos: fix PWM LED max brightness on Odroid XU/XU3 ARM: exynos: add missing of_node_put for loop iteration reset: a10sr: add missing of_match_table reference ARM: dts: gemini-rut1xx: remove duplicate ethernet node hexagon: use common DISCARDS macro NFSv4/pNFS: Don't call _nfs4_pnfs_v3_ds_connect multiple times ALSA: isa: Fix error return code in snd_cmi8330_probe() nvme-tcp: can't set sk_user_data without write_lock virtio_net: move tx vq operation under tx queue lock pwm: imx1: Don't disable clocks at device remove time x86/fpu: Limit xstate copy size in xstateregs_set() PCI: iproc: Support multi-MSI only on uniprocessor kernel PCI: iproc: Fix multi-MSI base vector number allocation ubifs: Set/Clear I_LINKABLE under i_lock for whiteout inode nfs: fix acl memory leak of posix_acl_create() watchdog: aspeed: fix hardware timeout calculation um: fix error return code in winch_tramp() um: fix error return code in slip_open() NFSv4: Initialise connection to the server in nfs4_alloc_client() power: supply: rt5033_battery: Fix device tree enumeration PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun f2fs: add MODULE_SOFTDEP to ensure crc32 is included in the initramfs x86/signal: Detect and prevent an alternate signal stack overflow virtio_console: Assure used length from device is limited virtio_net: Fix error handling in virtnet_restore() virtio-blk: Fix memory leak among suspend/resume procedure ACPI: video: Add quirk for the Dell Vostro 3350 ACPI: AMBA: Fix resource name in /proc/iomem pwm: tegra: Don't modify HW state in .remove callback pwm: img: Fix PM reference leak in img_pwm_enable() power: supply: ab8500: add missing MODULE_DEVICE_TABLE power: supply: charger-manager: add missing MODULE_DEVICE_TABLE NFS: nfs_find_open_context() may only select open files ceph: remove bogus checks and WARN_ONs from ceph_set_page_dirty orangefs: fix orangefs df output. PCI: tegra: Add missing MODULE_DEVICE_TABLE x86/fpu: Return proper error codes from user access functions watchdog: iTCO_wdt: Account for rebooting on second timeout watchdog: imx_sc_wdt: fix pretimeout watchdog: Fix possible use-after-free by calling del_timer_sync() watchdog: sc520_wdt: Fix possible use-after-free in wdt_turnoff() watchdog: Fix possible use-after-free in wdt_startup() PCI/P2PDMA: Avoid pci_get_slot(), which may sleep ARM: 9087/1: kprobes: test-thumb: fix for LLVM_IAS=1 power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE power: supply: max17042: Do not enforce (incorrect) interrupt trigger type power: supply: ab8500: Avoid NULL pointers pwm: spear: Don't modify HW state in .remove callback power: supply: sc2731_charger: Add missing MODULE_DEVICE_TABLE power: supply: sc27xx: Add missing MODULE_DEVICE_TABLE lib/decompress_unlz4.c: correctly handle zero-padding around initrds. i2c: core: Disable client irq on reboot/shutdown intel_th: Wait until port is in reset before programming it staging: rtl8723bs: fix macro value for 2.4Ghz only device ALSA: usb-audio: scarlett2: Fix 6i6 Gen 2 line out descriptions ALSA: hda: Add IRQ check for platform_get_irq() backlight: lm3630a: Fix return code of .update_status() callback ASoC: Intel: kbl_da7219_max98357a: shrink platform_id below 20 characters powerpc/boot: Fixup device-tree on little endian usb: gadget: hid: fix error return code in hid_bind() usb: gadget: f_hid: fix endianness issue with descriptors ALSA: usb-audio: scarlett2: Fix scarlett2_*_ctl_put() return values ALSA: usb-audio: scarlett2: Fix data_mutex lock ALSA: usb-audio: scarlett2: Fix 18i8 Gen 2 PCM Input count ALSA: bebob: add support for ToneWeal FW66 Input: hideep - fix the uninitialized use in hideep_nvm_unlock() s390/mem_detect: fix tprot() program check new psw handling s390/mem_detect: fix diag260() program check new psw handling s390/ipl_parm: fix program check new psw handling s390/processor: always inline stap() and __load_psw_mask() ASoC: soc-core: Fix the error return code in snd_soc_of_parse_audio_routing() gpio: pca953x: Add support for the On Semi pca9655 selftests/powerpc: Fix "no_handler" EBB selftest ALSA: ppc: fix error return code in snd_pmac_probe() gpio: zynq: Check return value of pm_runtime_get_sync iommu/arm-smmu: Fix arm_smmu_device refcount leak in address translation iommu/arm-smmu: Fix arm_smmu_device refcount leak when arm_smmu_rpm_get fails powerpc/ps3: Add dma_mask to ps3_dma_region ALSA: sb: Fix potential double-free of CSP mixer elements selftests: timers: rtcpie: skip test if default RTC device does not exist s390/sclp_vt220: fix console name to match device serial: tty: uartlite: fix console setup ASoC: img: Fix PM reference leak in img_i2s_in_probe() mfd: cpcap: Fix cpcap dmamask not set warnings mfd: da9052/stmpe: Add and modify MODULE_DEVICE_TABLE scsi: qedi: Fix null ref during abort handling scsi: iscsi: Fix shost->max_id use scsi: iscsi: Fix conn use after free during resets scsi: iscsi: Add iscsi_cls_conn refcount helpers scsi: megaraid_sas: Handle missing interrupts while re-enabling IRQs scsi: megaraid_sas: Early detection of VD deletion through RaidMap update scsi: megaraid_sas: Fix resource leak in case of probe failure fs/jfs: Fix missing error code in lmLogInit() scsi: scsi_dh_alua: Check for negative result value tty: serial: 8250: serial_cs: Fix a memory leak in error handling path ALSA: ac97: fix PM reference leak in ac97_bus_remove() scsi: core: Cap scsi_host cmd_per_lun at can_queue scsi: lpfc: Fix crash when lpfc_sli4_hba_setup() fails to initialize the SGLs scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology scsi: hisi_sas: Propagate errors in interrupt_init_v1_hw() w1: ds2438: fixing bug that would always get page0 Revert "ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro" ALSA: usx2y: Don't call free_pages_exact() with NULL address iio: magn: bmc150: Balance runtime pm + use pm_runtime_resume_and_get() iio: gyro: fxa21002c: Balance runtime pm + use pm_runtime_resume_and_get(). misc: alcor_pci: fix null-ptr-deref when there is no PCI bridge misc/libmasm/module: Fix two use after free in ibmasm_init_one tty: serial: fsl_lpuart: fix the potential risk of division or modulo by zero srcu: Fix broken node geometry after early ssp init dmaengine: fsl-qdma: check dma_set_mask return value net: moxa: Use devm_platform_get_and_ioremap_resource() fbmem: Do not delete the mode that is still in use cgroup: verify that source is a string tracing: Do not reference char * as a string in histograms scsi: core: Fix bad pointer dereference when ehandler kthread is invalid KVM: X86: Disable hardware breakpoints unconditionally before kvm_x86->run() KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled KVM: mmio: Fix use-after-free Read in kvm_vm_ioctl_unregister_coalesced_mmio Revert "media: subdev: disallow ioctl for saa6588/davinci" Linux 5.4.133 smackfs: restrict bytes count in smk_set_cipso() jfs: fix GPF in diFree pinctrl: mcp23s08: Fix missing unlock on error in mcp23s08_irq() media: uvcvideo: Fix pixel format change for Elgato Cam Link 4K media: gspca/sunplus: fix zero-length control requests media: gspca/sq905: fix control-request direction media: zr364xx: fix memory leak in zr364xx_start_readpipe media: dtv5100: fix control-request directions media: subdev: disallow ioctl for saa6588/davinci PCI: aardvark: Implement workaround for the readback value of VEND_ID PCI: aardvark: Fix checking for PIO Non-posted Request PCI: Leave Apple Thunderbolt controllers on for s2idle or standby dm btree remove: assign new_root only when removal succeeds coresight: tmc-etf: Fix global-out-of-bounds in tmc_update_etf_buffer() ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe tracing: Resize tgid_map to pid_max, not PID_MAX_DEFAULT tracing: Simplify & fix saved_tgids logic rq-qos: fix missed wake-ups in rq_qos_throttle try two seq_buf: Fix overflow in seq_buf_putmem_hex() extcon: intel-mrfld: Sync hardware and software state on init nvmem: core: add a missing of_node_put power: supply: ab8500: Fix an old bug ubifs: Fix races between xattr_{set|get} and listxattr operations thermal/drivers/int340x/processor_thermal: Fix tcc setting ipmi/watchdog: Stop watchdog timer when the current action is 'none' qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute ASoC: tegra: Set driver_name=tegra for all machine drivers MIPS: fix "mipsel-linux-ld: decompress.c:undefined reference to `memmove'" fpga: stratix10-soc: Add missing fpga_mgr_free() call clocksource/arm_arch_timer: Improve Allwinner A64 timer workaround cpu/hotplug: Cure the cpusets trainwreck ata: ahci_sunxi: Disable DIPM mmc: core: Allow UHS-I voltage switch for SDSC cards if supported mmc: core: clear flags before allowing to retune mmc: sdhci: Fix warning message when accessing RPMB in HS400 mode drm/arm/malidp: Always list modifiers drm/msm/mdp4: Fix modifier support enabling drm/tegra: Don't set allow_fb_modifiers explicitly drm/amd/display: Reject non-zero src_y and src_x for video planes pinctrl/amd: Add device HID for new AMD GPIO controller drm/amd/display: fix incorrrect valid irq check drm/rockchip: dsi: remove extra component_del() call drm/radeon: Add the missed drm_gem_object_put() in radeon_user_framebuffer_create() drm/amdgpu: Update NV SIMD-per-CU to 2 powerpc/barrier: Avoid collision with clang's __lwsync macro powerpc/mm: Fix lockup on kernel exec fault perf bench: Fix 2 memory sanitizer warnings crypto: ccp - Annotate SEV Firmware file names fscrypt: don't ignore minor_hash when hash is 0 MIPS: set mips32r5 for virt extensions MIPS: loongsoon64: Reserve memory below starting pfn to prevent Oops sctp: add size validation when walking chunks sctp: validate from_addr_param return Bluetooth: btusb: fix bt fiwmare downloading failure issue for qca btsoc. Bluetooth: Shutdown controller after workqueues are flushed or cancelled Bluetooth: Fix the HCI to MGMT status conversion table Bluetooth: btusb: Fixed too many in-token issue for Mediatek Chip. RDMA/cma: Fix rdma_resolve_route() memory leak net: ip: avoid OOM kills with large UDP sends over loopback media, bpf: Do not copy more entries than user space requested wireless: wext-spy: Fix out-of-bounds warning sfc: error code if SRIOV cannot be disabled sfc: avoid double pci_remove of VFs iwlwifi: pcie: fix context info freeing iwlwifi: pcie: free IML DMA memory allocation iwlwifi: mvm: don't change band on bound PHY contexts RDMA/rxe: Don't overwrite errno from ib_umem_get() vsock: notify server to shutdown when client has pending signal atm: nicstar: register the interrupt handler in the right place atm: nicstar: use 'dma_free_coherent' instead of 'kfree' MIPS: add PMD table accounting into MIPS'pmd_alloc_one rtl8xxxu: Fix device info for RTL8192EU devices drm/amdkfd: Walk through list with dqm lock hold net: sched: fix error return code in tcf_del_walker() net: fix mistake path for netdev_features_strings mt76: mt7615: fix fixed-rate tx status reporting bpf: Fix up register-based shifts in interpreter to silence KUBSAN cw1200: add missing MODULE_DEVICE_TABLE wl1251: Fix possible buffer overflow in wl1251_cmd_scan wlcore/wl12xx: Fix wl12xx get_mac error if device is in ELP xfrm: Fix error reporting in xfrm_state_construct. drm/amd/display: Verify Gamma & Degamma LUT sizes in amdgpu_dm_atomic_check r8169: avoid link-up interrupt issue on RTL8106e if user enables ASPM selinux: use __GFP_NOWARN with GFP_NOWAIT in the AVC fjes: check return value after calling platform_get_resource() drm/amdkfd: use allowed domain for vmbo validation drm/amd/display: Set DISPCLK_MAX_ERRDET_CYCLES to 7 drm/amd/display: Release MST resources on switch from MST to SST drm/amd/display: Update scaling settings on modeset net: micrel: check return value after calling platform_get_resource() net: mvpp2: check return value after calling platform_get_resource() net: bcmgenet: check return value after calling platform_get_resource() virtio_net: Remove BUG() to avoid machine dead ice: set the value of global config lock timeout longer pinctrl: mcp23s08: fix race condition in irq handler dm space maps: don't reset space map allocation cursor when committing RDMA/cxgb4: Fix missing error code in create_qp() ipv6: use prandom_u32() for ID generation clk: tegra: Ensure that PLLU configuration is applied properly clk: renesas: r8a77995: Add ZA2 clock drm/bridge: cdns: Fix PM reference leak in cdns_dsi_transfer() igb: handle vlan types with checker enabled e100: handle eeprom as little endian udf: Fix NULL pointer dereference in udf_symlink function drm/sched: Avoid data corruptions drm/virtio: Fix double free on probe failure reiserfs: add check for invalid 1st journal block drm/mediatek: Fix PM reference leak in mtk_crtc_ddp_hw_init() net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT atm: nicstar: Fix possible use-after-free in nicstar_cleanup() mISDN: fix possible use-after-free in HFC_cleanup() atm: iphase: fix possible use-after-free in ia_module_exit() hugetlb: clear huge pte during flush function on mips platform drm/amd/display: fix use_max_lb flag for 420 pixel formats net: pch_gbe: Use proper accessors to BE data in pch_ptp_match() drm/vc4: fix argument ordering in vc4_crtc_get_margins() drm/amd/amdgpu/sriov disable all ip hw status by default drm/zte: Don't select DRM_KMS_FB_HELPER drm/mxsfb: Don't select DRM_KMS_FB_HELPER ANDROID: GKI: fix up crc change in ip.h Linux 5.4.132 iommu/dma: Fix compile warning in 32-bit builds scsi: core: Retry I/O for Notify (Enable Spinup) Required error mmc: vub3000: fix control-request direction mmc: block: Disable CMDQ on the ioctl path block: return the correct bvec when checking for gaps scsi: target: cxgbit: Unmap DMA buffer before calling target_execute_cmd() perf llvm: Return -ENOMEM when asprintf() fails selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random mm/z3fold: fix potential memory leak in z3fold_destroy_pool() mm/huge_memory.c: don't discard hugepage if other processes are mapping it vfio/pci: Handle concurrent vma faults arm64: dts: marvell: armada-37xx: Fix reg for standard variant of UART serial: mvebu-uart: correctly calculate minimal possible baudrate serial: mvebu-uart: do not allow changing baudrate when uartclk is not available powerpc: Offline CPU in stop_this_cpu() leds: ktd2692: Fix an error handling path leds: as3645a: Fix error return code in as3645a_parse_node() configfs: fix memleak in configfs_release_bin_file ASoC: atmel-i2s: Fix usage of capture and playback at the same time extcon: max8997: Add missing modalias string extcon: sm5502: Drop invalid register write in sm5502_reg_data phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe() phy: uniphier-pcie: Fix updating phy parameters soundwire: stream: Fix test for DP prepare complete scsi: mpt3sas: Fix error return value in _scsih_expander_add() mtd: rawnand: marvell: add missing clk_disable_unprepare() on error in marvell_nfc_resume() of: Fix truncation of memory sizes on 32-bit platforms ASoC: cs42l42: Correct definition of CS42L42_ADC_PDN_MASK iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp() serial: 8250: Actually allow UPF_MAGIC_MULTIPLIER baud rates staging: mt7621-dts: fix pci address for PCI memory range staging: rtl8712: fix memory leak in rtl871x_load_fw_cb staging: rtl8712: remove redundant check in r871xu_drv_init staging: gdm724x: check for overflow in gdm_lte_netif_rx() staging: gdm724x: check for buffer overflow in gdm_lte_multi_sdu_pkt() iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: at91-sama5d2_adc: remove usage of iio_priv_to_dev() helper eeprom: idt_89hpesx: Restore printing the unsupported fwnode name eeprom: idt_89hpesx: Put fwnode in matching case during ->probe() usb: dwc2: Don't reset the core after setting turnaround time usb: gadget: f_fs: Fix setting of device and driver data cross-references ASoC: mediatek: mtk-btcvsd: Fix an error handling path in 'mtk_btcvsd_snd_probe()' iommu/dma: Fix IOVA reserve dma ranges s390: appldata depends on PROC_SYSCTL visorbus: fix error return code in visorchipset_init() fsi/sbefifo: Fix reset timeout fsi/sbefifo: Clean up correct FIFO when receiving reset request from SBE fsi: occ: Don't accept response from un-initialized OCC fsi: scom: Reset the FSI2PIB engine for any error fsi: core: Fix return of error values on failures scsi: FlashPoint: Rename si_flags field leds: lm3692x: Put fwnode in any case during ->probe() leds: lm36274: cosmetic: rename lm36274_data to chip leds: lm3532: select regmap I2C API tty: nozomi: Fix the error handling path of 'nozomi_card_init()' firmware: stratix10-svc: Fix a resource leak in an error handling path char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol() mtd: partitions: redboot: seek fis-index-block in the right node Input: hil_kbd - fix error return code in hil_dev_connect() ASoC: rsnd: tidyup loop on rsnd_adg_clk_query() backlight: lm3630a_bl: Put fwnode in error case during ->probe() ASoC: hisilicon: fix missing clk_disable_unprepare() on error in hi6210_i2s_startup() ASoC: rk3328: fix missing clk_disable_unprepare() on error in rk3328_platform_probe() iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() iio: cros_ec_sensors: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() iio: light: tcs3472: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: light: tcs3414: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: light: isl29125: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: magn: bmc150: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: magn: hmc5843: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: prox: as3935: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: prox: pulsed-light: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: prox: srf08: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: humidity: am2315: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: gyro: bmg160: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: adc: vf610: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: adc: ti-ads1015: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: mxc4005: Fix overread of data and alignment issue. iio:accel:mxc4005: Drop unnecessary explicit casts in regmap_bulk_read calls iio: accel: kxcjk-1013: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: hid: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: bma220: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: accel: bma180: Fix buffer alignment in iio_push_to_buffers_with_timestamp() iio: adis16400: do not return ints in irq handlers iio: adis_buffer: do not return ints in irq handlers mwifiex: re-fix for unaligned accesses tty: nozomi: Fix a resource leak in an error handling function rcu: Invoke rcu_spawn_core_kthreads() from rcu_spawn_gp_kthread() staging: fbtft: Rectify GPIO handling MIPS: Fix PKMAP with 32-bit MIPS huge page support RDMA/mlx5: Don't access NULL-cleared mpi pointer net: sched: fix warning in tcindex_alloc_perfect_hash net: lwtunnel: handle MTU calculation in forwading writeback: fix obtain a reference to a freeing memcg css clk: si5341: Update initialization magic clk: si5341: Avoid divide errors due to bogus register contents clk: actions: Fix bisp_factor_table based clocks on Owl S500 SoC clk: actions: Fix SD clocks factor table on Owl S500 SoC clk: actions: Fix UART clock dividers on Owl S500 SoC Bluetooth: Fix handling of HCI_LE_Advertising_Set_Terminated event Bluetooth: mgmt: Fix slab-out-of-bounds in tlv_data_is_valid Revert "be2net: disable bh with spin_lock in be_process_mcc" gve: Fix swapped vars when fetching max queues bpfilter: Specify the log level for the kmsg message e1000e: Check the PCIm state ipv6: fix out-of-bound access in ip6_parse_tlv() ibmvnic: free tx_pool if tso_pool alloc fails Revert "ibmvnic: remove duplicate napi_schedule call in open function" i40e: Fix autoneg disabling for non-10GBaseT links i40e: Fix error handling in i40e_vsi_open bpf: Do not change gso_size during bpf_skb_change_proto() ipv6: exthdrs: do not blindly use init_net net: bcmgenet: Fix attaching to PYH failed on RPi 4B mac80211: remove iwlwifi specific workaround NDPs of null_response ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl() ieee802154: hwsim: Fix memory leak in hwsim_add_one tc-testing: fix list handling net/ipv4: swap flow ports when validating source vxlan: add missing rcu_read_lock() in neigh_reduce() pkt_sched: sch_qfq: fix qfq_change_class() error path tls: prevent oversized sendfile() hangs by ignoring MSG_MORE net: sched: add barrier to ensure correct ordering for lockless qdisc vrf: do not push non-ND strict packets with a source LLA through packet taps again net: ethernet: ezchip: fix error handling net: ethernet: ezchip: fix UAF in nps_enet_remove net: ethernet: aeroflex: fix UAF in greth_of_remove samples/bpf: Fix the error return code of xdp_redirect's main() RDMA/rxe: Fix qp reference counting for atomic ops netfilter: nft_tproxy: restrict support to TCP and UDP transport protocols netfilter: nft_osf: check for TCP packet before further processing netfilter: nft_exthdr: check for IPv6 packet before further processing RDMA/mlx5: Don't add slave port to unaffiliated list netlabel: Fix memory leak in netlbl_mgmt_add_common ath10k: Fix an error code in ath10k_add_interface() brcmsmac: mac80211_if: Fix a resource leak in an error handling path brcmfmac: correctly report average RSSI in station info brcmfmac: fix setting of station info chains bitmask ssb: Fix error return code in ssb_bus_scan() wcn36xx: Move hal_buf allocation to devm_kmalloc in probe ieee802154: hwsim: Fix possible memory leak in hwsim_subscribe_all_others wireless: carl9170: fix LEDS build errors & warnings ath10k: add missing error return code in ath10k_pci_probe() ath10k: go to path err_unsupported when chip id is not supported tools/bpftool: Fix error return code in do_batch() drm: qxl: ensure surf.data is ininitialized RDMA/rxe: Fix failure during driver load RDMA/core: Sanitize WQ state received from the userspace net/sched: act_vlan: Fix modify to allow 0 ehea: fix error return code in ehea_restart_qps() drm/rockchip: dsi: move all lane config except LCDC mux to bind() drm/rockchip: cdn-dp-core: add missing clk_disable_unprepare() on error in cdn_dp_grf_write() net: ftgmac100: add missing error return code in ftgmac100_probe() clk: meson: g12a: fix gp0 and hifi ranges pinctrl: renesas: r8a77990: JTAG pins do not have pull-down capabilities pinctrl: renesas: r8a7796: Add missing bias for PRESET# pin net: pch_gbe: Propagate error from devm_gpio_request_one() net: mvpp2: Put fwnode in error case during ->probe() video: fbdev: imxfb: Fix an error message xfrm: xfrm_state_mtu should return at least 1280 for ipv6 dax: fix ENOMEM handling in grab_mapping_entry() ocfs2: fix snprintf() checking cpufreq: Make cpufreq_online() call driver->offline() on errors ACPI: bgrt: Fix CFI violation ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros blk-wbt: make sure throttle is enabled properly blk-wbt: introduce a new disable state to prevent false positive by rwb_enabled() extcon: extcon-max8997: Fix IRQ freeing at error path ACPI: sysfs: Fix a buffer overrun problem with description_show() crypto: nx - Fix RCU warning in nx842_OF_upd_status spi: spi-sun6i: Fix chipselect/clock bug sched/uclamp: Fix uclamp_tg_restrict() sched/rt: Fix Deadline utilization tracking during policy change sched/rt: Fix RT utilization tracking during policy change btrfs: clear log tree recovering status if starting transaction fails regulator: hi655x: Fix pass wrong pointer to config.driver_data KVM: nVMX: Ensure 64-bit shift when checking VMFUNC bitmap hwmon: (max31790) Fix fan speed reporting for fan7..12 hwmon: (max31722) Remove non-standard ACPI device IDs media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan arm64: consistently use reserved_pg_dir mmc: usdhi6rol0: fix error return code in usdhi6_probe() crypto: omap-sham - Fix PM reference leak in omap sham ops crypto: nitrox - fix unchecked variable in nitrox_register_interrupts media: siano: Fix out-of-bounds warnings in smscore_load_firmware_family2() m68k: atari: Fix ATARI_KBD_CORE kconfig unmet dependency warning media: gspca/gl860: fix zero-length control requests media: tc358743: Fix error return code in tc358743_probe_of() media: au0828: fix a NULL vs IS_ERR() check media: exynos4-is: Fix a use after free in isp_video_release pata_ep93xx: fix deferred probing media: rc: i2c: Fix an error message crypto: ccp - Fix a resource leak in an error handling path evm: fix writing <securityfs>/evm overflow pata_octeon_cf: avoid WARN_ON() in ata_host_activate() kbuild: Fix objtool dependency for 'OBJECT_FILES_NON_STANDARD_<obj> := n' kbuild: run the checker after the compiler sched/uclamp: Fix locking around cpu_util_update_eff() sched/uclamp: Fix wrong implementation of cpu.uclamp.min media: I2C: change 'RST' to "RSET" to fix multiple build errors pata_rb532_cf: fix deferred probing sata_highbank: fix deferred probing crypto: ux500 - Fix error return code in hash_hw_final() crypto: ixp4xx - dma_unmap the correct address media: s5p_cec: decrement usage count if disabled writeback, cgroup: increment isw_nr_in_flight before grabbing an inode ia64: mca_drv: fix incorrect array size calculation kthread_worker: fix return value when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync() block: fix discard request merge cifs: fix missing spinlock around update to ses->status HID: wacom: Correct base usage for capacitive ExpressKey status bits ACPI: tables: Add custom DSDT file as makefile prerequisite clocksource: Retry clock read if long delays detected PCI: hv: Add check for hyperv_initialized in init_hv_pci_drv() EDAC/Intel: Do not load EDAC driver when running as a guest nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp_rqst() platform/x86: toshiba_acpi: Fix missing error code in toshiba_acpi_setup_keyboard() block: fix race between adding/removing rq qos and normal IO ACPI: resources: Add checks for ACPI IRQ override ACPI: bus: Call kobject_put() in acpi_init() error path ACPICA: Fix memory leak caused by _CID repair function fs: dlm: fix memory leak when fenced random32: Fix implicit truncation warning in prandom_seed_state() fs: dlm: cancel work sync othercon block_dump: remove block_dump feature in mark_inode_dirty() ACPI: EC: Make more Asus laptops use ECDT _GPE lib: vsprintf: Fix handling of number field widths in vsscanf hv_utils: Fix passing zero to 'PTR_ERR' warning ACPI: processor idle: Fix up C-state latency if not ordered EDAC/ti: Add missing MODULE_DEVICE_TABLE HID: do not use down_interruptible() when unbinding devices media: Fix Media Controller API config checks regulator: da9052: Ensure enough delay time for .set_voltage_time_sel regulator: mt6358: Fix vdram2 .vsel_mask KVM: s390: get rid of register asm usage lockding/lockdep: Avoid to find wrong lock dep path in check_irq_usage() locking/lockdep: Fix the dep path printing for backwards BFS btrfs: disable build on platforms having page size 256K btrfs: abort transaction if we fail to update the delayed inode btrfs: fix error handling in __btrfs_update_delayed_inode KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe() hwmon: (max31790) Fix pwmX_enable attributes hwmon: (max31790) Report correct current pwm duty cycles media: imx-csi: Skip first few frames from a BT.656 source media: siano: fix device register error path media: dvb_net: avoid speculation from net slot crypto: shash - avoid comparing pointers to exported functions under CFI mmc: via-sdmmc: add a check against NULL pointer dereference mmc: sdhci-sprd: use sdhci_sprd_writew memstick: rtsx_usb_ms: fix UAF media: dvd_usb: memory leak in cinergyt2_fe_attach Makefile: fix GDB warning with CONFIG_RELR media: st-hva: Fix potential NULL pointer dereferences media: bt8xx: Fix a missing check bug in bt878_probe media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release media: em28xx: Fix possible memory leak of em28xx struct sched/fair: Fix ascii art by relpacing tabs crypto: qat - remove unused macro in FW loader crypto: qat - check return code of qat_hal_rd_rel_reg() media: imx: imx7_mipi_csis: Fix logging of only error event counters media: pvrusb2: fix warning in pvr2_i2c_core_done media: cobalt: fix race condition in setting HPD media: cpia2: fix memory leak in cpia2_usb_probe media: sti: fix obj-$(config) targets crypto: nx - add missing MODULE_DEVICE_TABLE hwrng: exynos - Fix runtime PM imbalance on error regulator: uniphier: Add missing MODULE_DEVICE_TABLE spi: omap-100k: Fix the length judgment problem spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages() spi: spi-loopback-test: Fix 'tx_buf' might be 'rx_buf' media: exynos-gsc: fix pm_runtime_get_sync() usage count media: sti/bdisp: fix pm_runtime_get_sync() usage count media: s5p-jpeg: fix pm_runtime_get_sync() usage count media: mtk-vcodec: fix PM runtime get logic media: sh_vou: fix pm_runtime_get_sync() usage count media: s5p: fix pm_runtime_get_sync() usage count media: mdk-mdp: fix pm_runtime_get_sync() usage count spi: Make of_register_spi_device also set the fwnode fuse: reject internal errno fuse: check connected before queueing on fpq->io fuse: ignore PG_workingset after stealing evm: Refuse EVM_ALLOW_METADATA_WRITES only if an HMAC key is loaded evm: Execute evm_inode_init_security() only when an HMAC key is loaded powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi() seq_buf: Make trace_seq_putmem_hex() support data longer than 8 tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing tracing/histograms: Fix parsing of "sym-offset" modifier rsi: fix AP mode with WPA failure due to encrypted EAPOL rsi: Assign beacon rate settings to the correct rate_info descriptor field ssb: sdio: Don't overwrite const buffer if block_write fails ath9k: Fix kernel NULL pointer dereference during ath_reset_internal() serial_cs: remove wrong GLOBETROTTER.cis entry serial_cs: Add Option International GSM-Ready 56K/ISDN modem serial: sh-sci: Stop dmaengine transfer in sci_stop_tx() serial: mvebu-uart: fix calculation of clock divisor iio: ltr501: ltr501_read_ps(): add missing endianness conversion iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too iio: light: tcs3472: do not free unallocated IRQ rtc: stm32: Fix unbalanced clk_disable_unprepare() on probe error path s390/cio: dont call css_wait_for_slow_path() inside a lock KVM: PPC: Book3S HV: Workaround high stack usage with clang perf/smmuv3: Don't trample existing events with global filter SUNRPC: Should wake up the privileged task firstly. SUNRPC: Fix the batch tasks count wraparound. mac80211: remove iwlwifi specific workaround that broke sta NDP tx can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path can: j1939: j1939_sk_init(): set SOCK_RCU_FREE to call sk_destruct() after RCU is done can: gw: synchronize rcu operations before removing gw job entry can: bcm: delay release of struct bcm_op after synchronize_rcu() ext4: use ext4_grp_locked_error in mb_find_extent ext4: fix avefreec in find_group_orlov ext4: remove check for zero nr_to_scan in ext4_es_scan() ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit ext4: return error code when ext4_fill_flex_info() fails ext4: fix kernel infoleak via ext4_extent_header ext4: cleanup in-core orphan list if ext4_truncate() failed to get a transaction handle btrfs: clear defrag status of a root if starting transaction fails btrfs: send: fix invalid path for unlink operations after parent orphanization ARM: dts: at91: sama5d4: fix pinctrl muxing arm_pmu: Fix write counter incorrect in ARMv7 big-endian mode Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl iov_iter_fault_in_readable() should do nothing in xarray case copy_page_to_iter(): fix ITER_DISCARD case ntfs: fix validity check for file name attribute xhci: solve a double free problem while doing s4 usb: typec: Add the missed altmode_id_remove() in typec_register_altmode() usb: dwc3: Fix debugfs creation flow USB: cdc-acm: blacklist Heimann USB Appset device usb: gadget: eem: fix echo command packet response issue net: can: ems_usb: fix use-after-free in ems_usb_disconnect() Input: usbtouchscreen - fix control-request directions media: dvb-usb: fix wrong definition ALSA: hda/realtek: Apply LED fixup for HP Dragonfly G1, too ALSA: hda/realtek: Fix bass speaker DAC mapping for Asus UM431D ALSA: hda/realtek: Improve fixup for HP Spectre x360 15-df0xxx ALSA: hda/realtek: Add another ALC236 variant support ALSA: intel8x0: Fix breakage at ac97 clock measurement ALSA: usb-audio: scarlett2: Fix wrong resume call ALSA: usb-audio: Fix OOB access at proc output ALSA: usb-audio: fix rate on Ozone Z90 USB headset Linux 5.4.131 xen/events: reset active flag for lateeoi events later KVM: SVM: Call SEV Guest Decommission if ASID binding fails s390/stack: fix possible register corruption with stack switch helper KVM: SVM: Periodically schedule when unregistering regions on destroy Linux 5.4.130 RDMA/mlx5: Block FDB rules when not in switchdev mode gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP drm/nouveau: fix dma_address check for CPU/GPU sync scsi: sr: Return appropriate error code when disk is ejected x86/efi: remove unused variables Linux 5.4.129 certs: Move load_system_certificate_list to a common function certs: Add EFI_CERT_X509_GUID support for dbx entries x86/efi: move common keyring handler functions to new file certs: Add wrapper function to check blacklisted binary hash mm, futex: fix shared futex pgoff on shmem huge page mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk() mm/thp: fix page_vma_mapped_walk() if THP mapped by ptes mm: page_vma_mapped_walk(): get vma_address_end() earlier mm: page_vma_mapped_walk(): use goto instead of while (1) mm: page_vma_mapped_walk(): add a level of indentation mm: page_vma_mapped_walk(): crossing page table boundary mm: page_vma_mapped_walk(): prettify PVMW_MIGRATION block mm: page_vma_mapped_walk(): use pmde for *pvmw->pmd mm: page_vma_mapped_walk(): settle PageHuge on entry mm: page_vma_mapped_walk(): use page for pvmw->page mm: thp: replace DEBUG_VM BUG with VM_WARN when unmap fails for split mm/thp: unmap_mapping_page() to fix THP truncate_cleanup_page() mm/thp: fix page_address_in_vma() on file THP tails mm/thp: fix vma_address() if virtual address below file offset mm/thp: try_to_unmap() use TTU_SYNC for safe splitting mm/thp: make is_huge_zero_pmd() safe and quicker mm/thp: fix __split_huge_pmd_locked() on shmem migration entry mm, thp: use head page in __migration_entry_wait() mm/rmap: use page_not_mapped in try_to_unmap() mm/rmap: remove unneeded semicolon in page_not_mapped() mm: add VM_WARN_ON_ONCE_PAGE() macro kthread: prevent deadlock when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync() kthread_worker: split code for canceling the delayed work timer i2c: robotfuzz-osif: fix control-request directions KVM: do not allow mapping valid but non-reference-counted pages nilfs2: fix memory leak in nilfs_sysfs_delete_device_group pinctrl: stm32: fix the reported number of GPIO lines per bank net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY net: ll_temac: Add memory-barriers for TX BD access PCI: Add AMD RS690 quirk to enable 64-bit DMA recordmcount: Correct st_shndx handling net: qed: Fix memcpy() overflow of qed_dcbx_params() KVM: selftests: Fix kvm_check_cap() assertion r8169: Avoid memcpy() over-reading of ETH_SS_STATS sh_eth: Avoid memcpy() over-reading of ETH_SS_STATS r8152: Avoid memcpy() over-reading of ETH_SS_STATS net/packet: annotate accesses to po->ifindex net/packet: annotate accesses to po->bind net: caif: fix memory leak in ldisc_open net: phy: dp83867: perform soft reset and retain established link inet: annotate date races around sk->sk_txhash ping: Check return value of function 'ping_queue_rcv_skb' net: ethtool: clear heap allocations for ethtool function mac80211: drop multicast fragments net: ipv4: Remove unneed BUG() function dmaengine: mediatek: use GFP_NOWAIT instead of GFP_ATOMIC in prep_dma dmaengine: mediatek: do not issue a new desc if one is still current dmaengine: mediatek: free the proper desc in desc_free handler dmaengine: rcar-dmac: Fix PM reference leak in rcar_dmac_probe() cfg80211: call cfg80211_leave_ocb when switching away from OCB mac80211_hwsim: drop pending frames on stop mac80211: remove warning in ieee80211_get_sband() dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc() Revert "PCI: PM: Do not read power state in pci_enable_device_flags()" spi: spi-nxp-fspi: move the register operation after the clock enable MIPS: generic: Update node names to avoid unit addresses arm64: link with -z norelro for LLD or aarch64-elf kbuild: add CONFIG_LD_IS_LLD mmc: meson-gx: use memcpy_to/fromio for dram-access-quirk ARM: 9081/1: fix gcc-10 thumb2-kernel regression drm/radeon: wait for moving fence after pinning drm/nouveau: wait for moving fence after pinning v2 Revert "drm/amdgpu/gfx10: enlarge CP_MEC_DOORBELL_RANGE_UPPER to cover full doorbell." Revert "drm/amdgpu/gfx9: fix the doorbell missing when in CGPG issue." module: limit enabling module.sig_enforce Revert "clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940" Linux 5.4.128 usb: dwc3: core: fix kernel panic when do reboot usb: dwc3: debugfs: Add and remove endpoint dirs dynamically clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940 clocksource/drivers/timer-ti-dm: Prepare to handle dra7 timer wrap issue clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support ARM: OMAP: replace setup_irq() by request_irq() KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read tools headers UAPI: Sync linux/in.h copy with the kernel sources net: fec_ptp: add clock rate zero check net: stmmac: disable clocks in stmmac_remove_config_dt() mm/slub.c: include swab.h mm/slub: fix redzoning for small allocations mm/slub: clarify verification reporting net: bridge: fix vlan tunnel dst refcnt when egressing net: bridge: fix vlan tunnel dst null pointer dereference net: ll_temac: Fix TX BD buffer overwrite net: ll_temac: Make sure to free skb when it is completely used drm/amdgpu/gfx9: fix the doorbell missing when in CGPG issue. drm/amdgpu/gfx10: enlarge CP_MEC_DOORBELL_RANGE_UPPER to cover full doorbell. cfg80211: avoid double free of PMSR request cfg80211: make certificate generation more robust dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc x86/fpu: Reset state for all signal restore failures x86/pkru: Write hardware init value to PKRU when xstate is init x86/process: Check PF_KTHREAD and not current->mm for kernel threads ARCv2: save ABI registers across signal handling KVM: x86: Immediately reset the MMU context when the SMM flag is cleared PCI: Work around Huawei Intelligent NIC VF FLR erratum PCI: Add ACS quirk for Broadcom BCM57414 NIC PCI: aardvark: Fix kernel panic during PIO transfer PCI: aardvark: Don't rely on jiffies while holding spinlock PCI: Mark some NVIDIA GPUs to avoid bus reset PCI: Mark TI C667X to avoid bus reset tracing: Do no increment trace_clock_global() by one tracing: Do not stop recording comms if the trace file is being read tracing: Do not stop recording cmdlines when tracing is off usb: core: hub: Disable autosuspend for Cypress CY7C65632 can: mcba_usb: fix memory leak in mcba_usb can: j1939: fix Use-after-Free, hold skb ref while in use can: bcm/raw/isotp: use per module netdevice notifier can: bcm: fix infoleak in struct bcm_msg_head hwmon: (scpi-hwmon) shows the negative temperature properly radeon: use memcpy_to/fromio for UVD fw upload pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled spi: stm32-qspi: Always wait BUSY bit to be cleared in stm32_qspi_wait_cmd() ASoC: rt5659: Fix the lost powers for the HDA header regulator: bd70528: Fix off-by-one for buck123 .n_voltages setting net: ethernet: fix potential use-after-free in ec_bhf_remove icmp: don't send out ICMP messages with a source address of 0.0.0.0 bnxt_en: Call bnxt_ethtool_free() in bnxt_init_one() error path bnxt_en: Rediscover PHY capabilities after firmware reset cxgb4: fix wrong shift. net: cdc_eem: fix tx fixup skb leak net: hamradio: fix memory leak in mkiss_close be2net: Fix an error handling path in 'be_probe()' net/af_unix: fix a data-race in unix_dgram_sendmsg / unix_release_sock net: ipv4: fix memory leak in ip_mc_add1_src net: fec_ptp: fix issue caused by refactor the fec_devtype net: usb: fix possible use-after-free in smsc75xx_bind lantiq: net: fix duplicated skb in rx descriptor ring net: cdc_ncm: switch to eth%d interface naming ptp: improve max_adj check against unreasonable values net: qrtr: fix OOB Read in qrtr_endpoint_post netxen_nic: Fix an error handling path in 'netxen_nic_probe()' qlcnic: Fix an error handling path in 'qlcnic_probe()' net: make get_net_ns return error if NET_NS is disabled net: stmmac: dwmac1000: Fix extended MAC address registers definition alx: Fix an error handling path in 'alx_probe()' sch_cake: Fix out of bounds when parsing TCP options and header netfilter: synproxy: Fix out of bounds when parsing TCP options net/mlx5e: Block offload of outer header csum for UDP tunnels net/mlx5e: allow TSO on VXLAN over VLAN topologies net/mlx5: Consider RoCE cap before init RDMA resources net/mlx5e: Fix page reclaim for dead peer hairpin net/mlx5e: Remove dependency in IPsec initialization flows net/sched: act_ct: handle DNAT tuple collision rtnetlink: Fix regression in bridge VLAN configuration udp: fix race between close() and udp_abort() net: lantiq: disable interrupt before sheduling NAPI net: rds: fix memory leak in rds_recvmsg vrf: fix maximum MTU net: ipv4: fix memory leak in netlbl_cipsov4_add_std batman-adv: Avoid WARN_ON timing related checks kvm: LAPIC: Restore guard to prevent illegal APIC register access mm/memory-failure: make sure wait for page writeback in memory_failure afs: Fix an IS_ERR() vs NULL check dmaengine: stedma40: add missing iounmap() on error in d40_probe() dmaengine: QCOM_HIDMA_MGMT depends on HAS_IOMEM dmaengine: ALTERA_MSGDMA depends on HAS_IOMEM Linux 5.4.127 fib: Return the correct errno code net: Return the correct errno code net/x25: Return the correct errno code rtnetlink: Fix missing error code in rtnl_bridge_notify() drm/amd/display: Allow bandwidth validation for 0 streams. net: ipconfig: Don't override command-line hostnames or domains nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue() nvme-loop: clear NVME_LOOP_Q_LIVE when nvme_loop_configure_admin_queue() fails nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues() scsi: scsi_devinfo: Add blacklist entry for HPE OPEN-V scsi: qedf: Do not put host in qedf_vport_create() unconditionally ethernet: myri10ge: Fix missing error code in myri10ge_probe() scsi: target: core: Fix warning on realtime kernels gfs2: Fix use-after-free in gfs2_glock_shrink_scan riscv: Use -mno-relax when using lld linker HID: gt683r: add missing MODULE_DEVICE_TABLE gfs2: Prevent direct-I/O write fallback errors from getting lost ARM: OMAP2+: Fix build warning when mmc_omap is not built drm/tegra: sor: Do not leak runtime PM reference HID: usbhid: fix info leak in hid_submit_ctrl HID: Add BUS_VIRTUAL to hid_connect logging HID: multitouch: set Stylus suffix for Stylus-application devices, too HID: quirks: Add quirk for Lenovo optical mouse HID: hid-sensor-hub: Return error for hid_set_field() failure HID: hid-input: add mapping for emoji picker key HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for Saitek X65 net: ieee802154: fix null deref in parse dev addr Revert "RDMA/ipoib: Fix warning caused by destroying non-initial netns" Linux 5.4.126 proc: only require mm_struct for writing tracing: Correct the length check which causes memory corruption ftrace: Do not blindly read the ip address in ftrace_bug() scsi: core: Only put parent device if host state differs from SHOST_CREATED scsi: core: Put .shost_dev in failure path if host state changes to RUNNING scsi: core: Fix failure handling of scsi_add_host_with_dma() scsi: core: Fix error handling of scsi_host_alloc() NFSv4: nfs4_proc_set_acl needs to restore NFS_CAP_UIDGID_NOMAP on error. NFSv4: Fix second deadlock in nfs4_evict_inode() NFS: Fix use-after-free in nfs4_init_client() kvm: fix previous commit for 32-bit builds perf session: Correct buffer copying when peeking events NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode() NFS: Fix a potential NULL dereference in nfs_get_client() IB/mlx5: Fix initializing CQ fragments buffer KVM: x86: Ensure liveliness of nested VM-Enter fail tracepoint message sched/fair: Make sure to update tg contrib for blocked load perf: Fix data race between pin_count increment/decrement vmlinux.lds.h: Avoid orphan section with !SMP RDMA/mlx4: Do not map the core_clock page to user space unless enabled RDMA/ipoib: Fix warning caused by destroying non-initial netns usb: typec: mux: Fix copy-paste mistake in typec_mux_match regulator: max77620: Use device_set_of_node_from_dev() regulator: core: resolve supply for boot-on/always-on regulators usb: fix various gadget panics on 10gbps cabling usb: fix various gadgets null ptr deref on 10gbps cabling. usb: gadget: eem: fix wrong eem header operation USB: serial: cp210x: fix alternate function for CP2102N QFN20 USB: serial: quatech2: fix control-request directions USB: serial: omninet: add device id for Zyxel Omni 56K Plus USB: serial: ftdi_sio: add NovaTech OrionMX product ID usb: gadget: f_fs: Ensure io_completion_wq is idle during unbind usb: typec: ucsi: Clear PPM capability data in ucsi_init() error path usb: typec: wcove: Use LE to CPU conversion when accessing msg->header usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling usb: dwc3: ep0: fix NULL pointer exception usb: pd: Set PD_T_SINK_WAIT_CAP to 310ms usb: f_ncm: only first packet of aggregate needs to start timer USB: f_ncm: ncm_bitrate (speed) is unsigned cgroup1: don't allow '\n' in renaming btrfs: promote debugging asserts to full-fledged checks in validate_super btrfs: return value from btrfs_mark_extent_written() in case of error staging: rtl8723bs: Fix uninitialized variables kvm: avoid speculation-based attacks from out-of-range memslot accesses drm: Lock pointer access in drm_master_release() drm: Fix use-after-free read in drm_getunique() spi: bcm2835: Fix out-of-bounds access with more than 4 slaves x86/boot: Add .text.* to setup.ld i2c: mpc: implement erratum A-004447 workaround i2c: mpc: Make use of i2c_recover_bus() spi: Cleanup on failure of initial setup spi: Don't have controller clean up spi device before driver unbind powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P1010 i2c controllers powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P2041 i2c controllers nvme-tcp: remove incorrect Kconfig dep in BLK_DEV_NVME bnx2x: Fix missing error code in bnx2x_iov_init_one() dm verity: fix require_signatures module_param permissions MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER nvme-fabrics: decode host pathing error for connect net: dsa: microchip: enable phy errata workaround on 9567 net: appletalk: cops: Fix data race in cops_probe1 net: macb: ensure the device is available before accessing GEMGXL control registers scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal scsi: hisi_sas: Drop free_irq() of devm_request_irq() allocated irq scsi: vmw_pvscsi: Set correct residual data length scsi: bnx2fc: Return failure if io_req is already in ABTS processing RDS tcp loopback connection can hang net/qla3xxx: fix schedule while atomic in ql_sem_spinlock wq: handle VM suspension in stall detection cgroup: disable controllers at parse time net: mdiobus: get rid of a BUG_ON() netlink: disable IRQs for netlink_lock_table() bonding: init notify_work earlier to avoid uninitialized use isdn: mISDN: netjet: Fix crash in nj_probe: spi: sprd: Add missing MODULE_DEVICE_TABLE ASoC: sti-sas: add missing MODULE_DEVICE_TABLE vfio-ccw: Serialize FSM IDLE state with I/O completion ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix 3-830 tablet ASoC: Intel: bytcr_rt5640: Add quirk for the Glavey TM800A550L tablet usb: cdns3: Fix runtime PM imbalance on error net/nfc/rawsock.c: fix a permission check bug spi: Fix spi device unregister flow ASoC: max98088: fix ni clock divider calculation proc: Track /proc/$pid/attr/ opener mm_struct ANDROID: GKI: update .xml file ANDROID: restore abi breakage in usbnet.h Linux 5.4.125 neighbour: allow NUD_NOARP entries to be forced GCed i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops xen-pciback: redo VF placement in the virtual topology lib/lz4: explicitly support in-place decompression x86/kvm: Disable all PV features on crash x86/kvm: Disable kvmclock on all CPUs on shutdown x86/kvm: Teardown PV features on boot CPU as well KVM: arm64: Fix debug register indexing KVM: SVM: Truncate GPR value for DR and CR accesses in !64-bit mode btrfs: fix unmountable seed device after fstrim mm/filemap: fix storing to a THP shadow entry XArray: add xas_split XArray: add xa_get_order mm: add thp_order bnxt_en: Remove the setting of dev_port. mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY btrfs: fixup error handling in fixup_inode_link_counts btrfs: return errors from btrfs_del_csums in cleanup_ref_head btrfs: fix error handling in btrfs_del_csums btrfs: mark ordered extent and inode with error if we fail to finish x86/apic: Mark _all_ legacy interrupts when IO/APIC is missing drm/amdgpu: make sure we unpin the UVD BO drm/amdgpu: Don't query CE and UE errors nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect ocfs2: fix data corruption by fallocate pid: take a reference when initializing `cad_pid` usb: dwc2: Fix build in periphal-only mode ext4: fix bug on in ext4_es_cache_extent as ext4_split_extent_at failed ARM: dts: imx6q-dhcom: Add PU,VDD1P1,VDD2P5 regulators ARM: dts: imx6dl-yapp4: Fix RGMII connection to QCA8334 switch ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx ALSA: timer: Fix master timer notification HID: multitouch: require Finger field to mark Win8 reports as MT HID: magicmouse: fix NULL-deref on disconnect HID: i2c-hid: Skip ELAN power-on command after reset net: caif: fix memory leak in cfusbl_device_notify net: caif: fix memory leak in caif_device_notify net: caif: add proper error handling net: caif: added cfserl_release function Bluetooth: use correct lock to prevent UAF of hdev object Bluetooth: fix the erroneous flush_work() order tipc: fix unique bearer names sanity check tipc: add extack messages for bearer/media failure bus: ti-sysc: Fix flakey idling of uarts and stop using swsup_sidle_act ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells ARM: dts: imx7d-pico: Fix the 'tuning-step' property ARM: dts: imx7d-meerkat96: Fix the 'tuning-step' property arm64: dts: zii-ultra: fix 12V_MAIN voltage arm64: dts: ls1028a: fix memory node i40e: add correct exception tracing for XDP i40e: optimize for XDP_REDIRECT in xsk path i2c: qcom-geni: Add shutdown callback for i2c ice: Allow all LLDP packets from PF to Tx ice: Fix VFR issues for AVF drivers that expect ATQLEN cleared ice: write register with correct offset ipv6: Fix KASAN: slab-out-of-bounds Read in fib6_nh_flush_exceptions ixgbevf: add correct exception tracing for XDP ieee802154: fix error return code in ieee802154_llsec_getparams() ieee802154: fix error return code in ieee802154_add_iface() netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches netfilter: nft_ct: skip expectations for confirmed conntrack ACPICA: Clean up context mutex during object deletion net/sched: act_ct: Fix ct template allocation for zone 0 HID: i2c-hid: fix format string mismatch HID: pidff: fix error return code in hid_pidff_init() ipvs: ignore IP_VS_SVC_F_HASHED flag when adding service vfio/platform: fix module_put call in error flow samples: vfio-mdev: fix error handing in mdpy_fb_probe() vfio/pci: zap_vma_ptes() needs MMU vfio/pci: Fix error return code in vfio_ecap_init() efi: cper: fix snprintf() use in cper_dimm_err_location() efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared netfilter: conntrack: unregister ipv4 sockopts on error unwind hwmon: (dell-smm-hwmon) Fix index values nl80211: validate key indexes for cfg80211_registered_device ALSA: usb: update old-style static const declaration net: usb: cdc_ncm: don't spew notifications btrfs: tree-checker: do not error out if extent ref hash doesn't match ANDROID: GKI: Preserve abi change in ieee80211_data_to_8023_exthdr() Linux 5.4.124 usb: core: reduce power-on-good delay time of root hub neighbour: Prevent Race condition in neighbour subsytem net: hso: bail out on interrupt URB allocation failure Revert "Revert "ALSA: usx2y: Fix potential NULL pointer dereference"" net: hns3: check the return of skb_checksum_help() drivers/net/ethernet: clean up unused assignments i915: fix build warning in intel_dp_get_link_status() drm/i915/display: fix compiler warning about array overrun MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c MIPS: alchemy: xxs1500: add gpio-au1000.h header file sch_dsmark: fix a NULL deref in qdisc_reset() net: ethernet: mtk_eth_soc: Fix packet statistics support for MT7628/88 ALSA: usb-audio: scarlett2: snd_scarlett_gen2_controls_create() can be static ipv6: record frag_max_size in atomic fragments in input path net: lantiq: fix memory corruption in RX ring scsi: libsas: Use _safe() loop in sas_resume_port() ixgbe: fix large MTU request from VF bpf: Set mac_len in bpf_skb_change_head ASoC: cs35l33: fix an error code in probe() staging: emxx_udc: fix loop in _nbu2ss_nuke() cxgb4: avoid accessing registers when clearing filters gve: Correct SKB queue index validation. gve: Upgrade memory barrier in poll routine gve: Add NULL pointer checks when freeing irqs. gve: Update mgmt_msix_idx if num_ntfy changes gve: Check TX QPL was actually assigned mld: fix panic in mld_newpack() bnxt_en: Include new P5 HV definition in VF check. net: bnx2: Fix error return code in bnx2_init_board() net: hso: check for allocation failure in hso_create_bulk_serial_device() net: sched: fix tx action reschedule issue with stopped queue net: sched: fix tx action rescheduling issue during deactivation net: sched: fix packet stuck problem for lockless qdisc tls splice: check SPLICE_F_NONBLOCK instead of MSG_DONTWAIT openvswitch: meter: fix race when getting now_ms. net: mdio: octeon: Fix some double free issues net: mdio: thunder: Fix a double free issue in the .remove function net: fec: fix the potential memory leak in fec_enet_init() net: really orphan skbs tied to closing sk vfio-ccw: Check initialized flag in cp_init() ASoC: cs42l42: Regmap must use_single_read/write net: dsa: fix error code getting shifted with 4 in dsa_slave_get_sset_count net: netcp: Fix an error message drm/amd/amdgpu: fix a potential deadlock in gpu reset drm/amdgpu: Fix a use-after-free drm/amd/amdgpu: fix refcount leak drm/amd/display: Disconnect non-DP with no EDID SMB3: incorrect file id in requests compounded with open platform/x86: touchscreen_dmi: Add info for the Mediacom Winpad 7.0 W700 tablet platform/x86: intel_punit_ipc: Append MODULE_DEVICE_TABLE for ACPI platform/x86: hp-wireless: add AMD's hardware id to the supported list btrfs: do not BUG_ON in link_to_fixup_dir openrisc: Define memory barrier mb scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic btrfs: return whole extents in fiemap brcmfmac: properly check for bus register errors Revert "brcmfmac: add a check for the status of usb_register" net: liquidio: Add missing null pointer checks Revert "net: liquidio: fix a NULL pointer dereference" media: gspca: properly check for errors in po1030_probe() Revert "media: gspca: Check the return value of write_bridge for timeout" media: gspca: mt9m111: Check write_bridge for timeout Revert "media: gspca: mt9m111: Check write_bridge for timeout" media: dvb: Add check on sp8870_readreg return Revert "media: dvb: Add check on sp8870_readreg" ASoC: cs43130: handle errors in cs43130_probe() properly Revert "ASoC: cs43130: fix a NULL pointer dereference" libertas: register sysfs groups properly Revert "libertas: add checks for the return value of sysfs_create_group" dmaengine: qcom_hidma: comment platform_driver_register call Revert "dmaengine: qcom_hidma: Check for driver register failure" isdn: mISDN: correctly handle ph_info allocation failure in hfcsusb_ph_info Revert "isdn: mISDN: Fix potential NULL pointer dereference of kzalloc" ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd() Revert "ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd()" isdn: mISDNinfineon: check/cleanup ioremap failure correctly in setup_io Revert "isdn: mISDNinfineon: fix potential NULL pointer dereference" Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Revert "ALSA: gus: add a check of the status of snd_ctl_add" char: hpet: add checks after calling ioremap Revert "char: hpet: fix a missing check of ioremap" net: caif: remove BUG_ON(dev == NULL) in caif_xmit Revert "net/smc: fix a NULL pointer dereference" net: fujitsu: fix potential null-ptr-deref Revert "net: fujitsu: fix a potential NULL pointer dereference" serial: max310x: unregister uart driver in case of failure and abort Revert "serial: max310x: pass return value of spi_register_driver" Revert "ALSA: sb: fix a missing check of snd_ctl_add" Revert "media: usb: gspca: add a missed check for goto_low_power" gpio: cadence: Add missing MODULE_DEVICE_TABLE platform/x86: hp_accel: Avoid invoking _INI to speed up resume perf jevents: Fix getting maximum number of fds i2c: sh_mobile: Use new clock calculation formulas for RZ/G2E i2c: i801: Don't generate an interrupt on bus reset i2c: s3c2410: fix possible NULL pointer deref on read message after write net: dsa: sja1105: error out on unsupported PHY mode net: dsa: fix a crash if ->get_sset_count() fails net: dsa: mt7530: fix VLAN traffic leaks spi: spi-fsl-dspi: Fix a resource leak in an error handling path tipc: skb_linearize the head skb when reassembling msgs tipc: wait and exit until all work queues are done Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv" net/mlx4: Fix EEPROM dump support net/mlx5e: Fix nullptr in add_vlan_push_action() net/mlx5e: Fix multipath lag activation drm/meson: fix shutdown crash when component not probed NFSv4: Fix v4.0/v4.1 SEEK_DATA return -ENOTSUPP when set NFS_V4_2 config NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce() NFS: Fix an Oopsable condition in __nfs_pageio_add_request() NFS: fix an incorrect limit in filelayout_decode_layout() fs/nfs: Use fatal_signal_pending instead of signal_pending Bluetooth: cmtp: fix file refcount when cmtp_attach_device fails spi: spi-geni-qcom: Fix use-after-free on unbind net: usb: fix memory leak in smsc75xx_bind usb: gadget: udc: renesas_usb3: Fix a race in usb3_start_pipen() usb: dwc3: gadget: Properly track pending and queued SG thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID USB: serial: pl2303: add device id for ADLINK ND-6530 GC USB: serial: ftdi_sio: add IDs for IDS GmbH Products USB: serial: option: add Telit LE910-S1 compositions 0x7010, 0x7011 USB: serial: ti_usb_3410_5052: add startech.com device id serial: rp2: use 'request_firmware' instead of 'request_firmware_nowait' serial: sh-sci: Fix off-by-one error in FIFO threshold register setting serial: tegra: Fix a mask operation that is always true USB: usbfs: Don't WARN about excessively large memory allocations USB: trancevibrator: fix control-request direction serial: 8250_pci: handle FL_NOIRQ board flag serial: 8250_pci: Add support for new HPE serial device iio: adc: ad7793: Add missing error code in ad7793_setup() iio: adc: ad7124: Fix potential overflow due to non sequential channel numbers iio: adc: ad7124: Fix missbalanced regulator enable / disable on error. iio: adc: ad7768-1: Fix too small buffer passed to iio_push_to_buffers_with_timestamp() iio: gyro: fxas21002c: balance runtime power in error path staging: iio: cdc: ad7746: avoid overwrite of num_channels mei: request autosuspend after sending rx flow control thunderbolt: dma_port: Fix NVM read buffer bounds and offset issue misc/uss720: fix memory leak in uss720_probe serial: core: fix suspicious security_locked_down() call Documentation: seccomp: Fix user notification documentation kgdb: fix gcc-11 warnings harder selftests/gpio: Fix build when source tree is read only selftests/gpio: Move include of lib.mk up selftests/gpio: Use TEST_GEN_PROGS_EXTENDED drm/amdgpu/vcn2.5: add cancel_delayed_work_sync before power gate drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate drm/amdgpu/vcn1: add cancel_delayed_work_sync before power gate dm snapshot: properly fix a crash when an origin has no snapshots ath10k: Validate first subframe of A-MSDU before processing the list ath10k: Fix TKIP Michael MIC verification for PCIe ath10k: drop MPDU which has discard flag set by firmware for SDIO ath10k: drop fragments with multicast DA for SDIO ath10k: drop fragments with multicast DA for PCIe ath10k: add CCMP PN replay protection for fragmented frames for PCIe mac80211: extend protection against mixed key and fragment cache attacks mac80211: do not accept/forward invalid EAPOL frames mac80211: prevent attacks on TKIP/WEP as well mac80211: check defrag PN against current frame mac80211: add fragment cache to sta_info mac80211: drop A-MSDUs on old ciphers cfg80211: mitigate A-MSDU aggregation attacks mac80211: properly handle A-MSDUs that start with an RFC 1042 header mac80211: prevent mixed key and fragment cache attacks mac80211: assure all fragments are encrypted net: hso: fix control-request directions proc: Check /proc/$pid/attr/ writes against file opener perf scripts python: exported-sql-viewer.py: Fix warning display perf scripts python: exported-sql-viewer.py: Fix Array TypeError perf scripts python: exported-sql-viewer.py: Fix copy to clipboard from Top Calls by elapsed Time report perf intel-pt: Fix transaction abort handling perf intel-pt: Fix sample instruction bytes iommu/vt-d: Fix sysfs leak in alloc_iommu() NFSv4: Fix a NULL pointer dereference in pnfs_mark_matching_lsegs_return() cifs: set server->cipher_type to AES-128-CCM for SMB3.0 ALSA: usb-audio: scarlett2: Improve driver startup messages ALSA: usb-audio: scarlett2: Fix device hang with ehci-pci ALSA: hda/realtek: Headphone volume is controlled by Front mixer ANDROID: GKI: update .xml file due to merge with `android11-5.4` Linux 5.4.123 NFC: nci: fix memory leak in nci_allocate_device perf unwind: Set userdata for all __report_module() paths perf unwind: Fix separate debug info files when using elfutils' libdw's unwinder usb: dwc3: gadget: Enable suspend events bpf: No need to simulate speculative domain for immediates bpf: Fix mask direction swap upon off reg sign change bpf: Wrap aux data inside bpf_sanitize_info container ANDROID: GKI: add thermal_zone_get_slope() to the .xml file Linux 5.4.122 Bluetooth: SMP: Fail if remote and local public keys are identical video: hgafb: correctly handle card detect failure during probe nvmet: use new ana_log_size instead the old one Bluetooth: L2CAP: Fix handling LE modes by L2CAP_OPTIONS ext4: fix error handling in ext4_end_enable_verity() nvme-multipath: fix double initialization of ANA state tty: vt: always invoke vc->vc_sw->con_resize callback vt: Fix character height handling with VT_RESIZEX vgacon: Record video mode changes with VT_RESIZEX video: hgafb: fix potential NULL pointer dereference qlcnic: Add null check after calling netdev_alloc_skb leds: lp5523: check return value of lp5xx_read and jump to cleanup code ics932s401: fix broken handling of errors when word reading fails net: rtlwifi: properly check for alloc_workqueue() failure scsi: ufs: handle cleanup correctly on devm_reset_control_get error net: stmicro: handle clk_prepare() failure during init ethernet: sun: niu: fix missing checks of niu_pci_eeprom_read() Revert "niu: fix missing checks of niu_pci_eeprom_read" Revert "qlcnic: Avoid potential NULL pointer dereference" Revert "rtlwifi: fix a potential NULL pointer dereference" Revert "media: rcar_drif: fix a memory disclosure" cdrom: gdrom: initialize global variable at init time cdrom: gdrom: deallocate struct gdrom_unit fields in remove_gdrom Revert "gdrom: fix a memory leak bug" Revert "scsi: ufs: fix a missing check of devm_reset_control_get" Revert "ecryptfs: replace BUG_ON with error handling code" Revert "video: imsttfb: fix potential NULL pointer dereferences" Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe" Revert "leds: lp5523: fix a missing check of return value of lp55xx_read" Revert "net: stmicro: fix a missing check of clk_prepare" Revert "video: hgafb: fix potential NULL pointer dereference" dm snapshot: fix crash with transient storage and zero chunk size xen-pciback: reconfigure also from backend watch handler mmc: sdhci-pci-gli: increase 1.8V regulator wait drm/amdgpu: update sdma golden setting for Navi12 drm/amdgpu: update gc golden setting for Navi12 drm/amdgpu: disable 3DCGCG on picasso/raven1 to avoid compute hang Revert "serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference" rapidio: handle create_workqueue() failure Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" uio_hv_generic: Fix a memory leak in error handling paths ALSA: hda/realtek: Add fixup for HP Spectre x360 15-df0xxx ALSA: hda/realtek: Add fixup for HP OMEN laptop ALSA: hda/realtek: Fix silent headphone output on ASUS UX430UA ALSA: hda/realtek: Add some CLOVE SSIDs of ALC293 ALSA: hda/realtek: reset eapd coeff to default value for alc287 ALSA: firewire-lib: fix check for the size of isochronous packet payload Revert "ALSA: sb8: add a check for request_region" ALSA: hda: fixup headset for ASUS GU502 laptop ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro ALSA: usb-audio: Validate MS endpoint descriptors ALSA: firewire-lib: fix calculation for size of IR context payload ALSA: dice: fix stream format at middle sampling rate for Alesis iO 26 ALSA: line6: Fix racy initialization of LINE6 MIDI ALSA: intel8x0: Don't update period unless prepared ALSA: dice: fix stream format for TC Electronic Konnekt Live at high sampling transfer frequency cifs: fix memory leak in smb2_copychunk_range btrfs: avoid RCU stalls while running delayed iputs locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal nvmet: seset ns->file when open fails ptrace: make ptrace() fail if the tracee changed its pid unexpectedly RDMA/uverbs: Fix a NULL vs IS_ERR() bug platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios platform/mellanox: mlxbf-tmfifo: Fix a memory barrier issue RDMA/core: Don't access cm_id after its destruction RDMA/mlx5: Recover from fatal event in dual port mode scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword() scsi: ufs: core: Increase the usable queue depth RDMA/rxe: Clear all QP fields if creation failed RDMA/siw: Release xarray entry RDMA/siw: Properly check send and receive CQ pointers openrisc: Fix a memory leak firmware: arm_scpi: Prevent the ternary sign expansion bug Linux 5.4.121 scripts: switch explicitly to Python 3 tweewide: Fix most Shebang lines KVM: arm64: Initialize VCPU mdcr_el2 before loading it ipv6: remove extra dev_hold() for fallback tunnels ip6_tunnel: sit: proper dev_{hold|put} in ndo_[un]init methods sit: proper dev_{hold|put} in ndo_[un]init methods ip6_gre: proper dev_{hold|put} in ndo_[un]init methods net: stmmac: Do not enable RX FIFO overflow interrupts lib: stackdepot: turn depot_lock spinlock to raw_spinlock block: reexpand iov_iter after read/write ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP gpiolib: acpi: Add quirk to ignore EC wakeups on Dell Venue 10 Pro 5055 drm/amd/display: Fix two cursor duplication when using overlay bridge: Fix possible races between assigning rx_handler_data and setting IFF_BRIDGE_PORT bit scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found ceph: fix fscache invalidation scsi: lpfc: Fix illegal memory access on Abort IOCBs riscv: Workaround mcount name prior to clang-13 scripts/recordmcount.pl: Fix RISC-V regex for clang ARM: 9075/1: kernel: Fix interrupted SMC calls um: Disable CONFIG_GCOV with MODULES um: Mark all kernel symbols as local Input: silead - add workaround for x86 BIOS-es which bring the chip up in a stuck state Input: elants_i2c - do not bind to i2c-hid compatible ACPI instantiated devices ACPI / hotplug / PCI: Fix reference count leak in enable_slot() ARM: 9066/1: ftrace: pause/unpause function graph tracer in cpu_suspend() dmaengine: dw-edma: Fix crash on loading/unloading driver PCI: thunder: Fix compile testing virtio_net: Do not pull payload in skb->head xsk: Simplify detection of empty and full rings pinctrl: ingenic: Improve unreachable code generation isdn: capi: fix mismatched prototypes cxgb4: Fix the -Wmisleading-indentation warning usb: sl811-hcd: improve misleading indentation kgdb: fix gcc-11 warning on indentation x86/msr: Fix wr/rdmsr_safe_regs_on_cpu() prototypes ANDROID: GKI: genksyms fixup for efed9a3337e3 ("kyber: fix out of bounds access when * preempted") Revert "PM: runtime: Fix unpaired parent child_count for force_resume" Revert "mm: fix struct page layout on 32-bit systems" Linux 5.4.120 ASoC: rsnd: check all BUSIF status when error nvme: do not try to reconfigure APST when the controller is not live clk: exynos7: Mark aclk_fsys1_200 as critical netfilter: conntrack: Make global sysctls readonly in non-init netns kobject_uevent: remove warning in init_uevent_argv() usb: typec: tcpm: Fix error while calculating PPS out values ARM: 9027/1: head.S: explicitly map DT even if it lives in the first physical section ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address ARM: 9012/1: move device tree mapping out of linear region ARM: 9011/1: centralize phys-to-virt conversion of DT/ATAGS address f2fs: fix error handling in f2fs_end_enable_verity() thermal/core/fair share: Lock the thermal zone while looping over instances MIPS: Avoid handcoded DIVU in `__div64_32' altogether MIPS: Avoid DIVU in `__div64_32' is result would be zero MIPS: Reinstate platform `__div64_32' handler FDDI: defxx: Make MMIO the configuration default except for EISA mm: fix struct page layout on 32-bit systems KVM: x86: Cancel pvclock_gtod_work on module removal cdc-wdm: untangle a circular dependency between callback and softint iio: tsl2583: Fix division by a zero lux_val iio: gyro: mpu3050: Fix reported temperature value xhci: Add reset resume quirk for AMD xhci controller. xhci: Do not use GFP_KERNEL in (potentially) atomic context usb: dwc3: gadget: Return success always for kick transfer in ep queue usb: core: hub: fix race condition about TRSMRCY of resume usb: dwc2: Fix gadget DMA unmap direction usb: xhci: Increase timeout for HC halt usb: dwc3: pci: Enable usb2-gadget-lpm-disable for Intel Merrifield usb: dwc3: omap: improve extcon initialization iomap: fix sub-page uptodate handling blk-mq: Swap two calls in blk_mq_exit_queue() nbd: Fix NULL pointer in flush_workqueue kyber: fix out of bounds access when preempted ACPI: scan: Fix a memory leak in an error handling path hwmon: (occ) Fix poll rate limiting usb: fotg210-hcd: Fix an error message iio: proximity: pulsedlight: Fix rumtime PM imbalance on error drm/i915: Avoid div-by-zero on gen2 drm/radeon/dpm: Disable sclk switching on Oland when two 4K 60Hz monitors are connected mm/hugetlb: fix F_SEAL_FUTURE_WRITE userfaultfd: release page in error path to avoid BUG_ON squashfs: fix divide error in calculate_skip() hfsplus: prevent corruption in shrinking truncate powerpc/64s: Fix crashes when toggling entry flush barrier powerpc/64s: Fix crashes when toggling stf barrier ARC: mm: PAE: use 40-bit physical page mask ARC: entry: fix off-by-one error in syscall number validation i40e: Fix PHY type identifiers for 2.5G and 5G adapters i40e: fix the restart auto-negotiation after FEC modified i40e: Fix use-after-free in i40e_client_subtask() netfilter: nftables: avoid overflows in nft_hash_buckets() kernel: kexec_file: fix error return code of kexec_calculate_store_digests() sched/fair: Fix unfairness caused by missing load decay sched: Fix out-of-bound access in uclamp can: m_can: m_can_tx_work_queue(): fix tx_skb race condition netfilter: nfnetlink_osf: Fix a missing skb_header_pointer() NULL check smc: disallow TCP_ULP in smc_setsockopt() net: fix nla_strcmp to handle more then one trailing null character ksm: fix potential missing rmap_item for stable_node mm/migrate.c: fix potential indeterminate pte entry in migrate_vma_insert_page() mm/hugeltb: handle the error case in hugetlb_fix_reserve_counts() khugepaged: fix wrong result value for trace_mm_collapse_huge_page_isolate() drm/radeon: Avoid power table parsing memory leaks drm/radeon: Fix off-by-one power_state index heap overwrite netfilter: xt_SECMARK: add new revision to fix structure layout sctp: fix a SCTP_MIB_CURRESTAB leak in sctp_sf_do_dupcook_b ethernet:enic: Fix a use after free bug in enic_hard_start_xmit sunrpc: Fix misplaced barrier in call_decode RISC-V: Fix error code returned by riscv_hartid_to_cpuid() sctp: do asoc update earlier in sctp_sf_do_dupcook_a net: hns3: disable phy loopback setting in hclge_mac_start_phy net: hns3: use netif_tx_disable to stop the transmit queue net: hns3: fix for vxlan gpe tx checksum bug net: hns3: add check for HNS3_NIC_STATE_INITED in hns3_reset_notify_up_enet() net: hns3: initialize the message content in hclge_get_link_mode() net: hns3: fix incorrect configuration for igu_egu_hw_err rtc: ds1307: Fix wday settings for rx8130 ceph: fix inode leak on getattr error in __fh_to_dentry rtc: fsl-ftm-alarm: add MODULE_TABLE() NFSv4.2 fix handling of sr_eof in SEEK's reply pNFS/flexfiles: fix incorrect size check in decode_nfs_fh() PCI: endpoint: Fix missing destroy_workqueue() NFS: Deal correctly with attribute generation counter overflow NFSv4.2: Always flush out writes in nfs42_proc_fallocate() rpmsg: qcom_glink_native: fix error return code of qcom_glink_rx_data() ARM: 9064/1: hw_breakpoint: Do not directly check the event's overflow_handler hook PCI: Release OF node in pci_scan_device()'s error path PCI: iproc: Fix return value of iproc_msi_irq_domain_alloc() f2fs: fix a redundant call to f2fs_balance_fs if an error occurs thermal: thermal_of: Fix error return code of thermal_of_populate_bind_params() ASoC: rt286: Make RT286_SET_GPIO_* readable and writable ia64: module: fix symbolizer crash on fdescr bnxt_en: Add PCI IDs for Hyper-V VF devices. net: ethernet: mtk_eth_soc: fix RX VLAN offload iavf: remove duplicate free resources calls powerpc/iommu: Annotate nested lock for lockdep qtnfmac: Fix possible buffer overflow in qtnf_event_handle_external_auth wl3501_cs: Fix out-of-bounds warnings in wl3501_mgmt_join wl3501_cs: Fix out-of-bounds warnings in wl3501_send_pkt drm/amd/display: fixed divide by zero kernel crash during dsc enablement powerpc/pseries: Stop calling printk in rtas_stop_self() samples/bpf: Fix broken tracex1 due to kprobe argument change net: sched: tapr: prevent cycle_time == 0 in parse_taprio_schedule ethtool: ioctl: Fix out-of-bounds warning in store_link_ksettings_for_user() ASoC: rt286: Generalize support for ALC3263 codec powerpc/smp: Set numa node before updating mask flow_dissector: Fix out-of-bounds warning in __skb_flow_bpf_to_target() sctp: Fix out-of-bounds warning in sctp_process_asconf_param() ALSA: hda/hdmi: fix race in handling acomp ELD notification at resume kconfig: nconf: stop endless search loops selftests: Set CC to clang in lib.mk if LLVM is set drm/amd/display: Force vsync flip when reconfiguring MPCC iommu/amd: Remove performance counter pre-initialization test Revert "iommu/amd: Fix performance counter initialization" ASoC: rsnd: call rsnd_ssi_master_clk_start() from rsnd_ssi_init() cuse: prevent clone mt76: mt76x0: disable GTK offloading pinctrl: samsung: use 'int' for register masks in Exynos mac80211: clear the beacon's CRC after channel switch i2c: Add I2C_AQ_NO_REP_START adapter quirk ASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Hi8 tablet ip6_vti: proper dev_{hold|put} in ndo_[un]init methods Bluetooth: check for zapped sk before connecting net: bridge: when suppression is enabled exclude RARP packets Bluetooth: initialize skb_queue_head at l2cap_chan_create() Bluetooth: Set CONF_NOT_COMPLETE as l2cap_chan default ALSA: bebob: enable to deliver MIDI messages for multiple ports ALSA: rme9652: don't disable if not enabled ALSA: hdspm: don't disable if not enabled ALSA: hdsp: don't disable if not enabled i2c: bail out early when RDWR parameters are wrong ASoC: rsnd: core: Check convert rate in rsnd_hw_params net: stmmac: Set FIFO sizes for ipq806x ASoC: Intel: bytcr_rt5640: Enable jack-detect support on Asus T100TAF tipc: convert dest node's address to network order fs: dlm: fix debugfs dump PM: runtime: Fix unpaired parent child_count for force_resume KVM: x86/mmu: Remove the defunct update_pte() paging hook tpm, tpm_tis: Reserve locality in tpm_tis_resume() tpm, tpm_tis: Extend locality handling to TPM2 in tpm_tis_gen_interrupt() tpm: fix error return code in tpm2_get_cc_attrs_tbl() Revert "smp: Fix smp_call_function_single_async prototype" Revert "usb: typec: tcpm: Address incorrect values of tcpm psy for fixed supply" Revert "usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply" Revert "usb: typec: tcpm: update power supply once partner accepts" Revert "spi: Fix use-after-free with devm_spi_alloc_*" Linux 5.4.119 Revert "fdt: Properly handle "no-map" field in the memory region" Revert "of/fdt: Make sure no-map does not remove already reserved regions" sctp: delay auto_asconf init until binding the first addr Revert "net/sctp: fix race condition in sctp_destroy_sock" smp: Fix smp_call_function_single_async prototype net: Only allow init netns to set default tcp cong to a restricted algo mm/memory-failure: unnecessary amount of unmapping mm/sparse: add the missing sparse_buffer_fini() in error branch kfifo: fix ternary sign extension bugs net:nfc:digital: Fix a double free in digital_tg_recv_dep_req net: bridge: mcast: fix broken length + header check for MRDv6 Adv. RDMA/bnxt_re: Fix a double free in bnxt_qplib_alloc_res RDMA/siw: Fix a use after free in siw_alloc_mr net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send bnxt_en: Fix RX consumer index logic in the error path. selftests: net: mirror_gre_vlan_bridge_1q: Make an FDB entry static net: geneve: modify IP header check in geneve6_xmit_skb and geneve_xmit_skb arm64: dts: uniphier: Change phy-mode to RGMII-ID to enable delay pins for RTL8211E ARM: dts: uniphier: Change phy-mode to RGMII-ID to enable delay pins for RTL8211E bnxt_en: fix ternary sign extension bug in bnxt_show_temp() powerpc/52xx: Fix an invalid ASM expression ('addi' used instead of 'add') ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devices net: phy: intel-xway: enable integrated led functions net: renesas: ravb: Fix a stuck issue when a lot of frames are received net: davinci_emac: Fix incorrect masking of tx and rx error channel ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails RDMA/i40iw: Fix error unwinding when i40iw_hmc_sd_one fails RDMA/cxgb4: add missing qpid increment gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check vsock/vmci: log once the failed queue pair allocation mwl8k: Fix a double Free in mwl8k_probe_hw i2c: sh7760: fix IRQ error path rtlwifi: 8821ae: upgrade PHY and RF parameters powerpc/pseries: extract host bridge from pci_bus prior to bus removal MIPS: pci-legacy: stop using of_pci_range_to_resource perf beauty: Fix fsconfig generator drm/i915/gvt: Fix error code in intel_gvt_init_device() ASoC: ak5558: correct reset polarity powerpc/xive: Fix xmon command "dxi" i2c: sh7760: add IRQ check i2c: jz4780: add IRQ check i2c: emev2: add IRQ check i2c: cadence: add IRQ check i2c: sprd: fix reference leak when pm_runtime_get_sync fails i2c: omap: fix reference leak when pm_runtime_get_sync fails i2c: imx-lpi2c: fix reference leak when pm_runtime_get_sync fails i2c: img-scb: fix reference leak when pm_runtime_get_sync fails RDMA/srpt: Fix error return code in srpt_cm_req_recv() net: thunderx: Fix unintentional sign extension issue cxgb4: Fix unintentional sign extension issues IB/hfi1: Fix error return code in parse_platform_config() RDMA/qedr: Fix error return code in qedr_iw_connect() KVM: PPC: Book3S HV P9: Restore host CTRL SPR after guest exit mt7601u: fix always true expression mac80211: bail out if cipher schemes are invalid powerpc: iommu: fix build when neither PCI or IBMVIO is set powerpc/perf: Fix PMU constraint check for EBB events powerpc/64s: Fix pte update for kernel memory on radix liquidio: Fix unintented sign extension of a left shift of a u16 ASoC: simple-card: fix possible uninitialized single_cpu local variable ALSA: usb-audio: Add error checks for usb_driver_claim_interface() calls mips: bmips: fix syscon-reboot nodes net: hns3: Limiting the scope of vector_ring_chain variable nfc: pn533: prevent potential memory corruption bug: Remove redundant condition check in report_bug ALSA: core: remove redundant spin_lock pair in snd_card_disconnect powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration inet: use bigger hash table for IP ID generation powerpc/prom: Mark identical_pvr_fixup as __init powerpc/fadump: Mark fadump_calculate_reserve_size as __init net: lapbether: Prevent racing when checking whether the netif is running perf symbols: Fix dso__fprintf_symbols_by_name() to return the number of printed chars HID: plantronics: Workaround for double volume key presses drivers/block/null_blk/main: Fix a double free in null_init. sched/debug: Fix cgroup_path[] serialization x86/events/amd/iommu: Fix sysfs type mismatch HSI: core: fix resource leaks in hsi_add_client_from_dt() nvme-pci: don't simple map sgl when sgls are disabled mfd: stm32-timers: Avoid clearing auto reload register scsi: ibmvfc: Fix invalid state machine BUG_ON() scsi: sni_53c710: Add IRQ check scsi: sun3x_esp: Add IRQ check scsi: jazz_esp: Add IRQ check scsi: hisi_sas: Fix IRQ checks clk: uniphier: Fix potential infinite loop clk: qcom: a53-pll: Add missing MODULE_DEVICE_TABLE clk: zynqmp: move zynqmp_pll_set_mode out of round_rate callback vfio/mdev: Do not allow a mdev_type to have a NULL parent pointer media: v4l2-ctrls.c: fix race condition in hdl->requests list nvme: retrigger ANA log update if group descriptor isn't found nvmet-tcp: fix incorrect locking in state_change sk callback nvme-tcp: block BH in sk state_change sk callback ata: libahci_platform: fix IRQ check sata_mv: add IRQ checks pata_ipx4xx_cf: fix IRQ check pata_arasan_cf: fix IRQ check x86/kprobes: Fix to check non boostable prefixes correctly drm/amdkfd: fix build error with AMD_IOMMU_V2=m media: m88rs6000t: avoid potential out-of-bounds reads on arrays media: platform: sunxi: sun6i-csi: fix error return code of sun6i_video_start_streaming() media: aspeed: fix clock handling logic media: omap4iss: return error code when omap4iss_get() failed media: vivid: fix assignment of dev->fbuf_out_flags soc: aspeed: fix a ternary sign expansion bug xen-blkback: fix compatibility bug with single page rings ttyprintk: Add TTY hangup callback. usb: dwc2: Fix hibernation between host and device modes. usb: dwc2: Fix host mode hibernation exit with remote wakeup flow. Drivers: hv: vmbus: Increase wait time for VMbus unload x86/platform/uv: Fix !KEXEC build failure platform/x86: pmc_atom: Match all Beckhoff Automation baytrail boards with critclk_systems DMI table usbip: vudc: fix missing unlock on error in usbip_sockfd_store() node: fix device cleanups in error handling code firmware: qcom-scm: Fix QCOM_SCM configuration serial: core: return early on unsupported ioctls tty: fix return value for unsupported ioctls tty: actually undefine superseded ASYNC flags USB: cdc-acm: fix TIOCGSERIAL implementation USB: cdc-acm: fix unprivileged TIOCCSERIAL usb: gadget: r8a66597: Add missing null check on return from platform_get_resource spi: fsl-lpspi: Fix PM reference leak in lpspi_prepare_xfer_hardware() cpufreq: armada-37xx: Fix determining base CPU frequency cpufreq: armada-37xx: Fix driver cleanup when registration failed clk: mvebu: armada-37xx-periph: Fix workaround for switching from L1 to L0 clk: mvebu: armada-37xx-periph: Fix switching CPU freq from 250 Mhz to 1 GHz cpufreq: armada-37xx: Fix the AVS value for load L1 clk: mvebu: armada-37xx-periph: remove .set_parent method for CPU PM clock cpufreq: armada-37xx: Fix setting TBG parent for load levels crypto: qat - Fix a double free in adf_create_ring ACPI: CPPC: Replace cppc_attr with kobj_attribute soc: qcom: mdt_loader: Detect truncated read of segments soc: qcom: mdt_loader: Validate that p_filesz < p_memsz spi: Fix use-after-free with devm_spi_alloc_* PM / devfreq: Use more accurate returned new_freq as resume_freq staging: greybus: uart: fix unprivileged TIOCCSERIAL staging: rtl8192u: Fix potential infinite loop irqchip/gic-v3: Fix OF_BAD_ADDR error handling mtd: rawnand: gpmi: Fix a double free in gpmi_nand_init m68k: mvme147,mvme16x: Don't wipe PCC timer config bits soundwire: stream: fix memory leak in stream config error path memory: pl353: fix mask of ECC page_size config register USB: gadget: udc: fix wrong pointer passed to IS_ERR() and PTR_ERR() usb: gadget: aspeed: fix dma map failure crypto: qat - fix error path in adf_isr_resource_alloc() phy: marvell: ARMADA375_USBCLUSTER_PHY should not default to y, unconditionally soundwire: bus: Fix device found flag correctly bus: qcom: Put child node before return mtd: require write permissions for locking and badblock ioctls fotg210-udc: Complete OUT requests on short packets fotg210-udc: Don't DMA more than the buffer can take fotg210-udc: Mask GRP2 interrupts we don't handle fotg210-udc: Remove a dubious condition leading to fotg210_done fotg210-udc: Fix EP0 IN requests bigger than two packets fotg210-udc: Fix DMA on EP0 for length > max packet size crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init crypto: qat - don't release uninitialized resources usb: gadget: pch_udc: Check for DMA mapping error usb: gadget: pch_udc: Check if driver is present before calling ->setup() usb: gadget: pch_udc: Replace cpu_to_le32() by lower_32_bits() x86/microcode: Check for offline CPUs before requesting new microcode arm64: dts: renesas: r8a77980: Fix vin4-7 endpoint binding spi: stm32: drop devres version of spi_register_master arm64: dts: qcom: sm8150: fix number of pins in 'gpio-ranges' mtd: rawnand: qcom: Return actual error code instead of -ENODEV mtd: Handle possible -EPROBE_DEFER from parse_mtd_partitions() mtd: rawnand: brcmnand: fix OOB R/W with Hamming ECC mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe() regmap: set debugfs_name to NULL after it is freed usb: typec: tcpci: Check ROLE_CONTROL while interpreting CC_STATUS serial: stm32: fix tx_empty condition serial: stm32: fix incorrect characters on console ARM: dts: exynos: correct PMIC interrupt trigger level on Snow ARM: dts: exynos: correct PMIC interrupt trigger level on SMDK5250 ARM: dts: exynos: correct PMIC interrupt trigger level on Odroid X/U3 family ARM: dts: exynos: correct PMIC interrupt trigger level on Midas family ARM: dts: exynos: correct MUIC interrupt trigger level on Midas family ARM: dts: exynos: correct fuel gauge interrupt trigger level on Midas family memory: gpmc: fix out of bounds read and dereference on gpmc_cs[] usb: gadget: pch_udc: Revertd3cb25a121
completely ovl: fix missing revert_creds() on error path Revert "i3c master: fix missing destroy_workqueue() on error in i3c_master_register" KVM: Stop looking for coalesced MMIO zones if the bus is destroyed KVM: nVMX: Truncate bits 63:32 of VMCS field on nested check in !64-bit KVM: s390: split kvm_s390_real_to_abs s390: fix detection of vector enhancements facility 1 vs. vector packed decimal facility KVM: s390: fix guarded storage control register handling KVM: s390: split kvm_s390_logical_to_effective ALSA: hda/realtek: ALC285 Thinkpad jack pin quirk is unreachable ALSA: hda/realtek: Remove redundant entry for ALC861 Haier/Uniwill devices ALSA: hda/realtek: Re-order ALC662 quirk table entries ALSA: hda/realtek: Re-order remaining ALC269 quirk table entries ALSA: hda/realtek: Re-order ALC269 Lenovo quirk table entries ALSA: hda/realtek: Re-order ALC269 Sony quirk table entries ALSA: hda/realtek: Re-order ALC269 ASUS quirk table entries ALSA: hda/realtek: Re-order ALC269 Dell quirk table entries ALSA: hda/realtek: Re-order ALC269 Acer quirk table entries ALSA: hda/realtek: Re-order ALC269 HP quirk table entries ALSA: hda/realtek: Re-order ALC882 Clevo quirk table entries ALSA: hda/realtek: Re-order ALC882 Sony quirk table entries ALSA: hda/realtek: Re-order ALC882 Acer quirk table entries drm/amd/display: Reject non-zero src_y and src_x for video planes drm/radeon: fix copy of uninitialized variable back to userspace drm/panfrost: Don't try to map pages that are already mapped drm/panfrost: Clear MMU irqs before handling the fault rtw88: Fix array overrun in rtw_get_tx_power_params() cfg80211: scan: drop entry from hidden_list on overflow ipw2x00: potential buffer overflow in libipw_wx_set_encodeext() md: Fix missing unused status line of /proc/mdstat md: md_open returns -EBUSY when entering racing area md: factor out a mddev_find_locked helper from mddev_find md: split mddev_find md-cluster: fix use-after-free issue when removing rdev md/bitmap: wait for external bitmap writes to complete during tear down misc: vmw_vmci: explicitly initialize vmci_datagram payload misc: vmw_vmci: explicitly initialize vmci_notify_bm_set_msg struct misc: lis3lv02d: Fix false-positive WARN on various HP models iio:accel:adis16201: Fix wrong axis assignment that prevents loading PCI: Allow VPD access for QLogic ISP2722 FDDI: defxx: Bail out gracefully with unassigned PCI resource for CSR MIPS: pci-rt2880: fix slot 0 configuration MIPS: pci-mt7620: fix PLL lock check ASoC: Intel: kbl_da7219_max98927: Fix kabylake_ssp_fixup function ASoC: samsung: tm2_wm5110: check of of_parse return value usb: xhci-mtk: improve bandwidth scheduling with TT usb: xhci-mtk: remove or operator for setting schedule parameters usb: typec: tcpm: update power supply once partner accepts usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply usb: typec: tcpm: Address incorrect values of tcpm psy for fixed supply staging: fwserial: fix TIOCSSERIAL permission check tty: moxa: fix TIOCSSERIAL permission check staging: fwserial: fix TIOCSSERIAL jiffies conversions USB: serial: ti_usb_3410_5052: fix TIOCSSERIAL permission check staging: greybus: uart: fix TIOCSSERIAL jiffies conversions USB: serial: usb_wwan: fix TIOCSSERIAL jiffies conversions tty: amiserial: fix TIOCSSERIAL permission check tty: moxa: fix TIOCSSERIAL jiffies conversions Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL" net/nfc: fix use-after-free llcp_sock_bind/connect bluetooth: eliminate the potential race condition when removing the HCI controller hsr: use netdev_err() instead of WARN_ONCE() Bluetooth: verify AMP hci_chan before amp_destroy ANDROID: GKI: restore a part of "struct mmc_host" Revert "mmc: block: Issue a cache flush only when it's enabled" Linux 5.4.118 dm rq: fix double free of blk_mq_tag_set in dev remove after table load fails dm integrity: fix missing goto in bitmap_flush_interval error handling dm space map common: fix division bug in sm_ll_find_free_block() dm persistent data: packed struct should have an aligned() attribute too tracing: Restructure trace_clock_global() to never block tracing: Map all PIDs to command lines rsi: Use resume_noirq for SDIO tty: fix memory leak in vc_deallocate usb: dwc2: Fix session request interrupt handler usb: dwc3: gadget: Fix START_TRANSFER link state check usb: gadget/function/f_fs string table fix for multiple languages usb: gadget: Fix double free of device descriptor pointers usb: gadget: dummy_hcd: fix gpf in gadget_setup media: staging/intel-ipu3: Fix race condition during set_fmt media: staging/intel-ipu3: Fix set_fmt error handling media: staging/intel-ipu3: Fix memory leak in imu_fmt media: dvb-usb: Fix memory leak at error in dvb_usb_device_init() media: dvb-usb: Fix use-after-free access media: dvbdev: Fix memory leak in dvb_media_device_free() ext4: fix error code in ext4_commit_super ext4: do not set SB_ACTIVE in ext4_orphan_cleanup() ext4: fix check to prevent false positive report of incorrect used inodes kbuild: update config_data.gz only when the content of .config is changed x86/cpu: Initialize MSR_TSC_AUX if RDTSCP *or* RDPID is supported Revert337f13046f
("futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op") jffs2: check the validity of dstlen in jffs2_zlib_compress() Fix misc new gcc warnings security: commoncap: fix -Wstringop-overread warning fuse: fix write deadlock dm raid: fix inconclusive reshape layout on fast raid4/5/6 table reload sequences md/raid1: properly indicate failure when ending a failed write request crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS tpm: vtpm_proxy: Avoid reading host log when using a virtual device tpm: efi: Use local variable for calculating final log size intel_th: pci: Add Alder Lake-M support powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h powerpc/eeh: Fix EEH handling for hugepages in ioremap space. jffs2: Fix kasan slab-out-of-bounds problem Input: ili210x - add missing negation for touch indication on ili210x NFSv4: Don't discard segments marked for return in _pnfs_return_layout() NFS: Don't discard pNFS layout segments that are marked for return ACPI: GTDT: Don't corrupt interrupt mappings on watchdow probe failure openvswitch: fix stack OOB read while fragmenting IPv4 packets mlxsw: spectrum_mr: Update egress RIF list before route's action f2fs: fix to avoid out-of-bounds memory access ubifs: Only check replay with inode type to judge if inode linked virtiofs: fix memory leak in virtio_fs_probe() Makefile: Move -Wno-unused-but-set-variable out of GCC only block arm64/vdso: Discard .note.gnu.property sections in vDSO btrfs: fix race when picking most recent mod log operation for an old root ALSA: hda/realtek: Add quirk for Intel Clevo PCx0Dx ALSA: hda/realtek: fix static noise on ALC285 Lenovo laptops ALSA: hda/realtek: fix mic boost on Intel NUC 8 ALSA: hda/realtek: GA503 use same quirks as GA401 ALSA: usb-audio: Add dB range mapping for Sennheiser Communications Headset PC 8 ALSA: usb-audio: More constifications ALSA: usb-audio: Explicitly set up the clock selector ALSA: sb: Fix two use after free in snd_sb_qsound_build ALSA: hda/conexant: Re-order CX5066 quirk table entries ALSA: emu8000: Fix a use after free in snd_emu8000_create_mixer s390/archrandom: add parameter check for s390_arch_random_generate scsi: libfc: Fix a format specifier mfd: arizona: Fix rumtime PM imbalance on error scsi: lpfc: Remove unsupported mbox PORT_CAPABILITIES logic scsi: lpfc: Fix error handling for mailboxes completed in MBX_POLL mode scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response drm/amdgpu: fix NULL pointer dereference amdgpu: avoid incorrect %hu format string drm/amdkfd: Fix cat debugfs hang_hws file causes system crash bug drm/msm/mdp5: Do not multiply vclk line count by 100 drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal sched/fair: Ignore percpu threads for imbalance pulls media: gscpa/stv06xx: fix memory leak media: dvb-usb: fix memory leak in dvb_usb_adapter_init media: platform: sti: Fix runtime PM imbalance in regs_show media: i2c: adv7842: fix possible use-after-free in adv7842_remove() media: i2c: tda1997: Fix possible use-after-free in tda1997x_remove() media: i2c: adv7511-v4l2: fix possible use-after-free in adv7511_remove() media: adv7604: fix possible use-after-free in adv76xx_remove() media: tc358743: fix possible use-after-free in tc358743_remove() power: supply: s3c_adc_battery: fix possible use-after-free in s3c_adc_bat_remove() power: supply: generic-adc-battery: fix possible use-after-free in gab_remove() clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return media: vivid: update EDID media: em28xx: fix memory leak scsi: scsi_dh_alua: Remove check for ASC 24h in alua_rtpg() scsi: smartpqi: Add new PCI IDs scsi: smartpqi: Correct request leakage during reset operations ata: ahci: Disable SXS for Hisilicon Kunpeng920 mmc: sdhci-pci: Add PCI IDs for Intel LKF scsi: qla2xxx: Fix use after free in bsg drm/vkms: fix misuse of WARN_ON scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() drm/amd/display: fix dml prefetch validation drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool' drm/amdgpu : Fix asic reset regression issue introduce by 8f211fe8ac7c4f drm/amdkfd: Fix UBSAN shift-out-of-bounds warning drm/amdgpu: mask the xgmi number of hops reported from psp to kfd power: supply: Use IRQF_ONESHOT media: gspca/sq905.c: fix uninitialized variable media: media/saa7164: fix saa7164_encoder_register() memory leak bugs extcon: arizona: Fix various races on driver unbind extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged power: supply: bq27xxx: fix power_avg for newer ICs media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() media: drivers: media: pci: sta2x11: fix Kconfig dependency on GPIOLIB media: ite-cir: check for receive overflow scsi: target: pscsi: Fix warning in pscsi_complete_cmd() scsi: lpfc: Fix pt2pt connection does not recover after LOGO scsi: lpfc: Fix incorrect dbde assignment when building target abts wqe drm/amd/display: Don't optimize bandwidth before disabling planes drm/amd/display: Check for DSC support instead of ASIC revision drm/qxl: release shadow on shutdown drm: Added orientation quirk for OneGX1 Pro btrfs: convert logic BUG_ON()'s in replace_path to ASSERT()'s platform/x86: intel_pmc_core: Don't use global pmcdev in quirks crypto: omap-aes - Fix PM reference leak on omap-aes.c crypto: stm32/cryp - Fix PM reference leak on stm32-cryp.c crypto: stm32/hash - Fix PM reference leak on stm32-hash.c phy: phy-twl4030-usb: Fix possible use-after-free in twl4030_usb_remove() intel_th: Consistency and off-by-one fix tty: n_gsm: check error while registering tty devices usb: core: hub: Fix PM reference leak in usb_port_resume() usb: musb: fix PM reference leak in musb_irq_work() spi: qup: fix PM reference leak in spi_qup_remove() spi: omap-100k: Fix reference leak to master spi: dln2: Fix reference leak to master xhci: fix potential array out of bounds with several interrupters xhci: check control context is valid before dereferencing it. usb: xhci-mtk: support quirk to disable usb2 lpm perf/arm_pmu_platform: Fix error handling tee: optee: do not check memref size on return from Secure World x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) PCI: PM: Do not read power state in pci_enable_device_flags() usb: xhci: Fix port minor revision usb: dwc3: gadget: Ignore EP queue requests during bus reset usb: gadget: f_uac1: validate input parameters usb: gadget: f_uac2: validate input parameters genirq/matrix: Prevent allocation counter corruption usb: webcam: Invalid size of Processing Unit Descriptor usb: gadget: uvc: add bInterval checking for HS mode crypto: qat - fix unmap invalid dma address crypto: api - check for ERR pointers in crypto_destroy_tfm() spi: ath79: remove spi-master setup and cleanup assignment spi: ath79: always call chipselect function staging: wimax/i2400m: fix byte-order issue bus: ti-sysc: Probe for l4_wkup and l4_cfg interconnect devices first fbdev: zero-fill colormap in fbcmap.c posix-timers: Preserve return value in clock_adjtime32() intel_th: pci: Add Rocket Lake CPU support btrfs: fix metadata extent leak after failure to create subvolume cifs: Return correct error code from smb2_get_enc_key irqchip/gic-v3: Do not enable irqs when handling spurious interrups modules: inherit TAINT_PROPRIETARY_MODULE modules: return licensing information from find_symbol modules: rename the licence field in struct symsearch to license modules: unexport __module_address modules: unexport __module_text_address modules: mark each_symbol_section static modules: mark find_symbol static modules: mark ref_module static mmc: core: Fix hanging on I/O during system suspend for removable cards mmc: core: Set read only for SD cards with permanent write protect bit mmc: core: Do a power cycle when the CMD11 fails mmc: block: Issue a cache flush only when it's enabled mmc: block: Update ext_csd.cache_ctrl if it was written mmc: sdhci-pci: Fix initialization of some SD cards for Intel BYT-based controllers mmc: sdhci: Check for reset prior to DMA address unmap mmc: uniphier-sd: Fix a resource leak in the remove function mmc: uniphier-sd: Fix an error handling path in uniphier_sd_probe() scsi: mpt3sas: Block PCI config access from userspace during reset scsi: qla2xxx: Fix crash in qla2xxx_mqueuecommand() spi: spi-ti-qspi: Free DMA resources erofs: add unsupported inode i_format check mtd: rawnand: atmel: Update ecc_stats.corrected counter mtd: spinand: core: add missing MODULE_DEVICE_TABLE() ecryptfs: fix kernel panic with null dev_name arm64: dts: mt8173: fix property typo of 'phys' in dsi node arm64: dts: marvell: armada-37xx: add syscon compatible to NB clk node ARM: 9056/1: decompressor: fix BSS size calculation for LLVM ld.lld ftrace: Handle commands when closing set_ftrace_filter file ACPI: custom_method: fix a possible memory leak ACPI: custom_method: fix potential use-after-free issue s390/disassembler: increase ebpf disasm buffer size ANDROID: GKI: Update the .xml file after android11-5.4 merge Linux 5.4.117 vfio: Depend on MMU perf/core: Fix unconditional security_locked_down() call ovl: allow upperdir inside lowerdir scsi: ufs: Unlock on a couple error paths platform/x86: thinkpad_acpi: Correct thermal sensor allocation USB: Add reset-resume quirk for WD19's Realtek Hub USB: Add LPM quirk for Lenovo ThinkPad USB-C Dock Gen2 Ethernet ALSA: usb-audio: Add MIDI quirk for Vox ToneLab EX perf ftrace: Fix access to pid in array when setting a pid filter perf data: Fix error return code in perf_data__create_dir() iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() avoid __memcat_p link failure bpf: Fix leakage of uninitialized bpf stack under speculation bpf: Fix masking negation logic upon negative dst register iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd() igb: Enable RSS for Intel I211 Ethernet Controller net: usb: ax88179_178a: initialize local variables before use ACPI: x86: Call acpi_boot_table_init() after acpi_table_upgrade() ACPI: tables: x86: Reserve memory occupied by ACPI tables mips: Do not include hi and lo in clobber list for R6 Linux 5.4.116 bpf: Update selftests to reflect new error states bpf: Tighten speculative pointer arithmetic mask bpf: Move sanitize_val_alu out of op switch bpf: Refactor and streamline bounds check into helper bpf: Improve verifier error messages for users bpf: Rework ptr_limit into alu_limit and add common error path bpf: Ensure off_reg has no mixed signed bounds for all types bpf: Move off_reg into sanitize_ptr_alu Linux 5.4.115 USB: CDC-ACM: fix poison/unpoison imbalance net: hso: fix NULL-deref on disconnect regression x86/crash: Fix crash_setup_memmap_entries() out-of-bounds access ia64: tools: remove duplicate definition of ia64_mf() on ia64 ia64: fix discontig.c section mismatches csky: change a Kconfig symbol name to fix e1000 build error cavium/liquidio: Fix duplicate argument xen-netback: Check for hotplug-status existence before watching s390/entry: save the caller of psw_idle net: geneve: check skb is large enough for IPv4/IPv6 header ARM: dts: Fix swapped mmc order for omap3 HID: wacom: Assign boolean values to a bool variable HID: alps: fix error return code in alps_input_configured() HID: google: add don USB id perf auxtrace: Fix potential NULL pointer dereference perf/x86/kvm: Fix Broadwell Xeon stepping in isolation_ucodes[] perf/x86/intel/uncore: Remove uncore extra PCI dev HSWEP_PCI_PCU_3 locking/qrwlock: Fix ordering in queued_write_lock_slowpath() arm64: dts: allwinner: Revert SD card CD GPIO for Pine64-LTS pinctrl: lewisburg: Update number of pins in community gpio: omap: Save and restore sysconfig s390/ptrace: return -ENOSYS when invalid syscall is supplied ANDROID: clang: update to 12.0.5 Linux 5.4.114 net: phy: marvell: fix detection of PHY on Topaz switches ARM: 9071/1: uprobes: Don't hook on thumb instructions r8169: don't advertise pause in jumbo mode r8169: tweak max read request size for newer chips also in jumbo mtu mode r8169: improve rtl_jumbo_config r8169: fix performance regression related to PCIe max read request size r8169: simplify setting PCI_EXP_DEVCTL_NOSNOOP_EN r8169: remove fiddling with the PCIe max read request size arm64: dts: allwinner: Fix SD card CD GPIO for SOPine systems ARM: footbridge: fix PCI interrupt mapping gro: ensure frag0 meets IP header alignment ibmvnic: remove duplicate napi_schedule call in open function ibmvnic: remove duplicate napi_schedule call in do_reset function ibmvnic: avoid calling napi_disable() twice i40e: fix the panic when running bpf in xdpdrv mode net: ip6_tunnel: Unregister catch-all devices net: sit: Unregister catch-all devices net: davicom: Fix regulator not turned off on failed probe netfilter: nft_limit: avoid possible divide error in nft_limit_init net: macb: fix the restore of cmp registers netfilter: arp_tables: add pre_exit hook for table unregister netfilter: bridge: add pre_exit hooks for ebtable unregistration libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC netfilter: conntrack: do not print icmpv6 as unknown via /proc scsi: libsas: Reset num_scatter if libata marks qc as NODATA riscv: Fix spelling mistake "SPARSEMEM" to "SPARSMEM" vfio/pci: Add missing range check in vfio_pci_mmap arm64: alternatives: Move length validation in alternative_{insn, endif} arm64: fix inline asm in load_unaligned_zeropad() readdir: make sure to verify directory entry for legacy interfaces too dm verity fec: fix misaligned RS roots IO HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices Input: i8042 - fix Pegatron C15B ID entry Input: s6sy761 - fix coordinate read bit shift virt_wifi: Return micros for BSS TSF values mac80211: clear sta->fast_rx when STA removed from 4-addr VLAN pcnet32: Use pci_resource_len to validate PCI resource net: ieee802154: forbid monitor for add llsec seclevel net: ieee802154: stop dump llsec seclevels for monitors net: ieee802154: forbid monitor for del llsec devkey net: ieee802154: forbid monitor for add llsec devkey net: ieee802154: stop dump llsec devkeys for monitors net: ieee802154: forbid monitor for del llsec dev net: ieee802154: forbid monitor for add llsec dev net: ieee802154: stop dump llsec devs for monitors net: ieee802154: forbid monitor for del llsec key net: ieee802154: forbid monitor for add llsec key net: ieee802154: stop dump llsec keys for monitors scsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST state ASoC: fsl_esai: Fix TDM slot setup for I2S mode drm/msm: Fix a5xx/a6xx timestamps ARM: omap1: fix building with clang IAS ARM: keystone: fix integer overflow warning neighbour: Disregard DEAD dst in neigh_update ASoC: max98373: Added 30ms turn on/off time delay arc: kernel: Return -EFAULT if copy_to_user() fails lockdep: Add a missing initialization hint to the "INFO: Trying to register non-static key" message ARM: dts: Fix moving mmc devices with aliases for omap4 & 5 ARM: dts: Drop duplicate sha2md5_fck to fix clk_disable race dmaengine: dw: Make it dependent to HAS_IOMEM gpio: sysfs: Obey valid_mask Input: nspire-keypad - enable interrupts only when opened net/sctp: fix race condition in sctp_destroy_sock scsi: qla2xxx: Fix fabric scan hang scsi: qla2xxx: Fix stuck login session using prli_pend_timer scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure scsi: qla2xxx: Fix device connect issues in P2P configuration scsi: qla2xxx: Dual FCP-NVMe target port support Revert "scsi: qla2xxx: Fix stuck login session using prli_pend_timer" Revert "scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure" Linux 5.4.113 xen/events: fix setting irq affinity perf map: Tighten snprintf() string precision to pass gcc check on some 32-bit arches perf tools: Use %zd for size_t printf formats on 32-bit perf tools: Use %define api.pure full instead of %pure-parser driver core: Fix locking bug in deferred_probe_timeout_work_func() netfilter: x_tables: fix compat match/target pad out-of-bound write block: don't ignore REQ_NOWAIT for direct IO riscv,entry: fix misaligned base for excp_vect_table idr test suite: Create anchor before launching throbber idr test suite: Take RCU read lock in idr_find_test_1 radix tree test suite: Register the main thread with the RCU library block: only update parent bi_status when bio fail drm/tegra: dc: Don't set PLL clock to 0Hz gfs2: report "already frozen/thawed" errors drm/imx: imx-ldb: fix out of bounds array access warning KVM: arm64: Disable guest access to trace filter controls KVM: arm64: Hide system instruction access to Trace registers interconnect: core: fix error return code of icc_link_destroy() Revert "UPSTREAM: scsi: ufs: Avoid busy-waiting by eliminating tag conflicts" Revert "UPSTREAM: scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs" Revert "UPSTREAM: scsi: ufs: core: Fix task management request completion timeout" Revert "UPSTREAM: scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs" Revert "net: xfrm: Localize sequence counter per network namespace" UPSTREAM: scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs UPSTREAM: scsi: ufs: core: Fix task management request completion timeout UPSTREAM: scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs UPSTREAM: scsi: ufs: Avoid busy-waiting by eliminating tag conflicts Linux 5.4.112 Revert "cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath." net: ieee802154: stop dump llsec params for monitors net: ieee802154: forbid monitor for del llsec seclevel net: ieee802154: forbid monitor for set llsec params net: ieee802154: fix nl802154 del llsec devkey net: ieee802154: fix nl802154 add llsec key net: ieee802154: fix nl802154 del llsec dev net: ieee802154: fix nl802154 del llsec key net: ieee802154: nl-mac: fix check on panid net: mac802154: Fix general protection fault drivers: net: fix memory leak in peak_usb_create_dev drivers: net: fix memory leak in atusb_probe net: tun: set tun->dev->addr_len during TUNSETLINK processing cfg80211: remove WARN_ON() in cfg80211_sme_connect net: sched: bump refcount for new action in ACT replace mode dt-bindings: net: ethernet-controller: fix typo in NVMEM clk: socfpga: fix iomem pointer cast on 64-bit RAS/CEC: Correct ce_add_elem()'s returned values RDMA/addr: Be strict with gid size RDMA/cxgb4: check for ipv6 address properly while destroying listener net/mlx5: Fix PBMC register mapping net/mlx5: Fix placement of log_max_flow_counter net: hns3: clear VF down state bit before request link status openvswitch: fix send of uninitialized stack memory in ct limit reply net: openvswitch: conntrack: simplify the return expression of ovs_ct_limit_get_default_limit() perf inject: Fix repipe usage s390/cpcmd: fix inline assembly register clobbering workqueue: Move the position of debug_work_activate() in __queue_work() clk: fix invalid usage of list cursor in unregister clk: fix invalid usage of list cursor in register net: macb: restore cmp registers on resume path scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs scsi: ufs: core: Fix task management request completion timeout scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs scsi: ufs: Avoid busy-waiting by eliminating tag conflicts scsi: ufs: Fix irq return code net: udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...); drm/msm: Set drvdata to NULL when msm_drm_init() fails i40e: Fix display statistics for veb_tc soc/fsl: qbman: fix conflicting alignment attributes net/rds: Fix a use after free in rds_message_map_pages net/mlx5: Don't request more than supported EQs net/mlx5e: Fix ethtool indication of connector type ASoC: sunxi: sun4i-codec: fill ASoC card owner net: phy: broadcom: Only advertise EEE for supported modes nfp: flower: ignore duplicate merge hints from FW net/ncsi: Avoid channel_monitor hrtimer deadlock ARM: dts: imx6: pbab01: Set vmmc supply for both SD interfaces net:tipc: Fix a double free in tipc_sk_mcast_rcv cxgb4: avoid collecting SGE_QBASE regs during traffic gianfar: Handle error code at MAC address change can: bcm/raw: fix msg_namelen values depending on CAN_REQUIRED_SIZE arm64: dts: imx8mm/q: Fix pad control of SD1_DATA0 sch_red: fix off-by-one checks in red_check_params() amd-xgbe: Update DMA coherency values hostfs: fix memory handling in follow_link() hostfs: Use kasprintf() instead of fixed buffer formatting i40e: Fix kernel oops when i40e driver removes VF's i40e: Added Asym_Pause to supported link modes xfrm: Fix NULL pointer dereference on policy lookup ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some chips ASoC: SOF: Intel: HDA: fix core status verification ASoC: SOF: Intel: hda: remove unnecessary parentheses esp: delete NETIF_F_SCTP_CRC bit from features for esp offload net: xfrm: Localize sequence counter per network namespace regulator: bd9571mwv: Fix AVS and DVFS voltage range xfrm: interface: fix ipv4 pmtu check to honor ip header df net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits net: dsa: lantiq_gswip: Don't use PHY auto polling virtio_net: Add XDP meta data support i2c: turn recovery error on init to debug usbip: synchronize event handler with sysfs code paths usbip: vudc synchronize sysfs code paths usbip: stub-dev synchronize sysfs code paths usbip: add sysfs_lock to synchronize sysfs code paths net: let skb_orphan_partial wake-up waiters. net-ipv6: bugfix - raw & sctp - switch to ipv6_can_nonlocal_bind() net: hsr: Reset MAC header for Tx path mac80211: fix TXQ AC confusion net: sched: sch_teql: fix null-pointer dereference i40e: Fix sparse error: 'vsi->netdev' could be null i40e: Fix sparse warning: missing error code 'err' net: ensure mac header is set in virtio_net_hdr_to_skb() bpf, sockmap: Fix sk->prot unhash op reset ethernet/netronome/nfp: Fix a use after free in nfp_bpf_ctrl_msg_rx net: hso: fix null-ptr-deref during tty device unregistration ice: Cleanup fltr list in case of allocation issues ice: Fix for dereference of NULL pointer ice: Increase control queue timeout batman-adv: initialize "struct batadv_tvlv_tt_vlan_data"->reserved field ARM: dts: turris-omnia: configure LED[2]/INTn pin as interrupt pin parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers parisc: parisc-agp requires SBA IOMMU driver fs: direct-io: fix missing sdio->boundary ocfs2: fix deadlock between setattr and dio_end_io_write nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff ia64: fix user_stack_pointer() for ptrace() gcov: re-fix clang-11+ support drm/i915: Fix invalid access to ACPI _DSM objects net: dsa: lantiq_gswip: Let GSWIP automatically set the xMII clock net: ipv6: check for validity before dereferencing cfg->fc_nlinfo.nlh xen/evtchn: Change irq_info lock to raw_spinlock_t nfc: Avoid endless loops caused by repeated llcp_sock_connect() nfc: fix memory leak in llcp_sock_connect() nfc: fix refcount leak in llcp_sock_connect() nfc: fix refcount leak in llcp_sock_bind() ASoC: intel: atom: Stop advertising non working S24LE support ALSA: hda/realtek: Fix speaker amp setup on Acer Aspire E1 ALSA: aloop: Fix initialization of controls counter: stm32-timer-cnt: fix ceiling miss-alignment with reload register Linux 5.4.111 init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM init/Kconfig: make COMPILE_TEST depend on !S390 nvme-mpath: replace direct_make_request with generic_make_request bpf, x86: Validate computation of branch displacements for x86-32 bpf, x86: Validate computation of branch displacements for x86-64 cifs: Silently ignore unknown oplock break handle cifs: revalidate mapping when we open files for SMB1 POSIX ia64: fix format strings for err_inject ia64: mca: allocate early mca with GFP_ATOMIC scsi: target: pscsi: Clean up after failure in pscsi_map_sg() x86/build: Turn off -fcf-protection for realmode targets platform/x86: thinkpad_acpi: Allow the FnLock LED to change state netfilter: conntrack: Fix gre tunneling over ipv6 drm/msm: Ratelimit invalid-fence message drm/msm/adreno: a5xx_power: Don't apply A540 lm_setup to other GPUs mac80211: choose first enabled channel for monitor mISDN: fix crash in fritzpci net: pxa168_eth: Fix a potential data race in pxa168_eth_remove net/mlx5e: Enforce minimum value check for ICOSQ size bpf, x86: Use kvmalloc_array instead kmalloc_array in bpf_jit_comp platform/x86: intel-hid: Support Lenovo ThinkPad X1 Tablet Gen 2 bus: ti-sysc: Fix warning on unbind if reset is not deasserted ARM: dts: am33xx: add aliases for mmc interfaces ANDROID: GKI: update .xml file Revert "net: introduce CAN specific pointer in the struct net_device" Linux 5.4.110 drivers: video: fbcon: fix NULL dereference in fbcon_cursor() staging: rtl8192e: Change state information from u16 to u8 staging: rtl8192e: Fix incorrect source in memcpy() usb: dwc2: Prevent core suspend when port connection flag is 0 usb: dwc2: Fix HPRT0.PrtSusp bit setting for HiKey 960 board. usb: gadget: udc: amd5536udc_pci fix null-ptr-dereference USB: cdc-acm: fix use-after-free after probe failure USB: cdc-acm: fix double free on probe failure USB: cdc-acm: downgrade message to debug USB: cdc-acm: untangle a circular dependency between callback and softint cdc-acm: fix BREAK rx code path adding necessary calls usb: xhci-mtk: fix broken streams issue on 0.96 xHCI usb: musb: Fix suspend with devices connected for a64 USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem usbip: vhci_hcd fix shift out-of-bounds in vhci_hub_control() firewire: nosy: Fix a use-after-free bug in nosy_ioctl() extcon: Fix error handling in extcon_dev_register extcon: Add stubs for extcon_register_notifier_all() functions pinctrl: rockchip: fix restore error in resume vfio/nvlink: Add missing SPAPR_TCE_IOMMU depends reiserfs: update reiserfs_xattrs_initialized() condition drm/amdgpu: check alignment on CPU page for bo map drm/amdgpu: fix offset calculation in amdgpu_vm_bo_clear_mappings() mm: fix race by making init_zero_pfn() early_initcall tracing: Fix stack trace event size PM: runtime: Fix ordering in pm_runtime_get_suppliers() PM: runtime: Fix race getting/putting suppliers at probe xtensa: move coprocessor_flush to the .text section ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook ALSA: hda/realtek: fix a determine_headset_type issue for a Dell AIO ALSA: hda: Add missing sanity checks in PM prepare/complete callbacks ALSA: hda: Re-add dropped snd_poewr_change_state() calls ALSA: usb-audio: Apply sample rate quirk to Logitech Connect bpf: Remove MTU check in __bpf_skb_max_len net: wan/lmc: unregister device when no matching device is found appletalk: Fix skb allocation size in loopback case net: ethernet: aquantia: Handle error cleanup of start on open ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr() brcmfmac: clear EAP/association status bits on linkdown events can: tcan4x5x: fix max register value net: introduce CAN specific pointer in the struct net_device can: dev: move driver related infrastructure into separate subdir flow_dissector: fix TTL and TOS dissection on IPv4 fragments net: mvpp2: fix interrupt mask/unmask skip condition ext4: do not iput inode under running transaction in ext4_rename() locking/ww_mutex: Simplify use_ww_ctx & ww_ctx handling thermal/core: Add NULL pointer check before using cooling device stats ASoC: rt5659: Update MCLK rate in set_sysclk() staging: comedi: cb_pcidas64: fix request_irq() warn staging: comedi: cb_pcidas: fix request_irq() warn scsi: qla2xxx: Fix broken #endif placement scsi: st: Fix a use after free in st_open() vhost: Fix vhost_vq_reset() powerpc: Force inlining of cpu_has_feature() to avoid build failure NFSD: fix error handling in NFSv4.0 callbacks ASoC: cs42l42: Always wait at least 3ms after reset ASoC: cs42l42: Fix mixer volume control ASoC: cs42l42: Fix channel width support ASoC: cs42l42: Fix Bitclock polarity inversion ASoC: es8316: Simplify adc_pga_gain_tlv table ASoC: sgtl5000: set DAP_AVC_CTRL register to correct default value on probe ASoC: rt5651: Fix dac- and adc- vol-tlv values being off by a factor of 10 ASoC: rt5640: Fix dac- and adc- vol-tlv values being off by a factor of 10 iomap: Fix negative assignment to unsigned sis->pages in iomap_swapfile_activate rpc: fix NULL dereference on kmalloc failure fs: nfsd: fix kconfig dependency warning for NFSD_V4 ext4: fix bh ref count on error paths ext4: shrink race window in ext4_should_retry_alloc() module: harden ELF info handling module: avoid *goto*s in module_sig_check() module: merge repetitive strings in module_sig_check() modsign: print module name along with error message ipv6: weaken the v4mapped source check selinux: vsock: Set SID for socket returned by accept() Revert "can: dev: Move device back to init netns on owning netns delete" Linux 5.4.109 xen-blkback: don't leak persistent grants from xen_blkbk_map() can: peak_usb: Revert "can: peak_usb: add forgotten supported devices" ext4: add reclaim checks to xattr code mac80211: fix double free in ibss_leave net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() net: dsa: b53: VLAN filtering is global to all users can: dev: Move device back to init netns on owning netns delete x86/mem_encrypt: Correct physical address calculation in __set_clr_pte_enc() locking/mutex: Fix non debug version of mutex_lock_io_nested() scsi: mpt3sas: Fix error return code of mpt3sas_base_attach() scsi: qedi: Fix error return code of qedi_alloc_global_queues() scsi: Revert "qla2xxx: Make sure that aborted commands are freed" block: recalculate segment count for multi-segment discards correctly perf auxtrace: Fix auxtrace queue conflict ACPI: scan: Use unique number for instance_no ACPI: scan: Rearrange memory allocation in acpi_device_add() Revert "netfilter: x_tables: Update remaining dereference to RCU" netfilter: x_tables: Use correct memory barriers. Revert "netfilter: x_tables: Switch synchronization to RCU" bpf: Don't do bpf_cgroup_storage_set() for kuprobe/tp programs RDMA/cxgb4: Fix adapter LE hash errors while destroying ipv6 listening server PM: EM: postpone creating the debugfs dir till fs_initcall net/mlx5e: Fix error path for ethtool set-priv-flag PM: runtime: Defer suspending suppliers arm64: kdump: update ppos when reading elfcorehdr drm/msm: fix shutdown hook in case GPU components failed to bind libbpf: Fix BTF dump of pointer-to-array-of-struct selftests: forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes r8152: limit the RX buffer size of RTL8153A for USB 2.0 net: cdc-phonet: fix data-interface release on probe failure octeontx2-af: fix infinite loop in unmapping NPC counter octeontx2-af: Fix irq free in rvu teardown libbpf: Use SOCK_CLOEXEC when opening the netlink socket nfp: flower: fix pre_tun mask id allocation mac80211: fix rate mask reset can: m_can: m_can_rx_peripheral(): fix RX being blocked by errors can: m_can: m_can_do_rx_poll(): fix extraneous msg loss warning can: c_can: move runtime PM enable/disable to c_can_platform can: c_can_pci: c_can_pci_remove(): fix use-after-free can: kvaser_pciefd: Always disable bus load reporting can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate can: peak_usb: add forgotten supported devices tcp: relookup sock for RST+ACK packets handled by obsolete req sock netfilter: ctnetlink: fix dump of the expect mask attribute selftests/bpf: Set gopt opt_class to 0 if get tunnel opt failed ftgmac100: Restart MAC HW once net/qlcnic: Fix a use after free in qlcnic_83xx_get_minidump_template e1000e: Fix error handling in e1000_set_d0_lplu_state_82571 e1000e: add rtnl_lock() to e1000_reset_task igc: Fix Supported Pause Frame Link Setting igc: Fix Pause Frame Advertising net: dsa: bcm_sf2: Qualify phydev->dev_flags based on port net: sched: validate stab values macvlan: macvlan_count_rx() needs to be aware of preemption ipv6: fix suspecious RCU usage warning net/mlx5e: Don't match on Geneve options in case option masks are all zero libbpf: Fix INSTALL flag order veth: Store queue_mapping independently of XDP prog presence bus: omap_l3_noc: mark l3 irqs as IRQF_NO_THREAD dm ioctl: fix out of bounds array access when no devices dm verity: fix DM_VERITY_OPTS_MAX value integrity: double check iint_cache was initialized ARM: dts: at91-sama5d27_som1: fix phy address to 7 arm64: dts: ls1043a: mark crypto engine dma coherent arm64: dts: ls1012a: mark crypto engine dma coherent arm64: dts: ls1046a: mark crypto engine dma coherent ACPI: video: Add missing callback back for Sony VPCEH3U1E gcov: fix clang-11+ support kasan: fix per-page tags for non-page_alloc pages squashfs: fix xattr id and id lookup sanity checks squashfs: fix inode lookup sanity checks platform/x86: intel-vbtn: Stop reporting SW_DOCK events netsec: restore phy power state after controller reset ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls block: Suppress uevent for hidden device when removed nfs: we don't support removing system.nfs4_acl nvme-pci: add the DISABLE_WRITE_ZEROES quirk for a Samsung PM1725a nvme-fc: return NVME_SC_HOST_ABORTED_CMD when a command has been aborted nvme: add NVME_REQ_CANCELLED flag in nvme_cancel_request() drm/radeon: fix AGP dependency drm/amdgpu: fb BO should be ttm_bo_type_device drm/amd/display: Revert dram_clock_change_latency for DCN2.1 regulator: qcom-rpmh: Correct the pmic5_hfsmps515 buck u64_stats,lockdep: Fix u64_stats_init() vs lockdep habanalabs: Call put_pid() when releasing control device sparc64: Fix opcode filtering in handling of no fault loads irqchip/ingenic: Add support for the JZ4760 cifs: change noisy error message to FYI atm: idt77252: fix null-ptr-dereference atm: uPD98402: fix incorrect allocation net: davicom: Use platform_get_irq_optional() net: wan: fix error return code of uhdlc_init() net: hisilicon: hns: fix error return code of hns_nic_clear_all_rx_fetch() NFS: Correct size calculation for create reply length nfs: fix PNFS_FLEXFILE_LAYOUT Kconfig default gpiolib: acpi: Add missing IRQF_ONESHOT cpufreq: blacklist Arm Vexpress platforms in cpufreq-dt-platdev cifs: ask for more credit on async read/write code paths gianfar: fix jumbo packets+napi+rx overrun crash sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count net: intel: iavf: fix error return code of iavf_init_get_resources() net: tehuti: fix error return code in bdx_probe() ixgbe: Fix memleak in ixgbe_configure_clsu32 ALSA: hda: ignore invalid NHLT table Revert "r8152: adjust the settings about MAC clock speed down for RTL8153" atm: lanai: dont run lanai_dev_close if not open atm: eni: dont release is never initialized powerpc/4xx: Fix build errors from mfdcr() net: fec: ptp: avoid register access when ipg clock is disabled hugetlbfs: hugetlb_fault_mutex_hash() cleanup ANDROID: refresh ABI XML to new version ANDROID: refresh ABI XML ANDROID: fix up ext4 build from 5.4.108 Linux 5.4.108 cifs: Fix preauth hash corruption x86/apic/of: Fix CPU devicetree-node lookups genirq: Disable interrupts for force threaded handlers firmware/efi: Fix a use after bug in efi_mem_reserve_persistent efi: use 32-bit alignment for efi_guid_t literals ext4: fix potential error in ext4_do_update_inode ext4: do not try to set xattr into ea_inode if value is empty ext4: find old entry again if failed to rename whiteout x86: Introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall() x86: Move TS_COMPAT back to asm/thread_info.h kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() x86/ioapic: Ignore IRQ2 again perf/x86/intel: Fix a crash caused by zero PEBS status PCI: rpadlpar: Fix potential drc_name corruption in store functions counter: stm32-timer-cnt: fix ceiling write max value iio: hid-sensor-temperature: Fix issues of timestamp channel iio: hid-sensor-prox: Fix scale not correct issue iio: hid-sensor-humidity: Fix alignment issue of timestamp channel iio: adc: ad7949: fix wrong ADC result due to incorrect bit mask iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler iio: adis16400: Fix an error code in adis16400_initial_setup() iio:adc:qcom-spmi-vadc: add default scale to LR_MUX2_BAT_ID channel iio:adc:stm32-adc: Add HAS_IOMEM dependency usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy- usb: gadget: configfs: Fix KASAN use-after-free USB: replace hardcode maximum usb string length by definition usbip: Fix incorrect double assignment to udc->ud.tcp_rx usb-storage: Add quirk to defeat Kindle's automatic unload nvme-rdma: fix possible hang when failing to set io queues counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED scsi: myrs: Fix a double free in myrs_cleanup() scsi: lpfc: Fix some error codes in debugfs riscv: Correct SPARSEMEM configuration kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL again net/qrtr: fix __netdev_alloc_skb call sunrpc: fix refcount leak for rpc auth modules vfio: IOMMU_API should be selected svcrdma: disable timeouts on rdma backchannel NFSD: Repair misuse of sv_lock in 5.10.16-rt30. nfsd: Don't keep looking up unhashed files in the nfsd file cache nvmet: don't check iosqes,iocqes for discovery controllers nvme-tcp: fix a NULL deref when receiving a 0-length r2t PDU nvme-tcp: fix possible hang when failing to set io queues nvme: fix Write Zeroes limitations afs: Stop listxattr() from listing "afs.*" attributes ASoC: simple-card-utils: Do not handle device clock ASoC: SOF: intel: fix wrong poll bits in dsp power down ASoC: SOF: Intel: unregister DMIC device on probe error ASoC: fsl_ssi: Fix TDM slot setup for I2S mode btrfs: fix slab cache flags for free space tree bitmap btrfs: fix race when cloning extent buffer during rewind of an old root ARM: 9044/1: vfp: use undef hook for VFP support detection ARM: 9030/1: entry: omit FP emulation for UND exceptions taken in kernel mode s390/vtime: fix increased steal time accounting Revert "PM: runtime: Update device status before letting suppliers suspend" ALSA: hda/realtek: Apply headset-mic quirks for Xiaomi Redmibook Air ALSA: hda: generic: Fix the micmute led init state ALSA: hda/realtek: apply pin quirk for XiaomiNotebook Pro ALSA: dice: fix null pointer dereference when node is disconnected ASoC: ak5558: Add MODULE_DEVICE_TABLE ASoC: ak4458: Add MODULE_DEVICE_TABLE Linux 5.4.107 net: dsa: b53: Support setting learning on port net: dsa: tag_mtk: fix 802.1ad VLAN egress crypto: x86/aes-ni-xts - use direct calls to and 4-way stride crypto: aesni - Use TEST %reg,%reg instead of CMP $0,%reg crypto: x86 - Regularize glue function prototypes fuse: fix live lock in fuse_iget() drm/i915/gvt: Fix vfio_edid issue for BXT/APL drm/i915/gvt: Fix port number for BDW on EDID region setup drm/i915/gvt: Fix virtual display setup for BXT/APL drm/i915/gvt: Fix mmio handler break on BXT/APL. drm/i915/gvt: Set SNOOP for PAT3 on BXT/APL to workaround GPU BB hang btrfs: scrub: Don't check free space before marking a block group RO bpf, selftests: Fix up some test_verifier cases for unprivileged bpf: Add sanity check for upper ptr_limit bpf: Simplify alu_limit masking for pointer arithmetic bpf: Fix off-by-one for area size in creating mask to left bpf: Prohibit alu ops for pointer types not defining ptr_limit KVM: arm64: nvhe: Save the SPE context early Linux 5.4.106 xen/events: avoid handling the same event on two cpus at the same time xen/events: don't unmask an event channel when an eoi is pending xen/events: reset affinity of 2-level event when tearing it down KVM: arm64: Reject VM creation when the default IPA size is unsupported KVM: arm64: Ensure I-cache isolation between vcpus of a same VM nvme: release namespace head reference on error nvme: unlink head after removing last namespace KVM: arm64: Fix exclusive limit for IPA size x86/unwind/orc: Disable KASAN checking in the ORC unwinder, part 2 binfmt_misc: fix possible deadlock in bm_register_write powerpc/64s: Fix instruction encoding for lis in ppc_function_entry() sched/membarrier: fix missing local execution of ipi_sync_rq_state() zram: fix return value on writeback_store include/linux/sched/mm.h: use rcu_dereference in in_vfork() stop_machine: mark helpers __always_inline hrtimer: Update softirq_expires_next correctly after __hrtimer_get_next_event() arm64: mm: use a 48-bit ID map when possible on 52-bit VA builds configfs: fix a use-after-free in __configfs_open_file block: rsxx: fix error return code of rsxx_pci_probe() NFSv4.2: fix return value of _nfs4_get_security_label() NFS: Don't gratuitously clear the inode cache when lookup failed NFS: Don't revalidate the directory permissions on a lookup failure SUNRPC: Set memalloc_nofs_save() for sync tasks arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory sh_eth: fix TRSCER mask for R7S72100 staging: comedi: pcl818: Fix endian problem for AI command data staging: comedi: pcl711: Fix endian problem for AI command data staging: comedi: me4000: Fix endian problem for AI command data staging: comedi: dmm32at: Fix endian problem for AI command data staging: comedi: das800: Fix endian problem for AI command data staging: comedi: das6402: Fix endian problem for AI command data staging: comedi: adv_pci1710: Fix endian problem for AI command data staging: comedi: addi_apci_1500: Fix endian problem for command sample staging: comedi: addi_apci_1032: Fix endian problem for COS sample staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan staging: rtl8712: Fix possible buffer overflow in r8712_sitesurvey_cmd staging: ks7010: prevent buffer overflow in ks_wlan_set_scan() staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data() staging: rtl8712: unterminated string leads to read overflow staging: rtl8188eu: prevent ->ssid overflow in rtw_wx_set_scan() staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan() misc: fastrpc: restrict user apps from sending kernel RPC messages misc/pvpanic: Export module FDT device table usbip: fix vudc usbip_sockfd_store races leading to gpf usbip: fix vhci_hcd attach_store() races leading to gpf usbip: fix stub_dev usbip_sockfd_store() races leading to gpf usbip: fix vudc to check for stream socket usbip: fix vhci_hcd to check for stream socket usbip: fix stub_dev to check for stream socket USB: serial: cp210x: add some more GE USB IDs USB: serial: cp210x: add ID for Acuity Brands nLight Air Adapter USB: serial: ch341: add new Product ID USB: serial: io_edgeport: fix memory leak in edge_startup xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state usb: xhci: Fix ASMedia ASM1042A and ASM3242 DMA addressing xhci: Improve detection of device initiated wake signal. usb: xhci: do not perform Soft Retry for some xHCI hosts usb: renesas_usbhs: Clear PIPECFG for re-enabling pipe with other EPNUM USB: usblp: fix a hang in poll() if disconnected usb: dwc3: qcom: Honor wakeup enabled/disabled state usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement usb: gadget: f_uac1: stop playback on function disable usb: gadget: f_uac2: always increase endpoint max_packet_size by one audio slot USB: gadget: u_ether: Fix a configfs return code Goodix Fingerprint device is not a modem mmc: cqhci: Fix random crash when remove mmc module/card mmc: core: Fix partition switch time for eMMC software node: Fix node registration s390/dasd: fix hanging IO request during DASD driver unbind s390/dasd: fix hanging DASD driver unbind arm64: kasan: fix page_alloc tagging with DEBUG_VIRTUAL Revert 95ebabde382c ("capabilities: Don't allow writing ambiguous v3 file capabilities") ALSA: usb-audio: Apply the control quirk to Plantronics headsets ALSA: usb-audio: Fix "cannot get freq eq" errors on Dell AE515 sound bar ALSA: hda: Avoid spurious unsol event handling during S3/S4 ALSA: hda: Flush pending unsolicited events before suspend ALSA: hda: Drop the BATCH workaround for AMD controllers ALSA: hda/ca0132: Add Sound BlasterX AE-5 Plus support ALSA: hda/hdmi: Cancel pending works before suspend ALSA: usb: Add Plantronics C320-M USB ctrl msg delay quirk scsi: target: core: Prevent underflow for service actions scsi: target: core: Add cmd length set before cmd complete scsi: libiscsi: Fix iscsi_prep_scsi_cmd_pdu() error handling sysctl.c: fix underflow value setting risk in vm_table s390/smp: __smp_rescan_cpus() - move cpumask away from stack i40e: Fix memory leak in i40e_probe PCI: Fix pci_register_io_range() memory leak kbuild: clamp SUBLEVEL to 255 PCI: mediatek: Add missing of_node_put() to fix reference leak PCI: xgene-msi: Fix race in installing chained irq handler Input: applespi - don't wait for responses to commands indefinitely. sparc64: Use arch_validate_flags() to validate ADI flag sparc32: Limit memblock allocation to low memory iommu/amd: Fix performance counter initialization powerpc/64: Fix stack trace not displaying final frame HID: logitech-dj: add support for the new lightspeed connection iteration powerpc/perf: Record counter overflow always if SAMPLE_IP is unset powerpc: improve handling of unrecoverable system reset spi: stm32: make spurious and overrun interrupts visible powerpc/pci: Add ppc_md.discover_phbs() Platform: OLPC: Fix probe error handling mmc: mediatek: fix race condition between msdc_request_timeout and irq mmc: mxs-mmc: Fix a resource leak in an error handling path in 'mxs_mmc_probe()' udf: fix silent AED tagLocation corruption i2c: rcar: optimize cacheline to minimize HW race condition i2c: rcar: faster irq code to minimize HW race condition net: phy: fix save wrong speed and duplex problem if autoneg is on net: enetc: initialize RFS/RSS memories for unused ports too net: hns3: fix error mask definition of flow director media: rc: compile rc-cec.c into rc-core media: v4l: vsp1: Fix bru null pointer access media: v4l: vsp1: Fix uif null pointer access media: usbtv: Fix deadlock on suspend sh_eth: fix TRSCER mask for R7S9210 qxl: Fix uninitialised struct field head.surface_id s390/crypto: return -EFAULT if copy_to_user() fails s390/cio: return -EFAULT if copy_to_user() fails drm: meson_drv add shutdown function drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff drm/shmem-helper: Check for purged buffers in fault handler drm/compat: Clear bounce structures bnxt_en: reliably allocate IRQ table on reset to avoid crash s390/cio: return -EFAULT if copy_to_user() fails again net: hns3: fix bug when calculating the TCAM table info net: hns3: fix query vlan mask value error for flow director perf traceevent: Ensure read cmdlines are null terminated. selftests: forwarding: Fix race condition in mirror installation net: stmmac: fix watchdog timeout during suspend/resume stress test net: stmmac: stop each tx channel independently ixgbe: fail to create xfrm offload of IPsec tunnel mode SA net: qrtr: fix error return code of qrtr_sendmsg() net: davicom: Fix regulator not turned off on driver removal net: davicom: Fix regulator not turned off on failed probe net: lapbether: Remove netif_start_queue / netif_stop_queue cipso,calipso: resolve a number of problems with the DOI refcounts netdevsim: init u64 stats for 32bit hardware net: usb: qmi_wwan: allow qmimux add/del with master up net: sched: avoid duplicates in classes dump nexthop: Do not flush blackhole nexthops when loopback goes down net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10 net/mlx4_en: update moderation when config reset net: enetc: don't overwrite the RSS indirection table when initializing Revert "mm, slub: consider rest of partial list if acquire_slab() fails" cifs: return proper error code in statfs(2) mount: fix mounting of detached mounts onto targets that reside on shared mounts powerpc/603: Fix protection of user pages mapped with PROT_NONE mt76: dma: do not report truncated frames to mac80211 ibmvnic: always store valid MAC address samples, bpf: Add missing munmap in xdpsock selftests/bpf: Mask bpf_csum_diff() return value to 16 bits in test_verifier selftests/bpf: No need to drop the packet when there is no geneve opt netfilter: x_tables: gpf inside xt_find_revision() netfilter: nf_nat: undo erroneous tcp edemux lookup tcp: add sanity tests to TCP_QUEUE_SEQ can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Normal Mode can: flexcan: invoke flexcan_chip_freeze() to enter freeze mode can: flexcan: enable RX FIFO after FRZ/HALT valid can: flexcan: assert FRZ bit in flexcan_chip_freeze() can: skb: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership sh_eth: fix TRSCER mask for SH771x net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 net: check if protocol extracted by virtio_net_hdr_set_proto is correct net: Fix gro aggregation for udp encaps with zero csum ath9k: fix transmitting to stations in dynamic SMPS mode ethernet: alx: fix order of calls on resume powerpc/pseries: Don't enforce MSI affinity with kdump uapi: nfnetlink_cthelper.h: fix userspace compilation error Linux 5.4.105 nvme-pci: add quirks for Lexar 256GB SSD nvme-pci: mark Seagate Nytro XM1440 as QUIRK_NO_NS_DESC_LIST. HID: i2c-hid: Add I2C_HID_QUIRK_NO_IRQ_AFTER_RESET for ITE8568 EC on Voyo Winpad A15 mmc: sdhci-of-dwcmshc: set SDHCI_QUIRK2_PRESET_VALUE_BROKEN drm/msm/a5xx: Remove overwriting A5XX_PC_DBG_ECO_CNTL register misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller ASoC: Intel: bytcr_rt5640: Add quirk for ARCHOS Cesium 140 ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807 media: cx23885: add more quirks for reset DMA on some AMD IOMMU HID: mf: add support for 0079:1846 Mayflash/Dragonrise USB Gamecube Adapter platform/x86: acer-wmi: Add ACER_CAP_KBD_DOCK quirk for the Aspire Switch 10E SW3-016 platform/x86: acer-wmi: Add support for SW_TABLET_MODE on Switch devices platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag platform/x86: acer-wmi: Add new force_caps module parameter platform/x86: acer-wmi: Cleanup accelerometer device handling platform/x86: acer-wmi: Cleanup ACER_CAP_FOO defines mwifiex: pcie: skip cancel_work_sync() on reset failure path iommu/amd: Fix sleeping in atomic in increase_address_space() ACPICA: Fix race in generic_serial_bus (I2C) and GPIO op_region parameter handling 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 net: dsa: add GRO support via gro_cells ANDROID: GKI: update .xml file due to new symbol additions. Revert "crypto - shash: reduce minimum alignment of shash_desc structure" Linux 5.4.104 r8169: fix resuming from suspend on RTL8105e if machine runs on battery rsxx: Return -EFAULT if copy_to_user() fails ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount ALSA: hda: intel-nhlt: verify config type IB/mlx5: Add missing error code RDMA/rxe: Fix missing kconfig dependency on CRYPTO ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits usbip: tools: fix build error for multiple definition crypto - shash: reduce minimum alignment of shash_desc structure arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL) drm/amdgpu: fix parameter error of RREG32_PCIE() in amdgpu_regs_pcie dm verity: fix FEC for RS roots unaligned to block size dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size PM: runtime: Update device status before letting suppliers suspend btrfs: fix warning when creating a directory with smack enabled btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata btrfs: validate qgroup inherit for SNAP_CREATE_V2 ioctl btrfs: fix raid6 qstripe kmap btrfs: raid56: simplify tracking of Q stripe presence tpm, tpm_tis: Decorate tpm_get_timeouts() with request_locality() tpm, tpm_tis: Decorate tpm_tis_gen_interrupt() with request_locality() ANDROID: GKI: hack up fs/sysfs/file.c to prevent GENKSYMS change Revert "sched/features: Fix hrtick reprogramming" Linux 5.4.103 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 swap: fix swapfile read/write offset zsmalloc: account the number of compacted pages correctly 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 sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output 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 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/display: Guard against NULL pointer deref when get_i2c_info fails PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse drm/amdgpu: Add check to prevent IH overflow 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 x86/build: Treat R_386_PLT32 relocation as R_386_PC32 ath10k: fix wmi mgmt tx queue full due to race condition pktgen: fix misuse of BUG_ON() in pktgen_thread_worker() 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 rsi: Move card interrupt handling to RX thread rsi: Fix TX EAPOL packet handling against iwlwifi AP drm/virtio: use kvmalloc for large allocations MIPS: Drop 32-bit asm string functions 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: ag71xx: remove unnecessary MTU reservation net: bridge: use switchdev for port flags set through sysfs too mm/hugetlb.c: fix unnecessary address expansion of pmd sharing nbd: handle device refs for DESTROY_ON_DISCONNECT properly net: fix up truesize of cloned skb in skb_prepare_for_shift() 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 JFS: more checks for invalid superblock MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target=' arm64 module: set plt* section addresses to 0x0 nvme-pci: fix error unwind in nvme_map_data nvme-pci: refactor nvme_unmap_data Input: elantech - fix protocol errors for some trackpoints in SMBus mode net: usb: qmi_wwan: support ZTE P685M modem ANDROID: GKI: update .xml file due to new symbol additions. ANDROID: Adding kprobes build configs for Cuttlefish ANDROID: GKI: bring back icmpv6_send Linux 5.4.102 ARM: dts: aspeed: Add LCLK to lpc-snoop net: qrtr: Fix memory leak in qrtr_tun_open dm era: Update in-core bitset after committing the metadata net: sched: fix police ext initialization net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending ipv6: silence compilation warning for non-IPV6 builds ipv6: icmp6: avoid indirect call for icmpv6_send() xfrm: interface: use icmp_ndo_send helper sunvnet: use icmp_ndo_send helper gtp: use icmp_ndo_send helper icmp: allow icmpv6_ndo_send to work with CONFIG_IPV6=n icmp: introduce helper for nat'd source address in network device context 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: Recover committed writeset after crash dm writecache: fix writing beyond end of underlying device when shrinking dm: fix deadlock when swapping to encrypted device gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end gfs2: Don't skip dlm unlock if glock has an lvb spi: spi-synquacer: fix set_cs handling sparc32: fix a user-triggerable oops in clear_user() f2fs: fix out-of-repair __setattr_copy() um: mm: check more comprehensively for stub changes virtio/s390: implement virtio-ccw revision 2 correctly s390/vtime: fix inline assembly clobber list cpufreq: intel_pstate: Get per-CPU max freq via MSR_HWP_CAPABILITIES if available printk: fix deadlock when kernel panic gpio: pcf857x: Fix missing first interrupt spmi: spmi-pmic-arb: Fix hw_irq overflow powerpc/32s: Add missing call to kuep_lock on syscall entry mmc: sdhci-esdhc-imx: fix kernel panic when remove module module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols media: smipcie: fix interrupt handling and IR timeout arm64: Extend workaround for erratum 1024718 to all versions of Cortex-A55 hugetlb: fix copy_huge_page_from_user contig page struct assumption hugetlb: fix update_and_free_page contig page struct assumption 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 watchdog: mei_wdt: request stop on unregister watchdog: qcom: Remove incorrect usage of QCOM_WDT_ENABLE_IRQ arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails floppy: reintroduce O_NDELAY fix 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/reboot: Force all cpus to exit VMX root if VMX is supported x86/virt: Eat faults on VMXOFF in reboot flows media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt() 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 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 seccomp: Add missing return in non-void function crypto: sun4i-ss - initialize need_fallback crypto: sun4i-ss - handle BigEndian for cipher crypto: sun4i-ss - checking sg length is not sufficient crypto: aesni - prevent misaligned buffers on the stack crypto: arm64/sha - add missing module aliases btrfs: fix extent buffer leak on failure to copy root 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 KEYS: trusted: Fix migratable=1 failing 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 drm/sched: Cancel and flush all outstanding jobs before finish. drm/nouveau/kms: handle mDP connectors drm/amdgpu: Set reference clock to 100Mhz on Renoir (v2) drm/amd/display: Add vupdate_no_lock interrupts for DCN2.1 bcache: Move journal work to new flush wq bcache: Give btree_io_wq correct semantics again Revert "bcache: Kill btree_io_wq" ALSA: hda/realtek: modify EAPD in the ALC886 ALSA: hda: Add another CometLake-H PCI ID USB: serial: mos7720: fix error code in mos7720_write() USB: serial: mos7840: fix error code in mos7840_write() 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 ACPI: configfs: add missing check after configfs_register_default_group() ACPI: property: Fix fwnode string properties matching blk-settings: align max_sectors on "logical_block_size" boundary scsi: bnx2fc: Fix Kconfig warning & CNIC build errors mm/rmap: fix potential pte_unmap on an not mapped pte i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition arm64: Add missing ISB after invalidating TLB in __primary_switch r8169: fix jumbo packet handling on RTL8168e mm/compaction: fix misbehaviors of fast_find_migrateblock() mm/hugetlb: fix potential double free in hugetlb_register_node() error path mm/memory.c: fix potential pte_unmap_unlock pte error ocfs2: fix a use after free on error vxlan: move debug check after netdev unregister net/mlx4_core: Add missed mlx4_free_cmd_mailbox() vfio/type1: Use follow_pte() i40e: Fix add TC filter for IPv6 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) regmap: sdw: use _no_pm functions in regmap_read/write nvmem: core: skip child nodes not matching binding nvmem: core: Fix a resource leak on error in nvmem_add_cells_from_of() ext4: fix potential htree index checksum corruption vfio/iommu_type1: Fix some sanity checks in detach group drm/msm/mdp5: Fix wait-for-commit for cmd panels drm/msm/dsi: Correct io_start for MSM8994 (20nm PHY) 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 pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare() soundwire: cadence: fix ACK/NAK handling misc: eeprom_93xx46: Add module alias to avoid breaking support for non device tree users phy: rockchip-emmc: emmc_phy_init() always return 0 misc: eeprom_93xx46: Fix module alias to enable module autoprobe 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 premature IPC perf intel-pt: Fix missing CYC processing in PSB Input: sur40 - fix an error code in sur40_probe() RDMA/hns: Fixes missing error code of CMDQ nfsd: register pernet ops last, unregister first clk: aspeed: Fix APLL calculate formula from ast2600-A2 regulator: qcom-rpmh: fix pm8009 ldo7 spi: pxa2xx: Fix the controller numbering for Wildcat Point 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 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() 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 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 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 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 objtool: Fix ".cold" section suffix check for newer versions of GCC objtool: Fix error handling for STD/CLD warnings auxdisplay: ht16k33: Fix refresh rate handling isofs: release buffer head before return regulator: core: Avoid debugfs: Directory ... already present! error 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 regulator: axp20x: Fix reference cout leak clk: sunxi-ng: h6: Fix clock divider range on some clocks RDMA/mlx5: Use the correct obj_id upon DEVX TIR creation clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined clocksource/drivers/ixp4xx: Select TIMER_OF when needed rtc: s5m: select REGMAP_I2C power: reset: at91-sama5d2_shdwc: fix wkupdbc mask of/fdt: Make sure no-map does not remove already reserved regions fdt: Properly handle "no-map" field in the memory region 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: 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 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 HSI: Fix PM usage counter unbalance in ssi_hw_init capabilities: Don't allow writing ambiguous v3 file capabilities ubifs: Fix error return code in alloc_wbufs() 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 crypto: ecdh_helper - Ensure 'len >= secret.len' in decode_key() hwrng: timeriomem - Fix cooldown period calculation btrfs: clarify error returns values in __load_free_space_cache ASoC: SOF: debug: Fix a potential issue on string buffer termination Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind() 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: cpcap: fix microphone timeslot mask ata: ahci_brcm: Add back regulators management drm/nouveau: bail out of nouveau_channel_new if channel init fails crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error) mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions() 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: cx25821: Fix a bug when reallocating some dma memory media: qm1d1c0042: fix error return code in qm1d1c0042_init() 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. bsg: free the request before return error code MIPS: properly stop .eh_frame generation drm/sun4i: tcon: fix inverted DCLK polarity crypto: bcm - Rename struct device_private to bcm_device_private evm: Fix memleak in init_desc 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: imx: Fix csc/scaler unregister media: imx: Unregister csc/scaler only if registered media: i2c: ov5670: Fix PIXEL_RATE minimum value 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 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/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 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 ibmvnic: skip send_request_unmap for timeout reset ibmvnic: add memory barrier to protect long term buffer 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 bpf: Fix bpf_fib_lookup helper MTU check for SKB ctx mac80211: fix potential overflow when multiplying to u32 integers xen/netback: fix spurious event detection for common event case bnxt_en: reverse order of TX disable and carrier off ibmvnic: Set to CLOSED state even on error ath9k: fix data bus crash when setting nf_override via debugfs bpf_lru_list: Read double-checked variable once without lock soc: aspeed: snoop: Add clock control logic ARM: s3c: fix fiq for clang IAS arm64: dts: msm8916: Fix reserved and rfsa nodes unit address Bluetooth: btusb: Fix memory leak in btusb_mtk_wmt_recv 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 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 usb: gadget: u_audio: Free requests only after callback ACPICA: Fix exception code class checks cpufreq: brcmstb-avs-cpufreq: Fix resource leaks in ->remove() cpufreq: brcmstb-avs-cpufreq: Free resources in error path 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 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 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 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 random: fix the RNDRESEEDCRNG ioctl 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 kdb: Make memory allocations more robust 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() kvm: x86: replace kvm_spec_ctrl_test_value with runtime test on the host vmlinux.lds.h: add DWARF v5 sections Linux 5.4.101 scripts/recordmcount.pl: support big endian for ARCH sh cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath. cxgb4: Add new T6 PCI device id 0x6092 NET: usb: qmi_wwan: Adding support for Cinterion MV31 KVM: Use kvm_pfn_t for local PFN variable in hva_to_pfn_remapped() mm: provide a saner PTE walking API for modules KVM: do not assume PTE is writable after follow_pfn mm: simplify follow_pte{,pmd} mm: unexport follow_pte_pmd scripts: set proper OpenSSL include dir also for sign-file scripts: use pkg-config to locate libcrypto arm64: tegra: Add power-domain for Tegra210 HDA ntfs: check for valid standard information attribute usb: quirks: add quirk to start video capture on ELMO L-12F document camera reliable USB: quirks: sort quirk entries HID: make arrays usage and value to be the same bpf: Fix truncation handling for mod32 dst reg wrt zero Linux 5.4.100 btrfs: fix backport of 2175bf57dc952 in 5.4.95 media: pwc: Use correct device for DMA xen-blkback: fix error handling in xen_blkbk_map() xen-scsiback: don't "handle" error by BUG() xen-netback: don't "handle" error by BUG() xen-blkback: don't "handle" error by BUG() xen/arm: don't ignore return errors from set_phys_to_machine Xen/gntdev: correct error checking in gntdev_map_grant_pages() Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages() Xen/x86: also check kernel mapping in set_foreign_p2m_mapping() Xen/x86: don't bail early from clear_foreign_p2m_mapping() net: bridge: Fix a warning when del bridge sysfs net: qrtr: Fix port ID for control messages KVM: SEV: fix double locking due to incorrect backport ANDROID: GKI: Fix up .xml file after merge with android11-5.4 ANDROID: GKI: Fix up .xml file after merge with android11-5.4 ANDROID: GKI: fix up .xml file after big merge with android11-5.4 Linux 5.4.99 ovl: expand warning in ovl_d_real() net/qrtr: restrict user-controlled length in qrtr_tun_write_iter() net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS vsock: fix locking in vsock_shutdown() vsock/virtio: update credit only if socket is not closed net: watchdog: hold device global xmit lock during tx disable net/vmw_vsock: improve locking in vsock_connect_timeout() net: fix iteration for sctp transport seq_files net: gro: do not keep too many GRO packets in napi->rx_list net: dsa: call teardown method on probe failure udp: fix skb_copy_and_csum_datagram with odd segment sizes rxrpc: Fix clearance of Tx/Rx ring when releasing a call usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one usb: dwc3: ulpi: fix checkpatch warning h8300: fix PREEMPTION build, TI_PRE_COUNT undefined i2c: stm32f7: fix configuration of the digital filter clk: sunxi-ng: mp: fix parent rate change flag check drm/sun4i: dw-hdmi: Fix max. frequency for H6 drm/sun4i: Fix H6 HDMI PHY configuration drm/sun4i: tcon: set sync polarity for tcon1 channel firmware_loader: align .builtin_fw to 8 net: hns3: add a check for queue_id in hclge_reset_vf_queue() x86/build: Disable CET instrumentation in the kernel for 32-bit too netfilter: conntrack: skip identical origin tuple in same zone only ibmvnic: Clear failover_pending if unable to schedule net: stmmac: set TxQ mode back to DCB after disabling CBS selftests: txtimestamp: fix compilation issue net: enetc: initialize the RFS and RSS memories xen/netback: avoid race in xenvif_rx_ring_slots_available() netfilter: flowtable: fix tcp and udp header checksum update netfilter: nftables: fix possible UAF over chains from packet path in netns netfilter: xt_recent: Fix attempt to update deleted entry bpf: Check for integer overflow when using roundup_pow_of_two() drm/vc4: hvs: Fix buffer overflow with the dlist handling mt76: dma: fix a possible memory leak in mt76_add_fragment() lkdtm: don't move ctors to .rodata vmlinux.lds.h: Create section for protection against instrumentation ARM: kexec: fix oops after TLB are invalidated ARM: ensure the signal page contains defined contents ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL bfq-iosched: Revert "bfq: Fix computation of shallow depth" riscv: virt_addr_valid must check the address belongs to linear mapping drm/amd/display: Decrement refcount of dc_sink before reassignment drm/amd/display: Free atomic state after drm_atomic_commit drm/amd/display: Fix dc_sink kref count in emulated_link_detect drm/amd/display: Add more Clock Sources to DCN2.1 nvme-pci: ignore the subsysem NQN on Phison E16 ovl: skip getxattr of security labels cap: fix conversions on getxattr ovl: perform vfs_getxattr() with mounter creds platform/x86: hp-wmi: Disable tablet-mode reporting by default ARM: OMAP2+: Fix suspcious RCU usage splats for omap_enter_idle_coupled arm64: dts: qcom: sdm845: Reserve LPASS clocks in gcc arm64: dts: rockchip: Fix PCIe DT properties on rk3399 cgroup: fix psi monitor for root cgroup arm/xen: Don't probe xenbus as part of an early initcall tracing: Check length before giving out the filter buffer tracing: Do not count ftrace events in top level enable output gpio: ep93xx: Fix single irqchip with multi gpiochips gpio: ep93xx: fix BUG_ON port F usage Linux 5.4.98 squashfs: add more sanity checks in xattr id lookup squashfs: add more sanity checks in inode lookup squashfs: add more sanity checks in id lookup Fix unsynchronized access to sev members through svm_register_enc_region bpf: Fix 32 bit src register truncation on div/mod regulator: Fix lockdep warning resolving supplies blk-cgroup: Use cond_resched() when destroy blkgs i2c: mediatek: Move suspend and resume handling to NOIRQ phase SUNRPC: Handle 0 length opaque XDR object data properly SUNRPC: Move simple_get_bytes and simple_get_netobj into private header iwlwifi: mvm: guard against device removal in reprobe iwlwifi: mvm: invalidate IDs of internal stations at mvm start iwlwifi: pcie: fix context info memory leak iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time() iwlwifi: mvm: skip power command when unbinding vif during CSA ASoC: ak4458: correct reset polarity pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process() chtls: Fix potential resource leak ASoC: Intel: Skylake: Zero snd_ctl_elem_value mac80211: 160MHz with extended NSS BW in CSA regulator: core: avoid regulator_resolve_supply() race condition af_key: relax availability checks for skb size calculation tracing/kprobe: Fix to support kretprobe events on unloaded modules UPSTREAM: usb: xhci-mtk: break loop when find the endpoint to drop UPSTREAM: usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints Linux 5.4.97 usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 net: sched: replaced invalid qdisc tree flush helper in qdisc_replace net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add net: ip_tunnel: fix mtu calculation neighbour: Prevent a dead entry from updating gc_list igc: Report speed and duplex as unknown when device is runtime suspended md: Set prev_flush_start and flush_bio in an atomic way iommu/vt-d: Do not use flush-queue when caching-mode is on Input: xpad - sync supported devices with fork on GitHub iwlwifi: mvm: don't send RFH_QUEUE_CONFIG_CMD with no queues x86/apic: Add extra serialization for non-serializing MSRs x86/build: Disable CET instrumentation in the kernel mm: thp: fix MADV_REMOVE deadlock on shmem THP mm, compaction: move high_pfn to the for loop scope mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active mm: hugetlb: fix a race between isolating and freeing page mm: hugetlb: fix a race between freeing and dissolving the page mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page ARM: footbridge: fix dc21285 PCI configuration accessors KVM: x86: Update emulator context mode if SYSENTER xfers to 64-bit mode KVM: SVM: Treat SVM as unsupported when running as an SEV guest nvme-pci: avoid the deepest sleep state on Kingston A2000 SSDs drm/amd/display: Revert "Fix EDID parsing after resume from suspend" mmc: core: Limit retries when analyse of SDIO tuples fails smb3: fix crediting for compounding when only one request in flight smb3: Fix out-of-bounds bug in SMB2_negotiate() cifs: report error instead of invalid when revalidating a dentry fails xhci: fix bounce buffer usage for non-sg list case genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set libnvdimm/dimm: Avoid race between probe and available_slots_show() kretprobe: Avoid re-registration of the same kretprobe earlier fgraph: Initialize tracing_graph_pause at task creation mac80211: fix station rate table updates on assoc ovl: fix dentry leak in ovl_get_redirect usb: host: xhci-plat: add priv quirk for skip PHY initialization usb: xhci-mtk: break loop when find the endpoint to drop usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints usb: xhci-mtk: fix unreleased bandwidth data usb: dwc3: fix clock issue during resume in OTG mode usb: dwc2: Fix endpoint direction check in ep_from_windex usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop() USB: usblp: don't call usb_set_interface if there's a single alt USB: gadget: legacy: fix an error code in eth_bind() memblock: do not start bottom-up allocations with kernel_end nvmet-tcp: fix out-of-bounds access when receiving multiple h2cdata PDUs ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set net: mvpp2: TCAM entry enable should be written after SRAM data net: lapb: Copy the skb before sending a packet net/mlx5: Fix leak upon failure of rule creation i40e: Revert "i40e: don't report link up for a VF who hasn't enabled queues" igc: check return value of ret_val in igc_config_fc_after_link_up igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr arm64: dts: ls1046a: fix dcfg address range rxrpc: Fix deadlock around release of dst cached on udp tunnel um: virtio: free vu_dev only with the contained struct device bpf, cgroup: Fix problematic bounds check bpf, cgroup: Fix optlen WARN_ON_ONCE toctou arm64: dts: rockchip: fix vopl iommu irq on px30 arm64: dts: amlogic: meson-g12: Set FL-adj property value Input: i8042 - unbreak Pegatron C15B arm64: dts: qcom: c630: keep both touchpad devices enabled USB: serial: option: Adding support for Cinterion MV31 USB: serial: cp210x: add new VID/PID for supporting Teraoka AD2000 USB: serial: cp210x: add pid/vid for WSDA-200-USB Linux 5.4.96 workqueue: Restrict affinity change to rescuer kthread: Extract KTHREAD_IS_PER_CPU objtool: Don't fail on missing symbol table drm/amd/display: Change function decide_dp_link_settings to avoid infinite looping drm/amd/display: Update dram_clock_change_latency for DCN2.1 selftests/powerpc: Only test lwm/stmw on big endian nvme: check the PRINFO bit before deciding the host buffer length udf: fix the problem that the disc content is not displayed ALSA: hda: Add Cometlake-R PCI ID scsi: ibmvfc: Set default timeout to avoid crash during migration mac80211: fix fast-rx encryption check ASoC: SOF: Intel: hda: Resume codec to do jack detection scsi: fnic: Fix memleak in vnic_dev_init_devcmd2 scsi: libfc: Avoid invoking response handler twice if ep is already completed scsi: scsi_transport_srp: Don't block target in failfast state x86: __always_inline __{rd,wr}msr() platform/x86: intel-vbtn: Support for tablet mode on Dell Inspiron 7352 platform/x86: touchscreen_dmi: Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet phy: cpcap-usb: Fix warning for missing regulator_disable net_sched: gen_estimator: support large ewma log btrfs: backref, use correct count to resolve normal data refs btrfs: backref, only search backref entries from leaves of the same root btrfs: backref, don't add refs from shared block when resolving normal backref btrfs: backref, only collect file extent items matching backref offset tcp: make TCP_USER_TIMEOUT accurate for zero window probes arm64: Do not pass tagged addresses to __is_lm_address() arm64: Fix kernel address detection of __is_lm_address() ACPI: thermal: Do not call acpi_thermal_check() directly Revert "Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT"" ibmvnic: Ensure that CRQ entry read are correctly ordered net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP net: dsa: bcm_sf2: put device node before return Linux 5.4.95 tcp: fix TLP timer not set when CA_STATE changes from DISORDER to OPEN team: protect features update by RCU to avoid deadlock ASoC: topology: Fix memory corruption in soc_tplg_denum_create_values() NFC: fix possible resource leak NFC: fix resource leak when target index is invalid rxrpc: Fix memory leak in rxrpc_lookup_local iommu/vt-d: Don't dereference iommu_device if IOMMU_API is not built iommu/vt-d: Gracefully handle DMAR units with no supported address widths selftests: forwarding: Specify interface when invoking mausezahn nvme-multipath: Early exit if no path is available can: dev: prevent potential information leak in can_fill_info() net/mlx5e: Reduce tc unsupported key print level net/mlx5e: E-switch, Fix rate calculation for overflow net/mlx5: Fix memory leak on flow table creation error flow igc: fix link speed advertising i40e: acquire VSI pointer only after VF is initialized mac80211: pause TX while changing interface type iwlwifi: pcie: reschedule in long-running memory reads iwlwifi: pcie: use jiffies for memory read spin time limit pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process() ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete RDMA/cxgb4: Fix the reported max_recv_sge value firmware: imx: select SOC_BUS to fix firmware build ARM: dts: imx6qdl-kontron-samx6i: fix i2c_lcd/cam default status arm64: dts: ls1028a: fix the offset of the reset register xfrm: Fix wraparound in xfrm_policy_addr_delta() selftests: xfrm: fix test return value override issue in xfrm_policy.sh xfrm: fix disable_xfrm sysctl when used on xfrm interfaces xfrm: Fix oops in xfrm_replay_advance_bmp netfilter: nft_dynset: add timeout extension to template ARM: imx: build suspend-imx6.S with arm instruction set xen-blkfront: allow discard-* nodes to be optional tee: optee: replace might_sleep with cond_resched drm/i915: Check for all subplatform bits drm/nouveau/svm: fail NOUVEAU_SVM_INIT ioctl on unsupported devices mt7601u: fix rx buffer refcounting mt7601u: fix kernel crash unplugging the device arm64: dts: broadcom: Fix USB DMA address translation for Stingray leds: trigger: fix potential deadlock with libata xen: Fix XenStore initialisation for XS_LOCAL KVM: Forbid the use of tagged userspace addresses for memslots KVM: x86: get smi pending status correctly KVM: nVMX: Sync unsync'd vmcs02 state to vmcs12 on migration KVM: x86/pmu: Fix UBSAN shift-out-of-bounds warning in intel_pmu_refresh() KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] btrfs: fix possible free space tree corruption with online conversion drivers: soc: atmel: add null entry at the end of at91_soc_allowed_list[] drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs PM: hibernate: flush swap writer after marking s390/vfio-ap: No need to disable IRQ after queue reset net: usb: qmi_wwan: added support for Thales Cinterion PLSx3 modem family wext: fix NULL-ptr-dereference with cfg80211's lack of commit() ARM: dts: imx6qdl-gw52xx: fix duplicate regulator naming media: rc: ensure that uevent can be read directly after rc device register ALSA: hda/via: Apply the workaround generically for Clevo machines ALSA: hda/realtek: Enable headset of ASUS B1400CEPE with ALC256 kernel: kexec: remove the lock operation of system_transition_mutex ACPI: sysfs: Prefer "compatible" modalias nbd: freeze the queue while we're adding connections IPv6: reply ICMP error if the first fragment don't include all headers ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition ANDROID: arm64: mm: ensure that memstart_addr and physvirt_offset remain in sync Revert "arm64: mm: use single quantity to represent the PA to VA translation" Linux 5.4.94 fs: fix lazytime expiration handling in __writeback_single_inode() writeback: Drop I_DIRTY_TIME_EXPIRE dm integrity: conditionally disable "recalculate" feature tools: Factor HOSTCC, HOSTLD, HOSTAR definitions SMB3.1.1: do not log warning message if server doesn't populate salt arm64: mm: use single quantity to represent the PA to VA translation tracing: Fix race in trace_open and buffer resize call io_uring: Fix current->fs handling in io_sq_wq_submit_work() HID: wacom: Correct NULL dereference on AES pen proximity futex: Handle faults correctly for PI futexes futex: Simplify fixup_pi_state_owner() futex: Use pi_state_update_owner() in put_pi_state() rtmutex: Remove unused argument from rt_mutex_proxy_unlock() futex: Provide and use pi_state_update_owner() futex: Replace pointless printk in fixup_owner() futex: Ensure the correct return value from futex_lock_pi() Revert "mm/slub: fix a memory leak in sysfs_slab_add()" gpio: mvebu: fix pwm .get_state period calculation ANDROID: GKI: api preservation of struct inet_connection_sock ANDROID: GKI: update .xml file in android11-5.4-lts Linux 5.4.93 tcp: fix TCP_USER_TIMEOUT with zero window tcp: do not mess with cloned skbs in tcp_add_backlog() net: dsa: b53: fix an off by one in checking "vlan->vid" net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled net: mscc: ocelot: allow offloading of bridge on top of LAG ipv6: set multicast flag on the multicast route net_sched: reject silly cell_log in qdisc_get_rtab() net_sched: avoid shift-out-of-bounds in tcindex_set_parms() ipv6: create multicast route with RTPROT_KERNEL udp: mask TOS bits in udp_v4_early_demux() kasan: fix incorrect arguments passing in kasan_add_zero_shadow kasan: fix unaligned address is unhandled in kasan_remove_zero_shadow skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too lightnvm: fix memory leak when submit fails sh_eth: Fix power down vs. is_opened flag ordering net: dsa: mv88e6xxx: also read STU state in mv88e6250_g1_vtu_getnext sh: dma: fix kconfig dependency for G2_DMA netfilter: rpfilter: mask ecn bits before fib lookup x86/cpu/amd: Set __max_die_per_package on AMD pinctrl: ingenic: Fix JZ4760 support driver core: Extend device_is_dependent() xhci: tegra: Delay for disabling LFPS detector xhci: make sure TRB is fully written before giving it to the controller usb: bdc: Make bdc pci driver depend on BROKEN usb: udc: core: Use lock when write to soft_connect usb: gadget: aspeed: fix stop dma register setting. USB: ehci: fix an interrupt calltrace error ehci: fix EHCI host controller initialization sequence serial: mvebu-uart: fix tx lost characters at power off stm class: Fix module init return on allocation failure intel_th: pci: Add Alder Lake-P support x86/mmx: Use KFPU_387 for MMX string operations x86/topology: Make __max_die_per_package available unconditionally x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state irqchip/mips-cpu: Set IPI domain parent chip cifs: do not fail __smb_send_rqst if non-fatal signals are pending iio: ad5504: Fix setting power-down state can: peak_usb: fix use after free bugs can: vxcan: vxcan_xmit: fix use after free bug can: dev: can_restart: fix use after free bug selftests: net: fib_tests: remove duplicate log test platform/x86: intel-vbtn: Drop HP Stream x360 Convertible PC 11 from allow-list i2c: octeon: check correct size of maximum RECV_LEN packet powerpc: Fix alignment bug within the init sections scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression pinctrl: aspeed: g6: Fix PWMG0 pinctrl setting powerpc: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0 drm/nouveau/mmu: fix vram heap sizing drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields drm/nouveau/privring: ack interrupts the same way as RM drm/nouveau/bios: fix issue shadowing expansion ROMs drm/amd/display: Fix to be able to stop crc calculation drm/amdgpu/psp: fix psp gfx ctrl cmds riscv: defconfig: enable gpio support for HiFive Unleashed dts: phy: fix missing mdio device and probe failure of vsc8541-01 device x86/xen: Add xen_no_vector_callback option to test PCI INTX delivery xen: Fix event channel callback via INTX/GSI arm64: make atomic helpers __always_inline clk: tegra30: Add hda clock default rates to clock driver HID: Ignore battery for Elan touchscreen on ASUS UX550 HID: logitech-dj: add the G602 receiver riscv: Fix sifive serial driver riscv: Fix kernel time_init() scsi: sd: Suppress spurious errors when WRITE SAME is being disabled scsi: qedi: Correct max length of CHAP secret scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback dm integrity: select CRYPTO_SKCIPHER HID: multitouch: Enable multi-input for Synaptics pointstick/touchpad device ASoC: Intel: haswell: Add missing pm_ops drm/i915/gt: Prevent use of engine->wa_ctx after error drm/syncobj: Fix use-after-free drm/atomic: put state on error path dm integrity: fix a crash if "recalculate" used without "internal_hash" dm: avoid filesystem lookup in dm_get_dev_t() mmc: sdhci-xenon: fix 1.8v regulator stabilization mmc: core: don't initialize block size from ext_csd if not present btrfs: send: fix invalid clone operations when cloning from the same file and root btrfs: don't clear ret in btrfs_start_dirty_block_groups btrfs: fix lockdep splat in btrfs_recover_relocation btrfs: don't get an EINTR during drop_snapshot for reloc ACPI: scan: Make acpi_bus_get_device() clear return pointer on error ALSA: hda/via: Add minimum mute flag ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info() platform/x86: ideapad-laptop: Disable touchpad_switch for ELAN0634 platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes i2c: bpmp-tegra: Ignore unknown I2C_M flags Linux 5.4.92 spi: cadence: cache reference clock rate during probe mac80211: check if atf has been disabled in __ieee80211_schedule_txq mac80211: do not drop tx nulldata packets on encrypted links tipc: fix NULL deref in tipc_link_xmit() net, sctp, filter: remap copy_from_user failure error rxrpc: Fix handling of an unsupported token type in rxrpc_read() net: avoid 32 x truesize under-estimation for tiny skbs net: sit: unregister_netdevice on newlink's error path net: stmmac: Fixed mtu channged by cache aligned rxrpc: Call state should be read with READ_ONCE() under some circumstances net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands net: dcb: Validate netlink message in DCB handler esp: avoid unneeded kmap_atomic call rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM request net: mvpp2: Remove Pause and Asym_Pause support mlxsw: core: Increase critical threshold for ASIC thermal zone mlxsw: core: Add validation of transceiver temperature thresholds net: ipv6: Validate GSO SKB before finish IPv6 processing net: skbuff: disambiguate argument and member for skb_list_walk_safe helper net: introduce skb_list_walk_safe for skb segment walking netxen_nic: fix MSI/MSI-x interrupts udp: Prevent reuseport_select_sock from reading uninitialized socks bpf: Fix helper bpf_map_peek_elem_proto pointing to wrong callback bpf: Don't leak memory in bpf getsockopt when optlen == 0 nfsd4: readdirplus shouldn't return parent of export spi: npcm-fiu: Disable clock in probe error path spi: npcm-fiu: simplify the return expression of npcm_fiu_probe() scsi: lpfc: Make lpfc_defer_acc_rsp static scsi: lpfc: Make function lpfc_defer_pt2pt_acc static elfcore: fix building with clang xen/privcmd: allow fetching resource sizes compiler.h: Raise minimum version of GCC to 5.1 for arm64 usb: ohci: Make distrust_firmware param default to false Linux 5.4.91 netfilter: nft_compat: remove flush counter optimization netfilter: nf_nat: Fix memleak in nf_nat_init netfilter: conntrack: fix reading nf_conntrack_buckets ALSA: firewire-tascam: Fix integer overflow in midi_port_work() ALSA: fireface: Fix integer overflow in transmit_midi_msg() dm: eliminate potential source of excessive kernel log noise net: sunrpc: interpret the return value of kstrtou32 correctly iommu/vt-d: Fix unaligned addresses for intel_flush_svm_range_dev() mm, slub: consider rest of partial list if acquire_slab() fails drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence IB/mlx5: Fix error unwinding when set_has_smi_cap fails RDMA/mlx5: Fix wrong free of blue flame register on error bnxt_en: Improve stats context resource accounting with RDMA driver loaded. RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp RDMA/restrack: Don't treat as an error allocation ID wrapping ext4: fix superblock checksum failure when setting password salt NFS: nfs_igrab_and_active must first reference the superblock NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter pNFS: Stricter ordering of layoutget and layoutreturn pNFS: Mark layout for return if return-on-close was not sent pNFS: We want return-on-close to complete when evicting the inode NFS4: Fix use-after-free in trace_event_raw_event_nfs4_set_lock nvme-tcp: fix possible data corruption with bio merges ASoC: Intel: fix error code cnl_set_dsp_D0() ASoC: meson: axg-tdmin: fix axg skew offset ASoC: meson: axg-tdm-interface: fix loopback dump_common_audit_data(): fix racy accesses to ->d_name perf intel-pt: Fix 'CPU too large' error ARM: picoxcell: fix missing interrupt-parent properties drm/msm: Call msm_init_vram before binding the gpu ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI usb: typec: Fix copy paste error for NVIDIA alt-mode description drm/amdgpu: fix a GPU hang issue when remove device nvmet-rdma: Fix list_del corruption on queue establishment failure nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN selftests: fix the return value for UDP GRO test net: ethernet: fs_enet: Add missing MODULE_LICENSE misdn: dsp: select CONFIG_BITREVERSE arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC bfq: Fix computation of shallow depth lib/raid6: Let $(UNROLL) rules work with macOS userland hwmon: (pwm-fan) Ensure that calculation doesn't discard big period values habanalabs: Fix memleak in hl_device_reset habanalabs: register to pci shutdown callback ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram regulator: bd718x7: Add enable times btrfs: fix transaction leak and crash after RO remount caused by qgroup rescan netfilter: ipset: fixes possible oops in mtype_resize ARC: build: move symlink creation to arch/arc/Makefile to avoid race ARC: build: add boot_targets to PHONY ARC: build: add uImage.lzma to the top-level target ARC: build: remove non-existing bootpImage from KBUILD_IMAGE dm integrity: fix flush with external metadata device cifs: fix interrupted close commands smb3: remove unused flag passed into close functions ext4: don't leak old mountpoint samples ext4: fix bug for rename with RENAME_WHITEOUT drm/i915/backlight: fix CPU mode backlight takeover on LPT btrfs: tree-checker: check if chunk item end overflows r8152: Add Lenovo Powered USB-C Travel Hub dm integrity: fix the maximum number of arguments dm snapshot: flush merged data before committing metadata dm raid: fix discard limits for raid1 mm/hugetlb: fix potential missing huge page size info ACPI: scan: Harden acpi_device_add() against device ID overflows RDMA/ocrdma: Fix use after free in ocrdma_dealloc_ucontext_pd() MIPS: relocatable: fix possible boot hangup with KASLR enabled MIPS: boot: Fix unaligned access with CONFIG_MIPS_RAW_APPENDED_DTB mips: lib: uncached: fix non-standard usage of variable 'sp' mips: fix Section mismatch in reference tracing/kprobes: Do the notrace functions check without kprobes on ftrace x86/hyperv: check cpu mask after interrupt has been disabled ASoC: dapm: remove widget from dirty list on free btrfs: prevent NULL pointer dereference in extent_io_tree_panic kbuild: enforce -Werror=return-type Linux 5.4.90 regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init() net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet block: fix use-after-free in disk_part_iter_next KVM: arm64: Don't access PMCR_EL0 when no PMU is available net: mvpp2: disable force link UP during port init procedure regulator: qcom-rpmh-regulator: correct hfsmps515 definition wan: ds26522: select CONFIG_BITREVERSE regmap: debugfs: Fix a memory leak when calling regmap_attach_dev net/mlx5e: Fix two double free cases net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups bpftool: Fix compilation failure for net.o with older glibc iommu/intel: Fix memleak in intel_irq_remapping_alloc lightnvm: select CONFIG_CRC32 block: rsxx: select CONFIG_CRC32 wil6210: select CONFIG_CRC32 qed: select CONFIG_CRC32 dmaengine: xilinx_dma: fix mixed_enum_type coverity warning dmaengine: xilinx_dma: fix incompatible param warning in _child_probe() dmaengine: xilinx_dma: check dma_async_device_register return value dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated spi: stm32: FIFO threshold level - fix align packet size cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get() can: kvaser_pciefd: select CONFIG_CRC32 can: m_can: m_can_class_unregister(): remove erroneous m_can_clk_stop() can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk() i2c: sprd: use a specific timeout to avoid system hang up issue ARM: OMAP2+: omap_device: fix idling of devices during probe HID: wacom: Fix memory leakage caused by kfifo_alloc iio: imu: st_lsm6dsx: fix edge-trigger interrupts vmlinux.lds.h: Add PGO and AutoFDO input sections exfat: Month timestamp metadata accidentally incremented x86/resctrl: Don't move a task to the same resource group x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR chtls: Fix chtls resources release sequence chtls: Added a check to avoid NULL pointer dereference chtls: Replace skb_dequeue with skb_peek chtls: Fix panic when route to peer not configured chtls: Remove invalid set_tcb call chtls: Fix hardware tid leak net/mlx5e: ethtool, Fix restriction of autoneg with 56G net/mlx5: Use port_num 1 instead of 0 when delete a RoCE address net: dsa: lantiq_gswip: Exclude RMII from modes that report 1 GbE s390/qeth: fix L2 header access in qeth_l3_osa_features_check() nexthop: Unlink nexthop group entry in error path nexthop: Fix off-by-one error in error path octeontx2-af: fix memory leak of lmac and lmac->name net: ip: always refragment ip defragmented packets net: fix pmtu check in nopmtudisc mode tools: selftests: add test for changing routes with PTMU exceptions net: ipv6: fib: flush exceptions when purging route net/sonic: Fix some resource leaks in error handling paths net: vlan: avoid leaks on register_vlan_dev() failures net: stmmac: dwmac-sun8i: Balance internal PHY power net: stmmac: dwmac-sun8i: Balance internal PHY resource references net: hns3: fix a phy loopback fail issue net: hns3: fix the number of queues actually used by ARQ net: cdc_ncm: correct overhead in delayed_ndp_size vfio iommu: Add dma available capability x86/asm/32: Add ENDs to some functions and relabel with SYM_CODE_* Linux 5.4.89 scsi: target: Fix XCOPY NAA identifier lookup KVM: x86: fix shift out of bounds reported by UBSAN x86/mtrr: Correct the range check before performing MTRR type lookups netfilter: nft_dynset: report EOPNOTSUPP on missing set feature netfilter: xt_RATEEST: reject non-null terminated string from userspace netfilter: ipset: fix shift-out-of-bounds in htable_bits() netfilter: x_tables: Update remaining dereference to RCU drm/i915: clear the gpu reloc batch dmabuf: fix use-after-free of dmabuf's file->f_inode Revert "device property: Keep secondary firmware node secondary by type" btrfs: send: fix wrong file path when there is an inode with a pending rmdir ALSA: hda/realtek: Add two "Intel Reference board" SSID in the ALC256. ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7 ALSA: hda/realtek - Fix speaker volume control on Lenovo C940 ALSA: hda/conexant: add a new hda codec CX11970 ALSA: hda/via: Fix runtime PM for Clevo W35xSS kvm: check tlbs_dirty directly x86/mm: Fix leak of pmd ptlock USB: serial: keyspan_pda: remove unused variable usb: gadget: configfs: Fix use-after-free issue with udc_name usb: gadget: configfs: Preserve function ordering after bind failure usb: gadget: Fix spinlock lockup on usb_function_deactivate USB: gadget: legacy: fix return error code in acm_ms_bind() usb: gadget: u_ether: Fix MTU size mismatch with RX packet size usb: gadget: function: printer: Fix a memory leak for interface descriptor usb: gadget: f_uac2: reset wMaxPacketSize usb: gadget: select CONFIG_CRC32 ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks USB: usblp: fix DMA to stack USB: yurex: fix control-URB timeout handling USB: serial: option: add Quectel EM160R-GL USB: serial: option: add LongSung M5710 module support USB: serial: iuu_phoenix: fix DMA from stack usb: uas: Add PNY USB Portable SSD to unusual_uas usb: usbip: vhci_hcd: protect shift size USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion USB: cdc-wdm: Fix use after free in service_outstanding_interrupt(). USB: cdc-acm: blacklist another IR Droid device usb: gadget: enable super speed plus staging: mt7621-dma: Fix a resource leak in an error handling path powerpc: Handle .text.{hot,unlikely}.* in linker script crypto: asym_tpm: correct zero out potential secrets crypto: ecdh - avoid buffer overflow in ecdh_set_secret() video: hyperv_fb: Fix the mmap() regression for v5.4.y and older Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close kbuild: don't hardcode depmod path net/sched: sch_taprio: ensure to reset/destroy all child qdiscs ionic: account for vlan tag len in rx buffer len vhost_net: fix ubuf refcount incorrectly when sendmsg fails net: usb: qmi_wwan: add Quectel EM160R-GL CDC-NCM: remove "connected" log message net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access net: dsa: lantiq_gswip: Enable GSWIP_MII_CFG_EN also for internal PHYs r8169: work around power-saving bug on some chip versions net: hdlc_ppp: Fix issues when mod_timer is called while timer is running erspan: fix version 1 check in gre_parse_header() net: hns: fix return value check in __lb_other_process() net: sched: prevent invalid Scell_log shift count ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst() net: mvpp2: fix pkt coalescing int-threshold configuration tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc net-sysfs: take the rtnl lock when storing xps_rxqs net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc net-sysfs: take the rtnl lock when storing xps_cpus net: ethernet: Fix memleak in ethoc_probe net/ncsi: Use real net-device for response handler virtio_net: Fix recursive call to cpus_read_lock() qede: fix offload for IPIP tunnel packets net: ethernet: mvneta: Fix error handling in mvneta_probe ibmvnic: continue fatal error reset after passive init net: mvpp2: Fix GoP port 3 Networking Complex Control configurations atm: idt77252: call pci_disable_device() on error path ethernet: ucc_geth: set dev->max_mtu to 1518 ethernet: ucc_geth: fix use-after-free in ucc_geth_remove() net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE net: mvpp2: prs: fix PPPoE with ipv6 packet parse net: mvpp2: Add TCAM entry to drop flow control pause frames iavf: fix double-release of rtnl_lock i40e: Fix Error I40E_AQ_RC_EINVAL when removing VFs proc: fix lookup in /proc/net subdirectories after setns(2) proc: change ->nlink under proc_subdir_lock depmod: handle the case of /sbin/depmod without /sbin in PATH lib/genalloc: fix the overflow when size is too big scsi: scsi_transport_spi: Set RQF_PM for domain validation commands scsi: ide: Do not set the RQF_PREEMPT flag for sense requests scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff() scsi: ufs: Fix wrong print message in dev_err() workqueue: Kick a worker based on the actual activation of delayed works Revert "rwsem: Implement down_read_killable_nested" Revert "rwsem: Implement down_read_interruptible" Revert "perf: Use new infrastructure to fix deadlocks in execve" Revert "perf: Break deadlock involving exec_update_mutex" Revert "exec: Add exec_update_mutex to replace cred_guard_mutex" Revert "kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve" Revert "proc: Use new infrastructure to fix deadlocks in execve" Revert "proc: io_accounting: Use new infrastructure to fix deadlocks in execve" Revert "exec: Fix a deadlock in strace" Revert "exec: Transform exec_update_mutex into a rw_semaphore" Revert "Revert "exec: Fix a deadlock in strace"" Revert "Revert "perf: Use new infrastructure to fix deadlocks in execve"" Revert "Revert "proc: io_accounting: Use new infrastructure to fix deadlocks in execve"" Revert "Revert "proc: Use new infrastructure to fix deadlocks in execve"" Revert "Revert "kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve"" Revert "Revert "exec: Add exec_update_mutex to replace cred_guard_mutex"" Linux 5.4.88 mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start exec: Transform exec_update_mutex into a rw_semaphore rwsem: Implement down_read_interruptible rwsem: Implement down_read_killable_nested perf: Break deadlock involving exec_update_mutex fuse: fix bad inode iio:imu:bmi160: Fix alignment and data leak issues kdev_t: always inline major/minor helper functions dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate() dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate() dmaengine: at_hdmac: Substitute kzalloc with kmalloc Revert "mtd: spinand: Fix OOB read" Revert "drm/amd/display: Fix memory leaks in S3 resume" Linux 5.4.87 dm verity: skip verity work if I/O error when system is shutting down ALSA: pcm: Clear the full allocated memory at hw_params tick/sched: Remove bogus boot "safety" check um: ubd: Submit all data segments atomically fs/namespace.c: WARN if mnt_count has become negative module: delay kobject uevent until after module init call f2fs: avoid race condition for shrinker count NFSv4: Fix a pNFS layout related use-after-free race when freeing the inode i3c master: fix missing destroy_workqueue() on error in i3c_master_register powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() rtc: pl031: fix resource leak in pl031_probe quota: Don't overflow quota file offsets module: set MODULE_STATE_GOING state when a module fails to load rtc: sun6i: Fix memleak in sun6i_rtc_clk_init fcntl: Fix potential deadlock in send_sig{io, urg}() bfs: don't use WARNING: string when it's just info. ALSA: rawmidi: Access runtime->avail always in spinlock ALSA: seq: Use bool for snd_seq_queue internal flags f2fs: fix shift-out-of-bounds in sanity_check_raw_super() media: gp8psk: initialize stats at power control logic misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_ctx_get_chkpt_doorbells() reiserfs: add check for an invalid ih_entry_count Bluetooth: hci_h5: close serdev device and free hu in h5_close scsi: cxgb4i: Fix TLS dependency cgroup: Fix memory leak when parsing multiple source parameters of: fix linker-section match-table corruption null_blk: Fix zone size initialization tools headers UAPI: Sync linux/const.h with the kernel headers uapi: move constants from <linux/kernel.h> to <linux/const.h> scsi: block: Fix a race in the runtime power management code jffs2: Fix NULL pointer dereference in rp_size fs option parsing jffs2: Allow setting rp_size to zero during remounting powerpc/bitops: Fix possible undefined behaviour with fls() and fls64() KVM: x86: reinstate vendor-agnostic check on SPEC_CTRL cpuid bits KVM: SVM: relax conditions for allowing MSR_IA32_SPEC_CTRL accesses KVM: x86: avoid incorrect writes to host MSR_IA32_SPEC_CTRL ext4: don't remount read-only with errors=continue on reboot btrfs: fix race when defragmenting leads to unnecessary IO vfio/pci: Move dummy_resources_list init in vfio_pci_probe() fscrypt: remove kernel-internal constants from UAPI header fscrypt: add fscrypt_is_nokey_name() f2fs: prevent creating duplicate encrypted filenames ubifs: prevent creating duplicate encrypted filenames ext4: prevent creating duplicate encrypted filenames thermal/drivers/cpufreq_cooling: Update cpufreq_state only if state has changed md/raid10: initialize r10_bio->read_slot before use. net/sched: sch_taprio: reset child qdiscs before freeing them Conflicts: Documentation/devicetree/bindings Documentation/devicetree/bindings/net/btusb.txt Documentation/devicetree/bindings/net/ethernet-controller.yaml arch/arm/kernel/smccc-call.S arch/arm64/kernel/cpufeature.c block/blk-pm.c drivers/dma-buf/dma-buf.c drivers/iommu/arm-smmu.c drivers/md/dm-verity-target.c drivers/spmi/spmi-pmic-arb.c drivers/staging/exfat/exfat_super.c drivers/usb/core/hub.c drivers/usb/dwc3/core.c drivers/usb/dwc3/debugfs.c drivers/usb/dwc3/gadget.c drivers/usb/gadget/function/f_fs.c drivers/usb/gadget/function/f_uac2.c drivers/usb/gadget/function/u_audio.c fs/fuse/fuse_i.h include/linux/mm.h kernel/cpu.c kernel/sched/fair.c kernel/workqueue.c mm/huge_memory.c net/ipv4/tcp_timer.c net/qrtr/qrtr.c net/qrtr/tun.c security/selinux/avc.c fixed build errors. Change-Id: I8c05a8523ac57cedf52589a41ec4c582fd512a26 Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
3119 lines
86 KiB
C
3119 lines
86 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2009 Red Hat, Inc.
|
|
*/
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
#include <linux/mm.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/sched/coredump.h>
|
|
#include <linux/sched/numa_balancing.h>
|
|
#include <linux/highmem.h>
|
|
#include <linux/hugetlb.h>
|
|
#include <linux/mmu_notifier.h>
|
|
#include <linux/rmap.h>
|
|
#include <linux/swap.h>
|
|
#include <linux/shrinker.h>
|
|
#include <linux/mm_inline.h>
|
|
#include <linux/swapops.h>
|
|
#include <linux/dax.h>
|
|
#include <linux/khugepaged.h>
|
|
#include <linux/freezer.h>
|
|
#include <linux/pfn_t.h>
|
|
#include <linux/mman.h>
|
|
#include <linux/memremap.h>
|
|
#include <linux/pagemap.h>
|
|
#include <linux/debugfs.h>
|
|
#include <linux/migrate.h>
|
|
#include <linux/hashtable.h>
|
|
#include <linux/userfaultfd_k.h>
|
|
#include <linux/page_idle.h>
|
|
#include <linux/shmem_fs.h>
|
|
#include <linux/oom.h>
|
|
#include <linux/numa.h>
|
|
#include <linux/page_owner.h>
|
|
|
|
#include <asm/tlb.h>
|
|
#include <asm/pgalloc.h>
|
|
#include "internal.h"
|
|
|
|
/*
|
|
* By default, transparent hugepage support is disabled in order to avoid
|
|
* risking an increased memory footprint for applications that are not
|
|
* guaranteed to benefit from it. When transparent hugepage support is
|
|
* enabled, it is for all mappings, and khugepaged scans all mappings.
|
|
* Defrag is invoked by khugepaged hugepage allocations and by page faults
|
|
* for all hugepage allocations.
|
|
*/
|
|
unsigned long transparent_hugepage_flags __read_mostly =
|
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS
|
|
(1<<TRANSPARENT_HUGEPAGE_FLAG)|
|
|
#endif
|
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE_MADVISE
|
|
(1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)|
|
|
#endif
|
|
(1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG)|
|
|
(1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
|
|
(1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
|
|
|
|
static struct shrinker deferred_split_shrinker;
|
|
|
|
static atomic_t huge_zero_refcount;
|
|
struct page *huge_zero_page __read_mostly;
|
|
unsigned long huge_zero_pfn __read_mostly = ~0UL;
|
|
|
|
bool transparent_hugepage_enabled(struct vm_area_struct *vma)
|
|
{
|
|
/* The addr is used to check if the vma size fits */
|
|
unsigned long addr = (vma->vm_end & HPAGE_PMD_MASK) - HPAGE_PMD_SIZE;
|
|
|
|
if (!transhuge_vma_suitable(vma, addr))
|
|
return false;
|
|
if (vma_is_anonymous(vma))
|
|
return __transparent_hugepage_enabled(vma);
|
|
if (vma_is_shmem(vma))
|
|
return shmem_huge_enabled(vma);
|
|
|
|
return false;
|
|
}
|
|
|
|
static struct page *get_huge_zero_page(void)
|
|
{
|
|
struct page *zero_page;
|
|
retry:
|
|
if (likely(atomic_inc_not_zero(&huge_zero_refcount)))
|
|
return READ_ONCE(huge_zero_page);
|
|
|
|
zero_page = alloc_pages((GFP_TRANSHUGE | __GFP_ZERO) & ~__GFP_MOVABLE,
|
|
HPAGE_PMD_ORDER);
|
|
if (!zero_page) {
|
|
count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED);
|
|
return NULL;
|
|
}
|
|
count_vm_event(THP_ZERO_PAGE_ALLOC);
|
|
preempt_disable();
|
|
if (cmpxchg(&huge_zero_page, NULL, zero_page)) {
|
|
preempt_enable();
|
|
__free_pages(zero_page, compound_order(zero_page));
|
|
goto retry;
|
|
}
|
|
WRITE_ONCE(huge_zero_pfn, page_to_pfn(zero_page));
|
|
|
|
/* We take additional reference here. It will be put back by shrinker */
|
|
atomic_set(&huge_zero_refcount, 2);
|
|
preempt_enable();
|
|
return READ_ONCE(huge_zero_page);
|
|
}
|
|
|
|
static void put_huge_zero_page(void)
|
|
{
|
|
/*
|
|
* Counter should never go to zero here. Only shrinker can put
|
|
* last reference.
|
|
*/
|
|
BUG_ON(atomic_dec_and_test(&huge_zero_refcount));
|
|
}
|
|
|
|
struct page *mm_get_huge_zero_page(struct mm_struct *mm)
|
|
{
|
|
if (test_bit(MMF_HUGE_ZERO_PAGE, &mm->flags))
|
|
return READ_ONCE(huge_zero_page);
|
|
|
|
if (!get_huge_zero_page())
|
|
return NULL;
|
|
|
|
if (test_and_set_bit(MMF_HUGE_ZERO_PAGE, &mm->flags))
|
|
put_huge_zero_page();
|
|
|
|
return READ_ONCE(huge_zero_page);
|
|
}
|
|
|
|
void mm_put_huge_zero_page(struct mm_struct *mm)
|
|
{
|
|
if (test_bit(MMF_HUGE_ZERO_PAGE, &mm->flags))
|
|
put_huge_zero_page();
|
|
}
|
|
|
|
static unsigned long shrink_huge_zero_page_count(struct shrinker *shrink,
|
|
struct shrink_control *sc)
|
|
{
|
|
/* we can free zero page only if last reference remains */
|
|
return atomic_read(&huge_zero_refcount) == 1 ? HPAGE_PMD_NR : 0;
|
|
}
|
|
|
|
static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
|
|
struct shrink_control *sc)
|
|
{
|
|
if (atomic_cmpxchg(&huge_zero_refcount, 1, 0) == 1) {
|
|
struct page *zero_page = xchg(&huge_zero_page, NULL);
|
|
BUG_ON(zero_page == NULL);
|
|
WRITE_ONCE(huge_zero_pfn, ~0UL);
|
|
__free_pages(zero_page, compound_order(zero_page));
|
|
return HPAGE_PMD_NR;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static struct shrinker huge_zero_page_shrinker = {
|
|
.count_objects = shrink_huge_zero_page_count,
|
|
.scan_objects = shrink_huge_zero_page_scan,
|
|
.seeks = DEFAULT_SEEKS,
|
|
};
|
|
|
|
#ifdef CONFIG_SYSFS
|
|
static ssize_t enabled_show(struct kobject *kobj,
|
|
struct kobj_attribute *attr, char *buf)
|
|
{
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_FLAG, &transparent_hugepage_flags))
|
|
return sprintf(buf, "[always] madvise never\n");
|
|
else if (test_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG, &transparent_hugepage_flags))
|
|
return sprintf(buf, "always [madvise] never\n");
|
|
else
|
|
return sprintf(buf, "always madvise [never]\n");
|
|
}
|
|
|
|
static ssize_t enabled_store(struct kobject *kobj,
|
|
struct kobj_attribute *attr,
|
|
const char *buf, size_t count)
|
|
{
|
|
ssize_t ret = count;
|
|
|
|
if (sysfs_streq(buf, "always")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_FLAG, &transparent_hugepage_flags);
|
|
} else if (sysfs_streq(buf, "madvise")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_FLAG, &transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
} else if (sysfs_streq(buf, "never")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
} else
|
|
ret = -EINVAL;
|
|
|
|
if (ret > 0) {
|
|
int err = start_stop_khugepaged();
|
|
if (err)
|
|
ret = err;
|
|
}
|
|
return ret;
|
|
}
|
|
static struct kobj_attribute enabled_attr =
|
|
__ATTR(enabled, 0644, enabled_show, enabled_store);
|
|
|
|
ssize_t single_hugepage_flag_show(struct kobject *kobj,
|
|
struct kobj_attribute *attr, char *buf,
|
|
enum transparent_hugepage_flag flag)
|
|
{
|
|
return sprintf(buf, "%d\n",
|
|
!!test_bit(flag, &transparent_hugepage_flags));
|
|
}
|
|
|
|
ssize_t single_hugepage_flag_store(struct kobject *kobj,
|
|
struct kobj_attribute *attr,
|
|
const char *buf, size_t count,
|
|
enum transparent_hugepage_flag flag)
|
|
{
|
|
unsigned long value;
|
|
int ret;
|
|
|
|
ret = kstrtoul(buf, 10, &value);
|
|
if (ret < 0)
|
|
return ret;
|
|
if (value > 1)
|
|
return -EINVAL;
|
|
|
|
if (value)
|
|
set_bit(flag, &transparent_hugepage_flags);
|
|
else
|
|
clear_bit(flag, &transparent_hugepage_flags);
|
|
|
|
return count;
|
|
}
|
|
|
|
static ssize_t defrag_show(struct kobject *kobj,
|
|
struct kobj_attribute *attr, char *buf)
|
|
{
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags))
|
|
return sprintf(buf, "[always] defer defer+madvise madvise never\n");
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags))
|
|
return sprintf(buf, "always [defer] defer+madvise madvise never\n");
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags))
|
|
return sprintf(buf, "always defer [defer+madvise] madvise never\n");
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags))
|
|
return sprintf(buf, "always defer defer+madvise [madvise] never\n");
|
|
return sprintf(buf, "always defer defer+madvise madvise [never]\n");
|
|
}
|
|
|
|
static ssize_t defrag_store(struct kobject *kobj,
|
|
struct kobj_attribute *attr,
|
|
const char *buf, size_t count)
|
|
{
|
|
if (sysfs_streq(buf, "always")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags);
|
|
} else if (sysfs_streq(buf, "defer+madvise")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags);
|
|
} else if (sysfs_streq(buf, "defer")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags);
|
|
} else if (sysfs_streq(buf, "madvise")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
} else if (sysfs_streq(buf, "never")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags);
|
|
} else
|
|
return -EINVAL;
|
|
|
|
return count;
|
|
}
|
|
static struct kobj_attribute defrag_attr =
|
|
__ATTR(defrag, 0644, defrag_show, defrag_store);
|
|
|
|
static ssize_t use_zero_page_show(struct kobject *kobj,
|
|
struct kobj_attribute *attr, char *buf)
|
|
{
|
|
return single_hugepage_flag_show(kobj, attr, buf,
|
|
TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
|
|
}
|
|
static ssize_t use_zero_page_store(struct kobject *kobj,
|
|
struct kobj_attribute *attr, const char *buf, size_t count)
|
|
{
|
|
return single_hugepage_flag_store(kobj, attr, buf, count,
|
|
TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
|
|
}
|
|
static struct kobj_attribute use_zero_page_attr =
|
|
__ATTR(use_zero_page, 0644, use_zero_page_show, use_zero_page_store);
|
|
|
|
static ssize_t hpage_pmd_size_show(struct kobject *kobj,
|
|
struct kobj_attribute *attr, char *buf)
|
|
{
|
|
return sprintf(buf, "%lu\n", HPAGE_PMD_SIZE);
|
|
}
|
|
static struct kobj_attribute hpage_pmd_size_attr =
|
|
__ATTR_RO(hpage_pmd_size);
|
|
|
|
#ifdef CONFIG_DEBUG_VM
|
|
static ssize_t debug_cow_show(struct kobject *kobj,
|
|
struct kobj_attribute *attr, char *buf)
|
|
{
|
|
return single_hugepage_flag_show(kobj, attr, buf,
|
|
TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG);
|
|
}
|
|
static ssize_t debug_cow_store(struct kobject *kobj,
|
|
struct kobj_attribute *attr,
|
|
const char *buf, size_t count)
|
|
{
|
|
return single_hugepage_flag_store(kobj, attr, buf, count,
|
|
TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG);
|
|
}
|
|
static struct kobj_attribute debug_cow_attr =
|
|
__ATTR(debug_cow, 0644, debug_cow_show, debug_cow_store);
|
|
#endif /* CONFIG_DEBUG_VM */
|
|
|
|
static struct attribute *hugepage_attr[] = {
|
|
&enabled_attr.attr,
|
|
&defrag_attr.attr,
|
|
&use_zero_page_attr.attr,
|
|
&hpage_pmd_size_attr.attr,
|
|
#if defined(CONFIG_SHMEM) && defined(CONFIG_TRANSPARENT_HUGE_PAGECACHE)
|
|
&shmem_enabled_attr.attr,
|
|
#endif
|
|
#ifdef CONFIG_DEBUG_VM
|
|
&debug_cow_attr.attr,
|
|
#endif
|
|
NULL,
|
|
};
|
|
|
|
static const struct attribute_group hugepage_attr_group = {
|
|
.attrs = hugepage_attr,
|
|
};
|
|
|
|
static int __init hugepage_init_sysfs(struct kobject **hugepage_kobj)
|
|
{
|
|
int err;
|
|
|
|
*hugepage_kobj = kobject_create_and_add("transparent_hugepage", mm_kobj);
|
|
if (unlikely(!*hugepage_kobj)) {
|
|
pr_err("failed to create transparent hugepage kobject\n");
|
|
return -ENOMEM;
|
|
}
|
|
|
|
err = sysfs_create_group(*hugepage_kobj, &hugepage_attr_group);
|
|
if (err) {
|
|
pr_err("failed to register transparent hugepage group\n");
|
|
goto delete_obj;
|
|
}
|
|
|
|
err = sysfs_create_group(*hugepage_kobj, &khugepaged_attr_group);
|
|
if (err) {
|
|
pr_err("failed to register transparent hugepage group\n");
|
|
goto remove_hp_group;
|
|
}
|
|
|
|
return 0;
|
|
|
|
remove_hp_group:
|
|
sysfs_remove_group(*hugepage_kobj, &hugepage_attr_group);
|
|
delete_obj:
|
|
kobject_put(*hugepage_kobj);
|
|
return err;
|
|
}
|
|
|
|
static void __init hugepage_exit_sysfs(struct kobject *hugepage_kobj)
|
|
{
|
|
sysfs_remove_group(hugepage_kobj, &khugepaged_attr_group);
|
|
sysfs_remove_group(hugepage_kobj, &hugepage_attr_group);
|
|
kobject_put(hugepage_kobj);
|
|
}
|
|
#else
|
|
static inline int hugepage_init_sysfs(struct kobject **hugepage_kobj)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void hugepage_exit_sysfs(struct kobject *hugepage_kobj)
|
|
{
|
|
}
|
|
#endif /* CONFIG_SYSFS */
|
|
|
|
static int __init hugepage_init(void)
|
|
{
|
|
int err;
|
|
struct kobject *hugepage_kobj;
|
|
|
|
if (!has_transparent_hugepage()) {
|
|
transparent_hugepage_flags = 0;
|
|
return -EINVAL;
|
|
}
|
|
|
|
/*
|
|
* hugepages can't be allocated by the buddy allocator
|
|
*/
|
|
MAYBE_BUILD_BUG_ON(HPAGE_PMD_ORDER >= MAX_ORDER);
|
|
/*
|
|
* we use page->mapping and page->index in second tail page
|
|
* as list_head: assuming THP order >= 2
|
|
*/
|
|
MAYBE_BUILD_BUG_ON(HPAGE_PMD_ORDER < 2);
|
|
|
|
err = hugepage_init_sysfs(&hugepage_kobj);
|
|
if (err)
|
|
goto err_sysfs;
|
|
|
|
err = khugepaged_init();
|
|
if (err)
|
|
goto err_slab;
|
|
|
|
err = register_shrinker(&huge_zero_page_shrinker);
|
|
if (err)
|
|
goto err_hzp_shrinker;
|
|
err = register_shrinker(&deferred_split_shrinker);
|
|
if (err)
|
|
goto err_split_shrinker;
|
|
|
|
/*
|
|
* By default disable transparent hugepages on smaller systems,
|
|
* where the extra memory used could hurt more than TLB overhead
|
|
* is likely to save. The admin can still enable it through /sys.
|
|
*/
|
|
if (totalram_pages() < (512 << (20 - PAGE_SHIFT))) {
|
|
transparent_hugepage_flags = 0;
|
|
return 0;
|
|
}
|
|
|
|
err = start_stop_khugepaged();
|
|
if (err)
|
|
goto err_khugepaged;
|
|
|
|
return 0;
|
|
err_khugepaged:
|
|
unregister_shrinker(&deferred_split_shrinker);
|
|
err_split_shrinker:
|
|
unregister_shrinker(&huge_zero_page_shrinker);
|
|
err_hzp_shrinker:
|
|
khugepaged_destroy();
|
|
err_slab:
|
|
hugepage_exit_sysfs(hugepage_kobj);
|
|
err_sysfs:
|
|
return err;
|
|
}
|
|
subsys_initcall(hugepage_init);
|
|
|
|
static int __init setup_transparent_hugepage(char *str)
|
|
{
|
|
int ret = 0;
|
|
if (!str)
|
|
goto out;
|
|
if (!strcmp(str, "always")) {
|
|
set_bit(TRANSPARENT_HUGEPAGE_FLAG,
|
|
&transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
|
|
&transparent_hugepage_flags);
|
|
ret = 1;
|
|
} else if (!strcmp(str, "madvise")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_FLAG,
|
|
&transparent_hugepage_flags);
|
|
set_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
|
|
&transparent_hugepage_flags);
|
|
ret = 1;
|
|
} else if (!strcmp(str, "never")) {
|
|
clear_bit(TRANSPARENT_HUGEPAGE_FLAG,
|
|
&transparent_hugepage_flags);
|
|
clear_bit(TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
|
|
&transparent_hugepage_flags);
|
|
ret = 1;
|
|
}
|
|
out:
|
|
if (!ret)
|
|
pr_warn("transparent_hugepage= cannot parse, ignored\n");
|
|
return ret;
|
|
}
|
|
__setup("transparent_hugepage=", setup_transparent_hugepage);
|
|
|
|
pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma)
|
|
{
|
|
if (likely(vma->vm_flags & VM_WRITE))
|
|
pmd = pmd_mkwrite(pmd);
|
|
return pmd;
|
|
}
|
|
|
|
#ifdef CONFIG_MEMCG
|
|
static inline struct deferred_split *get_deferred_split_queue(struct page *page)
|
|
{
|
|
struct mem_cgroup *memcg = compound_head(page)->mem_cgroup;
|
|
struct pglist_data *pgdat = NODE_DATA(page_to_nid(page));
|
|
|
|
if (memcg)
|
|
return &memcg->deferred_split_queue;
|
|
else
|
|
return &pgdat->deferred_split_queue;
|
|
}
|
|
#else
|
|
static inline struct deferred_split *get_deferred_split_queue(struct page *page)
|
|
{
|
|
struct pglist_data *pgdat = NODE_DATA(page_to_nid(page));
|
|
|
|
return &pgdat->deferred_split_queue;
|
|
}
|
|
#endif
|
|
|
|
void prep_transhuge_page(struct page *page)
|
|
{
|
|
/*
|
|
* we use page->mapping and page->indexlru in second tail page
|
|
* as list_head: assuming THP order >= 2
|
|
*/
|
|
|
|
INIT_LIST_HEAD(page_deferred_list(page));
|
|
set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
|
|
}
|
|
|
|
static unsigned long __thp_get_unmapped_area(struct file *filp,
|
|
unsigned long addr, unsigned long len,
|
|
loff_t off, unsigned long flags, unsigned long size)
|
|
{
|
|
loff_t off_end = off + len;
|
|
loff_t off_align = round_up(off, size);
|
|
unsigned long len_pad, ret;
|
|
|
|
if (off_end <= off_align || (off_end - off_align) < size)
|
|
return 0;
|
|
|
|
len_pad = len + size;
|
|
if (len_pad < len || (off + len_pad) < off)
|
|
return 0;
|
|
|
|
ret = current->mm->get_unmapped_area(filp, addr, len_pad,
|
|
off >> PAGE_SHIFT, flags);
|
|
|
|
/*
|
|
* The failure might be due to length padding. The caller will retry
|
|
* without the padding.
|
|
*/
|
|
if (IS_ERR_VALUE(ret))
|
|
return 0;
|
|
|
|
/*
|
|
* Do not try to align to THP boundary if allocation at the address
|
|
* hint succeeds.
|
|
*/
|
|
if (ret == addr)
|
|
return addr;
|
|
|
|
ret += (off - ret) & (size - 1);
|
|
return ret;
|
|
}
|
|
|
|
unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
|
|
unsigned long len, unsigned long pgoff, unsigned long flags)
|
|
{
|
|
unsigned long ret;
|
|
loff_t off = (loff_t)pgoff << PAGE_SHIFT;
|
|
|
|
if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD))
|
|
goto out;
|
|
|
|
ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE);
|
|
if (ret)
|
|
return ret;
|
|
out:
|
|
return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags);
|
|
}
|
|
EXPORT_SYMBOL_GPL(thp_get_unmapped_area);
|
|
|
|
static vm_fault_t __do_huge_pmd_anonymous_page(struct vm_fault *vmf,
|
|
struct page *page, gfp_t gfp)
|
|
{
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
struct mem_cgroup *memcg;
|
|
pgtable_t pgtable;
|
|
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
|
|
vm_fault_t ret = 0;
|
|
|
|
VM_BUG_ON_PAGE(!PageCompound(page), page);
|
|
|
|
if (mem_cgroup_try_charge_delay(page, vma->vm_mm, gfp, &memcg, true)) {
|
|
put_page(page);
|
|
count_vm_event(THP_FAULT_FALLBACK);
|
|
return VM_FAULT_FALLBACK;
|
|
}
|
|
|
|
pgtable = pte_alloc_one(vma->vm_mm);
|
|
if (unlikely(!pgtable)) {
|
|
ret = VM_FAULT_OOM;
|
|
goto release;
|
|
}
|
|
|
|
clear_huge_page(page, vmf->address, HPAGE_PMD_NR);
|
|
/*
|
|
* The memory barrier inside __SetPageUptodate makes sure that
|
|
* clear_huge_page writes become visible before the set_pmd_at()
|
|
* write.
|
|
*/
|
|
__SetPageUptodate(page);
|
|
|
|
vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd);
|
|
if (unlikely(!pmd_none(*vmf->pmd))) {
|
|
goto unlock_release;
|
|
} else {
|
|
pmd_t entry;
|
|
|
|
ret = check_stable_address_space(vma->vm_mm);
|
|
if (ret)
|
|
goto unlock_release;
|
|
|
|
/* Deliver the page fault to userland */
|
|
if (userfaultfd_missing(vma)) {
|
|
vm_fault_t ret2;
|
|
|
|
spin_unlock(vmf->ptl);
|
|
mem_cgroup_cancel_charge(page, memcg, true);
|
|
put_page(page);
|
|
pte_free(vma->vm_mm, pgtable);
|
|
ret2 = handle_userfault(vmf, VM_UFFD_MISSING);
|
|
VM_BUG_ON(ret2 & VM_FAULT_FALLBACK);
|
|
return ret2;
|
|
}
|
|
|
|
entry = mk_huge_pmd(page, vma->vm_page_prot);
|
|
entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
|
|
page_add_new_anon_rmap(page, vma, haddr, true);
|
|
mem_cgroup_commit_charge(page, memcg, false, true);
|
|
lru_cache_add_active_or_unevictable(page, vma);
|
|
pgtable_trans_huge_deposit(vma->vm_mm, vmf->pmd, pgtable);
|
|
set_pmd_at(vma->vm_mm, haddr, vmf->pmd, entry);
|
|
add_mm_counter(vma->vm_mm, MM_ANONPAGES, HPAGE_PMD_NR);
|
|
mm_inc_nr_ptes(vma->vm_mm);
|
|
spin_unlock(vmf->ptl);
|
|
count_vm_event(THP_FAULT_ALLOC);
|
|
count_memcg_events(memcg, THP_FAULT_ALLOC, 1);
|
|
}
|
|
|
|
return 0;
|
|
unlock_release:
|
|
spin_unlock(vmf->ptl);
|
|
release:
|
|
if (pgtable)
|
|
pte_free(vma->vm_mm, pgtable);
|
|
mem_cgroup_cancel_charge(page, memcg, true);
|
|
put_page(page);
|
|
return ret;
|
|
|
|
}
|
|
|
|
/*
|
|
* always: directly stall for all thp allocations
|
|
* defer: wake kswapd and fail if not immediately available
|
|
* defer+madvise: wake kswapd and directly stall for MADV_HUGEPAGE, otherwise
|
|
* fail if not immediately available
|
|
* madvise: directly stall for MADV_HUGEPAGE, otherwise fail if not immediately
|
|
* available
|
|
* never: never stall for any thp allocation
|
|
*/
|
|
static inline gfp_t alloc_hugepage_direct_gfpmask(struct vm_area_struct *vma)
|
|
{
|
|
const bool vma_madvised = !!(vma->vm_flags & VM_HUGEPAGE);
|
|
|
|
/* Always do synchronous compaction */
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_DIRECT_FLAG, &transparent_hugepage_flags))
|
|
return GFP_TRANSHUGE | (vma_madvised ? 0 : __GFP_NORETRY);
|
|
|
|
/* Kick kcompactd and fail quickly */
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_FLAG, &transparent_hugepage_flags))
|
|
return GFP_TRANSHUGE_LIGHT | __GFP_KSWAPD_RECLAIM;
|
|
|
|
/* Synchronous compaction if madvised, otherwise kick kcompactd */
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG, &transparent_hugepage_flags))
|
|
return GFP_TRANSHUGE_LIGHT |
|
|
(vma_madvised ? __GFP_DIRECT_RECLAIM :
|
|
__GFP_KSWAPD_RECLAIM);
|
|
|
|
/* Only do synchronous compaction if madvised */
|
|
if (test_bit(TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, &transparent_hugepage_flags))
|
|
return GFP_TRANSHUGE_LIGHT |
|
|
(vma_madvised ? __GFP_DIRECT_RECLAIM : 0);
|
|
|
|
return GFP_TRANSHUGE_LIGHT;
|
|
}
|
|
|
|
/* Caller must hold page table lock. */
|
|
static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm,
|
|
struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd,
|
|
struct page *zero_page)
|
|
{
|
|
pmd_t entry;
|
|
if (!pmd_none(*pmd))
|
|
return false;
|
|
entry = mk_pmd(zero_page, vma->vm_page_prot);
|
|
entry = pmd_mkhuge(entry);
|
|
if (pgtable)
|
|
pgtable_trans_huge_deposit(mm, pmd, pgtable);
|
|
set_pmd_at(mm, haddr, pmd, entry);
|
|
mm_inc_nr_ptes(mm);
|
|
return true;
|
|
}
|
|
|
|
vm_fault_t do_huge_pmd_anonymous_page(struct vm_fault *vmf)
|
|
{
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
gfp_t gfp;
|
|
struct page *page;
|
|
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
|
|
|
|
if (!transhuge_vma_suitable(vma, haddr))
|
|
return VM_FAULT_FALLBACK;
|
|
if (unlikely(anon_vma_prepare(vma)))
|
|
return VM_FAULT_OOM;
|
|
if (unlikely(khugepaged_enter(vma, vma->vm_flags)))
|
|
return VM_FAULT_OOM;
|
|
if (!(vmf->flags & FAULT_FLAG_WRITE) &&
|
|
!mm_forbids_zeropage(vma->vm_mm) &&
|
|
transparent_hugepage_use_zero_page()) {
|
|
pgtable_t pgtable;
|
|
struct page *zero_page;
|
|
vm_fault_t ret;
|
|
pgtable = pte_alloc_one(vma->vm_mm);
|
|
if (unlikely(!pgtable))
|
|
return VM_FAULT_OOM;
|
|
zero_page = mm_get_huge_zero_page(vma->vm_mm);
|
|
if (unlikely(!zero_page)) {
|
|
pte_free(vma->vm_mm, pgtable);
|
|
count_vm_event(THP_FAULT_FALLBACK);
|
|
return VM_FAULT_FALLBACK;
|
|
}
|
|
vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd);
|
|
ret = 0;
|
|
if (pmd_none(*vmf->pmd)) {
|
|
ret = check_stable_address_space(vma->vm_mm);
|
|
if (ret) {
|
|
spin_unlock(vmf->ptl);
|
|
pte_free(vma->vm_mm, pgtable);
|
|
} else if (userfaultfd_missing(vma)) {
|
|
spin_unlock(vmf->ptl);
|
|
pte_free(vma->vm_mm, pgtable);
|
|
ret = handle_userfault(vmf, VM_UFFD_MISSING);
|
|
VM_BUG_ON(ret & VM_FAULT_FALLBACK);
|
|
} else {
|
|
set_huge_zero_page(pgtable, vma->vm_mm, vma,
|
|
haddr, vmf->pmd, zero_page);
|
|
spin_unlock(vmf->ptl);
|
|
}
|
|
} else {
|
|
spin_unlock(vmf->ptl);
|
|
pte_free(vma->vm_mm, pgtable);
|
|
}
|
|
return ret;
|
|
}
|
|
gfp = alloc_hugepage_direct_gfpmask(vma);
|
|
page = alloc_hugepage_vma(gfp, vma, haddr, HPAGE_PMD_ORDER);
|
|
if (unlikely(!page)) {
|
|
count_vm_event(THP_FAULT_FALLBACK);
|
|
return VM_FAULT_FALLBACK;
|
|
}
|
|
prep_transhuge_page(page);
|
|
return __do_huge_pmd_anonymous_page(vmf, page, gfp);
|
|
}
|
|
|
|
static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
|
|
pmd_t *pmd, pfn_t pfn, pgprot_t prot, bool write,
|
|
pgtable_t pgtable)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
pmd_t entry;
|
|
spinlock_t *ptl;
|
|
|
|
ptl = pmd_lock(mm, pmd);
|
|
if (!pmd_none(*pmd)) {
|
|
if (write) {
|
|
if (pmd_pfn(*pmd) != pfn_t_to_pfn(pfn)) {
|
|
WARN_ON_ONCE(!is_huge_zero_pmd(*pmd));
|
|
goto out_unlock;
|
|
}
|
|
entry = pmd_mkyoung(*pmd);
|
|
entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
|
|
if (pmdp_set_access_flags(vma, addr, pmd, entry, 1))
|
|
update_mmu_cache_pmd(vma, addr, pmd);
|
|
}
|
|
|
|
goto out_unlock;
|
|
}
|
|
|
|
entry = pmd_mkhuge(pfn_t_pmd(pfn, prot));
|
|
if (pfn_t_devmap(pfn))
|
|
entry = pmd_mkdevmap(entry);
|
|
if (write) {
|
|
entry = pmd_mkyoung(pmd_mkdirty(entry));
|
|
entry = maybe_pmd_mkwrite(entry, vma);
|
|
}
|
|
|
|
if (pgtable) {
|
|
pgtable_trans_huge_deposit(mm, pmd, pgtable);
|
|
mm_inc_nr_ptes(mm);
|
|
pgtable = NULL;
|
|
}
|
|
|
|
set_pmd_at(mm, addr, pmd, entry);
|
|
update_mmu_cache_pmd(vma, addr, pmd);
|
|
|
|
out_unlock:
|
|
spin_unlock(ptl);
|
|
if (pgtable)
|
|
pte_free(mm, pgtable);
|
|
}
|
|
|
|
vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write)
|
|
{
|
|
unsigned long addr = vmf->address & PMD_MASK;
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
pgprot_t pgprot = vma->vm_page_prot;
|
|
pgtable_t pgtable = NULL;
|
|
|
|
/*
|
|
* If we had pmd_special, we could avoid all these restrictions,
|
|
* but we need to be consistent with PTEs and architectures that
|
|
* can't support a 'special' bit.
|
|
*/
|
|
BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) &&
|
|
!pfn_t_devmap(pfn));
|
|
BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) ==
|
|
(VM_PFNMAP|VM_MIXEDMAP));
|
|
BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags));
|
|
|
|
if (addr < vma->vm_start || addr >= vma->vm_end)
|
|
return VM_FAULT_SIGBUS;
|
|
|
|
if (arch_needs_pgtable_deposit()) {
|
|
pgtable = pte_alloc_one(vma->vm_mm);
|
|
if (!pgtable)
|
|
return VM_FAULT_OOM;
|
|
}
|
|
|
|
track_pfn_insert(vma, &pgprot, pfn);
|
|
|
|
insert_pfn_pmd(vma, addr, vmf->pmd, pfn, pgprot, write, pgtable);
|
|
return VM_FAULT_NOPAGE;
|
|
}
|
|
EXPORT_SYMBOL_GPL(vmf_insert_pfn_pmd);
|
|
|
|
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
|
|
static pud_t maybe_pud_mkwrite(pud_t pud, struct vm_area_struct *vma)
|
|
{
|
|
if (likely(vma->vm_flags & VM_WRITE))
|
|
pud = pud_mkwrite(pud);
|
|
return pud;
|
|
}
|
|
|
|
static void insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
|
|
pud_t *pud, pfn_t pfn, pgprot_t prot, bool write)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
pud_t entry;
|
|
spinlock_t *ptl;
|
|
|
|
ptl = pud_lock(mm, pud);
|
|
if (!pud_none(*pud)) {
|
|
if (write) {
|
|
if (pud_pfn(*pud) != pfn_t_to_pfn(pfn)) {
|
|
WARN_ON_ONCE(!is_huge_zero_pud(*pud));
|
|
goto out_unlock;
|
|
}
|
|
entry = pud_mkyoung(*pud);
|
|
entry = maybe_pud_mkwrite(pud_mkdirty(entry), vma);
|
|
if (pudp_set_access_flags(vma, addr, pud, entry, 1))
|
|
update_mmu_cache_pud(vma, addr, pud);
|
|
}
|
|
goto out_unlock;
|
|
}
|
|
|
|
entry = pud_mkhuge(pfn_t_pud(pfn, prot));
|
|
if (pfn_t_devmap(pfn))
|
|
entry = pud_mkdevmap(entry);
|
|
if (write) {
|
|
entry = pud_mkyoung(pud_mkdirty(entry));
|
|
entry = maybe_pud_mkwrite(entry, vma);
|
|
}
|
|
set_pud_at(mm, addr, pud, entry);
|
|
update_mmu_cache_pud(vma, addr, pud);
|
|
|
|
out_unlock:
|
|
spin_unlock(ptl);
|
|
}
|
|
|
|
vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write)
|
|
{
|
|
unsigned long addr = vmf->address & PUD_MASK;
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
pgprot_t pgprot = vma->vm_page_prot;
|
|
|
|
/*
|
|
* If we had pud_special, we could avoid all these restrictions,
|
|
* but we need to be consistent with PTEs and architectures that
|
|
* can't support a 'special' bit.
|
|
*/
|
|
BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) &&
|
|
!pfn_t_devmap(pfn));
|
|
BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) ==
|
|
(VM_PFNMAP|VM_MIXEDMAP));
|
|
BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags));
|
|
|
|
if (addr < vma->vm_start || addr >= vma->vm_end)
|
|
return VM_FAULT_SIGBUS;
|
|
|
|
track_pfn_insert(vma, &pgprot, pfn);
|
|
|
|
insert_pfn_pud(vma, addr, vmf->pud, pfn, pgprot, write);
|
|
return VM_FAULT_NOPAGE;
|
|
}
|
|
EXPORT_SYMBOL_GPL(vmf_insert_pfn_pud);
|
|
#endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
|
|
|
|
static void touch_pmd(struct vm_area_struct *vma, unsigned long addr,
|
|
pmd_t *pmd, int flags)
|
|
{
|
|
pmd_t _pmd;
|
|
|
|
_pmd = pmd_mkyoung(*pmd);
|
|
if (flags & FOLL_WRITE)
|
|
_pmd = pmd_mkdirty(_pmd);
|
|
if (pmdp_set_access_flags(vma, addr & HPAGE_PMD_MASK,
|
|
pmd, _pmd, flags & FOLL_WRITE))
|
|
update_mmu_cache_pmd(vma, addr, pmd);
|
|
}
|
|
|
|
struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long addr,
|
|
pmd_t *pmd, int flags, struct dev_pagemap **pgmap)
|
|
{
|
|
unsigned long pfn = pmd_pfn(*pmd);
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
struct page *page;
|
|
|
|
assert_spin_locked(pmd_lockptr(mm, pmd));
|
|
|
|
/*
|
|
* When we COW a devmap PMD entry, we split it into PTEs, so we should
|
|
* not be in this function with `flags & FOLL_COW` set.
|
|
*/
|
|
WARN_ONCE(flags & FOLL_COW, "mm: In follow_devmap_pmd with FOLL_COW set");
|
|
|
|
if (flags & FOLL_WRITE && !pmd_write(*pmd))
|
|
return NULL;
|
|
|
|
if (pmd_present(*pmd) && pmd_devmap(*pmd))
|
|
/* pass */;
|
|
else
|
|
return NULL;
|
|
|
|
if (flags & FOLL_TOUCH)
|
|
touch_pmd(vma, addr, pmd, flags);
|
|
|
|
/*
|
|
* device mapped pages can only be returned if the
|
|
* caller will manage the page reference count.
|
|
*/
|
|
if (!(flags & FOLL_GET))
|
|
return ERR_PTR(-EEXIST);
|
|
|
|
pfn += (addr & ~PMD_MASK) >> PAGE_SHIFT;
|
|
*pgmap = get_dev_pagemap(pfn, *pgmap);
|
|
if (!*pgmap)
|
|
return ERR_PTR(-EFAULT);
|
|
page = pfn_to_page(pfn);
|
|
get_page(page);
|
|
|
|
return page;
|
|
}
|
|
|
|
int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
|
|
pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
|
|
struct vm_area_struct *vma)
|
|
{
|
|
spinlock_t *dst_ptl, *src_ptl;
|
|
struct page *src_page;
|
|
pmd_t pmd;
|
|
pgtable_t pgtable = NULL;
|
|
int ret = -ENOMEM;
|
|
|
|
/* Skip if can be re-fill on fault */
|
|
if (!vma_is_anonymous(vma))
|
|
return 0;
|
|
|
|
pgtable = pte_alloc_one(dst_mm);
|
|
if (unlikely(!pgtable))
|
|
goto out;
|
|
|
|
dst_ptl = pmd_lock(dst_mm, dst_pmd);
|
|
src_ptl = pmd_lockptr(src_mm, src_pmd);
|
|
spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
|
|
|
|
ret = -EAGAIN;
|
|
pmd = *src_pmd;
|
|
|
|
#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
|
|
if (unlikely(is_swap_pmd(pmd))) {
|
|
swp_entry_t entry = pmd_to_swp_entry(pmd);
|
|
|
|
VM_BUG_ON(!is_pmd_migration_entry(pmd));
|
|
if (is_write_migration_entry(entry)) {
|
|
make_migration_entry_read(&entry);
|
|
pmd = swp_entry_to_pmd(entry);
|
|
if (pmd_swp_soft_dirty(*src_pmd))
|
|
pmd = pmd_swp_mksoft_dirty(pmd);
|
|
set_pmd_at(src_mm, addr, src_pmd, pmd);
|
|
}
|
|
add_mm_counter(dst_mm, MM_ANONPAGES, HPAGE_PMD_NR);
|
|
mm_inc_nr_ptes(dst_mm);
|
|
pgtable_trans_huge_deposit(dst_mm, dst_pmd, pgtable);
|
|
set_pmd_at(dst_mm, addr, dst_pmd, pmd);
|
|
ret = 0;
|
|
goto out_unlock;
|
|
}
|
|
#endif
|
|
|
|
if (unlikely(!pmd_trans_huge(pmd))) {
|
|
pte_free(dst_mm, pgtable);
|
|
goto out_unlock;
|
|
}
|
|
/*
|
|
* When page table lock is held, the huge zero pmd should not be
|
|
* under splitting since we don't split the page itself, only pmd to
|
|
* a page table.
|
|
*/
|
|
if (is_huge_zero_pmd(pmd)) {
|
|
struct page *zero_page;
|
|
/*
|
|
* get_huge_zero_page() will never allocate a new page here,
|
|
* since we already have a zero page to copy. It just takes a
|
|
* reference.
|
|
*/
|
|
zero_page = mm_get_huge_zero_page(dst_mm);
|
|
set_huge_zero_page(pgtable, dst_mm, vma, addr, dst_pmd,
|
|
zero_page);
|
|
ret = 0;
|
|
goto out_unlock;
|
|
}
|
|
|
|
src_page = pmd_page(pmd);
|
|
VM_BUG_ON_PAGE(!PageHead(src_page), src_page);
|
|
get_page(src_page);
|
|
page_dup_rmap(src_page, true);
|
|
add_mm_counter(dst_mm, MM_ANONPAGES, HPAGE_PMD_NR);
|
|
mm_inc_nr_ptes(dst_mm);
|
|
pgtable_trans_huge_deposit(dst_mm, dst_pmd, pgtable);
|
|
|
|
pmdp_set_wrprotect(src_mm, addr, src_pmd);
|
|
pmd = pmd_mkold(pmd_wrprotect(pmd));
|
|
set_pmd_at(dst_mm, addr, dst_pmd, pmd);
|
|
|
|
ret = 0;
|
|
out_unlock:
|
|
spin_unlock(src_ptl);
|
|
spin_unlock(dst_ptl);
|
|
out:
|
|
return ret;
|
|
}
|
|
|
|
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
|
|
static void touch_pud(struct vm_area_struct *vma, unsigned long addr,
|
|
pud_t *pud, int flags)
|
|
{
|
|
pud_t _pud;
|
|
|
|
_pud = pud_mkyoung(*pud);
|
|
if (flags & FOLL_WRITE)
|
|
_pud = pud_mkdirty(_pud);
|
|
if (pudp_set_access_flags(vma, addr & HPAGE_PUD_MASK,
|
|
pud, _pud, flags & FOLL_WRITE))
|
|
update_mmu_cache_pud(vma, addr, pud);
|
|
}
|
|
|
|
struct page *follow_devmap_pud(struct vm_area_struct *vma, unsigned long addr,
|
|
pud_t *pud, int flags, struct dev_pagemap **pgmap)
|
|
{
|
|
unsigned long pfn = pud_pfn(*pud);
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
struct page *page;
|
|
|
|
assert_spin_locked(pud_lockptr(mm, pud));
|
|
|
|
if (flags & FOLL_WRITE && !pud_write(*pud))
|
|
return NULL;
|
|
|
|
if (pud_present(*pud) && pud_devmap(*pud))
|
|
/* pass */;
|
|
else
|
|
return NULL;
|
|
|
|
if (flags & FOLL_TOUCH)
|
|
touch_pud(vma, addr, pud, flags);
|
|
|
|
/*
|
|
* device mapped pages can only be returned if the
|
|
* caller will manage the page reference count.
|
|
*/
|
|
if (!(flags & FOLL_GET))
|
|
return ERR_PTR(-EEXIST);
|
|
|
|
pfn += (addr & ~PUD_MASK) >> PAGE_SHIFT;
|
|
*pgmap = get_dev_pagemap(pfn, *pgmap);
|
|
if (!*pgmap)
|
|
return ERR_PTR(-EFAULT);
|
|
page = pfn_to_page(pfn);
|
|
get_page(page);
|
|
|
|
return page;
|
|
}
|
|
|
|
int copy_huge_pud(struct mm_struct *dst_mm, struct mm_struct *src_mm,
|
|
pud_t *dst_pud, pud_t *src_pud, unsigned long addr,
|
|
struct vm_area_struct *vma)
|
|
{
|
|
spinlock_t *dst_ptl, *src_ptl;
|
|
pud_t pud;
|
|
int ret;
|
|
|
|
dst_ptl = pud_lock(dst_mm, dst_pud);
|
|
src_ptl = pud_lockptr(src_mm, src_pud);
|
|
spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
|
|
|
|
ret = -EAGAIN;
|
|
pud = *src_pud;
|
|
if (unlikely(!pud_trans_huge(pud) && !pud_devmap(pud)))
|
|
goto out_unlock;
|
|
|
|
/*
|
|
* When page table lock is held, the huge zero pud should not be
|
|
* under splitting since we don't split the page itself, only pud to
|
|
* a page table.
|
|
*/
|
|
if (is_huge_zero_pud(pud)) {
|
|
/* No huge zero pud yet */
|
|
}
|
|
|
|
pudp_set_wrprotect(src_mm, addr, src_pud);
|
|
pud = pud_mkold(pud_wrprotect(pud));
|
|
set_pud_at(dst_mm, addr, dst_pud, pud);
|
|
|
|
ret = 0;
|
|
out_unlock:
|
|
spin_unlock(src_ptl);
|
|
spin_unlock(dst_ptl);
|
|
return ret;
|
|
}
|
|
|
|
void huge_pud_set_accessed(struct vm_fault *vmf, pud_t orig_pud)
|
|
{
|
|
pud_t entry;
|
|
unsigned long haddr;
|
|
bool write = vmf->flags & FAULT_FLAG_WRITE;
|
|
|
|
vmf->ptl = pud_lock(vmf->vma->vm_mm, vmf->pud);
|
|
if (unlikely(!pud_same(*vmf->pud, orig_pud)))
|
|
goto unlock;
|
|
|
|
entry = pud_mkyoung(orig_pud);
|
|
if (write)
|
|
entry = pud_mkdirty(entry);
|
|
haddr = vmf->address & HPAGE_PUD_MASK;
|
|
if (pudp_set_access_flags(vmf->vma, haddr, vmf->pud, entry, write))
|
|
update_mmu_cache_pud(vmf->vma, vmf->address, vmf->pud);
|
|
|
|
unlock:
|
|
spin_unlock(vmf->ptl);
|
|
}
|
|
#endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
|
|
|
|
void huge_pmd_set_accessed(struct vm_fault *vmf, pmd_t orig_pmd)
|
|
{
|
|
pmd_t entry;
|
|
unsigned long haddr;
|
|
bool write = vmf->flags & FAULT_FLAG_WRITE;
|
|
|
|
vmf->ptl = pmd_lock(vmf->vma->vm_mm, vmf->pmd);
|
|
if (unlikely(!pmd_same(*vmf->pmd, orig_pmd)))
|
|
goto unlock;
|
|
|
|
entry = pmd_mkyoung(orig_pmd);
|
|
if (write)
|
|
entry = pmd_mkdirty(entry);
|
|
haddr = vmf->address & HPAGE_PMD_MASK;
|
|
if (pmdp_set_access_flags(vmf->vma, haddr, vmf->pmd, entry, write))
|
|
update_mmu_cache_pmd(vmf->vma, vmf->address, vmf->pmd);
|
|
|
|
unlock:
|
|
spin_unlock(vmf->ptl);
|
|
}
|
|
|
|
static vm_fault_t do_huge_pmd_wp_page_fallback(struct vm_fault *vmf,
|
|
pmd_t orig_pmd, struct page *page)
|
|
{
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
|
|
struct mem_cgroup *memcg;
|
|
pgtable_t pgtable;
|
|
pmd_t _pmd;
|
|
int i;
|
|
vm_fault_t ret = 0;
|
|
struct page **pages;
|
|
struct mmu_notifier_range range;
|
|
|
|
pages = kmalloc_array(HPAGE_PMD_NR, sizeof(struct page *),
|
|
GFP_KERNEL);
|
|
if (unlikely(!pages)) {
|
|
ret |= VM_FAULT_OOM;
|
|
goto out;
|
|
}
|
|
|
|
for (i = 0; i < HPAGE_PMD_NR; i++) {
|
|
pages[i] = alloc_page_vma_node(GFP_HIGHUSER_MOVABLE, vma,
|
|
vmf->address, page_to_nid(page));
|
|
if (unlikely(!pages[i] ||
|
|
mem_cgroup_try_charge_delay(pages[i], vma->vm_mm,
|
|
GFP_KERNEL, &memcg, false))) {
|
|
if (pages[i])
|
|
put_page(pages[i]);
|
|
while (--i >= 0) {
|
|
memcg = (void *)page_private(pages[i]);
|
|
set_page_private(pages[i], 0);
|
|
mem_cgroup_cancel_charge(pages[i], memcg,
|
|
false);
|
|
put_page(pages[i]);
|
|
}
|
|
kfree(pages);
|
|
ret |= VM_FAULT_OOM;
|
|
goto out;
|
|
}
|
|
set_page_private(pages[i], (unsigned long)memcg);
|
|
}
|
|
|
|
for (i = 0; i < HPAGE_PMD_NR; i++) {
|
|
copy_user_highpage(pages[i], page + i,
|
|
haddr + PAGE_SIZE * i, vma);
|
|
__SetPageUptodate(pages[i]);
|
|
cond_resched();
|
|
}
|
|
|
|
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm,
|
|
haddr, haddr + HPAGE_PMD_SIZE);
|
|
mmu_notifier_invalidate_range_start(&range);
|
|
|
|
vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd);
|
|
if (unlikely(!pmd_same(*vmf->pmd, orig_pmd)))
|
|
goto out_free_pages;
|
|
VM_BUG_ON_PAGE(!PageHead(page), page);
|
|
|
|
/*
|
|
* Leave pmd empty until pte is filled note we must notify here as
|
|
* concurrent CPU thread might write to new page before the call to
|
|
* mmu_notifier_invalidate_range_end() happens which can lead to a
|
|
* device seeing memory write in different order than CPU.
|
|
*
|
|
* See Documentation/vm/mmu_notifier.rst
|
|
*/
|
|
pmdp_huge_clear_flush_notify(vma, haddr, vmf->pmd);
|
|
|
|
pgtable = pgtable_trans_huge_withdraw(vma->vm_mm, vmf->pmd);
|
|
pmd_populate(vma->vm_mm, &_pmd, pgtable);
|
|
|
|
for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) {
|
|
pte_t entry;
|
|
entry = mk_pte(pages[i], vmf->vma_page_prot);
|
|
entry = maybe_mkwrite(pte_mkdirty(entry), vmf->vma_flags);
|
|
memcg = (void *)page_private(pages[i]);
|
|
set_page_private(pages[i], 0);
|
|
page_add_new_anon_rmap(pages[i], vmf->vma, haddr, false);
|
|
mem_cgroup_commit_charge(pages[i], memcg, false, false);
|
|
lru_cache_add_active_or_unevictable(pages[i], vma);
|
|
vmf->pte = pte_offset_map(&_pmd, haddr);
|
|
VM_BUG_ON(!pte_none(*vmf->pte));
|
|
set_pte_at(vma->vm_mm, haddr, vmf->pte, entry);
|
|
pte_unmap(vmf->pte);
|
|
}
|
|
kfree(pages);
|
|
|
|
smp_wmb(); /* make pte visible before pmd */
|
|
pmd_populate(vma->vm_mm, vmf->pmd, pgtable);
|
|
page_remove_rmap(page, true);
|
|
spin_unlock(vmf->ptl);
|
|
|
|
/*
|
|
* No need to double call mmu_notifier->invalidate_range() callback as
|
|
* the above pmdp_huge_clear_flush_notify() did already call it.
|
|
*/
|
|
mmu_notifier_invalidate_range_only_end(&range);
|
|
|
|
ret |= VM_FAULT_WRITE;
|
|
put_page(page);
|
|
|
|
out:
|
|
return ret;
|
|
|
|
out_free_pages:
|
|
spin_unlock(vmf->ptl);
|
|
mmu_notifier_invalidate_range_end(&range);
|
|
for (i = 0; i < HPAGE_PMD_NR; i++) {
|
|
memcg = (void *)page_private(pages[i]);
|
|
set_page_private(pages[i], 0);
|
|
mem_cgroup_cancel_charge(pages[i], memcg, false);
|
|
put_page(pages[i]);
|
|
}
|
|
kfree(pages);
|
|
goto out;
|
|
}
|
|
|
|
vm_fault_t do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd)
|
|
{
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
struct page *page = NULL, *new_page;
|
|
struct mem_cgroup *memcg;
|
|
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
|
|
struct mmu_notifier_range range;
|
|
gfp_t huge_gfp; /* for allocation and charge */
|
|
vm_fault_t ret = 0;
|
|
|
|
vmf->ptl = pmd_lockptr(vma->vm_mm, vmf->pmd);
|
|
VM_BUG_ON_VMA(!vma->anon_vma, vma);
|
|
if (is_huge_zero_pmd(orig_pmd))
|
|
goto alloc;
|
|
spin_lock(vmf->ptl);
|
|
if (unlikely(!pmd_same(*vmf->pmd, orig_pmd)))
|
|
goto out_unlock;
|
|
|
|
page = pmd_page(orig_pmd);
|
|
VM_BUG_ON_PAGE(!PageCompound(page) || !PageHead(page), page);
|
|
/*
|
|
* We can only reuse the page if nobody else maps the huge page or it's
|
|
* part.
|
|
*/
|
|
if (!trylock_page(page)) {
|
|
get_page(page);
|
|
spin_unlock(vmf->ptl);
|
|
lock_page(page);
|
|
spin_lock(vmf->ptl);
|
|
if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) {
|
|
unlock_page(page);
|
|
put_page(page);
|
|
goto out_unlock;
|
|
}
|
|
put_page(page);
|
|
}
|
|
if (reuse_swap_page(page, NULL)) {
|
|
pmd_t entry;
|
|
entry = pmd_mkyoung(orig_pmd);
|
|
entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
|
|
if (pmdp_set_access_flags(vma, haddr, vmf->pmd, entry, 1))
|
|
update_mmu_cache_pmd(vma, vmf->address, vmf->pmd);
|
|
ret |= VM_FAULT_WRITE;
|
|
unlock_page(page);
|
|
goto out_unlock;
|
|
}
|
|
unlock_page(page);
|
|
get_page(page);
|
|
spin_unlock(vmf->ptl);
|
|
alloc:
|
|
if (__transparent_hugepage_enabled(vma) &&
|
|
!transparent_hugepage_debug_cow()) {
|
|
huge_gfp = alloc_hugepage_direct_gfpmask(vma);
|
|
new_page = alloc_hugepage_vma(huge_gfp, vma, haddr, HPAGE_PMD_ORDER);
|
|
} else
|
|
new_page = NULL;
|
|
|
|
if (likely(new_page)) {
|
|
prep_transhuge_page(new_page);
|
|
} else {
|
|
if (!page) {
|
|
split_huge_pmd(vma, vmf->pmd, vmf->address);
|
|
ret |= VM_FAULT_FALLBACK;
|
|
} else {
|
|
ret = do_huge_pmd_wp_page_fallback(vmf, orig_pmd, page);
|
|
if (ret & VM_FAULT_OOM) {
|
|
split_huge_pmd(vma, vmf->pmd, vmf->address);
|
|
ret |= VM_FAULT_FALLBACK;
|
|
}
|
|
put_page(page);
|
|
}
|
|
count_vm_event(THP_FAULT_FALLBACK);
|
|
goto out;
|
|
}
|
|
|
|
if (unlikely(mem_cgroup_try_charge_delay(new_page, vma->vm_mm,
|
|
huge_gfp, &memcg, true))) {
|
|
put_page(new_page);
|
|
split_huge_pmd(vma, vmf->pmd, vmf->address);
|
|
if (page)
|
|
put_page(page);
|
|
ret |= VM_FAULT_FALLBACK;
|
|
count_vm_event(THP_FAULT_FALLBACK);
|
|
goto out;
|
|
}
|
|
|
|
count_vm_event(THP_FAULT_ALLOC);
|
|
count_memcg_events(memcg, THP_FAULT_ALLOC, 1);
|
|
|
|
if (!page)
|
|
clear_huge_page(new_page, vmf->address, HPAGE_PMD_NR);
|
|
else
|
|
copy_user_huge_page(new_page, page, vmf->address,
|
|
vma, HPAGE_PMD_NR);
|
|
__SetPageUptodate(new_page);
|
|
|
|
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm,
|
|
haddr, haddr + HPAGE_PMD_SIZE);
|
|
mmu_notifier_invalidate_range_start(&range);
|
|
|
|
spin_lock(vmf->ptl);
|
|
if (page)
|
|
put_page(page);
|
|
if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) {
|
|
spin_unlock(vmf->ptl);
|
|
mem_cgroup_cancel_charge(new_page, memcg, true);
|
|
put_page(new_page);
|
|
goto out_mn;
|
|
} else {
|
|
pmd_t entry;
|
|
entry = mk_huge_pmd(new_page, vma->vm_page_prot);
|
|
entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
|
|
pmdp_huge_clear_flush_notify(vma, haddr, vmf->pmd);
|
|
page_add_new_anon_rmap(new_page, vma, haddr, true);
|
|
mem_cgroup_commit_charge(new_page, memcg, false, true);
|
|
lru_cache_add_active_or_unevictable(new_page, vma);
|
|
set_pmd_at(vma->vm_mm, haddr, vmf->pmd, entry);
|
|
update_mmu_cache_pmd(vma, vmf->address, vmf->pmd);
|
|
if (!page) {
|
|
add_mm_counter(vma->vm_mm, MM_ANONPAGES, HPAGE_PMD_NR);
|
|
} else {
|
|
VM_BUG_ON_PAGE(!PageHead(page), page);
|
|
page_remove_rmap(page, true);
|
|
put_page(page);
|
|
}
|
|
ret |= VM_FAULT_WRITE;
|
|
}
|
|
spin_unlock(vmf->ptl);
|
|
out_mn:
|
|
/*
|
|
* No need to double call mmu_notifier->invalidate_range() callback as
|
|
* the above pmdp_huge_clear_flush_notify() did already call it.
|
|
*/
|
|
mmu_notifier_invalidate_range_only_end(&range);
|
|
out:
|
|
return ret;
|
|
out_unlock:
|
|
spin_unlock(vmf->ptl);
|
|
return ret;
|
|
}
|
|
|
|
/*
|
|
* FOLL_FORCE can write to even unwritable pmd's, but only
|
|
* after we've gone through a COW cycle and they are dirty.
|
|
*/
|
|
static inline bool can_follow_write_pmd(pmd_t pmd, unsigned int flags)
|
|
{
|
|
return pmd_write(pmd) ||
|
|
((flags & FOLL_FORCE) && (flags & FOLL_COW) && pmd_dirty(pmd));
|
|
}
|
|
|
|
struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
|
|
unsigned long addr,
|
|
pmd_t *pmd,
|
|
unsigned int flags)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
struct page *page = NULL;
|
|
|
|
assert_spin_locked(pmd_lockptr(mm, pmd));
|
|
|
|
if (flags & FOLL_WRITE && !can_follow_write_pmd(*pmd, flags))
|
|
goto out;
|
|
|
|
/* Avoid dumping huge zero page */
|
|
if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd))
|
|
return ERR_PTR(-EFAULT);
|
|
|
|
/* Full NUMA hinting faults to serialise migration in fault paths */
|
|
if ((flags & FOLL_NUMA) && pmd_protnone(*pmd))
|
|
goto out;
|
|
|
|
page = pmd_page(*pmd);
|
|
VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page);
|
|
if (flags & FOLL_TOUCH)
|
|
touch_pmd(vma, addr, pmd, flags);
|
|
if ((flags & FOLL_MLOCK) && (vma->vm_flags & VM_LOCKED)) {
|
|
/*
|
|
* We don't mlock() pte-mapped THPs. This way we can avoid
|
|
* leaking mlocked pages into non-VM_LOCKED VMAs.
|
|
*
|
|
* For anon THP:
|
|
*
|
|
* In most cases the pmd is the only mapping of the page as we
|
|
* break COW for the mlock() -- see gup_flags |= FOLL_WRITE for
|
|
* writable private mappings in populate_vma_page_range().
|
|
*
|
|
* The only scenario when we have the page shared here is if we
|
|
* mlocking read-only mapping shared over fork(). We skip
|
|
* mlocking such pages.
|
|
*
|
|
* For file THP:
|
|
*
|
|
* We can expect PageDoubleMap() to be stable under page lock:
|
|
* for file pages we set it in page_add_file_rmap(), which
|
|
* requires page to be locked.
|
|
*/
|
|
|
|
if (PageAnon(page) && compound_mapcount(page) != 1)
|
|
goto skip_mlock;
|
|
if (PageDoubleMap(page) || !page->mapping)
|
|
goto skip_mlock;
|
|
if (!trylock_page(page))
|
|
goto skip_mlock;
|
|
lru_add_drain();
|
|
if (page->mapping && !PageDoubleMap(page))
|
|
mlock_vma_page(page);
|
|
unlock_page(page);
|
|
}
|
|
skip_mlock:
|
|
page += (addr & ~HPAGE_PMD_MASK) >> PAGE_SHIFT;
|
|
VM_BUG_ON_PAGE(!PageCompound(page) && !is_zone_device_page(page), page);
|
|
if (flags & FOLL_GET)
|
|
get_page(page);
|
|
|
|
out:
|
|
return page;
|
|
}
|
|
|
|
/* NUMA hinting page fault entry point for trans huge pmds */
|
|
vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t pmd)
|
|
{
|
|
struct vm_area_struct *vma = vmf->vma;
|
|
struct anon_vma *anon_vma = NULL;
|
|
struct page *page;
|
|
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
|
|
int page_nid = NUMA_NO_NODE, this_nid = numa_node_id();
|
|
int target_nid, last_cpupid = -1;
|
|
bool page_locked;
|
|
bool migrated = false;
|
|
bool was_writable;
|
|
int flags = 0;
|
|
|
|
vmf->ptl = pmd_lock(vma->vm_mm, vmf->pmd);
|
|
if (unlikely(!pmd_same(pmd, *vmf->pmd)))
|
|
goto out_unlock;
|
|
|
|
/*
|
|
* If there are potential migrations, wait for completion and retry
|
|
* without disrupting NUMA hinting information. Do not relock and
|
|
* check_same as the page may no longer be mapped.
|
|
*/
|
|
if (unlikely(pmd_trans_migrating(*vmf->pmd))) {
|
|
page = pmd_page(*vmf->pmd);
|
|
if (!get_page_unless_zero(page))
|
|
goto out_unlock;
|
|
spin_unlock(vmf->ptl);
|
|
put_and_wait_on_page_locked(page);
|
|
goto out;
|
|
}
|
|
|
|
page = pmd_page(pmd);
|
|
BUG_ON(is_huge_zero_page(page));
|
|
page_nid = page_to_nid(page);
|
|
last_cpupid = page_cpupid_last(page);
|
|
count_vm_numa_event(NUMA_HINT_FAULTS);
|
|
if (page_nid == this_nid) {
|
|
count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL);
|
|
flags |= TNF_FAULT_LOCAL;
|
|
}
|
|
|
|
/* See similar comment in do_numa_page for explanation */
|
|
if (!pmd_savedwrite(pmd))
|
|
flags |= TNF_NO_GROUP;
|
|
|
|
/*
|
|
* Acquire the page lock to serialise THP migrations but avoid dropping
|
|
* page_table_lock if at all possible
|
|
*/
|
|
page_locked = trylock_page(page);
|
|
target_nid = mpol_misplaced(page, vma, haddr);
|
|
if (target_nid == NUMA_NO_NODE) {
|
|
/* If the page was locked, there are no parallel migrations */
|
|
if (page_locked)
|
|
goto clear_pmdnuma;
|
|
}
|
|
|
|
/* Migration could have started since the pmd_trans_migrating check */
|
|
if (!page_locked) {
|
|
page_nid = NUMA_NO_NODE;
|
|
if (!get_page_unless_zero(page))
|
|
goto out_unlock;
|
|
spin_unlock(vmf->ptl);
|
|
put_and_wait_on_page_locked(page);
|
|
goto out;
|
|
}
|
|
|
|
/*
|
|
* Page is misplaced. Page lock serialises migrations. Acquire anon_vma
|
|
* to serialises splits
|
|
*/
|
|
get_page(page);
|
|
spin_unlock(vmf->ptl);
|
|
anon_vma = page_lock_anon_vma_read(page);
|
|
|
|
/* Confirm the PMD did not change while page_table_lock was released */
|
|
spin_lock(vmf->ptl);
|
|
if (unlikely(!pmd_same(pmd, *vmf->pmd))) {
|
|
unlock_page(page);
|
|
put_page(page);
|
|
page_nid = NUMA_NO_NODE;
|
|
goto out_unlock;
|
|
}
|
|
|
|
/* Bail if we fail to protect against THP splits for any reason */
|
|
if (unlikely(!anon_vma)) {
|
|
put_page(page);
|
|
page_nid = NUMA_NO_NODE;
|
|
goto clear_pmdnuma;
|
|
}
|
|
|
|
/*
|
|
* Since we took the NUMA fault, we must have observed the !accessible
|
|
* bit. Make sure all other CPUs agree with that, to avoid them
|
|
* modifying the page we're about to migrate.
|
|
*
|
|
* Must be done under PTL such that we'll observe the relevant
|
|
* inc_tlb_flush_pending().
|
|
*
|
|
* We are not sure a pending tlb flush here is for a huge page
|
|
* mapping or not. Hence use the tlb range variant
|
|
*/
|
|
if (mm_tlb_flush_pending(vma->vm_mm)) {
|
|
flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
|
|
/*
|
|
* change_huge_pmd() released the pmd lock before
|
|
* invalidating the secondary MMUs sharing the primary
|
|
* MMU pagetables (with ->invalidate_range()). The
|
|
* mmu_notifier_invalidate_range_end() (which
|
|
* internally calls ->invalidate_range()) in
|
|
* change_pmd_range() will run after us, so we can't
|
|
* rely on it here and we need an explicit invalidate.
|
|
*/
|
|
mmu_notifier_invalidate_range(vma->vm_mm, haddr,
|
|
haddr + HPAGE_PMD_SIZE);
|
|
}
|
|
|
|
/*
|
|
* Migrate the THP to the requested node, returns with page unlocked
|
|
* and access rights restored.
|
|
*/
|
|
spin_unlock(vmf->ptl);
|
|
|
|
migrated = migrate_misplaced_transhuge_page(vma->vm_mm, vma,
|
|
vmf->pmd, pmd, vmf->address, page, target_nid);
|
|
if (migrated) {
|
|
flags |= TNF_MIGRATED;
|
|
page_nid = target_nid;
|
|
} else
|
|
flags |= TNF_MIGRATE_FAIL;
|
|
|
|
goto out;
|
|
clear_pmdnuma:
|
|
BUG_ON(!PageLocked(page));
|
|
was_writable = pmd_savedwrite(pmd);
|
|
pmd = pmd_modify(pmd, vma->vm_page_prot);
|
|
pmd = pmd_mkyoung(pmd);
|
|
if (was_writable)
|
|
pmd = pmd_mkwrite(pmd);
|
|
set_pmd_at(vma->vm_mm, haddr, vmf->pmd, pmd);
|
|
update_mmu_cache_pmd(vma, vmf->address, vmf->pmd);
|
|
unlock_page(page);
|
|
out_unlock:
|
|
spin_unlock(vmf->ptl);
|
|
|
|
out:
|
|
if (anon_vma)
|
|
page_unlock_anon_vma_read(anon_vma);
|
|
|
|
if (page_nid != NUMA_NO_NODE)
|
|
task_numa_fault(last_cpupid, page_nid, HPAGE_PMD_NR,
|
|
flags);
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* Return true if we do MADV_FREE successfully on entire pmd page.
|
|
* Otherwise, return false.
|
|
*/
|
|
bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
|
|
pmd_t *pmd, unsigned long addr, unsigned long next)
|
|
{
|
|
spinlock_t *ptl;
|
|
pmd_t orig_pmd;
|
|
struct page *page;
|
|
struct mm_struct *mm = tlb->mm;
|
|
bool ret = false;
|
|
|
|
tlb_change_page_size(tlb, HPAGE_PMD_SIZE);
|
|
|
|
ptl = pmd_trans_huge_lock(pmd, vma);
|
|
if (!ptl)
|
|
goto out_unlocked;
|
|
|
|
orig_pmd = *pmd;
|
|
if (is_huge_zero_pmd(orig_pmd))
|
|
goto out;
|
|
|
|
if (unlikely(!pmd_present(orig_pmd))) {
|
|
VM_BUG_ON(thp_migration_supported() &&
|
|
!is_pmd_migration_entry(orig_pmd));
|
|
goto out;
|
|
}
|
|
|
|
page = pmd_page(orig_pmd);
|
|
/*
|
|
* If other processes are mapping this page, we couldn't discard
|
|
* the page unless they all do MADV_FREE so let's skip the page.
|
|
*/
|
|
if (total_mapcount(page) != 1)
|
|
goto out;
|
|
|
|
if (!trylock_page(page))
|
|
goto out;
|
|
|
|
/*
|
|
* If user want to discard part-pages of THP, split it so MADV_FREE
|
|
* will deactivate only them.
|
|
*/
|
|
if (next - addr != HPAGE_PMD_SIZE) {
|
|
get_page(page);
|
|
spin_unlock(ptl);
|
|
split_huge_page(page);
|
|
unlock_page(page);
|
|
put_page(page);
|
|
goto out_unlocked;
|
|
}
|
|
|
|
if (PageDirty(page))
|
|
ClearPageDirty(page);
|
|
unlock_page(page);
|
|
|
|
if (pmd_young(orig_pmd) || pmd_dirty(orig_pmd)) {
|
|
pmdp_invalidate(vma, addr, pmd);
|
|
orig_pmd = pmd_mkold(orig_pmd);
|
|
orig_pmd = pmd_mkclean(orig_pmd);
|
|
|
|
set_pmd_at(mm, addr, pmd, orig_pmd);
|
|
tlb_remove_pmd_tlb_entry(tlb, pmd, addr);
|
|
}
|
|
|
|
mark_page_lazyfree(page);
|
|
ret = true;
|
|
out:
|
|
spin_unlock(ptl);
|
|
out_unlocked:
|
|
return ret;
|
|
}
|
|
|
|
static inline void zap_deposited_table(struct mm_struct *mm, pmd_t *pmd)
|
|
{
|
|
pgtable_t pgtable;
|
|
|
|
pgtable = pgtable_trans_huge_withdraw(mm, pmd);
|
|
pte_free(mm, pgtable);
|
|
mm_dec_nr_ptes(mm);
|
|
}
|
|
|
|
int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
|
|
pmd_t *pmd, unsigned long addr)
|
|
{
|
|
pmd_t orig_pmd;
|
|
spinlock_t *ptl;
|
|
|
|
tlb_change_page_size(tlb, HPAGE_PMD_SIZE);
|
|
|
|
ptl = __pmd_trans_huge_lock(pmd, vma);
|
|
if (!ptl)
|
|
return 0;
|
|
/*
|
|
* For architectures like ppc64 we look at deposited pgtable
|
|
* when calling pmdp_huge_get_and_clear. So do the
|
|
* pgtable_trans_huge_withdraw after finishing pmdp related
|
|
* operations.
|
|
*/
|
|
orig_pmd = pmdp_huge_get_and_clear_full(tlb->mm, addr, pmd,
|
|
tlb->fullmm);
|
|
tlb_remove_pmd_tlb_entry(tlb, pmd, addr);
|
|
if (vma_is_dax(vma)) {
|
|
if (arch_needs_pgtable_deposit())
|
|
zap_deposited_table(tlb->mm, pmd);
|
|
spin_unlock(ptl);
|
|
if (is_huge_zero_pmd(orig_pmd))
|
|
tlb_remove_page_size(tlb, pmd_page(orig_pmd), HPAGE_PMD_SIZE);
|
|
} else if (is_huge_zero_pmd(orig_pmd)) {
|
|
zap_deposited_table(tlb->mm, pmd);
|
|
spin_unlock(ptl);
|
|
tlb_remove_page_size(tlb, pmd_page(orig_pmd), HPAGE_PMD_SIZE);
|
|
} else {
|
|
struct page *page = NULL;
|
|
int flush_needed = 1;
|
|
|
|
if (pmd_present(orig_pmd)) {
|
|
page = pmd_page(orig_pmd);
|
|
page_remove_rmap(page, true);
|
|
VM_BUG_ON_PAGE(page_mapcount(page) < 0, page);
|
|
VM_BUG_ON_PAGE(!PageHead(page), page);
|
|
} else if (thp_migration_supported()) {
|
|
swp_entry_t entry;
|
|
|
|
VM_BUG_ON(!is_pmd_migration_entry(orig_pmd));
|
|
entry = pmd_to_swp_entry(orig_pmd);
|
|
page = pfn_to_page(swp_offset(entry));
|
|
flush_needed = 0;
|
|
} else
|
|
WARN_ONCE(1, "Non present huge pmd without pmd migration enabled!");
|
|
|
|
if (PageAnon(page)) {
|
|
zap_deposited_table(tlb->mm, pmd);
|
|
add_mm_counter(tlb->mm, MM_ANONPAGES, -HPAGE_PMD_NR);
|
|
} else {
|
|
if (arch_needs_pgtable_deposit())
|
|
zap_deposited_table(tlb->mm, pmd);
|
|
add_mm_counter(tlb->mm, mm_counter_file(page), -HPAGE_PMD_NR);
|
|
}
|
|
|
|
spin_unlock(ptl);
|
|
if (flush_needed)
|
|
tlb_remove_page_size(tlb, page, HPAGE_PMD_SIZE);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
#ifndef pmd_move_must_withdraw
|
|
static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
|
|
spinlock_t *old_pmd_ptl,
|
|
struct vm_area_struct *vma)
|
|
{
|
|
/*
|
|
* With split pmd lock we also need to move preallocated
|
|
* PTE page table if new_pmd is on different PMD page table.
|
|
*
|
|
* We also don't deposit and withdraw tables for file pages.
|
|
*/
|
|
return (new_pmd_ptl != old_pmd_ptl) && vma_is_anonymous(vma);
|
|
}
|
|
#endif
|
|
|
|
static pmd_t move_soft_dirty_pmd(pmd_t pmd)
|
|
{
|
|
#ifdef CONFIG_MEM_SOFT_DIRTY
|
|
if (unlikely(is_pmd_migration_entry(pmd)))
|
|
pmd = pmd_swp_mksoft_dirty(pmd);
|
|
else if (pmd_present(pmd))
|
|
pmd = pmd_mksoft_dirty(pmd);
|
|
#endif
|
|
return pmd;
|
|
}
|
|
|
|
bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
|
|
unsigned long new_addr, unsigned long old_end,
|
|
pmd_t *old_pmd, pmd_t *new_pmd)
|
|
{
|
|
spinlock_t *old_ptl, *new_ptl;
|
|
pmd_t pmd;
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
bool force_flush = false;
|
|
|
|
if ((old_addr & ~HPAGE_PMD_MASK) ||
|
|
(new_addr & ~HPAGE_PMD_MASK) ||
|
|
old_end - old_addr < HPAGE_PMD_SIZE)
|
|
return false;
|
|
|
|
/*
|
|
* The destination pmd shouldn't be established, free_pgtables()
|
|
* should have release it.
|
|
*/
|
|
if (WARN_ON(!pmd_none(*new_pmd))) {
|
|
VM_BUG_ON(pmd_trans_huge(*new_pmd));
|
|
return false;
|
|
}
|
|
|
|
/*
|
|
* We don't have to worry about the ordering of src and dst
|
|
* ptlocks because exclusive mmap_sem prevents deadlock.
|
|
*/
|
|
old_ptl = __pmd_trans_huge_lock(old_pmd, vma);
|
|
if (old_ptl) {
|
|
new_ptl = pmd_lockptr(mm, new_pmd);
|
|
if (new_ptl != old_ptl)
|
|
spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
|
|
pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd);
|
|
if (pmd_present(pmd))
|
|
force_flush = true;
|
|
VM_BUG_ON(!pmd_none(*new_pmd));
|
|
|
|
if (pmd_move_must_withdraw(new_ptl, old_ptl, vma)) {
|
|
pgtable_t pgtable;
|
|
pgtable = pgtable_trans_huge_withdraw(mm, old_pmd);
|
|
pgtable_trans_huge_deposit(mm, new_pmd, pgtable);
|
|
}
|
|
pmd = move_soft_dirty_pmd(pmd);
|
|
set_pmd_at(mm, new_addr, new_pmd, pmd);
|
|
if (force_flush)
|
|
flush_tlb_range(vma, old_addr, old_addr + PMD_SIZE);
|
|
if (new_ptl != old_ptl)
|
|
spin_unlock(new_ptl);
|
|
spin_unlock(old_ptl);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/*
|
|
* Returns
|
|
* - 0 if PMD could not be locked
|
|
* - 1 if PMD was locked but protections unchange and TLB flush unnecessary
|
|
* - HPAGE_PMD_NR is protections changed and TLB flush necessary
|
|
*/
|
|
int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
|
unsigned long addr, pgprot_t newprot, int prot_numa)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
spinlock_t *ptl;
|
|
pmd_t entry;
|
|
bool preserve_write;
|
|
int ret;
|
|
|
|
ptl = __pmd_trans_huge_lock(pmd, vma);
|
|
if (!ptl)
|
|
return 0;
|
|
|
|
preserve_write = prot_numa && pmd_write(*pmd);
|
|
ret = 1;
|
|
|
|
#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
|
|
if (is_swap_pmd(*pmd)) {
|
|
swp_entry_t entry = pmd_to_swp_entry(*pmd);
|
|
|
|
VM_BUG_ON(!is_pmd_migration_entry(*pmd));
|
|
if (is_write_migration_entry(entry)) {
|
|
pmd_t newpmd;
|
|
/*
|
|
* A protection check is difficult so
|
|
* just be safe and disable write
|
|
*/
|
|
make_migration_entry_read(&entry);
|
|
newpmd = swp_entry_to_pmd(entry);
|
|
if (pmd_swp_soft_dirty(*pmd))
|
|
newpmd = pmd_swp_mksoft_dirty(newpmd);
|
|
set_pmd_at(mm, addr, pmd, newpmd);
|
|
}
|
|
goto unlock;
|
|
}
|
|
#endif
|
|
|
|
/*
|
|
* Avoid trapping faults against the zero page. The read-only
|
|
* data is likely to be read-cached on the local CPU and
|
|
* local/remote hits to the zero page are not interesting.
|
|
*/
|
|
if (prot_numa && is_huge_zero_pmd(*pmd))
|
|
goto unlock;
|
|
|
|
if (prot_numa && pmd_protnone(*pmd))
|
|
goto unlock;
|
|
|
|
/*
|
|
* In case prot_numa, we are under down_read(mmap_sem). It's critical
|
|
* to not clear pmd intermittently to avoid race with MADV_DONTNEED
|
|
* which is also under down_read(mmap_sem):
|
|
*
|
|
* CPU0: CPU1:
|
|
* change_huge_pmd(prot_numa=1)
|
|
* pmdp_huge_get_and_clear_notify()
|
|
* madvise_dontneed()
|
|
* zap_pmd_range()
|
|
* pmd_trans_huge(*pmd) == 0 (without ptl)
|
|
* // skip the pmd
|
|
* set_pmd_at();
|
|
* // pmd is re-established
|
|
*
|
|
* The race makes MADV_DONTNEED miss the huge pmd and don't clear it
|
|
* which may break userspace.
|
|
*
|
|
* pmdp_invalidate() is required to make sure we don't miss
|
|
* dirty/young flags set by hardware.
|
|
*/
|
|
entry = pmdp_invalidate(vma, addr, pmd);
|
|
|
|
entry = pmd_modify(entry, newprot);
|
|
if (preserve_write)
|
|
entry = pmd_mk_savedwrite(entry);
|
|
ret = HPAGE_PMD_NR;
|
|
set_pmd_at(mm, addr, pmd, entry);
|
|
BUG_ON(vma_is_anonymous(vma) && !preserve_write && pmd_write(entry));
|
|
unlock:
|
|
spin_unlock(ptl);
|
|
return ret;
|
|
}
|
|
|
|
/*
|
|
* Returns page table lock pointer if a given pmd maps a thp, NULL otherwise.
|
|
*
|
|
* Note that if it returns page table lock pointer, this routine returns without
|
|
* unlocking page table lock. So callers must unlock it.
|
|
*/
|
|
spinlock_t *__pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma)
|
|
{
|
|
spinlock_t *ptl;
|
|
ptl = pmd_lock(vma->vm_mm, pmd);
|
|
if (likely(is_swap_pmd(*pmd) || pmd_trans_huge(*pmd) ||
|
|
pmd_devmap(*pmd)))
|
|
return ptl;
|
|
spin_unlock(ptl);
|
|
return NULL;
|
|
}
|
|
|
|
/*
|
|
* Returns true if a given pud maps a thp, false otherwise.
|
|
*
|
|
* Note that if it returns true, this routine returns without unlocking page
|
|
* table lock. So callers must unlock it.
|
|
*/
|
|
spinlock_t *__pud_trans_huge_lock(pud_t *pud, struct vm_area_struct *vma)
|
|
{
|
|
spinlock_t *ptl;
|
|
|
|
ptl = pud_lock(vma->vm_mm, pud);
|
|
if (likely(pud_trans_huge(*pud) || pud_devmap(*pud)))
|
|
return ptl;
|
|
spin_unlock(ptl);
|
|
return NULL;
|
|
}
|
|
|
|
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
|
|
int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma,
|
|
pud_t *pud, unsigned long addr)
|
|
{
|
|
spinlock_t *ptl;
|
|
|
|
ptl = __pud_trans_huge_lock(pud, vma);
|
|
if (!ptl)
|
|
return 0;
|
|
/*
|
|
* For architectures like ppc64 we look at deposited pgtable
|
|
* when calling pudp_huge_get_and_clear. So do the
|
|
* pgtable_trans_huge_withdraw after finishing pudp related
|
|
* operations.
|
|
*/
|
|
pudp_huge_get_and_clear_full(tlb->mm, addr, pud, tlb->fullmm);
|
|
tlb_remove_pud_tlb_entry(tlb, pud, addr);
|
|
if (vma_is_dax(vma)) {
|
|
spin_unlock(ptl);
|
|
/* No zero page support yet */
|
|
} else {
|
|
/* No support for anonymous PUD pages yet */
|
|
BUG();
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
static void __split_huge_pud_locked(struct vm_area_struct *vma, pud_t *pud,
|
|
unsigned long haddr)
|
|
{
|
|
VM_BUG_ON(haddr & ~HPAGE_PUD_MASK);
|
|
VM_BUG_ON_VMA(vma->vm_start > haddr, vma);
|
|
VM_BUG_ON_VMA(vma->vm_end < haddr + HPAGE_PUD_SIZE, vma);
|
|
VM_BUG_ON(!pud_trans_huge(*pud) && !pud_devmap(*pud));
|
|
|
|
count_vm_event(THP_SPLIT_PUD);
|
|
|
|
pudp_huge_clear_flush_notify(vma, haddr, pud);
|
|
}
|
|
|
|
void __split_huge_pud(struct vm_area_struct *vma, pud_t *pud,
|
|
unsigned long address)
|
|
{
|
|
spinlock_t *ptl;
|
|
struct mmu_notifier_range range;
|
|
|
|
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm,
|
|
address & HPAGE_PUD_MASK,
|
|
(address & HPAGE_PUD_MASK) + HPAGE_PUD_SIZE);
|
|
mmu_notifier_invalidate_range_start(&range);
|
|
ptl = pud_lock(vma->vm_mm, pud);
|
|
if (unlikely(!pud_trans_huge(*pud) && !pud_devmap(*pud)))
|
|
goto out;
|
|
__split_huge_pud_locked(vma, pud, range.start);
|
|
|
|
out:
|
|
spin_unlock(ptl);
|
|
/*
|
|
* No need to double call mmu_notifier->invalidate_range() callback as
|
|
* the above pudp_huge_clear_flush_notify() did already call it.
|
|
*/
|
|
mmu_notifier_invalidate_range_only_end(&range);
|
|
}
|
|
#endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
|
|
|
|
static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
|
|
unsigned long haddr, pmd_t *pmd)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
pgtable_t pgtable;
|
|
pmd_t _pmd;
|
|
int i;
|
|
|
|
/*
|
|
* Leave pmd empty until pte is filled note that it is fine to delay
|
|
* notification until mmu_notifier_invalidate_range_end() as we are
|
|
* replacing a zero pmd write protected page with a zero pte write
|
|
* protected page.
|
|
*
|
|
* See Documentation/vm/mmu_notifier.rst
|
|
*/
|
|
pmdp_huge_clear_flush(vma, haddr, pmd);
|
|
|
|
pgtable = pgtable_trans_huge_withdraw(mm, pmd);
|
|
pmd_populate(mm, &_pmd, pgtable);
|
|
|
|
for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) {
|
|
pte_t *pte, entry;
|
|
entry = pfn_pte(my_zero_pfn(haddr), vma->vm_page_prot);
|
|
entry = pte_mkspecial(entry);
|
|
pte = pte_offset_map(&_pmd, haddr);
|
|
VM_BUG_ON(!pte_none(*pte));
|
|
set_pte_at(mm, haddr, pte, entry);
|
|
pte_unmap(pte);
|
|
}
|
|
smp_wmb(); /* make pte visible before pmd */
|
|
pmd_populate(mm, pmd, pgtable);
|
|
}
|
|
|
|
static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
|
|
unsigned long haddr, bool freeze)
|
|
{
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
struct page *page;
|
|
pgtable_t pgtable;
|
|
pmd_t old_pmd, _pmd;
|
|
bool young, write, soft_dirty, pmd_migration = false;
|
|
unsigned long addr;
|
|
int i;
|
|
|
|
VM_BUG_ON(haddr & ~HPAGE_PMD_MASK);
|
|
VM_BUG_ON_VMA(vma->vm_start > haddr, vma);
|
|
VM_BUG_ON_VMA(vma->vm_end < haddr + HPAGE_PMD_SIZE, vma);
|
|
VM_BUG_ON(!is_pmd_migration_entry(*pmd) && !pmd_trans_huge(*pmd)
|
|
&& !pmd_devmap(*pmd));
|
|
|
|
count_vm_event(THP_SPLIT_PMD);
|
|
|
|
if (!vma_is_anonymous(vma)) {
|
|
old_pmd = pmdp_huge_clear_flush_notify(vma, haddr, pmd);
|
|
/*
|
|
* We are going to unmap this huge page. So
|
|
* just go ahead and zap it
|
|
*/
|
|
if (arch_needs_pgtable_deposit())
|
|
zap_deposited_table(mm, pmd);
|
|
if (vma_is_dax(vma))
|
|
return;
|
|
if (unlikely(is_pmd_migration_entry(old_pmd))) {
|
|
swp_entry_t entry;
|
|
|
|
entry = pmd_to_swp_entry(old_pmd);
|
|
page = migration_entry_to_page(entry);
|
|
} else {
|
|
page = pmd_page(old_pmd);
|
|
if (!PageDirty(page) && pmd_dirty(old_pmd))
|
|
set_page_dirty(page);
|
|
if (!PageReferenced(page) && pmd_young(old_pmd))
|
|
SetPageReferenced(page);
|
|
page_remove_rmap(page, true);
|
|
put_page(page);
|
|
}
|
|
add_mm_counter(mm, mm_counter_file(page), -HPAGE_PMD_NR);
|
|
return;
|
|
}
|
|
|
|
if (is_huge_zero_pmd(*pmd)) {
|
|
/*
|
|
* FIXME: Do we want to invalidate secondary mmu by calling
|
|
* mmu_notifier_invalidate_range() see comments below inside
|
|
* __split_huge_pmd() ?
|
|
*
|
|
* We are going from a zero huge page write protected to zero
|
|
* small page also write protected so it does not seems useful
|
|
* to invalidate secondary mmu at this time.
|
|
*/
|
|
return __split_huge_zero_page_pmd(vma, haddr, pmd);
|
|
}
|
|
|
|
/*
|
|
* Up to this point the pmd is present and huge and userland has the
|
|
* whole access to the hugepage during the split (which happens in
|
|
* place). If we overwrite the pmd with the not-huge version pointing
|
|
* to the pte here (which of course we could if all CPUs were bug
|
|
* free), userland could trigger a small page size TLB miss on the
|
|
* small sized TLB while the hugepage TLB entry is still established in
|
|
* the huge TLB. Some CPU doesn't like that.
|
|
* See http://support.amd.com/us/Processor_TechDocs/41322.pdf, Erratum
|
|
* 383 on page 93. Intel should be safe but is also warns that it's
|
|
* only safe if the permission and cache attributes of the two entries
|
|
* loaded in the two TLB is identical (which should be the case here).
|
|
* But it is generally safer to never allow small and huge TLB entries
|
|
* for the same virtual address to be loaded simultaneously. So instead
|
|
* of doing "pmd_populate(); flush_pmd_tlb_range();" we first mark the
|
|
* current pmd notpresent (atomically because here the pmd_trans_huge
|
|
* must remain set at all times on the pmd until the split is complete
|
|
* for this pmd), then we flush the SMP TLB and finally we write the
|
|
* non-huge version of the pmd entry with pmd_populate.
|
|
*/
|
|
old_pmd = pmdp_invalidate(vma, haddr, pmd);
|
|
|
|
pmd_migration = is_pmd_migration_entry(old_pmd);
|
|
if (unlikely(pmd_migration)) {
|
|
swp_entry_t entry;
|
|
|
|
entry = pmd_to_swp_entry(old_pmd);
|
|
page = pfn_to_page(swp_offset(entry));
|
|
write = is_write_migration_entry(entry);
|
|
young = false;
|
|
soft_dirty = pmd_swp_soft_dirty(old_pmd);
|
|
} else {
|
|
page = pmd_page(old_pmd);
|
|
if (pmd_dirty(old_pmd))
|
|
SetPageDirty(page);
|
|
write = pmd_write(old_pmd);
|
|
young = pmd_young(old_pmd);
|
|
soft_dirty = pmd_soft_dirty(old_pmd);
|
|
}
|
|
VM_BUG_ON_PAGE(!page_count(page), page);
|
|
page_ref_add(page, HPAGE_PMD_NR - 1);
|
|
|
|
/*
|
|
* Withdraw the table only after we mark the pmd entry invalid.
|
|
* This's critical for some architectures (Power).
|
|
*/
|
|
pgtable = pgtable_trans_huge_withdraw(mm, pmd);
|
|
pmd_populate(mm, &_pmd, pgtable);
|
|
|
|
for (i = 0, addr = haddr; i < HPAGE_PMD_NR; i++, addr += PAGE_SIZE) {
|
|
pte_t entry, *pte;
|
|
/*
|
|
* Note that NUMA hinting access restrictions are not
|
|
* transferred to avoid any possibility of altering
|
|
* permissions across VMAs.
|
|
*/
|
|
if (freeze || pmd_migration) {
|
|
swp_entry_t swp_entry;
|
|
swp_entry = make_migration_entry(page + i, write);
|
|
entry = swp_entry_to_pte(swp_entry);
|
|
if (soft_dirty)
|
|
entry = pte_swp_mksoft_dirty(entry);
|
|
} else {
|
|
entry = mk_pte(page + i, READ_ONCE(vma->vm_page_prot));
|
|
entry = maybe_mkwrite(entry, vma->vm_flags);
|
|
if (!write)
|
|
entry = pte_wrprotect(entry);
|
|
if (!young)
|
|
entry = pte_mkold(entry);
|
|
if (soft_dirty)
|
|
entry = pte_mksoft_dirty(entry);
|
|
}
|
|
pte = pte_offset_map(&_pmd, addr);
|
|
BUG_ON(!pte_none(*pte));
|
|
set_pte_at(mm, addr, pte, entry);
|
|
if (!pmd_migration)
|
|
atomic_inc(&page[i]._mapcount);
|
|
pte_unmap(pte);
|
|
}
|
|
|
|
if (!pmd_migration) {
|
|
/*
|
|
* Set PG_double_map before dropping compound_mapcount to avoid
|
|
* false-negative page_mapped().
|
|
*/
|
|
if (compound_mapcount(page) > 1 &&
|
|
!TestSetPageDoubleMap(page)) {
|
|
for (i = 0; i < HPAGE_PMD_NR; i++)
|
|
atomic_inc(&page[i]._mapcount);
|
|
}
|
|
|
|
lock_page_memcg(page);
|
|
if (atomic_add_negative(-1, compound_mapcount_ptr(page))) {
|
|
/* Last compound_mapcount is gone. */
|
|
__dec_lruvec_page_state(page, NR_ANON_THPS);
|
|
if (TestClearPageDoubleMap(page)) {
|
|
/* No need in mapcount reference anymore */
|
|
for (i = 0; i < HPAGE_PMD_NR; i++)
|
|
atomic_dec(&page[i]._mapcount);
|
|
}
|
|
}
|
|
unlock_page_memcg(page);
|
|
}
|
|
|
|
smp_wmb(); /* make pte visible before pmd */
|
|
pmd_populate(mm, pmd, pgtable);
|
|
|
|
if (freeze) {
|
|
for (i = 0; i < HPAGE_PMD_NR; i++) {
|
|
page_remove_rmap(page + i, false);
|
|
put_page(page + i);
|
|
}
|
|
}
|
|
}
|
|
|
|
void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
|
unsigned long address, bool freeze, struct page *page)
|
|
{
|
|
spinlock_t *ptl;
|
|
struct mmu_notifier_range range;
|
|
bool do_unlock_page = false;
|
|
pmd_t _pmd;
|
|
|
|
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm,
|
|
address & HPAGE_PMD_MASK,
|
|
(address & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE);
|
|
mmu_notifier_invalidate_range_start(&range);
|
|
ptl = pmd_lock(vma->vm_mm, pmd);
|
|
|
|
/*
|
|
* If caller asks to setup a migration entries, we need a page to check
|
|
* pmd against. Otherwise we can end up replacing wrong page.
|
|
*/
|
|
VM_BUG_ON(freeze && !page);
|
|
if (page) {
|
|
VM_WARN_ON_ONCE(!PageLocked(page));
|
|
if (page != pmd_page(*pmd))
|
|
goto out;
|
|
}
|
|
|
|
repeat:
|
|
if (pmd_trans_huge(*pmd)) {
|
|
if (!page) {
|
|
page = pmd_page(*pmd);
|
|
/*
|
|
* An anonymous page must be locked, to ensure that a
|
|
* concurrent reuse_swap_page() sees stable mapcount;
|
|
* but reuse_swap_page() is not used on shmem or file,
|
|
* and page lock must not be taken when zap_pmd_range()
|
|
* calls __split_huge_pmd() while i_mmap_lock is held.
|
|
*/
|
|
if (PageAnon(page)) {
|
|
if (unlikely(!trylock_page(page))) {
|
|
get_page(page);
|
|
_pmd = *pmd;
|
|
spin_unlock(ptl);
|
|
lock_page(page);
|
|
spin_lock(ptl);
|
|
if (unlikely(!pmd_same(*pmd, _pmd))) {
|
|
unlock_page(page);
|
|
put_page(page);
|
|
page = NULL;
|
|
goto repeat;
|
|
}
|
|
put_page(page);
|
|
}
|
|
do_unlock_page = true;
|
|
}
|
|
}
|
|
if (PageMlocked(page))
|
|
clear_page_mlock(page);
|
|
} else if (!(pmd_devmap(*pmd) || is_pmd_migration_entry(*pmd)))
|
|
goto out;
|
|
__split_huge_pmd_locked(vma, pmd, range.start, freeze);
|
|
out:
|
|
spin_unlock(ptl);
|
|
if (do_unlock_page)
|
|
unlock_page(page);
|
|
/*
|
|
* No need to double call mmu_notifier->invalidate_range() callback.
|
|
* They are 3 cases to consider inside __split_huge_pmd_locked():
|
|
* 1) pmdp_huge_clear_flush_notify() call invalidate_range() obvious
|
|
* 2) __split_huge_zero_page_pmd() read only zero page and any write
|
|
* fault will trigger a flush_notify before pointing to a new page
|
|
* (it is fine if the secondary mmu keeps pointing to the old zero
|
|
* page in the meantime)
|
|
* 3) Split a huge pmd into pte pointing to the same page. No need
|
|
* to invalidate secondary tlb entry they are all still valid.
|
|
* any further changes to individual pte will notify. So no need
|
|
* to call mmu_notifier->invalidate_range()
|
|
*/
|
|
mmu_notifier_invalidate_range_only_end(&range);
|
|
}
|
|
|
|
void split_huge_pmd_address(struct vm_area_struct *vma, unsigned long address,
|
|
bool freeze, struct page *page)
|
|
{
|
|
pgd_t *pgd;
|
|
p4d_t *p4d;
|
|
pud_t *pud;
|
|
pmd_t *pmd;
|
|
|
|
pgd = pgd_offset(vma->vm_mm, address);
|
|
if (!pgd_present(*pgd))
|
|
return;
|
|
|
|
p4d = p4d_offset(pgd, address);
|
|
if (!p4d_present(*p4d))
|
|
return;
|
|
|
|
pud = pud_offset(p4d, address);
|
|
if (!pud_present(*pud))
|
|
return;
|
|
|
|
pmd = pmd_offset(pud, address);
|
|
|
|
__split_huge_pmd(vma, pmd, address, freeze, page);
|
|
}
|
|
|
|
void vma_adjust_trans_huge(struct vm_area_struct *vma,
|
|
unsigned long start,
|
|
unsigned long end,
|
|
long adjust_next)
|
|
{
|
|
/*
|
|
* If the new start address isn't hpage aligned and it could
|
|
* previously contain an hugepage: check if we need to split
|
|
* an huge pmd.
|
|
*/
|
|
if (start & ~HPAGE_PMD_MASK &&
|
|
(start & HPAGE_PMD_MASK) >= vma->vm_start &&
|
|
(start & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE <= vma->vm_end)
|
|
split_huge_pmd_address(vma, start, false, NULL);
|
|
|
|
/*
|
|
* If the new end address isn't hpage aligned and it could
|
|
* previously contain an hugepage: check if we need to split
|
|
* an huge pmd.
|
|
*/
|
|
if (end & ~HPAGE_PMD_MASK &&
|
|
(end & HPAGE_PMD_MASK) >= vma->vm_start &&
|
|
(end & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE <= vma->vm_end)
|
|
split_huge_pmd_address(vma, end, false, NULL);
|
|
|
|
/*
|
|
* If we're also updating the vma->vm_next->vm_start, if the new
|
|
* vm_next->vm_start isn't page aligned and it could previously
|
|
* contain an hugepage: check if we need to split an huge pmd.
|
|
*/
|
|
if (adjust_next > 0) {
|
|
struct vm_area_struct *next = vma->vm_next;
|
|
unsigned long nstart = next->vm_start;
|
|
nstart += adjust_next << PAGE_SHIFT;
|
|
if (nstart & ~HPAGE_PMD_MASK &&
|
|
(nstart & HPAGE_PMD_MASK) >= next->vm_start &&
|
|
(nstart & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE <= next->vm_end)
|
|
split_huge_pmd_address(next, nstart, false, NULL);
|
|
}
|
|
}
|
|
|
|
static void unmap_page(struct page *page)
|
|
{
|
|
enum ttu_flags ttu_flags = TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS |
|
|
TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD | TTU_SYNC;
|
|
|
|
VM_BUG_ON_PAGE(!PageHead(page), page);
|
|
|
|
if (PageAnon(page))
|
|
ttu_flags |= TTU_SPLIT_FREEZE;
|
|
|
|
try_to_unmap(page, ttu_flags, NULL);
|
|
|
|
VM_WARN_ON_ONCE_PAGE(page_mapped(page), page);
|
|
}
|
|
|
|
static void remap_page(struct page *page)
|
|
{
|
|
int i;
|
|
if (PageTransHuge(page)) {
|
|
remove_migration_ptes(page, page, true);
|
|
} else {
|
|
for (i = 0; i < HPAGE_PMD_NR; i++)
|
|
remove_migration_ptes(page + i, page + i, true);
|
|
}
|
|
}
|
|
|
|
static void __split_huge_page_tail(struct page *head, int tail,
|
|
struct lruvec *lruvec, struct list_head *list)
|
|
{
|
|
struct page *page_tail = head + tail;
|
|
|
|
VM_BUG_ON_PAGE(atomic_read(&page_tail->_mapcount) != -1, page_tail);
|
|
|
|
/*
|
|
* Clone page flags before unfreezing refcount.
|
|
*
|
|
* After successful get_page_unless_zero() might follow flags change,
|
|
* for exmaple lock_page() which set PG_waiters.
|
|
*/
|
|
page_tail->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
|
|
page_tail->flags |= (head->flags &
|
|
((1L << PG_referenced) |
|
|
(1L << PG_swapbacked) |
|
|
(1L << PG_swapcache) |
|
|
(1L << PG_mlocked) |
|
|
(1L << PG_uptodate) |
|
|
(1L << PG_active) |
|
|
(1L << PG_workingset) |
|
|
(1L << PG_locked) |
|
|
(1L << PG_unevictable) |
|
|
(1L << PG_dirty)));
|
|
|
|
/* ->mapping in first tail page is compound_mapcount */
|
|
VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING,
|
|
page_tail);
|
|
page_tail->mapping = head->mapping;
|
|
page_tail->index = head->index + tail;
|
|
|
|
/* Page flags must be visible before we make the page non-compound. */
|
|
smp_wmb();
|
|
|
|
/*
|
|
* Clear PageTail before unfreezing page refcount.
|
|
*
|
|
* After successful get_page_unless_zero() might follow put_page()
|
|
* which needs correct compound_head().
|
|
*/
|
|
clear_compound_head(page_tail);
|
|
|
|
/* Finally unfreeze refcount. Additional reference from page cache. */
|
|
page_ref_unfreeze(page_tail, 1 + (!PageAnon(head) ||
|
|
PageSwapCache(head)));
|
|
|
|
if (page_is_young(head))
|
|
set_page_young(page_tail);
|
|
if (page_is_idle(head))
|
|
set_page_idle(page_tail);
|
|
|
|
page_cpupid_xchg_last(page_tail, page_cpupid_last(head));
|
|
|
|
/*
|
|
* always add to the tail because some iterators expect new
|
|
* pages to show after the currently processed elements - e.g.
|
|
* migrate_pages
|
|
*/
|
|
lru_add_page_tail(head, page_tail, lruvec, list);
|
|
}
|
|
|
|
static void __split_huge_page(struct page *page, struct list_head *list,
|
|
pgoff_t end, unsigned long flags)
|
|
{
|
|
struct page *head = compound_head(page);
|
|
pg_data_t *pgdat = page_pgdat(head);
|
|
struct lruvec *lruvec;
|
|
struct address_space *swap_cache = NULL;
|
|
unsigned long offset = 0;
|
|
int i;
|
|
|
|
lruvec = mem_cgroup_page_lruvec(head, pgdat);
|
|
|
|
/* complete memcg works before add pages to LRU */
|
|
mem_cgroup_split_huge_fixup(head);
|
|
|
|
if (PageAnon(head) && PageSwapCache(head)) {
|
|
swp_entry_t entry = { .val = page_private(head) };
|
|
|
|
offset = swp_offset(entry);
|
|
swap_cache = swap_address_space(entry);
|
|
xa_lock(&swap_cache->i_pages);
|
|
}
|
|
|
|
for (i = HPAGE_PMD_NR - 1; i >= 1; i--) {
|
|
__split_huge_page_tail(head, i, lruvec, list);
|
|
/* Some pages can be beyond i_size: drop them from page cache */
|
|
if (head[i].index >= end) {
|
|
ClearPageDirty(head + i);
|
|
__delete_from_page_cache(head + i, NULL);
|
|
if (IS_ENABLED(CONFIG_SHMEM) && PageSwapBacked(head))
|
|
shmem_uncharge(head->mapping->host, 1);
|
|
put_page(head + i);
|
|
} else if (!PageAnon(page)) {
|
|
__xa_store(&head->mapping->i_pages, head[i].index,
|
|
head + i, 0);
|
|
} else if (swap_cache) {
|
|
__xa_store(&swap_cache->i_pages, offset + i,
|
|
head + i, 0);
|
|
}
|
|
}
|
|
|
|
ClearPageCompound(head);
|
|
|
|
split_page_owner(head, HPAGE_PMD_NR);
|
|
|
|
/* See comment in __split_huge_page_tail() */
|
|
if (PageAnon(head)) {
|
|
/* Additional pin to swap cache */
|
|
if (PageSwapCache(head)) {
|
|
page_ref_add(head, 2);
|
|
xa_unlock(&swap_cache->i_pages);
|
|
} else {
|
|
page_ref_inc(head);
|
|
}
|
|
} else {
|
|
/* Additional pin to page cache */
|
|
page_ref_add(head, 2);
|
|
xa_unlock(&head->mapping->i_pages);
|
|
}
|
|
|
|
spin_unlock_irqrestore(&pgdat->lru_lock, flags);
|
|
|
|
remap_page(head);
|
|
|
|
for (i = 0; i < HPAGE_PMD_NR; i++) {
|
|
struct page *subpage = head + i;
|
|
if (subpage == page)
|
|
continue;
|
|
unlock_page(subpage);
|
|
|
|
/*
|
|
* Subpages may be freed if there wasn't any mapping
|
|
* like if add_to_swap() is running on a lru page that
|
|
* had its mapping zapped. And freeing these pages
|
|
* requires taking the lru_lock so we do the put_page
|
|
* of the tail pages after the split is complete.
|
|
*/
|
|
put_page(subpage);
|
|
}
|
|
}
|
|
|
|
int total_mapcount(struct page *page)
|
|
{
|
|
int i, compound, ret;
|
|
|
|
VM_BUG_ON_PAGE(PageTail(page), page);
|
|
|
|
if (likely(!PageCompound(page)))
|
|
return atomic_read(&page->_mapcount) + 1;
|
|
|
|
compound = compound_mapcount(page);
|
|
if (PageHuge(page))
|
|
return compound;
|
|
ret = compound;
|
|
for (i = 0; i < HPAGE_PMD_NR; i++)
|
|
ret += atomic_read(&page[i]._mapcount) + 1;
|
|
/* File pages has compound_mapcount included in _mapcount */
|
|
if (!PageAnon(page))
|
|
return ret - compound * HPAGE_PMD_NR;
|
|
if (PageDoubleMap(page))
|
|
ret -= HPAGE_PMD_NR;
|
|
return ret;
|
|
}
|
|
|
|
/*
|
|
* This calculates accurately how many mappings a transparent hugepage
|
|
* has (unlike page_mapcount() which isn't fully accurate). This full
|
|
* accuracy is primarily needed to know if copy-on-write faults can
|
|
* reuse the page and change the mapping to read-write instead of
|
|
* copying them. At the same time this returns the total_mapcount too.
|
|
*
|
|
* The function returns the highest mapcount any one of the subpages
|
|
* has. If the return value is one, even if different processes are
|
|
* mapping different subpages of the transparent hugepage, they can
|
|
* all reuse it, because each process is reusing a different subpage.
|
|
*
|
|
* The total_mapcount is instead counting all virtual mappings of the
|
|
* subpages. If the total_mapcount is equal to "one", it tells the
|
|
* caller all mappings belong to the same "mm" and in turn the
|
|
* anon_vma of the transparent hugepage can become the vma->anon_vma
|
|
* local one as no other process may be mapping any of the subpages.
|
|
*
|
|
* It would be more accurate to replace page_mapcount() with
|
|
* page_trans_huge_mapcount(), however we only use
|
|
* page_trans_huge_mapcount() in the copy-on-write faults where we
|
|
* need full accuracy to avoid breaking page pinning, because
|
|
* page_trans_huge_mapcount() is slower than page_mapcount().
|
|
*/
|
|
int page_trans_huge_mapcount(struct page *page, int *total_mapcount)
|
|
{
|
|
int i, ret, _total_mapcount, mapcount;
|
|
|
|
/* hugetlbfs shouldn't call it */
|
|
VM_BUG_ON_PAGE(PageHuge(page), page);
|
|
|
|
if (likely(!PageTransCompound(page))) {
|
|
mapcount = atomic_read(&page->_mapcount) + 1;
|
|
if (total_mapcount)
|
|
*total_mapcount = mapcount;
|
|
return mapcount;
|
|
}
|
|
|
|
page = compound_head(page);
|
|
|
|
_total_mapcount = ret = 0;
|
|
for (i = 0; i < HPAGE_PMD_NR; i++) {
|
|
mapcount = atomic_read(&page[i]._mapcount) + 1;
|
|
ret = max(ret, mapcount);
|
|
_total_mapcount += mapcount;
|
|
}
|
|
if (PageDoubleMap(page)) {
|
|
ret -= 1;
|
|
_total_mapcount -= HPAGE_PMD_NR;
|
|
}
|
|
mapcount = compound_mapcount(page);
|
|
ret += mapcount;
|
|
_total_mapcount += mapcount;
|
|
if (total_mapcount)
|
|
*total_mapcount = _total_mapcount;
|
|
return ret;
|
|
}
|
|
|
|
/* Racy check whether the huge page can be split */
|
|
bool can_split_huge_page(struct page *page, int *pextra_pins)
|
|
{
|
|
int extra_pins;
|
|
|
|
/* Additional pins from page cache */
|
|
if (PageAnon(page))
|
|
extra_pins = PageSwapCache(page) ? HPAGE_PMD_NR : 0;
|
|
else
|
|
extra_pins = HPAGE_PMD_NR;
|
|
if (pextra_pins)
|
|
*pextra_pins = extra_pins;
|
|
return total_mapcount(page) == page_count(page) - extra_pins - 1;
|
|
}
|
|
|
|
/*
|
|
* This function splits huge page into normal pages. @page can point to any
|
|
* subpage of huge page to split. Split doesn't change the position of @page.
|
|
*
|
|
* Only caller must hold pin on the @page, otherwise split fails with -EBUSY.
|
|
* The huge page must be locked.
|
|
*
|
|
* If @list is null, tail pages will be added to LRU list, otherwise, to @list.
|
|
*
|
|
* Both head page and tail pages will inherit mapping, flags, and so on from
|
|
* the hugepage.
|
|
*
|
|
* GUP pin and PG_locked transferred to @page. Rest subpages can be freed if
|
|
* they are not mapped.
|
|
*
|
|
* Returns 0 if the hugepage is split successfully.
|
|
* Returns -EBUSY if the page is pinned or if anon_vma disappeared from under
|
|
* us.
|
|
*/
|
|
int split_huge_page_to_list(struct page *page, struct list_head *list)
|
|
{
|
|
struct page *head = compound_head(page);
|
|
struct pglist_data *pgdata = NODE_DATA(page_to_nid(head));
|
|
struct deferred_split *ds_queue = get_deferred_split_queue(page);
|
|
struct anon_vma *anon_vma = NULL;
|
|
struct address_space *mapping = NULL;
|
|
int extra_pins, ret;
|
|
bool mlocked;
|
|
unsigned long flags;
|
|
pgoff_t end;
|
|
|
|
VM_BUG_ON_PAGE(is_huge_zero_page(head), head);
|
|
VM_BUG_ON_PAGE(!PageLocked(page), page);
|
|
VM_BUG_ON_PAGE(!PageCompound(page), page);
|
|
|
|
if (PageWriteback(page))
|
|
return -EBUSY;
|
|
|
|
if (PageAnon(head)) {
|
|
/*
|
|
* The caller does not necessarily hold an mmap_sem that would
|
|
* prevent the anon_vma disappearing so we first we take a
|
|
* reference to it and then lock the anon_vma for write. This
|
|
* is similar to page_lock_anon_vma_read except the write lock
|
|
* is taken to serialise against parallel split or collapse
|
|
* operations.
|
|
*/
|
|
anon_vma = page_get_anon_vma(head);
|
|
if (!anon_vma) {
|
|
ret = -EBUSY;
|
|
goto out;
|
|
}
|
|
end = -1;
|
|
mapping = NULL;
|
|
anon_vma_lock_write(anon_vma);
|
|
} else {
|
|
mapping = head->mapping;
|
|
|
|
/* Truncated ? */
|
|
if (!mapping) {
|
|
ret = -EBUSY;
|
|
goto out;
|
|
}
|
|
|
|
anon_vma = NULL;
|
|
i_mmap_lock_read(mapping);
|
|
|
|
/*
|
|
*__split_huge_page() may need to trim off pages beyond EOF:
|
|
* but on 32-bit, i_size_read() takes an irq-unsafe seqlock,
|
|
* which cannot be nested inside the page tree lock. So note
|
|
* end now: i_size itself may be changed at any moment, but
|
|
* head page lock is good enough to serialize the trimming.
|
|
*/
|
|
end = DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE);
|
|
}
|
|
|
|
/*
|
|
* Racy check if we can split the page, before unmap_page() will
|
|
* split PMDs
|
|
*/
|
|
if (!can_split_huge_page(head, &extra_pins)) {
|
|
ret = -EBUSY;
|
|
goto out_unlock;
|
|
}
|
|
|
|
mlocked = PageMlocked(page);
|
|
unmap_page(head);
|
|
|
|
/* Make sure the page is not on per-CPU pagevec as it takes pin */
|
|
if (mlocked)
|
|
lru_add_drain();
|
|
|
|
/* prevent PageLRU to go away from under us, and freeze lru stats */
|
|
spin_lock_irqsave(&pgdata->lru_lock, flags);
|
|
|
|
if (mapping) {
|
|
XA_STATE(xas, &mapping->i_pages, page_index(head));
|
|
|
|
/*
|
|
* Check if the head page is present in page cache.
|
|
* We assume all tail are present too, if head is there.
|
|
*/
|
|
xa_lock(&mapping->i_pages);
|
|
if (xas_load(&xas) != head)
|
|
goto fail;
|
|
}
|
|
|
|
/* Prevent deferred_split_scan() touching ->_refcount */
|
|
spin_lock(&ds_queue->split_queue_lock);
|
|
if (page_ref_freeze(head, 1 + extra_pins)) {
|
|
if (!list_empty(page_deferred_list(head))) {
|
|
ds_queue->split_queue_len--;
|
|
list_del(page_deferred_list(head));
|
|
}
|
|
if (mapping) {
|
|
if (PageSwapBacked(page))
|
|
__dec_node_page_state(page, NR_SHMEM_THPS);
|
|
else
|
|
__dec_node_page_state(page, NR_FILE_THPS);
|
|
}
|
|
|
|
spin_unlock(&ds_queue->split_queue_lock);
|
|
__split_huge_page(page, list, end, flags);
|
|
if (PageSwapCache(head)) {
|
|
swp_entry_t entry = { .val = page_private(head) };
|
|
|
|
ret = split_swap_cluster(entry);
|
|
} else
|
|
ret = 0;
|
|
} else {
|
|
spin_unlock(&ds_queue->split_queue_lock);
|
|
fail:
|
|
if (mapping)
|
|
xa_unlock(&mapping->i_pages);
|
|
spin_unlock_irqrestore(&pgdata->lru_lock, flags);
|
|
remap_page(head);
|
|
ret = -EBUSY;
|
|
}
|
|
|
|
out_unlock:
|
|
if (anon_vma) {
|
|
anon_vma_unlock_write(anon_vma);
|
|
put_anon_vma(anon_vma);
|
|
}
|
|
if (mapping)
|
|
i_mmap_unlock_read(mapping);
|
|
out:
|
|
count_vm_event(!ret ? THP_SPLIT_PAGE : THP_SPLIT_PAGE_FAILED);
|
|
return ret;
|
|
}
|
|
|
|
void free_transhuge_page(struct page *page)
|
|
{
|
|
struct deferred_split *ds_queue = get_deferred_split_queue(page);
|
|
unsigned long flags;
|
|
|
|
spin_lock_irqsave(&ds_queue->split_queue_lock, flags);
|
|
if (!list_empty(page_deferred_list(page))) {
|
|
ds_queue->split_queue_len--;
|
|
list_del(page_deferred_list(page));
|
|
}
|
|
spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
|
|
free_compound_page(page);
|
|
}
|
|
|
|
void deferred_split_huge_page(struct page *page)
|
|
{
|
|
struct deferred_split *ds_queue = get_deferred_split_queue(page);
|
|
#ifdef CONFIG_MEMCG
|
|
struct mem_cgroup *memcg = compound_head(page)->mem_cgroup;
|
|
#endif
|
|
unsigned long flags;
|
|
|
|
VM_BUG_ON_PAGE(!PageTransHuge(page), page);
|
|
|
|
/*
|
|
* The try_to_unmap() in page reclaim path might reach here too,
|
|
* this may cause a race condition to corrupt deferred split queue.
|
|
* And, if page reclaim is already handling the same page, it is
|
|
* unnecessary to handle it again in shrinker.
|
|
*
|
|
* Check PageSwapCache to determine if the page is being
|
|
* handled by page reclaim since THP swap would add the page into
|
|
* swap cache before calling try_to_unmap().
|
|
*/
|
|
if (PageSwapCache(page))
|
|
return;
|
|
|
|
spin_lock_irqsave(&ds_queue->split_queue_lock, flags);
|
|
if (list_empty(page_deferred_list(page))) {
|
|
count_vm_event(THP_DEFERRED_SPLIT_PAGE);
|
|
list_add_tail(page_deferred_list(page), &ds_queue->split_queue);
|
|
ds_queue->split_queue_len++;
|
|
#ifdef CONFIG_MEMCG
|
|
if (memcg)
|
|
memcg_set_shrinker_bit(memcg, page_to_nid(page),
|
|
deferred_split_shrinker.id);
|
|
#endif
|
|
}
|
|
spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
|
|
}
|
|
|
|
static unsigned long deferred_split_count(struct shrinker *shrink,
|
|
struct shrink_control *sc)
|
|
{
|
|
struct pglist_data *pgdata = NODE_DATA(sc->nid);
|
|
struct deferred_split *ds_queue = &pgdata->deferred_split_queue;
|
|
|
|
#ifdef CONFIG_MEMCG
|
|
if (sc->memcg)
|
|
ds_queue = &sc->memcg->deferred_split_queue;
|
|
#endif
|
|
return READ_ONCE(ds_queue->split_queue_len);
|
|
}
|
|
|
|
static unsigned long deferred_split_scan(struct shrinker *shrink,
|
|
struct shrink_control *sc)
|
|
{
|
|
struct pglist_data *pgdata = NODE_DATA(sc->nid);
|
|
struct deferred_split *ds_queue = &pgdata->deferred_split_queue;
|
|
unsigned long flags;
|
|
LIST_HEAD(list), *pos, *next;
|
|
struct page *page;
|
|
int split = 0;
|
|
|
|
#ifdef CONFIG_MEMCG
|
|
if (sc->memcg)
|
|
ds_queue = &sc->memcg->deferred_split_queue;
|
|
#endif
|
|
|
|
spin_lock_irqsave(&ds_queue->split_queue_lock, flags);
|
|
/* Take pin on all head pages to avoid freeing them under us */
|
|
list_for_each_safe(pos, next, &ds_queue->split_queue) {
|
|
page = list_entry((void *)pos, struct page, mapping);
|
|
page = compound_head(page);
|
|
if (get_page_unless_zero(page)) {
|
|
list_move(page_deferred_list(page), &list);
|
|
} else {
|
|
/* We lost race with put_compound_page() */
|
|
list_del_init(page_deferred_list(page));
|
|
ds_queue->split_queue_len--;
|
|
}
|
|
if (!--sc->nr_to_scan)
|
|
break;
|
|
}
|
|
spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
|
|
|
|
list_for_each_safe(pos, next, &list) {
|
|
page = list_entry((void *)pos, struct page, mapping);
|
|
if (!trylock_page(page))
|
|
goto next;
|
|
/* split_huge_page() removes page from list on success */
|
|
if (!split_huge_page(page))
|
|
split++;
|
|
unlock_page(page);
|
|
next:
|
|
put_page(page);
|
|
}
|
|
|
|
spin_lock_irqsave(&ds_queue->split_queue_lock, flags);
|
|
list_splice_tail(&list, &ds_queue->split_queue);
|
|
spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
|
|
|
|
/*
|
|
* Stop shrinker if we didn't split any page, but the queue is empty.
|
|
* This can happen if pages were freed under us.
|
|
*/
|
|
if (!split && list_empty(&ds_queue->split_queue))
|
|
return SHRINK_STOP;
|
|
return split;
|
|
}
|
|
|
|
static struct shrinker deferred_split_shrinker = {
|
|
.count_objects = deferred_split_count,
|
|
.scan_objects = deferred_split_scan,
|
|
.seeks = DEFAULT_SEEKS,
|
|
.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE |
|
|
SHRINKER_NONSLAB,
|
|
};
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
static int split_huge_pages_set(void *data, u64 val)
|
|
{
|
|
struct zone *zone;
|
|
struct page *page;
|
|
unsigned long pfn, max_zone_pfn;
|
|
unsigned long total = 0, split = 0;
|
|
|
|
if (val != 1)
|
|
return -EINVAL;
|
|
|
|
for_each_populated_zone(zone) {
|
|
max_zone_pfn = zone_end_pfn(zone);
|
|
for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) {
|
|
if (!pfn_valid(pfn))
|
|
continue;
|
|
|
|
page = pfn_to_page(pfn);
|
|
if (!get_page_unless_zero(page))
|
|
continue;
|
|
|
|
if (zone != page_zone(page))
|
|
goto next;
|
|
|
|
if (!PageHead(page) || PageHuge(page) || !PageLRU(page))
|
|
goto next;
|
|
|
|
total++;
|
|
lock_page(page);
|
|
if (!split_huge_page(page))
|
|
split++;
|
|
unlock_page(page);
|
|
next:
|
|
put_page(page);
|
|
}
|
|
}
|
|
|
|
pr_info("%lu of %lu THP split\n", split, total);
|
|
|
|
return 0;
|
|
}
|
|
DEFINE_SIMPLE_ATTRIBUTE(split_huge_pages_fops, NULL, split_huge_pages_set,
|
|
"%llu\n");
|
|
|
|
static int __init split_huge_pages_debugfs(void)
|
|
{
|
|
debugfs_create_file("split_huge_pages", 0200, NULL, NULL,
|
|
&split_huge_pages_fops);
|
|
return 0;
|
|
}
|
|
late_initcall(split_huge_pages_debugfs);
|
|
#endif
|
|
|
|
#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
|
|
void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw,
|
|
struct page *page)
|
|
{
|
|
struct vm_area_struct *vma = pvmw->vma;
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
unsigned long address = pvmw->address;
|
|
pmd_t pmdval;
|
|
swp_entry_t entry;
|
|
pmd_t pmdswp;
|
|
|
|
if (!(pvmw->pmd && !pvmw->pte))
|
|
return;
|
|
|
|
flush_cache_range(vma, address, address + HPAGE_PMD_SIZE);
|
|
pmdval = pmdp_invalidate(vma, address, pvmw->pmd);
|
|
if (pmd_dirty(pmdval))
|
|
set_page_dirty(page);
|
|
entry = make_migration_entry(page, pmd_write(pmdval));
|
|
pmdswp = swp_entry_to_pmd(entry);
|
|
if (pmd_soft_dirty(pmdval))
|
|
pmdswp = pmd_swp_mksoft_dirty(pmdswp);
|
|
set_pmd_at(mm, address, pvmw->pmd, pmdswp);
|
|
page_remove_rmap(page, true);
|
|
put_page(page);
|
|
}
|
|
|
|
void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
|
|
{
|
|
struct vm_area_struct *vma = pvmw->vma;
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
unsigned long address = pvmw->address;
|
|
unsigned long mmun_start = address & HPAGE_PMD_MASK;
|
|
pmd_t pmde;
|
|
swp_entry_t entry;
|
|
|
|
if (!(pvmw->pmd && !pvmw->pte))
|
|
return;
|
|
|
|
entry = pmd_to_swp_entry(*pvmw->pmd);
|
|
get_page(new);
|
|
pmde = pmd_mkold(mk_huge_pmd(new, vma->vm_page_prot));
|
|
if (pmd_swp_soft_dirty(*pvmw->pmd))
|
|
pmde = pmd_mksoft_dirty(pmde);
|
|
if (is_write_migration_entry(entry))
|
|
pmde = maybe_pmd_mkwrite(pmde, vma);
|
|
|
|
flush_cache_range(vma, mmun_start, mmun_start + HPAGE_PMD_SIZE);
|
|
if (PageAnon(new))
|
|
page_add_anon_rmap(new, vma, mmun_start, true);
|
|
else
|
|
page_add_file_rmap(new, true);
|
|
set_pmd_at(mm, mmun_start, pvmw->pmd, pmde);
|
|
if ((vma->vm_flags & VM_LOCKED) && !PageDoubleMap(new))
|
|
mlock_vma_page(new);
|
|
update_mmu_cache_pmd(vma, address, pvmw->pmd);
|
|
}
|
|
#endif
|