This brings the android14-6.1 branch up to date with the 6.1.78 LTS release. Included in here are the following commits: *4b97573495Revert "hrtimer: Report offline hrtimer enqueue" *0e5af42a0aMerge 6.1.78 into android14-6.1-lts |\ | *8b4118fabdLinux 6.1.78 | *1296c110c5netfilter: nft_set_rbtree: skip end interval element from gc | *d89a80e482net: stmmac: xgmac: fix a typo of register name in DPP safety handling | *7b430fb924ALSA: usb-audio: Sort quirk table entries | *06040fadbfnet: stmmac: xgmac: use #define for string constants | *499e6e9f07clocksource: Skip watchdog check for large watchdog intervals | *492e0aba08block: treat poll queue enter similarly to timeouts | *cf3d57ad6ff2fs: add helper to check compression level | *9f74b3d718RDMA/irdma: Fix support for 64k pages | *4675661672vhost: use kzalloc() instead of kmalloc() followed by memset() | *d8712c6c6aRevert "ASoC: amd: Add new dmi entries for acp5x platform" | *fbd77ce1d1io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers | *08249dc3d9Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID | *315075ac73Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU | *a94d303beahrtimer: Report offline hrtimer enqueue | *8b380ad970usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK | *f2cf6db285usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK | *041cb58f54USB: serial: cp210x: add ID for IMST iM871A-USB | *36ef5b7b4fUSB: serial: option: add Fibocom FM101-GL variant | *234099ab7fUSB: serial: qcserial: add new usb-id for Dell Wireless DW5826e | *39fbca505fALSA: usb-audio: add quirk for RODE NT-USB+ | *2552f6b1bdALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter | *b8259a5023ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision | *82761993d4mtd: parsers: ofpart: add workaround for #size-cells 0 | *b478e414cffs: dlm: don't put dlm_local_addrs on heap | *e5dc63f01eblk-iocost: Fix an UBSAN shift-out-of-bounds warning | *1ebd75cefascsi: core: Move scsi_host_busy() out of host lock if it is for per-command | *ec1bedd797fs/ntfs3: Fix an NULL dereference bug | *a442ff5405netfilter: nft_set_pipapo: remove scratch_aligned pointer | *fac3478d5bnetfilter: nft_set_pipapo: add helper to release pcpu scratch area | *3eaab7d565netfilter: nft_set_pipapo: store index in scratch maps | *181dade251netfilter: nft_ct: reject direction for ct id | *efdd665ce1drm/amd/display: Implement bounds check for stream encoder creation in DCN301 | *a060da3235netfilter: nft_compat: restrict match/target protocol to u16 | *8762bcc927netfilter: nft_compat: reject unused compat flag | *e79ef7966enetfilter: nft_compat: narrow down revision to unsigned 8-bits | *69d66d493bselftests: cmsg_ipv6: repeat the exact packet | *4e2c4846b2ppp_async: limit MRU to 64K | *e0e09186d8af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. | *3d3a5b31b4tipc: Check the bearer type before calling tipc_udp_nl_bearer_add() | *cf6b97e183rxrpc: Fix response to PING RESPONSE ACKs to a dead call | *05a4d0e166drm/i915/gvt: Fix uninitialized variable in handle_mmio() | *5453875221inet: read sk->sk_family once in inet_recv_error() | *3fa78ee0e3hwmon: (coretemp) Fix bogus core_id to attr name mapping | *9bce694192hwmon: (coretemp) Fix out-of-bounds memory access | *a3156be201hwmon: (aspeed-pwm-tacho) mutex for tach reading | *4065746686octeontx2-pf: Fix a memleak otx2_sq_init | *cbf2e16602atm: idt77252: fix a memleak in open_card_ubr0 | *e37cde7a57tunnels: fix out of bounds access when building IPv6 PMTU error | *90fe47743aselftests: net: avoid just another constant wait | *7f484179c5selftests: net: cut more slack for gro fwd tests. | *466ceebe48net: atlantic: Fix DMA mapping for PTP hwts ring | *0193e0660cnetdevsim: avoid potential loop in nsim_dev_trap_report_work() | *bcabbf8ab5wifi: mac80211: fix waiting for beacons logic | *e42ff0844fnet: stmmac: xgmac: fix handling of DPP safety error for DMA channels | *fb8bfc6ea3drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup | *42939a1ea6drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case | *d2b7e247f3drm/msms/dp: fixed link clock divider bits be over written in BPC unknown case | *cbc53148cccifs: failure to add channel on iface should bump up weight | *0430bfcd46phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP | *296fb308f4dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV | *ed3bb52a05phy: renesas: rcar-gen3-usb2: Fix returning wrong error code | *25ab4d72ebdmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA | *13535ae766dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA | *908939b8e8dmaengine: ti: k3-udma: Report short packet errors | *a1d7ca71badmaengine: fsl-dpaa2-qdma: Fix the size of dma pools | *78327acd4cext4: regenerate buddy after block freeing failed if under fc replay * |19c319d14dRevert "drm/mipi-dsi: Fix detach call without attach" * |20b90d46a0Merge 6.1.77 into android14-6.1-lts |\| | *f1bb70486cLinux 6.1.77 | *d78690bb5ddrm/amdgpu: Fix missing error code in 'gmc_v6/7/8/9_0_hw_init()' | *f086c50a98ASoC: codecs: wsa883x: fix PA volume control | *ac86261fa8ASoC: codecs: lpass-wsa-macro: fix compander volume hack | *2386ee6cbabonding: remove print in bond_verify_device_path | *e1edd8e6c0gve: Fix use-after-free vulnerability | *9e584ea101LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init() | *98c392a91adrm/msm/dsi: Enable runtime PM | *befdb0a8a1Revert "drm/amd/display: Disable PSR-SU on Parade 0803 TCON again" | *dc904345e3mm, kmsan: fix infinite recursion due to RCU critical section | *c5a12dfbfaarm64: irq: set the correct node for shadow call stack | *ddd367ebc4selftests: bonding: Check initial state | *7ebe20e632selftests: team: Add missing config options | *aaa8f76845net: sysfs: Fix /sys/class/net/<iface> path | *bea0fbf857selftests: net: fix available tunnels detection | *a2104f4387af_unix: fix lockdep positive in sk_diag_dump_icons() | *fde3d47efenet: ipv4: fix a memleak in ip_setup_cork | *0f501dae16netfilter: nft_ct: sanitize layer 3 and 4 protocol number in custom expectations | *9ff981cd65netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger | *67f0ca0a4cnetfilter: nf_tables: restrict tunnel object to NFPROTO_NETDEV | *8a51dbf7b7netfilter: conntrack: correct window scaling with retransmitted SYN | *cd091ca44cselftests: net: add missing config for GENEVE | *04a553d8acbridge: mcast: fix disabled snooping after long uptime | *9c333d9891llc: call sock_orphan() at release time | *c59ed6592fipv6: Ensure natural alignment of const ipv6 loopback and router addresses | *2f3d9829f7net: dsa: qca8k: fix illegal usage of GPIO | *1e4c227805ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550() | *3b84b7000cixgbe: Refactor overtemp event handling | *9c8eafc5e9ixgbe: Refactor returning internal error codes | *b383d4ea27tcp: add sanity checks to rx zerocopy | *046260ce7cnet: lan966x: Fix port configuration when using SGMII interface | *d2f1b7fe74ipmr: fix kernel panic when forwarding mcast packets | *03dc5b73afipv4: raw: add drop reasons | *d54e4da98bip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv() | *262caadfa9selftests: net: give more time for GRO aggregation | *53e94ec530HID: hidraw: fix a problem of memory leak in hidraw_release() | *db6338f459scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler | *81e92f0c97regulator: ti-abb: don't use devm_platform_ioremap_resource_byname for shared interrupt register | *7eb86ddaf1scsi: isci: Fix an error code problem in isci_io_request_build() | *206dcd2624drm: using mul_u32_u32() requires linux/math64.h | *a2f30104fewifi: cfg80211: fix RCU dereference in __cfg80211_bss_update | *071d98d5eeperf: Fix the nr_addr_filters fix | *8eea7e1d69drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()' | *7513f0906cdrm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' | *af8e292615drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()' | *d282ea0703drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' | *3fbfeb8536ceph: fix invalid pointer access if get_quota_realm return ERR_PTR | *7f2649c942ceph: fix deadlock or deadcode of misusing dget() | *692ead237dceph: reinitialize mds feature bit even when session in open | *1d9c777d3eblk-mq: fix IO hang from sbitmap wakeup race | *1f7a018857virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings | *b602f098f7drm/amdkfd: Fix lock dependency warning with srcu | *8b25d39716drm/amdkfd: Fix lock dependency warning | *49a7b708dalibsubcmd: Fix memory leak in uniq() | *2c1164ad92misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback | *91f19774879p: Fix initialisation of netfs_inode for 9p | *fc557b76dcPCI/AER: Decode Requester ID when no error info found | *83c895561aPCI: Fix 64GT/s effective data rate calculation | *521f28eeddspmi: mediatek: Fix UAF on device remove | *089ebfab24fs/kernfs/dir: obey S_ISGID | *c13bcbdb84tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE | *d8d7ffefc0selftests/sgx: Fix linker script asserts | *fa3f6cd20dusb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub | *9cdf5ddb06usb: hub: Replace hardcoded quirk value with BIT() macro | *4c8ca96124perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present | *1d83c85922PCI: switchtec: Fix stdev_release() crash after surprise hot remove | *5e0160dab1PCI: Only override AMD USB controller if required | *26b8a35fefmailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt | *6e8c0eda6cmfd: ti_am335x_tscadc: Fix TI SoC dependencies | *52e7f05549xen/gntdev: Fix the abuse of underlying struct page in DMA-buf import | *e827364bc1i3c: master: cdns: Update maximum prescaler value for i2c clock | *4f7dad73dfum: time-travel: fix time corruption | *d8512cc8acum: net: Fix return type of uml_net_start_xmit() | *d8264ce2f8um: Don't use vfprintf() for os_info() | *a95e52af36um: Fix naming clash between UML and scheduler | *7d1c4e5809leds: trigger: panic: Don't register panic notifier if creating the trigger failed | *2cb659ef0aALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140 | *05a0900bd7drm/amdkfd: Fix iterator used outside loop in 'kfd_add_peer_prop()' | *34bb1b97c3drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()' | *66d38977e2drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' | *da08dbb647drm/amdgpu: Let KFD sync with VM fences | *adae24c5b3drm/amdgpu: Fix ecc irq enable/disable unpaired | *aade0a0760clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks | *7294b1bbaadrm/amd/display: make flip_timestamp_in_us a 64-bit variable | *c95d2144bewatchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786 | *ec74a45e80clk: mmp: pxa168: Fix memory leak in pxa168_clk_init() | *14992bc77fclk: hi3620: Fix memory leak in hi3620_mmc_clk_init() | *d443fb67cadrm/amdgpu: fix ftrace event amdgpu_bo_move always move on same heap | *fe7e8ec072drm/msm/dpu: fix writeback programming for YUV cases | *7593e62702drm/msm/dpu: Ratelimit framedone timeout msgs | *fb017c3e6adrm/amd/display: For prefetch mode > 0, extend prefetch if possible | *4ef53b7e30media: i2c: imx335: Fix hblank min/max values | *5008bde32cmedia: ddbridge: fix an error code problem in ddb_probe | *6408851d05media: amphion: remove mutext lock in condition of wait_event | *5108a2dc2dIB/ipoib: Fix mcast list locking | *fe80290b2adrm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time | *7c972c8945f2fs: fix to tag gcing flag on page during block migration | *fb55c3cee6hwmon: (nct6775) Fix fan speed set failure in automatic mode | *bf808f5868media: rkisp1: Fix IRQ disable race issue | *f0d0fe3787media: rkisp1: Store IRQ lines | *fb71b54856media: rkisp1: Fix IRQ handler return values | *1c51b6b0c6media: rkisp1: Drop IRQF_SHARED | *c3f77c5d63ALSA: hda: Intel: add HDA_ARL PCI ID support | *3b28da57d0PCI: add INTEL_HDA_ARL to pci_ids.h | *16786b7090media: rockchip: rga: fix swizzling for RGB formats | *1ef8beb4bfmedia: stk1160: Fixed high volume of stk1160_dbg messages | *25eaa9f999drm/mipi-dsi: Fix detach call without attach | *f3e41cc260drm/framebuffer: Fix use of uninitialized variable | *406f8d5baddrm/drm_file: fix use of uninitialized variable | *48ad42cd95ASoC: amd: Add new dmi entries for acp5x platform | *b6ca70f06ef2fs: fix write pointers on zoned device after roll forward | *9773a96eacdrm/amd/display: Fix tiled display misalignment | *126543736fdrm/bridge: anx7625: Fix Set HPD irq detect window to 2ms | *3c2bd20dc9drm/panel-edp: Add override_edid_mode quirk for generic edp | *055c849724RDMA/IPoIB: Fix error code return in ipoib_mcast_join | *c4cb42824efast_dput(): handle underflows gracefully | *0ee8e0a183ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument | *52e25a323cALSA: hda: Refer to correct stream index at loops | *b1020a5467f2fs: fix to check return value of f2fs_reserve_new_block() | *332a7c108enet: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure | *0438a985deocteontx2-af: Fix max NPC MCAM entry check while validating ref_entry | *95173204b1i40e: Fix VF disable behavior to block all traffic | *9f9ac39adbbridge: cfm: fix enum typo in br_cc_ccm_tx_parse | *a243e0818enet/smc: disable SEID on non-s390 archs where virtual ISM may be used | *388736c62bBluetooth: L2CAP: Fix possible multiple reject send | *6d95ade9e6Bluetooth: hci_sync: fix BR/EDR wakeup bug | *a836b1c333Bluetooth: qca: Set both WIDEBAND_SPEECH and LE_STATES quirks for QCA2066 | *da1a6e9f01wifi: cfg80211: free beacon_ies when overridden from hidden BSS | *3bb09b9af1wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() | *12473265f5libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos | *68ef19417awifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices | *e15fa0c67earm64: dts: amlogic: fix format for s4 uart node | *9e8338b72bice: fix pre-shifted bit usage | *9c5541f3f0arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property | *2fdbf9d9a0arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property | *fd9a2c7003md: Whenassemble the array, consult the superblock of the freshest device | *8ae4201900block: prevent an integer overflow in bvec_try_merge_hw_page | *44f6b75c09net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path | *0edb3ae8bfnet: atlantic: eliminate double free in error handling logic | *ea12794ea6ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values | *d4560c11c3scsi: hisi_sas: Set .phy_attached before notifing phyup event HISI_PHYE_PHY_UP_PM | *dc15b313f3ARM: dts: imx23/28: Fix the DMA controller node name | *9388665a12ARM: dts: imx23-sansa: Use preferred i2c-gpios properties | *fb8e41af95ARM: dts: imx27-apf27dev: Fix LED name | *6ebe86575bARM: dts: imx25/27: Pass timing0 | *68b2e26225ARM: dts: imx25: Fix the iim compatible string | *af7bbdac89block/rnbd-srv: Check for unlikely string overflow | *238ec612a2ionic: bypass firmware cmds when stuck in reset | *434fcaf372ionic: pass opcode to devcmd_wait | *7dc0fefd37net: phy: at803x: fix passing the wrong reference for config_intr | *e7398f3e45ARM: dts: imx1: Fix sram node | *7721a55c02ARM: dts: imx27: Fix sram node | *8a0285ed7eARM: dts: imx: Use flash@0,0 pattern | *8953b37bb1ARM: dts: imx25/27-eukrea: Fix RTC node name | *1acdaf9f29ARM: dts: rockchip: fix rk3036 hdmi ports node | *574dcd3126wifi: wfx: fix possible NULL pointer dereference in wfx_set_mfp_ap() | *5a44a664abbpf: Set uattr->batch.count as zero before batched update or deletion | *7719e56b20scsi: libfc: Fix up timeout error in fc_fcp_rec_error() | *73fe92ddf9scsi: libfc: Don't schedule abort twice | *d6d6fe4bb1bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers | *c07965d1a7wifi: ath11k: fix race due to setting ATH11K_FLAG_EXT_IRQ_ENABLED too early | *25c6f49ef5wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus() | *db30f469aeARM: dts: imx7s: Fix nand-controller #size-cells | *6fa750d62fARM: dts: imx7s: Fix lcdif compatible | *c9c2a35820ARM: dts: imx7d: Fix coresight funnel ports | *89fdf0a2c7scsi: arcmsr: Support new PCI device IDs 1883 and 1886 | *61c859bd66scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 | *5c4cbec510net: usb: ax88179_178a: avoid two consecutive device resets | *cd4cdad9bdbonding: return -ENOMEM instead of BUG in alb_upper_dev_walk | *c0d5a69322PCI: Add no PM reset quirk for NVIDIA Spectrum devices | *04dcef4a78scsi: lpfc: Fix possible file string name overflow when updating firmware | *c0a96adce2soc: xilinx: fix unhandled SGI warning message | *01946c3c83soc: xilinx: Fix for call trace due to the usage of smp_processor_id() | *fd937767d5selftests/bpf: Fix issues in setup_classid_environment() | *f58cfb63e4wifi: rt2x00: correct wrong BBP register in RxDCOC calibration | *ad0e7bbc0bselftests/bpf: Fix pyperf180 compilation failure with clang18 | *76ab331d6dselftests/bpf: satisfy compiler by having explicit return in btf test | *739b3ccd94wifi: rt2x00: restart beacon queue when hardware reset | *6d2cbf517dext4: avoid online resizing failures due to oversized flex bg | *dd10f82eceext4: remove unnecessary check from alloc_flex_gd() | *60292a12a0ext4: unify the type of flexbg_size to unsigned int | *069ede0475ext4: fix inconsistent between segment fstrim and full fstrim | *80cab9dad5ecryptfs: Reject casefold directory inodes | *e8ca3e7330SUNRPC: Fix a suspicious RCU usage warning | *0671f42a9cKVM: s390: fix setting of fpc register | *7a4d6481fbs390/ptrace: handle setting of fpc register correctly | *08f65c9067s390/vfio-ap: fix sysfs status attribute for AP queue devices | *d6c8d8ab76arch: consolidate arch_irq_work_raise prototypes | *3537f92cd2jfs: fix array-index-out-of-bounds in diNewExt | *b03d76cc66rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock() | *ea4eb77c53afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() | *eef7c4cd98afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() | *91256fcd57crypto: stm32/crc32 - fix parsing list of devices | *e0e78522b4erofs: fix ztailpacking for subpage compressed blocks | *6c7bdb97d4crypto: octeontx2 - Fix cptvf driver cleanup | *75b0f71b26pstore/ram: Fix crash when setting number of cpus to an odd number | *32e8f2d955jfs: fix uaf in jfs_evict_inode | *70780914cbjfs: fix array-index-out-of-bounds in dbAdjTree | *cab0c265bajfs: fix slab-out-of-bounds Read in dtSearch | *e4cbc857d7UBSAN: array-index-out-of-bounds in dtSplitRoot | *42f433785fFS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree | *185d97e5beACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events | *31569995fcPM / devfreq: Synchronize devfreq_monitor_[start/stop] | *7633b7a036ACPI: NUMA: Fix the logic of getting the fake_pxm value | *33650372e3ACPI: extlog: fix NULL pointer dereference check | *431c1a4921PNP: ACPI: fix fortify warning | *81eb8b56e7ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop | *4d4e06eaa2audit: Send netlink ACK before setting connection in auditd_set | *3430936a01regulator: core: Only increment use_count when enable_count changes | *b3ae38966ddebugobjects: Stop accessing objects after releasing hash bucket lock | *74ec093dbaperf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file | *d67e43be0ex86/mce: Mark fatal MCE's page as poison to avoid panic in the kdump kernel | *abd26515d4powerpc/lib: Validate size for vector operations | *0be5614f26powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE | *d4908b3431x86/boot: Ignore NMIs during very early boot | *a6fd14db75powerpc/64s: Fix CONFIG_NUMA=n build due to create_section_mapping() | *cf3256c431powerpc/mm: Fix build failures due to arch_reserved_kernel_pages() | *7ad4b2a6b2powerpc: Fix build error due to is_valid_bugaddr() | *d87d9a23a1drivers/perf: pmuv3: don't expose SW_INCR event in sysfs | *4431284f4aarm64: irq: set the correct node for VMAP stack | *d482d61025powerpc/mm: Fix null-pointer dereference in pgtable_cache_add | *9e5c37e0faasm-generic: make sparse happy with odd-sized put_unaligned_*() * |f28d3f0d96Merge branch 'android14-6.1' into branch 'android14-6.1-lts' * |7a8376be74ANDROID: use reserved cpucaps for new capability * |c801066ecaRevert "mm/sparsemem: fix race in accessing memory_section->usage" * |2dbddbe358Merge 6.1.76 into android-6.1 |\| | *e5c3b988b8Linux 6.1.76 | *d7dc6a8604net/mlx5e: Handle hardware IPsec limits events | *e90c7d26caserial: core: fix kernel-doc for uart_port_unlock_irqrestore() | *c02d3872c8x86/entry/ia32: Ensure s32 is sign extended to s64 | *cf0b4ba4b0tick/sched: Preserve number of idle sleeps across CPU hotplug events | *e333bbb557mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan | *ec745eeff4cxl/region:Fix overflow issue in alloc_hpa() | *1111abee59MIPS: lantiq: register smp_ops on non-smp platforms | *b086f6d979spi: fix finalize message on error return | *598af91f62spi: bcm-qspi: fix SFDP BFPT read by usig mspi read | *a2fa86e2bbdrm/bridge: anx7625: Ensure bridge is suspended in disable() | *9564767b67block: Move checking GENHD_FL_NO_PART to bdev_add_partition() | *4b84411165gpio: eic-sprd: Clear interrupt after set the interrupt type | *23cf4cf429drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume | *ba930885bfdrm/exynos: fix accidental on-stack copy of exynos_drm_plane | *c1cd4f9da5drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case | *6ba690e7f7drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable() | *279f1cc562drm/bridge: sii902x: Fix audio codec unregistration | *e0f83c234edrm/bridge: sii902x: Fix probing race issue | *c46f9c7f93drm/bridge: sii902x: Use devm_regulator_bulk_get_enable() | *ed555f5b5cdrm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33] | *6b7fb2903adrm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer | *f9a4c401bfRevert "powerpc/64s: Increase default stack size to 32KB" | *ec5e692cbadrm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing | *f91c77d2c3btrfs: zoned: optimize hint byte for zoned allocator | *4c45143447btrfs: zoned: factor out prepare_allocation_zoned() | *b168029d67serial: sc16is7xx: fix unconditional activation of THRI interrupt | *49d733c4bbserial: sc16is7xx: Use port lock wrappers | *4fd9a02121serial: core: Provide port lock wrappers | *e11dea8f50dlm: use kernel_connect() and kernel_bind() | *fd7c2ffa0eARM: dts: qcom: sdx55: fix USB SS wakeup | *ecf87621b4ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts | *34d2c909c7ARM: dts: qcom: sdx55: fix pdc '#interrupt-cells' | *bba1320ef2ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12 | *46cd7ef69fARM: dts: qcom: sdx55: fix USB wakeup interrupt types | *b87a1229d8pipe: wakeup wr_wait after setting max_usage | *6f5c4aadddfs/pipe: move check to pipe_has_watch_queue() | *28f010dc50thermal: intel: hfi: Add syscore callbacks for system-wide PM | *b2517d1412thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline | *a8056e821cthermal: intel: hfi: Refactor enabling code into helper functions | *e1c9d32c98PM: sleep: Fix possible deadlocks in core system-wide PM code | *a9dbf8ca31PM: core: Remove unnecessary (void *) conversions | *ea3357c6cfbus: mhi: ep: Do not allocate event ring element on stack | *512fc4d735media: ov13b10: Enable runtime PM before registering async sub-device | *a14c2431e5media: ov13b10: Support device probe in non-zero ACPI D state | *33bf23c994erofs: fix lz4 inplace decompression | *2197389e1aerofs: get rid of the remaining kmap_atomic() | *471ab2e8b7drm/amdgpu/pm: Fix the power source flag error | *b4cbd01832drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A | *7960f14fcadrm/bridge: nxp-ptn3460: simplify some error checking | *6341140b04platform/x86: intel-uncore-freq: Fix types in sysfs callbacks | *85d16c03dddrm/amd/display: Disable PSR-SU on Parade 0803 TCON again | *b5fcb340b7drm/tidss: Fix atomic_flush check | *2a81e844d1drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking | *62f2e79cf9drm: Don't unref the same fb many times by mistake due to deadlock handling | *635e996e6ecpufreq: intel_pstate: Refine computation of P-state for given frequency | *242996f500gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04 | *6c495c84e2xfs: read only mounts with fsopen mount API are busted | *7f95f6997ffirmware: arm_scmi: Check mailbox/SMT channel for consistency | *2c939c74efksmbd: fix global oob in ksmbd_nl_policy | *2841631a03platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe | *8e34430e33netfilter: nf_tables: reject QUEUE/DROP verdict parameters | *af149a4689netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain | *5e7d8ddf2ahv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes | *aa2cc93639wifi: iwlwifi: fix a memory corruption | *dcc54a54deexec: Fix error handling in begin_new_exec() | *4646445756rbd: don't move requests to the running list on errors | *6e6bca99e8btrfs: don't abort filesystem when attempting to snapshot deleted subvolume | *52e02f26d0btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args | *86aff7c5f7btrfs: don't warn if discard range is not aligned to sector | *b60f748a2fbtrfs: tree-checker: fix inline ref size in error messages | *c91c247be4btrfs: ref-verify: free ref cache before clearing mount opt | *9ebd514fbdbtrfs: avoid copying BTRFS_ROOT_SUBVOL_DEAD flag to snapshot of subvolume being deleted | *d9c54763e5nbd: always initialize struct msghdr completely | *0a5a083c2bnet: fec: fix the unhandled context fault from smmu | *5b1086d226fjes: fix memleaks in fjes_hw_setup | *4b4dcb3f42selftests: netdevsim: fix the udp_tunnel_nic test | *cec65f09c4net: mvpp2: clear BM pool before initialization | *acb6eaf2eanet: stmmac: Wait a bit for the reset to take effect | *67ee37360dnetfilter: nf_tables: validate NFPROTO_* family | *ed5b62bbd4netfilter: nf_tables: restrict anonymous set and map names to 16 bytes | *c25d7922efbtrfs: fix race between reading a directory and adding entries to it | *fd968e683bbtrfs: refresh dir last index during a rewinddir(3) call | *a045b6b197btrfs: set last dir index to the current last index when opening dir | *2aa515b5b5btrfs: fix infinite directory reads | *bc6e242bb7netfilter: nft_limit: reject configurations that cause integer overflow | *c817f5c016rcu: Defer RCU kthreads wakeup when CPU is dying | *b2fa86b2acnet/mlx5e: fix a potential double-free in fs_any_create_groups | *42876db001net/mlx5e: fix a double-free in arfs_create_groups | *890881d10fnet/mlx5e: Allow software parsing when IPsec crypto is enabled | *62ce16005enet/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO | *75d9ed4930net/mlx5: DR, Can't go to uplink vport on RX rule | *e54aedd4d0net/mlx5: DR, Use the right GVMI number for drop action | *f11792c389ipv6: init the accept_queue's spinlocks in inet6_create | *de061604f8netlink: fix potential sleeping issue in mqueue_flush_file | *90fba981catcp: Add memory barrier to tcp_push() | *ab49164c60afs: Hide silly-rename files from userspace | *f4f7e696dbtracing: Ensure visibility when inserting an element into tracing_map | *82a9bc343bnetfs, fscache: Prevent Oops in fscache_put_cache() | *71024928b3net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv | *fcb0b4b6bcnet: micrel: Fix PTP frame parsing for lan8814 | *7a581f597atun: add missing rx stats accounting in tun_xdp_act | *41e7decdadtun: fix missing dropped counter in tun_xdp_act | *a2232f29bfnet: fix removing a namespace with conflicting altnames | *6646145be9udp: fix busy polling | *660c3053d9llc: Drop support for ETH_P_TR_802_2. | *6d53b813ffllc: make llc_ui_sendmsg() more robust against bonding changes | *c5e7fa4f9dvlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING | *4ee0613868bnxt_en: Wait for FLR to complete during probe | *b1e0a68a0ctcp: make sure init the accept_queue's spinlocks once | *6994dba063net/smc: fix illegal rmb_desc access in SMC-D connection dump | *49aaeb8c53wifi: mac80211: fix potential sta-link leak | *b59e08c872drm/amd/display: pbn_div need be updated for hotplug event | *a5046e5eb8Revert "drm/amd: Enable PCIe PME from D3" | *b1c06ee2d1ksmbd: Add missing set_freezable() for freezable kthread | *844dfef316ksmbd: send lease break notification on FILE_RENAME_INFORMATION | *de603a52afksmbd: don't increment epoch if current state and request state are same | *e61fc656ceksmbd: fix potential circular locking issue in smb2_set_ea() | *8fa25e67fdksmbd: set v2 lease version on lease upgrade | *3101b9fd74mm: page_alloc: unreserve highatomic page blocks before oom | *1d15da5601LoongArch/smp: Call rcutree_report_cpu_starting() earlier | *0e0653d53aserial: sc16is7xx: improve do/while loop in sc16is7xx_irq() | *80beb4424dserial: sc16is7xx: remove obsolete loop in sc16is7xx_port_irq() | *de8e41f78fserial: sc16is7xx: fix invalid sc16is7xx_lines bitfield in case of probe error | *416b10d281serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO | *4b068e55bfserial: sc16is7xx: change EFR lock to operate on each channels | *f6c58552a8serial: sc16is7xx: remove unused line structure member | *6dca71e6e1serial: sc16is7xx: remove global regmap from struct sc16is7xx_port | *9bcb019aeeserial: sc16is7xx: remove wasteful static buffer in sc16is7xx_regmap_name() | *45ec1b7accserial: sc16is7xx: improve regmap debugfs by using one regmap per port | *362be9ec32rename(): fix the locking of subdirectories | *68ed9e3332mm/sparsemem: fix race in accessing memory_section->usage | *367a47ef4cmm/rmap: fix misplaced parenthesis of a likely() | *5d01dcda81ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path | *13a6ceeb5bnouveau/vmm: don't set addr on the fail path to avoid warning | *40c23b5e07rtc: Extend timeout for waiting for UIP to clear to 1s | *7971389316rtc: Add support for configuring the UIP timeout for RTC reads | *fd1f5396bertc: mc146818-lib: Adjust failure return code for mc146818_get_time() | *911e7206c8rtc: Adjust failure return code for cmos_set_alarm() | *aca1ea92f5rtc: cmos: Use ACPI alarm for non-Intel x86 systems too | *2b1dc0666earm64: Rename ARM64_WORKAROUND_2966298 | *9fec4db7ffmedia: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run | *a33fbb8b6dmmc: mmc_spi: remove custom DMA mapped buffers | *c4edcd134bmmc: core: Use mrq.sbc in close-ended ffu | *d78fac87c6media: videobuf2-dma-sg: fix vmap callback | *c160f2ac85scripts/get_abi: fix source path leak | *efe3ec7066docs: kernel_abi.py: fix command injection | *c014490c0blsm: new security_file_ioctl_compat() hook | *2647770eacarm64: dts: qcom: sm8150: fix USB DP/DM HS PHY interrupts | *0168530568arm64: dts: qcom: sdm845: fix USB DP/DM HS PHY interrupts | *69ee126bbaarm64: dts: qcom: sc7280: fix usb_1 wakeup interrupt types | *eec1f92949arm64: dts: qcom: sm8150: fix USB wakeup interrupt types | *595d35c6aearm64: dts: qcom: sdm845: fix USB wakeup interrupt types | *8191aa4146arm64: dts: qcom: sc7180: fix USB wakeup interrupt types | *9f29c5d2bfscsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan() | *2ab32986a0dmaengine: fix NULL pointer in channel unregistration function | *0c8ada71d9iio: adc: ad7091r: Enable internal vref if external vref is not supplied | *fcf8e37152async: Introduce async_schedule_dev_nocall() | *6e8aab4de7async: Split async_schedule_node_domain() | *b37c1b0db1parisc/power: Fix power soft-off button emulation on qemu | *71602d95aeparisc/firmware: Fix F-extend for PDC addresses | *0b093176fdbus: mhi: host: Add spinlock to protect WP access when queueing TREs | *3c5ec66b4bbus: mhi: host: Drop chan lock before queuing buffers | *2df39ac8f8bus: mhi: host: Add alignment check for event ring read pointer | *574f69b46bmips: Fix max_mapnr being uninitialized on early stages | *6690a0acbbs390/vfio-ap: let on_scan_complete() callback filter matrix and update guest's APCB | *baf3fcb268s390/vfio-ap: loop over the shadow APCB when filtering guest's AP configuration | *d6b8d034b5s390/vfio-ap: always filter entire AP matrix | *51a7c02bc7media: ov9734: Enable runtime PM before registering async sub-device | *f4bb1d5dafrpmsg: virtio: Free driver_override when rpmsg_remove() | *e8757cd139media: imx355: Enable runtime PM before registering async sub-device | *8a7729cda2PM / devfreq: Fix buffer overflow in trans_stat_show | *f4518de40as390/vfio-ap: unpin pages on gisc registration failure | *dbc9a791a7crypto: s390/aes - Fix buffer overread in CTR mode | *aa8aa16ed9hwrng: core - Fix page fault dead lock on mmap-ed hwrng | *3a081586c7PM: hibernate: Enforce ordering during image compression/decompression | *680eb0a993crypto: api - Disallow identical driver names | *562850a008btrfs: sysfs: validate scrub_speed_max value | *29e2da3eabOPP: Pass rounded rate to _set_opp() | *4b5f8a187farm64: properly install vmlinuz.efi | *852b6b2a2fext4: allow for the last group to be marked as trimmed | *137568aa54iio: adc: ad7091r: Allow users to configure device events | *6f57121e9ciio: adc: ad7091r: Set alert bit in config register | *fafda9f08aRevert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" | *c519a9054busb: dwc3: gadget: Handle EP0 request dequeuing properly | *c8fe8ce07fusb: dwc3: gadget: Queue PM runtime idle on disconnect event | *ce27046883usb: dwc3: gadget: Refactor EP0 forced stall/restart into a separate API *0eac7b614dMerge branch 'android14-6.1' into branch 'android14-6.1-lts' *63040ce8e9Merge branch 'android14-6.1' into branch 'android14-6.1-lts' *50fe3d2012ANDROID: Add symbols for IIO SCMI module *e666b8755fANDROID: Update symbols list for open-dice.ko Change-Id: Icb970da9bfba44d188465ce8c8148858a4a2fb1a Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
500 lines
16 KiB
C
500 lines
16 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_RMAP_H
|
|
#define _LINUX_RMAP_H
|
|
/*
|
|
* Declarations for Reverse Mapping functions in mm/rmap.c
|
|
*/
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/rwsem.h>
|
|
#include <linux/memcontrol.h>
|
|
#include <linux/highmem.h>
|
|
#include <linux/pagemap.h>
|
|
#include <linux/memremap.h>
|
|
|
|
/*
|
|
* The anon_vma heads a list of private "related" vmas, to scan if
|
|
* an anonymous page pointing to this anon_vma needs to be unmapped:
|
|
* the vmas on the list will be related by forking, or by splitting.
|
|
*
|
|
* Since vmas come and go as they are split and merged (particularly
|
|
* in mprotect), the mapping field of an anonymous page cannot point
|
|
* directly to a vma: instead it points to an anon_vma, on whose list
|
|
* the related vmas can be easily linked or unlinked.
|
|
*
|
|
* After unlinking the last vma on the list, we must garbage collect
|
|
* the anon_vma object itself: we're guaranteed no page can be
|
|
* pointing to this anon_vma once its vma list is empty.
|
|
*/
|
|
struct anon_vma {
|
|
struct anon_vma *root; /* Root of this anon_vma tree */
|
|
struct rw_semaphore rwsem; /* W: modification, R: walking the list */
|
|
/*
|
|
* The refcount is taken on an anon_vma when there is no
|
|
* guarantee that the vma of page tables will exist for
|
|
* the duration of the operation. A caller that takes
|
|
* the reference is responsible for clearing up the
|
|
* anon_vma if they are the last user on release
|
|
*/
|
|
atomic_t refcount;
|
|
|
|
/*
|
|
* Count of child anon_vmas. Equals to the count of all anon_vmas that
|
|
* have ->parent pointing to this one, including itself.
|
|
*
|
|
* This counter is used for making decision about reusing anon_vma
|
|
* instead of forking new one. See comments in function anon_vma_clone.
|
|
*/
|
|
unsigned long num_children;
|
|
/* Count of VMAs whose ->anon_vma pointer points to this object. */
|
|
unsigned long num_active_vmas;
|
|
|
|
struct anon_vma *parent; /* Parent of this anon_vma */
|
|
|
|
/*
|
|
* NOTE: the LSB of the rb_root.rb_node is set by
|
|
* mm_take_all_locks() _after_ taking the above lock. So the
|
|
* rb_root must only be read/written after taking the above lock
|
|
* to be sure to see a valid next pointer. The LSB bit itself
|
|
* is serialized by a system wide lock only visible to
|
|
* mm_take_all_locks() (mm_all_locks_mutex).
|
|
*/
|
|
|
|
/* Interval tree of private "related" vmas */
|
|
struct rb_root_cached rb_root;
|
|
};
|
|
|
|
/*
|
|
* The copy-on-write semantics of fork mean that an anon_vma
|
|
* can become associated with multiple processes. Furthermore,
|
|
* each child process will have its own anon_vma, where new
|
|
* pages for that process are instantiated.
|
|
*
|
|
* This structure allows us to find the anon_vmas associated
|
|
* with a VMA, or the VMAs associated with an anon_vma.
|
|
* The "same_vma" list contains the anon_vma_chains linking
|
|
* all the anon_vmas associated with this VMA.
|
|
* The "rb" field indexes on an interval tree the anon_vma_chains
|
|
* which link all the VMAs associated with this anon_vma.
|
|
*/
|
|
struct anon_vma_chain {
|
|
struct vm_area_struct *vma;
|
|
struct anon_vma *anon_vma;
|
|
struct list_head same_vma; /* locked by mmap_lock & page_table_lock */
|
|
struct rb_node rb; /* locked by anon_vma->rwsem */
|
|
unsigned long rb_subtree_last;
|
|
#ifdef CONFIG_DEBUG_VM_RB
|
|
unsigned long cached_vma_start, cached_vma_last;
|
|
#endif
|
|
};
|
|
|
|
enum ttu_flags {
|
|
TTU_SPLIT_HUGE_PMD = 0x4, /* split huge PMD if any */
|
|
TTU_IGNORE_MLOCK = 0x8, /* ignore mlock */
|
|
TTU_SYNC = 0x10, /* avoid racy checks with PVMW_SYNC */
|
|
TTU_HWPOISON = 0x20, /* do convert pte to hwpoison entry */
|
|
TTU_BATCH_FLUSH = 0x40, /* Batch TLB flushes where possible
|
|
* and caller guarantees they will
|
|
* do a final flush if necessary */
|
|
TTU_RMAP_LOCKED = 0x80, /* do not grab rmap lock:
|
|
* caller holds it */
|
|
};
|
|
|
|
#ifdef CONFIG_MMU
|
|
static inline void get_anon_vma(struct anon_vma *anon_vma)
|
|
{
|
|
atomic_inc(&anon_vma->refcount);
|
|
}
|
|
|
|
void __put_anon_vma(struct anon_vma *anon_vma);
|
|
|
|
static inline void put_anon_vma(struct anon_vma *anon_vma)
|
|
{
|
|
if (atomic_dec_and_test(&anon_vma->refcount))
|
|
__put_anon_vma(anon_vma);
|
|
}
|
|
|
|
static inline void anon_vma_lock_write(struct anon_vma *anon_vma)
|
|
{
|
|
down_write(&anon_vma->root->rwsem);
|
|
}
|
|
|
|
static inline int anon_vma_trylock_write(struct anon_vma *anon_vma)
|
|
{
|
|
return down_write_trylock(&anon_vma->root->rwsem);
|
|
}
|
|
|
|
static inline void anon_vma_unlock_write(struct anon_vma *anon_vma)
|
|
{
|
|
up_write(&anon_vma->root->rwsem);
|
|
}
|
|
|
|
static inline void anon_vma_lock_read(struct anon_vma *anon_vma)
|
|
{
|
|
down_read(&anon_vma->root->rwsem);
|
|
}
|
|
|
|
static inline int anon_vma_trylock_read(struct anon_vma *anon_vma)
|
|
{
|
|
return down_read_trylock(&anon_vma->root->rwsem);
|
|
}
|
|
|
|
static inline void anon_vma_unlock_read(struct anon_vma *anon_vma)
|
|
{
|
|
up_read(&anon_vma->root->rwsem);
|
|
}
|
|
|
|
|
|
/*
|
|
* anon_vma helper functions.
|
|
*/
|
|
void anon_vma_init(void); /* create anon_vma_cachep */
|
|
int __anon_vma_prepare(struct vm_area_struct *);
|
|
void unlink_anon_vmas(struct vm_area_struct *);
|
|
int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *);
|
|
int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *);
|
|
|
|
static inline int anon_vma_prepare(struct vm_area_struct *vma)
|
|
{
|
|
if (likely(vma->anon_vma))
|
|
return 0;
|
|
|
|
return __anon_vma_prepare(vma);
|
|
}
|
|
|
|
static inline void anon_vma_merge(struct vm_area_struct *vma,
|
|
struct vm_area_struct *next)
|
|
{
|
|
VM_BUG_ON_VMA(vma->anon_vma != next->anon_vma, vma);
|
|
unlink_anon_vmas(next);
|
|
}
|
|
|
|
struct anon_vma *folio_get_anon_vma(struct folio *folio);
|
|
|
|
/* RMAP flags, currently only relevant for some anon rmap operations. */
|
|
typedef int __bitwise rmap_t;
|
|
|
|
/*
|
|
* No special request: if the page is a subpage of a compound page, it is
|
|
* mapped via a PTE. The mapped (sub)page is possibly shared between processes.
|
|
*/
|
|
#define RMAP_NONE ((__force rmap_t)0)
|
|
|
|
/* The (sub)page is exclusive to a single process. */
|
|
#define RMAP_EXCLUSIVE ((__force rmap_t)BIT(0))
|
|
|
|
/*
|
|
* The compound page is not mapped via PTEs, but instead via a single PMD and
|
|
* should be accounted accordingly.
|
|
*/
|
|
#define RMAP_COMPOUND ((__force rmap_t)BIT(1))
|
|
|
|
/*
|
|
* rmap interfaces called when adding or removing pte of page
|
|
*/
|
|
void page_move_anon_rmap(struct page *, struct vm_area_struct *);
|
|
void page_add_anon_rmap(struct page *, struct vm_area_struct *,
|
|
unsigned long address, rmap_t flags);
|
|
void page_add_new_anon_rmap(struct page *, struct vm_area_struct *,
|
|
unsigned long address);
|
|
void page_add_file_rmap(struct page *, struct vm_area_struct *,
|
|
bool compound);
|
|
void page_remove_rmap(struct page *, struct vm_area_struct *,
|
|
bool compound);
|
|
|
|
void hugepage_add_anon_rmap(struct page *, struct vm_area_struct *,
|
|
unsigned long address, rmap_t flags);
|
|
void hugepage_add_new_anon_rmap(struct page *, struct vm_area_struct *,
|
|
unsigned long address);
|
|
|
|
static inline void __page_dup_rmap(struct page *page, bool compound)
|
|
{
|
|
atomic_inc(compound ? compound_mapcount_ptr(page) : &page->_mapcount);
|
|
}
|
|
|
|
static inline void page_dup_file_rmap(struct page *page, bool compound)
|
|
{
|
|
__page_dup_rmap(page, compound);
|
|
}
|
|
|
|
/**
|
|
* page_try_dup_anon_rmap - try duplicating a mapping of an already mapped
|
|
* anonymous page
|
|
* @page: the page to duplicate the mapping for
|
|
* @compound: the page is mapped as compound or as a small page
|
|
* @vma: the source vma
|
|
*
|
|
* The caller needs to hold the PT lock and the vma->vma_mm->write_protect_seq.
|
|
*
|
|
* Duplicating the mapping can only fail if the page may be pinned; device
|
|
* private pages cannot get pinned and consequently this function cannot fail.
|
|
*
|
|
* If duplicating the mapping succeeds, the page has to be mapped R/O into
|
|
* the parent and the child. It must *not* get mapped writable after this call.
|
|
*
|
|
* Returns 0 if duplicating the mapping succeeded. Returns -EBUSY otherwise.
|
|
*/
|
|
static inline int page_try_dup_anon_rmap(struct page *page, bool compound,
|
|
struct vm_area_struct *vma)
|
|
{
|
|
VM_BUG_ON_PAGE(!PageAnon(page), page);
|
|
|
|
/*
|
|
* No need to check+clear for already shared pages, including KSM
|
|
* pages.
|
|
*/
|
|
if (!PageAnonExclusive(page))
|
|
goto dup;
|
|
|
|
/*
|
|
* If this page may have been pinned by the parent process,
|
|
* don't allow to duplicate the mapping but instead require to e.g.,
|
|
* copy the page immediately for the child so that we'll always
|
|
* guarantee the pinned page won't be randomly replaced in the
|
|
* future on write faults.
|
|
*/
|
|
if (likely(!is_device_private_page(page)) &&
|
|
unlikely(page_needs_cow_for_dma(vma, page)))
|
|
return -EBUSY;
|
|
|
|
ClearPageAnonExclusive(page);
|
|
/*
|
|
* It's okay to share the anon page between both processes, mapping
|
|
* the page R/O into both processes.
|
|
*/
|
|
dup:
|
|
__page_dup_rmap(page, compound);
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* page_try_share_anon_rmap - try marking an exclusive anonymous page possibly
|
|
* shared to prepare for KSM or temporary unmapping
|
|
* @page: the exclusive anonymous page to try marking possibly shared
|
|
*
|
|
* The caller needs to hold the PT lock and has to have the page table entry
|
|
* cleared/invalidated.
|
|
*
|
|
* This is similar to page_try_dup_anon_rmap(), however, not used during fork()
|
|
* to duplicate a mapping, but instead to prepare for KSM or temporarily
|
|
* unmapping a page (swap, migration) via page_remove_rmap().
|
|
*
|
|
* Marking the page shared can only fail if the page may be pinned; device
|
|
* private pages cannot get pinned and consequently this function cannot fail.
|
|
*
|
|
* Returns 0 if marking the page possibly shared succeeded. Returns -EBUSY
|
|
* otherwise.
|
|
*/
|
|
static inline int page_try_share_anon_rmap(struct page *page)
|
|
{
|
|
VM_BUG_ON_PAGE(!PageAnon(page) || !PageAnonExclusive(page), page);
|
|
|
|
/* device private pages cannot get pinned via GUP. */
|
|
if (unlikely(is_device_private_page(page))) {
|
|
ClearPageAnonExclusive(page);
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* We have to make sure that when we clear PageAnonExclusive, that
|
|
* the page is not pinned and that concurrent GUP-fast won't succeed in
|
|
* concurrently pinning the page.
|
|
*
|
|
* Conceptually, PageAnonExclusive clearing consists of:
|
|
* (A1) Clear PTE
|
|
* (A2) Check if the page is pinned; back off if so.
|
|
* (A3) Clear PageAnonExclusive
|
|
* (A4) Restore PTE (optional, but certainly not writable)
|
|
*
|
|
* When clearing PageAnonExclusive, we cannot possibly map the page
|
|
* writable again, because anon pages that may be shared must never
|
|
* be writable. So in any case, if the PTE was writable it cannot
|
|
* be writable anymore afterwards and there would be a PTE change. Only
|
|
* if the PTE wasn't writable, there might not be a PTE change.
|
|
*
|
|
* Conceptually, GUP-fast pinning of an anon page consists of:
|
|
* (B1) Read the PTE
|
|
* (B2) FOLL_WRITE: check if the PTE is not writable; back off if so.
|
|
* (B3) Pin the mapped page
|
|
* (B4) Check if the PTE changed by re-reading it; back off if so.
|
|
* (B5) If the original PTE is not writable, check if
|
|
* PageAnonExclusive is not set; back off if so.
|
|
*
|
|
* If the PTE was writable, we only have to make sure that GUP-fast
|
|
* observes a PTE change and properly backs off.
|
|
*
|
|
* If the PTE was not writable, we have to make sure that GUP-fast either
|
|
* detects a (temporary) PTE change or that PageAnonExclusive is cleared
|
|
* and properly backs off.
|
|
*
|
|
* Consequently, when clearing PageAnonExclusive(), we have to make
|
|
* sure that (A1), (A2)/(A3) and (A4) happen in the right memory
|
|
* order. In GUP-fast pinning code, we have to make sure that (B3),(B4)
|
|
* and (B5) happen in the right memory order.
|
|
*
|
|
* We assume that there might not be a memory barrier after
|
|
* clearing/invalidating the PTE (A1) and before restoring the PTE (A4),
|
|
* so we use explicit ones here.
|
|
*/
|
|
|
|
/* Paired with the memory barrier in try_grab_folio(). */
|
|
if (IS_ENABLED(CONFIG_HAVE_FAST_GUP))
|
|
smp_mb();
|
|
|
|
if (unlikely(page_maybe_dma_pinned(page)))
|
|
return -EBUSY;
|
|
ClearPageAnonExclusive(page);
|
|
|
|
/*
|
|
* This is conceptually a smp_wmb() paired with the smp_rmb() in
|
|
* gup_must_unshare().
|
|
*/
|
|
if (IS_ENABLED(CONFIG_HAVE_FAST_GUP))
|
|
smp_mb__after_atomic();
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* Called from mm/vmscan.c to handle paging out
|
|
*/
|
|
int folio_referenced(struct folio *, int is_locked,
|
|
struct mem_cgroup *memcg, unsigned long *vm_flags);
|
|
|
|
void try_to_migrate(struct folio *folio, enum ttu_flags flags);
|
|
void try_to_unmap(struct folio *, enum ttu_flags flags);
|
|
|
|
int make_device_exclusive_range(struct mm_struct *mm, unsigned long start,
|
|
unsigned long end, struct page **pages,
|
|
void *arg);
|
|
|
|
/* Avoid racy checks */
|
|
#define PVMW_SYNC (1 << 0)
|
|
/* Look for migration entries rather than present PTEs */
|
|
#define PVMW_MIGRATION (1 << 1)
|
|
|
|
struct page_vma_mapped_walk {
|
|
unsigned long pfn;
|
|
unsigned long nr_pages;
|
|
pgoff_t pgoff;
|
|
struct vm_area_struct *vma;
|
|
unsigned long address;
|
|
pmd_t *pmd;
|
|
pte_t *pte;
|
|
spinlock_t *ptl;
|
|
unsigned int flags;
|
|
};
|
|
|
|
#define DEFINE_PAGE_VMA_WALK(name, _page, _vma, _address, _flags) \
|
|
struct page_vma_mapped_walk name = { \
|
|
.pfn = page_to_pfn(_page), \
|
|
.nr_pages = compound_nr(_page), \
|
|
.pgoff = page_to_pgoff(_page), \
|
|
.vma = _vma, \
|
|
.address = _address, \
|
|
.flags = _flags, \
|
|
}
|
|
|
|
#define DEFINE_FOLIO_VMA_WALK(name, _folio, _vma, _address, _flags) \
|
|
struct page_vma_mapped_walk name = { \
|
|
.pfn = folio_pfn(_folio), \
|
|
.nr_pages = folio_nr_pages(_folio), \
|
|
.pgoff = folio_pgoff(_folio), \
|
|
.vma = _vma, \
|
|
.address = _address, \
|
|
.flags = _flags, \
|
|
}
|
|
|
|
static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw)
|
|
{
|
|
/* HugeTLB pte is set to the relevant page table entry without pte_mapped. */
|
|
if (pvmw->pte && !is_vm_hugetlb_page(pvmw->vma))
|
|
pte_unmap(pvmw->pte);
|
|
if (pvmw->ptl)
|
|
spin_unlock(pvmw->ptl);
|
|
}
|
|
|
|
bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw);
|
|
|
|
/*
|
|
* Used by swapoff to help locate where page is expected in vma.
|
|
*/
|
|
unsigned long page_address_in_vma(struct page *, struct vm_area_struct *);
|
|
|
|
/*
|
|
* Cleans the PTEs of shared mappings.
|
|
* (and since clean PTEs should also be readonly, write protects them too)
|
|
*
|
|
* returns the number of cleaned PTEs.
|
|
*/
|
|
int folio_mkclean(struct folio *);
|
|
|
|
int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff,
|
|
struct vm_area_struct *vma);
|
|
|
|
void remove_migration_ptes(struct folio *src, struct folio *dst, bool locked);
|
|
|
|
int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
|
|
|
|
/*
|
|
* rmap_walk_control: To control rmap traversing for specific needs
|
|
*
|
|
* arg: passed to rmap_one() and invalid_vma()
|
|
* try_lock: bail out if the rmap lock is contended
|
|
* contended: indicate the rmap traversal bailed out due to lock contention
|
|
* rmap_one: executed on each vma where page is mapped
|
|
* done: for checking traversing termination condition
|
|
* anon_lock: for getting anon_lock by optimized way rather than default
|
|
* invalid_vma: for skipping uninterested vma
|
|
*/
|
|
struct rmap_walk_control {
|
|
void *arg;
|
|
bool try_lock;
|
|
bool contended;
|
|
/*
|
|
* Return false if page table scanning in rmap_walk should be stopped.
|
|
* Otherwise, return true.
|
|
*/
|
|
bool (*rmap_one)(struct folio *folio, struct vm_area_struct *vma,
|
|
unsigned long addr, void *arg);
|
|
int (*done)(struct folio *folio);
|
|
struct anon_vma *(*anon_lock)(struct folio *folio,
|
|
struct rmap_walk_control *rwc);
|
|
bool (*invalid_vma)(struct vm_area_struct *vma, void *arg);
|
|
};
|
|
|
|
void rmap_walk(struct folio *folio, struct rmap_walk_control *rwc);
|
|
void rmap_walk_locked(struct folio *folio, struct rmap_walk_control *rwc);
|
|
struct anon_vma *folio_lock_anon_vma_read(struct folio *folio,
|
|
struct rmap_walk_control *rwc);
|
|
|
|
#else /* !CONFIG_MMU */
|
|
|
|
#define anon_vma_init() do {} while (0)
|
|
#define anon_vma_prepare(vma) (0)
|
|
#define anon_vma_link(vma) do {} while (0)
|
|
|
|
static inline int folio_referenced(struct folio *folio, int is_locked,
|
|
struct mem_cgroup *memcg,
|
|
unsigned long *vm_flags)
|
|
{
|
|
*vm_flags = 0;
|
|
return 0;
|
|
}
|
|
|
|
static inline void try_to_unmap(struct folio *folio, enum ttu_flags flags)
|
|
{
|
|
}
|
|
|
|
static inline int folio_mkclean(struct folio *folio)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_MMU */
|
|
|
|
static inline int page_mkclean(struct page *page)
|
|
{
|
|
return folio_mkclean(page_folio(page));
|
|
}
|
|
#endif /* _LINUX_RMAP_H */
|