This brings the android14-6.1 branch up to date with the 6.1.78 LTS release. Included in here are the following commits: *4b97573495
Revert "hrtimer: Report offline hrtimer enqueue" *0e5af42a0a
Merge 6.1.78 into android14-6.1-lts |\ | *8b4118fabd
Linux 6.1.78 | *1296c110c5
netfilter: nft_set_rbtree: skip end interval element from gc | *d89a80e482
net: stmmac: xgmac: fix a typo of register name in DPP safety handling | *7b430fb924
ALSA: usb-audio: Sort quirk table entries | *06040fadbf
net: stmmac: xgmac: use #define for string constants | *499e6e9f07
clocksource: Skip watchdog check for large watchdog intervals | *492e0aba08
block: treat poll queue enter similarly to timeouts | *cf3d57ad6f
f2fs: add helper to check compression level | *9f74b3d718
RDMA/irdma: Fix support for 64k pages | *4675661672
vhost: use kzalloc() instead of kmalloc() followed by memset() | *d8712c6c6a
Revert "ASoC: amd: Add new dmi entries for acp5x platform" | *fbd77ce1d1
io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers | *08249dc3d9
Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID | *315075ac73
Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU | *a94d303bea
hrtimer: Report offline hrtimer enqueue | *8b380ad970
usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK | *f2cf6db285
usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK | *041cb58f54
USB: serial: cp210x: add ID for IMST iM871A-USB | *36ef5b7b4f
USB: serial: option: add Fibocom FM101-GL variant | *234099ab7f
USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e | *39fbca505f
ALSA: usb-audio: add quirk for RODE NT-USB+ | *2552f6b1bd
ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter | *b8259a5023
ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision | *82761993d4
mtd: parsers: ofpart: add workaround for #size-cells 0 | *b478e414cf
fs: dlm: don't put dlm_local_addrs on heap | *e5dc63f01e
blk-iocost: Fix an UBSAN shift-out-of-bounds warning | *1ebd75cefa
scsi: core: Move scsi_host_busy() out of host lock if it is for per-command | *ec1bedd797
fs/ntfs3: Fix an NULL dereference bug | *a442ff5405
netfilter: nft_set_pipapo: remove scratch_aligned pointer | *fac3478d5b
netfilter: nft_set_pipapo: add helper to release pcpu scratch area | *3eaab7d565
netfilter: nft_set_pipapo: store index in scratch maps | *181dade251
netfilter: nft_ct: reject direction for ct id | *efdd665ce1
drm/amd/display: Implement bounds check for stream encoder creation in DCN301 | *a060da3235
netfilter: nft_compat: restrict match/target protocol to u16 | *8762bcc927
netfilter: nft_compat: reject unused compat flag | *e79ef7966e
netfilter: nft_compat: narrow down revision to unsigned 8-bits | *69d66d493b
selftests: cmsg_ipv6: repeat the exact packet | *4e2c4846b2
ppp_async: limit MRU to 64K | *e0e09186d8
af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. | *3d3a5b31b4
tipc: Check the bearer type before calling tipc_udp_nl_bearer_add() | *cf6b97e183
rxrpc: Fix response to PING RESPONSE ACKs to a dead call | *05a4d0e166
drm/i915/gvt: Fix uninitialized variable in handle_mmio() | *5453875221
inet: read sk->sk_family once in inet_recv_error() | *3fa78ee0e3
hwmon: (coretemp) Fix bogus core_id to attr name mapping | *9bce694192
hwmon: (coretemp) Fix out-of-bounds memory access | *a3156be201
hwmon: (aspeed-pwm-tacho) mutex for tach reading | *4065746686
octeontx2-pf: Fix a memleak otx2_sq_init | *cbf2e16602
atm: idt77252: fix a memleak in open_card_ubr0 | *e37cde7a57
tunnels: fix out of bounds access when building IPv6 PMTU error | *90fe47743a
selftests: net: avoid just another constant wait | *7f484179c5
selftests: net: cut more slack for gro fwd tests. | *466ceebe48
net: atlantic: Fix DMA mapping for PTP hwts ring | *0193e0660c
netdevsim: avoid potential loop in nsim_dev_trap_report_work() | *bcabbf8ab5
wifi: mac80211: fix waiting for beacons logic | *e42ff0844f
net: stmmac: xgmac: fix handling of DPP safety error for DMA channels | *fb8bfc6ea3
drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup | *42939a1ea6
drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case | *d2b7e247f3
drm/msms/dp: fixed link clock divider bits be over written in BPC unknown case | *cbc53148cc
cifs: failure to add channel on iface should bump up weight | *0430bfcd46
phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP | *296fb308f4
dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV | *ed3bb52a05
phy: renesas: rcar-gen3-usb2: Fix returning wrong error code | *25ab4d72eb
dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA | *13535ae766
dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA | *908939b8e8
dmaengine: ti: k3-udma: Report short packet errors | *a1d7ca71ba
dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools | *78327acd4c
ext4: regenerate buddy after block freeing failed if under fc replay * |19c319d14d
Revert "drm/mipi-dsi: Fix detach call without attach" * |20b90d46a0
Merge 6.1.77 into android14-6.1-lts |\| | *f1bb70486c
Linux 6.1.77 | *d78690bb5d
drm/amdgpu: Fix missing error code in 'gmc_v6/7/8/9_0_hw_init()' | *f086c50a98
ASoC: codecs: wsa883x: fix PA volume control | *ac86261fa8
ASoC: codecs: lpass-wsa-macro: fix compander volume hack | *2386ee6cba
bonding: remove print in bond_verify_device_path | *e1edd8e6c0
gve: Fix use-after-free vulnerability | *9e584ea101
LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init() | *98c392a91a
drm/msm/dsi: Enable runtime PM | *befdb0a8a1
Revert "drm/amd/display: Disable PSR-SU on Parade 0803 TCON again" | *dc904345e3
mm, kmsan: fix infinite recursion due to RCU critical section | *c5a12dfbfa
arm64: irq: set the correct node for shadow call stack | *ddd367ebc4
selftests: bonding: Check initial state | *7ebe20e632
selftests: team: Add missing config options | *aaa8f76845
net: sysfs: Fix /sys/class/net/<iface> path | *bea0fbf857
selftests: net: fix available tunnels detection | *a2104f4387
af_unix: fix lockdep positive in sk_diag_dump_icons() | *fde3d47efe
net: ipv4: fix a memleak in ip_setup_cork | *0f501dae16
netfilter: nft_ct: sanitize layer 3 and 4 protocol number in custom expectations | *9ff981cd65
netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger | *67f0ca0a4c
netfilter: nf_tables: restrict tunnel object to NFPROTO_NETDEV | *8a51dbf7b7
netfilter: conntrack: correct window scaling with retransmitted SYN | *cd091ca44c
selftests: net: add missing config for GENEVE | *04a553d8ac
bridge: mcast: fix disabled snooping after long uptime | *9c333d9891
llc: call sock_orphan() at release time | *c59ed6592f
ipv6: Ensure natural alignment of const ipv6 loopback and router addresses | *2f3d9829f7
net: dsa: qca8k: fix illegal usage of GPIO | *1e4c227805
ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550() | *3b84b7000c
ixgbe: Refactor overtemp event handling | *9c8eafc5e9
ixgbe: Refactor returning internal error codes | *b383d4ea27
tcp: add sanity checks to rx zerocopy | *046260ce7c
net: lan966x: Fix port configuration when using SGMII interface | *d2f1b7fe74
ipmr: fix kernel panic when forwarding mcast packets | *03dc5b73af
ipv4: raw: add drop reasons | *d54e4da98b
ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv() | *262caadfa9
selftests: net: give more time for GRO aggregation | *53e94ec530
HID: hidraw: fix a problem of memory leak in hidraw_release() | *db6338f459
scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler | *81e92f0c97
regulator: ti-abb: don't use devm_platform_ioremap_resource_byname for shared interrupt register | *7eb86ddaf1
scsi: isci: Fix an error code problem in isci_io_request_build() | *206dcd2624
drm: using mul_u32_u32() requires linux/math64.h | *a2f30104fe
wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update | *071d98d5ee
perf: Fix the nr_addr_filters fix | *8eea7e1d69
drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()' | *7513f0906c
drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' | *af8e292615
drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()' | *d282ea0703
drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' | *3fbfeb8536
ceph: fix invalid pointer access if get_quota_realm return ERR_PTR | *7f2649c942
ceph: fix deadlock or deadcode of misusing dget() | *692ead237d
ceph: reinitialize mds feature bit even when session in open | *1d9c777d3e
blk-mq: fix IO hang from sbitmap wakeup race | *1f7a018857
virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings | *b602f098f7
drm/amdkfd: Fix lock dependency warning with srcu | *8b25d39716
drm/amdkfd: Fix lock dependency warning | *49a7b708da
libsubcmd: Fix memory leak in uniq() | *2c1164ad92
misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback | *91f1977487
9p: Fix initialisation of netfs_inode for 9p | *fc557b76dc
PCI/AER: Decode Requester ID when no error info found | *83c895561a
PCI: Fix 64GT/s effective data rate calculation | *521f28eedd
spmi: mediatek: Fix UAF on device remove | *089ebfab24
fs/kernfs/dir: obey S_ISGID | *c13bcbdb84
tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE | *d8d7ffefc0
selftests/sgx: Fix linker script asserts | *fa3f6cd20d
usb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub | *9cdf5ddb06
usb: hub: Replace hardcoded quirk value with BIT() macro | *4c8ca96124
perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present | *1d83c85922
PCI: switchtec: Fix stdev_release() crash after surprise hot remove | *5e0160dab1
PCI: Only override AMD USB controller if required | *26b8a35fef
mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt | *6e8c0eda6c
mfd: ti_am335x_tscadc: Fix TI SoC dependencies | *52e7f05549
xen/gntdev: Fix the abuse of underlying struct page in DMA-buf import | *e827364bc1
i3c: master: cdns: Update maximum prescaler value for i2c clock | *4f7dad73df
um: time-travel: fix time corruption | *d8512cc8ac
um: net: Fix return type of uml_net_start_xmit() | *d8264ce2f8
um: Don't use vfprintf() for os_info() | *a95e52af36
um: Fix naming clash between UML and scheduler | *7d1c4e5809
leds: trigger: panic: Don't register panic notifier if creating the trigger failed | *2cb659ef0a
ALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140 | *05a0900bd7
drm/amdkfd: Fix iterator used outside loop in 'kfd_add_peer_prop()' | *34bb1b97c3
drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()' | *66d38977e2
drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' | *da08dbb647
drm/amdgpu: Let KFD sync with VM fences | *adae24c5b3
drm/amdgpu: Fix ecc irq enable/disable unpaired | *aade0a0760
clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks | *7294b1bbaa
drm/amd/display: make flip_timestamp_in_us a 64-bit variable | *c95d2144be
watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786 | *ec74a45e80
clk: mmp: pxa168: Fix memory leak in pxa168_clk_init() | *14992bc77f
clk: hi3620: Fix memory leak in hi3620_mmc_clk_init() | *d443fb67ca
drm/amdgpu: fix ftrace event amdgpu_bo_move always move on same heap | *fe7e8ec072
drm/msm/dpu: fix writeback programming for YUV cases | *7593e62702
drm/msm/dpu: Ratelimit framedone timeout msgs | *fb017c3e6a
drm/amd/display: For prefetch mode > 0, extend prefetch if possible | *4ef53b7e30
media: i2c: imx335: Fix hblank min/max values | *5008bde32c
media: ddbridge: fix an error code problem in ddb_probe | *6408851d05
media: amphion: remove mutext lock in condition of wait_event | *5108a2dc2d
IB/ipoib: Fix mcast list locking | *fe80290b2a
drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time | *7c972c8945
f2fs: fix to tag gcing flag on page during block migration | *fb55c3cee6
hwmon: (nct6775) Fix fan speed set failure in automatic mode | *bf808f5868
media: rkisp1: Fix IRQ disable race issue | *f0d0fe3787
media: rkisp1: Store IRQ lines | *fb71b54856
media: rkisp1: Fix IRQ handler return values | *1c51b6b0c6
media: rkisp1: Drop IRQF_SHARED | *c3f77c5d63
ALSA: hda: Intel: add HDA_ARL PCI ID support | *3b28da57d0
PCI: add INTEL_HDA_ARL to pci_ids.h | *16786b7090
media: rockchip: rga: fix swizzling for RGB formats | *1ef8beb4bf
media: stk1160: Fixed high volume of stk1160_dbg messages | *25eaa9f999
drm/mipi-dsi: Fix detach call without attach | *f3e41cc260
drm/framebuffer: Fix use of uninitialized variable | *406f8d5bad
drm/drm_file: fix use of uninitialized variable | *48ad42cd95
ASoC: amd: Add new dmi entries for acp5x platform | *b6ca70f06e
f2fs: fix write pointers on zoned device after roll forward | *9773a96eac
drm/amd/display: Fix tiled display misalignment | *126543736f
drm/bridge: anx7625: Fix Set HPD irq detect window to 2ms | *3c2bd20dc9
drm/panel-edp: Add override_edid_mode quirk for generic edp | *055c849724
RDMA/IPoIB: Fix error code return in ipoib_mcast_join | *c4cb42824e
fast_dput(): handle underflows gracefully | *0ee8e0a183
ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument | *52e25a323c
ALSA: hda: Refer to correct stream index at loops | *b1020a5467
f2fs: fix to check return value of f2fs_reserve_new_block() | *332a7c108e
net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure | *0438a985de
octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry | *95173204b1
i40e: Fix VF disable behavior to block all traffic | *9f9ac39adb
bridge: cfm: fix enum typo in br_cc_ccm_tx_parse | *a243e0818e
net/smc: disable SEID on non-s390 archs where virtual ISM may be used | *388736c62b
Bluetooth: L2CAP: Fix possible multiple reject send | *6d95ade9e6
Bluetooth: hci_sync: fix BR/EDR wakeup bug | *a836b1c333
Bluetooth: qca: Set both WIDEBAND_SPEECH and LE_STATES quirks for QCA2066 | *da1a6e9f01
wifi: cfg80211: free beacon_ies when overridden from hidden BSS | *3bb09b9af1
wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() | *12473265f5
libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos | *68ef19417a
wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices | *e15fa0c67e
arm64: dts: amlogic: fix format for s4 uart node | *9e8338b72b
ice: fix pre-shifted bit usage | *9c5541f3f0
arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property | *2fdbf9d9a0
arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property | *fd9a2c7003
md: Whenassemble the array, consult the superblock of the freshest device | *8ae4201900
block: prevent an integer overflow in bvec_try_merge_hw_page | *44f6b75c09
net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path | *0edb3ae8bf
net: atlantic: eliminate double free in error handling logic | *ea12794ea6
ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values | *d4560c11c3
scsi: hisi_sas: Set .phy_attached before notifing phyup event HISI_PHYE_PHY_UP_PM | *dc15b313f3
ARM: dts: imx23/28: Fix the DMA controller node name | *9388665a12
ARM: dts: imx23-sansa: Use preferred i2c-gpios properties | *fb8e41af95
ARM: dts: imx27-apf27dev: Fix LED name | *6ebe86575b
ARM: dts: imx25/27: Pass timing0 | *68b2e26225
ARM: dts: imx25: Fix the iim compatible string | *af7bbdac89
block/rnbd-srv: Check for unlikely string overflow | *238ec612a2
ionic: bypass firmware cmds when stuck in reset | *434fcaf372
ionic: pass opcode to devcmd_wait | *7dc0fefd37
net: phy: at803x: fix passing the wrong reference for config_intr | *e7398f3e45
ARM: dts: imx1: Fix sram node | *7721a55c02
ARM: dts: imx27: Fix sram node | *8a0285ed7e
ARM: dts: imx: Use flash@0,0 pattern | *8953b37bb1
ARM: dts: imx25/27-eukrea: Fix RTC node name | *1acdaf9f29
ARM: dts: rockchip: fix rk3036 hdmi ports node | *574dcd3126
wifi: wfx: fix possible NULL pointer dereference in wfx_set_mfp_ap() | *5a44a664ab
bpf: Set uattr->batch.count as zero before batched update or deletion | *7719e56b20
scsi: libfc: Fix up timeout error in fc_fcp_rec_error() | *73fe92ddf9
scsi: libfc: Don't schedule abort twice | *d6d6fe4bb1
bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers | *c07965d1a7
wifi: ath11k: fix race due to setting ATH11K_FLAG_EXT_IRQ_ENABLED too early | *25c6f49ef5
wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus() | *db30f469ae
ARM: dts: imx7s: Fix nand-controller #size-cells | *6fa750d62f
ARM: dts: imx7s: Fix lcdif compatible | *c9c2a35820
ARM: dts: imx7d: Fix coresight funnel ports | *89fdf0a2c7
scsi: arcmsr: Support new PCI device IDs 1883 and 1886 | *61c859bd66
scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 | *5c4cbec510
net: usb: ax88179_178a: avoid two consecutive device resets | *cd4cdad9bd
bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk | *c0d5a69322
PCI: Add no PM reset quirk for NVIDIA Spectrum devices | *04dcef4a78
scsi: lpfc: Fix possible file string name overflow when updating firmware | *c0a96adce2
soc: xilinx: fix unhandled SGI warning message | *01946c3c83
soc: xilinx: Fix for call trace due to the usage of smp_processor_id() | *fd937767d5
selftests/bpf: Fix issues in setup_classid_environment() | *f58cfb63e4
wifi: rt2x00: correct wrong BBP register in RxDCOC calibration | *ad0e7bbc0b
selftests/bpf: Fix pyperf180 compilation failure with clang18 | *76ab331d6d
selftests/bpf: satisfy compiler by having explicit return in btf test | *739b3ccd94
wifi: rt2x00: restart beacon queue when hardware reset | *6d2cbf517d
ext4: avoid online resizing failures due to oversized flex bg | *dd10f82ece
ext4: remove unnecessary check from alloc_flex_gd() | *60292a12a0
ext4: unify the type of flexbg_size to unsigned int | *069ede0475
ext4: fix inconsistent between segment fstrim and full fstrim | *80cab9dad5
ecryptfs: Reject casefold directory inodes | *e8ca3e7330
SUNRPC: Fix a suspicious RCU usage warning | *0671f42a9c
KVM: s390: fix setting of fpc register | *7a4d6481fb
s390/ptrace: handle setting of fpc register correctly | *08f65c9067
s390/vfio-ap: fix sysfs status attribute for AP queue devices | *d6c8d8ab76
arch: consolidate arch_irq_work_raise prototypes | *3537f92cd2
jfs: fix array-index-out-of-bounds in diNewExt | *b03d76cc66
rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock() | *ea4eb77c53
afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() | *eef7c4cd98
afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() | *91256fcd57
crypto: stm32/crc32 - fix parsing list of devices | *e0e78522b4
erofs: fix ztailpacking for subpage compressed blocks | *6c7bdb97d4
crypto: octeontx2 - Fix cptvf driver cleanup | *75b0f71b26
pstore/ram: Fix crash when setting number of cpus to an odd number | *32e8f2d955
jfs: fix uaf in jfs_evict_inode | *70780914cb
jfs: fix array-index-out-of-bounds in dbAdjTree | *cab0c265ba
jfs: fix slab-out-of-bounds Read in dtSearch | *e4cbc857d7
UBSAN: array-index-out-of-bounds in dtSplitRoot | *42f433785f
FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree | *185d97e5be
ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events | *31569995fc
PM / devfreq: Synchronize devfreq_monitor_[start/stop] | *7633b7a036
ACPI: NUMA: Fix the logic of getting the fake_pxm value | *33650372e3
ACPI: extlog: fix NULL pointer dereference check | *431c1a4921
PNP: ACPI: fix fortify warning | *81eb8b56e7
ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop | *4d4e06eaa2
audit: Send netlink ACK before setting connection in auditd_set | *3430936a01
regulator: core: Only increment use_count when enable_count changes | *b3ae38966d
debugobjects: Stop accessing objects after releasing hash bucket lock | *74ec093dba
perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file | *d67e43be0e
x86/mce: Mark fatal MCE's page as poison to avoid panic in the kdump kernel | *abd26515d4
powerpc/lib: Validate size for vector operations | *0be5614f26
powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE | *d4908b3431
x86/boot: Ignore NMIs during very early boot | *a6fd14db75
powerpc/64s: Fix CONFIG_NUMA=n build due to create_section_mapping() | *cf3256c431
powerpc/mm: Fix build failures due to arch_reserved_kernel_pages() | *7ad4b2a6b2
powerpc: Fix build error due to is_valid_bugaddr() | *d87d9a23a1
drivers/perf: pmuv3: don't expose SW_INCR event in sysfs | *4431284f4a
arm64: irq: set the correct node for VMAP stack | *d482d61025
powerpc/mm: Fix null-pointer dereference in pgtable_cache_add | *9e5c37e0fa
asm-generic: make sparse happy with odd-sized put_unaligned_*() * |f28d3f0d96
Merge branch 'android14-6.1' into branch 'android14-6.1-lts' * |7a8376be74
ANDROID: use reserved cpucaps for new capability * |c801066eca
Revert "mm/sparsemem: fix race in accessing memory_section->usage" * |2dbddbe358
Merge 6.1.76 into android-6.1 |\| | *e5c3b988b8
Linux 6.1.76 | *d7dc6a8604
net/mlx5e: Handle hardware IPsec limits events | *e90c7d26ca
serial: core: fix kernel-doc for uart_port_unlock_irqrestore() | *c02d3872c8
x86/entry/ia32: Ensure s32 is sign extended to s64 | *cf0b4ba4b0
tick/sched: Preserve number of idle sleeps across CPU hotplug events | *e333bbb557
mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan | *ec745eeff4
cxl/region:Fix overflow issue in alloc_hpa() | *1111abee59
MIPS: lantiq: register smp_ops on non-smp platforms | *b086f6d979
spi: fix finalize message on error return | *598af91f62
spi: bcm-qspi: fix SFDP BFPT read by usig mspi read | *a2fa86e2bb
drm/bridge: anx7625: Ensure bridge is suspended in disable() | *9564767b67
block: Move checking GENHD_FL_NO_PART to bdev_add_partition() | *4b84411165
gpio: eic-sprd: Clear interrupt after set the interrupt type | *23cf4cf429
drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume | *ba930885bf
drm/exynos: fix accidental on-stack copy of exynos_drm_plane | *c1cd4f9da5
drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case | *6ba690e7f7
drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable() | *279f1cc562
drm/bridge: sii902x: Fix audio codec unregistration | *e0f83c234e
drm/bridge: sii902x: Fix probing race issue | *c46f9c7f93
drm/bridge: sii902x: Use devm_regulator_bulk_get_enable() | *ed555f5b5c
drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33] | *6b7fb2903a
drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer | *f9a4c401bf
Revert "powerpc/64s: Increase default stack size to 32KB" | *ec5e692cba
drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing | *f91c77d2c3
btrfs: zoned: optimize hint byte for zoned allocator | *4c45143447
btrfs: zoned: factor out prepare_allocation_zoned() | *b168029d67
serial: sc16is7xx: fix unconditional activation of THRI interrupt | *49d733c4bb
serial: sc16is7xx: Use port lock wrappers | *4fd9a02121
serial: core: Provide port lock wrappers | *e11dea8f50
dlm: use kernel_connect() and kernel_bind() | *fd7c2ffa0e
ARM: dts: qcom: sdx55: fix USB SS wakeup | *ecf87621b4
ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts | *34d2c909c7
ARM: dts: qcom: sdx55: fix pdc '#interrupt-cells' | *bba1320ef2
ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12 | *46cd7ef69f
ARM: dts: qcom: sdx55: fix USB wakeup interrupt types | *b87a1229d8
pipe: wakeup wr_wait after setting max_usage | *6f5c4aaddd
fs/pipe: move check to pipe_has_watch_queue() | *28f010dc50
thermal: intel: hfi: Add syscore callbacks for system-wide PM | *b2517d1412
thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline | *a8056e821c
thermal: intel: hfi: Refactor enabling code into helper functions | *e1c9d32c98
PM: sleep: Fix possible deadlocks in core system-wide PM code | *a9dbf8ca31
PM: core: Remove unnecessary (void *) conversions | *ea3357c6cf
bus: mhi: ep: Do not allocate event ring element on stack | *512fc4d735
media: ov13b10: Enable runtime PM before registering async sub-device | *a14c2431e5
media: ov13b10: Support device probe in non-zero ACPI D state | *33bf23c994
erofs: fix lz4 inplace decompression | *2197389e1a
erofs: get rid of the remaining kmap_atomic() | *471ab2e8b7
drm/amdgpu/pm: Fix the power source flag error | *b4cbd01832
drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A | *7960f14fca
drm/bridge: nxp-ptn3460: simplify some error checking | *6341140b04
platform/x86: intel-uncore-freq: Fix types in sysfs callbacks | *85d16c03dd
drm/amd/display: Disable PSR-SU on Parade 0803 TCON again | *b5fcb340b7
drm/tidss: Fix atomic_flush check | *2a81e844d1
drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking | *62f2e79cf9
drm: Don't unref the same fb many times by mistake due to deadlock handling | *635e996e6e
cpufreq: intel_pstate: Refine computation of P-state for given frequency | *242996f500
gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04 | *6c495c84e2
xfs: read only mounts with fsopen mount API are busted | *7f95f6997f
firmware: arm_scmi: Check mailbox/SMT channel for consistency | *2c939c74ef
ksmbd: fix global oob in ksmbd_nl_policy | *2841631a03
platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe | *8e34430e33
netfilter: nf_tables: reject QUEUE/DROP verdict parameters | *af149a4689
netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain | *5e7d8ddf2a
hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes | *aa2cc93639
wifi: iwlwifi: fix a memory corruption | *dcc54a54de
exec: Fix error handling in begin_new_exec() | *4646445756
rbd: don't move requests to the running list on errors | *6e6bca99e8
btrfs: don't abort filesystem when attempting to snapshot deleted subvolume | *52e02f26d0
btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args | *86aff7c5f7
btrfs: don't warn if discard range is not aligned to sector | *b60f748a2f
btrfs: tree-checker: fix inline ref size in error messages | *c91c247be4
btrfs: ref-verify: free ref cache before clearing mount opt | *9ebd514fbd
btrfs: avoid copying BTRFS_ROOT_SUBVOL_DEAD flag to snapshot of subvolume being deleted | *d9c54763e5
nbd: always initialize struct msghdr completely | *0a5a083c2b
net: fec: fix the unhandled context fault from smmu | *5b1086d226
fjes: fix memleaks in fjes_hw_setup | *4b4dcb3f42
selftests: netdevsim: fix the udp_tunnel_nic test | *cec65f09c4
net: mvpp2: clear BM pool before initialization | *acb6eaf2ea
net: stmmac: Wait a bit for the reset to take effect | *67ee37360d
netfilter: nf_tables: validate NFPROTO_* family | *ed5b62bbd4
netfilter: nf_tables: restrict anonymous set and map names to 16 bytes | *c25d7922ef
btrfs: fix race between reading a directory and adding entries to it | *fd968e683b
btrfs: refresh dir last index during a rewinddir(3) call | *a045b6b197
btrfs: set last dir index to the current last index when opening dir | *2aa515b5b5
btrfs: fix infinite directory reads | *bc6e242bb7
netfilter: nft_limit: reject configurations that cause integer overflow | *c817f5c016
rcu: Defer RCU kthreads wakeup when CPU is dying | *b2fa86b2ac
net/mlx5e: fix a potential double-free in fs_any_create_groups | *42876db001
net/mlx5e: fix a double-free in arfs_create_groups | *890881d10f
net/mlx5e: Allow software parsing when IPsec crypto is enabled | *62ce16005e
net/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO | *75d9ed4930
net/mlx5: DR, Can't go to uplink vport on RX rule | *e54aedd4d0
net/mlx5: DR, Use the right GVMI number for drop action | *f11792c389
ipv6: init the accept_queue's spinlocks in inet6_create | *de061604f8
netlink: fix potential sleeping issue in mqueue_flush_file | *90fba981ca
tcp: Add memory barrier to tcp_push() | *ab49164c60
afs: Hide silly-rename files from userspace | *f4f7e696db
tracing: Ensure visibility when inserting an element into tracing_map | *82a9bc343b
netfs, fscache: Prevent Oops in fscache_put_cache() | *71024928b3
net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv | *fcb0b4b6bc
net: micrel: Fix PTP frame parsing for lan8814 | *7a581f597a
tun: add missing rx stats accounting in tun_xdp_act | *41e7decdad
tun: fix missing dropped counter in tun_xdp_act | *a2232f29bf
net: fix removing a namespace with conflicting altnames | *6646145be9
udp: fix busy polling | *660c3053d9
llc: Drop support for ETH_P_TR_802_2. | *6d53b813ff
llc: make llc_ui_sendmsg() more robust against bonding changes | *c5e7fa4f9d
vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING | *4ee0613868
bnxt_en: Wait for FLR to complete during probe | *b1e0a68a0c
tcp: make sure init the accept_queue's spinlocks once | *6994dba063
net/smc: fix illegal rmb_desc access in SMC-D connection dump | *49aaeb8c53
wifi: mac80211: fix potential sta-link leak | *b59e08c872
drm/amd/display: pbn_div need be updated for hotplug event | *a5046e5eb8
Revert "drm/amd: Enable PCIe PME from D3" | *b1c06ee2d1
ksmbd: Add missing set_freezable() for freezable kthread | *844dfef316
ksmbd: send lease break notification on FILE_RENAME_INFORMATION | *de603a52af
ksmbd: don't increment epoch if current state and request state are same | *e61fc656ce
ksmbd: fix potential circular locking issue in smb2_set_ea() | *8fa25e67fd
ksmbd: set v2 lease version on lease upgrade | *3101b9fd74
mm: page_alloc: unreserve highatomic page blocks before oom | *1d15da5601
LoongArch/smp: Call rcutree_report_cpu_starting() earlier | *0e0653d53a
serial: sc16is7xx: improve do/while loop in sc16is7xx_irq() | *80beb4424d
serial: sc16is7xx: remove obsolete loop in sc16is7xx_port_irq() | *de8e41f78f
serial: sc16is7xx: fix invalid sc16is7xx_lines bitfield in case of probe error | *416b10d281
serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO | *4b068e55bf
serial: sc16is7xx: change EFR lock to operate on each channels | *f6c58552a8
serial: sc16is7xx: remove unused line structure member | *6dca71e6e1
serial: sc16is7xx: remove global regmap from struct sc16is7xx_port | *9bcb019aee
serial: sc16is7xx: remove wasteful static buffer in sc16is7xx_regmap_name() | *45ec1b7acc
serial: sc16is7xx: improve regmap debugfs by using one regmap per port | *362be9ec32
rename(): fix the locking of subdirectories | *68ed9e3332
mm/sparsemem: fix race in accessing memory_section->usage | *367a47ef4c
mm/rmap: fix misplaced parenthesis of a likely() | *5d01dcda81
ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path | *13a6ceeb5b
nouveau/vmm: don't set addr on the fail path to avoid warning | *40c23b5e07
rtc: Extend timeout for waiting for UIP to clear to 1s | *7971389316
rtc: Add support for configuring the UIP timeout for RTC reads | *fd1f5396be
rtc: mc146818-lib: Adjust failure return code for mc146818_get_time() | *911e7206c8
rtc: Adjust failure return code for cmos_set_alarm() | *aca1ea92f5
rtc: cmos: Use ACPI alarm for non-Intel x86 systems too | *2b1dc0666e
arm64: Rename ARM64_WORKAROUND_2966298 | *9fec4db7ff
media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run | *a33fbb8b6d
mmc: mmc_spi: remove custom DMA mapped buffers | *c4edcd134b
mmc: core: Use mrq.sbc in close-ended ffu | *d78fac87c6
media: videobuf2-dma-sg: fix vmap callback | *c160f2ac85
scripts/get_abi: fix source path leak | *efe3ec7066
docs: kernel_abi.py: fix command injection | *c014490c0b
lsm: new security_file_ioctl_compat() hook | *2647770eac
arm64: dts: qcom: sm8150: fix USB DP/DM HS PHY interrupts | *0168530568
arm64: dts: qcom: sdm845: fix USB DP/DM HS PHY interrupts | *69ee126bba
arm64: dts: qcom: sc7280: fix usb_1 wakeup interrupt types | *eec1f92949
arm64: dts: qcom: sm8150: fix USB wakeup interrupt types | *595d35c6ae
arm64: dts: qcom: sdm845: fix USB wakeup interrupt types | *8191aa4146
arm64: dts: qcom: sc7180: fix USB wakeup interrupt types | *9f29c5d2bf
scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan() | *2ab32986a0
dmaengine: fix NULL pointer in channel unregistration function | *0c8ada71d9
iio: adc: ad7091r: Enable internal vref if external vref is not supplied | *fcf8e37152
async: Introduce async_schedule_dev_nocall() | *6e8aab4de7
async: Split async_schedule_node_domain() | *b37c1b0db1
parisc/power: Fix power soft-off button emulation on qemu | *71602d95ae
parisc/firmware: Fix F-extend for PDC addresses | *0b093176fd
bus: mhi: host: Add spinlock to protect WP access when queueing TREs | *3c5ec66b4b
bus: mhi: host: Drop chan lock before queuing buffers | *2df39ac8f8
bus: mhi: host: Add alignment check for event ring read pointer | *574f69b46b
mips: Fix max_mapnr being uninitialized on early stages | *6690a0acbb
s390/vfio-ap: let on_scan_complete() callback filter matrix and update guest's APCB | *baf3fcb268
s390/vfio-ap: loop over the shadow APCB when filtering guest's AP configuration | *d6b8d034b5
s390/vfio-ap: always filter entire AP matrix | *51a7c02bc7
media: ov9734: Enable runtime PM before registering async sub-device | *f4bb1d5daf
rpmsg: virtio: Free driver_override when rpmsg_remove() | *e8757cd139
media: imx355: Enable runtime PM before registering async sub-device | *8a7729cda2
PM / devfreq: Fix buffer overflow in trans_stat_show | *f4518de40a
s390/vfio-ap: unpin pages on gisc registration failure | *dbc9a791a7
crypto: s390/aes - Fix buffer overread in CTR mode | *aa8aa16ed9
hwrng: core - Fix page fault dead lock on mmap-ed hwrng | *3a081586c7
PM: hibernate: Enforce ordering during image compression/decompression | *680eb0a993
crypto: api - Disallow identical driver names | *562850a008
btrfs: sysfs: validate scrub_speed_max value | *29e2da3eab
OPP: Pass rounded rate to _set_opp() | *4b5f8a187f
arm64: properly install vmlinuz.efi | *852b6b2a2f
ext4: allow for the last group to be marked as trimmed | *137568aa54
iio: adc: ad7091r: Allow users to configure device events | *6f57121e9c
iio: adc: ad7091r: Set alert bit in config register | *fafda9f08a
Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" | *c519a9054b
usb: dwc3: gadget: Handle EP0 request dequeuing properly | *c8fe8ce07f
usb: dwc3: gadget: Queue PM runtime idle on disconnect event | *ce27046883
usb: dwc3: gadget: Refactor EP0 forced stall/restart into a separate API *0eac7b614d
Merge branch 'android14-6.1' into branch 'android14-6.1-lts' *63040ce8e9
Merge branch 'android14-6.1' into branch 'android14-6.1-lts' *50fe3d2012
ANDROID: Add symbols for IIO SCMI module *e666b8755f
ANDROID: Update symbols list for open-dice.ko Change-Id: Icb970da9bfba44d188465ce8c8148858a4a2fb1a Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
501 lines
16 KiB
C
501 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 */
|