History

Merge tag 'v7.1-rc6' into work

Linux 7.1-rc6

Jonathan Cameron committed 5 months ago

Commit c82228f2 parents 3f2d03e e43ffb62186 files · +34139 −16689Browse files

Unified · Split

2186 files
  1. .mailmap +14 −2
  2. Documentation/.renames.txt +1 −0
  3. Documentation/ABI/removed/sysfs-selinux-user +0 −0
  4. Documentation/admin-guide/cgroup-v1/memcg_test.rst +2 −4
  5. Documentation/admin-guide/cgroup-v2.rst +1 −1
  6. Documentation/admin-guide/kernel-parameters.txt +0 −18
  7. Documentation/admin-guide/laptops/uniwill-laptop.rst +10 −0
  8. Documentation/admin-guide/pm/amd-pstate.rst +5 −6
  9. Documentation/admin-guide/pm/intel_pstate.rst +6 −5
  10. Documentation/arch/riscv/cmodx.rst +4 −4
  11. Documentation/arch/riscv/zicfilp.rst +1 −1
  12. Documentation/arch/x86/cpuinfo.rst +4 −0
  13. Documentation/crypto/krb5.rst +13 −4
  14. Documentation/devicetree/bindings/display/msm/dp-controller.yaml +23 −5
  15. Documentation/devicetree/bindings/display/msm/qcom,eliza-mdss.yaml +12 −8
  16. Documentation/devicetree/bindings/display/msm/qcom,sm8650-dpu.yaml +1 −1
  17. Documentation/devicetree/bindings/display/msm/qcom,sm8650-mdss.yaml +1 −1
  18. Documentation/devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml +10 −6
  19. Documentation/devicetree/bindings/i2c/amlogic,meson6-i2c.yaml +9 −4
  20. Documentation/devicetree/bindings/i2c/apple,i2c.yaml +3 −1
  21. Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml +1 −0
  22. Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml +12 −1
  23. Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650-rt5514.yaml +2 −0
  24. Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml +3 −0
  25. Documentation/devicetree/bindings/spi/qcom,spi-qpic-snand.yaml +1 −0
  26. Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml +4 −3
  27. Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml +4 −3
  28. Documentation/filesystems/isofs.rst +1 −1
  29. Documentation/hwmon/sy7636a-hwmon.rst +1 −1
  30. Documentation/hwmon/yogafan.rst +1 −1
  31. Documentation/netlink/genetlink-c.yaml +9 −0
  32. Documentation/netlink/genetlink-legacy.yaml +9 −0
  33. Documentation/netlink/genetlink.yaml +9 −0
  34. Documentation/netlink/netlink-raw.yaml +9 −0
  35. Documentation/netlink/specs/handshake.yaml +8 −0
  36. Documentation/netlink/specs/net_shaper.yaml +7 −0
  37. Documentation/netlink/specs/psp.yaml +2 −0
  38. Documentation/networking/device_drivers/ethernet/3com/3c509.rst +249 −0
  39. Documentation/networking/device_drivers/ethernet/index.rst +1 −0
  40. Documentation/process/index.rst +1 −0
  41. Documentation/process/security-bugs.rst +104 −2
  42. Documentation/process/threat-model.rst +235 −0
  43. Documentation/sound/codecs/cs35l56.rst +1 −1
  44. Documentation/userspace-api/rseq.rst +93 −1
  45. Documentation/virt/kvm/x86/amd-memory-encryption.rst +4 −4
  46. MAINTAINERS +130 −85
  47. Makefile +3 −1
  48. arch/alpha/include/asm/Kbuild +1 −0
  49. arch/arc/include/asm/Kbuild +1 −0
  50. arch/arm/boot/dts/renesas/r7s72100-genmai.dts +0 −3
  51. arch/arm/boot/dts/renesas/r7s72100-rskrza1.dts +0 −2
  52. arch/arm/boot/dts/renesas/r7s72100.dtsi +1 −1
  53. arch/arm/boot/dts/renesas/r8a7778.dtsi +1 −1
  54. arch/arm/boot/dts/renesas/r8a7779.dtsi +1 −1
  55. arch/arm/boot/dts/renesas/r8a7792.dtsi +1 −1
  56. arch/arm/include/asm/Kbuild +1 −0
  57. arch/arm/mach-versatile/integrator_cp.c +4 −9
  58. arch/arm64/boot/dts/renesas/draak-ebisu-panel-aa104xd12.dtso +5 −0
  59. arch/arm64/boot/dts/renesas/r8a78000.dtsi +4 −4
  60. arch/arm64/boot/dts/renesas/r9a09g056.dtsi +1 −0
  61. arch/arm64/boot/dts/renesas/r9a09g057.dtsi +2 −0
  62. arch/arm64/boot/dts/renesas/rz-smarc-cru-csi-ov5645.dtsi +5 −0
  63. arch/arm64/boot/dts/renesas/rz-smarc-du-adv7513.dtsi +5 −0
  64. arch/arm64/boot/dts/renesas/salvator-panel-aa104xd12.dtso +5 −0
  65. arch/arm64/include/asm/insn.h +1 −1
  66. arch/arm64/include/asm/irqflags.h +7 −7
  67. arch/arm64/include/asm/kernel-pgtable.h +6 −1
  68. arch/arm64/include/asm/kvm_asm.h +18 −10
  69. arch/arm64/include/asm/kvm_host.h +2 −5
  70. arch/arm64/include/asm/kvm_nested.h +1 −0
  71. arch/arm64/include/asm/page.h +1 −1
  72. arch/arm64/include/asm/ring_buffer.h +10 −0
  73. arch/arm64/include/asm/sysreg.h +1 −1
  74. arch/arm64/include/asm/tlb.h +2 −1
  75. arch/arm64/kernel/entry-common.c +24 −7
  76. arch/arm64/kernel/pi/patch-scs.c +2 −2
  77. arch/arm64/kernel/ptrace.c +2 −2
  78. arch/arm64/kernel/signal.c +43 −11
  79. arch/arm64/kvm/arm.c +28 −1
  80. arch/arm64/kvm/config.c +16 −7
  81. arch/arm64/kvm/hyp/include/hyp/switch.h +11 −7
  82. arch/arm64/kvm/hyp/nvhe/clock.c +3 −0
  83. arch/arm64/kvm/hyp/nvhe/host.S +1 −1
  84. arch/arm64/kvm/hyp/nvhe/hyp-main.c +17 −13
  85. arch/arm64/kvm/hyp/nvhe/mem_protect.c +46 −1
  86. arch/arm64/kvm/hyp/nvhe/pkvm.c +40 −14
  87. arch/arm64/kvm/hyp/nvhe/setup.c +3 −3
  88. arch/arm64/kvm/hyp/nvhe/trace.c +7 −2
  89. arch/arm64/kvm/hyp/vhe/switch.c +2 −1
  90. arch/arm64/kvm/hyp_trace.c +6 −3
  91. arch/arm64/kvm/mmu.c +21 −8
  92. arch/arm64/kvm/nested.c +5 −0
  93. arch/arm64/kvm/pmu-emul.c +2 −2
  94. arch/arm64/kvm/sys_regs.c +3 −8
  95. arch/arm64/kvm/vgic/vgic-its.c +4 −0
  96. arch/arm64/kvm/vgic/vgic-mmio-v2.c +1 −1
  97. arch/arm64/kvm/vgic/vgic-mmio-v3.c +1 −1
  98. arch/arm64/mm/fault.c +7 −4
  99. arch/csky/include/asm/Kbuild +1 −0
  100. arch/hexagon/include/asm/Kbuild +1 −0
  101. arch/loongarch/Kbuild +1 −1
  102. arch/loongarch/Kconfig +1 −0
  103. arch/loongarch/Makefile +2 −0
  104. arch/loongarch/include/asm/Kbuild +1 −0
  105. arch/loongarch/include/asm/asm-prototypes.h +20 −0
  106. arch/loongarch/include/asm/efi.h +3 −1
  107. arch/loongarch/include/asm/kvm_host.h +0 −3
  108. arch/loongarch/include/asm/linkage.h +1 −1
  109. arch/loongarch/include/asm/paravirt.h +6 −0
  110. arch/loongarch/include/asm/qspinlock.h +1 −4
  111. arch/loongarch/include/asm/vdso/gettimeofday.h +0 −6
  112. arch/loongarch/kernel/kprobes.c +8 −6
  113. arch/loongarch/kernel/relocate.c +50 −0
  114. arch/loongarch/kvm/Makefile +2 −1
  115. arch/loongarch/kvm/exit.c +1 −0
  116. arch/loongarch/kvm/interrupt.c +23 −11
  117. arch/loongarch/kvm/main.c +3 −32
  118. arch/loongarch/kvm/mmu.c +1 −1
  119. arch/loongarch/kvm/switch.S +16 −6
  120. arch/loongarch/kvm/timer.c +8 −2
  121. arch/loongarch/kvm/vm.c +1 −1
  122. arch/loongarch/mm/init.c +0 −4
  123. arch/loongarch/pci/acpi.c +5 −0
  124. arch/loongarch/pci/pci.c +3 −0
  125. arch/loongarch/vdso/Makefile +2 −0
  126. arch/m68k/include/asm/Kbuild +1 −0
  127. arch/microblaze/include/asm/Kbuild +1 −0
  128. arch/mips/dec/platform.c +108 −1
  129. arch/mips/include/asm/Kbuild +1 −0
  130. arch/nios2/include/asm/Kbuild +1 −0
  131. arch/nios2/include/asm/linkage.h +2 −0
  132. arch/openrisc/include/asm/Kbuild +1 −0
  133. arch/parisc/Makefile +11 −5
  134. arch/parisc/include/asm/Kbuild +1 −0
  135. arch/parisc/include/asm/vdso.h +4 −3
  136. arch/parisc/kernel/Makefile +5 −2
  137. arch/parisc/kernel/drivers.c +10 −11
  138. arch/powerpc/Kconfig.debug +1 −2
  139. arch/powerpc/configs/amigaone_defconfig +0 −1
  140. arch/powerpc/configs/chrp32_defconfig +0 −1
  141. arch/powerpc/configs/g5_defconfig +2 −1
  142. arch/powerpc/configs/pasemi_defconfig +0 −1
  143. arch/powerpc/configs/powernv_defconfig +0 −1
  144. arch/powerpc/configs/ppc64_defconfig +0 −1
  145. arch/powerpc/configs/ppc64e_defconfig +0 −1
  146. arch/powerpc/configs/ppc6xx_defconfig +1 −0
  147. arch/powerpc/configs/skiroot_defconfig +0 −1
  148. arch/powerpc/include/asm/Kbuild +1 −0
  149. arch/powerpc/include/asm/pmac_low_i2c.h +0 −4
  150. arch/powerpc/kernel/time.c +4 −2
  151. arch/powerpc/kernel/vdso/Makefile +6 −0
  152. arch/powerpc/kexec/Makefile +1 −1
  153. arch/powerpc/lib/vmx-helper.c +8 −1
  154. arch/powerpc/perf/core-book3s.c +3 −2
  155. arch/powerpc/perf/hv-gpci.c +16 −8
  156. arch/powerpc/platforms/44x/warp.c +2 −0
  157. arch/powerpc/platforms/82xx/km82xx.c +2 −2
  158. arch/powerpc/platforms/8xx/cpm1.c +2 −2
  159. arch/powerpc/platforms/pasemi/pci.c +1 −2
  160. arch/powerpc/platforms/powermac/low_i2c.c +0 −34
  161. arch/powerpc/platforms/ps3/device-init.c +1 −3
  162. arch/powerpc/platforms/pseries/htmdump.c +116 −17
  163. arch/powerpc/platforms/pseries/papr-hvpipe.c +97 −84
  164. arch/powerpc/platforms/pseries/papr-hvpipe.h +0 −1
  165. arch/riscv/Kconfig +22 −0
  166. arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi +0 −10
  167. arch/riscv/boot/dts/microchip/mpfs-icicle-kit-prod.dts +10 −0
  168. arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts +19 −0
  169. arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1 −26
  170. arch/riscv/boot/dts/starfive/jh7110.dtsi +0 −28
  171. arch/riscv/errata/mips/errata.c +1 −1
  172. arch/riscv/include/asm/Kbuild +1 −0
  173. arch/riscv/include/asm/syscall_wrapper.h +4 −0
  174. arch/riscv/kernel/compat_signal.c +2 −0
  175. arch/riscv/kernel/copy-unaligned.S +3 −2
  176. arch/riscv/kernel/cpufeature.c +9 −11
  177. arch/riscv/kernel/ptrace.c +2 −2
  178. arch/riscv/kernel/traps_misaligned.c +1 −1
  179. arch/riscv/kernel/usercfi.c +4 −3
  180. arch/riscv/kernel/vec-copy-unaligned.S +3 −2
  181. arch/riscv/kvm/vcpu_insn.c +4 −5
  182. arch/riscv/kvm/vcpu_pmu.c +8 −4
  183. arch/riscv/kvm/vcpu_sbi_sta.c +1 −1
  184. arch/riscv/kvm/vcpu_sbi_v01.c +2 −0
  185. arch/riscv/mm/init.c +25 −0
  186. arch/s390/include/asm/Kbuild +1 −0
  187. arch/s390/kernel/debug.c +8 −0
  188. arch/s390/kernel/perf_pai.c +21 −10
  189. arch/s390/kernel/topology.c +7 −3
  190. arch/s390/kvm/dat.c +1 −0
  191. arch/s390/kvm/dat.h +2 −1
  192. arch/s390/kvm/gaccess.c +1 −0
  193. arch/s390/kvm/gmap.c +11 −7
  194. arch/s390/kvm/gmap.h +58 −3
  195. arch/s390/kvm/interrupt.c +1 −2
  196. arch/s390/kvm/pci.c +4 −6
  197. arch/s390/mm/fault.c +1 −1
  198. arch/sh/include/asm/Kbuild +1 −0
  199. arch/sh/include/asm/setup.h +1 −1
  200. arch/sparc/include/asm/Kbuild +1 −0
  201. arch/um/include/asm/Kbuild +1 −0
  202. arch/x86/entry/Makefile +1 −1
  203. arch/x86/entry/common.c +61 −0
  204. arch/x86/entry/entry.S +48 −0
  205. arch/x86/entry/entry_64_fred.S +0 −1
  206. arch/x86/entry/vdso/vma.c +1 −1
  207. arch/x86/events/core.c +8 −5
  208. arch/x86/events/intel/core.c +39 −11
  209. arch/x86/events/perf_event.h +10 −0
  210. arch/x86/include/asm/Kbuild +1 −0
  211. arch/x86/include/asm/desc.h +4 −0
  212. arch/x86/include/asm/desc_defs.h +1 −1
  213. arch/x86/include/asm/efi.h +2 −1
  214. arch/x86/include/asm/entry-common.h +2 −0
  215. arch/x86/include/asm/fred.h +0 −1
  216. arch/x86/include/asm/kvm_host.h +1 −0
  217. arch/x86/include/asm/msr-index.h +2 −1
  218. arch/x86/include/asm/processor.h +1 −0
  219. arch/x86/kernel/acpi/cppc.c +3 −3
  220. arch/x86/kernel/cpu/amd.c +3 −0
  221. arch/x86/kernel/cpu/cpuid-deps.c +1 −0
  222. arch/x86/kernel/cpu/mce/core.c +5 −28
  223. arch/x86/kernel/cpu/microcode/amd.c +2 −2
  224. arch/x86/kernel/cpu/microcode/core.c +10 −12
  225. arch/x86/kernel/cpu/microcode/intel.c +3 −0
  226. arch/x86/kernel/cpu/microcode/internal.h +0 −1
  227. arch/x86/kernel/e820.c +5 −1
  228. arch/x86/kernel/fpu/signal.c +8 −3
  229. arch/x86/kernel/ftrace.c +7 −0
  230. arch/x86/kernel/idt.c +7 −0
  231. arch/x86/kernel/nmi.c +0 −1
  232. arch/x86/kernel/relocate_kernel_64.S +8 −0
  233. arch/x86/kvm/emulate.c +1 −1
  234. arch/x86/kvm/hyperv.c +1 −1
  235. arch/x86/kvm/lapic.c +13 −11
  236. arch/x86/kvm/mmu/mmu.c +33 −21
  237. arch/x86/kvm/svm/avic.c +36 −11
  238. arch/x86/kvm/svm/nested.c +14 −29
  239. arch/x86/kvm/svm/sev.c +65 −26
  240. arch/x86/kvm/svm/svm.c +13 −2
  241. arch/x86/kvm/trace.h +1 −1
  242. arch/x86/kvm/vmx/capabilities.h +1 −0
  243. arch/x86/kvm/vmx/vmenter.S +0 −46
  244. arch/x86/kvm/vmx/vmx.c +49 −27
  245. arch/x86/kvm/x86.c +11 −4
  246. arch/x86/mm/fault.c +1 −1
  247. arch/x86/platform/efi/quirks.c +11 −2
  248. arch/x86/virt/hw.c +14 −1
  249. arch/x86/xen/mmu_pv.c +6 −2
  250. arch/x86/xen/setup.c +10 −5
  251. arch/xtensa/include/asm/Kbuild +1 −0
  252. block/bio-integrity-fs.c +5 −1
  253. block/bio-integrity.c +18 −1
  254. block/bio.c +15 −12
  255. block/blk-cgroup.c +1 −1
  256. block/blk-mq.c +28 −25
  257. block/blk-zoned.c +30 −9
  258. block/ioctl.c +15 −9
  259. crypto/authencesn.c +5 −0
  260. crypto/krb5/krb5_api.c +48 −6
  261. drivers/accel/amdxdna/aie2_pci.c +5 −0
  262. drivers/accel/amdxdna/amdxdna_gem.c +8 −1
  263. drivers/accel/amdxdna/amdxdna_gem.h +2 −0
  264. drivers/accel/amdxdna/amdxdna_ubuf.c +0 −50
  265. drivers/accel/ivpu/ivpu_debugfs.c +1 −1
  266. drivers/accel/ivpu/ivpu_drv.c +21 −0
  267. drivers/accel/qaic/qaic_data.c +21 −2
  268. drivers/accel/qaic/qaic_ras.c +2 −2
  269. drivers/accel/rocket/rocket_gem.c +14 −5
  270. drivers/acpi/ac.c +5 −1
  271. drivers/acpi/acpi_pad.c +5 −1
  272. drivers/acpi/acpi_tad.c +24 −17
  273. drivers/acpi/acpica/evxfgpe.c +41 −9
  274. drivers/acpi/apei/einj-core.c +25 −20
  275. drivers/acpi/arm64/cpuidle.c +3 −7
  276. drivers/acpi/battery.c +8 −2
  277. drivers/acpi/button.c +31 −3
  278. drivers/acpi/cppc_acpi.c +3 −3
  279. drivers/acpi/ec.c +5 −1
  280. drivers/acpi/hed.c +5 −1
  281. drivers/acpi/nfit/core.c +5 −1
  282. drivers/acpi/pfr_telemetry.c +5 −1
  283. drivers/acpi/pfr_update.c +5 −1
  284. drivers/acpi/sbs.c +5 −1
  285. drivers/acpi/sbshc.c +5 −1
  286. drivers/acpi/thermal.c +1 −1
  287. drivers/acpi/tiny-power-button.c +5 −1
  288. drivers/acpi/video_detect.c +8 −0
  289. drivers/android/binder/allocation.rs +8 −0
  290. drivers/android/binder/process.rs +6 −1
  291. drivers/android/binder/range_alloc/array.rs +0 −1
  292. drivers/android/binder/transaction.rs +10 −1
  293. drivers/ata/libata-core.c +6 −3
  294. drivers/ata/libata-eh.c +4 −4
  295. drivers/ata/libata-pmp.c +16 −2
  296. drivers/ata/libata-scsi.c +52 −37
  297. drivers/ata/pata_parport/pata_parport.c +7 −14
  298. drivers/ata/sata_sil24.c +5 −1
  299. drivers/base/memory.c +6 −2
  300. drivers/base/platform.c +15 −1
  301. drivers/base/regmap/regmap-sdw-mbq.c +1 −1
  302. drivers/base/regmap/regmap.c +3 −0
  303. drivers/block/rbd.c +8 −12
  304. drivers/block/ublk_drv.c +38 −7
  305. drivers/block/zram/zram_drv.c +5 −1
  306. drivers/bluetooth/btintel_pcie.c +16 −17
  307. drivers/bluetooth/btintel_pcie.h +1 −4
  308. drivers/bluetooth/btmtk.c +15 −2
  309. drivers/bluetooth/btusb.c +7 −1
  310. drivers/bluetooth/hci_ath.c +3 −0
  311. drivers/bluetooth/hci_bcsp.c +3 −0
  312. drivers/bluetooth/hci_h4.c +3 −0
  313. drivers/bluetooth/hci_h5.c +3 −0
  314. drivers/bluetooth/hci_ldisc.c +40 −8
  315. drivers/bluetooth/hci_qca.c +18 −19
  316. drivers/bluetooth/virtio_bt.c +32 −7
  317. drivers/cdrom/cdrom.c +48 −25
  318. drivers/char/ipmi/ipmi_si_intf.c +56 −14
  319. drivers/char/ipmi/ipmi_ssif.c +22 −2
  320. drivers/clk/clk-eyeq.c +15 −45
  321. drivers/clk/clk-rk808.c +1 −1
  322. drivers/clk/spacemit/ccu-k3.c +1 −1
  323. drivers/comedi/drivers/comedi_test.c +3 −2
  324. drivers/counter/counter-core.c +2 −1
  325. drivers/cpufreq/Kconfig.x86 +0 −12
  326. drivers/cpufreq/amd-pstate-ut.c +38 −12
  327. drivers/cpufreq/amd-pstate.c +18 −9
  328. drivers/cpufreq/intel_pstate.c +2 −1
  329. drivers/dma-buf/dma-buf.c +5 −1
  330. drivers/dpll/dpll_netlink.c +21 −2
  331. drivers/dpll/dpll_netlink.h +0 −2
  332. drivers/dpll/zl3073x/core.c +8 −11
  333. drivers/dpll/zl3073x/core.h +3 −1
  334. drivers/dpll/zl3073x/dpll.c +27 −34
  335. drivers/dpll/zl3073x/dpll.h +0 −4
  336. drivers/edac/versalnet_edac.c +2 −8
  337. drivers/firmware/arm_ffa/bus.c +3 −1
  338. drivers/firmware/arm_ffa/driver.c +101 −43
  339. drivers/firmware/efi/efi-pstore.c +3 −1
  340. drivers/firmware/efi/efi.c +16 −12
  341. drivers/firmware/efi/libstub/Makefile +1 −1
  342. drivers/firmware/efi/libstub/efi-stub-helper.c +4 −0
  343. drivers/firmware/efi/libstub/efistub.h +0 −7
  344. drivers/firmware/efi/libstub/loongarch-stub.c +80 −0
  345. drivers/firmware/efi/libstub/loongarch.c +21 −0
  346. drivers/firmware/efi/libstub/mem.c +82 −0
  347. drivers/firmware/efi/libstub/relocate.c +0 −166
  348. drivers/firmware/efi/sysfb_efi.c +6 −3
  349. drivers/firmware/psci/psci.c +10 −0
  350. drivers/fwctl/pds/main.c +3 −0
  351. drivers/gpio/gpio-adnp.c +3 −1
  352. drivers/gpio/gpio-aggregator.c +11 −4
  353. drivers/gpio/gpio-mxc.c +1 −1
  354. drivers/gpio/gpio-pca953x.c +1 −1
  355. drivers/gpio/gpio-rockchip.c +17 −6
  356. drivers/gpio/gpio-shared-proxy.c +9 −0
  357. drivers/gpio/gpio-sim.c +7 −4
  358. drivers/gpio/gpio-virtuser.c +8 −5
  359. drivers/gpio/gpiolib-cdev.c +13 −0
  360. drivers/gpio/gpiolib-shared.c +3 −6
  361. drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 −1
  362. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +25 −0
  363. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +1 −0
  364. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12 −3
  365. drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +2 −4
  366. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +6 −11
  367. drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +10 −3
  368. drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +15 −4
  369. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 −1
  370. drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +8 −1
  371. drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +9 −8
  372. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +24 −33
  373. drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +2 −1
  374. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +2 −1
  375. drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +1 −1
  376. drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +21 −8
  377. drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c +8 −5
  378. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3 −0
  379. drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +2 −0
  380. drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +204 −331
  381. drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h +41 −20
  382. drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +146 −176
  383. drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.h +1 −4
  384. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +20 −6
  385. drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +6 −1
  386. drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 −9
  387. drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +8 −9
  388. drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +1 −10
  389. drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +66 −0
  390. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 −3
  391. drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +1 −0
  392. drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +2 −0
  393. drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +1 −0
  394. drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +1 −0
  395. drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +1 −0
  396. drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c +1 −0
  397. drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c +1 −0
  398. drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c +1 −0
  399. drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_2.c +1 −0
  400. drivers/gpu/drm/amd/amdgpu/jpeg_v5_3_0.c +1 −0
  401. drivers/gpu/drm/amd/amdgpu/mes_userqueue.c +69 −71
  402. drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 −2
  403. drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 −10
  404. drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +1 −10
  405. drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c +10 −0
  406. drivers/gpu/drm/amd/amdgpu/vce_v1_0.c +39 −25
  407. drivers/gpu/drm/amd/amdgpu/vce_v2_0.c +7 −2
  408. drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +1 −1
  409. drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2 −0
  410. drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2 −0
  411. drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +6 −1
  412. drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +4 −1
  413. drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +1 −0
  414. drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +1 −0
  415. drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +1 −0
  416. drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c +1 −0
  417. drivers/gpu/drm/amd/amdgpu/vcn_v5_0_2.c +1 −0
  418. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +53 −9
  419. drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 −32
  420. drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +17 −6
  421. drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +8 −3
  422. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +7 −3
  423. drivers/gpu/drm/amd/amdkfd/kfd_svm.c +16 −2
  424. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +20 −4
  425. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +44 −0
  426. drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +72 −1
  427. drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +9 −0
  428. drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c +6 −3
  429. drivers/gpu/drm/amd/display/dc/core/dc.c +5 −1
  430. drivers/gpu/drm/amd/display/dc/dc.h +1 −1
  431. drivers/gpu/drm/amd/display/dc/dc_bios_types.h +2 −1
  432. drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c +13 −2
  433. drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +3 −1
  434. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mmhubbub.c +2 −2
  435. drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +3 −0
  436. drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +59 −35
  437. drivers/gpu/drm/amd/display/dc/link/link_factory.c +3 −1
  438. drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c +2 −1
  439. drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c +2 −1
  440. drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +7 −1
  441. drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +4 −0
  442. drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c +4 −0
  443. drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c +7 −6
  444. drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1 −0
  445. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 −0
  446. drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +2 −0
  447. drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +1 −1
  448. drivers/gpu/drm/bridge/chipone-icn6211.c +3 −1
  449. drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +23 −17
  450. drivers/gpu/drm/bridge/ite-it66121.c +5 −0
  451. drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +10 −6
  452. drivers/gpu/drm/bridge/tda998x_drv.c +2 −2
  453. drivers/gpu/drm/drm_color_mgmt.c +1 −1
  454. drivers/gpu/drm/drm_drv.c +2 −0
  455. drivers/gpu/drm/drm_dumb_buffers.c +12 −2
  456. drivers/gpu/drm/drm_fb_helper.c +1 −1
  457. drivers/gpu/drm/drm_gem.c +42 −24
  458. drivers/gpu/drm/drm_gem_framebuffer_helper.c +2 −2
  459. drivers/gpu/drm/etnaviv/etnaviv_sched.c +9 −7
  460. drivers/gpu/drm/exynos/exynos_drm_mic.c +3 −5
  461. drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 −0
  462. drivers/gpu/drm/gma500/oaktrail_lvds.c +7 −2
  463. drivers/gpu/drm/hyperv/hyperv_drm_proto.c +97 −16
  464. drivers/gpu/drm/i915/display/intel_color.c +1 −1
  465. drivers/gpu/drm/i915/display/intel_display_core.h +1 −0
  466. drivers/gpu/drm/i915/display/intel_display_irq.c +6 −2
  467. drivers/gpu/drm/i915/display/intel_display_types.h +3 −0
  468. drivers/gpu/drm/i915/display/intel_dp.c +8 −3
  469. drivers/gpu/drm/i915/display/intel_dp_aux.c +16 −4
  470. drivers/gpu/drm/i915/display/intel_dpcd.h +15 −0
  471. drivers/gpu/drm/i915/display/intel_plane.c +1 −1
  472. drivers/gpu/drm/i915/display/intel_psr.c +49 −20
  473. drivers/gpu/drm/i915/gem/i915_gem_ttm.c +16 −12
  474. drivers/gpu/drm/i915/gt/intel_reset.c +2 −1
  475. drivers/gpu/drm/i915/i915_driver.c +2 −3
  476. drivers/gpu/drm/imagination/pvr_fw_trace.c +1 −1
  477. drivers/gpu/drm/loongson/lsdc_drv.c +1 −1
  478. drivers/gpu/drm/mediatek/mtk_cec.c +1 −1
  479. drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c +1 −1
  480. drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c +1 −1
  481. drivers/gpu/drm/mediatek/mtk_hdmi_v2.c +1 −1
  482. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +4 −3
  483. drivers/gpu/drm/msm/adreno/a6xx_hfi.c +2 −0
  484. drivers/gpu/drm/msm/adreno/adreno_device.c +1 −1
  485. drivers/gpu/drm/msm/adreno/adreno_gpu.c +7 −1
  486. drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_13_0_kaanapali.h +1 −1
  487. drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +7 −5
  488. drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c +2 −1
  489. drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +20 −8
  490. drivers/gpu/drm/msm/dsi/dsi_host.c +1 −0
  491. drivers/gpu/drm/msm/msm_drv.c +5 −6
  492. drivers/gpu/drm/msm/msm_drv.h +0 −7
  493. drivers/gpu/drm/msm/msm_gem.c +16 −17
  494. drivers/gpu/drm/msm/msm_gem_shrinker.c +18 −26
  495. drivers/gpu/drm/msm/msm_gem_submit.c +3 −3
  496. drivers/gpu/drm/msm/msm_gem_vma.c +6 −6
  497. drivers/gpu/drm/msm/msm_gpu.c +2 −2
  498. drivers/gpu/drm/msm/msm_iommu.c +3 −2
  499. drivers/gpu/drm/msm/msm_ringbuffer.c +3 −3
  500. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +9 −2
  501. drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c +4 −0
  502. drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c +5 −13
  503. drivers/gpu/drm/panel/Kconfig +1 −0
  504. drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +2 −0
  505. drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +1 −3
  506. drivers/gpu/drm/panel/panel-himax-hx83102.c +2 −0
  507. drivers/gpu/drm/panel/panel-himax-hx83121a.c +2 −2
  508. drivers/gpu/drm/panfrost/panfrost_drv.c +2 −0
  509. drivers/gpu/drm/qxl/qxl_drv.c +4 −2
  510. drivers/gpu/drm/radeon/ci_dpm.c +6 −3
  511. drivers/gpu/drm/radeon/evergreen_cs.c +4 −2
  512. drivers/gpu/drm/sti/sti_hda.c +4 −4
  513. drivers/gpu/drm/sysfb/ofdrm.c +2 −0
  514. drivers/gpu/drm/tiny/appletbdrm.c +2 −2
  515. drivers/gpu/drm/tiny/bochs.c +3 −7
  516. drivers/gpu/drm/ttm/ttm_bo.c +7 −11
  517. drivers/gpu/drm/ttm/ttm_bo_util.c +3 −8
  518. drivers/gpu/drm/ttm/ttm_pool.c +12 −6
  519. drivers/gpu/drm/ttm/ttm_resource.c +17 −1
  520. drivers/gpu/drm/udl/udl_main.c +1 −2
  521. drivers/gpu/drm/udl/udl_modeset.c +4 −1
  522. drivers/gpu/drm/v3d/v3d_sched.c +1 −15
  523. drivers/gpu/drm/v3d/v3d_submit.c +19 −3
  524. drivers/gpu/drm/virtio/virtgpu_drv.h +1 −0
  525. drivers/gpu/drm/virtio/virtgpu_gem.c +17 −0
  526. drivers/gpu/drm/virtio/virtgpu_plane.c +8 −2
  527. drivers/gpu/drm/xe/Makefile +1 −0
  528. drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +10 −2
  529. drivers/gpu/drm/xe/regs/xe_gt_regs.h +4 −2
  530. drivers/gpu/drm/xe/xe_bo.c +9 −5
  531. drivers/gpu/drm/xe/xe_bo.h +86 −2
  532. drivers/gpu/drm/xe/xe_bo_types.h +27 −4
  533. drivers/gpu/drm/xe/xe_dma_buf.c +37 −28
  534. drivers/gpu/drm/xe/xe_eu_stall.c +2 −2
  535. drivers/gpu/drm/xe/xe_exec_queue.c +6 −3
  536. drivers/gpu/drm/xe/xe_gsc.c +2 −5
  537. drivers/gpu/drm/xe/xe_gt_sriov_pf_migration.c +4 −4
  538. drivers/gpu/drm/xe/xe_gt_sriov_pf_monitor.c +5 −1
  539. drivers/gpu/drm/xe/xe_gt_sriov_pf_monitor.h +1 −1
  540. drivers/gpu/drm/xe/xe_gt_sriov_vf.c +18 −6
  541. drivers/gpu/drm/xe/xe_gt_sriov_vf.h +3 −3
  542. drivers/gpu/drm/xe/xe_gt_types.h +7 −0
  543. drivers/gpu/drm/xe/xe_guc_ads.c +6 −4
  544. drivers/gpu/drm/xe/xe_guc_submit.c +17 −32
  545. drivers/gpu/drm/xe/xe_lrc.c +10 −3
  546. drivers/gpu/drm/xe/xe_lrc.h +1 −1
  547. drivers/gpu/drm/xe/xe_mem_pool.c +403 −0
  548. drivers/gpu/drm/xe/xe_mem_pool.h +35 −0
  549. drivers/gpu/drm/xe/xe_mem_pool_types.h +21 −0
  550. drivers/gpu/drm/xe/xe_memirq.c +22 −4
  551. drivers/gpu/drm/xe/xe_migrate.c +33 −41
  552. drivers/gpu/drm/xe/xe_oa.c +4 −2
  553. drivers/gpu/drm/xe/xe_pci.c +10 −0
  554. drivers/gpu/drm/xe/xe_reg_whitelist.c +1 −1
  555. drivers/gpu/drm/xe/xe_sriov_pf_migration.c +4 −3
  556. drivers/gpu/drm/xe/xe_sriov_vf_ccs.c +29 −25
  557. drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h +1 −4
  558. drivers/gpu/drm/xe/xe_tile_types.h +0 −2
  559. drivers/gpu/drm/xe/xe_tuning.c +2 −2
  560. drivers/gpu/drm/xe/xe_vm.c +46 −10
  561. drivers/gpu/drm/xe/xe_vm_madvise.c +57 −152
  562. drivers/gpu/drm/xe/xe_vm_madvise.h +0 −2
  563. drivers/gpu/drm/xe/xe_wa.c +3 −11
  564. drivers/hid/bpf/hid_bpf_dispatch.c +4 −2
  565. drivers/hid/hid-appletb-kbd.c +36 −20
  566. drivers/hid/hid-core.c +53 −14
  567. drivers/hid/hid-elan.c +1 −0
  568. drivers/hid/hid-ft260.c +14 −2
  569. drivers/hid/hid-gfrm.c +2 −2
  570. drivers/hid/hid-google-hammer.c +1 −1
  571. drivers/hid/hid-ids.h +5 −0
  572. drivers/hid/hid-lenovo-go-s.c +50 −5
  573. drivers/hid/hid-lenovo-go.c +3 −3
  574. drivers/hid/hid-lenovo.c +3 −2
  575. drivers/hid/hid-logitech-hidpp.c +39 −1
  576. drivers/hid/hid-magicmouse.c +16 −0
  577. drivers/hid/hid-mcp2221.c +7 −0
  578. drivers/hid/hid-multitouch.c +1 −1
  579. drivers/hid/hid-playstation.c +4 −2
  580. drivers/hid/hid-primax.c +1 −1
  581. drivers/hid/hid-quirks.c +2 −1
  582. drivers/hid/hid-sjoy.c +6 −6
  583. drivers/hid/hid-sony.c +5 −10
  584. drivers/hid/hid-u2fzero.c +13 −9
  585. drivers/hid/hid-uclogic-core.c +3 −1
  586. drivers/hid/hid-vivaldi-common.c +1 −1
  587. drivers/hid/i2c-hid/i2c-hid-core.c +6 −3
  588. drivers/hid/intel-thc-hid/intel-quickspi/quickspi-protocol.c +2 −2
  589. drivers/hid/usbhid/hid-core.c +6 −5
  590. drivers/hid/usbhid/hid-pidff.c +5 −2
  591. drivers/hid/wacom_sys.c +13 −6
  592. drivers/hid/wacom_wac.h +1 −0
  593. drivers/hwmon/Makefile +0 −1
  594. drivers/hwmon/acpi_power_meter.c +5 −1
  595. drivers/hwmon/ads7871.c +5 −1
  596. drivers/hwmon/asus_atk0110.c +6 −1
  597. drivers/hwmon/corsair-psu.c +2 −2
  598. drivers/hwmon/lenovo-ec-sensors.c +7 −13
  599. drivers/hwmon/lm63.c +30 −9
  600. drivers/hwmon/lm75.c +5 −5
  601. drivers/hwmon/lm90.c +22 −4
  602. drivers/hwmon/ltc2992.c +33 −10
  603. drivers/hwmon/pmbus/adm1266.c +33 −13
  604. drivers/i2c/busses/i2c-davinci.c +1 −1
  605. drivers/i2c/busses/i2c-stm32f7.c +3 −3
  606. drivers/i2c/busses/i2c-tegra.c +9 −10
  607. drivers/i2c/busses/i2c-virtio.c +2 −0
  608. drivers/i2c/i2c-core-acpi.c +1 −0
  609. drivers/i2c/i2c-core-base.c +1 −2
  610. drivers/i2c/i2c-core-smbus.c +13 −0
  611. drivers/i2c/i2c-dev.c +5 −4
  612. drivers/i2c/i2c-slave-testunit.c +2 −2
  613. drivers/i2c/i2c-stub.c +5 −0
  614. drivers/iio/adc/ad4695.c +8 −15
  615. drivers/iio/adc/meson_saradc.c +3 −1
  616. drivers/iio/adc/mt6359-auxadc.c +1 −0
  617. drivers/iio/adc/npcm_adc.c +8 −17
  618. drivers/iio/adc/nxp-sar-adc.c +20 −4
  619. drivers/iio/adc/qcom-spmi-adc5-gen3.c +1 −1
  620. drivers/iio/adc/viperboard_adc.c +3 −1
  621. drivers/iio/adc/xilinx-xadc-core.c +9 −2
  622. drivers/iio/buffer/industrialio-hw-consumer.c +2 −2
  623. drivers/iio/chemical/mhz19b.c +17 −0
  624. drivers/iio/chemical/scd30_core.c +1 −1
  625. drivers/iio/common/ssp_sensors/ssp_dev.c +1 −0
  626. drivers/iio/dac/ad3530r.c +40 −14
  627. drivers/iio/dac/ad5686.c +42 −14
  628. drivers/iio/dac/ad5686.h +1 −0
  629. drivers/iio/dac/max5821.c +8 −1
  630. drivers/iio/gyro/adis16260.c +3 −0
  631. drivers/iio/gyro/itg3200_buffer.c +1 −1
  632. drivers/iio/imu/adis16550.c +1 −1
  633. drivers/iio/industrialio-buffer.c +1 −0
  634. drivers/iio/inkern.c +5 −1
  635. drivers/iio/light/cm3323.c +2 −3
  636. drivers/iio/light/veml6070.c +2 −12
  637. drivers/iio/magnetometer/st_magn_core.c +11 −2
  638. drivers/iio/pressure/bmp280-core.c +1 −1
  639. drivers/iio/temperature/tsys01.c +1 −1
  640. drivers/infiniband/core/addr.c +1 −1
  641. drivers/infiniband/core/ib_core_uverbs.c +87 −0
  642. drivers/infiniband/core/nldev.c +3 −0
  643. drivers/infiniband/core/uverbs.h +34 −0
  644. drivers/infiniband/core/uverbs_cmd.c +7 −2
  645. drivers/infiniband/core/uverbs_ioctl.c +14 −134
  646. drivers/infiniband/hw/bnxt_re/ib_verbs.c +1 −1
  647. drivers/infiniband/hw/hfi1/pio.c +4 −1
  648. drivers/infiniband/hw/hfi1/sdma.c +3 −1
  649. drivers/infiniband/hw/hns/hns_roce_qp.c +10 −3
  650. drivers/infiniband/hw/hns/hns_roce_srq.c +6 −6
  651. drivers/infiniband/hw/ionic/ionic_ibdev.c +1 −1
  652. drivers/infiniband/hw/mana/cq.c +3 −2
  653. drivers/infiniband/hw/mana/main.c +1 −0
  654. drivers/infiniband/hw/mana/qp.c +10 −6
  655. drivers/infiniband/hw/mlx4/srq.c +3 −1
  656. drivers/infiniband/hw/mlx5/main.c +5 −4
  657. drivers/infiniband/hw/mlx5/qp.c +6 −1
  658. drivers/infiniband/hw/mlx5/qpc.c +8 −1
  659. drivers/infiniband/hw/mlx5/srq_cmd.c +8 −1
  660. drivers/infiniband/hw/mlx5/umr.c +2 −2
  661. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +4 −4
  662. drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c +1 −1
  663. drivers/infiniband/sw/rxe/rxe_recv.c +11 −0
  664. drivers/infiniband/sw/rxe/rxe_resp.c +13 −1
  665. drivers/infiniband/sw/siw/siw_qp_rx.c +15 −0
  666. drivers/infiniband/ulp/ipoib/ipoib_main.c +5 −3
  667. drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c +1 −1
  668. drivers/input/gameport/fm801-gp.c +2 −2
  669. drivers/input/joystick/xpad.c +10 −4
  670. drivers/input/misc/atlas_btns.c +5 −1
  671. drivers/input/misc/ims-pcu.c +1 −1
  672. drivers/input/mouse/elan_i2c_core.c +8 −0
  673. drivers/input/mouse/elan_i2c_i2c.c +1 −1
  674. drivers/input/mouse/synaptics.c +1 −0
  675. drivers/input/touchscreen/atmel_mxt_ts.c +10 −3
  676. drivers/input/touchscreen/usbtouchscreen.c +5 −0
  677. drivers/iommu/amd/amd_iommu.h +3 −0
  678. drivers/iommu/amd/amd_iommu_types.h +13 −8
  679. drivers/iommu/amd/debugfs.c +5 −4
  680. drivers/iommu/amd/init.c +88 −35
  681. drivers/iommu/amd/iommu.c +9 −4
  682. drivers/iommu/amd/ppr.c +5 −3
  683. drivers/iommu/generic_pt/iommu_pt.h +15 −9
  684. drivers/iommu/intel/cache.c +19 −32
  685. drivers/iommu/intel/iommu.c +10 −6
  686. drivers/iommu/io-pgtable-arm-v7s.c +12 −6
  687. drivers/iommu/iommu-pages.h +1 −1
  688. drivers/iommu/iommu.c +217 −88
  689. drivers/irqchip/exynos-combiner.c +3 −3
  690. drivers/irqchip/irq-ath79-cpu.c +0 −7
  691. drivers/irqchip/irq-gic-v5-its.c +8 −26
  692. drivers/irqchip/irq-gic-v5.c +52 −46
  693. drivers/irqchip/irq-meson-gpio.c +1 −2
  694. drivers/irqchip/irq-renesas-rzt2h.c +1 −1
  695. drivers/irqchip/irq-riscv-imsic-early.c +2 −0
  696. drivers/mailbox/cix-mailbox.c +2 −4
  697. drivers/mailbox/exynos-mailbox.c +0 −4
  698. drivers/mailbox/hi3660-mailbox.c +0 −2
  699. drivers/mailbox/hi6220-mailbox.c +5 −9
  700. drivers/mailbox/imx-mailbox.c +1 −3
  701. drivers/mailbox/mailbox-sti.c +0 −2
  702. drivers/mailbox/mailbox-test.c +46 −34
  703. drivers/mailbox/mailbox.c +44 −23
  704. drivers/mailbox/mailbox.h +0 −12
  705. drivers/mailbox/mtk-cmdq-mailbox.c +5 −5
  706. drivers/mailbox/mtk-vcp-mailbox.c +1 −1
  707. drivers/mailbox/omap-mailbox.c +1 −3
  708. drivers/mailbox/pcc.c +0 −2
  709. drivers/mailbox/rockchip-mailbox.c +2 −7
  710. drivers/mailbox/tegra-hsp.c +2 −4
  711. drivers/md/dm-vdo/vdo.c +2 −2
  712. drivers/md/md-bitmap.c +119 −12
  713. drivers/md/md-bitmap.h +1 −1
  714. drivers/md/md-llbitmap.c +6 −1
  715. drivers/md/md.c +102 −80
  716. drivers/md/md.h +4 −2
  717. drivers/md/persistent-data/dm-btree-remove.c +8 −0
  718. drivers/md/raid1-10.c +6 −1
  719. drivers/md/raid1.c +4 −11
  720. drivers/md/raid10.c +2 −0
  721. drivers/md/raid5.c +6 −1
  722. drivers/media/platform/qcom/camss/camss-csid-gen3.c +3 −3
  723. drivers/media/platform/qcom/camss/camss-csiphy.c +7 −3
  724. drivers/media/platform/qcom/camss/camss.c +40 −40
  725. drivers/media/platform/qcom/iris/Kconfig +1 −1
  726. drivers/media/platform/qcom/iris/iris_buffer.c +4 −2
  727. drivers/media/platform/qcom/iris/iris_core.c +4 −0
  728. drivers/media/platform/qcom/iris/iris_hfi_common.c +4 −0
  729. drivers/media/platform/qcom/iris/iris_hfi_queue.c +1 −1
  730. drivers/media/platform/qcom/iris/iris_vdec.c +0 −6
  731. drivers/media/platform/qcom/iris/iris_vdec.h +0 −1
  732. drivers/media/platform/qcom/iris/iris_venc.c +0 −6
  733. drivers/media/platform/qcom/iris/iris_venc.h +0 −1
  734. drivers/media/platform/qcom/iris/iris_vidc.c +2 −4
  735. drivers/media/platform/qcom/iris/iris_vpu2.c +1 −0
  736. drivers/media/platform/qcom/iris/iris_vpu3x.c +3 −6
  737. drivers/media/platform/qcom/iris/iris_vpu4x.c +13 −11
  738. drivers/media/platform/qcom/iris/iris_vpu_buffer.h +1 −1
  739. drivers/media/platform/qcom/iris/iris_vpu_common.c +10 −6
  740. drivers/media/platform/qcom/iris/iris_vpu_common.h +3 −0
  741. drivers/media/platform/qcom/venus/Kconfig +1 −1
  742. drivers/media/platform/renesas/vsp1/vsp1_brx.c +2 −8
  743. drivers/media/platform/renesas/vsp1/vsp1_entity.c +1 −1
  744. drivers/media/rc/igorplugusb.c +1 −1
  745. drivers/media/rc/ttusbir.c +1 −1
  746. drivers/misc/rp1/rp1_pci.c +1 −0
  747. drivers/mtd/nand/spi/core.c +21 −3
  748. drivers/mtd/nand/spi/winbond.c +3 −3
  749. drivers/mtd/spi-nor/debugfs.c +3 −1
  750. drivers/net/bareudp.c +3 −0
  751. drivers/net/bonding/bond_3ad.c +60 −49
  752. drivers/net/bonding/bond_main.c +11 −3
  753. drivers/net/bonding/bond_netlink.c +10 −6
  754. drivers/net/bonding/bond_procfs.c +2 −1
  755. drivers/net/bonding/bond_sysfs_slave.c +11 −6
  756. drivers/net/dsa/mt7530.c +165 −70
  757. drivers/net/dsa/mt7530.h +8 −0
  758. drivers/net/ethernet/3com/3c509.c +1543 −0
  759. drivers/net/ethernet/3com/Kconfig +14 −0
  760. drivers/net/ethernet/3com/Makefile +1 −0
  761. drivers/net/ethernet/airoha/airoha_eth.c +38 −29
  762. drivers/net/ethernet/airoha/airoha_eth.h +5 −0
  763. drivers/net/ethernet/amazon/ena/ena_com.c +5 −2
  764. drivers/net/ethernet/amazon/ena/ena_phc.c +4 −1
  765. drivers/net/ethernet/amd/pds_core/debugfs.c +6 −1
  766. drivers/net/ethernet/amd/pds_core/dev.c +9 −2
  767. drivers/net/ethernet/amd/pds_core/devlink.c +4 −2
  768. drivers/net/ethernet/amd/xgbe/xgbe.h +2 −2
  769. drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +3 −1
  770. drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +1 −1
  771. drivers/net/ethernet/atheros/ag71xx.c +3 −0
  772. drivers/net/ethernet/broadcom/bnxt/bnxt.c +12 −4
  773. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +5 −24
  774. drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +8 −2
  775. drivers/net/ethernet/broadcom/genet/bcmgenet.c +4 −5
  776. drivers/net/ethernet/cirrus/cs89x0.c +0 −2
  777. drivers/net/ethernet/cortina/gemini.c +19 −2
  778. drivers/net/ethernet/freescale/enetc/enetc.h +1 −0
  779. drivers/net/ethernet/freescale/enetc/enetc_hw.h +12 −3
  780. drivers/net/ethernet/freescale/enetc/enetc_msg.c +58 −48
  781. drivers/net/ethernet/freescale/enetc/enetc_pf.c +56 −19
  782. drivers/net/ethernet/freescale/enetc/enetc_pf.h +1 −0
  783. drivers/net/ethernet/freescale/enetc/enetc_vf.c +34 −8
  784. drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c +3 −0
  785. drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c +3 −3
  786. drivers/net/ethernet/ibm/ibmveth.c +22 −0
  787. drivers/net/ethernet/ibm/ibmveth.h +1 −0
  788. drivers/net/ethernet/intel/i40e/i40e.h +1 −0
  789. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −0
  790. drivers/net/ethernet/intel/i40e/i40e_ptp.c +2 −1
  791. drivers/net/ethernet/intel/iavf/iavf.h +4 −5
  792. drivers/net/ethernet/intel/iavf/iavf_main.c +12 −40
  793. drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +36 −40
  794. drivers/net/ethernet/intel/ice/devlink/devlink.c +2 −0
  795. drivers/net/ethernet/intel/ice/ice_common.c +0 −2
  796. drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 −2
  797. drivers/net/ethernet/intel/ice/ice_dpll.c +139 −12
  798. drivers/net/ethernet/intel/ice/ice_dpll.h +16 −16
  799. drivers/net/ethernet/intel/ice/ice_main.c +10 −2
  800. drivers/net/ethernet/intel/ice/ice_ptp_hw.c +26 −7
  801. drivers/net/ethernet/intel/ice/ice_vf_lib.c +6 −1
  802. drivers/net/ethernet/intel/ice/virt/queues.c +1 −1
  803. drivers/net/ethernet/intel/idpf/idpf_idc.c +6 −0
  804. drivers/net/ethernet/intel/idpf/idpf_ptp.c +2 −2
  805. drivers/net/ethernet/intel/igc/igc_tsn.c +8 −1
  806. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 −0
  807. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +6 −1
  808. drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c +10 −23
  809. drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c +250 −124
  810. drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h +12 −12
  811. drivers/net/ethernet/marvell/octeontx2/af/rvu.c +1 −1
  812. drivers/net/ethernet/marvell/octeontx2/af/rvu.h +1 −0
  813. drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +3 −0
  814. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +200 −33
  815. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +22 −8
  816. drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c +8 −0
  817. drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c +2 −0
  818. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +2 −0
  819. drivers/net/ethernet/marvell/octeontx2/nic/rep.c +2 −1
  820. drivers/net/ethernet/mellanox/mlx4/srq.c +7 −6
  821. drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +3 −3
  822. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +1 −1
  823. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +4 −3
  824. drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c +20 −16
  825. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +4 −1
  826. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +23 −7
  827. drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +1 −1
  828. drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c +2 −1
  829. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +21 −0
  830. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +1 −0
  831. drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +5 −0
  832. drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c +99 −15
  833. drivers/net/ethernet/mellanox/mlx5/core/lib/sd.h +2 −0
  834. drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c +3 −1
  835. drivers/net/ethernet/meta/fbnic/fbnic_netdev.c +2 −1
  836. drivers/net/ethernet/microchip/lan966x/lan966x_main.c +5 −3
  837. drivers/net/ethernet/microchip/sparx5/sparx5_main.h +5 −5
  838. drivers/net/ethernet/microchip/sparx5/sparx5_port.c +2 −1
  839. drivers/net/ethernet/microsoft/mana/gdma_main.c +35 −5
  840. drivers/net/ethernet/microsoft/mana/hw_channel.c +19 −10
  841. drivers/net/ethernet/microsoft/mana/mana_en.c +52 −34
  842. drivers/net/ethernet/microsoft/mana/shm_channel.c +0 −5
  843. drivers/net/ethernet/qlogic/qed/qed_cxt.c +2 −0
  844. drivers/net/ethernet/qlogic/qed/qed_dev.c +7 −0
  845. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +4 −4
  846. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h +1 −0
  847. drivers/net/ethernet/renesas/ravb_main.c +6 −3
  848. drivers/net/ethernet/renesas/rtsn.c +4 −2
  849. drivers/net/ethernet/sfc/efx_devlink.c +1 −1
  850. drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c +89 −37
  851. drivers/net/ethernet/stmicro/stmmac/dwmac-nuvoton.c +2 −0
  852. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +12 −7
  853. drivers/net/ethernet/ti/icssm/icssm_prueth.c +1 −0
  854. drivers/net/ethernet/wangxun/libwx/wx_hw.c +5 −2
  855. drivers/net/ethernet/wangxun/libwx/wx_vf_common.c +2 −2
  856. drivers/net/fddi/defza.c +9 −2
  857. drivers/net/ifb.c +5 −6
  858. drivers/net/macsec.c +30 −12
  859. drivers/net/mctp/mctp-i2c.c +2 −2
  860. drivers/net/net_failover.c +6 −6
  861. drivers/net/netconsole.c +30 −19
  862. drivers/net/netdevsim/dev.c +1 −1
  863. drivers/net/netdevsim/netdev.c +2 −1
  864. drivers/net/netdevsim/netdevsim.h +3 −1
  865. drivers/net/netdevsim/psp.c +46 −19
  866. drivers/net/ovpn/io.c +13 −6
  867. drivers/net/ovpn/main.c +2 −10
  868. drivers/net/ovpn/netlink.c +5 −3
  869. drivers/net/ovpn/peer.c +19 −4
  870. drivers/net/ovpn/peer.h +0 −1
  871. drivers/net/ovpn/stats.h +16 −0
  872. drivers/net/ovpn/tcp.c +12 −7
  873. drivers/net/ovpn/udp.c +1 −1
  874. drivers/net/pcs/pcs-mtk-lynxi.c +3 −0
  875. drivers/net/phy/air_en8811h.c +149 −4
  876. drivers/net/phy/bcm-phy-lib.c +9 −0
  877. drivers/net/phy/bcm-phy-lib.h +1 −0
  878. drivers/net/phy/bcm7xxx.c +14 −0
  879. drivers/net/phy/broadcom.c +5 −0
  880. drivers/net/phy/dp83869.c +12 −1
  881. drivers/net/phy/dp83tc811.c +1 −0
  882. drivers/net/phy/micrel.c +8 −7
  883. drivers/net/phy/phy-c45.c +8 −0
  884. drivers/net/phy/phy_device.c +4 −2
  885. drivers/net/pse-pd/pse_core.c +1 −1
  886. drivers/net/tap.c +3 −1
  887. drivers/net/team/team_core.c +32 −13
  888. drivers/net/tun.c +4 −1
  889. drivers/net/usb/asix_devices.c +2 −0
  890. drivers/net/usb/cdc_ncm.c +8 −0
  891. drivers/net/usb/r8152.c +1 −0
  892. drivers/net/usb/rtl8150.c +11 −1
  893. drivers/net/veth.c +2 −1
  894. drivers/net/vrf.c +11 −4
  895. drivers/net/vxlan/vxlan_core.c +2 −2
  896. drivers/net/wan/fsl_ucc_hdlc.c +9 −7
  897. drivers/net/wireguard/send.c +10 −10
  898. drivers/net/wireless/ath/ath10k/Kconfig +1 −0
  899. drivers/net/wireless/ath/ath10k/wmi.c +7 −8
  900. drivers/net/wireless/ath/ath11k/dp_rx.c +5 −4
  901. drivers/net/wireless/ath/ath11k/hal.c +11 −3
  902. drivers/net/wireless/ath/ath11k/hal_rx.c +1 −4
  903. drivers/net/wireless/ath/ath11k/testmode.c +1 −0
  904. drivers/net/wireless/ath/ath11k/wmi.c +112 −19
  905. drivers/net/wireless/ath/ath12k/core.c +48 −29
  906. drivers/net/wireless/ath/ath12k/dp_rx.c +4 −1
  907. drivers/net/wireless/ath/ath12k/mac.c +7 −3
  908. drivers/net/wireless/ath/ath12k/p2p.c +1 −1
  909. drivers/net/wireless/ath/ath12k/wmi.c +89 −16
  910. drivers/net/wireless/ath/ath5k/base.c +2 −1
  911. drivers/net/wireless/broadcom/b43/xmit.c +2 −1
  912. drivers/net/wireless/broadcom/b43legacy/xmit.c +2 −1
  913. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +4 −2
  914. drivers/net/wireless/intel/iwlwifi/mld/constants.h +2 −2
  915. drivers/net/wireless/intel/iwlwifi/mld/d3.c +3 −3
  916. drivers/net/wireless/intel/iwlwifi/mld/link.c +6 −7
  917. drivers/net/wireless/intel/iwlwifi/mld/tx.c +14 −1
  918. drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +18 −9
  919. drivers/net/wireless/intel/iwlwifi/mvm/utils.c +4 −10
  920. drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c +3 −3
  921. drivers/net/wireless/marvell/libertas/if_usb.c +4 −2
  922. drivers/net/wireless/microchip/wilc1000/wlan.c +1 −1
  923. drivers/net/wireless/rsi/rsi_common.h +2 −3
  924. drivers/net/wireless/st/cw1200/pm.c +0 −2
  925. drivers/net/wwan/iosm/iosm_ipc_imem.c +2 −0
  926. drivers/net/wwan/t7xx/t7xx_modem_ops.c +17 −3
  927. drivers/net/wwan/t7xx/t7xx_port_ctrl_msg.c +16 −2
  928. drivers/net/wwan/t7xx/t7xx_port_proxy.h +1 −1
  929. drivers/nfc/nxp-nci/i2c.c +20 −1
  930. drivers/nfc/trf7970a.c +2 −1
  931. drivers/nvme/common/auth.c +74 −20
  932. drivers/nvme/host/apple.c +2 −5
  933. drivers/nvme/host/auth.c +9 −7
  934. drivers/nvme/host/core.c +16 −6
  935. drivers/nvme/host/fc.c +1 −0
  936. drivers/nvme/host/ioctl.c +4 −14
  937. drivers/nvme/host/multipath.c +0 −4
  938. drivers/nvme/host/pci.c +37 −6
  939. drivers/nvme/host/rdma.c +9 −0
  940. drivers/nvme/host/sysfs.c +19 −0
  941. drivers/nvme/host/tcp.c +23 −8
  942. drivers/nvme/target/Kconfig +9 −0
  943. drivers/nvme/target/admin-cmd.c +2 −6
  944. drivers/nvme/target/auth.c +18 −16
  945. drivers/nvme/target/configfs.c +27 −0
  946. drivers/nvme/target/core.c +9 −1
  947. drivers/nvme/target/fabrics-cmd-auth.c +5 −4
  948. drivers/nvme/target/nvmet.h +13 −0
  949. drivers/nvme/target/tcp.c +66 −53
  950. drivers/nvme/target/zns.c +1 −5
  951. drivers/parisc/lasi.c +8 −4
  952. drivers/parisc/led.c +2 −4
  953. drivers/parport/share.c +9 −2
  954. drivers/pci/controller/pcie-brcmstb.c +3 −1
  955. drivers/pci/pci-driver.c +8 −1
  956. drivers/pci/pci.c +4 −5
  957. drivers/pci/setup-res.c +2 −0
  958. drivers/phy/apple/atc.c +22 −5
  959. drivers/phy/eswin/phy-eic7700-sata.c +2 −2
  960. drivers/phy/marvell/phy-mvebu-a3700-utmi.c +2 −3
  961. drivers/phy/qualcomm/phy-qcom-edp.c +181 −43
  962. drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +1 −0
  963. drivers/phy/qualcomm/phy-qcom-qmp-usbc.c +1 −1
  964. drivers/phy/samsung/phy-exynos5-usbdrd.c +4 −3
  965. drivers/phy/spacemit/phy-k1-usb2.c +0 −1
  966. drivers/phy/tegra/xusb-tegra186.c +26 −7
  967. drivers/phy/tegra/xusb.h +1 −0
  968. drivers/pinctrl/freescale/pinctrl-imx1-core.c +41 −7
  969. drivers/pinctrl/mediatek/pinctrl-moore.c +18 −0
  970. drivers/pinctrl/meson/pinctrl-amlogic-a4.c +3 −3
  971. drivers/pinctrl/pinctrl-amd.c +35 −0
  972. drivers/pinctrl/qcom/pinctrl-eliza.c +4 −4
  973. drivers/pinctrl/qcom/pinctrl-ipq4019.c +1 −1
  974. drivers/pinctrl/qcom/pinctrl-msm.h +5 −0
  975. drivers/pinctrl/qcom/pinctrl-qcs615.c +3 −3
  976. drivers/pinctrl/qcom/pinctrl-sm8150.c +4 −4
  977. drivers/pinctrl/renesas/pinctrl-rzg2l.c +15 −8
  978. drivers/platform/chrome/cros_typec_altmode.c +1 −0
  979. drivers/platform/surface/surface_aggregator_registry.c +0 −2
  980. drivers/platform/surface/surfacepro3_button.c +7 −3
  981. drivers/platform/wmi/core.c +3 −0
  982. drivers/platform/x86/Kconfig +1 −0
  983. drivers/platform/x86/acer-wireless.c +6 −2
  984. drivers/platform/x86/adv_swbutton.c +5 −1
  985. drivers/platform/x86/asus-armoury.c +12 −4
  986. drivers/platform/x86/asus-armoury.h +113 −0
  987. drivers/platform/x86/asus-laptop.c +5 −1
  988. drivers/platform/x86/asus-nb-wmi.c +9 −0
  989. drivers/platform/x86/dell/dell-rbtn.c +5 −1
  990. drivers/platform/x86/eeepc-laptop.c +5 −1
  991. drivers/platform/x86/fujitsu-laptop.c +10 −2
  992. drivers/platform/x86/fujitsu-tablet.c +5 −1
  993. drivers/platform/x86/hp/hp-wmi.c +9 −1
  994. drivers/platform/x86/hp/hp_accel.c +3 −0
  995. drivers/platform/x86/intel/hid.c +5 −1
  996. drivers/platform/x86/intel/int1092/intel_sar.c +6 −1
  997. drivers/platform/x86/intel/plr_tpmi.c +43 −2
  998. drivers/platform/x86/intel/rst.c +5 −1
  999. drivers/platform/x86/intel/smartconnect.c +5 −1
  1000. drivers/platform/x86/intel/vbtn.c +5 −1
  1001. drivers/platform/x86/intel/vsec.c +30 −24
  1002. drivers/platform/x86/intel/vsec_tpmi.c +25 −4
  1003. drivers/platform/x86/lenovo/Kconfig +0 −1
  1004. drivers/platform/x86/lenovo/wmi-capdata.c +4 −4
  1005. drivers/platform/x86/lenovo/wmi-capdata.h +20 −0
  1006. drivers/platform/x86/lenovo/wmi-events.c +1 −1
  1007. drivers/platform/x86/lenovo/wmi-gamezone.c +2 −5
  1008. drivers/platform/x86/lenovo/wmi-gamezone.h +0 −20
  1009. drivers/platform/x86/lenovo/wmi-helpers.c +103 −2
  1010. drivers/platform/x86/lenovo/wmi-helpers.h +21 −0
  1011. drivers/platform/x86/lenovo/wmi-other.c +140 −156
  1012. drivers/platform/x86/lenovo/wmi-other.h +0 −16
  1013. drivers/platform/x86/lg-laptop.c +7 −2
  1014. drivers/platform/x86/panasonic-laptop.c +5 −1
  1015. drivers/platform/x86/samsung-galaxybook.c +48 −21
  1016. drivers/platform/x86/sony-laptop.c +10 −2
  1017. drivers/platform/x86/system76_acpi.c +5 −1
  1018. drivers/platform/x86/toshiba_acpi.c +5 −1
  1019. drivers/platform/x86/toshiba_bluetooth.c +5 −1
  1020. drivers/platform/x86/toshiba_haps.c +5 −1
  1021. drivers/platform/x86/uniwill/uniwill-acpi.c +42 −5
  1022. drivers/platform/x86/wireless-hotkey.c +7 −2
  1023. drivers/pmdomain/core.c +9 −1
  1024. drivers/pmdomain/mediatek/mtk-pm-domains.c +7 −3
  1025. drivers/regulator/Kconfig +2 −1
  1026. drivers/regulator/qcom-rpmh-regulator.c +1 −1
  1027. drivers/regulator/tps65219-regulator.c +95 −40
  1028. drivers/resctrl/mpam_devices.c +40 −41
  1029. drivers/resctrl/mpam_internal.h +0 −2
  1030. drivers/reset/reset-eyeq.c +2 −22
  1031. drivers/s390/char/Kconfig +0 −8
  1032. drivers/s390/char/sclp_config.c +0 −6
  1033. drivers/s390/cio/chsc.c +2 −2
  1034. drivers/s390/cio/chsc_sch.c +10 −10
  1035. drivers/s390/cio/scm.c +1 −1
  1036. drivers/scsi/device_handler/scsi_dh_alua.c +1 −1
  1037. drivers/scsi/fcoe/fcoe_ctlr.c +1 −1
  1038. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 −1
  1039. drivers/scsi/isci/host.c +3 −0
  1040. drivers/scsi/megaraid/megaraid_sas_fusion.c +9 −0
  1041. drivers/scsi/mpt3sas/mpt3sas_scsih.c +13 −1
  1042. drivers/scsi/pmcraid.h +1 −1
  1043. drivers/scsi/scsi_debug.c +1 −1
  1044. drivers/scsi/scsi_devinfo.c +1 −0
  1045. drivers/scsi/scsi_lib.c +25 −2
  1046. drivers/scsi/scsi_transport_fc.c +41 −36
  1047. drivers/scsi/sd.c +1 −2
  1048. drivers/scsi/sg.c +1 −1
  1049. drivers/scsi/smartpqi/smartpqi_init.c +1 −0
  1050. drivers/scsi/sr.c +2 −9
  1051. drivers/scsi/sr.h +0 −1
  1052. drivers/spi/spi-amd.c +1 −1
  1053. drivers/spi/spi-amlogic-spisg.c +1 −2
  1054. drivers/spi/spi-axiado.c +1 −1
  1055. drivers/spi/spi-cadence-quadspi.c +18 −18
  1056. drivers/spi/spi-cadence.c +13 −2
  1057. drivers/spi/spi-ch341.c +1 −1
  1058. drivers/spi/spi-ep93xx.c +2 −0
  1059. drivers/spi/spi-imx.c +3 −4
  1060. drivers/spi/spi-mem.c +11 −4
  1061. drivers/spi/spi-microchip-core-qspi.c +79 −20
  1062. drivers/spi/spi-mtk-snfi.c +1 −1
  1063. drivers/spi/spi-qup.c +3 −0
  1064. drivers/spi/spi-rockchip.c +2 −4
  1065. drivers/spi/spi-rzv2h-rspi.c +1 −1
  1066. drivers/spi/spi-sprd.c +2 −1
  1067. drivers/spi/spi-ti-qspi.c +1 −0
  1068. drivers/staging/greybus/hid.c +1 −1
  1069. drivers/staging/rtl8723bs/os_dep/osdep_service.c +2 −1
  1070. drivers/staging/vme_user/vme_fake.c +2 −0
  1071. drivers/target/iscsi/iscsi_target.c +22 −5
  1072. drivers/target/iscsi/iscsi_target_auth.c +18 −1
  1073. drivers/target/iscsi/iscsi_target_nego.c +6 −1
  1074. drivers/target/iscsi/iscsi_target_parameters.c +48 −14
  1075. drivers/target/iscsi/iscsi_target_parameters.h +1 −1
  1076. drivers/target/loopback/tcm_loop.c +10 −2
  1077. drivers/target/target_core_configfs.c +1 −1
  1078. drivers/thunderbolt/property.c +23 −9
  1079. drivers/tty/serial/8250/8250_dw.c +1 −1
  1080. drivers/tty/serial/8250/8250_port.c +5 −2
  1081. drivers/tty/serial/Kconfig +1 −1
  1082. drivers/tty/serial/altera_jtaguart.c +6 −1
  1083. drivers/tty/serial/dz.c +88 −83
  1084. drivers/tty/serial/fsl_lpuart.c +12 −3
  1085. drivers/tty/serial/pch_uart.c +13 −6
  1086. drivers/tty/serial/qcom_geni_serial.c +14 −2
  1087. drivers/tty/serial/samsung_tty.c +0 −8
  1088. drivers/tty/serial/sh-sci.c +1 −1
  1089. drivers/tty/serial/zs.c +83 −143
  1090. drivers/tty/serial/zs.h +0 −1
  1091. drivers/ufs/core/ufshcd.c +28 −2
  1092. drivers/uio/uio_pci_generic_sva.c +1 −6
  1093. drivers/usb/cdns3/cdns3-gadget.c +11 −1
  1094. drivers/usb/cdns3/cdns3-plat.c +7 −4
  1095. drivers/usb/chipidea/core.c +6 −10
  1096. drivers/usb/class/cdc-acm.c +0 −2
  1097. drivers/usb/class/cdc-acm.h +2 −0
  1098. drivers/usb/class/usblp.c +2 −1
  1099. drivers/usb/class/usbtmc.c +14 −0
  1100. drivers/usb/common/ulpi.c +4 −1
  1101. drivers/usb/core/config.c +19 −27
  1102. drivers/usb/core/hcd.c +1 −3
  1103. drivers/usb/core/quirks.c +4 −0
  1104. drivers/usb/dwc2/hcd.c +3 −1
  1105. drivers/usb/dwc3/core.c +6 −6
  1106. drivers/usb/dwc3/dwc3-xilinx.c +15 −12
  1107. drivers/usb/gadget/composite.c +4 −1
  1108. drivers/usb/gadget/function/f_fs.c +23 −3
  1109. drivers/usb/gadget/function/f_hid.c +1 −2
  1110. drivers/usb/gadget/function/f_uvc.c +21 −7
  1111. drivers/usb/gadget/udc/dummy_hcd.c +4 −0
  1112. drivers/usb/gadget/udc/net2280.c +1 −3
  1113. drivers/usb/gadget/udc/omap_udc.c +0 −4
  1114. drivers/usb/host/xhci-tegra.c +41 −32
  1115. drivers/usb/musb/omap2430.c +2 −1
  1116. drivers/usb/serial/belkin_sa.c +3 −0
  1117. drivers/usb/serial/cypress_m8.c +19 −1
  1118. drivers/usb/serial/digi_acceleport.c +21 −2
  1119. drivers/usb/serial/keyspan.c +4 −0
  1120. drivers/usb/serial/mct_u232.c +16 −10
  1121. drivers/usb/serial/mxuport.c +8 −0
  1122. drivers/usb/serial/omninet.c +5 −4
  1123. drivers/usb/serial/option.c +12 −1
  1124. drivers/usb/serial/safe_serial.c +11 −0
  1125. drivers/usb/storage/unusual_uas.h +7 −0
  1126. drivers/usb/typec/altmodes/displayport.c +2 −0
  1127. drivers/usb/typec/tcpm/fusb302.c +10 −10
  1128. drivers/usb/typec/tcpm/tcpci_maxim_core.c +9 −0
  1129. drivers/usb/typec/tcpm/tcpm.c +90 −54
  1130. drivers/usb/typec/tcpm/wcove.c +8 −5
  1131. drivers/usb/typec/tipd/core.c +1 −0
  1132. drivers/usb/typec/ucsi/displayport.c +4 −0
  1133. drivers/usb/typec/ucsi/ucsi.c +20 −4
  1134. drivers/usb/typec/ucsi/ucsi_ccg.c +5 −0
  1135. drivers/usb/usbip/vudc_dev.c +1 −0
  1136. drivers/usb/usbip/vudc_transfer.c +2 −1
  1137. drivers/vfio/pci/vfio_pci_core.c +36 −1
  1138. drivers/vfio/pci/vfio_pci_dmabuf.c +22 −20
  1139. drivers/vfio/pci/vfio_pci_rdwr.c +7 −19
  1140. drivers/video/fbdev/core/fb_defio.c +0 −1
  1141. drivers/video/fbdev/udlfb.c +30 −1
  1142. drivers/virt/coco/sev-guest/sev-guest.c +11 −9
  1143. drivers/xen/privcmd.c +7 −0
  1144. drivers/xen/sys-hypervisor.c +6 −2
  1145. drivers/xen/xen-acpi-pad.c +5 −1
  1146. fs/9p/v9fs_vfs.h +0 −13
  1147. fs/9p/vfs_inode.c +4 −2
  1148. fs/9p/vfs_inode_dotl.c +8 −4
  1149. fs/afs/Makefile +1 −0
  1150. fs/afs/dir.c +44 −35
  1151. fs/afs/file.c +19 −5
  1152. fs/afs/fsclient.c +2 −2
  1153. fs/afs/inode.c +26 −101
  1154. fs/afs/internal.h +27 −18
  1155. fs/afs/symlink.c +278 −0
  1156. fs/afs/validation.c +10 −4
  1157. fs/afs/write.c +1 −1
  1158. fs/afs/yfsclient.c +2 −2
  1159. fs/btrfs/block-group.c +8 −15
  1160. fs/btrfs/compression.c +14 −12
  1161. fs/btrfs/disk-io.c +1 −0
  1162. fs/btrfs/extent_io.c +12 −2
  1163. fs/btrfs/extent_io.h +2 −1
  1164. fs/btrfs/extent_map.c +3 −1
  1165. fs/btrfs/file.c +8 −3
  1166. fs/btrfs/free-space-tree.c +15 −3
  1167. fs/btrfs/fs.h +1 −0
  1168. fs/btrfs/inode.c +34 −2
  1169. fs/btrfs/ioctl.c +3 −4
  1170. fs/btrfs/qgroup.c +68 −33
  1171. fs/btrfs/raid-stripe-tree.c +45 −12
  1172. fs/btrfs/relocation.c +24 −6
  1173. fs/btrfs/transaction.c +4 −5
  1174. fs/cachefiles/namei.c +2 −0
  1175. fs/ceph/addr.c +2 −0
  1176. fs/ceph/quota.c +27 −10
  1177. fs/ceph/xattr.c +17 −0
  1178. fs/efivarfs/super.c +1 −4
  1179. fs/erofs/xattr.c +1 −3
  1180. fs/erofs/zdata.c +8 −7
  1181. fs/fuse/file.c +4 −1
  1182. fs/hpfs/alloc.c +1 −1
  1183. fs/hugetlbfs/inode.c +13 −33
  1184. fs/inode.c +7 −1
  1185. fs/iomap/direct-io.c +1 −1
  1186. fs/isofs/export.c +1 −1
  1187. fs/isofs/namei.c +2 −9
  1188. fs/isofs/rock.c +9 −0
  1189. fs/jfs/namei.c +1 −1
  1190. fs/lockd/lockd.h +1 −1
  1191. fs/lockd/svc4proc.c +7 −2
  1192. fs/lockd/svclock.c +1 −3
  1193. fs/lockd/svcproc.c +12 −3
  1194. fs/lockd/svcsubs.c +21 −10
  1195. fs/mnt_idmapping.c +2 −0
  1196. fs/netfs/buffered_read.c +39 −34
  1197. fs/netfs/buffered_write.c +111 −63
  1198. fs/netfs/direct_read.c +13 −29
  1199. fs/netfs/direct_write.c +4 −2
  1200. fs/netfs/internal.h +3 −0
  1201. fs/netfs/iterator.c +28 −13
  1202. fs/netfs/misc.c +30 −11
  1203. fs/netfs/read_collect.c +16 −3
  1204. fs/netfs/read_retry.c +14 −3
  1205. fs/netfs/read_single.c +10 −13
  1206. fs/netfs/write_collect.c +10 −5
  1207. fs/netfs/write_issue.c +33 −16
  1208. fs/netfs/write_retry.c +5 −1
  1209. fs/nfsd/nfs4proc.c +13 −5
  1210. fs/nfsd/nfs4state.c +44 −20
  1211. fs/nfsd/nfsctl.c +14 −4
  1212. fs/nfsd/state.h +1 −0
  1213. fs/nfsd/trace.h +7 −9
  1214. fs/nfsd/xdr4.h +1 −0
  1215. fs/notify/fanotify/fanotify.c +1 −1
  1216. fs/notify/fsnotify.c +1 −1
  1217. fs/notify/mark.c +47 −10
  1218. fs/nsfs.c +1 −1
  1219. fs/ntfs/attrib.c +22 −24
  1220. fs/ntfs/attrlist.c +3 −4
  1221. fs/ntfs/bdev-io.c +5 −2
  1222. fs/ntfs/bitmap.c +11 −8
  1223. fs/ntfs/dir.c +10 −3
  1224. fs/ntfs/index.c +25 −9
  1225. fs/ntfs/inode.c +3 −3
  1226. fs/ntfs/iomap.c +3 −3
  1227. fs/ntfs/logfile.c +4 −1
  1228. fs/ntfs/mft.c +65 −28
  1229. fs/ntfs/namei.c +13 −4
  1230. fs/ntfs/reparse.c +3 −2
  1231. fs/ntfs/runlist.c +26 −7
  1232. fs/ntfs/super.c +28 −7
  1233. fs/orangefs/namei.c +1 −1
  1234. fs/overlayfs/util.c +1 −1
  1235. fs/select.c +11 −0
  1236. fs/smb/client/cached_dir.c +8 −0
  1237. fs/smb/client/cifs_spnego.c +16 −0
  1238. fs/smb/client/cifsacl.c +33 −4
  1239. fs/smb/client/cifsfs.c +28 −14
  1240. fs/smb/client/cifsproto.h +0 −1
  1241. fs/smb/client/cifssmb.c +2 −1
  1242. fs/smb/client/file.c +9 −4
  1243. fs/smb/client/fs_context.c +109 −85
  1244. fs/smb/client/inode.c +8 −6
  1245. fs/smb/client/ioctl.c +1 −1
  1246. fs/smb/client/netlink.c +5 −1
  1247. fs/smb/client/readdir.c +2 −1
  1248. fs/smb/client/smb2file.c +3 −0
  1249. fs/smb/client/smb2inode.c +9 −5
  1250. fs/smb/client/smb2misc.c +2 −1
  1251. fs/smb/client/smb2ops.c +57 −22
  1252. fs/smb/client/smb2pdu.c +21 −7
  1253. fs/smb/client/smb2transport.c +28 −9
  1254. fs/smb/client/smbdirect.c +2 −1
  1255. fs/smb/client/smbdirect.h +1 −1
  1256. fs/smb/client/transport.c +9 −6
  1257. fs/smb/common/fscc.h +2 −2
  1258. fs/smb/common/smb2pdu.h +4 −0
  1259. fs/smb/server/connection.c +128 −23
  1260. fs/smb/server/connection.h +7 −0
  1261. fs/smb/server/mgmt/share_config.c +8 −4
  1262. fs/smb/server/oplock.c +7 −6
  1263. fs/smb/server/server.c +12 −0
  1264. fs/smb/server/smb2pdu.c +35 −5
  1265. fs/smb/server/smbacl.c +115 −37
  1266. fs/smb/server/transport_rdma.c +2 −1
  1267. fs/smb/server/transport_rdma.h +1 −1
  1268. fs/smb/server/vfs_cache.c +300 −65
  1269. fs/smb/server/vfs_cache.h +2 −2
  1270. fs/smb/smbdirect/accept.c +1 −1
  1271. fs/smb/smbdirect/connect.c +2 −2
  1272. fs/smb/smbdirect/connection.c +9 −9
  1273. fs/smb/smbdirect/debug.c +2 −2
  1274. fs/smb/smbdirect/devices.c +1 −1
  1275. fs/smb/smbdirect/internal.h +2 −2
  1276. fs/smb/smbdirect/listen.c +1 −1
  1277. fs/smb/smbdirect/mr.c +15 −12
  1278. fs/smb/smbdirect/rw.c +1 −1
  1279. fs/smb/smbdirect/smbdirect.h +0 −52
  1280. fs/smb/smbdirect/socket.c +10 −10
  1281. fs/sysfs/group.c +1 −1
  1282. fs/udf/misc.c +6 −2
  1283. fs/xfs/libxfs/xfs_dir2_data.c +11 −7
  1284. fs/xfs/libxfs/xfs_refcount.c +1 −2
  1285. fs/xfs/scrub/common.c +11 −0
  1286. fs/xfs/scrub/common.h +2 −0
  1287. fs/xfs/scrub/dabtree.c +6 −1
  1288. fs/xfs/scrub/dir.c +6 −1
  1289. fs/xfs/xfs_buf.c +24 −10
  1290. fs/xfs/xfs_inode.c +0 −6
  1291. fs/xfs/xfs_notify_failure.c +1 −1
  1292. fs/xfs/xfs_trans.c +11 −0
  1293. fs/xfs/xfs_zone_alloc.c +2 −2
  1294. fs/xfs/xfs_zone_gc.c +1 −1
  1295. fs/zonefs/super.c +5 −1
  1296. include/acpi/acpi_bus.h +2 −0
  1297. include/acpi/acpixf.h +5 −0
  1298. include/acpi/actbl1.h +6 −0
  1299. include/asm-generic/kprobes.h +1 −1
  1300. include/asm-generic/ring_buffer.h +13 −0
  1301. include/crypto/krb5.h +6 −3
  1302. include/drm/drm_device.h +7 −0
  1303. include/drm/drm_fb_helper.h +6 −0
  1304. include/drm/drm_gem.h +9 −11
  1305. include/drm/ttm/ttm_resource.h +2 −0
  1306. include/kunit/test.h +1 −0
  1307. include/linux/arm-smccc.h +6 −0
  1308. include/linux/bio.h +2 −1
  1309. include/linux/bpf.h +8 −1
  1310. include/linux/bpf_verifier.h +2 −0
  1311. include/linux/cdrom.h +1 −0
  1312. include/linux/cgroup-defs.h +2 −2
  1313. include/linux/cgroup.h +2 −0
  1314. include/linux/compat.h +4 −0
  1315. include/linux/compiler-clang.h +6 −0
  1316. include/linux/compiler_attributes.h +11 −0
  1317. include/linux/compiler_types.h +4 −0
  1318. include/linux/dma-buf.h +2 −2
  1319. include/linux/dpll.h +2 −0
  1320. include/linux/efi.h +1 −1
  1321. include/linux/filter.h +0 −3
  1322. include/linux/fprobe.h +5 −0
  1323. include/linux/fsnotify_backend.h +1 −0
  1324. include/linux/fwnode.h +1 −0
  1325. include/linux/gfp_types.h +5 −5
  1326. include/linux/hid.h +4 −4
  1327. include/linux/hid_bpf.h +9 −5
  1328. include/linux/highmem.h +4 −3
  1329. include/linux/hugetlb.h +1 −7
  1330. include/linux/hugetlb_inline.h +2 −12
  1331. include/linux/intel_tpmi.h +6 −0
  1332. include/linux/irq-entry-common.h +0 −8
  1333. include/linux/irqchip/arm-gic-v5.h +0 −3
  1334. include/linux/kho/abi/kexec_handover.h +1 −1
  1335. include/linux/libata.h +4 −3
  1336. include/linux/list.h +37 −0
  1337. include/linux/mailbox_client.h +1 −0
  1338. include/linux/mailbox_controller.h +13 −4
  1339. include/linux/maple_tree.h +1 −1
  1340. include/linux/mm.h +25 −4
  1341. include/linux/mroute_base.h +3 −0
  1342. include/linux/mtd/spinand.h +7 −0
  1343. include/linux/netfilter/nf_conntrack_proto_gre.h +4 −3
  1344. include/linux/netfilter/x_tables.h +11 −1
  1345. include/linux/netfilter_arp/arp_tables.h +0 −1
  1346. include/linux/netfilter_ipv4/ip_tables.h +0 −1
  1347. include/linux/netfilter_ipv6/ip6_tables.h +0 −1
  1348. include/linux/netfs.h +285 −10
  1349. include/linux/nvme-auth.h +3 −3
  1350. include/linux/page-flags.h +0 −6
  1351. include/linux/parport.h +1 −0
  1352. include/linux/rculist.h +29 −0
  1353. include/linux/rhashtable-types.h +5 −0
  1354. include/linux/rhashtable.h +5 −3
  1355. include/linux/rseq.h +26 −11
  1356. include/linux/rseq_entry.h +59 −82
  1357. include/linux/rseq_types.h +11 −2
  1358. include/linux/sched.h +3 −0
  1359. include/linux/sched/deadline.h +9 −0
  1360. include/linux/sched/ext.h +10 −6
  1361. include/linux/sched/isolation.h +5 −1
  1362. include/linux/serial_core.h +12 −0
  1363. include/linux/skbuff.h +2 −0
  1364. include/linux/slab.h +3 −0
  1365. include/linux/smbdirect.h +45 −7
  1366. include/linux/soc/airoha/airoha_offload.h +3 −3
  1367. include/linux/syscalls.h +4 −0
  1368. include/linux/tracepoint.h +1 −1
  1369. include/linux/tty_port.h +1 −1
  1370. include/linux/vfio_pci_core.h +1 −1
  1371. include/linux/workqueue.h +4 −2
  1372. include/net/bluetooth/bluetooth.h +1 −0
  1373. include/net/bluetooth/hci_core.h +1 −1
  1374. include/net/bond_3ad.h +1 −1
  1375. include/net/dropreason-core.h +6 −0
  1376. include/net/genetlink.h +3 −1
  1377. include/net/ip_vs.h +28 −6
  1378. include/net/ipv6.h +3 −0
  1379. include/net/macsec.h +5 −2
  1380. include/net/mana/shm_channel.h +6 −0
  1381. include/net/neighbour.h +6 −2
  1382. include/net/net_shaper.h +1 −0
  1383. include/net/netfilter/nf_conntrack_expect.h +4 −1
  1384. include/net/netfilter/nf_dup_netdev.h +13 −0
  1385. include/net/netfilter/nf_flow_table.h +3 −1
  1386. include/net/netfilter/nf_queue.h +1 −0
  1387. include/net/netfilter/nf_tables.h +20 −0
  1388. include/net/netmem.h +11 −11
  1389. include/net/netns/ipv4.h +1 −1
  1390. include/net/netns/ipv6.h +1 −0
  1391. include/net/nsh.h +2 −2
  1392. include/net/tcp.h +4 −3
  1393. include/net/xfrm.h +2 −1
  1394. include/rdma/uverbs_ioctl.h +1 −0
  1395. include/trace/events/btrfs.h +1 −3
  1396. include/trace/events/damon.h +1 −1
  1397. include/trace/events/netfs.h +8 −0
  1398. include/trace/events/rxrpc.h +1 −0
  1399. include/uapi/linux/io_uring.h +2 −1
  1400. include/uapi/linux/rseq.h +4 −1
  1401. include/ufs/unipro.h +5 −0
  1402. include/video/imx-ipu-image-convert.h +11 −5
  1403. include/video/udlfb.h +1 −0
  1404. include/xen/arm/interface.h +1 −1
  1405. io_uring/cancel.c +1 −1
  1406. io_uring/eventfd.c +1 −0
  1407. io_uring/fdinfo.c +2 −1
  1408. io_uring/io-wq.c +2 −1
  1409. io_uring/io_uring.c +27 −11
  1410. io_uring/kbuf.c +7 −2
  1411. io_uring/kbuf.h +7 −1
  1412. io_uring/napi.c +22 −7
  1413. io_uring/napi.h +5 −3
  1414. io_uring/net.c +25 −1
  1415. io_uring/nop.c +2 −2
  1416. io_uring/rw.c +2 −2
  1417. io_uring/tctx.c +8 −4
  1418. io_uring/timeout.c +39 −16
  1419. io_uring/tw.c +11 −1
  1420. io_uring/wait.c +5 −1
  1421. io_uring/waitid.c +1 −0
  1422. io_uring/zcrx.c +1 −2
  1423. ipc/util.c +1 −1
  1424. kernel/audit.c +4 −0
  1425. kernel/auditsc.c +1 −1
  1426. kernel/bpf/arena.c +1 −1
  1427. kernel/bpf/arraymap.c +1 −1
  1428. kernel/bpf/cfg.c +12 −1
  1429. kernel/bpf/core.c +19 −8
  1430. kernel/bpf/fixups.c +9 −4
  1431. kernel/bpf/helpers.c +5 −0
  1432. kernel/bpf/liveness.c +7 −18
  1433. kernel/bpf/syscall.c +26 −0
  1434. kernel/bpf/verifier.c +21 −6
  1435. kernel/cgroup/cgroup.c +141 −145
  1436. kernel/cgroup/cpuset-internal.h +6 −0
  1437. kernel/cgroup/cpuset.c +38 −27
  1438. kernel/cgroup/dmem.c +1 −0
  1439. kernel/cgroup/rdma.c +1 −1
  1440. kernel/cgroup/rstat.c +23 −14
  1441. kernel/dma/debug.c +8 −1
  1442. kernel/dma/direct.c +2 −2
  1443. kernel/dma/mapping.c +0 −4
  1444. kernel/events/core.c +55 −15
  1445. kernel/events/internal.h +1 −0
  1446. kernel/events/ring_buffer.c +2 −0
  1447. kernel/exit.c +2 −0
  1448. kernel/fork.c +10 −13
  1449. kernel/futex/requeue.c +9 −4
  1450. kernel/irq/chip.c +7 −2
  1451. kernel/irq_work.c +7 −0
  1452. kernel/liveupdate/kexec_handover.c +46 −33
  1453. kernel/liveupdate/luo_session.c +10 −5
  1454. kernel/ptrace.c +16 −6
  1455. kernel/rcu/srcutree.c +6 −6
  1456. kernel/rseq.c +132 −82
  1457. kernel/sched/core.c +1 −0
  1458. kernel/sched/deadline.c +10 −3
  1459. kernel/sched/ext.c +527 −208
  1460. kernel/sched/ext_idle.c +24 −8
  1461. kernel/sched/ext_idle.h +1 −0
  1462. kernel/sched/ext_internal.h +2 −0
  1463. kernel/sched/fair.c +59 −23
  1464. kernel/sched/membarrier.c +10 −1
  1465. kernel/time/timer_migration.c +29 −11
  1466. kernel/trace/Makefile +4 −3
  1467. kernel/trace/bpf_trace.c +2 −1
  1468. kernel/trace/fprobe.c +21 −2
  1469. kernel/trace/remote_test.c +2 −2
  1470. kernel/trace/ring_buffer.c +25 −5
  1471. kernel/trace/simple_ring_buffer.c +2 −2
  1472. kernel/trace/trace_branch.c +4 −4
  1473. kernel/trace/trace_events_hist.c +2 −4
  1474. kernel/trace/trace_probe.c +6 −0
  1475. kernel/trace/trace_probe.h +3 −1
  1476. kernel/trace/tracing_map.c +13 −4
  1477. kernel/workqueue.c +35 −10
  1478. lib/debugobjects.c +15 −5
  1479. lib/fonts/font_rotate.c +1 −1
  1480. lib/kunit/Kconfig +3 −2
  1481. lib/kunit/executor.c +16 −3
  1482. lib/kunit/test.c +1 −0
  1483. lib/maple_tree.c +1 −1
  1484. lib/rhashtable.c +57 −12
  1485. lib/test_maple_tree.c +2 −2
  1486. lib/tests/kunit_iov_iter.c +5 −5
  1487. lib/tests/test_kprobes.c +18 −11
  1488. lib/vdso/gettimeofday.c +2 −3
  1489. mm/damon/lru_sort.c +55 −30
  1490. mm/damon/reclaim.c +55 −30
  1491. mm/damon/stat.c +20 −10
  1492. mm/damon/sysfs-schemes.c +27 −6
  1493. mm/hugetlb.c +29 −42
  1494. mm/hugetlb_cma.c +1 −0
  1495. mm/memblock.c +4 −2
  1496. mm/memcontrol.c +28 −13
  1497. mm/memfd.c +6 −6
  1498. mm/memfd_luo.c +19 −6
  1499. mm/memory.c +20 −4
  1500. mm/memory_hotplug.c +2 −0
  1501. mm/migrate_device.c +4 −2
  1502. mm/page-writeback.c +6 −10
  1503. mm/page_alloc.c +13 −13
  1504. mm/rmap.c +2 −0
  1505. mm/slab_common.c +2 −0
  1506. mm/slub.c +21 −0
  1507. mm/userfaultfd.c +11 −1
  1508. mm/util.c +17 −9
  1509. mm/vma.c +2 −1
  1510. mm/vmalloc.c +2 −2
  1511. net/appletalk/aarp.c +5 −0
  1512. net/atm/signaling.c +1 −0
  1513. net/batman-adv/bat_iv_ogm.c +125 −42
  1514. net/batman-adv/bat_v_ogm.c +35 −24
  1515. net/batman-adv/bridge_loop_avoidance.c +83 −37
  1516. net/batman-adv/distributed-arp-table.c +3 −0
  1517. net/batman-adv/fragmentation.c +52 −6
  1518. net/batman-adv/gateway_client.c +4 −0
  1519. net/batman-adv/main.c +1 −0
  1520. net/batman-adv/mesh-interface.c +1 −0
  1521. net/batman-adv/originator.c +2 −2
  1522. net/batman-adv/tp_meter.c +169 −60
  1523. net/batman-adv/tp_meter.h +1 −0
  1524. net/batman-adv/translation-table.c +45 −10
  1525. net/batman-adv/tvlv.c +20 −8
  1526. net/batman-adv/tvlv.h +1 −1
  1527. net/batman-adv/types.h +48 −15
  1528. net/bluetooth/6lowpan.c +2 −0
  1529. net/bluetooth/af_bluetooth.c +75 −22
  1530. net/bluetooth/bnep/core.c +11 −4
  1531. net/bluetooth/hci_conn.c +107 −21
  1532. net/bluetooth/hci_core.c +3 −40
  1533. net/bluetooth/hci_event.c +26 −3
  1534. net/bluetooth/hci_sync.c +18 −4
  1535. net/bluetooth/hidp/core.c +42 −8
  1536. net/bluetooth/iso.c +52 −30
  1537. net/bluetooth/l2cap_core.c +37 −20
  1538. net/bluetooth/l2cap_sock.c +57 −9
  1539. net/bluetooth/mgmt.c +6 −0
  1540. net/bluetooth/rfcomm/core.c +5 −2
  1541. net/bluetooth/rfcomm/sock.c +8 −1
  1542. net/bluetooth/sco.c +47 −22
  1543. net/bridge/br_multicast.c +17 −5
  1544. net/bridge/br_netfilter_hooks.c +5 −1
  1545. net/bridge/br_netlink.c +17 −10
  1546. net/bridge/br_switchdev.c +0 −1
  1547. net/bridge/br_sysfs_if.c +22 −8
  1548. net/bridge/netfilter/ebtable_broute.c +6 −8
  1549. net/bridge/netfilter/ebtable_filter.c +6 −8
  1550. net/bridge/netfilter/ebtable_nat.c +5 −7
  1551. net/bridge/netfilter/ebtables.c +73 −28
  1552. net/ceph/auth_x.c +5 −0
  1553. net/ceph/crush/crush.c +1 −5
  1554. net/ceph/osdmap.c +12 −5
  1555. net/core/bpf_sk_storage.c +8 −6
  1556. net/core/dev.c +13 −10
  1557. net/core/devmem.c +12 −2
  1558. net/core/failover.c +5 −1
  1559. net/core/filter.c +49 −8
  1560. net/core/gro.c +7 −0
  1561. net/core/neighbour.c +5 −5
  1562. net/core/netmem_priv.h +13 −10
  1563. net/core/netpoll.c +33 −11
  1564. net/core/page_pool.c +7 −27
  1565. net/core/rtnetlink.c +4 −2
  1566. net/core/skbuff.c +51 −5
  1567. net/core/skmsg.c +7 −2
  1568. net/core/sock_map.c +25 −14
  1569. net/ethtool/bitset.c +4 −4
  1570. net/ethtool/cmis.h +2 −2
  1571. net/ethtool/cmis_cdb.c +7 −2
  1572. net/ethtool/cmis_fw_update.c +30 −14
  1573. net/ethtool/coalesce.c +6 −0
  1574. net/ethtool/eeprom.c +6 −4
  1575. net/ethtool/linkstate.c +2 −4
  1576. net/ethtool/module.c +25 −16
  1577. net/ethtool/netlink.c +2 −2
  1578. net/ethtool/netlink.h +2 −2
  1579. net/ethtool/phy.c +33 −3
  1580. net/ethtool/pse-pd.c +5 −5
  1581. net/ethtool/rss.c +23 −14
  1582. net/ethtool/strset.c +1 −1
  1583. net/ethtool/tsconfig.c +11 −4
  1584. net/ethtool/tsinfo.c +15 −4
  1585. net/handshake/genl.c +2 −1
  1586. net/handshake/genl.h +1 −0
  1587. net/handshake/handshake-test.c +37 −1
  1588. net/handshake/handshake.h +4 −2
  1589. net/handshake/netlink.c +13 −16
  1590. net/handshake/request.c +59 −22
  1591. net/handshake/tlshd.c +4 −2
  1592. net/hsr/hsr_forward.c +2 −2
  1593. net/hsr/hsr_framereg.c +6 −3
  1594. net/ipv4/ah4.c +13 −3
  1595. net/ipv4/bpf_tcp_ca.c +1 −1
  1596. net/ipv4/esp4.c +4 −3
  1597. net/ipv4/icmp.c +3 −0
  1598. net/ipv4/igmp.c +36 −22
  1599. net/ipv4/inet_connection_sock.c +2 −2
  1600. net/ipv4/inetpeer.c +2 −1
  1601. net/ipv4/ip_output.c +2 −0
  1602. net/ipv4/ip_tunnel_core.c +14 −8
  1603. net/ipv4/ipmr.c +64 −54
  1604. net/ipv4/ipmr_base.c +16 −0
  1605. net/ipv4/netfilter/arp_tables.c +23 −48
  1606. net/ipv4/netfilter/arpt_mangle.c +8 −0
  1607. net/ipv4/netfilter/arptable_filter.c +14 −13
  1608. net/ipv4/netfilter/ip_tables.c +8 −51
  1609. net/ipv4/netfilter/iptable_filter.c +14 −13
  1610. net/ipv4/netfilter/iptable_mangle.c +15 −14
  1611. net/ipv4/netfilter/iptable_nat.c +5 −1
  1612. net/ipv4/netfilter/iptable_raw.c +13 −13
  1613. net/ipv4/netfilter/iptable_security.c +14 −13
  1614. net/ipv4/netfilter/nf_socket_ipv4.c +3 −0
  1615. net/ipv4/raw.c +1 −1
  1616. net/ipv4/route.c +1 −1
  1617. net/ipv4/sysctl_net_ipv4.c +1 −1
  1618. net/ipv4/tcp.c +0 −3
  1619. net/ipv4/tcp_ao.c +2 −1
  1620. net/ipv4/tcp_input.c +6 −9
  1621. net/ipv4/tcp_ipv4.c +8 −9
  1622. net/ipv4/tcp_minisocks.c +1 −1
  1623. net/ipv4/tcp_output.c +1 −0
  1624. net/ipv4/tcp_timer.c +3 −2
  1625. net/ipv4/udp_offload.c +8 −14
  1626. net/ipv6/Kconfig +2 −2
  1627. net/ipv6/addrconf.c +1 −1
  1628. net/ipv6/ah6.c +13 −3
  1629. net/ipv6/datagram.c +46 −8
  1630. net/ipv6/esp6.c +4 −3
  1631. net/ipv6/exthdrs.c +27 −9
  1632. net/ipv6/exthdrs_core.c +7 −0
  1633. net/ipv6/ip6_flowlabel.c +31 −15
  1634. net/ipv6/ip6_gre.c +3 −2
  1635. net/ipv6/ip6_input.c +5 −0
  1636. net/ipv6/ip6_output.c +5 −0
  1637. net/ipv6/ip6_tunnel.c +4 −0
  1638. net/ipv6/ip6_vti.c +16 −7
  1639. net/ipv6/netfilter/ip6_tables.c +8 −48
  1640. net/ipv6/netfilter/ip6t_hbh.c +4 −0
  1641. net/ipv6/netfilter/ip6table_filter.c +13 −13
  1642. net/ipv6/netfilter/ip6table_mangle.c +14 −13
  1643. net/ipv6/netfilter/ip6table_nat.c +5 −1
  1644. net/ipv6/netfilter/ip6table_raw.c +12 −12
  1645. net/ipv6/netfilter/ip6table_security.c +14 −13
  1646. net/ipv6/netfilter/nf_socket_ipv6.c +3 −2
  1647. net/ipv6/netfilter/nft_fib_ipv6.c +17 −1
  1648. net/ipv6/route.c +15 −1
  1649. net/ipv6/rpl_iptunnel.c +9 −0
  1650. net/ipv6/seg6_iptunnel.c +9 −0
  1651. net/ipv6/tcp_ipv6.c +13 −7
  1652. net/ipv6/xfrm6_protocol.c +3 −1
  1653. net/iucv/af_iucv.c +14 −6
  1654. net/key/af_key.c +3 −3
  1655. net/l2tp/l2tp_core.c +7 −6
  1656. net/mac80211/cfg.c +3 −2
  1657. net/mac80211/mlme.c +17 −6
  1658. net/mac80211/parse.c +63 −42
  1659. net/mac80211/rx.c +9 −3
  1660. net/mac80211/tests/chan-mode.c +1 −0
  1661. net/mac80211/util.c +2 −2
  1662. net/mctp/test/route-test.c +1 −1
  1663. net/mctp/test/utils.c +1 −1
  1664. net/mptcp/bpf.c +1 −1
  1665. net/mptcp/fastopen.c +3 −1
  1666. net/mptcp/pm.c +88 −30
  1667. net/mptcp/pm_kernel.c +9 −5
  1668. net/mptcp/protocol.c +22 −6
  1669. net/mptcp/sockopt.c +18 −8
  1670. net/mptcp/subflow.c +2 −2
  1671. net/netfilter/ipset/ip_set_core.c +3 −2
  1672. net/netfilter/ipset/ip_set_hash_gen.h +37 −20
  1673. net/netfilter/ipset/ip_set_hash_ipmark.c +5 −1
  1674. net/netfilter/ipset/ip_set_hash_ipport.c +4 −1
  1675. net/netfilter/ipset/ip_set_hash_ipportip.c +4 −1
  1676. net/netfilter/ipset/ip_set_hash_ipportnet.c +4 −1
  1677. net/netfilter/ipvs/ip_vs_conn.c +42 −34
  1678. net/netfilter/ipvs/ip_vs_core.c +1 −1
  1679. net/netfilter/ipvs/ip_vs_ctl.c +237 −106
  1680. net/netfilter/ipvs/ip_vs_est.c +48 −35
  1681. net/netfilter/nf_conntrack_broadcast.c +1 −0
  1682. net/netfilter/nf_conntrack_core.c +13 −2
  1683. net/netfilter/nf_conntrack_expect.c +1 −0
  1684. net/netfilter/nf_conntrack_h323_main.c +6 −6
  1685. net/netfilter/nf_conntrack_helper.c +13 −5
  1686. net/netfilter/nf_conntrack_netlink.c +19 −2
  1687. net/netfilter/nf_conntrack_pptp.c +2 −6
  1688. net/netfilter/nf_conntrack_proto_gre.c +81 −25
  1689. net/netfilter/nf_conntrack_proto_sctp.c +7 −3
  1690. net/netfilter/nf_conntrack_proto_tcp.c +2 −1
  1691. net/netfilter/nf_conntrack_sip.c +123 −39
  1692. net/netfilter/nf_dup_netdev.c +0 −16
  1693. net/netfilter/nf_flow_table_core.c +1 −0
  1694. net/netfilter/nf_flow_table_ip.c +116 −35
  1695. net/netfilter/nf_flow_table_path.c +6 −1
  1696. net/netfilter/nf_nat_sip.c +1 −0
  1697. net/netfilter/nf_queue.c +3 −1
  1698. net/netfilter/nf_synproxy_core.c +2 −0
  1699. net/netfilter/nf_tables_api.c +245 −102
  1700. net/netfilter/nf_tables_core.c +1 −1
  1701. net/netfilter/nfnetlink_queue.c +6 −2
  1702. net/netfilter/nft_bitwise.c +16 −5
  1703. net/netfilter/nft_byteorder.c +10 −3
  1704. net/netfilter/nft_compat.c +35 −10
  1705. net/netfilter/nft_ct.c +2 −0
  1706. net/netfilter/nft_exthdr.c +1 −1
  1707. net/netfilter/nft_fwd_netdev.c +25 −4
  1708. net/netfilter/nft_inner.c +1 −2
  1709. net/netfilter/nft_osf.c +1 −1
  1710. net/netfilter/nft_payload.c +3 −0
  1711. net/netfilter/nft_tproxy.c +4 −4
  1712. net/netfilter/x_tables.c +218 −38
  1713. net/netfilter/xt_CT.c +4 −4
  1714. net/netfilter/xt_TCPMSS.c +17 −16
  1715. net/netfilter/xt_TPROXY.c +9 −2
  1716. net/netfilter/xt_addrtype.c +19 −6
  1717. net/netfilter/xt_cpu.c +1 −1
  1718. net/netfilter/xt_devgroup.c +13 −5
  1719. net/netfilter/xt_ecn.c +4 −0
  1720. net/netfilter/xt_hashlimit.c +3 −1
  1721. net/netfilter/xt_osf.c +3 −0
  1722. net/netfilter/xt_physdev.c +15 −5
  1723. net/netfilter/xt_policy.c +20 −6
  1724. net/netfilter/xt_set.c +25 −14
  1725. net/netfilter/xt_tcpmss.c +4 −0
  1726. net/netlink/af_netlink.c +8 −3
  1727. net/netlink/genetlink.c +6 −2
  1728. net/nfc/hci/core.c +10 −0
  1729. net/nfc/llcp_core.c +11 −0
  1730. net/nfc/llcp_sock.c +2 −0
  1731. net/nfc/nci/hci.c +10 −0
  1732. net/openvswitch/vport-geneve.c +4 −1
  1733. net/openvswitch/vport-gre.c +4 −1
  1734. net/openvswitch/vport-netdev.c +46 −22
  1735. net/openvswitch/vport-netdev.h +1 −1
  1736. net/openvswitch/vport-vxlan.c +4 −1
  1737. net/phonet/pep.c +17 −2
  1738. net/phonet/socket.c +8 −2
  1739. net/psp/psp-nl-gen.c +2 −2
  1740. net/psp/psp_main.c +31 −11
  1741. net/psp/psp_nl.c +7 −3
  1742. net/rds/message.c +16 −5
  1743. net/rds/tcp.c +6 −3
  1744. net/rxrpc/ar-internal.h +9 −5
  1745. net/rxrpc/call_event.c +1 −19
  1746. net/rxrpc/call_object.c +2 −0
  1747. net/rxrpc/conn_event.c +12 −17
  1748. net/rxrpc/insecure.c +3 −5
  1749. net/rxrpc/recvmsg.c +55 −13
  1750. net/rxrpc/rxgk.c +67 −93
  1751. net/rxrpc/rxgk_app.c +19 −27
  1752. net/rxrpc/rxgk_common.h +30 −36
  1753. net/rxrpc/rxkad.c +42 −73
  1754. net/sched/act_mirred.c +51 −26
  1755. net/sched/sch_cake.c +196 −176
  1756. net/sched/sch_cbs.c +15 −1
  1757. net/sched/sch_choke.c +16 −10
  1758. net/sched/sch_dualpi2.c +2 −2
  1759. net/sched/sch_fq_codel.c +20 −19
  1760. net/sched/sch_fq_pie.c +10 −9
  1761. net/sched/sch_netem.c +67 −56
  1762. net/sched/sch_pie.c +6 −8
  1763. net/sched/sch_red.c +1 −1
  1764. net/sched/sch_sfb.c +1 −1
  1765. net/sched/sch_sfq.c +25 −23
  1766. net/sched/sch_taprio.c +8 −5
  1767. net/sctp/sm_statefuns.c +6 −0
  1768. net/sctp/socket.c +11 −0
  1769. net/shaper/shaper.c +157 −67
  1770. net/shaper/shaper_nl_gen.c +6 −1
  1771. net/shaper/shaper_nl_gen.h +2 −0
  1772. net/smc/af_smc.c +14 −18
  1773. net/smc/smc_tracepoint.h +1 −1
  1774. net/sunrpc/cache.c +4 −1
  1775. net/tls/tls.h +1 −0
  1776. net/tls/tls_strp.c +6 −0
  1777. net/tls/tls_sw.c +39 −17
  1778. net/unix/af_unix.c +5 −9
  1779. net/unix/garbage.c +3 −3
  1780. net/vmw_vsock/af_vsock.c +32 −17
  1781. net/vmw_vsock/hyperv_transport.c +8 −5
  1782. net/vmw_vsock/virtio_transport_common.c +92 −93
  1783. net/vmw_vsock/vmci_transport.c +6 −4
  1784. net/wireless/nl80211.c +27 −0
  1785. net/wireless/pmsr.c +1 −1
  1786. net/wireless/scan.c +3 −0
  1787. net/wireless/wext-compat.c +2 −0
  1788. net/xdp/xsk.c +74 −41
  1789. net/xdp/xsk_buff_pool.c +3 −0
  1790. net/xdp/xskmap.c +4 −0
  1791. net/xfrm/xfrm_input.c +12 −4
  1792. net/xfrm/xfrm_ipcomp.c +8 −4
  1793. net/xfrm/xfrm_iptfs.c +23 −5
  1794. net/xfrm/xfrm_output.c +14 −6
  1795. net/xfrm/xfrm_policy.c +9 −8
  1796. net/xfrm/xfrm_state.c +24 −11
  1797. net/xfrm/xfrm_user.c +3 −3
  1798. rust/Makefile +2 −0
  1799. rust/kernel/drm/device.rs +16 −6
  1800. rust/kernel/drm/gem/mod.rs +11 −2
  1801. rust/kernel/drm/gem/shmem.rs +2 −4
  1802. rust/pin-init/internal/src/init.rs +84 −100
  1803. rust/pin-init/src/__internal.rs +19 −9
  1804. scripts/gcc-plugins/gcc-common.h +3 −1
  1805. scripts/gdb/linux/mm.py +3 −3
  1806. scripts/gdb/linux/slab.py +2 −2
  1807. scripts/mod/file2alias.c +53 −26
  1808. scripts/package/PKGBUILD +1 −1
  1809. security/keys/keyring.c +1 −0
  1810. security/lsm_syscalls.c +8 −1
  1811. security/selinux/hooks.c +17 −21
  1812. security/selinux/include/objsec.h +1 −3
  1813. security/selinux/include/security.h +0 −2
  1814. security/selinux/selinuxfs.c +31 −165
  1815. security/selinux/ss/services.c +0 −125
  1816. sound/core/misc.c +6 −2
  1817. sound/core/oss/pcm_oss.c +34 −13
  1818. sound/core/pcm_drm_eld.c +2 −2
  1819. sound/core/pcm_lib.c +3 −0
  1820. sound/core/seq/seq_clientmgr.c +1 −1
  1821. sound/core/seq/seq_clientmgr.h +4 −1
  1822. sound/core/seq/seq_ports.c +5 −2
  1823. sound/core/seq/seq_ump_client.c +19 −5
  1824. sound/core/timer.c +14 −5
  1825. sound/drivers/aloop.c +30 −13
  1826. sound/drivers/pcmtest.c +3 −3
  1827. sound/firewire/motu/motu-register-dsp-message-parser.c +7 −4
  1828. sound/firewire/tascam/tascam-hwdep.c +1 −0
  1829. sound/hda/codecs/Makefile +0 −2
  1830. sound/hda/codecs/ca0132.c +31 −13
  1831. sound/hda/codecs/cirrus/cs420x.c +1 −0
  1832. sound/hda/codecs/conexant.c +7 −1
  1833. sound/hda/codecs/realtek/alc269.c +96 −11
  1834. sound/hda/codecs/side-codecs/Kconfig +0 −1
  1835. sound/hda/codecs/side-codecs/cs35l41_hda.c +3 −1
  1836. sound/hda/codecs/side-codecs/cs35l56_hda.c +31 −18
  1837. sound/hda/codecs/side-codecs/cs35l56_hda.h +1 −0
  1838. sound/hda/codecs/side-codecs/tas2781_hda_spi.c +11 −3
  1839. sound/hda/common/auto_parser.c +2 −2
  1840. sound/hda/common/codec.c +3 −0
  1841. sound/hda/common/controller.c +7 −21
  1842. sound/hda/common/hda_controller.h +12 −2
  1843. sound/hda/controllers/intel.c +75 −31
  1844. sound/hda/controllers/intel.h +12 −3
  1845. sound/hda/core/hdmi_chmap.c +7 −4
  1846. sound/pci/asihpi/hpicmn.c +6 −0
  1847. sound/soc/amd/acp-config.c +7 −0
  1848. sound/soc/amd/acp/acp-legacy-mach.c +1 −1
  1849. sound/soc/amd/acp/acp-mach-common.c +19 −3
  1850. sound/soc/amd/acp/acp-mach.h +4 −0
  1851. sound/soc/amd/acp/acp-sdw-legacy-mach.c +1 −1
  1852. sound/soc/amd/acp/acp-sof-mach.c +1 −1
  1853. sound/soc/amd/yc/acp6x-mach.c +21 −0
  1854. sound/soc/codecs/Kconfig +0 −3
  1855. sound/soc/codecs/ab8500-codec.c +3 −301
  1856. sound/soc/codecs/aw88395/aw88395.c +4 −5
  1857. sound/soc/codecs/cs-amp-lib.c +12 −5
  1858. sound/soc/codecs/cs35l56-sdw.c +5 −3
  1859. sound/soc/codecs/cs35l56-shared.c +9 −9
  1860. sound/soc/codecs/cs35l56.c +16 −8
  1861. sound/soc/codecs/es8389.c +1 −1
  1862. sound/soc/codecs/fs210x.c +1 −1
  1863. sound/soc/codecs/pcm512x.c +3 −3
  1864. sound/soc/codecs/simple-mux.c +1 −1
  1865. sound/soc/codecs/tas2764.c +28 −8
  1866. sound/soc/codecs/tas2770.c +24 −3
  1867. sound/soc/codecs/wcd937x.c +25 −1
  1868. sound/soc/codecs/wm_adsp_fw_find_test.c +47 −10
  1869. sound/soc/fsl/fsl_sai.c +36 −7
  1870. sound/soc/fsl/fsl_xcvr.c +13 −4
  1871. sound/soc/intel/boards/bytcht_es8316.c +27 −2
  1872. sound/soc/intel/boards/bytcr_wm5102.c +1 −0
  1873. sound/soc/intel/boards/sof_sdw.c +8 −0
  1874. sound/soc/intel/common/soc-acpi-intel-arl-match.c +56 −15
  1875. sound/soc/intel/common/soc-acpi-intel-nvl-match.c +13 −0
  1876. sound/soc/intel/common/soc-acpi-intel-ptl-match.c +19 −115
  1877. sound/soc/intel/common/soc-acpi-intel-sdca-quirks.c +16 −0
  1878. sound/soc/intel/common/soc-acpi-intel-sdca-quirks.h +1 −0
  1879. sound/soc/qcom/qdsp6/q6apm-dai.c +6 −1
  1880. sound/soc/qcom/qdsp6/q6asm-dai.c +25 −23
  1881. sound/soc/sdw_utils/soc_sdw_utils.c +11 −4
  1882. sound/soc/soc-utils.c +1 −0
  1883. sound/soc/sof/amd/acp.c +1 −1
  1884. sound/soc/sof/intel/hda.c +2 −1
  1885. sound/soc/spacemit/k1_i2s.c +37 −19
  1886. sound/soc/tegra/Makefile +0 −1
  1887. sound/soc/ti/omap-dmic.c +1 −1
  1888. sound/sparc/dbri.c +1 −0
  1889. sound/usb/caiaq/device.c +3 −3
  1890. sound/usb/caiaq/input.c +1 −1
  1891. sound/usb/clock.c +11 −4
  1892. sound/usb/midi.c +7 −5
  1893. sound/usb/midi2.c +12 −9
  1894. sound/usb/misc/ua101.c +10 −2
  1895. sound/usb/mixer.c +10 −0
  1896. sound/usb/mixer_scarlett2.c +36 −6
  1897. sound/usb/qcom/qc_audio_offload.c +25 −6
  1898. sound/usb/quirks-table.h +3 −1
  1899. sound/usb/quirks.c +12 −1
  1900. sound/usb/stream.c +25 −37
  1901. sound/usb/stream.h +2 −1
  1902. tools/arch/x86/include/asm/msr-index.h +2 −1
  1903. tools/bootconfig/main.c +3 −1
  1904. tools/include/uapi/linux/stddef.h +25 −1
  1905. tools/lib/bpf/gen_loader.c +1 −2
  1906. tools/net/ynl/Makefile.deps +3 −1
  1907. tools/net/ynl/pyynl/lib/ynl.py +32 −5
  1908. tools/net/ynl/pyynl/ynl_gen_c.py +29 −2
  1909. tools/perf/Makefile +4 −1
  1910. tools/perf/Makefile.perf +8 −1
  1911. tools/perf/builtin-trace.c +3 −6
  1912. tools/perf/trace/beauty/beauty.h +3 −0
  1913. tools/perf/trace/beauty/clone.sh +4 −0
  1914. tools/perf/trace/beauty/fsmount.c +17 −1
  1915. tools/perf/trace/beauty/fsmount.sh +3 −8
  1916. tools/perf/trace/beauty/fsmount_attr.sh +22 −0
  1917. tools/perf/trace/beauty/include/linux/socket.h +1 −1
  1918. tools/perf/trace/beauty/include/uapi/linux/fs.h +12 −0
  1919. tools/perf/trace/beauty/include/uapi/linux/mount.h +1 −0
  1920. tools/perf/trace/beauty/include/uapi/linux/sched.h +15 −2
  1921. tools/sched_ext/scx_qmap.bpf.c +6 −18
  1922. tools/testing/cxl/test/cxl.c +43 −62
  1923. tools/testing/radix-tree/maple.c +1 −1
  1924. tools/testing/selftests/arm64/gcs/gcs-util.h +0 −6
  1925. tools/testing/selftests/arm64/gcs/libc-gcs.c +1 −0
  1926. tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c +4 −0
  1927. tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +1 −1
  1928. tools/testing/selftests/bpf/prog_tests/percpu_array_inner_map.c +57 −0
  1929. tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c +103 −0
  1930. tools/testing/selftests/bpf/prog_tests/sockopt_sk.c +16 −1
  1931. tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c +4 −0
  1932. tools/testing/selftests/bpf/prog_tests/verifier.c +2 −0
  1933. tools/testing/selftests/bpf/progs/bpf_cubic.c +14 −0
  1934. tools/testing/selftests/bpf/progs/exceptions_fail.c +22 −0
  1935. tools/testing/selftests/bpf/progs/sockopt_sk.c +16 −0
  1936. tools/testing/selftests/bpf/progs/test_misc_tcp_hdr_options.c +14 −1
  1937. tools/testing/selftests/bpf/progs/test_sockmap_ktls.c +21 −0
  1938. tools/testing/selftests/bpf/progs/verifier_call_large_imm.c +66 −0
  1939. tools/testing/selftests/cgroup/lib/cgroup_util.c +3 −2
  1940. tools/testing/selftests/cgroup/test_cpuset_v1_base.sh +1 −1
  1941. tools/testing/selftests/cgroup/test_kmem.c +7 −3
  1942. tools/testing/selftests/drivers/net/README.rst +8 −2
  1943. tools/testing/selftests/drivers/net/hw/Makefile +1 −0
  1944. tools/testing/selftests/drivers/net/hw/config +5 −0
  1945. tools/testing/selftests/drivers/net/hw/ipsec_vxlan.py +204 −0
  1946. tools/testing/selftests/drivers/net/lib/py/load.py +4 −1
  1947. tools/testing/selftests/drivers/net/shaper.py +22 −2
  1948. tools/testing/selftests/kselftest.h +1 −1
  1949. tools/testing/selftests/kselftest_harness.h +6 −6
  1950. tools/testing/selftests/kvm/access_tracking_perf_test.c +23 −23
  1951. tools/testing/selftests/kvm/arch_timer.c +3 −3
  1952. tools/testing/selftests/kvm/arm64/aarch32_id_regs.c +7 −7
  1953. tools/testing/selftests/kvm/arm64/arch_timer.c +4 −4
  1954. tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c +80 −81
  1955. tools/testing/selftests/kvm/arm64/debug-exceptions.c +35 −37
  1956. tools/testing/selftests/kvm/arm64/hypercalls.c +12 −12
  1957. tools/testing/selftests/kvm/arm64/idreg-idst.c +2 −2
  1958. tools/testing/selftests/kvm/arm64/no-vgic.c +4 −4
  1959. tools/testing/selftests/kvm/arm64/page_fault_test.c +41 −41
  1960. tools/testing/selftests/kvm/arm64/psci_test.c +12 −14
  1961. tools/testing/selftests/kvm/arm64/sea_to_user.c +19 −22
  1962. tools/testing/selftests/kvm/arm64/set_id_regs.c +35 −35
  1963. tools/testing/selftests/kvm/arm64/smccc_filter.c +5 −5
  1964. tools/testing/selftests/kvm/arm64/vgic_init.c +28 −28
  1965. tools/testing/selftests/kvm/arm64/vgic_irq.c +69 −68
  1966. tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c +10 −10
  1967. tools/testing/selftests/kvm/arm64/vgic_v5.c +5 −5
  1968. tools/testing/selftests/kvm/arm64/vpmu_counter_access.c +28 −28
  1969. tools/testing/selftests/kvm/coalesced_io_test.c +19 −19
  1970. tools/testing/selftests/kvm/demand_paging_test.c +5 −5
  1971. tools/testing/selftests/kvm/dirty_log_perf_test.c +7 −7
  1972. tools/testing/selftests/kvm/dirty_log_test.c +41 −41
  1973. tools/testing/selftests/kvm/get-reg-list.c +1 −1
  1974. tools/testing/selftests/kvm/guest_memfd_test.c +17 −12
  1975. tools/testing/selftests/kvm/guest_print_test.c +11 −11
  1976. tools/testing/selftests/kvm/hardware_disable_test.c +3 −3
  1977. tools/testing/selftests/kvm/include/arm64/arch_timer.h +15 −15
  1978. tools/testing/selftests/kvm/include/arm64/delay.h +2 −2
  1979. tools/testing/selftests/kvm/include/arm64/gic.h +4 −4
  1980. tools/testing/selftests/kvm/include/arm64/gic_v3_its.h +3 −4
  1981. tools/testing/selftests/kvm/include/arm64/processor.h +11 −11
  1982. tools/testing/selftests/kvm/include/arm64/ucall.h +2 −2
  1983. tools/testing/selftests/kvm/include/arm64/vgic.h +11 −11
  1984. tools/testing/selftests/kvm/include/kvm_syscalls.h +10 −0
  1985. tools/testing/selftests/kvm/include/kvm_util.h +166 −180
  1986. tools/testing/selftests/kvm/include/kvm_util_types.h +5 −3
  1987. tools/testing/selftests/kvm/include/loongarch/arch_timer.h +2 −2
  1988. tools/testing/selftests/kvm/include/loongarch/ucall.h +2 −2
  1989. tools/testing/selftests/kvm/include/memstress.h +15 −15
  1990. tools/testing/selftests/kvm/include/riscv/arch_timer.h +11 −11
  1991. tools/testing/selftests/kvm/include/riscv/processor.h +4 −5
  1992. tools/testing/selftests/kvm/include/riscv/ucall.h +2 −2
  1993. tools/testing/selftests/kvm/include/s390/diag318_test_handler.h +1 −1
  1994. tools/testing/selftests/kvm/include/s390/facility.h +2 −2
  1995. tools/testing/selftests/kvm/include/s390/ucall.h +2 −2
  1996. tools/testing/selftests/kvm/include/sparsebit.h +3 −3
  1997. tools/testing/selftests/kvm/include/test_util.h +22 −20
  1998. tools/testing/selftests/kvm/include/timer_test.h +9 −9
  1999. tools/testing/selftests/kvm/include/ucall_common.h +11 −11
  2000. tools/testing/selftests/kvm/include/userfaultfd_util.h +3 −3
  2001. tools/testing/selftests/kvm/include/x86/apic.h +11 −11
  2002. tools/testing/selftests/kvm/include/x86/evmcs.h +11 −11
  2003. tools/testing/selftests/kvm/include/x86/hyperv.h +14 −14
  2004. tools/testing/selftests/kvm/include/x86/kvm_util_arch.h +18 −18
  2005. tools/testing/selftests/kvm/include/x86/pmu.h +5 −4
  2006. tools/testing/selftests/kvm/include/x86/processor.h +144 −148
  2007. tools/testing/selftests/kvm/include/x86/sev.h +10 −10
  2008. tools/testing/selftests/kvm/include/x86/smm.h +1 −2
  2009. tools/testing/selftests/kvm/include/x86/svm_util.h +6 −6
  2010. tools/testing/selftests/kvm/include/x86/ucall.h +1 −1
  2011. tools/testing/selftests/kvm/include/x86/vmx.h +35 −35
  2012. tools/testing/selftests/kvm/kvm_page_table_test.c +27 −27
  2013. tools/testing/selftests/kvm/lib/arm64/gic.c +3 −3
  2014. tools/testing/selftests/kvm/lib/arm64/gic_private.h +13 −13
  2015. tools/testing/selftests/kvm/lib/arm64/gic_v3.c +45 −45
  2016. tools/testing/selftests/kvm/lib/arm64/gic_v3_its.c +5 −6
  2017. tools/testing/selftests/kvm/lib/arm64/processor.c +82 −83
  2018. tools/testing/selftests/kvm/lib/arm64/ucall.c +6 −6
  2019. tools/testing/selftests/kvm/lib/arm64/vgic.c +20 −20
  2020. tools/testing/selftests/kvm/lib/assert.c +7 −1
  2021. tools/testing/selftests/kvm/lib/elf.c +9 −10
  2022. tools/testing/selftests/kvm/lib/guest_modes.c +1 −1
  2023. tools/testing/selftests/kvm/lib/guest_sprintf.c +9 −9
  2024. tools/testing/selftests/kvm/lib/kvm_util.c +145 −216
  2025. tools/testing/selftests/kvm/lib/loongarch/processor.c +55 −55
  2026. tools/testing/selftests/kvm/lib/loongarch/ucall.c +6 −6
  2027. tools/testing/selftests/kvm/lib/memstress.c +19 −19
  2028. tools/testing/selftests/kvm/lib/riscv/processor.c +45 −46
  2029. tools/testing/selftests/kvm/lib/s390/diag318_test_handler.c +6 −6
  2030. tools/testing/selftests/kvm/lib/s390/facility.c +1 −1
  2031. tools/testing/selftests/kvm/lib/s390/processor.c +31 −34
  2032. tools/testing/selftests/kvm/lib/sparsebit.c +9 −9
  2033. tools/testing/selftests/kvm/lib/test_util.c +15 −15
  2034. tools/testing/selftests/kvm/lib/ucall_common.c +17 −17
  2035. tools/testing/selftests/kvm/lib/userfaultfd_util.c +7 −7
  2036. tools/testing/selftests/kvm/lib/x86/apic.c +1 −1
  2037. tools/testing/selftests/kvm/lib/x86/hyperv.c +7 −7
  2038. tools/testing/selftests/kvm/lib/x86/memstress.c +7 −7
  2039. tools/testing/selftests/kvm/lib/x86/pmu.c +4 −4
  2040. tools/testing/selftests/kvm/lib/x86/processor.c +142 −150
  2041. tools/testing/selftests/kvm/lib/x86/sev.c +10 −10
  2042. tools/testing/selftests/kvm/lib/x86/svm.c +8 −8
  2043. tools/testing/selftests/kvm/lib/x86/ucall.c +2 −2
  2044. tools/testing/selftests/kvm/lib/x86/vmx.c +22 −22
  2045. tools/testing/selftests/kvm/loongarch/arch_timer.c +14 −14
  2046. tools/testing/selftests/kvm/loongarch/pmu_test.c +5 −5
  2047. tools/testing/selftests/kvm/memslot_modification_stress_test.c +5 −5
  2048. tools/testing/selftests/kvm/memslot_perf_test.c +83 −83
  2049. tools/testing/selftests/kvm/mmu_stress_test.c +14 −14
  2050. tools/testing/selftests/kvm/pre_fault_memory_test.c +6 −6
  2051. tools/testing/selftests/kvm/riscv/arch_timer.c +4 −4
  2052. tools/testing/selftests/kvm/riscv/ebreak_test.c +3 −3
  2053. tools/testing/selftests/kvm/riscv/get-reg-list.c +2 −2
  2054. tools/testing/selftests/kvm/riscv/sbi_pmu_test.c +4 −4
  2055. tools/testing/selftests/kvm/s390/debug_test.c +4 −4
  2056. tools/testing/selftests/kvm/s390/irq_routing.c +1 −1
  2057. tools/testing/selftests/kvm/s390/memop.c +47 −47
  2058. tools/testing/selftests/kvm/s390/resets.c +3 −3
  2059. tools/testing/selftests/kvm/s390/shared_zeropage_test.c +2 −3
  2060. tools/testing/selftests/kvm/s390/tprot.c +13 −13
  2061. tools/testing/selftests/kvm/s390/ucontrol_test.c +4 −4
  2062. tools/testing/selftests/kvm/set_memory_region_test.c +21 −21
  2063. tools/testing/selftests/kvm/steal_time.c +44 −37
  2064. tools/testing/selftests/kvm/system_counter_offset_test.c +6 −6
  2065. tools/testing/selftests/kvm/x86/amx_test.c +7 −7
  2066. tools/testing/selftests/kvm/x86/aperfmperf_test.c +8 −8
  2067. tools/testing/selftests/kvm/x86/apic_bus_clock_test.c +16 −12
  2068. tools/testing/selftests/kvm/x86/cpuid_test.c +3 −3
  2069. tools/testing/selftests/kvm/x86/debug_regs.c +2 −2
  2070. tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c +8 −8
  2071. tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c +3 −3
  2072. tools/testing/selftests/kvm/x86/fastops_test.c +26 −26
  2073. tools/testing/selftests/kvm/x86/feature_msrs_test.c +6 −6
  2074. tools/testing/selftests/kvm/x86/fix_hypercall_test.c +10 −10
  2075. tools/testing/selftests/kvm/x86/flds_emulation.h +3 −3
  2076. tools/testing/selftests/kvm/x86/hwcr_msr_test.c +5 −5
  2077. tools/testing/selftests/kvm/x86/hyperv_clock.c +3 −3
  2078. tools/testing/selftests/kvm/x86/hyperv_evmcs.c +5 −5
  2079. tools/testing/selftests/kvm/x86/hyperv_extended_hypercalls.c +10 −10
  2080. tools/testing/selftests/kvm/x86/hyperv_features.c +13 −13
  2081. tools/testing/selftests/kvm/x86/hyperv_ipi.c +6 −6
  2082. tools/testing/selftests/kvm/x86/hyperv_svm_test.c +5 −5
  2083. tools/testing/selftests/kvm/x86/hyperv_tlb_flush.c +18 −18
  2084. tools/testing/selftests/kvm/x86/kvm_buslock_test.c +1 −1
  2085. tools/testing/selftests/kvm/x86/kvm_clock_test.c +7 −7
  2086. tools/testing/selftests/kvm/x86/kvm_pv_test.c +5 −5
  2087. tools/testing/selftests/kvm/x86/monitor_mwait_test.c +1 −1
  2088. tools/testing/selftests/kvm/x86/nested_close_kvm_test.c +1 −1
  2089. tools/testing/selftests/kvm/x86/nested_dirty_log_test.c +5 −5
  2090. tools/testing/selftests/kvm/x86/nested_emulation_test.c +10 −10
  2091. tools/testing/selftests/kvm/x86/nested_exceptions_test.c +3 −3
  2092. tools/testing/selftests/kvm/x86/nested_invalid_cr3_test.c +1 −1
  2093. tools/testing/selftests/kvm/x86/nested_set_state_test.c +2 −2
  2094. tools/testing/selftests/kvm/x86/nested_tsc_adjust_test.c +6 −6
  2095. tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c +13 −13
  2096. tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c +1 −1
  2097. tools/testing/selftests/kvm/x86/nx_huge_pages_test.c +9 −9
  2098. tools/testing/selftests/kvm/x86/platform_info_test.c +3 −3
  2099. tools/testing/selftests/kvm/x86/pmu_counters_test.c +54 −55
  2100. tools/testing/selftests/kvm/x86/pmu_event_filter_test.c +51 −51
  2101. tools/testing/selftests/kvm/x86/private_mem_conversions_test.c +39 −39
  2102. tools/testing/selftests/kvm/x86/private_mem_kvm_exits_test.c +7 −7
  2103. tools/testing/selftests/kvm/x86/set_boot_cpu_id.c +3 −3
  2104. tools/testing/selftests/kvm/x86/set_sregs_test.c +3 −3
  2105. tools/testing/selftests/kvm/x86/sev_init2_tests.c +3 −3
  2106. tools/testing/selftests/kvm/x86/sev_smoke_test.c +11 −11
  2107. tools/testing/selftests/kvm/x86/smaller_maxphyaddr_emulation_test.c +4 −4
  2108. tools/testing/selftests/kvm/x86/smm_test.c +4 −4
  2109. tools/testing/selftests/kvm/x86/state_test.c +7 −7
  2110. tools/testing/selftests/kvm/x86/svm_int_ctl_test.c +1 −1
  2111. tools/testing/selftests/kvm/x86/svm_lbr_nested_state.c +1 −1
  2112. tools/testing/selftests/kvm/x86/svm_nested_clear_efer_svme.c +1 −1
  2113. tools/testing/selftests/kvm/x86/svm_nested_shutdown_test.c +1 −1
  2114. tools/testing/selftests/kvm/x86/svm_nested_soft_inject_test.c +5 −5
  2115. tools/testing/selftests/kvm/x86/svm_nested_vmcb12_gpa.c +7 −7
  2116. tools/testing/selftests/kvm/x86/svm_vmcall_test.c +1 −1
  2117. tools/testing/selftests/kvm/x86/sync_regs_test.c +1 −1
  2118. tools/testing/selftests/kvm/x86/triple_fault_event_test.c +2 −2
  2119. tools/testing/selftests/kvm/x86/tsc_msrs_test.c +1 −1
  2120. tools/testing/selftests/kvm/x86/tsc_scaling_sync.c +2 −2
  2121. tools/testing/selftests/kvm/x86/ucna_injection_test.c +23 −22
  2122. tools/testing/selftests/kvm/x86/userspace_io_test.c +2 −2
  2123. tools/testing/selftests/kvm/x86/userspace_msr_exit_test.c +29 −29
  2124. tools/testing/selftests/kvm/x86/vmx_apic_access_test.c +2 −2
  2125. tools/testing/selftests/kvm/x86/vmx_apicv_updates_test.c +2 −2
  2126. tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c +1 −1
  2127. tools/testing/selftests/kvm/x86/vmx_msrs_test.c +10 −12
  2128. tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c +2 −2
  2129. tools/testing/selftests/kvm/x86/vmx_pmu_caps_test.c +6 −6
  2130. tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c +1 −1
  2131. tools/testing/selftests/kvm/x86/xapic_ipi_test.c +32 −32
  2132. tools/testing/selftests/kvm/x86/xapic_state_test.c +10 −10
  2133. tools/testing/selftests/kvm/x86/xapic_tpr_test.c +12 −12
  2134. tools/testing/selftests/kvm/x86/xcr0_cpuid_test.c +4 −4
  2135. tools/testing/selftests/kvm/x86/xen_shinfo_test.c +11 −11
  2136. tools/testing/selftests/kvm/x86/xss_msr_test.c +1 −1
  2137. tools/testing/selftests/mm/config +1 −0
  2138. tools/testing/selftests/mm/hmm-tests.c +50 −0
  2139. tools/testing/selftests/mm/run_vmtests.sh +1 −1
  2140. tools/testing/selftests/net/Makefile +1 −0
  2141. tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +29 −1
  2142. tools/testing/selftests/net/ioam6.sh +1 −1
  2143. tools/testing/selftests/net/lib/xdp_native.bpf.c +30 −25
  2144. tools/testing/selftests/net/link_netns.py +59 −2
  2145. tools/testing/selftests/net/mptcp/mptcp_connect.sh +3 −3
  2146. tools/testing/selftests/net/mptcp/mptcp_join.sh +31 −0
  2147. tools/testing/selftests/net/mptcp/mptcp_lib.sh +15 −11
  2148. tools/testing/selftests/net/mptcp/pm_netlink.sh +13 −7
  2149. tools/testing/selftests/net/netfilter/Makefile +1 −0
  2150. tools/testing/selftests/net/netfilter/nft_fib_nexthop.sh +152 −0
  2151. tools/testing/selftests/net/openvswitch/openvswitch.sh +37 −0
  2152. tools/testing/selftests/net/openvswitch/ovs-dpctl.py +13 −6
  2153. tools/testing/selftests/net/ovpn/test-close-socket.sh +1 −1
  2154. tools/testing/selftests/net/ovpn/test-mark.sh +3 −3
  2155. tools/testing/selftests/net/ovpn/test.sh +4 −4
  2156. tools/testing/selftests/net/rds/config +1 −0
  2157. tools/testing/selftests/net/rtnetlink.sh +63 −0
  2158. tools/testing/selftests/net/tcp_ecmp_failover.sh +216 −0
  2159. tools/testing/selftests/net/tls.c +43 −0
  2160. tools/testing/selftests/rdma/rxe_ipv6.sh +4 −2
  2161. tools/testing/selftests/rdma/rxe_rping_between_netns.sh +7 −0
  2162. tools/testing/selftests/rdma/rxe_socket_with_netns.sh +6 −0
  2163. tools/testing/selftests/rdma/rxe_test_NETDEV_UNREGISTER.sh +4 −2
  2164. tools/testing/selftests/rseq/Makefile +15 −6
  2165. tools/testing/selftests/rseq/check_optimized.c +17 −0
  2166. tools/testing/selftests/rseq/legacy_check.c +65 −0
  2167. tools/testing/selftests/rseq/param_test.c +16 −9
  2168. tools/testing/selftests/rseq/rseq-abi.h +6 −1
  2169. tools/testing/selftests/rseq/rseq.c +18 −21
  2170. tools/testing/selftests/rseq/rseq.h +7 −1
  2171. tools/testing/selftests/rseq/run_legacy_check.sh +4 −0
  2172. tools/testing/selftests/rseq/run_param_test.sh +39 −0
  2173. tools/testing/selftests/rseq/run_timeslice_test.sh +14 −0
  2174. tools/testing/selftests/rseq/slice_test.c +7 −5
  2175. tools/testing/selftests/sched_ext/Makefile +1 −0
  2176. tools/testing/selftests/sched_ext/dequeue.c +1 −0
  2177. tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c +44 −0
  2178. tools/testing/selftests/sched_ext/non_scx_kfunc_deny.c +47 −0
  2179. tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json +615 −1
  2180. tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json +192 −2
  2181. tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json +23 −73
  2182. tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json +26 −0
  2183. tools/testing/selftests/ublk/kublk.c +11 −0
  2184. tools/testing/vma/include/dup.h +1 −1
  2185. tools/testing/vma/include/stubs.h +2 −1
  2186. virt/kvm/dirty_ring.c +2 −1
.mailmap+14−2
@@ -19,6 +19,7 @@ Abhinav Kumar <quic_abhinavk@quicinc.com> <abhinavk@codeaurora.org> · 18 unmodified lines
1919 Ahmad Masri <quic_amasri@quicinc.com> <amasri@codeaurora.org>
2020 Adam Oldham <oldhamca@gmail.com>
2121 Adam Radford <aradford@gmail.com>
22+Aditya Garg <gargaditya08@proton.me> <gargaditya08@live.com>
2223 Adriana Reus <adi.reus@gmail.com> <adriana.reus@intel.com>
2324 Adrian Bunk <bunk@stusta.de>
2425 Ajay Kaher <ajay.kaher@broadcom.com> <akaher@vmware.com>
@@ -207,6 +208,7 @@ Claudiu Beznea <claudiu.beznea@tuxon.dev> <claudiu.beznea@microchip.com> · 182 unmodified lines
207208 Colin Ian King <colin.i.king@gmail.com> <colin.king@canonical.com>
208209 Corey Minyard <minyard@acm.org>
209210 Damian Hobson-Garcia <dhobsong@igel.co.jp>
211+Dan Carpenter <error27@gmail.com> <dan.carpenter@linaro.org>
210212 Dan Carpenter <error27@gmail.com> <dan.carpenter@oracle.com>
211213 Dan Williams <djbw@kernel.org> <dan.j.williams@intel.com>
212214 Daniel Borkmann <daniel@iogearbox.net> <danborkmann@googlemail.com>
@@ -261,8 +263,9 @@ Enric Balletbo i Serra <eballetbo@kernel.org> <enric.balletbo@collabora.com> · 48 unmodified lines
261263 Enric Balletbo i Serra <eballetbo@kernel.org> <eballetbo@iseebcn.com>
262264 Erik Kaneda <erik.kaneda@intel.com> <erik.schmauss@intel.com>
263265 Ethan Carter Edwards <ethan@ethancedwards.com> Ethan Edwards <ethancarteredwards@gmail.com>
264−Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@microchip.com>
265−Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@collabora.com>
266+Eugen Hristev <ehristev@kernel.org> <eugen.hristev@microchip.com>
267+Eugen Hristev <ehristev@kernel.org> <eugen.hristev@linaro.org>
268+Eugen Hristev <ehristev@kernel.org> <eugen.hristev@collabora.com>
266269 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
267270 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> <ezequiel@collabora.com>
268271 Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
@@ -337,6 +340,7 @@ Henrik Rydberg <rydberg@bitmath.org> · 68 unmodified lines
337340 Herbert Xu <herbert@gondor.apana.org.au>
338341 Huacai Chen <chenhuacai@kernel.org> <chenhc@lemote.com>
339342 Huacai Chen <chenhuacai@kernel.org> <chenhuacai@loongson.cn>
343+Ian Ray <ian.ray@gehealthcare.com> <ian.ray@ge.com>
340344 Ignat Korchagin <ignat@linux.win> <ignat@cloudflare.com>
341345 Igor Korotin <igor.korotin@linux.dev> <igor.korotin.linux@gmail.com>
342346 Ike Panhc <ikepanhc@gmail.com> <ike.pan@canonical.com>
@@ -495,6 +499,7 @@ Leon Romanovsky <leon@kernel.org> <leon@leon.nu> · 152 unmodified lines
495499 Leon Romanovsky <leon@kernel.org> <leonro@mellanox.com>
496500 Leon Romanovsky <leon@kernel.org> <leonro@nvidia.com>
497501 Leo Yan <leo.yan@linux.dev> <leo.yan@linaro.org>
502+Liam R. Howlett <liam@infradead.org> <Liam.Howlett@oracle.com>
498503 Liam Mark <quic_lmark@quicinc.com> <lmark@codeaurora.org>
499504 Linas Vepstas <linas@austin.ibm.com>
500505 Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch>
@@ -505,6 +510,8 @@ Linus Walleij <linusw@kernel.org> <linus.walleij@stericsson.com> · 4 unmodified lines
505510 Linus Walleij <linusw@kernel.org> <linus.walleij@linaro.org>
506511 Linus Walleij <linusw@kernel.org> <triad@df.lth.se>
507512 <linux-hardening@vger.kernel.org> <kernel-hardening@lists.openwall.com>
513+Li Wang <li.wang@linux.dev> <liwang@redhat.com>
514+Li Wang <li.wang@linux.dev> <wangli.ahau@gmail.com>
508515 Li Yang <leoyang.li@nxp.com> <leoli@freescale.com>
509516 Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org>
510517 Lior David <quic_liord@quicinc.com> <liord@codeaurora.org>
@@ -579,6 +586,8 @@ Mayuresh Janorkar <mayur@ti.com> · 68 unmodified lines
579586 Md Sadre Alam <quic_mdalam@quicinc.com> <mdalam@codeaurora.org>
580587 Miaoqing Pan <quic_miaoqing@quicinc.com> <miaoqing@codeaurora.org>
581588 Michael Buesch <m@bues.ch>
589+Michal Grzeschik <mgr@kernel.org> <m.grzeschik@pengutronix.de>
590+Michal Grzeschik <mgr@kernel.org> <mgr@pengutronix.de>
582591 Michael Riesch <michael.riesch@collabora.com> <michael.riesch@wolfvision.net>
583592 Michal Simek <michal.simek@amd.com> <michal.simek@xilinx.com>
584593 Michel Dänzer <michel@tungstengraphics.com>
@@ -677,6 +686,7 @@ Peter A Jonsson <pj@ludd.ltu.se> · 92 unmodified lines
677686 Peter Hilber <peter.hilber@oss.qualcomm.com> <quic_philber@quicinc.com>
678687 Peter Oruba <peter.oruba@amd.com>
679688 Peter Oruba <peter@oruba.de>
689+Peter Rosin <peda@lysator.liu.se> <peda@axentia.se>
680690 Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> <pierre-louis.bossart@linux.intel.com>
681691 Pratyush Anand <pratyush.anand@gmail.com> <pratyush.anand@st.com>
682692 Pratyush Yadav <pratyush@kernel.org> <ptyadav@amazon.de>
@@ -687,6 +697,7 @@ Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com> · 4 unmodified lines
687697 Puranjay Mohan <puranjay@kernel.org> <puranjay12@gmail.com>
688698 Qais Yousef <qyousef@layalina.io> <qais.yousef@imgtec.com>
689699 Qais Yousef <qyousef@layalina.io> <qais.yousef@arm.com>
700+Qi Zheng <qi.zheng@linux.dev> <zhengqi.arch@bytedance.com>
690701 Quentin Monnet <qmo@kernel.org> <quentin.monnet@netronome.com>
691702 Quentin Monnet <qmo@kernel.org> <quentin@isovalent.com>
692703 Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com>
@@ -850,6 +861,7 @@ Tobias Klauser <tklauser@distanz.ch> <klto@zhaw.ch> · 157 unmodified lines
850861 Tobias Klauser <tklauser@distanz.ch> <tklauser@nuerscht.ch>
851862 Tobias Klauser <tklauser@distanz.ch> <tklauser@xenon.tklauser.home>
852863 Todor Tomov <todor.too@gmail.com> <todor.tomov@linaro.org>
864+Tomasz Jeznach <tomasz.jeznach@linux.dev> <tjeznach@rivosinc.com>
853865 Tony Luck <tony.luck@intel.com>
854866 Trilok Soni <quic_tsoni@quicinc.com> <tsoni@codeaurora.org>
855867 TripleX Chung <xxx.phy@gmail.com> <triplex@zh-kernel.org>
Documentation/.renames.txt+1−0
@@ -786,6 +786,7 @@ networking/altera_tse networking/device_drivers/ethernet/altera/altera_tse · 785 unmodified lines
786786 networking/bpf_flow_dissector bpf/prog_flow_dissector
787787 networking/cxacru networking/device_drivers/atm/cxacru
788788 networking/defza networking/device_drivers/fddi/defza
789+networking/device_drivers/3com/3c509 networking/device_drivers/ethernet/3com/3c509
789790 networking/device_drivers/3com/vortex networking/device_drivers/ethernet/3com/vortex
790791 networking/device_drivers/amazon/ena networking/device_drivers/ethernet/amazon/ena
791792 networking/device_drivers/aquantia/atlantic networking/device_drivers/ethernet/aquantia/atlantic
Documentation/ABI/removed/sysfs-selinux-userrenamed from Documentation/ABI/obsolete/sysfs-selinux-user+0−0

File renamed without changes.

Documentation/admin-guide/cgroup-v1/memcg_test.rst+2−4
@@ -47,21 +47,19 @@ Please note that implementation details can be changed. · 46 unmodified lines
4747 Called when swp_entry's refcnt goes down to 0. A charge against swap
4848 disappears.
4949
50−3. charge-commit-cancel
50+3. charge-commit
5151 =======================
5252
5353 Memcg pages are charged in two steps:
5454
5555 - mem_cgroup_try_charge()
56− - mem_cgroup_commit_charge() or mem_cgroup_cancel_charge()
56+ - commit_charge()
5757
5858 At try_charge(), there are no flags to say "this page is charged".
5959 at this point, usage += PAGE_SIZE.
6060
6161 At commit(), the page is associated with the memcg.
6262
63− At cancel(), simply usage -= PAGE_SIZE.
64−
6563 Under below explanation, we assume CONFIG_SWAP=y.
6664
6765 4. Anonymous
Documentation/admin-guide/cgroup-v2.rst+1−1
@@ -220,7 +220,7 @@ cgroup v2 currently supports the following mount options. · 219 unmodified lines
220220 memory_hugetlb_accounting
221221 Count HugeTLB memory usage towards the cgroup's overall
222222 memory usage for the memory controller (for the purpose of
223− statistics reporting and memory protetion). This is a new
223+ statistics reporting and memory protection). This is a new
224224 behavior that could regress existing setups, so it must be
225225 explicitly opted in with this mount option.
226226
Documentation/admin-guide/kernel-parameters.txt+0−18
@@ -789,24 +789,6 @@ Kernel parameters · 788 unmodified lines
789789 cio_ignore= [S390]
790790 See Documentation/arch/s390/common_io.rst for details.
791791
792− clearcpuid=X[,X...] [X86]
793− Disable CPUID feature X for the kernel. See
794− arch/x86/include/asm/cpufeatures.h for the valid bit
795− numbers X. Note the Linux-specific bits are not necessarily
796− stable over kernel options, but the vendor-specific
797− ones should be.
798− X can also be a string as appearing in the flags: line
799− in /proc/cpuinfo which does not have the above
800− instability issue. However, not all features have names
801− in /proc/cpuinfo.
802− Note that using this option will taint your kernel.
803− Also note that user programs calling CPUID directly
804− or using the feature without checking anything
805− will still see it. This just prevents it from
806− being used by the kernel or shown in /proc/cpuinfo.
807− Also note the kernel might malfunction if you disable
808− some critical bits.
809−
810792 clk_ignore_unused
811793 [CLK]
812794 Prevents the clock framework from automatically gating
Documentation/admin-guide/laptops/uniwill-laptop.rst+10−0
@@ -43,6 +43,11 @@ Support for changing the platform performance mode is currently not implemented. · 42 unmodified lines
4343 Battery Charging Control
4444 ------------------------
4545
46+.. warning:: Some devices do not properly implement the charging threshold interface. Forcing
47+ the driver to enable access to said interface on such devices might damage the
48+ battery [1]_. Because of this the driver will not enable said feature even when
49+ using the ``force`` module parameter.
50+
4651 The ``uniwill-laptop`` driver supports controlling the battery charge limit. This happens over
4752 the standard ``charge_control_end_threshold`` power supply sysfs attribute. All values
4853 between 1 and 100 percent are supported.
@@ -70,3 +75,8 @@ The ``uniwill-laptop`` driver allows to set the configurable TGP for devices wit · 21 unmodified lines
7075 allow it.
7176
7277 See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for details.
78+
79+References
80+==========
81+
82+.. [1] https://www.reddit.com/r/XMG_gg/comments/ld9yyf/battery_limit_hidden_function_discovered_on/
Documentation/admin-guide/pm/amd-pstate.rst+5−6
@@ -358,9 +358,9 @@ Dynamic energy performance profile · 357 unmodified lines
358358 The amd-pstate driver supports dynamically selecting the energy performance
359359 profile based on whether the machine is running on AC or DC power.
360360
361−Whether this behavior is enabled by default depends on the kernel
362−config option `CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP`. This behavior can also be overridden
363−at runtime by the sysfs file ``/sys/devices/system/cpu/cpufreq/policyX/dynamic_epp``.
361+Whether this behavior is enabled by default depends on the kernel command line option
362+``amd_dynamic_epp`` is set. This behavior can also be overridden
363+at runtime by the sysfs file ``/sys/devices/system/cpu/amd_pstate/dynamic_epp``.
364364
365365 When set to enabled, the driver will select a different energy performance
366366 profile when the machine is running on battery or AC power. The driver will
@@ -485,9 +485,8 @@ kernel parameter ``amd_prefcore=disable``. · 118 unmodified lines
485485 ``amd_dynamic_epp``
486486
487487 When AMD pstate is in auto mode, dynamic EPP will control whether the kernel
488−autonomously changes the EPP mode. The default is configured by
489−``CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP`` but can be explicitly enabled with
490−``amd_dynamic_epp=enable`` or disabled with ``amd_dynamic_epp=disable``.
488+autonomously changes the EPP mode. The default is disabled. It can be enabled
489+with the kernel parameter ``amd_dynamic_epp=enable``.
491490
492491 User Space Interface in ``sysfs`` - General
493492 ===========================================
Documentation/admin-guide/pm/intel_pstate.rst+6−5
@@ -355,11 +355,12 @@ HyperThreading (HT) in the context of Intel processors, is enabled on at least · 354 unmodified lines
355355 one core, ``intel_pstate`` assigns performance-based priorities to CPUs. Namely,
356356 the priority of a given CPU reflects its highest HWP performance level which
357357 causes the CPU scheduler to generally prefer more performant CPUs, so the less
358−performant CPUs are used when the other ones are fully loaded. However, SMT
359−siblings (that is, logical CPUs sharing one physical core) are treated in a
360−special way such that if one of them is in use, the effective priority of the
361−other ones is lowered below the priorities of the CPUs located in the other
362−physical cores.
358+performant CPUs are used when the other ones are fully loaded. SMT siblings
359+(that is, logical CPUs sharing one physical core) are given the same priority.
360+The scheduler can pull tasks from lower-priority cores and place them on any
361+sibling. Since the scheduler spreads tasks among physical cores, tasks will be
362+placed on the SMT siblings of physical cores only after all physical cores are
363+busy.
363364
364365 This approach maximizes performance in the majority of cases, but unfortunately
365366 it also leads to excessive energy usage in some important scenarios, like video
Documentation/arch/riscv/cmodx.rst+4−4
@@ -21,13 +21,13 @@ call at each patchable function entry, and patches it dynamically at runtime to · 20 unmodified lines
2121 enable or disable the redirection. In the case of RISC-V, 2 instructions,
2222 AUIPC + JALR, are required to compose a function call. However, it is impossible
2323 to patch 2 instructions and expect that a concurrent read-side executes them
24−without a race condition. This series makes atmoic code patching possible in
24+without a race condition. This series makes atomic code patching possible in
2525 RISC-V ftrace. Kernel preemption makes things even worse as it allows the old
2626 state to persist across the patching process with stop_machine().
2727
2828 In order to get rid of stop_machine() and run dynamic ftrace with full kernel
2929 preemption, we partially initialize each patchable function entry at boot-time,
30−setting the first instruction to AUIPC, and the second to NOP. Now, atmoic
30+setting the first instruction to AUIPC, and the second to NOP. Now, atomic
3131 patching is possible because the kernel only has to update one instruction.
3232 According to Ziccif, as long as an instruction is naturally aligned, the ISA
3333 guarantee an atomic update.
@@ -36,8 +36,8 @@ By fixing down the first instruction, AUIPC, the range of the ftrace trampoline · 2 unmodified lines
3636 is limited to +-2K from the predetermined target, ftrace_caller, due to the lack
3737 of immediate encoding space in RISC-V. To address the issue, we introduce
3838 CALL_OPS, where an 8B naturally align metadata is added in front of each
39−pacthable function. The metadata is resolved at the first trampoline, then the
40−execution can be derect to another custom trampoline.
39+patchable function. The metadata is resolved at the first trampoline, then the
40+execution can be directed to another custom trampoline.
4141
4242 CMODX in the User Space
4343 -----------------------
Documentation/arch/riscv/zicfilp.rst+1−1
@@ -78,7 +78,7 @@ the program. · 77 unmodified lines
7878
7979 Per-task indirect branch tracking state can be monitored and
8080 controlled via the :c:macro:`PR_GET_CFI` and :c:macro:`PR_SET_CFI`
81−``prctl()` arguments (respectively), by supplying
81+``prctl()`` arguments (respectively), by supplying
8282 :c:macro:`PR_CFI_BRANCH_LANDING_PADS` as the second argument. These
8383 are architecture-agnostic, and will return -EINVAL if the underlying
8484 functionality is not supported.
Documentation/arch/x86/cpuinfo.rst+4−0
@@ -187,6 +187,10 @@ to disable features using the feature number as defined in · 186 unmodified lines
187187 Protection can be disabled using clearcpuid=514. The number 514 is calculated
188188 from #define X86_FEATURE_UMIP (16*32 + 2).
189189
190+DO NOT USE this cmdline option in production - it is meant to be used only as
191+a quick'n'dirty debugging aid to rule out a feature-enabling code is the
192+culprit. If you use it, it'll taint the kernel.
193+
190194 In addition, there exists a variety of custom command-line parameters that
191195 disable specific features. The list of parameters includes, but is not limited
192196 to, nofsgsbase, nosgx, noxsave, etc. 5-level paging can also be disabled using
Documentation/crypto/krb5.rst+13−4
@@ -158,13 +158,22 @@ returned. · 157 unmodified lines
158158 When a message has been received, the location and size of the data with the
159159 message can be determined by calling::
160160
161− void crypto_krb5_where_is_the_data(const struct krb5_enctype *krb5,
162− enum krb5_crypto_mode mode,
163− size_t *_offset, size_t *_len);
161+ int crypto_krb5_where_is_the_data(const struct krb5_enctype *krb5,
162+ enum krb5_crypto_mode mode,
163+ size_t *_offset, size_t *_len);
164164
165165 The caller provides the offset and length of the message to the function, which
166166 then alters those values to indicate the region containing the data (plus any
167−padding). It is up to the caller to determine how much padding there is.
167+padding). It is up to the caller to determine how much padding there is. The
168+function returns an error if the length is too small or if the mode is
169+unsupported. An additional function::
170+
171+ int crypto_krb5_check_data_len(const struct krb5_enctype *krb5,
172+ enum krb5_crypto_mode mode,
173+ size_t len, size_t min_content);
174+
175+is provided to just do a basic check that the decrypted/verified message would
176+have a sufficient minimum payload.
168177
169178 Preparation Functions
170179 ---------------------
Documentation/devicetree/bindings/display/msm/dp-controller.yaml+23−5
@@ -219,6 +219,7 @@ allOf: · 218 unmodified lines
219219 - required:
220220 - "#sound-dai-cells"
221221 else:
222+ $ref: /schemas/sound/dai-common.yaml#
222223 properties:
223224 aux-bus: false
224225 required:
@@ -243,7 +244,7 @@ allOf: · 18 unmodified lines
243244 clocks:
244245 minItems: 5
245246 maxItems: 5
246− clocks-names:
247+ clock-names:
247248 minItems: 5
248249 maxItems: 5
249250
@@ -264,7 +265,7 @@ allOf: · 14 unmodified lines
264265 clocks:
265266 minItems: 5
266267 maxItems: 6
267− clocks-names:
268+ clock-names:
268269 minItems: 5
269270 maxItems: 6
270271
@@ -277,7 +278,6 @@ allOf: · 6 unmodified lines
277278 - qcom,sc8180x-dp
278279 - qcom,sdm845-dp
279280 - qcom,sm8350-dp
280− - qcom,sm8650-dp
281281 then:
282282 properties:
283283 reg:
@@ -286,6 +286,24 @@ allOf: · 2 unmodified lines
286286 clocks:
287287 minItems: 6
288288 maxItems: 6
289+ clock-names:
290+ minItems: 6
291+ maxItems: 6
292+
293+ - if:
294+ properties:
295+ compatible:
296+ contains:
297+ enum:
298+ - qcom,sm8650-dp
299+ then:
300+ properties:
301+ reg:
302+ minItems: 5
303+ maxItems: 9
304+ clocks:
305+ minItems: 6
306+ maxItems: 6
289307 clocks-names:
290308 minItems: 6
291309 maxItems: 6
@@ -306,7 +324,7 @@ allOf: · 14 unmodified lines
306324 clocks:
307325 minItems: 6
308326 maxItems: 8
309− clocks-names:
327+ clock-names:
310328 minItems: 6
311329 maxItems: 8
312330
@@ -326,7 +344,7 @@ allOf: · 13 unmodified lines
326344 clocks:
327345 minItems: 5
328346 maxItems: 6
329− clocks-names:
347+ clock-names:
330348 minItems: 5
331349 maxItems: 6
332350
Documentation/devicetree/bindings/display/msm/qcom,eliza-mdss.yaml+12−8
@@ -119,7 +119,7 @@ examples: · 118 unmodified lines
119119 mdss_mdp: display-controller@ae01000 {
120120 compatible = "qcom,eliza-dpu";
121121 reg = <0x0ae01000 0x93000>,
122− <0x0aeb0000 0x2008>;
122+ <0x0aeb0000 0x3000>;
123123 reg-names = "mdp",
124124 "vbif";
125125
@@ -304,7 +304,7 @@ examples: · 178 unmodified lines
304304 mdss_dsi0_phy: phy@ae95000 {
305305 compatible = "qcom,eliza-dsi-phy-4nm", "qcom,sm8650-dsi-phy-4nm";
306306 reg = <0x0ae95000 0x200>,
307− <0x0ae95200 0x280>,
307+ <0x0ae95200 0x300>,
308308 <0x0ae95500 0x400>;
309309 reg-names = "dsi_phy",
310310 "dsi_phy_lane",
@@ -388,7 +388,7 @@ examples: · 77 unmodified lines
388388 mdss_dsi1_phy: phy@ae97000 {
389389 compatible = "qcom,eliza-dsi-phy-4nm", "qcom,sm8650-dsi-phy-4nm";
390390 reg = <0x0ae97000 0x200>,
391− <0x0ae97200 0x280>,
391+ <0x0ae97200 0x300>,
392392 <0x0ae97500 0x400>;
393393 reg-names = "dsi_phy",
394394 "dsi_phy_lane",
@@ -407,11 +407,15 @@ examples: · 12 unmodified lines
407407
408408 displayport-controller@af54000 {
409409 compatible = "qcom,eliza-dp", "qcom,sm8650-dp";
410− reg = <0xaf54000 0x104>,
411− <0xaf54200 0xc0>,
412− <0xaf55000 0x770>,
413− <0xaf56000 0x9c>,
414− <0xaf57000 0x9c>;
410+ reg = <0x0af54000 0x200>,
411+ <0x0af54200 0x200>,
412+ <0x0af55000 0xc00>,
413+ <0x0af56000 0x400>,
414+ <0x0af57000 0x400>,
415+ <0x0af58000 0x400>,
416+ <0x0af59000 0x400>,
417+ <0x0af5a000 0x600>,
418+ <0x0af5b000 0x600>;
415419
416420 interrupts-extended = <&mdss 12>;
417421
Documentation/devicetree/bindings/display/msm/qcom,sm8650-dpu.yaml+1−1
@@ -70,7 +70,7 @@ examples: · 69 unmodified lines
7070 display-controller@ae01000 {
7171 compatible = "qcom,sm8650-dpu";
7272 reg = <0x0ae01000 0x8f000>,
73− <0x0aeb0000 0x2008>;
73+ <0x0aeb0000 0x3000>;
7474 reg-names = "mdp", "vbif";
7575
7676 clocks = <&gcc_axi_clk>,
Documentation/devicetree/bindings/display/msm/qcom,sm8650-mdss.yaml+1−1
@@ -112,7 +112,7 @@ examples: · 111 unmodified lines
112112 display-controller@ae01000 {
113113 compatible = "qcom,sm8650-dpu";
114114 reg = <0x0ae01000 0x8f000>,
115− <0x0aeb0000 0x2008>;
115+ <0x0aeb0000 0x3000>;
116116 reg-names = "mdp", "vbif";
117117
118118 clocks = <&gcc_axi_clk>,
Documentation/devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml+10−6
@@ -117,7 +117,7 @@ examples: · 116 unmodified lines
117117 display-controller@ae01000 {
118118 compatible = "qcom,sm8750-dpu";
119119 reg = <0x0ae01000 0x93000>,
120− <0x0aeb0000 0x2008>;
120+ <0x0aeb0000 0x3000>;
121121 reg-names = "mdp",
122122 "vbif";
123123
@@ -389,11 +389,15 @@ examples: · 265 unmodified lines
389389
390390 displayport-controller@af54000 {
391391 compatible = "qcom,sm8750-dp", "qcom,sm8650-dp";
392− reg = <0xaf54000 0x104>,
393− <0xaf54200 0xc0>,
394− <0xaf55000 0x770>,
395− <0xaf56000 0x9c>,
396− <0xaf57000 0x9c>;
392+ reg = <0x0af54000 0x200>,
393+ <0x0af54200 0x200>,
394+ <0x0af55000 0xc00>,
395+ <0x0af56000 0x400>,
396+ <0x0af57000 0x400>,
397+ <0x0af58000 0x400>,
398+ <0x0af59000 0x400>,
399+ <0x0af5a000 0x600>,
400+ <0x0af5b000 0x600>;
397401
398402 interrupts-extended = <&mdss 12>;
399403
Documentation/devicetree/bindings/i2c/amlogic,meson6-i2c.yaml+9−4
@@ -16,10 +16,15 @@ allOf: · 15 unmodified lines
1616
1717 properties:
1818 compatible:
19− enum:
20− - amlogic,meson6-i2c # Meson6, Meson8 and compatible SoCs
21− - amlogic,meson-gxbb-i2c # GXBB and compatible SoCs
22− - amlogic,meson-axg-i2c # AXG and compatible SoCs
19+ oneOf:
20+ - items:
21+ - enum:
22+ - amlogic,t7-i2c
23+ - const: amlogic,meson-axg-i2c
24+ - enum:
25+ - amlogic,meson6-i2c # Meson6, Meson8 and compatible SoCs
26+ - amlogic,meson-gxbb-i2c # GXBB and compatible SoCs
27+ - amlogic,meson-axg-i2c # AXG and compatible SoCs
2328
2429 reg:
2530 maxItems: 1
Documentation/devicetree/bindings/i2c/apple,i2c.yaml+3−1
@@ -22,7 +22,9 @@ properties: · 21 unmodified lines
2222 compatible:
2323 oneOf:
2424 - items:
25− - const: apple,t6020-i2c
25+ - enum:
26+ - apple,t6020-i2c
27+ - apple,t8122-i2c
2628 - const: apple,t8103-i2c
2729 - items:
2830 - enum:
Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml+1−0
@@ -24,6 +24,7 @@ properties: · 23 unmodified lines
2424 compatible:
2525 items:
2626 - enum:
27+ - qcom,eliza-ipcc
2728 - qcom,glymur-ipcc
2829 - qcom,kaanapali-ipcc
2930 - qcom,milos-ipcc
Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml+12−1
@@ -73,6 +73,15 @@ properties: · 72 unmodified lines
7373 HSP CSR is to control and get status of different high-speed peripherals
7474 (such as Ethernet, USB, SATA, etc.) via register, which can tune
7575 board-level's parameters of PHY, etc.
76+
77+ Additional background information about the High-Speed Subsystem
78+ and the HSP CSR block is available in Chapter 10 ("High-Speed Interface")
79+ of the EIC7700X SoC Technical Reference Manual, Part 4
80+ (EIC7700X_SoC_Technical_Reference_Manual_Part4.pdf). The manual is
81+ publicly available at
82+ https://github.com/eswincomputing/EIC7700X-SoC-Technical-Reference-Manual/releases
83+
84+ This reference is provided for background information only.
7685 $ref: /schemas/types.yaml#/definitions/phandle-array
7786 items:
7887 - items:
@@ -82,6 +91,8 @@ properties: · 3 unmodified lines
8291 - description: Offset of AXI clock controller Low-Power request
8392 register
8493 - description: Offset of register controlling TX/RX clock delay
94+ - description: Optional offset of register controlling TXD delay
95+ - description: Optional offset of register controlling RXD delay
8596
8697 required:
8798 - compatible
@@ -116,7 +127,7 @@ examples: · 28 unmodified lines
116127 reset-names = "stmmaceth";
117128 rx-internal-delay-ps = <200>;
118129 tx-internal-delay-ps = <200>;
119− eswin,hsp-sp-csr = <&hsp_sp_csr 0x100 0x108 0x118>;
130+ eswin,hsp-sp-csr = <&hsp_sp_csr 0x100 0x108 0x118 0x114 0x11c>;
120131 snps,axi-config = <&stmmac_axi_setup>;
121132 snps,aal;
122133 snps,fixed-burst;
Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650-rt5514.yaml+2−0
@@ -18,7 +18,9 @@ properties: · 17 unmodified lines
1818 description: Phandles of rt5650 and rt5514 codecs
1919 items:
2020 - description: phandle of rt5650 codec
21+ maxItems: 1
2122 - description: phandle of rt5514 codec
23+ maxItems: 1
2224
2325 mediatek,platform:
2426 $ref: /schemas/types.yaml#/definitions/phandle
Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml+3−0
@@ -20,6 +20,9 @@ properties: · 19 unmodified lines
2020 - fsl,ls1021a-qspi
2121 - fsl,ls2080a-qspi
2222 - spacemit,k1-qspi
23+ - items:
24+ - const: spacemit,k3-qspi
25+ - const: spacemit,k1-qspi
2326 - items:
2427 - enum:
2528 - fsl,ls1043a-qspi
Documentation/devicetree/bindings/spi/qcom,spi-qpic-snand.yaml+1−0
@@ -25,6 +25,7 @@ properties: · 24 unmodified lines
2525 - items:
2626 - enum:
2727 - qcom,ipq5018-snand
28+ - qcom,ipq5210-snand
2829 - qcom,ipq5332-snand
2930 - qcom,ipq5424-snand
3031 - const: qcom,ipq9574-snand
Documentation/devicetree/bindings/usb/eswin,eic7700-usb.yaml+4−3
@@ -41,12 +41,13 @@ properties: · 40 unmodified lines
4141 - const: usb_en
4242
4343 resets:
44− maxItems: 2
44+ maxItems: 3
4545
4646 reset-names:
4747 items:
4848 - const: vaux
4949 - const: usb_rst
50+ - const: usb_phy
5051
5152 eswin,hsp-sp-csr:
5253 description:
@@ -85,8 +86,8 @@ examples: · 32 unmodified lines
8586 interrupt-parent = <&plic>;
8687 interrupts = <85>;
8788 interrupt-names = "peripheral";
88− resets = <&reset 84>, <&hspcrg 2>;
89− reset-names = "vaux", "usb_rst";
89+ resets = <&reset 84>, <&hspcrg 2>, <&hspcrg 4>;
90+ reset-names = "vaux", "usb_rst", "usb_phy";
9091 dr_mode = "peripheral";
9192 maximum-speed = "high-speed";
9293 phy_type = "utmi";
Documentation/devicetree/bindings/usb/ti,omap4-musb.yaml+4−3
@@ -81,9 +81,7 @@ properties: · 80 unmodified lines
8181 const: usb2-phy
8282
8383 usb-phy:
84− $ref: /schemas/types.yaml#/definitions/phandle-array
85− description: Phandle for the PHY device.
86− deprecated: true
84+ maxItems: 1
8785
8886 ctrl-module:
8987 $ref: /schemas/types.yaml#/definitions/phandle
@@ -96,6 +94,9 @@ required: · 6 unmodified lines
9694 - interrupts
9795 - interrupt-names
9896
97+allOf:
98+ - $ref: usb-hcd.yaml#
99+
99100 unevaluatedProperties: false
100101
101102 examples:
Documentation/filesystems/isofs.rst+1−1
@@ -57,7 +57,7 @@ Mount options unique to the isofs filesystem. · 56 unmodified lines
5757 Recommended documents about ISO 9660 standard are located at:
5858
5959 - http://www.y-adagio.com/
60−- ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf
60+- https://ecma-international.org/wp-content/uploads/ECMA-119_2nd_edition_december_1987.pdf
6161
6262 Quoting from the PDF "This 2nd Edition of Standard ECMA-119 is technically
6363 identical with ISO 9660.", so it is a valid and gratis substitute of the
Documentation/hwmon/sy7636a-hwmon.rst+1−1
@@ -22,5 +22,5 @@ The following sensors are supported · 21 unmodified lines
2222 sysfs-Interface
2323 ---------------
2424
25−temp0_input
25+temp1_input
2626 - Temperature of external NTC (milli-degree C)
Documentation/hwmon/yogafan.rst+1−1
@@ -135,4 +135,4 @@ References · 134 unmodified lines
135135
136136 4. **Lenovo IdeaPad Laptop Driver:** Reference for DMI-based hardware
137137 feature gating in Lenovo laptops.
138− https://github.com/torvalds/linux/blob/master/drivers/platform/x86/ideapad-laptop.c
138+ https://github.com/torvalds/linux/blob/master/drivers/platform/x86/lenovo/ideapad-laptop.c
Documentation/netlink/genetlink-c.yaml+9−0
@@ -69,6 +69,15 @@ properties: · 68 unmodified lines
6969 header:
7070 description: For C-compatible languages, header which already defines this value.
7171 type: string
72+ scope:
73+ description: |
74+ Visibility of this definition. "uapi" (default) renders into
75+ the uAPI header, "kernel" renders into the kernel-side
76+ generated header, "user" renders into the user-side
77+ generated header. When combined with `header:`, the
78+ definition is not rendered, and the named header is
79+ included only by code matching the scope.
80+ enum: [ uapi, kernel, user ]
7281 type:
7382 enum: [ const, enum, flags ]
7483 doc:
Documentation/netlink/genetlink-legacy.yaml+9−0
@@ -83,6 +83,15 @@ properties: · 82 unmodified lines
8383 header:
8484 description: For C-compatible languages, header which already defines this value.
8585 type: string
86+ scope:
87+ description: |
88+ Visibility of this definition. "uapi" (default) renders into
89+ the uAPI header, "kernel" renders into the kernel-side
90+ generated header, "user" renders into the user-side
91+ generated header. When combined with `header:`, the
92+ definition is not rendered, and the named header is
93+ included only by code matching the scope.
94+ enum: [ uapi, kernel, user ]
8695 type:
8796 enum: [ const, enum, flags, struct ] # Trim
8897 doc:
Documentation/netlink/genetlink.yaml+9−0
@@ -55,6 +55,15 @@ properties: · 54 unmodified lines
5555 header:
5656 description: For C-compatible languages, header which already defines this value.
5757 type: string
58+ scope:
59+ description: |
60+ Visibility of this definition. "uapi" (default) renders into
61+ the uAPI header, "kernel" renders into the kernel-side
62+ generated header, "user" renders into the user-side
63+ generated header. When combined with `header:`, the
64+ definition is not rendered, and the named header is
65+ included only by code matching the scope.
66+ enum: [ uapi, kernel, user ]
5867 type:
5968 enum: [ const, enum, flags ]
6069 doc:
Documentation/netlink/netlink-raw.yaml+9−0
@@ -87,6 +87,15 @@ properties: · 86 unmodified lines
8787 header:
8888 description: For C-compatible languages, header which already defines this value.
8989 type: string
90+ scope:
91+ description: |
92+ Visibility of this definition. "uapi" (default) renders into
93+ the uAPI header, "kernel" renders into the kernel-side
94+ generated header, "user" renders into the user-side
95+ generated header. When combined with `header:`, the
96+ definition is not rendered, and the named header is
97+ included only by code matching the scope.
98+ enum: [ uapi, kernel, user ]
9099 type:
91100 enum: [ const, enum, flags, struct ] # Trim
92101 doc:
Documentation/netlink/specs/handshake.yaml+8−0
@@ -12,6 +12,12 @@ protocol: genetlink · 11 unmodified lines
1212 doc: Netlink protocol to request a transport layer security handshake.
1313
1414 definitions:
15+ -
16+ type: const
17+ name: max-errno
18+ value: 4095
19+ header: linux/err.h
20+ scope: kernel
1521 -
1622 type: enum
1723 name: handler-class
@@ -80,6 +86,8 @@ attribute-sets: · 62 unmodified lines
8086 -
8187 name: status
8288 type: u32
89+ checks:
90+ max: max-errno
8391 -
8492 name: sockfd
8593 type: s32
Documentation/netlink/specs/net_shaper.yaml+7−0
@@ -33,6 +33,11 @@ doc: | · 32 unmodified lines
3333 @cap-get operation.
3434
3535 definitions:
36+ -
37+ type: const
38+ name: max-handle-id
39+ value: 0x3fffffe
40+ scope: kernel
3641 -
3742 type: enum
3843 name: scope
@@ -140,6 +145,8 @@ attribute-sets: · 101 unmodified lines
140145 -
141146 name: id
142147 type: u32
148+ checks:
149+ max: max-handle-id
143150 doc: |
144151 Numeric identifier of a shaper. The id semantic depends on
145152 the scope. For @queue scope it's the queue id and for @node
Documentation/netlink/specs/psp.yaml+2−0
@@ -188,6 +188,7 @@ operations: · 187 unmodified lines
188188 name: dev-set
189189 doc: Set the configuration of a PSP device.
190190 attribute-set: dev
191+ flags: [admin-perm]
191192 do:
192193 request:
193194 attributes:
@@ -207,6 +208,7 @@ operations: · 13 unmodified lines
207208 name: key-rotate
208209 doc: Rotate the device key.
209210 attribute-set: dev
211+ flags: [admin-perm]
210212 do:
211213 request:
212214 attributes:
Documentation/networking/device_drivers/ethernet/3com/3c509.rst+249−0
@@ -0,0 +1,249 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=============================================================================
4+Linux and the 3Com EtherLink III Series Ethercards (driver v1.18c and higher)
5+=============================================================================
6+
7+This file contains the instructions and caveats for v1.18c and higher versions
8+of the 3c509 driver. You should not use the driver without reading this file.
9+
10+release 1.0
11+
12+28 February 2002
13+
14+Current maintainer (corrections to):
15+ Maciej W. Rozycki <macro@orcam.me.uk>
16+
17+Introduction
18+============
19+
20+The following are notes and information on using the 3Com EtherLink III series
21+ethercards in Linux. These cards are commonly known by the most widely-used
22+card's 3Com model number, 3c509. They are all 10mb/s ISA-bus cards and shouldn't
23+be (but sometimes are) confused with the similarly-numbered PCI-bus "3c905"
24+(aka "Vortex" or "Boomerang") series. Kernel support for the 3c509 family is
25+provided by the module 3c509.c, which has code to support all of the following
26+models:
27+
28+ - 3c509 (original ISA card)
29+ - 3c509B (later revision of the ISA card; supports full-duplex)
30+ - 3c589 (PCMCIA)
31+ - 3c589B (later revision of the 3c589; supports full-duplex)
32+ - 3c579 (EISA)
33+
34+Large portions of this documentation were heavily borrowed from the guide
35+written the original author of the 3c509 driver, Donald Becker. The master
36+copy of that document, which contains notes on older versions of the driver,
37+currently resides on Scyld web server: http://www.scyld.com/.
38+
39+
40+Special Driver Features
41+=======================
42+
43+Overriding card settings
44+
45+The driver allows boot- or load-time overriding of the card's detected IOADDR,
46+IRQ, and transceiver settings, although this capability shouldn't generally be
47+needed except to enable full-duplex mode (see below). An example of the syntax
48+for LILO parameters for doing this::
49+
50+ ether=10,0x310,3,0x3c509,eth0
51+
52+This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and
53+transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts
54+with other card types when overriding the I/O address. When the driver is
55+loaded as a module, only the IRQ may be overridden. For example,
56+setting two cards to IRQ10 and IRQ11 is done by using the irq module
57+option::
58+
59+ options 3c509 irq=10,11
60+
61+
62+Full-duplex mode
63+================
64+
65+The v1.18c driver added support for the 3c509B's full-duplex capabilities.
66+In order to enable and successfully use full-duplex mode, three conditions
67+must be met:
68+
69+(a) You must have a Etherlink III card model whose hardware supports full-
70+duplex operations. Currently, the only members of the 3c509 family that are
71+positively known to support full-duplex are the 3c509B (ISA bus) and 3c589B
72+(PCMCIA) cards. Cards without the "B" model designation do *not* support
73+full-duplex mode; these include the original 3c509 (no "B"), the original
74+3c589, the 3c529 (MCA bus), and the 3c579 (EISA bus).
75+
76+(b) You must be using your card's 10baseT transceiver (i.e., the RJ-45
77+connector), not its AUI (thick-net) or 10base2 (thin-net/coax) interfaces.
78+AUI and 10base2 network cabling is physically incapable of full-duplex
79+operation.
80+
81+(c) Most importantly, your 3c509B must be connected to a link partner that is
82+itself full-duplex capable. This is almost certainly one of two things: a full-
83+duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on
84+another system that's connected directly to the 3c509B via a crossover cable.
85+
86+Full-duplex mode can be enabled using 'ethtool'.
87+
88+.. warning::
89+
90+ Extremely important caution concerning full-duplex mode
91+
92+ Understand that the 3c509B's hardware's full-duplex support is much more
93+ limited than that provide by more modern network interface cards. Although
94+ at the physical layer of the network it fully supports full-duplex operation,
95+ the card was designed before the current Ethernet auto-negotiation (N-way)
96+ spec was written. This means that the 3c509B family ***cannot and will not
97+ auto-negotiate a full-duplex connection with its link partner under any
98+ circumstances, no matter how it is initialized***. If the full-duplex mode
99+ of the 3c509B is enabled, its link partner will very likely need to be
100+ independently _forced_ into full-duplex mode as well; otherwise various nasty
101+ failures will occur - at the very least, you'll see massive numbers of packet
102+ collisions. This is one of very rare circumstances where disabling auto-
103+ negotiation and forcing the duplex mode of a network interface card or switch
104+ would ever be necessary or desirable.
105+
106+
107+Available Transceiver Types
108+===========================
109+
110+For versions of the driver v1.18c and above, the available transceiver types are:
111+
112+== =========================================================================
113+0 transceiver type from EEPROM config (normally 10baseT); force half-duplex
114+1 AUI (thick-net / DB15 connector)
115+2 (undefined)
116+3 10base2 (thin-net == coax / BNC connector)
117+4 10baseT (RJ-45 connector); force half-duplex mode
118+8 transceiver type and duplex mode taken from card's EEPROM config settings
119+12 10baseT (RJ-45 connector); force full-duplex mode
120+== =========================================================================
121+
122+Prior to driver version 1.18c, only transceiver codes 0-4 were supported. Note
123+that the new transceiver codes 8 and 12 are the *only* ones that will enable
124+full-duplex mode, no matter what the card's detected EEPROM settings might be.
125+This insured that merely upgrading the driver from an earlier version would
126+never automatically enable full-duplex mode in an existing installation;
127+it must always be explicitly enabled via one of these code in order to be
128+activated.
129+
130+The transceiver type can be changed using 'ethtool'.
131+
132+
133+Interpretation of error messages and common problems
134+----------------------------------------------------
135+
136+Error Messages
137+^^^^^^^^^^^^^^
138+
139+eth0: Infinite loop in interrupt, status 2011.
140+These are "mostly harmless" message indicating that the driver had too much
141+work during that interrupt cycle. With a status of 0x2011 you are receiving
142+packets faster than they can be removed from the card. This should be rare
143+or impossible in normal operation. Possible causes of this error report are:
144+
145+ - a "green" mode enabled that slows the processor down when there is no
146+ keyboard activity.
147+
148+ - some other device or device driver hogging the bus or disabling interrupts.
149+ Check /proc/interrupts for excessive interrupt counts. The timer tick
150+ interrupt should always be incrementing faster than the others.
151+
152+No received packets
153+^^^^^^^^^^^^^^^^^^^
154+
155+If a 3c509, 3c562 or 3c589 can successfully transmit packets, but never
156+receives packets (as reported by /proc/net/dev or 'ifconfig') you likely
157+have an interrupt line problem. Check /proc/interrupts to verify that the
158+card is actually generating interrupts. If the interrupt count is not
159+increasing you likely have a physical conflict with two devices trying to
160+use the same ISA IRQ line. The common conflict is with a sound card on IRQ10
161+or IRQ5, and the easiest solution is to move the 3c509 to a different
162+interrupt line. If the device is receiving packets but 'ping' doesn't work,
163+you have a routing problem.
164+
165+Tx Carrier Errors Reported in /proc/net/dev
166+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167+
168+
169+If an EtherLink III appears to transmit packets, but the "Tx carrier errors"
170+field in /proc/net/dev increments as quickly as the Tx packet count, you
171+likely have an unterminated network or the incorrect media transceiver selected.
172+
173+3c509B card is not detected on machines with an ISA PnP BIOS.
174+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
175+
176+While the updated driver works with most PnP BIOS programs, it does not work
177+with all. This can be fixed by disabling PnP support using the 3Com-supplied
178+setup program.
179+
180+3c509 card is not detected on overclocked machines
181+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182+
183+Increase the delay time in id_read_eeprom() from the current value, 500,
184+to an absurdly high value, such as 5000.
185+
186+
187+Decoding Status and Error Messages
188+----------------------------------
189+
190+
191+The bits in the main status register are:
192+
193+===== ======================================
194+value description
195+===== ======================================
196+0x01 Interrupt latch
197+0x02 Tx overrun, or Rx underrun
198+0x04 Tx complete
199+0x08 Tx FIFO room available
200+0x10 A complete Rx packet has arrived
201+0x20 A Rx packet has started to arrive
202+0x40 The driver has requested an interrupt
203+0x80 Statistics counter nearly full
204+===== ======================================
205+
206+The bits in the transmit (Tx) status word are:
207+
208+===== ============================================
209+value description
210+===== ============================================
211+0x02 Out-of-window collision.
212+0x04 Status stack overflow (normally impossible).
213+0x08 16 collisions.
214+0x10 Tx underrun (not enough PCI bus bandwidth).
215+0x20 Tx jabber.
216+0x40 Tx interrupt requested.
217+0x80 Status is valid (this should always be set).
218+===== ============================================
219+
220+
221+When a transmit error occurs the driver produces a status message such as::
222+
223+ eth0: Transmit error, Tx status register 82
224+
225+The two values typically seen here are:
226+
227+0x82
228+^^^^
229+
230+Out of window collision. This typically occurs when some other Ethernet
231+host is incorrectly set to full duplex on a half duplex network.
232+
233+0x88
234+^^^^
235+
236+16 collisions. This typically occurs when the network is exceptionally busy
237+or when another host doesn't correctly back off after a collision. If this
238+error is mixed with 0x82 errors it is the result of a host incorrectly set
239+to full duplex (see above).
240+
241+Both of these errors are the result of network problems that should be
242+corrected. They do not represent driver malfunction.
243+
244+
245+Revision history (this file)
246+============================
247+
248+28Feb02 v1.0 DR New; major portions based on Becker original 3c509 docs
249+
Documentation/networking/device_drivers/ethernet/index.rst+1−0
@@ -10,6 +10,7 @@ Contents: · 9 unmodified lines
1010 .. toctree::
1111 :maxdepth: 2
1212
13+ 3com/3c509
1314 3com/vortex
1415 amazon/ena
1516 altera/altera_tse
Documentation/process/index.rst+1−0
@@ -86,6 +86,7 @@ regressions and security problems. · 85 unmodified lines
8686 debugging/index
8787 handling-regressions
8888 security-bugs
89+ threat-model
8990 cve
9091 embargoed-hardware-issues
9192
Documentation/process/security-bugs.rst+104−2
@@ -66,6 +66,42 @@ In addition, the following information are highly desirable: · 65 unmodified lines
6666 the issue appear. It is useful to share them, as they can be helpful to
6767 keep end users protected during the time it takes them to apply the fix.
6868
69+What qualifies as a security bug
70+--------------------------------
71+
72+It is important that most bugs are handled publicly so as to involve the widest
73+possible audience and find the best solution. By nature, bugs that are handled
74+in closed discussions between a small set of participants are less likely to
75+produce the best possible fix (e.g., risk of missing valid use cases, limited
76+testing abilities).
77+
78+It turns out that the majority of the bugs reported via the security team are
79+just regular bugs that have been improperly qualified as security bugs due to
80+a lack of awareness of the Linux kernel's threat model, as described in
81+Documentation/process/threat-model.rst, and ought to have been sent through
82+the normal channels described in Documentation/admin-guide/reporting-issues.rst
83+instead.
84+
85+The security list exists for urgent bugs that grant an attacker a capability
86+they are not supposed to have on a correctly configured production system, and
87+can be easily exploited, representing an imminent threat to many users. Before
88+reporting, consider whether the issue actually crosses a trust boundary on such
89+a system.
90+
91+**If you resorted to AI assistance to identify a bug, you must treat it as
92+public**. While you may have valid reasons to believe it is not, the security
93+team's experience shows that bugs discovered this way systematically surface
94+simultaneously across multiple researchers, often on the same day. In this
95+case, do not publicly share a reproducer, as this could cause unintended harm;
96+just mention that one is available and maintainers might ask for it privately
97+if they need it.
98+
99+If you are unsure whether an issue qualifies, err on the side of reporting
100+privately: the security team would rather triage a borderline report than miss
101+a real vulnerability. Reporting ordinary bugs to the security list, however,
102+does not make them move faster and consumes triage capacity that other reports
103+need.
104+
69105 Identifying contacts
70106 --------------------
71107
@@ -74,7 +110,7 @@ affected subsystem's maintainers and Cc: the Linux kernel security team. Do · 2 unmodified lines
74110 not send it to a public list at this stage, unless you have good reasons to
75111 consider the issue as being public or trivial to discover (e.g. result of a
76112 widely available automated vulnerability scanning tool that can be repeated by
77−anyone).
113+anyone, or use of AI-based tools).
78114
79115 If you're sending a report for issues affecting multiple parts in the kernel,
80116 even if they're fairly similar issues, please send individual messages (think
@@ -131,6 +167,64 @@ the Linux kernel security team only. Your message will be triaged, and you · 50 unmodified lines
131167 will receive instructions about whom to contact, if needed. Your message may
132168 equally be forwarded as-is to the relevant maintainers.
133169
170+Responsible use of AI to find bugs
171+----------------------------------
172+
173+A significant fraction of bug reports submitted to the security team are
174+actually the result of code reviews assisted by AI tools. While this can be an
175+efficient means to find bugs in rarely explored areas, it causes an overload on
176+maintainers, who are sometimes forced to ignore such reports due to their poor
177+quality or accuracy. As such, reporters must be particularly cautious about a
178+number of points which tend to make these reports needlessly difficult to
179+handle:
180+
181+ * **Length**: AI-generated reports tend to be excessively long, containing
182+ multiple sections and excessive detail. This makes it difficult to spot
183+ important information such as affected files, versions, and impact. Please
184+ ensure that a clear summary of the problem and all critical details are
185+ presented first. Do not require triage engineers to scan multiple pages of
186+ text. Configure your tools to produce concise, human-style reports.
187+
188+ * **Formatting**: Most AI-generated reports are littered with Markdown tags.
189+ These decorations complicate the search for important information and do
190+ not survive the quoting processes involved in forwarding or replying.
191+ Please **always convert your report to plain text** without any formatting
192+ decorations before sending it.
193+
194+ * **Impact Evaluation**: Many AI-generated reports lack an understanding
195+ of the kernel's threat model (see Documentation/process/threat-model.rst)
196+ and go to great lengths inventing theoretical consequences. This adds
197+ noise and complicates triage. Please stick to verifiable facts (e.g.,
198+ "this bug permits any user to gain CAP_NET_ADMIN") without enumerating
199+ speculative implications. Have your tool read this documentation as
200+ part of the evaluation process.
201+
202+ * **Reproducer**: AI-based tools are often capable of generating reproducers.
203+ Please always ensure your tool provides one and **test it thoroughly**. If
204+ the reproducer does not work, or if the tool cannot produce one, the
205+ validity of the report should be seriously questioned. Note that since the
206+ report will be posted to a public list, the reproducer should only be
207+ shared upon maintainers' request.
208+
209+ * **Propose a Fix**: Many AI tools are actually better at writing code than
210+ evaluating it. Please ask your tool to propose a fix and **test it** before
211+ reporting the problem. If the fix cannot be tested because it relies on
212+ rare hardware or almost extinct network protocols, the issue is likely not
213+ a security bug. In any case, if a fix is proposed, it must adhere to
214+ Documentation/process/submitting-patches.rst and include a 'Fixes:' tag
215+ designating the commit that introduced the bug.
216+
217+Failure to consider these points exposes your report to the risk of being
218+ignored.
219+
220+Use common sense when evaluating the report. If the affected file has not been
221+touched for more than one year and is maintained by a single individual, it is
222+likely that usage has declined and exposed users are virtually non-existent
223+(e.g., drivers for very old hardware, obsolete filesystems). In such cases,
224+there is no need to consume a maintainer's time with an unimportant report. If
225+the issue is clearly trivial and publicly discoverable, you should report it
226+directly to the public mailing lists.
227+
134228 Sending the report
135229 ------------------
136230
@@ -148,7 +242,15 @@ run additional tests. Reports where the reporter does not respond promptly · 11 unmodified lines
148242 or cannot effectively discuss their findings may be abandoned if the
149243 communication does not quickly improve.
150244
151−The report must be sent to maintainers, with the security team in ``Cc:``.
245+The report must be sent to maintainers. If there are two or fewer
246+recipients in your message, you must also always Cc: the Linux kernel
247+security team who will ensure the message is delivered to the proper
248+people, and will be able to assist small maintainer teams with processes
249+they may not be familiar with. For larger teams, Cc: the Linux kernel
250+security team for your first few reports or when seeking specific help,
251+such as when resending a message which got no response within a week.
252+Once you have become comfortable with the process for a few reports, it is
253+no longer necessary to Cc: the security list when sending to large teams.
152254 The Linux kernel security team can be contacted by email at
153255 <security@kernel.org>. This is a private list of security officers
154256 who will help verify the bug report and assist developers working on a fix.
Documentation/process/threat-model.rst+235−0
@@ -0,0 +1,235 @@
1+The Linux Kernel threat model
2+=============================
3+
4+There are a lot of assumptions regarding what the kernel does and does not
5+protect against. These assumptions tend to cause confusion for bug reports
6+(:doc:`security-related ones <security-bugs>` vs :doc:`non-security ones
7+<../admin-guide/reporting-issues>`), and can complicate security enforcement
8+when the responsibilities for some boundaries is not clear between the kernel,
9+distros, administrators and users.
10+
11+This document tries to clarify the responsibilities of the kernel in this
12+domain.
13+
14+The kernel's responsibilities
15+-----------------------------
16+
17+The kernel abstracts access to local hardware resources and to remote systems
18+in a way that allows multiple local users to get a fair share of the available
19+resources granted to them, and, when the underlying hardware permits, to assign
20+a level of confidentiality to their communications and to the data they are
21+processing or storing.
22+
23+The kernel assumes that the underlying hardware behaves according to its
24+specifications. This includes the integrity of the CPU's instruction set, the
25+transparency of the branch prediction unit and the cache units, the consistency
26+of the Memory Management Unit (MMU), the isolation of DMA-capable peripherals
27+(e.g., via IOMMU), state transitions in controllers, ranges of values read from
28+registers, the respect of documented hardware limitations, etc.
29+
30+When hardware fails to maintain its specified isolation (e.g., CPU bugs,
31+side-channels, hardware response to unexpected inputs), the kernel will usually
32+attempt to implement reasonable mitigations. These are best-effort measures
33+intended to reduce the attack surface or elevate the cost of an attack within
34+the limits of the hardware's facilities; they do not constitute a
35+kernel-provided safety guarantee.
36+
37+Users always perform their activities under the authority of an administrator
38+who is able to grant or deny various types of permissions that may affect how
39+users benefit from available resources, or the level of confidentiality of
40+their activities. Administrators may also delegate all or part of their own
41+permissions to some users, particularly via capabilities but not only. All this
42+is performed via configuration (sysctl, file-system permissions etc).
43+
44+The Linux Kernel applies a certain collection of default settings that match
45+its threat model. Distros have their own threat model and will come with their
46+own configuration presets, that the administrator may have to adjust to better
47+suit their expectations (relax or restrict).
48+
49+By default, the Linux Kernel guarantees the following protections when running
50+on common processors featuring privilege levels and memory management units:
51+
52+* **User-based isolation**: an unprivileged user may restrict access to their
53+ own data from other unprivileged users running on the same system. This
54+ includes:
55+
56+ * stored data, via file system permissions
57+ * in-memory data (pages are not accessible by default to other users)
58+ * process activity (ptrace is not permitted to other users)
59+ * inter-process communication (other users may not observe data exchanged via
60+ UNIX domain sockets or other IPC mechanisms).
61+ * network communications within the same or with other systems
62+
63+* **Capability-based protection**:
64+
65+ * users not having elevated capabilities (including but not limited to
66+ CAP_SYS_ADMIN) may not alter the
67+ kernel's configuration, memory nor state, change other users' view of the
68+ file system layout, grant any user capabilities they do not have, nor
69+ affect the system's availability (shutdown, reboot, panic, hang, or making
70+ the system unresponsive via unbounded resource exhaustion).
71+ * users not having the ``CAP_NET_ADMIN`` capability may not alter the network
72+ configuration, intercept nor spoof network communications from other users
73+ nor systems.
74+ * users not having ``CAP_SYS_PTRACE`` may not observe other users' processes
75+ activities.
76+
77+When ``CONFIG_USER_NS`` is set, the kernel also permits unprivileged users to
78+create their own user namespace in which they have all capabilities, but with a
79+number of restrictions (they may not perform actions that have impacts on the
80+initial user namespace, such as changing time, loading modules or mounting
81+block devices). Please refer to ``user_namespaces(7)`` for more details, the
82+possibilities of user namespaces are not covered in this document.
83+
84+The kernel also offers a lot of troubleshooting and debugging facilities, which
85+can constitute attack vectors when placed in wrong hands. While some of them
86+are designed to be accessible to regular local users with a low risk (e.g.
87+kernel logs via ``/proc/kmsg``), some would expose enough information to
88+represent a risk in most places and the decision to expose them is under the
89+administrator's responsibility (perf events, traces), and others are not
90+designed to be accessed by non-privileged users (e.g. debugfs). Access to these
91+facilities by a user who has been explicitly granted permission by an
92+administrator does not constitute a security breach.
93+
94+Bugs that permit to violate the principles above constitute security breaches.
95+However, bugs that permit one violation only once another one was already
96+achieved are only weaknesses. The kernel applies a number of self-protection
97+measures whose purpose is to avoid crossing a security boundary when certain
98+classes of bugs are found, but a failure of these extra protections do not
99+constitute a vulnerability alone.
100+
101+What does not constitute a security bug
102+---------------------------------------
103+
104+In the Linux kernel's threat model, the following classes of problems are
105+**NOT** considered as Linux Kernel security bugs. However, when it is believed
106+that the kernel could do better, they should be reported, so that they can be
107+reviewed and fixed where reasonably possible, but they will be handled as any
108+regular bug:
109+
110+* **Configuration**:
111+
112+ * outdated kernels and particularly end-of-life branches are out of the scope
113+ of the kernel's threat model: administrators are responsible for keeping
114+ their system up to date. For a bug to qualify as a security bug, it must be
115+ demonstrated that it affects actively maintained versions.
116+
117+ * build-level: changes to the kernel configuration that are explicitly
118+ documented as lowering the security level (e.g. ``CONFIG_NOMMU``), or
119+ targeted at developers only.
120+
121+ * OS-level: changes to command line parameters, sysctls, filesystem
122+ permissions, user capabilities, exposure of privileged interfaces, that
123+ explicitly increase exposure by either offering non-default access to
124+ unprivileged users, or reduce the kernel's ability to enforce some
125+ protections or mitigations. Example: write access to procfs or debugfs.
126+
127+ * issues triggered only when using features intended for development or
128+ debugging (e.g., LOCKDEP, KASAN, FAULT_INJECTION): these features are known
129+ to introduce overhead and potential instability and are not intended for
130+ production use.
131+
132+ * issues affecting drivers exposed under CONFIG_STAGING, as well as features
133+ marked EXPERIMENTAL in the configuration.
134+
135+ * loading of explicitly insecure/broken/staging modules, and generally any
136+ using any subsystem marked as experimental or not intended for production
137+ use.
138+
139+ * running out-of-tree modules or unofficial kernel forks; these should be
140+ reported to the relevant vendor.
141+
142+* **Excess of initial privileges**:
143+
144+ * actions performed by a user already possessing the privileges required to
145+ perform that action or modify that state (e.g. ``CAP_SYS_ADMIN``,
146+ ``CAP_NET_ADMIN``, ``CAP_SYS_RAWIO``, ``CAP_SYS_MODULE`` with no further
147+ boundary being crossed).
148+
149+ * actions performed in user namespace that do not bypass the restrictions
150+ imposed to the initial user (e.g. ptrace usage, signal delivery, resource
151+ usage, access to FS/device/sysctl/memory, network binding, system/network
152+ configuration etc).
153+
154+ * anything performed by the root user in the initial namespace (e.g. kernel
155+ oops when writing to a privileged device).
156+
157+* **Out of production use**:
158+
159+ This covers theoretical/probabilistic attacks that rely on laboratory
160+ conditions with zero system noise, or those requiring an unrealistic number
161+ of attempts (e.g., billions of trials) that would be detected by standard
162+ system monitoring long before success, such as:
163+
164+ * prediction of random numbers that only works in a totally silent
165+ environment (such as IP ID, TCP ports or sequence numbers that can only be
166+ guessed in a lab).
167+
168+ * activity observation and information leaks based on probabilistic
169+ approaches that are prone to measurement noise and not realistically
170+ reproducible on a production system.
171+
172+ * issues that can only be triggered by heavy attacks (e.g. brute force) whose
173+ impact on the system makes it unlikely or impossible to remain undetected
174+ before they succeed (e.g. consuming all memory before succeeding).
175+
176+ * problems seen only under development simulators, emulators, or combinations
177+ that do not exist on real systems at the time of reporting (issues
178+ involving tens of millions of threads, tens of thousands of CPUs,
179+ unrealistic CPU frequencies, RAM sizes or disk capacities, network speeds.
180+
181+ * issues whose reproduction requires hardware modification or emulation,
182+ including fake USB devices that pretend to be another one.
183+
184+ * as well as issues that can be triggered at a cost that is orders of
185+ magnitude higher than the expected benefits (e.g. fully functional keyboard
186+ emulator only to retrieve 7 uninitialized bytes in a structure, or
187+ brute-force method involving millions of connection attempts to guess a
188+ port number).
189+
190+* **Hardening failures**:
191+
192+ * ability to bypass some of the kernel's hardening measures with no
193+ demonstrable exploit path (e.g. ASLR bypass, events timing or probing with
194+ no demonstrable consequence). These are just weaknesses, not
195+ vulnerabilities.
196+
197+ * missing argument checks and failure to report certain errors with no
198+ immediate consequence.
199+
200+* **Random information leaks**:
201+
202+ This concerns information leaks of small data parts that happen to be there
203+ and that cannot be chosen by the attacker, or face access restrictions:
204+
205+ * structure padding reported by syscalls or other interfaces.
206+
207+ * identifiers, partial data, non-terminated strings reported in error
208+ messages.
209+
210+ * Leaks of kernel memory addresses/pointers do not constitute an immediately
211+ exploitable vector and are not security bugs, though they must be reported
212+ and fixed.
213+
214+* **Crafted file system images**:
215+
216+ * bugs triggered by mounting a corrupted or maliciously crafted file system
217+ image are generally not security bugs, as the kernel assumes the underlying
218+ storage media is under the administrator's control, unless the filesystem
219+ driver is specifically documented as being hardened against untrusted media.
220+
221+ * issues that are resolved, mitigated, or detected by running a filesystem
222+ consistency check (fsck) on the image prior to mounting.
223+
224+* **Physical access**:
225+
226+ Issues that require physical access to the machine, hardware modification, or
227+ the use of specialized hardware (e.g., logic analyzers, DMA-attack tools over
228+ PCI-E/Thunderbolt) are out of scope unless the system is explicitly
229+ configured with technologies meant to defend against such attacks
230+ (e.g. IOMMU).
231+
232+* **Functional and performance regressions**:
233+
234+ Any issue that can be mitigated by setting proper permissions and limits
235+ doesn't qualify as a security bug.
Documentation/sound/codecs/cs35l56.rst+1−1
@@ -40,7 +40,7 @@ There are two drivers in the kernel · 39 unmodified lines
4040
4141 *For systems using SoundWire*: sound/soc/codecs/cs35l56.c and associated files
4242
43−*For systems using HDA*: sound/pci/hda/cs35l56_hda.c
43+*For systems using HDA*: sound/hda/codecs/side-codecs/cs35l56_hda.c
4444
4545 Firmware
4646 ========
Documentation/userspace-api/rseq.rst+93−1
@@ -24,6 +24,97 @@ Quick access to CPU number, node ID · 23 unmodified lines
2424 Allows to implement per CPU data efficiently. Documentation is in code and
2525 selftests. :(
2626
27+Optimized RSEQ V2
28+-----------------
29+
30+On architectures which utilize the generic entry code and generic TIF bits
31+the kernel supports runtime optimizations for RSEQ, which also enable
32+enhanced features like scheduler time slice extensions.
33+
34+To enable them a task has to register the RSEQ region with at least the
35+length advertised by getauxval(AT_RSEQ_FEATURE_SIZE).
36+
37+If existing binaries register with RSEQ_ORIG_SIZE (32 bytes), the kernel
38+keeps the legacy low performance mode enabled to fulfil the expectations
39+of existing users regarding the original RSEQ implementation behaviour.
40+
41+The following table documents the ABI and behavioral guarantees of the
42+legacy and the optimized V2 mode.
43+
44+.. list-table:: RSEQ modes
45+ :header-rows: 1
46+
47+ * - Nr
48+ - What
49+
50+ - Legacy
51+ - Optimized V2
52+
53+ * - 1
54+ - The cpu_id_start, cpu_id, node_id and mm_cid fields (User mode read
55+ only)
56+ .. Legacy
57+ - Updated by the kernel unconditionally after each context switch and
58+ before signal delivery
59+ .. Optimized V2
60+ - Updated by the kernel if and only if they change, i.e. if the task
61+ is migrated or mm_cid changes
62+
63+ * - 2
64+ - The rseq_cs critical section field
65+ .. Legacy
66+ - Evaluated and handled unconditionally after each context switch and
67+ before signal delivery
68+ .. Optimized V2
69+ - Evaluated and handled conditionally only when user space was
70+ interrupted and was scheduled out or before delivering a signal in
71+ the interrupted context.
72+
73+ * - 3
74+ - Read only fields
75+ .. Legacy
76+ - No strict enforcement except in debug mode
77+ .. Optimized V2
78+ - Strict enforcement
79+
80+ * - 4
81+ - membarrier(...RSEQ)
82+ .. Legacy
83+ - All running threads of the process are interrupted and the ID fields
84+ are rewritten and eventually active critical sections are aborted
85+ before they return to user space. All threads which are scheduled
86+ out whether voluntary or not are covered by #1/#2 above.
87+ .. Optimized V2
88+ - All running threads of the process are interrupted and eventually
89+ active critical sections are aborted before these threads return to
90+ user space. The ID fields are only updated if changed as a
91+ consequence of the interrupt. All threads which are scheduled out
92+ whether voluntary or not are covered by #1/#2 above.
93+
94+ * - 5
95+ - Time slice extensions
96+ .. Legacy
97+ - Not supported
98+ .. Optimized V2
99+ - Supported
100+
101+The legacy mode is obviously less performant as it does unconditional
102+updates and critical section checks even if not strictly required by the
103+ABI contract. That can't be changed anymore as some users depend on that
104+observed behavior, which in turn enables them to violate the ABI and
105+overwrite the cpu_id_start field for their own purposes. This is obviously
106+discouraged as it renders RSEQ incompatible with the intended usage and
107+breaks the expectation of other libraries in the same application.
108+
109+The ABI compliant optimized v2 mode, which respects the read only fields,
110+does not require unconditional updates and therefore is way more
111+performant. The kernel validates the read only fields for compliance. If
112+user space modifies them, the process is killed. Compliant usage allows
113+multiple libraries in the same application to benefit from the RSEQ
114+functionality without disturbing each other. The ABI compliant optimized v2
115+mode also enables extended RSEQ features like time slice extensions.
116+
117+
27118 Scheduler time slice extensions
28119 -------------------------------
29120
@@ -37,7 +128,8 @@ The prerequisites for this functionality are: · 7 unmodified lines
37128
38129 * Enabled at boot time (default is enabled)
39130
40− * A rseq userspace pointer has been registered for the thread
131+ * A rseq userspace pointer has been registered for the thread in
132+ optimized V2 mode
41133
42134 The thread has to enable the functionality via prctl(2)::
43135
Documentation/virt/kvm/x86/amd-memory-encryption.rst+4−4
@@ -656,8 +656,8 @@ References · 655 unmodified lines
656656 See [white-paper]_, [api-spec]_, [amd-apm]_, [kvm-forum]_, and [snp-fw-abi]_
657657 for more info.
658658
659−.. [white-paper] https://developer.amd.com/wordpress/media/2013/12/AMD_Memory_Encryption_Whitepaper_v7-Public.pdf
660−.. [api-spec] https://support.amd.com/TechDocs/55766_SEV-KM_API_Specification.pdf
661−.. [amd-apm] https://support.amd.com/TechDocs/24593.pdf (section 15.34)
659+.. [white-paper] https://docs.amd.com/v/u/en-US/memory-encryption-white-paper
660+.. [api-spec] https://docs.amd.com/v/u/en-US/55766_PUB_3.24_SEV_API
661+.. [amd-apm] https://docs.amd.com/v/u/en-US/24593_3.44_APM_Vol2 (section 15.34)
662662 .. [kvm-forum] https://www.linux-kvm.org/images/7/74/02x08A-Thomas_Lendacky-AMDs_Virtualizatoin_Memory_Encryption_Technology.pdf
663−.. [snp-fw-abi] https://www.amd.com/system/files/TechDocs/56860.pdf
663+.. [snp-fw-abi] https://www.amd.com/content/dam/amd/en/documents/developer/56860.pdf
MAINTAINERS+130−85
@@ -68,6 +68,12 @@ Maintainers List · 67 unmodified lines
6868 first. When adding to this list, please keep the entries in
6969 alphabetical order.
7070
71+3C509 NETWORK DRIVER
72+M: "Maciej W. Rozycki" <macro@orcam.me.uk>
73+L: netdev@vger.kernel.org
74+S: Maintained
75+F: drivers/net/ethernet/3com/3c509.c
76+
7177 3C59X NETWORK DRIVER
7278 M: Steffen Klassert <klassert@kernel.org>
7379 L: netdev@vger.kernel.org
@@ -1144,8 +1150,9 @@ F: Documentation/arch/x86/amd-hfi.rst · 1070 unmodified lines
11441150 F: drivers/platform/x86/amd/hfi/
11451151
11461152 AMD IOMMU (AMD-VI)
1147−M: Joerg Roedel <joro@8bytes.org>
1153+M: Joerg Roedel (AMD) <joro@8bytes.org>
11481154 R: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
1155+R: Vasant Hegde <vasant.hegde@amd.com>
11491156 L: iommu@lists.linux.dev
11501157 S: Maintained
11511158 T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
@@ -2033,7 +2040,7 @@ F: Documentation/hwmon/aquacomputer_d5next.rst · 881 unmodified lines
20332040 F: drivers/hwmon/aquacomputer_d5next.c
20342041
20352042 AQUANTIA ETHERNET DRIVER (atlantic)
2036−M: Igor Russkikh <irusskikh@marvell.com>
2043+M: Sukhdeep Singh <sukhdeeps@marvell.com>
20372044 L: netdev@vger.kernel.org
20382045 S: Maintained
20392046 W: https://www.marvell.com/
@@ -2042,7 +2049,7 @@ F: Documentation/networking/device_drivers/ethernet/aquantia/atlantic.rst · 2 unmodified lines
20422049 F: drivers/net/ethernet/aquantia/atlantic/
20432050
20442051 AQUANTIA ETHERNET DRIVER PTP SUBSYSTEM
2045−M: Egor Pomozov <epomozov@marvell.com>
2052+M: Sukhdeep Singh <sukhdeeps@marvell.com>
20462053 L: netdev@vger.kernel.org
20472054 S: Maintained
20482055 W: http://www.aquantia.com
@@ -2076,7 +2083,7 @@ F: Documentation/devicetree/bindings/display/snps,arcpgu.txt · 27 unmodified lines
20762083 F: drivers/gpu/drm/tiny/arcpgu.c
20772084
20782085 ARCNET NETWORK LAYER
2079−M: Michael Grzeschik <m.grzeschik@pengutronix.de>
2086+M: Michael Grzeschik <mgr@kernel.org>
20802087 L: netdev@vger.kernel.org
20812088 S: Maintained
20822089 F: drivers/net/arcnet/
@@ -3379,7 +3386,9 @@ F: drivers/irqchip/irq-rda-intc.c · 1296 unmodified lines
33793386 F: drivers/tty/serial/rda-uart.c
33803387
33813388 ARM/REALTEK ARCHITECTURE
3382−M: Andreas Färber <afaerber@suse.de>
3389+M: James Tai <james.tai@realtek.com>
3390+M: Yu-Chun Lin <eleanor.lin@realtek.com>
3391+R: Andreas Färber <afaerber@suse.com>
33833392 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
33843393 L: linux-realtek-soc@lists.infradead.org (moderated for non-subscribers)
33853394 S: Maintained
@@ -3387,6 +3396,7 @@ F: Documentation/devicetree/bindings/arm/realtek.yaml · 1 unmodified line
33873396 F: arch/arm/boot/dts/realtek/
33883397 F: arch/arm/mach-realtek/
33893398 F: arch/arm64/boot/dts/realtek/
3399+F: drivers/pinctrl/realtek/
33903400
33913401 ARM/RISC-V/RENESAS ARCHITECTURE
33923402 M: Geert Uytterhoeven <geert+renesas@glider.be>
@@ -4199,8 +4209,8 @@ F: include/uapi/linux/sonet.h · 806 unmodified lines
41994209 F: net/atm/
42004210
42014211 ATMEL MACB ETHERNET DRIVER
4202−M: Nicolas Ferre <nicolas.ferre@microchip.com>
4203−M: Claudiu Beznea <claudiu.beznea@tuxon.dev>
4212+M: Théo Lebrun <theo.lebrun@bootlin.com>
4213+R: Conor Dooley <conor.dooley@microchip.com>
42044214 S: Maintained
42054215 F: drivers/net/ethernet/cadence/
42064216
@@ -4317,18 +4327,16 @@ F: Documentation/devicetree/bindings/leds/backlight/awinic,aw99706.yaml · 110 unmodified lines
43174327 F: drivers/video/backlight/aw99706.c
43184328
43194329 AXENTIA ARM DEVICES
4320−M: Peter Rosin <peda@axentia.se>
43214330 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
4322−S: Maintained
4331+S: Orphan
43234332 F: arch/arm/boot/dts/microchip/at91-linea.dtsi
43244333 F: arch/arm/boot/dts/microchip/at91-natte.dtsi
43254334 F: arch/arm/boot/dts/microchip/at91-nattis-2-natte-2.dts
43264335 F: arch/arm/boot/dts/microchip/at91-tse850-3.dts
43274336
43284337 AXENTIA ASOC DRIVERS
4329−M: Peter Rosin <peda@axentia.se>
43304338 L: linux-sound@vger.kernel.org
4331−S: Maintained
4339+S: Orphan
43324340 F: Documentation/devicetree/bindings/sound/axentia,*
43334341 F: sound/soc/atmel/tse850-pcm5142.c
43344342
@@ -6383,6 +6391,7 @@ F: include/uapi/linux/comedi.h · 2048 unmodified lines
63836391 COMMON CLK FRAMEWORK
63846392 M: Michael Turquette <mturquette@baylibre.com>
63856393 M: Stephen Boyd <sboyd@kernel.org>
6394+R: Brian Masney <bmasney@redhat.com>
63866395 L: linux-clk@vger.kernel.org
63876396 S: Maintained
63886397 Q: http://patchwork.kernel.org/project/linux-clk/list/
@@ -7102,6 +7111,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/debugobjec · 713 unmodified lines
71027111 F: include/linux/debugobjects.h
71037112 F: lib/debugobjects.c
71047113
7114+DEC LANCE NETWORK DRIVER
7115+M: "Maciej W. Rozycki" <macro@orcam.me.uk>
7116+L: netdev@vger.kernel.org
7117+S: Maintained
7118+F: drivers/net/ethernet/amd/declance.c
7119+
71057120 DECSTATION PLATFORM SUPPORT
71067121 M: "Maciej W. Rozycki" <macro@orcam.me.uk>
71077122 L: linux-mips@vger.kernel.org
@@ -7898,7 +7913,7 @@ F: drivers/gpu/drm/sun4i/sun8i* · 790 unmodified lines
78987913
78997914 DRM DRIVER FOR APPLE TOUCH BARS
79007915 M: Aun-Ali Zaidi <admin@kodeit.net>
7901−M: Aditya Garg <gargaditya08@live.com>
7916+M: Aditya Garg <gargaditya08@proton.me>
79027917 L: dri-devel@lists.freedesktop.org
79037918 S: Maintained
79047919 T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
@@ -8218,10 +8233,9 @@ F: include/uapi/drm/nouveau_drm.h · 313 unmodified lines
82188233 CORE DRIVER FOR NVIDIA GPUS [RUST]
82198234 M: Danilo Krummrich <dakr@kernel.org>
82208235 M: Alexandre Courbot <acourbot@nvidia.com>
8221−L: nouveau@lists.freedesktop.org
8236+L: nova-gpu@lists.linux.dev
82228237 S: Supported
82238238 W: https://rust-for-linux.com/nova-gpu-driver
8224−Q: https://patchwork.freedesktop.org/project/nouveau/
82258239 B: https://gitlab.freedesktop.org/drm/nova/-/issues
82268240 C: irc://irc.oftc.net/nouveau
82278241 T: git https://gitlab.freedesktop.org/drm/rust/kernel.git drm-rust-next
@@ -8230,10 +8244,9 @@ F: drivers/gpu/nova-core/ · 2 unmodified lines
82308244
82318245 DRM DRIVER FOR NVIDIA GPUS [RUST]
82328246 M: Danilo Krummrich <dakr@kernel.org>
8233−L: nouveau@lists.freedesktop.org
8247+L: nova-gpu@lists.linux.dev
82348248 S: Supported
82358249 W: https://rust-for-linux.com/nova-gpu-driver
8236−Q: https://patchwork.freedesktop.org/project/nouveau/
82378250 B: https://gitlab.freedesktop.org/drm/nova/-/issues
82388251 C: irc://irc.oftc.net/nouveau
82398252 T: git https://gitlab.freedesktop.org/drm/rust/kernel.git drm-rust-next
@@ -10848,7 +10861,7 @@ F: include/linux/generic-radix-tree.h · 2608 unmodified lines
1084810861 F: lib/generic-radix-tree.c
1084910862
1085010863 GENERIC RESISTIVE TOUCHSCREEN ADC DRIVER
10851−M: Eugen Hristev <eugen.hristev@microchip.com>
10864+M: Eugen Hristev <ehristev@kernel.org>
1085210865 L: linux-input@vger.kernel.org
1085310866 S: Maintained
1085410867 F: drivers/input/touchscreen/resistive-adc-touch.c
@@ -12071,7 +12084,7 @@ F: Documentation/i2c/busses/i2c-nvidia-gpu.rst · 1216 unmodified lines
1207112084 F: drivers/i2c/busses/i2c-nvidia-gpu.c
1207212085
1207312086 I2C MUXES
12074−M: Peter Rosin <peda@axentia.se>
12087+M: Peter Rosin <peda@lysator.liu.se>
1207512088 L: linux-i2c@vger.kernel.org
1207612089 S: Maintained
1207712090 F: Documentation/devicetree/bindings/i2c/i2c-arb*
@@ -12472,7 +12485,7 @@ F: drivers/iio/industrialio-backend.c · 394 unmodified lines
1247212485 F: include/linux/iio/backend.h
1247312486
1247412487 IIO DIGITAL POTENTIOMETER DAC
12475−M: Peter Rosin <peda@axentia.se>
12488+M: Peter Rosin <peda@lysator.liu.se>
1247612489 L: linux-iio@vger.kernel.org
1247712490 S: Maintained
1247812491 F: Documentation/ABI/testing/sysfs-bus-iio-dac-dpot-dac
@@ -12480,7 +12493,7 @@ F: Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml · 1 unmodified line
1248012493 F: drivers/iio/dac/dpot-dac.c
1248112494
1248212495 IIO ENVELOPE DETECTOR
12483−M: Peter Rosin <peda@axentia.se>
12496+M: Peter Rosin <peda@lysator.liu.se>
1248412497 L: linux-iio@vger.kernel.org
1248512498 S: Maintained
1248612499 F: Documentation/ABI/testing/sysfs-bus-iio-adc-envelope-detector
@@ -12496,7 +12509,7 @@ F: include/linux/iio/iio-gts-helper.h · 9 unmodified lines
1249612509 F: drivers/iio/test/iio-test-gts.c
1249712510
1249812511 IIO MULTIPLEXER
12499−M: Peter Rosin <peda@axentia.se>
12512+M: Peter Rosin <peda@lysator.liu.se>
1250012513 L: linux-iio@vger.kernel.org
1250112514 S: Maintained
1250212515 F: Documentation/devicetree/bindings/iio/multiplexer/io-channel-mux.yaml
@@ -12528,7 +12541,7 @@ F: include/linux/iio/ · 25 unmodified lines
1252812541 F: tools/iio/
1252912542
1253012543 IIO UNIT CONVERTER
12531−M: Peter Rosin <peda@axentia.se>
12544+M: Peter Rosin <peda@lysator.liu.se>
1253212545 L: linux-iio@vger.kernel.org
1253312546 S: Maintained
1253412547 F: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml
@@ -12805,7 +12818,6 @@ M: Cezary Rojewski <cezary.rojewski@intel.com> · 270 unmodified lines
1280512818 M: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1280612819 M: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1280712820 M: Bard Liao <yung-chuan.liao@linux.intel.com>
12808−M: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1280912821 M: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1281012822 R: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
1281112823 L: linux-sound@vger.kernel.org
@@ -13498,7 +13510,7 @@ F: include/linux/iommu-dma.h · 686 unmodified lines
1349813510 F: include/linux/iova.h
1349913511
1350013512 IOMMU SUBSYSTEM
13501−M: Joerg Roedel <joro@8bytes.org>
13513+M: Joerg Roedel (AMD) <joro@8bytes.org>
1350213514 M: Will Deacon <will@kernel.org>
1350313515 R: Robin Murphy <robin.murphy@arm.com>
1350413516 L: iommu@lists.linux.dev
@@ -13886,7 +13898,7 @@ M: Pratyush Yadav <pratyush@kernel.org> · 381 unmodified lines
1388613898 R: Dave Young <ruirui.yang@linux.dev>
1388713899 L: kexec@lists.infradead.org
1388813900 S: Maintained
13889−W: http://lse.sourceforge.net/kdump/
13901+T: git git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git
1389013902 F: Documentation/admin-guide/kdump/
1389113903 F: fs/proc/vmcore.c
1389213904 F: include/linux/crash_core.h
@@ -14079,6 +14091,7 @@ KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64) · 186 unmodified lines
1407914091 M: Marc Zyngier <maz@kernel.org>
1408014092 M: Oliver Upton <oupton@kernel.org>
1408114093 R: Joey Gouly <joey.gouly@arm.com>
14094+R: Steffen Eiden <seiden@linux.ibm.com>
1408214095 R: Suzuki K Poulose <suzuki.poulose@arm.com>
1408314096 R: Zenghui Yu <yuzenghui@huawei.com>
1408414097 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -14203,6 +14216,7 @@ M: Pasha Tatashin <pasha.tatashin@soleen.com> · 118 unmodified lines
1420314216 M: Pratyush Yadav <pratyush@kernel.org>
1420414217 L: kexec@lists.infradead.org
1420514218 W: http://kernel.org/pub/linux/utils/kernel/kexec/
14219+T: git git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git
1420614220 F: include/linux/kexec.h
1420714221 F: include/uapi/linux/kexec.h
1420814222 F: kernel/kexec*
@@ -14919,6 +14933,7 @@ LIVE UPDATE · 710 unmodified lines
1491914933 M: Pasha Tatashin <pasha.tatashin@soleen.com>
1492014934 M: Mike Rapoport <rppt@kernel.org>
1492114935 M: Pratyush Yadav <pratyush@kernel.org>
14936+L: kexec@lists.infradead.org
1492214937 L: linux-kernel@vger.kernel.org
1492314938 S: Maintained
1492414939 T: git git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git
@@ -15278,7 +15293,7 @@ M: Andrea Cervesato <andrea.cervesato@suse.com> · 353 unmodified lines
1527815293 M: Cyril Hrubis <chrubis@suse.cz>
1527915294 M: Jan Stancek <jstancek@redhat.com>
1528015295 M: Petr Vorel <pvorel@suse.cz>
15281−M: Li Wang <liwang@redhat.com>
15296+M: Li Wang <li.wang@linux.dev>
1528215297 M: Yang Xu <xuyang2018.jy@fujitsu.com>
1528315298 M: Xiao Yang <yangx.jy@fujitsu.com>
1528415299 L: ltp@lists.linux.it (subscribers-only)
@@ -15425,7 +15440,7 @@ F: include/net/netns/mctp.h · 140 unmodified lines
1542515440 F: net/mctp/
1542615441
1542715442 MAPLE TREE
15428−M: Liam R. Howlett <Liam.Howlett@oracle.com>
15443+M: Liam R. Howlett <liam@infradead.org>
1542915444 R: Alice Ryhl <aliceryhl@google.com>
1543015445 R: Andrew Ballance <andrewjballance@gmail.com>
1543115446 L: maple-tree@lists.infradead.org
@@ -15745,7 +15760,7 @@ F: Documentation/devicetree/bindings/media/i2c/maxim,max96717.yaml · 313 unmodified lines
1574515760 F: drivers/media/i2c/max96717.c
1574615761
1574715762 MAX9860 MONO AUDIO VOICE CODEC DRIVER
15748−M: Peter Rosin <peda@axentia.se>
15763+M: Peter Rosin <peda@lysator.liu.se>
1574915764 L: linux-sound@vger.kernel.org
1575015765 S: Maintained
1575115766 F: Documentation/devicetree/bindings/sound/max9860.txt
@@ -15960,7 +15975,7 @@ F: Documentation/devicetree/bindings/net/can/microchip,mcp251xfd.yaml · 208 unmodified lines
1596015975 F: drivers/net/can/spi/mcp251xfd/
1596115976
1596215977 MCP4018 AND MCP4531 MICROCHIP DIGITAL POTENTIOMETER DRIVERS
15963−M: Peter Rosin <peda@axentia.se>
15978+M: Peter Rosin <peda@lysator.liu.se>
1596415979 L: linux-iio@vger.kernel.org
1596515980 S: Maintained
1596615981 F: Documentation/ABI/testing/sysfs-bus-iio-potentiometer-mcp4531
@@ -16518,7 +16533,7 @@ F: drivers/usb/mtu3/ · 551 unmodified lines
1651816533
1651916534 MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES
1652016535 M: Peter Senna Tschudin <peter.senna@gmail.com>
16521−M: Ian Ray <ian.ray@ge.com>
16536+M: Ian Ray <ian.ray@gehealthcare.com>
1652216537 M: Martyn Welch <martyn.welch@collabora.co.uk>
1652316538 S: Maintained
1652416539 F: Documentation/devicetree/bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt
@@ -16785,7 +16800,7 @@ MEMORY MANAGEMENT - CORE · 260 unmodified lines
1678516800 M: Andrew Morton <akpm@linux-foundation.org>
1678616801 M: David Hildenbrand <david@kernel.org>
1678716802 R: Lorenzo Stoakes <ljs@kernel.org>
16788−R: Liam R. Howlett <Liam.Howlett@oracle.com>
16803+R: Liam R. Howlett <liam@infradead.org>
1678916804 R: Vlastimil Babka <vbabka@kernel.org>
1679016805 R: Mike Rapoport <rppt@kernel.org>
1679116806 R: Suren Baghdasaryan <surenb@google.com>
@@ -16831,7 +16846,7 @@ F: mm/sparse.c · 39 unmodified lines
1683116846 F: mm/util.c
1683216847 F: mm/vmpressure.c
1683316848 F: mm/vmstat.c
16834−N: include/linux/page[-_]*
16849+N: include\/linux\/page[-_][a-zA-Z]*
1683516850
1683616851 MEMORY MANAGEMENT - EXECMEM
1683716852 M: Andrew Morton <akpm@linux-foundation.org>
@@ -16921,7 +16936,7 @@ MEMORY MANAGEMENT - MISC · 83 unmodified lines
1692116936 M: Andrew Morton <akpm@linux-foundation.org>
1692216937 M: David Hildenbrand <david@kernel.org>
1692316938 R: Lorenzo Stoakes <ljs@kernel.org>
16924−R: Liam R. Howlett <Liam.Howlett@oracle.com>
16939+R: Liam R. Howlett <liam@infradead.org>
1692516940 R: Vlastimil Babka <vbabka@kernel.org>
1692616941 R: Mike Rapoport <rppt@kernel.org>
1692716942 R: Suren Baghdasaryan <surenb@google.com>
@@ -16988,6 +17003,7 @@ S: Maintained · 60 unmodified lines
1698817003 F: include/linux/compaction.h
1698917004 F: include/linux/gfp.h
1699017005 F: include/linux/page-isolation.h
17006+F: include/linux/pageblock-flags.h
1699117007 F: mm/compaction.c
1699217008 F: mm/debug_page_alloc.c
1699317009 F: mm/debug_page_ref.c
@@ -17009,7 +17025,7 @@ M: Andrew Morton <akpm@linux-foundation.org> · 15 unmodified lines
1700917025 M: Johannes Weiner <hannes@cmpxchg.org>
1701017026 R: David Hildenbrand <david@kernel.org>
1701117027 R: Michal Hocko <mhocko@kernel.org>
17012−R: Qi Zheng <zhengqi.arch@bytedance.com>
17028+R: Qi Zheng <qi.zheng@linux.dev>
1701317029 R: Shakeel Butt <shakeel.butt@linux.dev>
1701417030 R: Lorenzo Stoakes <ljs@kernel.org>
1701517031 L: linux-mm@kvack.org
@@ -17022,7 +17038,7 @@ M: Andrew Morton <akpm@linux-foundation.org> · 6 unmodified lines
1702217038 M: David Hildenbrand <david@kernel.org>
1702317039 M: Lorenzo Stoakes <ljs@kernel.org>
1702417040 R: Rik van Riel <riel@surriel.com>
17025−R: Liam R. Howlett <Liam.Howlett@oracle.com>
17041+R: Liam R. Howlett <liam@infradead.org>
1702617042 R: Vlastimil Babka <vbabka@kernel.org>
1702717043 R: Harry Yoo <harry@kernel.org>
1702817044 R: Jann Horn <jannh@google.com>
@@ -17069,7 +17085,7 @@ M: David Hildenbrand <david@kernel.org> · 40 unmodified lines
1706917085 M: Lorenzo Stoakes <ljs@kernel.org>
1707017086 R: Zi Yan <ziy@nvidia.com>
1707117087 R: Baolin Wang <baolin.wang@linux.alibaba.com>
17072−R: Liam R. Howlett <Liam.Howlett@oracle.com>
17088+R: Liam R. Howlett <liam@infradead.org>
1707317089 R: Nico Pache <npache@redhat.com>
1707417090 R: Ryan Roberts <ryan.roberts@arm.com>
1707517091 R: Dev Jain <dev.jain@arm.com>
@@ -17107,7 +17123,7 @@ F: tools/testing/selftests/mm/uffd-*.[ch] · 31 unmodified lines
1710717123 MEMORY MANAGEMENT - RUST
1710817124 M: Alice Ryhl <aliceryhl@google.com>
1710917125 R: Lorenzo Stoakes <ljs@kernel.org>
17110−R: Liam R. Howlett <Liam.Howlett@oracle.com>
17126+R: Liam R. Howlett <liam@infradead.org>
1711117127 L: linux-mm@kvack.org
1711217128 L: rust-for-linux@vger.kernel.org
1711317129 S: Maintained
@@ -17121,7 +17137,7 @@ F: rust/kernel/page.rs · 7 unmodified lines
1712117137
1712217138 MEMORY MAPPING
1712317139 M: Andrew Morton <akpm@linux-foundation.org>
17124−M: Liam R. Howlett <Liam.Howlett@oracle.com>
17140+M: Liam R. Howlett <liam@infradead.org>
1712517141 M: Lorenzo Stoakes <ljs@kernel.org>
1712617142 R: Vlastimil Babka <vbabka@kernel.org>
1712717143 R: Jann Horn <jannh@google.com>
@@ -17153,7 +17169,7 @@ F: tools/testing/vma/ · 25 unmodified lines
1715317169 MEMORY MAPPING - LOCKING
1715417170 M: Andrew Morton <akpm@linux-foundation.org>
1715517171 M: Suren Baghdasaryan <surenb@google.com>
17156−M: Liam R. Howlett <Liam.Howlett@oracle.com>
17172+M: Liam R. Howlett <liam@infradead.org>
1715717173 M: Lorenzo Stoakes <ljs@kernel.org>
1715817174 R: Vlastimil Babka <vbabka@kernel.org>
1715917175 R: Shakeel Butt <shakeel.butt@linux.dev>
@@ -17168,7 +17184,7 @@ F: mm/mmap_lock.c · 8 unmodified lines
1716817184
1716917185 MEMORY MAPPING - MADVISE (MEMORY ADVICE)
1717017186 M: Andrew Morton <akpm@linux-foundation.org>
17171−M: Liam R. Howlett <Liam.Howlett@oracle.com>
17187+M: Liam R. Howlett <liam@infradead.org>
1717217188 M: Lorenzo Stoakes <ljs@kernel.org>
1717317189 M: David Hildenbrand <david@kernel.org>
1717417190 R: Vlastimil Babka <vbabka@kernel.org>
@@ -17363,7 +17379,7 @@ F: Documentation/devicetree/bindings/sound/mikroe,mikroe-proto.txt · 188 unmodified lines
1736317379 F: sound/soc/atmel
1736417380
1736517381 MICROCHIP CSI2DC DRIVER
17366−M: Eugen Hristev <eugen.hristev@microchip.com>
17382+M: Eugen Hristev <ehristev@kernel.org>
1736717383 L: linux-media@vger.kernel.org
1736817384 S: Supported
1736917385 F: Documentation/devicetree/bindings/media/microchip,csi2dc.yaml
@@ -17390,7 +17406,7 @@ F: drivers/i2c/busses/i2c-at91-*.c · 20 unmodified lines
1739017406 F: drivers/i2c/busses/i2c-at91.h
1739117407
1739217408 MICROCHIP ISC DRIVER
17393−M: Eugen Hristev <eugen.hristev@microchip.com>
17409+M: Eugen Hristev <ehristev@kernel.org>
1739417410 L: linux-media@vger.kernel.org
1739517411 S: Supported
1739617412 F: Documentation/devicetree/bindings/media/atmel,isc.yaml
@@ -17402,7 +17418,7 @@ F: drivers/staging/media/deprecated/atmel/atmel-sama*-isc* · 5 unmodified lines
1740217418 F: include/linux/atmel-isc-media.h
1740317419
1740417420 MICROCHIP ISI DRIVER
17405−M: Eugen Hristev <eugen.hristev@microchip.com>
17421+M: Eugen Hristev <ehristev@kernel.org>
1740617422 L: linux-media@vger.kernel.org
1740717423 S: Supported
1740817424 F: drivers/media/platform/atmel/atmel-isi.c
@@ -17592,7 +17608,7 @@ F: Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-lvds.yaml · 183 unmodified lines
1759217608 F: drivers/gpu/drm/bridge/microchip-lvds.c
1759317609
1759417610 MICROCHIP SAMA5D2-COMPATIBLE ADC DRIVER
17595−M: Eugen Hristev <eugen.hristev@microchip.com>
17611+M: Eugen Hristev <ehristev@kernel.org>
1759617612 L: linux-iio@vger.kernel.org
1759717613 S: Supported
1759817614 F: Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
@@ -18271,7 +18287,7 @@ F: include/linux/mmc/ · 672 unmodified lines
1827118287 F: include/uapi/linux/mmc/
1827218288
1827318289 MULTIPLEXER SUBSYSTEM
18274−M: Peter Rosin <peda@axentia.se>
18290+M: Peter Rosin <peda@lysator.liu.se>
1827518291 S: Odd Fixes
1827618292 F: Documentation/ABI/testing/sysfs-class-mux*
1827718293 F: Documentation/devicetree/bindings/mux/
@@ -18655,6 +18671,7 @@ F: tools/testing/selftests/net/ · 377 unmodified lines
1865518671 X: Documentation/networking/mac80211-injection.rst
1865618672 X: Documentation/networking/mac80211_hwsim/
1865718673 X: Documentation/networking/regulatory.rst
18674+X: include/net/bluetooth/
1865818675 X: include/net/cfg80211.h
1865918676 X: include/net/ieee80211_radiotap.h
1866018677 X: include/net/iw_handler.h
@@ -18705,19 +18722,59 @@ F: net/xfrm/ · 44 unmodified lines
1870518722 F: tools/testing/selftests/net/ipsec.c
1870618723
1870718724 NETWORKING [IPv4/IPv6]
18708−M: "David S. Miller" <davem@davemloft.net>
1870918725 M: David Ahern <dsahern@kernel.org>
18726+M: Ido Schimmel <idosch@nvidia.com>
1871018727 L: netdev@vger.kernel.org
1871118728 S: Maintained
18712−T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
18713−F: arch/x86/net/*
18714−F: include/linux/ip.h
18715−F: include/linux/ipv6*
18729+F: Documentation/netlink/specs/rt-addr.yaml
18730+F: Documentation/netlink/specs/rt-neigh.yaml
18731+F: Documentation/netlink/specs/rt-route.yaml
18732+F: Documentation/netlink/specs/rt-rule.yaml
18733+F: include/linux/inetdevice.h
18734+F: include/linux/mroute*
18735+F: include/net/addrconf.h
18736+F: include/net/arp.h
1871618737 F: include/net/fib*
18738+F: include/net/if_inet6.h
18739+F: include/net/inetpeer.h
1871718740 F: include/net/ip*
18741+F: include/net/lwtunnel.h
18742+F: include/net/ndisc.h
18743+F: include/net/netns/nexthop.h
18744+F: include/net/nexthop.h
1871818745 F: include/net/route.h
18719−F: net/ipv4/
18720−F: net/ipv6/
18746+F: include/uapi/linux/fib_rules.h
18747+F: include/uapi/linux/in_route.h
18748+F: include/uapi/linux/mroute*
18749+F: include/uapi/linux/nexthop.h
18750+F: net/core/fib*
18751+F: net/core/lwtunnel.c
18752+F: net/ipv4/arp.c
18753+F: net/ipv4/devinet.c
18754+F: net/ipv4/fib*
18755+F: net/ipv4/icmp.c
18756+F: net/ipv4/igmp.c
18757+F: net/ipv4/inet_fragment.c
18758+F: net/ipv4/inetpeer.c
18759+F: net/ipv4/ip*
18760+F: net/ipv4/metrics.c
18761+F: net/ipv4/netlink.c
18762+F: net/ipv4/nexthop.c
18763+F: net/ipv4/route.c
18764+F: net/ipv6/addr*
18765+F: net/ipv6/anycast.c
18766+F: net/ipv6/exthdrs.c
18767+F: net/ipv6/exthdrs_core.c
18768+F: net/ipv6/fib*
18769+F: net/ipv6/icmp.c
18770+F: net/ipv6/ip*
18771+F: net/ipv6/mcast*
18772+F: net/ipv6/ndisc.c
18773+F: net/ipv6/output_core.c
18774+F: net/ipv6/reassembly.c
18775+F: net/ipv6/route.c
18776+F: tools/testing/selftests/net/fib*
18777+F: tools/testing/selftests/net/forwarding/
1872118778
1872218779 NETWORKING [LABELED] (NetLabel, Labeled IPsec, SECMARK)
1872318780 M: Paul Moore <paul@paul-moore.com>
@@ -18852,18 +18909,11 @@ F: Documentation/networking/net_failover.rst · 128 unmodified lines
1885218909 F: drivers/net/net_failover.c
1885318910 F: include/net/net_failover.h
1885418911
18855−NEXTHOP
18856−M: David Ahern <dsahern@kernel.org>
18857−L: netdev@vger.kernel.org
18858−S: Maintained
18859−F: include/net/netns/nexthop.h
18860−F: include/net/nexthop.h
18861−F: include/uapi/linux/nexthop.h
18862−F: net/ipv4/nexthop.c
18863−
1886418912 NFC SUBSYSTEM
18865−L: netdev@vger.kernel.org
18866−S: Orphan
18913+M: David Heidelberg <david+nfc@ixit.cz>
18914+L: oe-linux-nfc@lists.linux.dev
18915+S: Maintained
18916+T: git https://codeberg.org/linux-nfc/linux.git
1886718917 F: Documentation/devicetree/bindings/net/nfc/
1886818918 F: drivers/nfc/
1886918919 F: include/net/nfc/
@@ -18931,7 +18981,8 @@ F: drivers/hid/hid-nintendo* · 61 unmodified lines
1893118981
1893218982 NIOS2 ARCHITECTURE
1893318983 M: Dinh Nguyen <dinguyen@kernel.org>
18934−S: Maintained
18984+M: Simon Schuster <schuster.simon@siemens-energy.com>
18985+S: Supported
1893518986 T: git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
1893618987 F: arch/nios2/
1893718988
@@ -19347,7 +19398,7 @@ F: include/dt-bindings/display/tda998x.h · 409 unmodified lines
1934719398 K: "nxp,tda998x"
1934819399
1934919400 NXP TFA9879 DRIVER
19350−M: Peter Rosin <peda@axentia.se>
19401+M: Peter Rosin <peda@lysator.liu.se>
1935119402 L: linux-sound@vger.kernel.org
1935219403 S: Maintained
1935319404 F: Documentation/devicetree/bindings/sound/trivial-codec.yaml
@@ -19445,7 +19496,6 @@ F: include/misc/ocxl* · 91 unmodified lines
1944519496 F: include/uapi/misc/ocxl.h
1944619497
1944719498 OMAP AUDIO SUPPORT
19448−M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1944919499 M: Jarkko Nikula <jarkko.nikula@bitmer.com>
1945019500 L: linux-sound@vger.kernel.org
1945119501 L: linux-omap@vger.kernel.org
@@ -20348,13 +20398,14 @@ F: Documentation/devicetree/bindings/pci/marvell,armada8k-pcie.yaml · 896 unmodified lines
2034820398 F: drivers/pci/controller/dwc/pcie-armada8k.c
2034920399
2035020400 PCI DRIVER FOR CADENCE PCIE IP
20401+R: Aksh Garg <a-garg7@ti.com>
2035120402 L: linux-pci@vger.kernel.org
2035220403 S: Orphan
2035320404 F: Documentation/devicetree/bindings/pci/cdns,*
20354−F: drivers/pci/controller/cadence/*cadence*
20405+F: drivers/pci/controller/cadence/
2035520406
2035620407 PCI DRIVER FOR CIX Sky1
20357−M: Hans Zhang <hans.zhang@cixtech.com>
20408+M: Hans Zhang <18255117159@163.com>
2035820409 L: linux-pci@vger.kernel.org
2035920410 S: Maintained
2036020411 F: Documentation/devicetree/bindings/pci/cix,sky1-pcie-*.yaml
@@ -20466,7 +20517,7 @@ F: drivers/pci/controller/plda/pcie-plda-host.c · 105 unmodified lines
2046620517 F: drivers/pci/controller/plda/pcie-plda.h
2046720518
2046820519 PCI DRIVER FOR RENESAS R-CAR
20469−M: Marek Vasut <marek.vasut+renesas@gmail.com>
20520+M: Marek Vasut <marek.vasut+renesas@mailbox.org>
2047020521 M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
2047120522 L: linux-pci@vger.kernel.org
2047220523 L: linux-renesas-soc@vger.kernel.org
@@ -20726,15 +20777,13 @@ F: Documentation/devicetree/bindings/pci/intel,keembay-pcie* · 253 unmodified lines
2072620777 F: drivers/pci/controller/dwc/pcie-keembay.c
2072720778
2072820779 PCIE DRIVER FOR INTEL LGM GW SOC
20729−M: Chuanhua Lei <lchuanhua@maxlinear.com>
2073020780 L: linux-pci@vger.kernel.org
20731−S: Maintained
20781+S: Orphan
2073220782 F: Documentation/devicetree/bindings/pci/intel-gw-pcie.yaml
2073320783 F: drivers/pci/controller/dwc/pcie-intel-gw.c
2073420784
2073520785 PCIE DRIVER FOR MEDIATEK
2073620786 M: Ryder Lee <ryder.lee@mediatek.com>
20737−M: Jianjun Wang <jianjun.wang@mediatek.com>
2073820787 L: linux-pci@vger.kernel.org
2073920788 L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)
2074020789 S: Supported
@@ -20807,6 +20856,7 @@ M: Dominik Brodowski <linux@dominikbrodowski.net> · 66 unmodified lines
2080720856 S: Odd Fixes
2080820857 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git
2080920858 F: Documentation/pcmcia/
20859+F: drivers/net/ethernet/8390/pcnet_cs.c
2081020860 F: drivers/pcmcia/
2081120861 F: include/pcmcia/
2081220862 F: tools/pcmcia/
@@ -22939,7 +22989,7 @@ N: riscv · 2126 unmodified lines
2293922989 K: riscv
2294022990
2294122991 RISC-V IOMMU
22942−M: Tomasz Jeznach <tjeznach@rivosinc.com>
22992+M: Tomasz Jeznach <tomasz.jeznach@linux.dev>
2294322993 L: iommu@lists.linux.dev
2294422994 L: linux-riscv@lists.infradead.org
2294522995 S: Maintained
@@ -23402,7 +23452,7 @@ RUST [ALLOC] · 456 unmodified lines
2340223452 M: Danilo Krummrich <dakr@kernel.org>
2340323453 R: Lorenzo Stoakes <ljs@kernel.org>
2340423454 R: Vlastimil Babka <vbabka@kernel.org>
23405−R: Liam R. Howlett <Liam.Howlett@oracle.com>
23455+R: Liam R. Howlett <liam@infradead.org>
2340623456 R: Uladzislau Rezki <urezki@gmail.com>
2340723457 L: rust-for-linux@vger.kernel.org
2340823458 S: Maintained
@@ -23554,7 +23604,7 @@ F: drivers/s390/net/ · 145 unmodified lines
2355423604
2355523605 S390 PCI SUBSYSTEM
2355623606 M: Niklas Schnelle <schnelle@linux.ibm.com>
23557−M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
23607+M: Gerd Bayer <gbayer@linux.ibm.com>
2355823608 L: linux-s390@vger.kernel.org
2355923609 S: Supported
2356023610 F: Documentation/arch/s390/pci.rst
@@ -24108,7 +24158,7 @@ F: drivers/mmc/host/sdhci* · 547 unmodified lines
2410824158
2410924159 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) MICROCHIP DRIVER
2411024160 M: Aubin Constans <aubin.constans@microchip.com>
24111−R: Eugen Hristev <eugen.hristev@collabora.com>
24161+R: Eugen Hristev <ehristev@kernel.org>
2411224162 L: linux-mmc@vger.kernel.org
2411324163 S: Supported
2411424164 F: drivers/mmc/host/sdhci-of-at91.c
@@ -24347,7 +24397,7 @@ F: include/media/i2c/rj54n1cb0c.h · 232 unmodified lines
2434724397 SHRINKER
2434824398 M: Andrew Morton <akpm@linux-foundation.org>
2434924399 M: Dave Chinner <david@fromorbit.com>
24350−R: Qi Zheng <zhengqi.arch@bytedance.com>
24400+R: Qi Zheng <qi.zheng@linux.dev>
2435124401 R: Roman Gushchin <roman.gushchin@linux.dev>
2435224402 R: Muchun Song <muchun.song@linux.dev>
2435324403 L: linux-mm@kvack.org
@@ -24649,6 +24699,7 @@ S: Maintained · 295 unmodified lines
2464924699 F: fs/smb/client/smbdirect.*
2465024700 F: fs/smb/smbdirect/
2465124701 F: fs/smb/server/transport_rdma.*
24702+F: include/linux/smbdirect.h
2465224703
2465324704 SMC91x ETHERNET DRIVER
2465424705 M: Nicolas Pitre <nico@fluxnic.net>
@@ -24797,6 +24848,7 @@ SOFTWARE RAID (Multiple Disks) SUPPORT · 142 unmodified lines
2479724848 M: Song Liu <song@kernel.org>
2479824849 M: Yu Kuai <yukuai@fnnas.com>
2479924850 R: Li Nan <linan122@huawei.com>
24851+R: Xiao Ni <xiao@kernel.org>
2480024852 L: linux-raid@vger.kernel.org
2480124853 S: Supported
2480224854 Q: https://patchwork.kernel.org/project/linux-raid/list/
@@ -25051,7 +25103,6 @@ SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS · 248 unmodified lines
2505125103 M: Liam Girdwood <lgirdwood@gmail.com>
2505225104 M: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2505325105 M: Bard Liao <yung-chuan.liao@linux.intel.com>
25054−M: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2505525106 M: Daniel Baluta <daniel.baluta@nxp.com>
2505625107 R: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2505725108 R: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
@@ -26344,7 +26395,7 @@ F: arch/xtensa/ · 1286 unmodified lines
2634426395 F: drivers/irqchip/irq-xtensa-*
2634526396
2634626397 TEXAS INSTRUMENTS ASoC DRIVERS
26347−M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
26398+M: Sen Wang <sen@ti.com>
2634826399 L: linux-sound@vger.kernel.org
2634926400 S: Maintained
2635026401 F: Documentation/devicetree/bindings/sound/davinci-mcasp-audio.yaml
@@ -26846,12 +26897,6 @@ S: Maintained · 495 unmodified lines
2684626897 F: Documentation/devicetree/bindings/iio/adc/ti,tsc2046.yaml
2684726898 F: drivers/iio/adc/ti-tsc2046.c
2684826899
26849−TI TWL4030 SERIES SOC CODEC DRIVER
26850−M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
26851−L: linux-sound@vger.kernel.org
26852−S: Maintained
26853−F: sound/soc/codecs/twl4030*
26854−
2685526900 TI VPE/CAL DRIVERS
2685626901 M: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
2685726902 L: linux-media@vger.kernel.org
Makefile+3−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 7
33 PATCHLEVEL = 1
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc6
66 NAME = Baby Opossum Posse
77
88 # *DOCUMENTATION*
@@ -486,6 +486,8 @@ export rust_common_flags := --edition=2021 \ · 477 unmodified lines
486486 -Wclippy::as_ptr_cast_mut \
487487 -Wclippy::as_underscore \
488488 -Wclippy::cast_lossless \
489+ -Aclippy::collapsible_if \
490+ -Aclippy::collapsible_match \
489491 -Wclippy::ignored_unit_patterns \
490492 -Aclippy::incompatible_msrv \
491493 -Wclippy::mut_mut \
arch/alpha/include/asm/Kbuild+1−0
@@ -5,4 +5,5 @@ generic-y += agp.h · 4 unmodified lines
55 generic-y += asm-offsets.h
66 generic-y += kvm_para.h
77 generic-y += mcs_spinlock.h
8+generic-y += ring_buffer.h
89 generic-y += text-patching.h
arch/arc/include/asm/Kbuild+1−0
@@ -5,5 +5,6 @@ generic-y += extable.h · 4 unmodified lines
55 generic-y += kvm_para.h
66 generic-y += mcs_spinlock.h
77 generic-y += parport.h
8+generic-y += ring_buffer.h
89 generic-y += user.h
910 generic-y += text-patching.h
arch/arm/boot/dts/renesas/r7s72100-genmai.dts+0−3
@@ -34,9 +34,6 @@ · 33 unmodified lines
3434 clocks = <&mstp9_clks R7S72100_CLK_SPIBSC0>;
3535 power-domains = <&cpg_clocks>;
3636
37− #address-cells = <1>;
38− #size-cells = <1>;
39−
4037 partitions {
4138 compatible = "fixed-partitions";
4239 #address-cells = <1>;
arch/arm/boot/dts/renesas/r7s72100-rskrza1.dts+0−2
@@ -36,8 +36,6 @@ · 35 unmodified lines
3636 power-domains = <&cpg_clocks>;
3737 bank-width = <4>;
3838 device-width = <1>;
39− #address-cells = <1>;
40− #size-cells = <1>;
4139
4240 partitions {
4341 compatible = "fixed-partitions";
arch/arm/boot/dts/renesas/r7s72100.dtsi+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 clock-div = <3>;
3838 };
3939
40− bsc: bus {
40+ bsc: bus@0 {
4141 compatible = "simple-bus";
4242 #address-cells = <1>;
4343 #size-cells = <1>;
arch/arm/boot/dts/renesas/r8a7778.dtsi+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 spi2 = &hspi2;
4141 };
4242
43− lbsc: bus {
43+ lbsc: bus@0 {
4444 compatible = "simple-bus";
4545 #address-cells = <1>;
4646 #size-cells = <1>;
arch/arm/boot/dts/renesas/r8a7779.dtsi+1−1
@@ -704,7 +704,7 @@ · 703 unmodified lines
704704 };
705705 };
706706
707− lbsc: bus {
707+ lbsc: bus@0 {
708708 compatible = "simple-bus";
709709 #address-cells = <1>;
710710 #size-cells = <1>;
arch/arm/boot/dts/renesas/r8a7792.dtsi+1−1
@@ -86,7 +86,7 @@ · 85 unmodified lines
8686 bootph-all;
8787 };
8888
89− lbsc: bus {
89+ lbsc: bus@0 {
9090 compatible = "simple-bus";
9191 #address-cells = <1>;
9292 #size-cells = <1>;
arch/arm/include/asm/Kbuild+1−0
@@ -3,6 +3,7 @@ generic-y += early_ioremap.h · 2 unmodified lines
33 generic-y += extable.h
44 generic-y += flat.h
55 generic-y += parport.h
6+generic-y += ring_buffer.h
67
78 generated-y += mach-types.h
89 generated-y += unistd-nr.h
arch/arm/mach-versatile/integrator_cp.c+4−9
@@ -86,14 +86,6 @@ static u64 notrace intcp_read_sched_clock(void) · 85 unmodified lines
8686 return val;
8787 }
8888
89−static void __init intcp_init_early(void)
90−{
91− cm_map = syscon_regmap_lookup_by_compatible("arm,core-module-integrator");
92− if (IS_ERR(cm_map))
93− return;
94− sched_clock_register(intcp_read_sched_clock, 32, 24000000);
95−}
96−
9789 static void __init intcp_init_irq_of(void)
9890 {
9991 cm_init();
@@ -119,6 +111,10 @@ static void __init intcp_init_of(void) · 19 unmodified lines
119111 {
120112 struct device_node *cpcon;
121113
114+ cm_map = syscon_regmap_lookup_by_compatible("arm,core-module-integrator");
115+ if (!IS_ERR(cm_map))
116+ sched_clock_register(intcp_read_sched_clock, 32, 24000000);
117+
122118 cpcon = of_find_matching_node(NULL, intcp_syscon_match);
123119 if (!cpcon)
124120 return;
@@ -138,7 +134,6 @@ static const char * intcp_dt_board_compat[] = { · 13 unmodified lines
138134 DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
139135 .reserve = integrator_reserve,
140136 .map_io = intcp_map_io,
141− .init_early = intcp_init_early,
142137 .init_irq = intcp_init_irq_of,
143138 .init_machine = intcp_init_of,
144139 .dt_compat = intcp_dt_board_compat,
arch/arm64/boot/dts/renesas/draak-ebisu-panel-aa104xd12.dtso+5−0
@@ -27,7 +27,12 @@ · 26 unmodified lines
2727 status = "okay";
2828
2929 ports {
30+ #address-cells = <1>;
31+ #size-cells = <0>;
32+
3033 port@1 {
34+ reg = <1>;
35+
3136 lvds1_out: endpoint {
3237 remote-endpoint = <&panel_in>;
3338 };
arch/arm64/boot/dts/renesas/r8a78000.dtsi+4−4
@@ -699,7 +699,7 @@ · 698 unmodified lines
699699 "renesas,rcar-gen5-scif", "renesas,scif";
700700 reg = <0 0xc0700000 0 0x40>;
701701 interrupts = <GIC_ESPI 10 IRQ_TYPE_LEVEL_HIGH>;
702− clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
702+ clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
703703 clock-names = "fck", "brg_int", "scif_clk";
704704 status = "disabled";
705705 };
@@ -709,7 +709,7 @@ · 3 unmodified lines
709709 "renesas,rcar-gen5-scif", "renesas,scif";
710710 reg = <0 0xc0704000 0 0x40>;
711711 interrupts = <GIC_ESPI 11 IRQ_TYPE_LEVEL_HIGH>;
712− clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
712+ clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
713713 clock-names = "fck", "brg_int", "scif_clk";
714714 status = "disabled";
715715 };
@@ -719,7 +719,7 @@ · 3 unmodified lines
719719 "renesas,rcar-gen5-scif", "renesas,scif";
720720 reg = <0 0xc0708000 0 0x40>;
721721 interrupts = <GIC_ESPI 12 IRQ_TYPE_LEVEL_HIGH>;
722− clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
722+ clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
723723 clock-names = "fck", "brg_int", "scif_clk";
724724 status = "disabled";
725725 };
@@ -729,7 +729,7 @@ · 3 unmodified lines
729729 "renesas,rcar-gen5-scif", "renesas,scif";
730730 reg = <0 0xc070c000 0 0x40>;
731731 interrupts = <GIC_ESPI 13 IRQ_TYPE_LEVEL_HIGH>;
732− clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
732+ clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
733733 clock-names = "fck", "brg_int", "scif_clk";
734734 status = "disabled";
735735 };
arch/arm64/boot/dts/renesas/r9a09g056.dtsi+1−0
@@ -1327,6 +1327,7 @@ · 1326 unmodified lines
13271327 resets = <&cpg 0xaf>;
13281328 power-domains = <&cpg>;
13291329 #reset-cells = <0>;
1330+ #mux-state-cells = <1>;
13301331 status = "disabled";
13311332 };
13321333
arch/arm64/boot/dts/renesas/r9a09g057.dtsi+2−0
@@ -1345,6 +1345,7 @@ · 1344 unmodified lines
13451345 resets = <&cpg 0xaf>;
13461346 power-domains = <&cpg>;
13471347 #reset-cells = <0>;
1348+ #mux-state-cells = <1>;
13481349 status = "disabled";
13491350 };
13501351
@@ -1355,6 +1356,7 @@ · 4 unmodified lines
13551356 resets = <&cpg 0xaf>;
13561357 power-domains = <&cpg>;
13571358 #reset-cells = <0>;
1359+ #mux-state-cells = <1>;
13581360 status = "disabled";
13591361 };
13601362
arch/arm64/boot/dts/renesas/rz-smarc-cru-csi-ov5645.dtsi+5−0
@@ -46,7 +46,12 @@ · 45 unmodified lines
4646 status = "okay";
4747
4848 ports {
49+ #address-cells = <1>;
50+ #size-cells = <0>;
51+
4952 port@0 {
53+ reg = <0>;
54+
5055 csi2_in: endpoint {
5156 clock-lanes = <0>;
5257 data-lanes = <1 2>;
arch/arm64/boot/dts/renesas/rz-smarc-du-adv7513.dtsi+5−0
@@ -26,7 +26,12 @@ · 25 unmodified lines
2626 status = "okay";
2727
2828 ports {
29+ #address-cells = <1>;
30+ #size-cells = <0>;
31+
2932 port@0 {
33+ reg = <0>;
34+
3035 du_out_rgb: endpoint {
3136 remote-endpoint = <&adv7513_in>;
3237 };
arch/arm64/boot/dts/renesas/salvator-panel-aa104xd12.dtso+5−0
@@ -27,7 +27,12 @@ · 26 unmodified lines
2727 status = "okay";
2828
2929 ports {
30+ #address-cells = <1>;
31+ #size-cells = <0>;
32+
3033 port@1 {
34+ reg = <1>;
35+
3136 lvds0_out: endpoint {
3237 remote-endpoint = <&panel_in>;
3338 };
arch/arm64/include/asm/insn.h+1−1
@@ -409,7 +409,7 @@ __AARCH64_INSN_FUNCS(cbz, 0x7F000000, 0x34000000) · 408 unmodified lines
409409 __AARCH64_INSN_FUNCS(cbnz, 0x7F000000, 0x35000000)
410410 __AARCH64_INSN_FUNCS(tbz, 0x7F000000, 0x36000000)
411411 __AARCH64_INSN_FUNCS(tbnz, 0x7F000000, 0x37000000)
412−__AARCH64_INSN_FUNCS(bcond, 0xFF000010, 0x54000000)
412+__AARCH64_INSN_FUNCS(bcond, 0xFF000000, 0x54000000)
413413 __AARCH64_INSN_FUNCS(svc, 0xFFE0001F, 0xD4000001)
414414 __AARCH64_INSN_FUNCS(hvc, 0xFFE0001F, 0xD4000002)
415415 __AARCH64_INSN_FUNCS(smc, 0xFFE0001F, 0xD4000003)
arch/arm64/include/asm/irqflags.h+7−7
@@ -40,7 +40,7 @@ static __always_inline void __pmr_local_irq_enable(void) · 39 unmodified lines
4040 barrier();
4141 }
4242
43−static inline void arch_local_irq_enable(void)
43+static __always_inline void arch_local_irq_enable(void)
4444 {
4545 if (system_uses_irq_prio_masking()) {
4646 __pmr_local_irq_enable();
@@ -68,7 +68,7 @@ static __always_inline void __pmr_local_irq_disable(void) · 21 unmodified lines
6868 barrier();
6969 }
7070
71−static inline void arch_local_irq_disable(void)
71+static __always_inline void arch_local_irq_disable(void)
7272 {
7373 if (system_uses_irq_prio_masking()) {
7474 __pmr_local_irq_disable();
@@ -90,7 +90,7 @@ static __always_inline unsigned long __pmr_local_save_flags(void) · 15 unmodified lines
9090 /*
9191 * Save the current interrupt enable state.
9292 */
93−static inline unsigned long arch_local_save_flags(void)
93+static __always_inline unsigned long arch_local_save_flags(void)
9494 {
9595 if (system_uses_irq_prio_masking()) {
9696 return __pmr_local_save_flags();
@@ -109,7 +109,7 @@ static __always_inline bool __pmr_irqs_disabled_flags(unsigned long flags) · 12 unmodified lines
109109 return flags != GIC_PRIO_IRQON;
110110 }
111111
112−static inline bool arch_irqs_disabled_flags(unsigned long flags)
112+static __always_inline bool arch_irqs_disabled_flags(unsigned long flags)
113113 {
114114 if (system_uses_irq_prio_masking()) {
115115 return __pmr_irqs_disabled_flags(flags);
@@ -128,7 +128,7 @@ static __always_inline bool __pmr_irqs_disabled(void) · 12 unmodified lines
128128 return __pmr_irqs_disabled_flags(__pmr_local_save_flags());
129129 }
130130
131−static inline bool arch_irqs_disabled(void)
131+static __always_inline bool arch_irqs_disabled(void)
132132 {
133133 if (system_uses_irq_prio_masking()) {
134134 return __pmr_irqs_disabled();
@@ -160,7 +160,7 @@ static __always_inline unsigned long __pmr_local_irq_save(void) · 25 unmodified lines
160160 return flags;
161161 }
162162
163−static inline unsigned long arch_local_irq_save(void)
163+static __always_inline unsigned long arch_local_irq_save(void)
164164 {
165165 if (system_uses_irq_prio_masking()) {
166166 return __pmr_local_irq_save();
@@ -187,7 +187,7 @@ static __always_inline void __pmr_local_irq_restore(unsigned long flags) · 20 unmodified lines
187187 /*
188188 * restore saved IRQ state
189189 */
190−static inline void arch_local_irq_restore(unsigned long flags)
190+static __always_inline void arch_local_irq_restore(unsigned long flags)
191191 {
192192 if (system_uses_irq_prio_masking()) {
193193 __pmr_local_irq_restore(flags);
arch/arm64/include/asm/kernel-pgtable.h+6−1
@@ -68,7 +68,12 @@ · 67 unmodified lines
6868 #define KERNEL_SEGMENT_COUNT 5
6969
7070 #if SWAPPER_BLOCK_SIZE > SEGMENT_ALIGN
71−#define EARLY_SEGMENT_EXTRA_PAGES (KERNEL_SEGMENT_COUNT + 1)
71+/*
72+ * KERNEL_SEGMENT_COUNT counts the permanent kernel VMAs. The early mapping
73+ * has one additional split, [_text, _stext). Reserve one more page for the
74+ * SWAPPER_BLOCK_SIZE-unaligned boundaries.
75+ */
76+#define EARLY_SEGMENT_EXTRA_PAGES (KERNEL_SEGMENT_COUNT + 2)
7277 /*
7378 * The initial ID map consists of the kernel image, mapped as two separate
7479 * segments, and may appear misaligned wrt the swapper block size. This means
arch/arm64/include/asm/kvm_asm.h+18−10
@@ -50,6 +50,9 @@ · 49 unmodified lines
5050
5151 #include <linux/mm.h>
5252
53+#define MARKER(m) \
54+ m, __after_##m = m - 1
55+
5356 enum __kvm_host_smccc_func {
5457 /* Hypercalls that are unavailable once pKVM has finalised. */
5558 /* __KVM_HOST_SMCCC_FUNC___kvm_hyp_init */
@@ -59,8 +62,10 @@ enum __kvm_host_smccc_func { · 3 unmodified lines
5962 __KVM_HOST_SMCCC_FUNC___kvm_enable_ssbs,
6063 __KVM_HOST_SMCCC_FUNC___vgic_v3_init_lrs,
6164 __KVM_HOST_SMCCC_FUNC___vgic_v3_get_gic_config,
65+
66+ MARKER(__KVM_HOST_SMCCC_FUNC_MIN_PKVM),
67+
6268 __KVM_HOST_SMCCC_FUNC___pkvm_prot_finalize,
63− __KVM_HOST_SMCCC_FUNC_MIN_PKVM = __KVM_HOST_SMCCC_FUNC___pkvm_prot_finalize,
6469
6570 /* Hypercalls that are always available and common to [nh]VHE/pKVM. */
6671 __KVM_HOST_SMCCC_FUNC___kvm_adjust_pc,
@@ -72,11 +77,20 @@ enum __kvm_host_smccc_func { · 5 unmodified lines
7277 __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid_range,
7378 __KVM_HOST_SMCCC_FUNC___kvm_flush_cpu_context,
7479 __KVM_HOST_SMCCC_FUNC___kvm_timer_set_cntvoff,
80+ __KVM_HOST_SMCCC_FUNC___tracing_load,
81+ __KVM_HOST_SMCCC_FUNC___tracing_unload,
82+ __KVM_HOST_SMCCC_FUNC___tracing_enable,
83+ __KVM_HOST_SMCCC_FUNC___tracing_swap_reader,
84+ __KVM_HOST_SMCCC_FUNC___tracing_update_clock,
85+ __KVM_HOST_SMCCC_FUNC___tracing_reset,
86+ __KVM_HOST_SMCCC_FUNC___tracing_enable_event,
87+ __KVM_HOST_SMCCC_FUNC___tracing_write_event,
7588 __KVM_HOST_SMCCC_FUNC___vgic_v3_save_aprs,
7689 __KVM_HOST_SMCCC_FUNC___vgic_v3_restore_vmcr_aprs,
7790 __KVM_HOST_SMCCC_FUNC___vgic_v5_save_apr,
7891 __KVM_HOST_SMCCC_FUNC___vgic_v5_restore_vmcr_apr,
79− __KVM_HOST_SMCCC_FUNC_MAX_NO_PKVM = __KVM_HOST_SMCCC_FUNC___vgic_v5_restore_vmcr_apr,
92+
93+ MARKER(__KVM_HOST_SMCCC_FUNC_PKVM_ONLY),
8094
8195 /* Hypercalls that are available only when pKVM has finalised. */
8296 __KVM_HOST_SMCCC_FUNC___pkvm_host_share_hyp,
@@ -100,14 +114,8 @@ enum __kvm_host_smccc_func { · 17 unmodified lines
100114 __KVM_HOST_SMCCC_FUNC___pkvm_vcpu_load,
101115 __KVM_HOST_SMCCC_FUNC___pkvm_vcpu_put,
102116 __KVM_HOST_SMCCC_FUNC___pkvm_tlb_flush_vmid,
103− __KVM_HOST_SMCCC_FUNC___tracing_load,
104− __KVM_HOST_SMCCC_FUNC___tracing_unload,
105− __KVM_HOST_SMCCC_FUNC___tracing_enable,
106− __KVM_HOST_SMCCC_FUNC___tracing_swap_reader,
107− __KVM_HOST_SMCCC_FUNC___tracing_update_clock,
108− __KVM_HOST_SMCCC_FUNC___tracing_reset,
109− __KVM_HOST_SMCCC_FUNC___tracing_enable_event,
110− __KVM_HOST_SMCCC_FUNC___tracing_write_event,
117+
118+ MARKER(__KVM_HOST_SMCCC_FUNC_MAX)
111119 };
112120
113121 #define DECLARE_KVM_VHE_SYM(sym) extern char sym[]
arch/arm64/include/asm/kvm_host.h+2−5
@@ -450,9 +450,6 @@ struct kvm_vcpu_fault_info { · 449 unmodified lines
450450 r = __VNCR_START__ + ((VNCR_ ## r) / 8), \
451451 __after_##r = __MAX__(__before_##r - 1, r)
452452
453−#define MARKER(m) \
454− m, __after_##m = m - 1
455−
456453 enum vcpu_sysreg {
457454 __INVALID_SYSREG__, /* 0 is reserved as an invalid value */
458455 MPIDR_EL1, /* MultiProcessor Affinity Register */
@@ -514,7 +511,6 @@ enum vcpu_sysreg { · 55 unmodified lines
514511 ACTLR_EL2, /* Auxiliary Control Register (EL2) */
515512 CPTR_EL2, /* Architectural Feature Trap Register (EL2) */
516513 HACR_EL2, /* Hypervisor Auxiliary Control Register */
517− ZCR_EL2, /* SVE Control Register (EL2) */
518514 TTBR0_EL2, /* Translation Table Base Register 0 (EL2) */
519515 TTBR1_EL2, /* Translation Table Base Register 1 (EL2) */
520516 TCR_EL2, /* Translation Control Register (EL2) */
@@ -546,6 +542,7 @@ enum vcpu_sysreg { · 25 unmodified lines
546542 SCTLR2_EL2, /* System Control Register 2 (EL2) */
547543 MDCR_EL2, /* Monitor Debug Configuration Register (EL2) */
548544 CNTHCTL_EL2, /* Counter-timer Hypervisor Control register */
545+ ZCR_EL2, /* SVE Control Register (EL2) */
549546
550547 /* Any VNCR-capable reg goes after this point */
551548 MARKER(__VNCR_START__),
@@ -1548,7 +1545,7 @@ static inline bool __vcpu_has_feature(const struct kvm_arch *ka, int feature) · 996 unmodified lines
15481545 #define kvm_vcpu_has_feature(k, f) __vcpu_has_feature(&(k)->arch, (f))
15491546 #define vcpu_has_feature(v, f) __vcpu_has_feature(&(v)->kvm->arch, (f))
15501547
1551−#define kvm_vcpu_initialized(v) vcpu_get_flag(vcpu, VCPU_INITIALIZED)
1548+#define kvm_vcpu_initialized(v) vcpu_get_flag(v, VCPU_INITIALIZED)
15521549
15531550 int kvm_trng_call(struct kvm_vcpu *vcpu);
15541551 #ifdef CONFIG_KVM
arch/arm64/include/asm/kvm_nested.h+1−0
@@ -23,6 +23,7 @@ static inline u64 tcr_el2_ps_to_tcr_el1_ips(u64 tcr_el2) · 22 unmodified lines
2323 static inline u64 translate_tcr_el2_to_tcr_el1(u64 tcr)
2424 {
2525 return TCR_EPD1_MASK | /* disable TTBR1_EL1 */
26+ ((tcr & TCR_EL2_DS) ? TCR_DS : 0) |
2627 ((tcr & TCR_EL2_TBI) ? TCR_TBI0 : 0) |
2728 tcr_el2_ps_to_tcr_el1_ips(tcr) |
2829 (tcr & TCR_EL2_TG0_MASK) |
arch/arm64/include/asm/page.h+1−1
@@ -33,7 +33,7 @@ struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma, · 32 unmodified lines
3333 unsigned long vaddr);
3434 #define vma_alloc_zeroed_movable_folio vma_alloc_zeroed_movable_folio
3535
36−bool tag_clear_highpages(struct page *to, int numpages);
36+bool tag_clear_highpages(struct page *to, int numpages, bool clear_pages);
3737 #define __HAVE_ARCH_TAG_CLEAR_HIGHPAGES
3838
3939 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
arch/arm64/include/asm/ring_buffer.h+10−0
@@ -0,0 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+#ifndef _ASM_ARM64_RING_BUFFER_H
3+#define _ASM_ARM64_RING_BUFFER_H
4+
5+#include <asm/cacheflush.h>
6+
7+/* Flush D-cache on persistent ring buffer */
8+#define arch_ring_buffer_flush_range(start, end) dcache_clean_pop(start, end)
9+
10+#endif /* _ASM_ARM64_RING_BUFFER_H */
arch/arm64/include/asm/sysreg.h+1−1
@@ -844,7 +844,7 @@ · 843 unmodified lines
844844 #define INIT_SCTLR_EL2_MMU_ON \
845845 (SCTLR_ELx_M | SCTLR_ELx_C | SCTLR_ELx_SA | SCTLR_ELx_I | \
846846 SCTLR_ELx_IESB | SCTLR_ELx_WXN | ENDIAN_SET_EL2 | \
847− SCTLR_ELx_ITFSB | SCTLR_EL2_RES1)
847+ SCTLR_ELx_ITFSB | SCTLR_ELx_EIS | SCTLR_ELx_EOS | SCTLR_EL2_RES1)
848848
849849 #define INIT_SCTLR_EL2_MMU_OFF \
850850 (SCTLR_EL2_RES1 | ENDIAN_SET_EL2)
arch/arm64/include/asm/tlb.h+2−1
@@ -53,7 +53,8 @@ static inline int tlb_get_level(struct mmu_gather *tlb) · 52 unmodified lines
5353 static inline void tlb_flush(struct mmu_gather *tlb)
5454 {
5555 struct vm_area_struct vma = TLB_FLUSH_VMA(tlb->mm, 0);
56− tlbf_t flags = tlb->freed_tables ? TLBF_NONE : TLBF_NOWALKCACHE;
56+ tlbf_t flags = (tlb->freed_tables || tlb->unshared_tables) ?
57+ TLBF_NONE : TLBF_NOWALKCACHE;
5758 unsigned long stride = tlb_get_unmap_size(tlb);
5859 int tlb_level = tlb_get_level(tlb);
5960
arch/arm64/kernel/entry-common.c+24−7
@@ -62,6 +62,13 @@ static void noinstr arm64_exit_to_kernel_mode(struct pt_regs *regs, · 61 unmodified lines
6262 irqentry_exit_to_kernel_mode_after_preempt(regs, state);
6363 }
6464
65+static __always_inline void arm64_syscall_enter_from_user_mode(struct pt_regs *regs)
66+{
67+ enter_from_user_mode(regs);
68+ mte_disable_tco_entry(current);
69+ sme_enter_from_user_mode();
70+}
71+
6572 /*
6673 * Handle IRQ/context state management when entering from user mode.
6774 * Before this function is called it is not safe to call regular kernel code,
@@ -70,20 +77,30 @@ static void noinstr arm64_exit_to_kernel_mode(struct pt_regs *regs, · 2 unmodified lines
7077 static __always_inline void arm64_enter_from_user_mode(struct pt_regs *regs)
7178 {
7279 enter_from_user_mode(regs);
80+ rseq_note_user_irq_entry();
7381 mte_disable_tco_entry(current);
7482 sme_enter_from_user_mode();
7583 }
7684
85+static __always_inline void arm64_syscall_exit_to_user_mode(struct pt_regs *regs)
86+{
87+ local_irq_disable();
88+ syscall_exit_to_user_mode_prepare(regs);
89+ local_daif_mask();
90+ sme_exit_to_user_mode();
91+ mte_check_tfsr_exit();
92+ exit_to_user_mode();
93+}
94+
7795 /*
7896 * Handle IRQ/context state management when exiting to user mode.
7997 * After this function returns it is not safe to call regular kernel code,
8098 * instrumentable code, or any code which may trigger an exception.
8199 */
82−
83100 static __always_inline void arm64_exit_to_user_mode(struct pt_regs *regs)
84101 {
85102 local_irq_disable();
86− exit_to_user_mode_prepare_legacy(regs);
103+ irqentry_exit_to_user_mode_prepare(regs);
87104 local_daif_mask();
88105 sme_exit_to_user_mode();
89106 mte_check_tfsr_exit();
@@ -92,7 +109,7 @@ static __always_inline void arm64_exit_to_user_mode(struct pt_regs *regs) · 2 unmodified lines
92109
93110 asmlinkage void noinstr asm_exit_to_user_mode(struct pt_regs *regs)
94111 {
95− arm64_exit_to_user_mode(regs);
112+ arm64_syscall_exit_to_user_mode(regs);
96113 }
97114
98115 /*
@@ -716,12 +733,12 @@ static void noinstr el0_brk64(struct pt_regs *regs, unsigned long esr) · 617 unmodified lines
716733
717734 static void noinstr el0_svc(struct pt_regs *regs)
718735 {
719− arm64_enter_from_user_mode(regs);
736+ arm64_syscall_enter_from_user_mode(regs);
720737 cortex_a76_erratum_1463225_svc_handler();
721738 fpsimd_syscall_enter();
722739 local_daif_restore(DAIF_PROCCTX);
723740 do_el0_svc(regs);
724− arm64_exit_to_user_mode(regs);
741+ arm64_syscall_exit_to_user_mode(regs);
725742 fpsimd_syscall_exit();
726743 }
727744
@@ -868,11 +885,11 @@ static void noinstr el0_cp15(struct pt_regs *regs, unsigned long esr) · 140 unmodified lines
868885
869886 static void noinstr el0_svc_compat(struct pt_regs *regs)
870887 {
871− arm64_enter_from_user_mode(regs);
888+ arm64_syscall_enter_from_user_mode(regs);
872889 cortex_a76_erratum_1463225_svc_handler();
873890 local_daif_restore(DAIF_PROCCTX);
874891 do_el0_svc_compat(regs);
875− arm64_exit_to_user_mode(regs);
892+ arm64_syscall_exit_to_user_mode(regs);
876893 }
877894
878895 static void noinstr el0_bkpt32(struct pt_regs *regs, unsigned long esr)
arch/arm64/kernel/pi/patch-scs.c+2−2
@@ -196,9 +196,9 @@ static int scs_handle_fde_frame(const struct eh_frame *frame, · 195 unmodified lines
196196 loc += *opcode++ * code_alignment_factor;
197197 loc += (*opcode++ << 8) * code_alignment_factor;
198198 loc += (*opcode++ << 16) * code_alignment_factor;
199− loc += (*opcode++ << 24) * code_alignment_factor;
199+ loc += ((u64)*opcode++ << 24) * code_alignment_factor;
200200 size -= 4;
201− break;
201+ break;
202202
203203 case DW_CFA_def_cfa:
204204 case DW_CFA_offset_extended:
arch/arm64/kernel/ptrace.c+2−2
@@ -983,8 +983,8 @@ static int sve_set_common(struct task_struct *target, · 982 unmodified lines
983983 }
984984
985985 /* Always zero V regs, FPSR, and FPCR */
986− memset(&current->thread.uw.fpsimd_state, 0,
987− sizeof(current->thread.uw.fpsimd_state));
986+ memset(&target->thread.uw.fpsimd_state, 0,
987+ sizeof(target->thread.uw.fpsimd_state));
988988
989989 /* Registers: FPSIMD-only case */
990990
arch/arm64/kernel/signal.c+43−11
@@ -67,6 +67,9 @@ struct rt_sigframe_user_layout { · 66 unmodified lines
6767 unsigned long end_offset;
6868 };
6969
70+#define TERMINATOR_SIZE round_up(sizeof(struct _aarch64_ctx), 16)
71+#define EXTRA_CONTEXT_SIZE round_up(sizeof(struct extra_context), 16)
72+
7073 /*
7174 * Holds any EL0-controlled state that influences unprivileged memory accesses.
7275 * This includes both accesses done in userspace and uaccess done in the kernel.
@@ -74,13 +77,35 @@ struct rt_sigframe_user_layout { · 1 unmodified line
7477 * This state needs to be carefully managed to ensure that it doesn't cause
7578 * uaccess to fail when setting up the signal frame, and the signal handler
7679 * itself also expects a well-defined state when entered.
80+ *
81+ * The struct should be zero-initialised. Its members should only be accessed
82+ * via the accessors below. __valid_fields tracks which of the fields are valid
83+ * (have been set to some value).
7784 */
7885 struct user_access_state {
79− u64 por_el0;
86+ unsigned int __valid_fields;
87+ u64 __por_el0;
8088 };
8189
82−#define TERMINATOR_SIZE round_up(sizeof(struct _aarch64_ctx), 16)
83−#define EXTRA_CONTEXT_SIZE round_up(sizeof(struct extra_context), 16)
90+#define UA_STATE_HAS_POR_EL0 BIT(0)
91+
92+static void set_ua_state_por_el0(struct user_access_state *ua_state,
93+ u64 por_el0)
94+{
95+ ua_state->__por_el0 = por_el0;
96+ ua_state->__valid_fields |= UA_STATE_HAS_POR_EL0;
97+}
98+
99+static int get_ua_state_por_el0(const struct user_access_state *ua_state,
100+ u64 *por_el0)
101+{
102+ if (ua_state->__valid_fields & UA_STATE_HAS_POR_EL0) {
103+ *por_el0 = ua_state->__por_el0;
104+ return 0;
105+ }
106+
107+ return -ENOENT;
108+}
84109
85110 /*
86111 * Save the user access state into ua_state and reset it to disable any
@@ -94,7 +119,7 @@ static void save_reset_user_access_state(struct user_access_state *ua_state) · 7 unmodified lines
94119 for (int pkey = 0; pkey < arch_max_pkey(); pkey++)
95120 por_enable_all |= POR_ELx_PERM_PREP(pkey, POE_RWX);
96121
97− ua_state->por_el0 = read_sysreg_s(SYS_POR_EL0);
122+ set_ua_state_por_el0(ua_state, read_sysreg_s(SYS_POR_EL0));
98123 write_sysreg_s(por_enable_all, SYS_POR_EL0);
99124 /*
100125 * No ISB required as we can tolerate spurious Overlay faults -
@@ -122,8 +147,10 @@ static void set_handler_user_access_state(void) · 21 unmodified lines
122147 */
123148 static void restore_user_access_state(const struct user_access_state *ua_state)
124149 {
125− if (system_supports_poe())
126− write_sysreg_s(ua_state->por_el0, SYS_POR_EL0);
150+ u64 por_el0;
151+
152+ if (get_ua_state_por_el0(ua_state, &por_el0) == 0)
153+ write_sysreg_s(por_el0, SYS_POR_EL0);
127154 }
128155
129156 static void init_user_layout(struct rt_sigframe_user_layout *user)
@@ -333,11 +360,16 @@ static int restore_fpmr_context(struct user_ctxs *user) · 203 unmodified lines
333360 static int preserve_poe_context(struct poe_context __user *ctx,
334361 const struct user_access_state *ua_state)
335362 {
336− int err = 0;
363+ int err;
364+ u64 por_el0;
365+
366+ err = get_ua_state_por_el0(ua_state, &por_el0);
367+ if (WARN_ON_ONCE(err))
368+ return err;
337369
338370 __put_user_error(POE_MAGIC, &ctx->head.magic, err);
339371 __put_user_error(sizeof(*ctx), &ctx->head.size, err);
340− __put_user_error(ua_state->por_el0, &ctx->por_el0, err);
372+ __put_user_error(por_el0, &ctx->por_el0, err);
341373
342374 return err;
343375 }
@@ -353,7 +385,7 @@ static int restore_poe_context(struct user_ctxs *user, · 9 unmodified lines
353385
354386 __get_user_error(por_el0, &(user->poe->por_el0), err);
355387 if (!err)
356− ua_state->por_el0 = por_el0;
388+ set_ua_state_por_el0(ua_state, por_el0);
357389
358390 return err;
359391 }
@@ -1095,7 +1127,7 @@ SYSCALL_DEFINE0(rt_sigreturn) · 735 unmodified lines
10951127 {
10961128 struct pt_regs *regs = current_pt_regs();
10971129 struct rt_sigframe __user *frame;
1098− struct user_access_state ua_state;
1130+ struct user_access_state ua_state = {};
10991131
11001132 /* Always make any pending restarted system calls return -EINTR */
11011133 current->restart_block.fn = do_no_restart_syscall;
@@ -1507,7 +1539,7 @@ static int setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, · 405 unmodified lines
15071539 {
15081540 struct rt_sigframe_user_layout user;
15091541 struct rt_sigframe __user *frame;
1510− struct user_access_state ua_state;
1542+ struct user_access_state ua_state = {};
15111543 int err = 0;
15121544
15131545 fpsimd_save_and_flush_current_state();
arch/arm64/kvm/arm.c+28−1
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
55 */
66
7+#include <linux/arm-smccc.h>
78 #include <linux/bug.h>
89 #include <linux/cpu_pm.h>
910 #include <linux/errno.h>
@@ -554,8 +555,10 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 544 unmodified lines
554555 kvm_destroy_mpidr_data(vcpu->kvm);
555556
556557 err = kvm_vgic_vcpu_init(vcpu);
557− if (err)
558+ if (err) {
559+ kvm_vgic_vcpu_destroy(vcpu);
558560 return err;
561+ }
559562
560563 err = kvm_share_hyp(vcpu, vcpu + 1);
561564 if (err)
@@ -824,6 +827,10 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) · 262 unmodified lines
824827 {
825828 bool irq_lines = *vcpu_hcr(v) & (HCR_VI | HCR_VF | HCR_VSE);
826829
830+ irq_lines |= (!irqchip_in_kernel(v->kvm) &&
831+ (kvm_timer_should_notify_user(v) ||
832+ kvm_pmu_should_notify_user(v)));
833+
827834 return ((irq_lines || kvm_vgic_vcpu_pending_irq(v))
828835 && !kvm_arm_vcpu_stopped(v) && !v->arch.pause);
829836 }
@@ -2634,6 +2641,22 @@ static int init_pkvm_host_sve_state(void) · 1804 unmodified lines
26342641 return 0;
26352642 }
26362643
2644+static int pkvm_check_sme_dvmsync_fw_call(void)
2645+{
2646+ struct arm_smccc_res res;
2647+
2648+ if (!cpus_have_final_cap(ARM64_WORKAROUND_4193714))
2649+ return 0;
2650+
2651+ arm_smccc_1_1_smc(ARM_SMCCC_CPU_WORKAROUND_4193714, &res);
2652+ if (res.a0) {
2653+ kvm_err("pKVM requires firmware support for C1-Pro erratum 4193714\n");
2654+ return -ENODEV;
2655+ }
2656+
2657+ return 0;
2658+}
2659+
26372660 /*
26382661 * Finalizes the initialization of hyp mode, once everything else is initialized
26392662 * and the initialziation process cannot fail.
@@ -2834,6 +2857,10 @@ static int __init init_hyp_mode(void) · 194 unmodified lines
28342857 if (err)
28352858 goto out_err;
28362859
2860+ err = pkvm_check_sme_dvmsync_fw_call();
2861+ if (err)
2862+ goto out_err;
2863+
28372864 err = kvm_hyp_init_protection(hyp_va_bits);
28382865 if (err) {
28392866 kvm_err("Failed to init hyp memory protection\n");
arch/arm64/kvm/config.c+16−7
@@ -131,7 +131,6 @@ struct reg_feat_map_desc { · 130 unmodified lines
131131 }
132132
133133 #define FEAT_SPE ID_AA64DFR0_EL1, PMSVer, IMP
134−#define FEAT_SPE_FnE ID_AA64DFR0_EL1, PMSVer, V1P2
135134 #define FEAT_BRBE ID_AA64DFR0_EL1, BRBE, IMP
136135 #define FEAT_TRC_SR ID_AA64DFR0_EL1, TraceVer, IMP
137136 #define FEAT_PMUv3 ID_AA64DFR0_EL1, PMUVer, IMP
@@ -192,7 +191,7 @@ struct reg_feat_map_desc { · 54 unmodified lines
192191 #define FEAT_SRMASK ID_AA64MMFR4_EL1, SRMASK, IMP
193192 #define FEAT_PoPS ID_AA64MMFR4_EL1, PoPS, IMP
194193 #define FEAT_PFAR ID_AA64PFR1_EL1, PFAR, IMP
195−#define FEAT_Debugv8p9 ID_AA64DFR0_EL1, PMUVer, V3P9
194+#define FEAT_Debugv8p9 ID_AA64DFR0_EL1, DebugVer, V8P9
196195 #define FEAT_PMUv3_SS ID_AA64DFR0_EL1, PMSS, IMP
197196 #define FEAT_SEBEP ID_AA64DFR0_EL1, SEBEP, IMP
198197 #define FEAT_EBEP ID_AA64DFR1_EL1, EBEP, IMP
@@ -283,7 +282,7 @@ static bool feat_anerr(struct kvm *kvm) · 84 unmodified lines
283282 static bool feat_sme_smps(struct kvm *kvm)
284283 {
285284 /*
286− * Revists this if KVM ever supports SME -- this really should
285+ * Revisit this if KVM ever supports SME -- this really should
287286 * look at the guest's view of SMIDR_EL1. Funnily enough, this
288287 * is not captured in the JSON file, but only as a note in the
289288 * ARM ARM.
@@ -295,17 +294,27 @@ static bool feat_sme_smps(struct kvm *kvm) · 5 unmodified lines
295294 static bool feat_spe_fds(struct kvm *kvm)
296295 {
297296 /*
298− * Revists this if KVM ever supports SPE -- this really should
297+ * Revisit this if KVM ever supports SPE -- this really should
299298 * look at the guest's view of PMSIDR_EL1.
300299 */
301300 return (kvm_has_feat(kvm, FEAT_SPEv1p4) &&
302301 (read_sysreg_s(SYS_PMSIDR_EL1) & PMSIDR_EL1_FDS));
303302 }
304303
304+static bool feat_spe_fne(struct kvm *kvm)
305+{
306+ /*
307+ * Revisit this if KVM ever supports SPE -- this really should
308+ * look at the guest's view of PMSIDR_EL1.
309+ */
310+ return (kvm_has_feat(kvm, FEAT_SPEv1p2) &&
311+ (read_sysreg_s(SYS_PMSIDR_EL1) & PMSIDR_EL1_FnE));
312+}
313+
305314 static bool feat_trbe_mpam(struct kvm *kvm)
306315 {
307316 /*
308− * Revists this if KVM ever supports both MPAM and TRBE --
317+ * Revisit this if KVM ever supports both MPAM and TRBE --
309318 * this really should look at the guest's view of TRBIDR_EL1.
310319 */
311320 return (kvm_has_feat(kvm, FEAT_TRBE) &&
@@ -537,7 +546,7 @@ static const struct reg_bits_to_feat_map hdfgrtr_feat_map[] = { · 225 unmodified lines
537546 HDFGRTR_EL2_PMBPTR_EL1 |
538547 HDFGRTR_EL2_PMBLIMITR_EL1,
539548 FEAT_SPE),
540− NEEDS_FEAT(HDFGRTR_EL2_nPMSNEVFR_EL1, FEAT_SPE_FnE),
549+ NEEDS_FEAT(HDFGRTR_EL2_nPMSNEVFR_EL1, feat_spe_fne),
541550 NEEDS_FEAT(HDFGRTR_EL2_nBRBDATA |
542551 HDFGRTR_EL2_nBRBCTL |
543552 HDFGRTR_EL2_nBRBIDR,
@@ -605,7 +614,7 @@ static const struct reg_bits_to_feat_map hdfgwtr_feat_map[] = { · 61 unmodified lines
605614 HDFGWTR_EL2_PMBPTR_EL1 |
606615 HDFGWTR_EL2_PMBLIMITR_EL1,
607616 FEAT_SPE),
608− NEEDS_FEAT(HDFGWTR_EL2_nPMSNEVFR_EL1, FEAT_SPE_FnE),
617+ NEEDS_FEAT(HDFGWTR_EL2_nPMSNEVFR_EL1, feat_spe_fne),
609618 NEEDS_FEAT(HDFGWTR_EL2_nBRBDATA |
610619 HDFGWTR_EL2_nBRBCTL,
611620 FEAT_BRBE),
arch/arm64/kvm/hyp/include/hyp/switch.h+11−7
@@ -245,7 +245,7 @@ static inline void __activate_traps_ich_hfgxtr(struct kvm_vcpu *vcpu) · 244 unmodified lines
245245 __activate_fgt(hctxt, vcpu, ICH_HFGITR_EL2);
246246 }
247247
248−#define __deactivate_fgt(htcxt, vcpu, reg) \
248+#define __deactivate_fgt(hctxt, vcpu, reg) \
249249 do { \
250250 write_sysreg_s(ctxt_sys_reg(hctxt, reg), \
251251 SYS_ ## reg); \
@@ -462,11 +462,13 @@ static inline bool kvm_hyp_handle_mops(struct kvm_vcpu *vcpu, u64 *exit_code) · 210 unmodified lines
462462
463463 static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu)
464464 {
465+ u64 zcr_el2 = vcpu_sve_max_vq(vcpu) - 1;
466+
465467 /*
466468 * The vCPU's saved SVE state layout always matches the max VL of the
467469 * vCPU. Start off with the max VL so we can load the SVE state.
468470 */
469− sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
471+ sve_cond_update_zcr_vq(zcr_el2, SYS_ZCR_EL2);
470472 __sve_restore_state(vcpu_sve_pffr(vcpu),
471473 &vcpu->arch.ctxt.fp_regs.fpsr,
472474 true);
@@ -476,8 +478,10 @@ static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu) · 3 unmodified lines
476478 * nested guest, as the guest hypervisor could select a smaller VL. Slap
477479 * that into hardware before wrapping up.
478480 */
479− if (is_nested_ctxt(vcpu))
480− sve_cond_update_zcr_vq(__vcpu_sys_reg(vcpu, ZCR_EL2), SYS_ZCR_EL2);
481+ if (is_nested_ctxt(vcpu)) {
482+ zcr_el2 = min(zcr_el2, __vcpu_sys_reg(vcpu, ZCR_EL2));
483+ sve_cond_update_zcr_vq(zcr_el2, SYS_ZCR_EL2);
484+ }
481485
482486 write_sysreg_el1(__vcpu_sys_reg(vcpu, vcpu_sve_zcr_elx(vcpu)), SYS_ZCR);
483487 }
@@ -501,11 +505,11 @@ static inline void fpsimd_lazy_switch_to_guest(struct kvm_vcpu *vcpu) · 17 unmodified lines
501505 return;
502506
503507 if (vcpu_has_sve(vcpu)) {
508+ zcr_el2 = vcpu_sve_max_vq(vcpu) - 1;
509+
504510 /* A guest hypervisor may restrict the effective max VL. */
505511 if (is_nested_ctxt(vcpu))
506− zcr_el2 = __vcpu_sys_reg(vcpu, ZCR_EL2);
507− else
508− zcr_el2 = vcpu_sve_max_vq(vcpu) - 1;
512+ zcr_el2 = min(zcr_el2, __vcpu_sys_reg(vcpu, ZCR_EL2));
509513
510514 write_sysreg_el2(zcr_el2, SYS_ZCR);
511515
arch/arm64/kvm/hyp/nvhe/clock.c+3−0
@@ -35,6 +35,9 @@ void trace_clock_update(u32 mult, u32 shift, u64 epoch_ns, u64 epoch_cyc) · 34 unmodified lines
3535 struct clock_data *clock = &trace_clock_data;
3636 u64 bank = clock->cur ^ 1;
3737
38+ if (!mult || shift >= 64)
39+ return;
40+
3841 clock->data[bank].mult = mult;
3942 clock->data[bank].shift = shift;
4043 clock->data[bank].epoch_ns = epoch_ns;
arch/arm64/kvm/hyp/nvhe/host.S+1−1
@@ -120,7 +120,7 @@ SYM_FUNC_START(__hyp_do_panic) · 119 unmodified lines
120120
121121 mov x29, x0
122122
123−#ifdef PKVM_DISABLE_STAGE2_ON_PANIC
123+#ifdef CONFIG_PKVM_DISABLE_STAGE2_ON_PANIC
124124 /* Ensure host stage-2 is disabled */
125125 mrs x0, hcr_el2
126126 bic x0, x0, #HCR_VM
arch/arm64/kvm/hyp/nvhe/hyp-main.c+17−13
@@ -709,6 +709,14 @@ static const hcall_t host_hcall[] = { · 708 unmodified lines
709709 HANDLE_FUNC(__kvm_tlb_flush_vmid_range),
710710 HANDLE_FUNC(__kvm_flush_cpu_context),
711711 HANDLE_FUNC(__kvm_timer_set_cntvoff),
712+ HANDLE_FUNC(__tracing_load),
713+ HANDLE_FUNC(__tracing_unload),
714+ HANDLE_FUNC(__tracing_enable),
715+ HANDLE_FUNC(__tracing_swap_reader),
716+ HANDLE_FUNC(__tracing_update_clock),
717+ HANDLE_FUNC(__tracing_reset),
718+ HANDLE_FUNC(__tracing_enable_event),
719+ HANDLE_FUNC(__tracing_write_event),
712720 HANDLE_FUNC(__vgic_v3_save_aprs),
713721 HANDLE_FUNC(__vgic_v3_restore_vmcr_aprs),
714722 HANDLE_FUNC(__vgic_v5_save_apr),
@@ -735,22 +743,16 @@ static const hcall_t host_hcall[] = { · 20 unmodified lines
735743 HANDLE_FUNC(__pkvm_vcpu_load),
736744 HANDLE_FUNC(__pkvm_vcpu_put),
737745 HANDLE_FUNC(__pkvm_tlb_flush_vmid),
738− HANDLE_FUNC(__tracing_load),
739− HANDLE_FUNC(__tracing_unload),
740− HANDLE_FUNC(__tracing_enable),
741− HANDLE_FUNC(__tracing_swap_reader),
742− HANDLE_FUNC(__tracing_update_clock),
743− HANDLE_FUNC(__tracing_reset),
744− HANDLE_FUNC(__tracing_enable_event),
745− HANDLE_FUNC(__tracing_write_event),
746746 };
747747
748748 static void handle_host_hcall(struct kvm_cpu_context *host_ctxt)
749749 {
750750 DECLARE_REG(unsigned long, id, host_ctxt, 0);
751− unsigned long hcall_min = 0, hcall_max = -1;
751+ unsigned long hcall_min = 0, hcall_max = __KVM_HOST_SMCCC_FUNC_MAX;
752752 hcall_t hfn;
753753
754+ BUILD_BUG_ON(ARRAY_SIZE(host_hcall) != __KVM_HOST_SMCCC_FUNC_MAX);
755+
754756 /*
755757 * If pKVM has been initialised then reject any calls to the
756758 * early "privileged" hypercalls. Note that we cannot reject
@@ -763,16 +765,14 @@ static void handle_host_hcall(struct kvm_cpu_context *host_ctxt) · 6 unmodified lines
763765 if (static_branch_unlikely(&kvm_protected_mode_initialized)) {
764766 hcall_min = __KVM_HOST_SMCCC_FUNC_MIN_PKVM;
765767 } else {
766− hcall_max = __KVM_HOST_SMCCC_FUNC_MAX_NO_PKVM;
768+ hcall_max = __KVM_HOST_SMCCC_FUNC_PKVM_ONLY;
767769 }
768770
769771 id &= ~ARM_SMCCC_CALL_HINTS;
770772 id -= KVM_HOST_SMCCC_ID(0);
771773
772− if (unlikely(id < hcall_min || id > hcall_max ||
773− id >= ARRAY_SIZE(host_hcall))) {
774+ if (unlikely(id < hcall_min || id >= hcall_max))
774775 goto inval;
775− }
776776
777777 hfn = host_hcall[id];
778778 if (unlikely(!hfn))
@@ -805,6 +805,10 @@ static void handle_host_smc(struct kvm_cpu_context *host_ctxt) · 26 unmodified lines
805805 }
806806
807807 func_id &= ~ARM_SMCCC_CALL_HINTS;
808+ if (upper_32_bits(func_id)) {
809+ cpu_reg(host_ctxt, 0) = SMCCC_RET_NOT_SUPPORTED;
810+ goto exit_skip_instr;
811+ }
808812
809813 handled = kvm_host_psci_handler(host_ctxt, func_id);
810814 if (!handled)
arch/arm64/kvm/hyp/nvhe/mem_protect.c+46−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 */
66
77 #include <linux/kvm_host.h>
8+
89 #include <asm/kvm_emulate.h>
910 #include <asm/kvm_hyp.h>
1011 #include <asm/kvm_mmu.h>
@@ -14,6 +15,7 @@ · 3 unmodified lines
1415
1516 #include <hyp/fault.h>
1617
18+#include <nvhe/arm-smccc.h>
1719 #include <nvhe/gfp.h>
1820 #include <nvhe/memory.h>
1921 #include <nvhe/mem_protect.h>
@@ -29,6 +31,19 @@ static struct hyp_pool host_s2_pool; · 9 unmodified lines
2931 static DEFINE_PER_CPU(struct pkvm_hyp_vm *, __current_vm);
3032 #define current_vm (*this_cpu_ptr(&__current_vm))
3133
34+static void pkvm_sme_dvmsync_fw_call(void)
35+{
36+ if (alternative_has_cap_unlikely(ARM64_WORKAROUND_4193714)) {
37+ struct arm_smccc_res res;
38+
39+ /*
40+ * Ignore the return value. Probing for the workaround
41+ * availability took place in init_hyp_mode().
42+ */
43+ hyp_smccc_1_1_smc(ARM_SMCCC_CPU_WORKAROUND_4193714, &res);
44+ }
45+}
46+
3247 static void guest_lock_component(struct pkvm_hyp_vm *vm)
3348 {
3449 hyp_spin_lock(&vm->lock);
@@ -574,8 +589,14 @@ static int host_stage2_set_owner_metadata_locked(phys_addr_t addr, u64 size, · 539 unmodified lines
574589 ret = host_stage2_try(kvm_pgtable_stage2_annotate, &host_mmu.pgt,
575590 addr, size, &host_s2_pool,
576591 KVM_HOST_INVALID_PTE_TYPE_DONATION, annotation);
577− if (!ret)
592+ if (!ret) {
593+ /*
594+ * After stage2 maintenance has happened, but before the page
595+ * owner has changed.
596+ */
597+ pkvm_sme_dvmsync_fw_call();
578598 __host_update_page_state(addr, size, PKVM_NOPAGE);
599+ }
579600
580601 return ret;
581602 }
@@ -1369,6 +1390,22 @@ unlock: · 787 unmodified lines
13691390 return ret && ret != -EHWPOISON ? ret : 0;
13701391 }
13711392
1393+/*
1394+ * share/donate install at most one stage-2 leaf (PAGE_SIZE, or one
1395+ * KVM_PGTABLE_LAST_LEVEL - 1 block for share). kvm_mmu_cache_min_pages()
1396+ * bounds the worst-case allocation: exact for the PAGE_SIZE leaf,
1397+ * conservative by one for the block.
1398+ */
1399+static int __guest_check_pgtable_memcache(struct pkvm_hyp_vcpu *vcpu)
1400+{
1401+ struct pkvm_hyp_vm *vm = pkvm_hyp_vcpu_to_hyp_vm(vcpu);
1402+
1403+ if (vcpu->vcpu.arch.pkvm_memcache.nr_pages < kvm_mmu_cache_min_pages(vm->pgt.mmu))
1404+ return -ENOMEM;
1405+
1406+ return 0;
1407+}
1408+
13721409 int __pkvm_host_donate_guest(u64 pfn, u64 gfn, struct pkvm_hyp_vcpu *vcpu)
13731410 {
13741411 struct pkvm_hyp_vm *vm = pkvm_hyp_vcpu_to_hyp_vm(vcpu);
@@ -1388,6 +1425,10 @@ int __pkvm_host_donate_guest(u64 pfn, u64 gfn, struct pkvm_hyp_vcpu *vcpu) · 13 unmodified lines
13881425 if (ret)
13891426 goto unlock;
13901427
1428+ ret = __guest_check_pgtable_memcache(vcpu);
1429+ if (ret)
1430+ goto unlock;
1431+
13911432 meta = host_stage2_encode_gfn_meta(vm, gfn);
13921433 WARN_ON(host_stage2_set_owner_metadata_locked(phys, PAGE_SIZE,
13931434 PKVM_ID_GUEST, meta));
@@ -1453,6 +1494,10 @@ int __pkvm_host_share_guest(u64 pfn, u64 gfn, u64 nr_pages, struct pkvm_hyp_vcpu · 59 unmodified lines
14531494 }
14541495 }
14551496
1497+ ret = __guest_check_pgtable_memcache(vcpu);
1498+ if (ret)
1499+ goto unlock;
1500+
14561501 for_each_hyp_page(page, phys, size) {
14571502 set_host_state(page, PKVM_PAGE_SHARED_OWNED);
14581503 page->host_share_guest_count++;
arch/arm64/kvm/hyp/nvhe/pkvm.c+40−14
@@ -266,7 +266,8 @@ struct pkvm_hyp_vcpu *pkvm_load_hyp_vcpu(pkvm_handle_t handle, · 265 unmodified lines
266266 if (hyp_vm->kvm.created_vcpus <= vcpu_idx)
267267 goto unlock;
268268
269− hyp_vcpu = hyp_vm->vcpus[vcpu_idx];
269+ /* Pairs with smp_store_release() in register_hyp_vcpu(). */
270+ hyp_vcpu = smp_load_acquire(&hyp_vm->vcpus[vcpu_idx]);
270271 if (!hyp_vcpu)
271272 goto unlock;
272273
@@ -751,16 +752,30 @@ static struct pkvm_hyp_vcpu selftest_vcpu = { · 478 unmodified lines
751752 struct pkvm_hyp_vcpu *init_selftest_vm(void *virt)
752753 {
753754 struct hyp_page *p = hyp_virt_to_page(virt);
755+ unsigned long min_pages, seeded = 0;
754756 int i;
755757
756758 selftest_vm.kvm.arch.mmu.vtcr = host_mmu.arch.mmu.vtcr;
757759 WARN_ON(kvm_guest_prepare_stage2(&selftest_vm, virt));
758760
761+ /*
762+ * Mirror pkvm_refill_memcache() for the share/donate pre-checks;
763+ * the selftest invokes those functions directly and would
764+ * otherwise see an empty memcache.
765+ */
766+ min_pages = kvm_mmu_cache_min_pages(&selftest_vm.kvm.arch.mmu);
767+
759768 for (i = 0; i < pkvm_selftest_pages(); i++) {
760769 if (p[i].refcount)
761770 continue;
762771 p[i].refcount = 1;
763− hyp_put_page(&selftest_vm.pool, hyp_page_to_virt(&p[i]));
772+ if (seeded < min_pages) {
773+ push_hyp_memcache(&selftest_vcpu.vcpu.arch.pkvm_memcache,
774+ hyp_page_to_virt(&p[i]), hyp_virt_to_phys);
775+ seeded++;
776+ } else {
777+ hyp_put_page(&selftest_vm.pool, hyp_page_to_virt(&p[i]));
778+ }
764779 }
765780
766781 selftest_vm.kvm.arch.pkvm.handle = __pkvm_reserve_vm();
@@ -860,12 +875,30 @@ err_unpin_kvm: · 93 unmodified lines
860875 * the page-aligned size of 'struct pkvm_hyp_vcpu'.
861876 * Return 0 on success, negative error code on failure.
862877 */
878+static int register_hyp_vcpu(struct pkvm_hyp_vm *hyp_vm,
879+ struct pkvm_hyp_vcpu *hyp_vcpu)
880+{
881+ unsigned int idx = hyp_vcpu->vcpu.vcpu_idx;
882+
883+ if (idx >= hyp_vm->kvm.created_vcpus)
884+ return -EINVAL;
885+
886+ if (hyp_vm->vcpus[idx])
887+ return -EINVAL;
888+
889+ /*
890+ * Ensure the hyp_vcpu is initialised before publishing it to
891+ * the vCPU-load path via 'hyp_vm->vcpus[]'.
892+ */
893+ smp_store_release(&hyp_vm->vcpus[idx], hyp_vcpu);
894+ return 0;
895+}
896+
863897 int __pkvm_init_vcpu(pkvm_handle_t handle, struct kvm_vcpu *host_vcpu,
864898 unsigned long vcpu_hva)
865899 {
866900 struct pkvm_hyp_vcpu *hyp_vcpu;
867901 struct pkvm_hyp_vm *hyp_vm;
868− unsigned int idx;
869902 int ret;
870903
871904 hyp_vcpu = map_donated_memory(vcpu_hva, sizeof(*hyp_vcpu));
@@ -884,18 +917,11 @@ int __pkvm_init_vcpu(pkvm_handle_t handle, struct kvm_vcpu *host_vcpu, · 12 unmodified lines
884917 if (ret)
885918 goto unlock;
886919
887− idx = hyp_vcpu->vcpu.vcpu_idx;
888− if (idx >= hyp_vm->kvm.created_vcpus) {
889− ret = -EINVAL;
890− goto unlock;
891− }
892−
893− if (hyp_vm->vcpus[idx]) {
894− ret = -EINVAL;
895− goto unlock;
920+ ret = register_hyp_vcpu(hyp_vm, hyp_vcpu);
921+ if (ret) {
922+ unpin_host_vcpu(host_vcpu);
923+ unpin_host_sve_state(hyp_vcpu);
896924 }
897−
898− hyp_vm->vcpus[idx] = hyp_vcpu;
899925 unlock:
900926 hyp_spin_unlock(&vm_table_lock);
901927
arch/arm64/kvm/hyp/nvhe/setup.c+3−3
@@ -312,15 +312,15 @@ void __noreturn __pkvm_init_finalise(void) · 311 unmodified lines
312312 };
313313 pkvm_pgtable.mm_ops = &pkvm_pgtable_mm_ops;
314314
315− ret = fix_host_ownership();
315+ ret = fix_hyp_pgtable_refcnt();
316316 if (ret)
317317 goto out;
318318
319− ret = fix_hyp_pgtable_refcnt();
319+ ret = hyp_create_fixmap();
320320 if (ret)
321321 goto out;
322322
323− ret = hyp_create_fixmap();
323+ ret = fix_host_ownership();
324324 if (ret)
325325 goto out;
326326
arch/arm64/kvm/hyp/nvhe/trace.c+7−2
@@ -164,13 +164,16 @@ static int hyp_trace_buffer_load(struct hyp_trace_buffer *trace_buffer, · 163 unmodified lines
164164 return ret;
165165 }
166166
167−static bool hyp_trace_desc_validate(struct hyp_trace_desc *desc, size_t desc_size)
167+static bool hyp_trace_desc_is_valid(struct hyp_trace_desc *desc, size_t desc_size)
168168 {
169169 struct ring_buffer_desc *rb_desc;
170170 unsigned int cpu;
171171 size_t nr_bpages;
172172 void *desc_end;
173173
174+ if (!is_protected_kvm_enabled())
175+ return true;
176+
174177 /*
175178 * Both desc_size and bpages_backing_size are untrusted host-provided
176179 * values. We rely on __pkvm_host_donate_hyp() to enforce their validity.
@@ -212,8 +215,10 @@ int __tracing_load(unsigned long desc_hva, size_t desc_size) · 35 unmodified lines
212215 if (ret)
213216 return ret;
214217
215− if (!hyp_trace_desc_validate(desc, desc_size))
218+ if (!hyp_trace_desc_is_valid(desc, desc_size)) {
219+ ret = -EINVAL;
216220 goto err_release_desc;
221+ }
217222
218223 hyp_spin_lock(&trace_buffer.lock);
219224
arch/arm64/kvm/hyp/vhe/switch.c+2−1
@@ -663,7 +663,8 @@ static void __noreturn __hyp_call_panic(u64 spsr, u64 elr, u64 par) · 662 unmodified lines
663663 host_ctxt = host_data_ptr(host_ctxt);
664664 vcpu = host_ctxt->__hyp_running_vcpu;
665665
666− __deactivate_traps(vcpu);
666+ if (vcpu)
667+ __deactivate_traps(vcpu);
667668 sysreg_restore_host_state_vhe(host_ctxt);
668669
669670 panic("HYP panic:\nPS:%08llx PC:%016llx ESR:%08llx\nFAR:%016llx HPFAR:%016llx PAR:%016llx\nVCPU:%p\n",
arch/arm64/kvm/hyp_trace.c+6−3
@@ -189,7 +189,7 @@ static void hyp_trace_buffer_unshare_hyp(struct hyp_trace_buffer *trace_buffer, · 188 unmodified lines
189189 if (cpu > last_cpu)
190190 break;
191191
192− __share_page(rb_desc->meta_va);
192+ __unshare_page(rb_desc->meta_va);
193193 for (p = 0; p < rb_desc->nr_page_va; p++)
194194 __unshare_page(rb_desc->page_va[p]);
195195 }
@@ -212,14 +212,15 @@ static int hyp_trace_buffer_share_hyp(struct hyp_trace_buffer *trace_buffer) · 16 unmodified lines
212212 }
213213
214214 if (ret) {
215− for (p--; p >= 0; p--)
215+ while (--p >= 0)
216216 __unshare_page(rb_desc->page_va[p]);
217+ __unshare_page(rb_desc->meta_va);
217218 break;
218219 }
219220 }
220221
221222 if (ret)
222− hyp_trace_buffer_unshare_hyp(trace_buffer, cpu--);
223+ hyp_trace_buffer_unshare_hyp(trace_buffer, --cpu);
223224
224225 return ret;
225226 }
@@ -248,6 +249,7 @@ static struct trace_buffer_desc *hyp_trace_load(unsigned long size, void *priv) · 22 unmodified lines
248249 goto err_free_desc;
249250
250251 trace_buffer->desc = desc;
252+ trace_buffer->desc_size = desc_size;
251253
252254 ret = hyp_trace_buffer_alloc_bpages_backing(trace_buffer, size);
253255 if (ret)
@@ -297,6 +299,7 @@ static void hyp_trace_unload(struct trace_buffer_desc *desc, void *priv) · 43 unmodified lines
297299 hyp_trace_buffer_free_bpages_backing(trace_buffer);
298300 free_pages_exact(trace_buffer->desc, trace_buffer->desc_size);
299301 trace_buffer->desc = NULL;
302+ trace_buffer->desc_size = 0;
300303 }
301304
302305 static int hyp_trace_enable_tracing(bool enable, void *priv)
arch/arm64/kvm/mmu.c+21−8
@@ -1576,21 +1576,24 @@ struct kvm_s2_fault_desc { · 1575 unmodified lines
15761576 static int gmem_abort(const struct kvm_s2_fault_desc *s2fd)
15771577 {
15781578 bool write_fault, exec_fault;
1579+ bool perm_fault = kvm_vcpu_trap_is_permission_fault(s2fd->vcpu);
15791580 enum kvm_pgtable_walk_flags flags = KVM_PGTABLE_WALK_SHARED;
15801581 enum kvm_pgtable_prot prot = KVM_PGTABLE_PROT_R;
15811582 struct kvm_pgtable *pgt = s2fd->vcpu->arch.hw_mmu->pgt;
15821583 unsigned long mmu_seq;
15831584 struct page *page;
15841585 struct kvm *kvm = s2fd->vcpu->kvm;
1585− void *memcache;
1586+ void *memcache = NULL;
15861587 kvm_pfn_t pfn;
15871588 gfn_t gfn;
15881589 int ret;
15891590
1590− memcache = get_mmu_memcache(s2fd->vcpu);
1591− ret = topup_mmu_memcache(s2fd->vcpu, memcache);
1592− if (ret)
1593− return ret;
1591+ if (!perm_fault) {
1592+ memcache = get_mmu_memcache(s2fd->vcpu);
1593+ ret = topup_mmu_memcache(s2fd->vcpu, memcache);
1594+ if (ret)
1595+ return ret;
1596+ }
15941597
15951598 if (s2fd->nested)
15961599 gfn = kvm_s2_trans_output(s2fd->nested) >> PAGE_SHIFT;
@@ -1631,9 +1634,19 @@ static int gmem_abort(const struct kvm_s2_fault_desc *s2fd) · 34 unmodified lines
16311634 goto out_unlock;
16321635 }
16331636
1634− ret = KVM_PGT_FN(kvm_pgtable_stage2_map)(pgt, s2fd->fault_ipa, PAGE_SIZE,
1635− __pfn_to_phys(pfn), prot,
1636− memcache, flags);
1637+ if (perm_fault) {
1638+ /*
1639+ * Drop the SW bits in favour of those stored in the
1640+ * PTE, which will be preserved.
1641+ */
1642+ prot &= ~KVM_NV_GUEST_MAP_SZ;
1643+ ret = KVM_PGT_FN(kvm_pgtable_stage2_relax_perms)(pgt, s2fd->fault_ipa,
1644+ prot, flags);
1645+ } else {
1646+ ret = KVM_PGT_FN(kvm_pgtable_stage2_map)(pgt, s2fd->fault_ipa, PAGE_SIZE,
1647+ __pfn_to_phys(pfn), prot,
1648+ memcache, flags);
1649+ }
16371650
16381651 out_unlock:
16391652 kvm_release_faultin_page(kvm, page, !!ret, prot & KVM_PGTABLE_PROT_W);
arch/arm64/kvm/nested.c+5−0
@@ -1834,6 +1834,11 @@ int kvm_init_nv_sysregs(struct kvm_vcpu *vcpu) · 1833 unmodified lines
18341834 resx.res1 = VNCR_EL2_RES1;
18351835 set_sysreg_masks(kvm, VNCR_EL2, resx);
18361836
1837+ /* ZCR_EL2 - bits 8:4 are RAZ/WI so treat them as RES0 */
1838+ resx.res0 = ZCR_ELx_RES0 | GENMASK_ULL(8, 4);
1839+ resx.res1 = ZCR_ELx_RES1;
1840+ set_sysreg_masks(kvm, ZCR_EL2, resx);
1841+
18371842 out:
18381843 for (enum vcpu_sysreg sr = __SANITISED_REG_START__; sr < NR_SYS_REGS; sr++)
18391844 __vcpu_rmw_sys_reg(vcpu, sr, |=, 0);
arch/arm64/kvm/pmu-emul.c+2−2
@@ -174,8 +174,8 @@ static void kvm_pmu_set_pmc_value(struct kvm_pmc *pmc, u64 val, bool force) · 173 unmodified lines
174174 * action is to use PMCR.P, which will reset them to
175175 * 0 (the only use of the 'force' parameter).
176176 */
177− val = __vcpu_sys_reg(vcpu, reg) & GENMASK(63, 32);
178− val |= lower_32_bits(val);
177+ val = (__vcpu_sys_reg(vcpu, reg) & GENMASK(63, 32)) |
178+ lower_32_bits(val);
179179 }
180180
181181 __vcpu_assign_sys_reg(vcpu, reg, val);
arch/arm64/kvm/sys_regs.c+3−8
@@ -2862,21 +2862,16 @@ static bool access_zcr_el2(struct kvm_vcpu *vcpu, · 2861 unmodified lines
28622862 struct sys_reg_params *p,
28632863 const struct sys_reg_desc *r)
28642864 {
2865− unsigned int vq;
2866−
28672865 if (guest_hyp_sve_traps_enabled(vcpu)) {
28682866 kvm_inject_nested_sve_trap(vcpu);
28692867 return false;
28702868 }
28712869
2872− if (!p->is_write) {
2870+ if (!p->is_write)
28732871 p->regval = __vcpu_sys_reg(vcpu, ZCR_EL2);
2874− return true;
2875− }
2872+ else
2873+ __vcpu_assign_sys_reg(vcpu, ZCR_EL2, p->regval);
28762874
2877− vq = SYS_FIELD_GET(ZCR_ELx, LEN, p->regval) + 1;
2878− vq = min(vq, vcpu_sve_max_vq(vcpu));
2879− __vcpu_assign_sys_reg(vcpu, ZCR_EL2, vq - 1);
28802875 return true;
28812876 }
28822877
arch/arm64/kvm/vgic/vgic-its.c+4−0
@@ -2307,6 +2307,10 @@ static int vgic_its_restore_dte(struct vgic_its *its, u32 id, · 2306 unmodified lines
23072307 /* dte entry is valid */
23082308 offset = (entry & KVM_ITS_DTE_NEXT_MASK) >> KVM_ITS_DTE_NEXT_SHIFT;
23092309
2310+ /* Mimic the MAPD behaviour and reject invalid EID bits. */
2311+ if (num_eventid_bits > VITS_TYPER_IDBITS)
2312+ return -EINVAL;
2313+
23102314 if (!vgic_its_check_id(its, baser, id, NULL))
23112315 return -EINVAL;
23122316
arch/arm64/kvm/vgic/vgic-mmio-v2.c+1−1
@@ -91,7 +91,7 @@ static int vgic_mmio_uaccess_write_v2_misc(struct kvm_vcpu *vcpu, · 90 unmodified lines
9191 * migration from old kernels to new kernels with legacy
9292 * userspace.
9393 */
94− reg = FIELD_GET(GICD_IIDR_REVISION_MASK, reg);
94+ reg = FIELD_GET(GICD_IIDR_REVISION_MASK, val);
9595 switch (reg) {
9696 case KVM_VGIC_IMP_REV_2:
9797 case KVM_VGIC_IMP_REV_3:
arch/arm64/kvm/vgic/vgic-mmio-v3.c+1−1
@@ -194,7 +194,7 @@ static int vgic_mmio_uaccess_write_v3_misc(struct kvm_vcpu *vcpu, · 193 unmodified lines
194194 if ((reg ^ val) & ~GICD_IIDR_REVISION_MASK)
195195 return -EINVAL;
196196
197− reg = FIELD_GET(GICD_IIDR_REVISION_MASK, reg);
197+ reg = FIELD_GET(GICD_IIDR_REVISION_MASK, val);
198198 switch (reg) {
199199 case KVM_VGIC_IMP_REV_2:
200200 case KVM_VGIC_IMP_REV_3:
arch/arm64/mm/fault.c+7−4
@@ -1018,7 +1018,7 @@ struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma, · 1017 unmodified lines
10181018 return vma_alloc_folio(flags, 0, vma, vaddr);
10191019 }
10201020
1021−bool tag_clear_highpages(struct page *page, int numpages)
1021+bool tag_clear_highpages(struct page *page, int numpages, bool clear_pages)
10221022 {
10231023 /*
10241024 * Check if MTE is supported and fall back to clear_highpage().
@@ -1026,13 +1026,16 @@ bool tag_clear_highpages(struct page *page, int numpages) · 1 unmodified line
10261026 * post_alloc_hook() will invoke tag_clear_highpages().
10271027 */
10281028 if (!system_supports_mte())
1029− return false;
1029+ return clear_pages;
10301030
10311031 /* Newly allocated pages, shouldn't have been tagged yet */
10321032 for (int i = 0; i < numpages; i++, page++) {
10331033 WARN_ON_ONCE(!try_page_mte_tagging(page));
1034− mte_zero_clear_page_tags(page_address(page));
1034+ if (clear_pages)
1035+ mte_zero_clear_page_tags(page_address(page));
1036+ else
1037+ mte_clear_page_tags(page_address(page));
10351038 set_page_mte_tagged(page);
10361039 }
1037− return true;
1040+ return false;
10381041 }
arch/csky/include/asm/Kbuild+1−0
@@ -9,6 +9,7 @@ generic-y += qrwlock.h · 8 unmodified lines
99 generic-y += qrwlock_types.h
1010 generic-y += qspinlock.h
1111 generic-y += parport.h
12+generic-y += ring_buffer.h
1213 generic-y += user.h
1314 generic-y += vmlinux.lds.h
1415 generic-y += text-patching.h
arch/hexagon/include/asm/Kbuild+1−0
@@ -5,4 +5,5 @@ generic-y += extable.h · 4 unmodified lines
55 generic-y += iomap.h
66 generic-y += kvm_para.h
77 generic-y += mcs_spinlock.h
8+generic-y += ring_buffer.h
89 generic-y += text-patching.h
arch/loongarch/Kbuild+1−1
@@ -3,7 +3,7 @@ obj-y += mm/ · 2 unmodified lines
33 obj-y += net/
44 obj-y += vdso/
55
6−obj-$(CONFIG_KVM) += kvm/
6+obj-$(subst m,y,$(CONFIG_KVM)) += kvm/
77
88 # for cleaning
99 subdir- += boot
arch/loongarch/Kconfig+1−0
@@ -220,6 +220,7 @@ menu "Kernel type and options" · 219 unmodified lines
220220
221221 choice
222222 prompt "Kernel type"
223+ default 64BIT # Keep existing behavior
223224
224225 config 32BIT
225226 bool "32-bit kernel"
arch/loongarch/Makefile+2−0
@@ -55,9 +55,11 @@ endif · 54 unmodified lines
5555 ifdef CONFIG_32BIT
5656 tool-archpref = $(32bit-tool-archpref)
5757 UTS_MACHINE := loongarch32
58+cflags-y += $(call cc-option,-m32)
5859 else
5960 tool-archpref = $(64bit-tool-archpref)
6061 UTS_MACHINE := loongarch64
62+cflags-y += $(call cc-option,-m64)
6163 endif
6264
6365 ifneq ($(SUBARCH),$(ARCH))
arch/loongarch/include/asm/Kbuild+1−0
@@ -10,5 +10,6 @@ generic-y += qrwlock.h · 9 unmodified lines
1010 generic-y += user.h
1111 generic-y += ioctl.h
1212 generic-y += mmzone.h
13+generic-y += ring_buffer.h
1314 generic-y += statfs.h
1415 generic-y += text-patching.h
arch/loongarch/include/asm/asm-prototypes.h+20−0
@@ -20,3 +20,23 @@ asmlinkage void noinstr __no_stack_protector ret_from_kernel_thread(struct task_ · 19 unmodified lines
2020 struct pt_regs *regs,
2121 int (*fn)(void *),
2222 void *fn_arg);
23+
24+struct kvm_run;
25+struct kvm_vcpu;
26+struct loongarch_fpu;
27+
28+void kvm_exc_entry(void);
29+int kvm_enter_guest(struct kvm_run *run, struct kvm_vcpu *vcpu);
30+
31+void kvm_save_fpu(struct loongarch_fpu *fpu);
32+void kvm_restore_fpu(struct loongarch_fpu *fpu);
33+
34+#ifdef CONFIG_CPU_HAS_LSX
35+void kvm_save_lsx(struct loongarch_fpu *fpu);
36+void kvm_restore_lsx(struct loongarch_fpu *fpu);
37+#endif
38+
39+#ifdef CONFIG_CPU_HAS_LASX
40+void kvm_save_lasx(struct loongarch_fpu *fpu);
41+void kvm_restore_lasx(struct loongarch_fpu *fpu);
42+#endif
arch/loongarch/include/asm/efi.h+3−1
@@ -30,6 +30,8 @@ static inline unsigned long efi_get_kimg_min_align(void) · 29 unmodified lines
3030 return SZ_2M;
3131 }
3232
33−#define EFI_KIMG_PREFERRED_ADDRESS PHYSADDR(VMLINUX_LOAD_ADDRESS)
33+unsigned long efi_get_kimg_kaslr_address(void);
34+
35+#define EFI_KIMG_PREFERRED_ADDRESS efi_get_kimg_kaslr_address()
3436
3537 #endif /* _ASM_LOONGARCH_EFI_H */
arch/loongarch/include/asm/kvm_host.h+0−3
@@ -87,7 +87,6 @@ struct kvm_context { · 86 unmodified lines
8787 struct kvm_world_switch {
8888 int (*exc_entry)(void);
8989 int (*enter_guest)(struct kvm_run *run, struct kvm_vcpu *vcpu);
90− unsigned long page_order;
9190 };
9291
9392 #define MAX_PGTABLE_LEVELS 4
@@ -359,8 +358,6 @@ void kvm_exc_entry(void); · 265 unmodified lines
359358 int kvm_enter_guest(struct kvm_run *run, struct kvm_vcpu *vcpu);
360359
361360 extern unsigned long vpid_mask;
362−extern const unsigned long kvm_exception_size;
363−extern const unsigned long kvm_enter_guest_size;
364361 extern struct kvm_world_switch *kvm_loongarch_ops;
365362
366363 #define SW_GCSR (1 << 0)
arch/loongarch/include/asm/linkage.h+1−1
@@ -69,7 +69,7 @@ · 68 unmodified lines
6969 9, 10, 11, 12, 13, 14, 15, 16, \
7070 17, 18, 19, 20, 21, 22, 23, 24, \
7171 25, 26, 27, 28, 29, 30, 31; \
72− .cfi_offset \num, SC_REGS + \num * SZREG; \
72+ .cfi_offset \num, SC_REGS + \num * 8; \
7373 .endr; \
7474 \
7575 nop; \
arch/loongarch/include/asm/paravirt.h+6−0
@@ -4,6 +4,12 @@ · 3 unmodified lines
44
55 #ifdef CONFIG_PARAVIRT
66
7+#include <linux/jump_label.h>
8+
9+DECLARE_STATIC_KEY_FALSE(virt_preempt_key);
10+DECLARE_STATIC_KEY_FALSE(virt_spin_lock_key);
11+DECLARE_PER_CPU(struct kvm_steal_time, steal_time);
12+
713 int __init pv_ipi_init(void);
814 int __init pv_time_init(void);
915 int __init pv_spinlock_init(void);
arch/loongarch/include/asm/qspinlock.h+1−4
@@ -3,12 +3,9 @@ · 2 unmodified lines
33 #define _ASM_LOONGARCH_QSPINLOCK_H
44
55 #include <asm/kvm_para.h>
6−#include <linux/jump_label.h>
6+#include <asm/paravirt.h>
77
88 #ifdef CONFIG_PARAVIRT
9−DECLARE_STATIC_KEY_FALSE(virt_preempt_key);
10−DECLARE_STATIC_KEY_FALSE(virt_spin_lock_key);
11−DECLARE_PER_CPU(struct kvm_steal_time, steal_time);
129
1310 #define virt_spin_lock virt_spin_lock
1411
arch/loongarch/include/asm/vdso/gettimeofday.h+0−6
@@ -85,12 +85,6 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode, · 84 unmodified lines
8585 return count;
8686 }
8787
88−static inline bool loongarch_vdso_hres_capable(void)
89−{
90− return true;
91−}
92−#define __arch_vdso_hres_capable loongarch_vdso_hres_capable
93−
9488 #endif /* CONFIG_GENERIC_GETTIMEOFDAY */
9589
9690 #endif /* !__ASSEMBLER__ */
arch/loongarch/kernel/kprobes.c+8−6
@@ -60,16 +60,18 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe); · 59 unmodified lines
6060 /* Install breakpoint in text */
6161 void arch_arm_kprobe(struct kprobe *p)
6262 {
63− *p->addr = KPROBE_BP_INSN;
64− flush_insn_slot(p);
63+ u32 insn = KPROBE_BP_INSN;
64+
65+ larch_insn_text_copy(p->addr, &insn, LOONGARCH_INSN_SIZE);
6566 }
6667 NOKPROBE_SYMBOL(arch_arm_kprobe);
6768
6869 /* Remove breakpoint from text */
6970 void arch_disarm_kprobe(struct kprobe *p)
7071 {
71− *p->addr = p->opcode;
72− flush_insn_slot(p);
72+ u32 insn = p->opcode;
73+
74+ larch_insn_text_copy(p->addr, &insn, LOONGARCH_INSN_SIZE);
7375 }
7476 NOKPROBE_SYMBOL(arch_disarm_kprobe);
7577
@@ -184,16 +186,16 @@ static bool reenter_kprobe(struct kprobe *p, struct pt_regs *regs, · 108 unmodified lines
184186 struct kprobe_ctlblk *kcb)
185187 {
186188 switch (kcb->kprobe_status) {
187− case KPROBE_HIT_SS:
188189 case KPROBE_HIT_SSDONE:
189190 case KPROBE_HIT_ACTIVE:
190191 kprobes_inc_nmissed_count(p);
191192 setup_singlestep(p, regs, kcb, 1);
192193 break;
194+ case KPROBE_HIT_SS:
193195 case KPROBE_REENTER:
194196 pr_warn("Failed to recover from reentered kprobes.\n");
195197 dump_kprobe(p);
196− WARN_ON_ONCE(1);
198+ BUG();
197199 break;
198200 default:
199201 WARN_ON(1);
arch/loongarch/kernel/relocate.c+50−0
@@ -134,11 +134,23 @@ early_param("nokaslr", nokaslr); · 133 unmodified lines
134134
135135 #define KASLR_DISABLED_MESSAGE "KASLR is disabled by %s in %s cmdline.\n"
136136
137+/*
138+ * Note: strictly-defined KASLR means the kernel's final runtime address
139+ * has a random offset from the kernel's load address, which is implemented
140+ * in relocate.c; broadly-defined KALSR means the kernel's final runtime
141+ * address has a random offset from the kernel's link address (a.k.a.
142+ * VMLINUX_LOAD_ADDRESS), which also include the efistlub implementation,
143+ * kexec_file implementation and QEMU direct kernel boot. kaslr_disabled()
144+ * return true only means strictly-defined KASLR is disabled.
145+ */
137146 static inline __init bool kaslr_disabled(void)
138147 {
139148 char *str;
140149 const char *builtin_cmdline = CONFIG_CMDLINE;
141150
151+ if (kaslr_offset())
152+ return true; /* KASLR is performed during early boot. */
153+
142154 str = strstr(builtin_cmdline, "nokaslr");
143155 if (str == builtin_cmdline || (str > builtin_cmdline && *(str - 1) == ' ')) {
144156 pr_info(KASLR_DISABLED_MESSAGE, "\'nokaslr\'", "built-in");
@@ -210,14 +222,52 @@ static inline void __init *determine_relocation_address(void) · 65 unmodified lines
210222 return RELOCATED_KASLR(destination);
211223 }
212224
225+static unsigned long __init determine_initrd_address(unsigned long *size)
226+{
227+ unsigned long start = 0;
228+ unsigned long key_length;
229+ char *p, *endp, *key = "initrd=";
230+
231+ key_length = strlen(key);
232+ p = strstr(boot_command_line, key);
233+
234+ if (!p) {
235+ key = "initrdmem=";
236+ key_length = strlen(key);
237+ p = strstr(boot_command_line, key);
238+ }
239+
240+ if (p == boot_command_line || (p > boot_command_line && *(p - 1) == ' ')) {
241+ p += key_length;
242+ start = memparse(p, &endp);
243+ if (*endp == ',')
244+ *size = memparse(endp + 1, NULL);
245+ }
246+
247+ return start;
248+}
249+
213250 static inline int __init relocation_addr_valid(void *location_new)
214251 {
252+ unsigned long kernel_start, kernel_size;
253+ unsigned long initrd_start, initrd_size = 0;
254+
215255 if ((unsigned long)location_new & 0x00000ffff)
216256 return 0; /* Inappropriately aligned new location */
217257
218258 if ((unsigned long)location_new < (unsigned long)_end)
219259 return 0; /* New location overlaps original kernel */
220260
261+ initrd_start = determine_initrd_address(&initrd_size);
262+ if (initrd_start && initrd_size) {
263+ kernel_start = PHYSADDR(location_new);
264+ kernel_size = (unsigned long)_end - (unsigned long)_text;
265+
266+ if (kernel_start < (initrd_start + initrd_size) &&
267+ initrd_start < (kernel_start + kernel_size))
268+ return 0; /* initrd/initramfs overlaps kernel */
269+ }
270+
221271 return 1;
222272 }
223273 #endif
arch/loongarch/kvm/Makefile+2−1
@@ -7,11 +7,12 @@ include $(srctree)/virt/kvm/Makefile.kvm · 6 unmodified lines
77
88 obj-$(CONFIG_KVM) += kvm.o
99
10+obj-y += switch.o
11+
1012 kvm-y += exit.o
1113 kvm-y += interrupt.o
1214 kvm-y += main.o
1315 kvm-y += mmu.o
14−kvm-y += switch.o
1516 kvm-y += timer.o
1617 kvm-y += tlb.o
1718 kvm-y += vcpu.o
arch/loongarch/kvm/exit.c+1−0
@@ -390,6 +390,7 @@ int kvm_emu_mmio_read(struct kvm_vcpu *vcpu, larch_inst inst) · 389 unmodified lines
390390 run->mmio.len = 8;
391391 break;
392392 default:
393+ ret = EMULATE_FAIL;
393394 break;
394395 }
395396 break;
arch/loongarch/kvm/interrupt.c+23−11
@@ -28,23 +28,29 @@ static unsigned int priority_to_irq[EXCCODE_INT_NUM] = { · 27 unmodified lines
2828 static int kvm_irq_deliver(struct kvm_vcpu *vcpu, unsigned int priority)
2929 {
3030 unsigned int irq = 0;
31+ unsigned long old, new;
3132
3233 clear_bit(priority, &vcpu->arch.irq_pending);
3334 if (priority < EXCCODE_INT_NUM)
3435 irq = priority_to_irq[priority];
3536
36− if (kvm_guest_has_msgint(&vcpu->arch) && (priority == INT_AVEC)) {
37− dmsintc_inject_irq(vcpu);
38− set_gcsr_estat(irq);
39− return 1;
40− }
41−
4237 switch (priority) {
38+ case INT_AVEC:
39+ if (!kvm_guest_has_msgint(&vcpu->arch))
40+ break;
41+ dmsintc_inject_irq(vcpu);
42+ fallthrough;
4343 case INT_TI:
4444 case INT_IPI:
4545 case INT_SWI0:
4646 case INT_SWI1:
47+ old = kvm_read_hw_gcsr(LOONGARCH_CSR_TVAL);
4748 set_gcsr_estat(irq);
49+ new = kvm_read_hw_gcsr(LOONGARCH_CSR_TVAL);
50+
51+ /* Inject TI if TVAL inverted */
52+ if (new > old)
53+ set_gcsr_estat(CPU_TIMER);
4854 break;
4955
5056 case INT_HWI0 ... INT_HWI7:
@@ -61,22 +67,28 @@ static int kvm_irq_deliver(struct kvm_vcpu *vcpu, unsigned int priority) · 10 unmodified lines
6167 static int kvm_irq_clear(struct kvm_vcpu *vcpu, unsigned int priority)
6268 {
6369 unsigned int irq = 0;
70+ unsigned long old, new;
6471
6572 clear_bit(priority, &vcpu->arch.irq_clear);
6673 if (priority < EXCCODE_INT_NUM)
6774 irq = priority_to_irq[priority];
6875
69− if (kvm_guest_has_msgint(&vcpu->arch) && (priority == INT_AVEC)) {
70− clear_gcsr_estat(irq);
71− return 1;
72− }
73−
7476 switch (priority) {
77+ case INT_AVEC:
78+ if (!kvm_guest_has_msgint(&vcpu->arch))
79+ break;
80+ fallthrough;
7581 case INT_TI:
7682 case INT_IPI:
7783 case INT_SWI0:
7884 case INT_SWI1:
85+ old = kvm_read_hw_gcsr(LOONGARCH_CSR_TVAL);
7986 clear_gcsr_estat(irq);
87+ new = kvm_read_hw_gcsr(LOONGARCH_CSR_TVAL);
88+
89+ /* Inject TI if TVAL inverted */
90+ if (new > old)
91+ set_gcsr_estat(CPU_TIMER);
8092 break;
8193
8294 case INT_HWI0 ... INT_HWI7:
arch/loongarch/kvm/main.c+3−32
@@ -348,8 +348,7 @@ void kvm_arch_disable_virtualization_cpu(void) · 347 unmodified lines
348348
349349 static int kvm_loongarch_env_init(void)
350350 {
351− int cpu, order, ret;
352− void *addr;
351+ int cpu, ret;
353352 struct kvm_context *context;
354353
355354 vmcs = alloc_percpu(struct kvm_context);
@@ -365,30 +364,8 @@ static int kvm_loongarch_env_init(void) · 9 unmodified lines
365364 return -ENOMEM;
366365 }
367366
368− /*
369− * PGD register is shared between root kernel and kvm hypervisor.
370− * So world switch entry should be in DMW area rather than TLB area
371− * to avoid page fault reenter.
372− *
373− * In future if hardware pagetable walking is supported, we won't
374− * need to copy world switch code to DMW area.
375− */
376− order = get_order(kvm_exception_size + kvm_enter_guest_size);
377− addr = (void *)__get_free_pages(GFP_KERNEL, order);
378− if (!addr) {
379− free_percpu(vmcs);
380− vmcs = NULL;
381− kfree(kvm_loongarch_ops);
382− kvm_loongarch_ops = NULL;
383− return -ENOMEM;
384− }
385−
386− memcpy(addr, kvm_exc_entry, kvm_exception_size);
387− memcpy(addr + kvm_exception_size, kvm_enter_guest, kvm_enter_guest_size);
388− flush_icache_range((unsigned long)addr, (unsigned long)addr + kvm_exception_size + kvm_enter_guest_size);
389− kvm_loongarch_ops->exc_entry = addr;
390− kvm_loongarch_ops->enter_guest = addr + kvm_exception_size;
391− kvm_loongarch_ops->page_order = order;
367+ kvm_loongarch_ops->exc_entry = (void *)kvm_exc_entry;
368+ kvm_loongarch_ops->enter_guest = (void *)kvm_enter_guest;
392369
393370 vpid_mask = read_csr_gstat();
394371 vpid_mask = (vpid_mask & CSR_GSTAT_GIDBIT) >> CSR_GSTAT_GIDBIT_SHIFT;
@@ -428,16 +405,10 @@ static int kvm_loongarch_env_init(void) · 33 unmodified lines
428405
429406 static void kvm_loongarch_env_exit(void)
430407 {
431− unsigned long addr;
432−
433408 if (vmcs)
434409 free_percpu(vmcs);
435410
436411 if (kvm_loongarch_ops) {
437− if (kvm_loongarch_ops->exc_entry) {
438− addr = (unsigned long)kvm_loongarch_ops->exc_entry;
439− free_pages(addr, kvm_loongarch_ops->page_order);
440− }
441412 kfree(kvm_loongarch_ops);
442413 }
443414
arch/loongarch/kvm/mmu.c+1−1
@@ -95,7 +95,7 @@ static int kvm_flush_pte(kvm_pte_t *pte, phys_addr_t addr, kvm_ptw_ctx *ctx) · 94 unmodified lines
9595 else
9696 kvm->stat.pages--;
9797
98− *pte = ctx->invalid_entry;
98+ kvm_set_pte(pte, ctx->invalid_entry);
9999
100100 return 1;
101101 }
arch/loongarch/kvm/switch.S+16−6
@@ -4,9 +4,11 @@ · 3 unmodified lines
44 */
55
66 #include <linux/linkage.h>
7+#include <linux/kvm_types.h>
78 #include <asm/asm.h>
89 #include <asm/asmmacro.h>
910 #include <asm/loongarch.h>
11+#include <asm/page.h>
1012 #include <asm/regdef.h>
1113 #include <asm/unwind_hints.h>
1214
@@ -100,11 +102,16 @@ · 87 unmodified lines
100102 * - is still in guest mode, such as pgd table/vmid registers etc,
101103 * - will fix with hw page walk enabled in future
102104 * load kvm_vcpu from reserved CSR KVM_VCPU_KS, and save a2 to KVM_TEMP_KS
105+ *
106+ * PGD register is shared between root kernel and kvm hypervisor.
107+ * So world switch entry should be in DMW area rather than TLB area
108+ * to avoid page fault re-enter.
103109 */
104110 .text
111+ .p2align PAGE_SHIFT
105112 .cfi_sections .debug_frame
106113 SYM_CODE_START(kvm_exc_entry)
107− UNWIND_HINT_UNDEFINED
114+ UNWIND_HINT_END_OF_STACK
108115 csrwr a2, KVM_TEMP_KS
109116 csrrd a2, KVM_VCPU_KS
110117 addi.d a2, a2, KVM_VCPU_ARCH
@@ -190,8 +197,8 @@ ret_to_host: · 79 unmodified lines
190197 kvm_restore_host_gpr a2
191198 jr ra
192199
193−SYM_INNER_LABEL(kvm_exc_entry_end, SYM_L_LOCAL)
194200 SYM_CODE_END(kvm_exc_entry)
201+EXPORT_SYMBOL_FOR_KVM(kvm_exc_entry)
195202
196203 /*
197204 * int kvm_enter_guest(struct kvm_run *run, struct kvm_vcpu *vcpu)
@@ -215,8 +222,8 @@ SYM_FUNC_START(kvm_enter_guest) · 17 unmodified lines
215222 /* Save kvm_vcpu to kscratch */
216223 csrwr a1, KVM_VCPU_KS
217224 kvm_switch_to_guest
218−SYM_INNER_LABEL(kvm_enter_guest_end, SYM_L_LOCAL)
219225 SYM_FUNC_END(kvm_enter_guest)
226+EXPORT_SYMBOL_FOR_KVM(kvm_enter_guest)
220227
221228 SYM_FUNC_START(kvm_save_fpu)
222229 fpu_save_csr a0 t1
@@ -224,6 +231,7 @@ SYM_FUNC_START(kvm_save_fpu) · 1 unmodified line
224231 fpu_save_cc a0 t1 t2
225232 jr ra
226233 SYM_FUNC_END(kvm_save_fpu)
234+EXPORT_SYMBOL_FOR_KVM(kvm_save_fpu)
227235
228236 SYM_FUNC_START(kvm_restore_fpu)
229237 fpu_restore_double a0 t1
@@ -231,6 +239,7 @@ SYM_FUNC_START(kvm_restore_fpu) · 1 unmodified line
231239 fpu_restore_cc a0 t1 t2
232240 jr ra
233241 SYM_FUNC_END(kvm_restore_fpu)
242+EXPORT_SYMBOL_FOR_KVM(kvm_restore_fpu)
234243
235244 #ifdef CONFIG_CPU_HAS_LSX
236245 SYM_FUNC_START(kvm_save_lsx)
@@ -239,6 +248,7 @@ SYM_FUNC_START(kvm_save_lsx) · 2 unmodified lines
239248 lsx_save_data a0 t1
240249 jr ra
241250 SYM_FUNC_END(kvm_save_lsx)
251+EXPORT_SYMBOL_FOR_KVM(kvm_save_lsx)
242252
243253 SYM_FUNC_START(kvm_restore_lsx)
244254 lsx_restore_data a0 t1
@@ -246,6 +256,7 @@ SYM_FUNC_START(kvm_restore_lsx) · 1 unmodified line
246256 fpu_restore_csr a0 t1 t2
247257 jr ra
248258 SYM_FUNC_END(kvm_restore_lsx)
259+EXPORT_SYMBOL_FOR_KVM(kvm_restore_lsx)
249260 #endif
250261
251262 #ifdef CONFIG_CPU_HAS_LASX
@@ -255,6 +266,7 @@ SYM_FUNC_START(kvm_save_lasx) · 3 unmodified lines
255266 lasx_save_data a0 t1
256267 jr ra
257268 SYM_FUNC_END(kvm_save_lasx)
269+EXPORT_SYMBOL_FOR_KVM(kvm_save_lasx)
258270
259271 SYM_FUNC_START(kvm_restore_lasx)
260272 lasx_restore_data a0 t1
@@ -262,10 +274,8 @@ SYM_FUNC_START(kvm_restore_lasx) · 1 unmodified line
262274 fpu_restore_csr a0 t1 t2
263275 jr ra
264276 SYM_FUNC_END(kvm_restore_lasx)
277+EXPORT_SYMBOL_FOR_KVM(kvm_restore_lasx)
265278 #endif
266− .section ".rodata"
267−SYM_DATA(kvm_exception_size, .quad kvm_exc_entry_end - kvm_exc_entry)
268−SYM_DATA(kvm_enter_guest_size, .quad kvm_enter_guest_end - kvm_enter_guest)
269279
270280 #ifdef CONFIG_CPU_HAS_LBT
271281 STACK_FRAME_NON_STANDARD kvm_restore_fpu
arch/loongarch/kvm/timer.c+8−2
@@ -96,15 +96,21 @@ void kvm_restore_timer(struct kvm_vcpu *vcpu) · 95 unmodified lines
9696 * and set CSR TVAL with -1
9797 */
9898 write_gcsr_timertick(0);
99− __delay(2); /* Wait cycles until timer interrupt injected */
10099
101100 /*
102101 * Writing CSR_TINTCLR_TI to LOONGARCH_CSR_TINTCLR will clear
103102 * timer interrupt, and CSR TVAL keeps unchanged with -1, it
104103 * avoids spurious timer interrupt
105104 */
106− if (!(estat & CPU_TIMER))
105+ if (!(estat & CPU_TIMER)) {
106+ __delay(2); /* Wait cycles until timer interrupt injected */
107+
108+ /* Write TVAL with max value if no TI shot */
109+ estat = kvm_read_hw_gcsr(LOONGARCH_CSR_ESTAT);
110+ if (!(estat & CPU_TIMER))
111+ write_gcsr_timertick(CSR_TCFG_VAL);
107112 gcsr_write(CSR_TINTCLR_TI, LOONGARCH_CSR_TINTCLR);
113+ }
108114 return;
109115 }
110116
arch/loongarch/kvm/vm.c+1−1
@@ -125,7 +125,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 124 unmodified lines
125125 r = 1;
126126 break;
127127 case KVM_CAP_NR_VCPUS:
128− r = num_online_cpus();
128+ r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
129129 break;
130130 case KVM_CAP_MAX_VCPUS:
131131 r = KVM_MAX_VCPUS;
arch/loongarch/mm/init.c+0−4
@@ -123,11 +123,7 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) · 122 unmodified lines
123123 {
124124 unsigned long start_pfn = start >> PAGE_SHIFT;
125125 unsigned long nr_pages = size >> PAGE_SHIFT;
126− struct page *page = pfn_to_page(start_pfn);
127126
128− /* With altmap the first mapped page is offset from @start */
129− if (altmap)
130− page += vmem_altmap_offset(altmap);
131127 __remove_pages(start_pfn, nr_pages, altmap);
132128 }
133129 #endif
arch/loongarch/pci/acpi.c+5−0
@@ -61,11 +61,16 @@ static void acpi_release_root_info(struct acpi_pci_root_info *ci) · 60 unmodified lines
6161 static int acpi_prepare_root_resources(struct acpi_pci_root_info *ci)
6262 {
6363 int status;
64+ unsigned long long pci_h = 0;
6465 struct resource_entry *entry, *tmp;
6566 struct acpi_device *device = ci->bridge;
6667
6768 status = acpi_pci_probe_root_resources(ci);
6869 if (status > 0) {
70+ acpi_evaluate_integer(device->handle, "PCIH", NULL, &pci_h);
71+ if (pci_h)
72+ return status;
73+
6974 resource_list_for_each_entry_safe(entry, tmp, &ci->resources) {
7075 if (entry->res->flags & IORESOURCE_MEM) {
7176 entry->offset = ci->root->mcfg_addr & GENMASK_ULL(63, 40);
arch/loongarch/pci/pci.c+3−0
@@ -132,6 +132,9 @@ static void loongson_gpu_fixup_dma_hang(struct pci_dev *pdev, bool on) · 131 unmodified lines
132132 crtc_reg = regbase;
133133 crtc_offset = 0x400;
134134 break;
135+ default:
136+ iounmap(regbase);
137+ return;
135138 }
136139
137140 for (i = 0; i < CRTC_NUM_MAX; i++, crtc_reg += crtc_offset) {
arch/loongarch/vdso/Makefile+2−0
@@ -12,6 +12,8 @@ obj-vdso-$(CONFIG_GENERIC_GETTIMEOFDAY) += vgettimeofday.o · 11 unmodified lines
1212 ccflags-vdso := \
1313 $(filter -I%,$(KBUILD_CFLAGS)) \
1414 $(filter -E%,$(KBUILD_CFLAGS)) \
15+ $(filter -m32,$(KBUILD_CFLAGS)) \
16+ $(filter -m64,$(KBUILD_CFLAGS)) \
1517 $(filter -march=%,$(KBUILD_CFLAGS)) \
1618 $(filter -m%-float,$(KBUILD_CFLAGS)) \
1719 $(CLANG_FLAGS) \
arch/m68k/include/asm/Kbuild+1−0
@@ -3,5 +3,6 @@ generated-y += syscall_table.h · 2 unmodified lines
33 generic-y += extable.h
44 generic-y += kvm_para.h
55 generic-y += mcs_spinlock.h
6+generic-y += ring_buffer.h
67 generic-y += spinlock.h
78 generic-y += text-patching.h
arch/microblaze/include/asm/Kbuild+1−0
@@ -5,6 +5,7 @@ generic-y += extable.h · 4 unmodified lines
55 generic-y += kvm_para.h
66 generic-y += mcs_spinlock.h
77 generic-y += parport.h
8+generic-y += ring_buffer.h
89 generic-y += syscalls.h
910 generic-y += tlb.h
1011 generic-y += user.h
arch/mips/dec/platform.c+108−1
@@ -10,6 +10,14 @@ · 9 unmodified lines
1010 #include <linux/mc146818rtc.h>
1111 #include <linux/platform_device.h>
1212
13+#include <asm/bootinfo.h>
14+
15+#include <asm/dec/interrupts.h>
16+#include <asm/dec/ioasic_addrs.h>
17+#include <asm/dec/kn01.h>
18+#include <asm/dec/kn02.h>
19+#include <asm/dec/system.h>
20+
1321 static struct resource dec_rtc_resources[] = {
1422 {
1523 .name = "rtc",
@@ -30,11 +38,110 @@ static struct platform_device dec_rtc_device = { · 14 unmodified lines
3038 .num_resources = ARRAY_SIZE(dec_rtc_resources),
3139 };
3240
41+static struct resource dec_dz_resources[] = {
42+ { .name = "dz", .flags = IORESOURCE_MEM, },
43+ { .name = "dz", .flags = IORESOURCE_IRQ, },
44+};
45+
46+static struct platform_device dec_dz_device = {
47+ .name = "dz",
48+ .id = PLATFORM_DEVID_NONE,
49+ .resource = dec_dz_resources,
50+ .num_resources = ARRAY_SIZE(dec_dz_resources),
51+};
52+
53+static struct platform_device *dec_dz_devices[] __initdata = {
54+ &dec_dz_device,
55+};
56+
57+static struct resource dec_zs_resources[][2] = {
58+ {
59+ { .name = "scc0", .flags = IORESOURCE_MEM, },
60+ { .name = "scc0", .flags = IORESOURCE_IRQ, },
61+ },
62+ {
63+ { .name = "scc1", .flags = IORESOURCE_MEM, },
64+ { .name = "scc1", .flags = IORESOURCE_IRQ, },
65+ },
66+};
67+
68+static struct platform_device dec_zs_device[] = {
69+ {
70+ .name = "zs",
71+ .id = 0,
72+ .resource = dec_zs_resources[0],
73+ .num_resources = ARRAY_SIZE(dec_zs_resources[0]),
74+ },
75+ {
76+ .name = "zs",
77+ .id = 1,
78+ .resource = dec_zs_resources[1],
79+ .num_resources = ARRAY_SIZE(dec_zs_resources[1]),
80+ },
81+};
82+
3383 static int __init dec_add_devices(void)
3484 {
85+ struct platform_device *dec_zs_devices[ARRAY_SIZE(dec_zs_device)];
86+ int ret1, ret2, ret3;
87+ int num_dz, num_zs;
88+ int irq, i;
89+
3590 dec_rtc_resources[0].start = RTC_PORT(0);
3691 dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
37− return platform_device_register(&dec_rtc_device);
92+
93+ i = 0;
94+ irq = dec_interrupt[DEC_IRQ_DZ11];
95+ if (IS_ENABLED(CONFIG_32BIT) && irq >= 0) {
96+ resource_size_t base;
97+
98+ switch (mips_machtype) {
99+ case MACH_DS23100:
100+ case MACH_DS5100:
101+ base = dec_kn_slot_base + KN01_DZ11;
102+ break;
103+ default:
104+ base = dec_kn_slot_base + KN02_DZ11;
105+ break;
106+ }
107+ dec_dz_device.resource[0].start = base;
108+ dec_dz_device.resource[0].end = base + dec_kn_slot_size - 1;
109+ dec_dz_device.resource[1].start = irq;
110+ dec_dz_device.resource[1].end = irq;
111+ i++;
112+ }
113+ num_dz = i;
114+
115+ i = 0;
116+ irq = dec_interrupt[DEC_IRQ_SCC0];
117+ if (irq >= 0) {
118+ resource_size_t base = dec_kn_slot_base + IOASIC_SCC0;
119+
120+ dec_zs_device[i].resource[0].start = base;
121+ dec_zs_device[i].resource[0].end = base + dec_kn_slot_size - 1;
122+ dec_zs_device[i].resource[1].start = irq;
123+ dec_zs_device[i].resource[1].end = irq;
124+ dec_zs_devices[i] = &dec_zs_device[i];
125+ i++;
126+ }
127+ irq = dec_interrupt[DEC_IRQ_SCC1];
128+ if (irq >= 0) {
129+ resource_size_t base = dec_kn_slot_base + IOASIC_SCC1;
130+
131+ dec_zs_device[i].resource[0].start = base;
132+ dec_zs_device[i].resource[0].end = base + dec_kn_slot_size - 1;
133+ dec_zs_device[i].resource[1].start = irq;
134+ dec_zs_device[i].resource[1].end = irq;
135+ dec_zs_devices[i] = &dec_zs_device[i];
136+ i++;
137+ }
138+ num_zs = i;
139+
140+ ret1 = platform_device_register(&dec_rtc_device);
141+ ret2 = IS_ENABLED(CONFIG_32BIT) ?
142+ platform_add_devices(dec_dz_devices, num_dz) : 0;
143+ ret3 = platform_add_devices(dec_zs_devices, num_zs);
144+ return ret1 ? ret1 : ret2 ? ret2 : ret3;
38145 }
39146
40147 device_initcall(dec_add_devices);
arch/mips/include/asm/Kbuild+1−0
@@ -12,5 +12,6 @@ generic-y += mcs_spinlock.h · 11 unmodified lines
1212 generic-y += parport.h
1313 generic-y += qrwlock.h
1414 generic-y += qspinlock.h
15+generic-y += ring_buffer.h
1516 generic-y += user.h
1617 generic-y += text-patching.h
arch/nios2/include/asm/Kbuild+1−0
@@ -5,6 +5,7 @@ generic-y += cmpxchg.h · 4 unmodified lines
55 generic-y += extable.h
66 generic-y += kvm_para.h
77 generic-y += mcs_spinlock.h
8+generic-y += ring_buffer.h
89 generic-y += spinlock.h
910 generic-y += user.h
1011 generic-y += text-patching.h
arch/nios2/include/asm/linkage.h+2−0
@@ -12,4 +12,6 @@ · 11 unmodified lines
1212 #define __ALIGN .align 4
1313 #define __ALIGN_STR ".align 4"
1414
15+#define _THIS_IP_ ({ unsigned long __ip; asm volatile("nextpc %0" : "=r" (__ip)); __ip; })
16+
1517 #endif
arch/openrisc/include/asm/Kbuild+1−0
@@ -8,4 +8,5 @@ generic-y += spinlock_types.h · 7 unmodified lines
88 generic-y += spinlock.h
99 generic-y += qrwlock_types.h
1010 generic-y += qrwlock.h
11+generic-y += ring_buffer.h
1112 generic-y += user.h
arch/parisc/Makefile+11−5
@@ -174,15 +174,21 @@ ifeq ($(KBUILD_EXTMOD),) · 173 unmodified lines
174174 # this hack.
175175 prepare: vdso_prepare
176176 vdso_prepare: prepare0
177− $(if $(CONFIG_64BIT),$(Q)$(MAKE) \
178− $(build)=arch/parisc/kernel/vdso64 include/generated/vdso64-offsets.h)
179− $(if $(CONFIG_PA11)$(CONFIG_COMPAT),$(Q)$(MAKE) \
177+ifdef CONFIG_64BIT
178+ $(Q)$(MAKE) $(build)=arch/parisc/kernel/vdso64 include/generated/vdso64-offsets.h
179+ $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
180180 $(build)=arch/parisc/kernel/vdso32 include/generated/vdso32-offsets.h)
181+else
182+ $(Q)$(MAKE) $(build)=arch/parisc/kernel/vdso32 include/generated/vdso32-offsets.h
183+endif
181184 endif
182185
183−vdso-install-$(CONFIG_PA11) += arch/parisc/kernel/vdso32/vdso32.so
186+ifdef CONFIG_64BIT
187+vdso-install-y += arch/parisc/kernel/vdso64/vdso64.so
184188 vdso-install-$(CONFIG_COMPAT) += arch/parisc/kernel/vdso32/vdso32.so
185−vdso-install-$(CONFIG_64BIT) += arch/parisc/kernel/vdso64/vdso64.so
189+else
190+vdso-install-y += arch/parisc/kernel/vdso32/vdso32.so
191+endif
186192
187193 install: KBUILD_IMAGE := vmlinux
188194 zinstall: KBUILD_IMAGE := vmlinuz
arch/parisc/include/asm/Kbuild+1−0
@@ -4,4 +4,5 @@ generated-y += syscall_table_64.h · 3 unmodified lines
44 generic-y += agp.h
55 generic-y += kvm_para.h
66 generic-y += mcs_spinlock.h
7+generic-y += ring_buffer.h
78 generic-y += user.h
arch/parisc/include/asm/vdso.h+4−3
@@ -6,13 +6,14 @@ · 5 unmodified lines
66
77 #ifdef CONFIG_64BIT
88 #include <generated/vdso64-offsets.h>
9+#define VDSO64_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso64_offset_##name))
910 #endif
1011 #if !defined(CONFIG_64BIT) || defined(CONFIG_COMPAT)
1112 #include <generated/vdso32-offsets.h>
12−#endif
13−
14−#define VDSO64_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso64_offset_##name))
1513 #define VDSO32_SYMBOL(tsk, name) ((tsk)->mm->context.vdso_base + (vdso32_offset_##name))
14+#else
15+#define VDSO32_SYMBOL(tsk, name) 0UL
16+#endif
1617
1718 #endif /* __ASSEMBLER__ */
1819
arch/parisc/kernel/Makefile+5−2
@@ -46,6 +46,9 @@ obj-$(CONFIG_KEXEC_FILE) += kexec_file.o · 45 unmodified lines
4646
4747 # vdso
4848 obj-y += vdso.o
49−obj-$(CONFIG_64BIT) += vdso64/
50−obj-$(CONFIG_PA11) += vdso32/
49+ifdef CONFIG_64BIT
50+obj-y += vdso64/
5151 obj-$(CONFIG_COMPAT) += vdso32/
52+else
53+obj-y += vdso32/
54+endif
arch/parisc/kernel/drivers.c+10−11
@@ -41,9 +41,7 @@ · 40 unmodified lines
4141 const struct dma_map_ops *hppa_dma_ops __ro_after_init;
4242 EXPORT_SYMBOL(hppa_dma_ops);
4343
44−static struct device root = {
45− .init_name = "parisc",
46−};
44+static struct device *root;
4745
4846 static inline int check_dev(struct device *dev)
4947 {
@@ -89,7 +87,7 @@ static int for_each_padev(int (*fn)(struct device *, void *), void * data) · 39 unmodified lines
8987 .obj = data,
9088 .fn = fn,
9189 };
92− return device_for_each_child(&root, &recurse_data, descend_children);
90+ return device_for_each_child(root, &recurse_data, descend_children);
9391 }
9492
9593 /**
@@ -290,7 +288,7 @@ const struct parisc_device * · 194 unmodified lines
290288 find_pa_parent_type(const struct parisc_device *padev, int type)
291289 {
292290 const struct device *dev = &padev->dev;
293− while (dev != &root) {
291+ while (dev != root) {
294292 struct parisc_device *candidate = to_parisc_device(dev);
295293 if (candidate->id.hw_type == type)
296294 return candidate;
@@ -319,7 +317,7 @@ static void get_node_path(struct device *dev, struct hardware_path *path) · 22 unmodified lines
319317 dev = dev->parent;
320318 }
321319
322− while (dev != &root) {
320+ while (dev != root) {
323321 if (dev_is_pci(dev)) {
324322 unsigned int devfn = to_pci_dev(dev)->devfn;
325323 path->bc[i--] = PCI_SLOT(devfn) | (PCI_FUNC(devfn)<< 5);
@@ -482,7 +480,7 @@ static struct parisc_device * __init alloc_tree_node( · 156 unmodified lines
482480 static struct parisc_device *create_parisc_device(struct hardware_path *modpath)
483481 {
484482 int i;
485− struct device *parent = &root;
483+ struct device *parent = root;
486484 for (i = 0; i < 6; i++) {
487485 if (modpath->bc[i] == -1)
488486 continue;
@@ -755,7 +753,7 @@ parse_tree_node(struct device *parent, int index, struct hardware_path *modpath) · 266 unmodified lines
755753 struct device *hwpath_to_device(struct hardware_path *modpath)
756754 {
757755 int i;
758− struct device *parent = &root;
756+ struct device *parent = root;
759757 for (i = 0; i < 6; i++) {
760758 if (modpath->bc[i] == -1)
761759 continue;
@@ -880,7 +878,7 @@ void __init walk_central_bus(void) · 118 unmodified lines
880878 {
881879 walk_native_bus(CENTRAL_BUS_ADDR,
882880 CENTRAL_BUS_ADDR + (MAX_NATIVE_DEVICES * NATIVE_DEVICE_OFFSET),
883− &root);
881+ root);
884882 }
885883
886884 static __init void print_parisc_device(struct parisc_device *dev)
@@ -907,9 +905,10 @@ void __init init_parisc_bus(void) · 20 unmodified lines
907905 {
908906 if (bus_register(&parisc_bus_type))
909907 panic("Could not register PA-RISC bus type\n");
910− if (device_register(&root))
908+
909+ root = root_device_register("parisc");
910+ if (IS_ERR(root))
911911 panic("Could not register PA-RISC root device\n");
912− get_device(&root);
913912 }
914913
915914 static __init void qemu_header(void)
arch/powerpc/Kconfig.debug+1−2
@@ -83,11 +83,10 @@ config MSI_BITMAP_SELFTEST · 82 unmodified lines
8383 depends on DEBUG_KERNEL
8484
8585 config GUEST_STATE_BUFFER_TEST
86− def_tristate n
86+ def_tristate KUNIT_ALL_TESTS
8787 prompt "Enable Guest State Buffer unit tests"
8888 depends on KUNIT
8989 depends on KVM_BOOK3S_HV_POSSIBLE
90− default KUNIT_ALL_TESTS
9190 help
9291 The Guest State Buffer is a data format specified in the PAPR.
9392 It is by hcalls to communicate the state of L2 guests between
arch/powerpc/configs/amigaone_defconfig+0−1
@@ -76,7 +76,6 @@ CONFIG_SERIAL_8250_CONSOLE=y · 75 unmodified lines
7676 # CONFIG_HW_RANDOM is not set
7777 # CONFIG_HWMON is not set
7878 CONFIG_FB=y
79−CONFIG_FIRMWARE_EDID=y
8079 CONFIG_FB_TILEBLITTING=y
8180 CONFIG_FB_RADEON=y
8281 CONFIG_FB_3DFX=y
arch/powerpc/configs/chrp32_defconfig+0−1
@@ -76,7 +76,6 @@ CONFIG_SERIAL_8250_CONSOLE=y · 75 unmodified lines
7676 CONFIG_NVRAM=y
7777 # CONFIG_HWMON is not set
7878 CONFIG_FB=y
79−CONFIG_FIRMWARE_EDID=y
8079 CONFIG_FB_OF=y
8180 CONFIG_FB_MATROX=y
8281 CONFIG_FB_MATROX_MILLENIUM=y
arch/powerpc/configs/g5_defconfig+2−1
@@ -85,6 +85,8 @@ CONFIG_PMAC_SMU=y · 84 unmodified lines
8585 CONFIG_MAC_EMUMOUSEBTN=y
8686 CONFIG_WINDFARM=y
8787 CONFIG_WINDFARM_PM81=y
88+CONFIG_WINDFARM_PM72=y
89+CONFIG_WINDFARM_RM31=y
8890 CONFIG_WINDFARM_PM91=y
8991 CONFIG_WINDFARM_PM112=y
9092 CONFIG_WINDFARM_PM121=y
@@ -121,7 +123,6 @@ CONFIG_I2C_CHARDEV=y · 30 unmodified lines
121123 CONFIG_AGP=m
122124 CONFIG_AGP_UNINORTH=m
123125 CONFIG_FB=y
124−CONFIG_FIRMWARE_EDID=y
125126 CONFIG_FB_TILEBLITTING=y
126127 CONFIG_FB_OF=y
127128 CONFIG_FB_NVIDIA=y
arch/powerpc/configs/pasemi_defconfig+0−1
@@ -98,7 +98,6 @@ CONFIG_SENSORS_LM85=y · 97 unmodified lines
9898 CONFIG_SENSORS_LM90=y
9999 CONFIG_DRM=y
100100 CONFIG_DRM_RADEON=y
101−CONFIG_FIRMWARE_EDID=y
102101 CONFIG_FB_TILEBLITTING=y
103102 CONFIG_FB_VGA16=y
104103 CONFIG_FB_NVIDIA=y
arch/powerpc/configs/powernv_defconfig+0−1
@@ -196,7 +196,6 @@ CONFIG_I2C_CHARDEV=y · 195 unmodified lines
196196 # CONFIG_PTP_1588_CLOCK is not set
197197 CONFIG_DRM=y
198198 CONFIG_DRM_AST=y
199−CONFIG_FIRMWARE_EDID=y
200199 CONFIG_FB_OF=y
201200 CONFIG_FB_MATROX=m
202201 CONFIG_FB_MATROX_MILLENIUM=y
arch/powerpc/configs/ppc64_defconfig+0−1
@@ -249,7 +249,6 @@ CONFIG_I2C_CHARDEV=y · 248 unmodified lines
249249 CONFIG_I2C_AMD8111=y
250250 CONFIG_I2C_PASEMI=y
251251 CONFIG_FB=y
252−CONFIG_FIRMWARE_EDID=y
253252 CONFIG_FB_OF=y
254253 CONFIG_FB_MATROX=y
255254 CONFIG_FB_MATROX_MILLENIUM=y
arch/powerpc/configs/ppc64e_defconfig+0−1
@@ -118,7 +118,6 @@ CONFIG_SERIAL_8250_CONSOLE=y · 117 unmodified lines
118118 CONFIG_I2C_CHARDEV=y
119119 CONFIG_I2C_AMD8111=y
120120 CONFIG_FB=y
121−CONFIG_FIRMWARE_EDID=y
122121 CONFIG_FB_OF=y
123122 CONFIG_FB_MATROX=y
124123 CONFIG_FB_MATROX_MILLENIUM=y
arch/powerpc/configs/ppc6xx_defconfig+1−0
@@ -393,6 +393,7 @@ CONFIG_NETCONSOLE=m · 392 unmodified lines
393393 CONFIG_TUN=m
394394 CONFIG_VETH=m
395395 CONFIG_VIRTIO_NET=m
396+CONFIG_EL3=m
396397 CONFIG_VORTEX=m
397398 CONFIG_TYPHOON=m
398399 CONFIG_ADAPTEC_STARFIRE=m
arch/powerpc/configs/skiroot_defconfig+0−1
@@ -214,7 +214,6 @@ CONFIG_SENSORS_IBMPOWERNV=m · 213 unmodified lines
214214 CONFIG_DRM=m
215215 CONFIG_DRM_AST=m
216216 CONFIG_FB=y
217−CONFIG_FIRMWARE_EDID=y
218217 # CONFIG_VGA_CONSOLE is not set
219218 CONFIG_FRAMEBUFFER_CONSOLE=y
220219 CONFIG_LOGO=y
arch/powerpc/include/asm/Kbuild+1−0
@@ -5,4 +5,5 @@ generated-y += syscall_table_spu.h · 4 unmodified lines
55 generic-y += agp.h
66 generic-y += mcs_spinlock.h
77 generic-y += qrwlock.h
8+generic-y += ring_buffer.h
89 generic-y += early_ioremap.h
arch/powerpc/include/asm/pmac_low_i2c.h+0−4
@@ -79,10 +79,6 @@ extern int pmac_i2c_match_adapter(struct device_node *dev, · 78 unmodified lines
7979 struct i2c_adapter *adapter);
8080
8181
82−/* (legacy) Locking functions exposed to i2c-keywest */
83−extern int pmac_low_i2c_lock(struct device_node *np);
84−extern int pmac_low_i2c_unlock(struct device_node *np);
85−
8682 /* Access functions for platform code */
8783 extern int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled);
8884 extern void pmac_i2c_close(struct pmac_i2c_bus *bus);
arch/powerpc/kernel/time.c+4−2
@@ -458,6 +458,10 @@ DEFINE_PER_CPU(u8, irq_work_pending); · 457 unmodified lines
458458
459459 #endif /* 32 vs 64 bit */
460460
461+/*
462+ * Must be called with preemption disabled since it updates
463+ * per-CPU irq_work state and programs the local CPU decrementer.
464+ */
461465 void arch_irq_work_raise(void)
462466 {
463467 /*
@@ -471,10 +475,8 @@ void arch_irq_work_raise(void) · 7 unmodified lines
471475 * which could get tangled up if we're messing with the same state
472476 * here.
473477 */
474− preempt_disable();
475478 set_irq_work_pending_flag();
476479 set_dec(1);
477− preempt_enable();
478480 }
479481
480482 static void set_dec_or_work(u64 val)
arch/powerpc/kernel/vdso/Makefile+6−0
@@ -62,6 +62,12 @@ CC32FLAGSREMOVE += -fno-stack-clash-protection · 61 unmodified lines
6262 # 32-bit one. clang validates the values passed to these arguments during
6363 # parsing, even when -fno-stack-protector is passed afterwards.
6464 CC32FLAGSREMOVE += -mstack-protector-guard%
65+# ftrace is disabled for the vdso but arch/powerpc/Makefile adds this define to
66+# KBUILD_CPPFLAGS, which enables use of the 'patchable_function_entry'
67+# attribute in the 'inline' define via 'notrace'. This attribute is not
68+# supported for the powerpcle target, resulting in many instances of
69+# -Wunknown-attributes.
70+CC32FLAGSREMOVE += -DCC_USING_PATCHABLE_FUNCTION_ENTRY
6571 endif
6672 LD32FLAGS := -Wl,-soname=linux-vdso32.so.1
6773 AS32FLAGS := -D__VDSO32__
arch/powerpc/kexec/Makefile+1−1
@@ -16,4 +16,4 @@ GCOV_PROFILE_core_$(BITS).o := n · 15 unmodified lines
1616 KCOV_INSTRUMENT_core_$(BITS).o := n
1717 UBSAN_SANITIZE_core_$(BITS).o := n
1818 KASAN_SANITIZE_core.o := n
19−KASAN_SANITIZE_core_$(BITS) := n
19+KASAN_SANITIZE_core_$(BITS).o := n
arch/powerpc/lib/vmx-helper.c+8−1
@@ -52,7 +52,14 @@ int exit_vmx_usercopy(void) · 51 unmodified lines
5252 }
5353 EXPORT_SYMBOL(exit_vmx_usercopy);
5454
55−int enter_vmx_ops(void)
55+/*
56+ * Can be called from kexec copy_page() path with MMU off. The kexec
57+ * code sets preempt_count to HARDIRQ_OFFSET so we return early here.
58+ * Since in_interrupt() is always inline, __no_sanitize_address on this
59+ * function is sufficient to avoid KASAN shadow memory accesses in real
60+ * mode.
61+ */
62+int __no_sanitize_address enter_vmx_ops(void)
5663 {
5764 if (in_interrupt())
5865 return 0;
arch/powerpc/perf/core-book3s.c+3−2
@@ -2242,6 +2242,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val, · 2241 unmodified lines
22422242 const u64 last_period = event->hw.last_period;
22432243 s64 prev, delta, left;
22442244 int record = 0;
2245+ int mark_event = regs->dsisr & MMCRA_SAMPLE_ENABLE;
22452246
22462247 if (event->hw.state & PERF_HES_STOPPED) {
22472248 write_pmc(event->hw.idx, 0);
@@ -2304,9 +2305,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val, · 56 unmodified lines
23042305 * In ISA v3.0 and before values "0" and "7" are considered reserved.
23052306 * In ISA v3.1, value "7" has been used to indicate "larx/stcx".
23062307 * Drop the sample if "type" has reserved values for this field with a
2307− * ISA version check.
2308+ * ISA version check for marked events.
23082309 */
2309− if (event->attr.sample_type & PERF_SAMPLE_DATA_SRC &&
2310+ if (mark_event && event->attr.sample_type & PERF_SAMPLE_DATA_SRC &&
23102311 ppmu->get_mem_data_src) {
23112312 val = (regs->dar & SIER_TYPE_MASK) >> SIER_TYPE_SHIFT;
23122313 if (val == 0 || (val == 7 && !cpu_has_feature(CPU_FTR_ARCH_31))) {
arch/powerpc/perf/hv-gpci.c+16−8
@@ -210,7 +210,7 @@ static ssize_t processor_bus_topology_show(struct device *dev, struct device_att · 209 unmodified lines
210210 0, 0, buf, &n, arg);
211211
212212 if (!ret)
213− return n;
213+ goto out_success;
214214
215215 if (ret != H_PARAMETER)
216216 goto out;
@@ -244,12 +244,14 @@ static ssize_t processor_bus_topology_show(struct device *dev, struct device_att · 27 unmodified lines
244244 starting_index, 0, buf, &n, arg);
245245
246246 if (!ret)
247− return n;
247+ goto out_success;
248248
249249 if (ret != H_PARAMETER)
250250 goto out;
251251 }
252252
253+out_success:
254+ put_cpu_var(hv_gpci_reqb);
253255 return n;
254256
255257 out:
@@ -278,7 +280,7 @@ static ssize_t processor_config_show(struct device *dev, struct device_attribute · 22 unmodified lines
278280 0, 0, buf, &n, arg);
279281
280282 if (!ret)
281− return n;
283+ goto out_success;
282284
283285 if (ret != H_PARAMETER)
284286 goto out;
@@ -312,12 +314,14 @@ static ssize_t processor_config_show(struct device *dev, struct device_attribute · 27 unmodified lines
312314 starting_index, 0, buf, &n, arg);
313315
314316 if (!ret)
315− return n;
317+ goto out_success;
316318
317319 if (ret != H_PARAMETER)
318320 goto out;
319321 }
320322
323+out_success:
324+ put_cpu_var(hv_gpci_reqb);
321325 return n;
322326
323327 out:
@@ -346,7 +350,7 @@ static ssize_t affinity_domain_via_virtual_processor_show(struct device *dev, · 22 unmodified lines
346350 0, 0, buf, &n, arg);
347351
348352 if (!ret)
349− return n;
353+ goto out_success;
350354
351355 if (ret != H_PARAMETER)
352356 goto out;
@@ -382,12 +386,14 @@ static ssize_t affinity_domain_via_virtual_processor_show(struct device *dev, · 29 unmodified lines
382386 starting_index, secondary_index, buf, &n, arg);
383387
384388 if (!ret)
385− return n;
389+ goto out_success;
386390
387391 if (ret != H_PARAMETER)
388392 goto out;
389393 }
390394
395+out_success:
396+ put_cpu_var(hv_gpci_reqb);
391397 return n;
392398
393399 out:
@@ -416,7 +422,7 @@ static ssize_t affinity_domain_via_domain_show(struct device *dev, struct device · 22 unmodified lines
416422 0, 0, buf, &n, arg);
417423
418424 if (!ret)
419− return n;
425+ goto out_success;
420426
421427 if (ret != H_PARAMETER)
422428 goto out;
@@ -448,12 +454,14 @@ static ssize_t affinity_domain_via_domain_show(struct device *dev, struct device · 25 unmodified lines
448454 starting_index, 0, buf, &n, arg);
449455
450456 if (!ret)
451− return n;
457+ goto out_success;
452458
453459 if (ret != H_PARAMETER)
454460 goto out;
455461 }
456462
463+out_success:
464+ put_cpu_var(hv_gpci_reqb);
457465 return n;
458466
459467 out:
arch/powerpc/platforms/44x/warp.c+2−0
@@ -293,6 +293,8 @@ static int pika_dtm_thread(void __iomem *fpga) · 292 unmodified lines
293293 schedule_timeout(HZ);
294294 }
295295
296+ put_device(&client->dev);
297+
296298 return 0;
297299 }
298300
arch/powerpc/platforms/82xx/km82xx.c+2−2
@@ -27,8 +27,8 @@ · 26 unmodified lines
2727
2828 static void __init km82xx_pic_init(void)
2929 {
30− struct device_node *np __free(device_node);
31− np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
30+ struct device_node *np __free(device_node) = of_find_compatible_node(NULL,
31+ NULL, "fsl,pq2-pic");
3232
3333 if (!np) {
3434 pr_err("PIC init: can not find cpm-pic node\n");
arch/powerpc/platforms/8xx/cpm1.c+2−2
@@ -477,7 +477,7 @@ int cpm1_gpiochip_add16(struct device *dev) · 476 unmodified lines
477477 struct device_node *np = dev->of_node;
478478 struct cpm1_gpio16_chip *cpm1_gc;
479479 struct gpio_chip *gc;
480− u16 mask;
480+ u32 mask;
481481
482482 cpm1_gc = devm_kzalloc(dev, sizeof(*cpm1_gc), GFP_KERNEL);
483483 if (!cpm1_gc)
@@ -485,7 +485,7 @@ int cpm1_gpiochip_add16(struct device *dev) · 1 unmodified line
485485
486486 spin_lock_init(&cpm1_gc->lock);
487487
488− if (!of_property_read_u16(np, "fsl,cpm1-gpio-irq-mask", &mask)) {
488+ if (!of_property_read_u32(np, "fsl,cpm1-gpio-irq-mask", &mask)) {
489489 int i, j;
490490
491491 for (i = 0, j = 0; i < 16; i++)
arch/powerpc/platforms/pasemi/pci.c+1−2
@@ -272,13 +272,12 @@ void __init pas_pci_init(void) · 271 unmodified lines
272272 {
273273 struct device_node *root = of_find_node_by_path("/");
274274 struct device_node *np;
275− int res;
276275
277276 pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);
278277
279278 np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
280279 if (np) {
281− res = pas_add_bridge(np);
280+ pas_add_bridge(np);
282281 of_node_put(np);
283282 }
284283 of_node_put(root);
arch/powerpc/platforms/powermac/low_i2c.c+0−34
@@ -1058,40 +1058,6 @@ int pmac_i2c_match_adapter(struct device_node *dev, struct i2c_adapter *adapter) · 1057 unmodified lines
10581058 }
10591059 EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter);
10601060
1061−int pmac_low_i2c_lock(struct device_node *np)
1062−{
1063− struct pmac_i2c_bus *bus, *found = NULL;
1064−
1065− list_for_each_entry(bus, &pmac_i2c_busses, link) {
1066− if (np == bus->controller) {
1067− found = bus;
1068− break;
1069− }
1070− }
1071− if (!found)
1072− return -ENODEV;
1073− return pmac_i2c_open(bus, 0);
1074−}
1075−EXPORT_SYMBOL_GPL(pmac_low_i2c_lock);
1076−
1077−int pmac_low_i2c_unlock(struct device_node *np)
1078−{
1079− struct pmac_i2c_bus *bus, *found = NULL;
1080−
1081− list_for_each_entry(bus, &pmac_i2c_busses, link) {
1082− if (np == bus->controller) {
1083− found = bus;
1084− break;
1085− }
1086− }
1087− if (!found)
1088− return -ENODEV;
1089− pmac_i2c_close(bus);
1090− return 0;
1091−}
1092−EXPORT_SYMBOL_GPL(pmac_low_i2c_unlock);
1093−
1094−
10951061 int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled)
10961062 {
10971063 int rc;
arch/powerpc/platforms/ps3/device-init.c+1−3
@@ -950,8 +950,6 @@ static int __init ps3_start_probe_thread(enum ps3_bus_type bus_type) · 949 unmodified lines
950950
951951 static int __init ps3_register_devices(void)
952952 {
953− int result;
954−
955953 if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
956954 return -ENODEV;
957955
@@ -959,7 +957,7 @@ static int __init ps3_register_devices(void) · 1 unmodified line
959957
960958 /* ps3_repository_dump_bus_info(); */
961959
962− result = ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE);
960+ ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE);
963961
964962 ps3_register_vuart_devices();
965963
arch/powerpc/platforms/pseries/htmdump.c+116−17
@@ -16,6 +16,7 @@ static void *htm_buf; · 15 unmodified lines
1616 static void *htm_status_buf;
1717 static void *htm_info_buf;
1818 static void *htm_caps_buf;
19+static void *htm_mem_buf;
1920 static u32 nodeindex;
2021 static u32 nodalchipindex;
2122 static u32 coreindexonchip;
@@ -86,7 +87,7 @@ static ssize_t htm_return_check(long rc) · 64 unmodified lines
8687 static ssize_t htmdump_read(struct file *filp, char __user *ubuf,
8788 size_t count, loff_t *ppos)
8889 {
89− void *htm_buf = filp->private_data;
90+ void *htm_buf_data = filp->private_data;
9091 unsigned long page, read_size, available;
9192 loff_t offset;
9293 long rc, ret;
@@ -100,7 +101,7 @@ static ssize_t htmdump_read(struct file *filp, char __user *ubuf, · 7 unmodified lines
100101 * - last three values are address, size and offset
101102 */
102103 rc = htm_hcall_wrapper(htmflags, nodeindex, nodalchipindex, coreindexonchip,
103− htmtype, H_HTM_OP_DUMP_DATA, virt_to_phys(htm_buf),
104+ htmtype, H_HTM_OP_DUMP_DATA, virt_to_phys(htm_buf_data),
104105 PAGE_SIZE, page);
105106
106107 ret = htm_return_check(rc);
@@ -112,7 +113,61 @@ static ssize_t htmdump_read(struct file *filp, char __user *ubuf, · 5 unmodified lines
112113 available = PAGE_SIZE;
113114 read_size = min(count, available);
114115 *ppos += read_size;
115− return simple_read_from_buffer(ubuf, count, &offset, htm_buf, available);
116+ return simple_read_from_buffer(ubuf, count, &offset, htm_buf_data, available);
117+}
118+
119+static ssize_t htmsystem_mem_read(struct file *filp, char __user *ubuf,
120+ size_t count, loff_t *ppos)
121+{
122+ void *htm_mem_data = filp->private_data;
123+ long rc, ret;
124+ u64 *num_entries;
125+ u64 to_copy = 0;
126+ loff_t offset = 0;
127+ u64 mem_offset = 0;
128+
129+ /*
130+ * Invoke H_HTM call with:
131+ * - operation as htm status (H_HTM_OP_STATUS)
132+ * - last three values as addr, size and offset. "offset"
133+ * is value from output buffer header that points to next
134+ * entry to dump. 0 is the first entry to dump. next entry
135+ * is read from the output bufferbyte offset 0x8.
136+ *
137+ * When first time hcall is invoked, mem_offset should be
138+ * zero because zero is the first entry.
139+ * In the next hcall, offset of next entry to read from is
140+ * picked from output buffer header itself. So don't fill
141+ * mem_offset for first read.
142+ *
143+ * If there is no further data to read in next iteration,
144+ * offset value from output buffer header will point to -1.
145+ */
146+ if (*ppos) {
147+ mem_offset = *(u64 *)(htm_mem_data + 0x8);
148+ if (mem_offset == -1)
149+ return 0;
150+ }
151+ rc = htm_hcall_wrapper(htmflags, nodeindex, nodalchipindex, coreindexonchip,
152+ htmtype, H_HTM_OP_DUMP_SYSMEM_CONF, virt_to_phys(htm_mem_data),
153+ PAGE_SIZE, be64_to_cpu(mem_offset));
154+ ret = htm_return_check(rc);
155+ if (ret <= 0) {
156+ pr_debug("H_HTM hcall returned for op: H_HTM_OP_DUMP_SYSMEM_CONF with hcall returning %ld\n", ret);
157+ return ret;
158+ }
159+
160+ /*
161+ * HTM system mem buffer, start of buffer + 0x10 gives the
162+ * number of HTM entries in the buffer.
163+ * So total count to copy is:
164+ * 32 bytes (for first 5 fields) + (number of HTM entries * entry size)
165+ */
166+ num_entries = htm_mem_data + 0x10;
167+ to_copy = 32 + (be64_to_cpu(*num_entries) * 32);
168+
169+ *ppos += to_copy;
170+ return simple_read_from_buffer(ubuf, count, &offset, htm_mem_data, to_copy);
116171 }
117172
118173 static const struct file_operations htmdump_fops = {
@@ -121,6 +176,12 @@ static const struct file_operations htmdump_fops = { · 2 unmodified lines
121176 .open = simple_open,
122177 };
123178
179+static const struct file_operations htmsystem_mem_fops = {
180+ .llseek = NULL,
181+ .read = htmsystem_mem_read,
182+ .open = simple_open,
183+};
184+
124185 static int htmconfigure_set(void *data, u64 val)
125186 {
126187 long rc, ret;
@@ -226,20 +287,31 @@ static int htmstart_get(void *data, u64 *val) · 99 unmodified lines
226287 static ssize_t htmstatus_read(struct file *filp, char __user *ubuf,
227288 size_t count, loff_t *ppos)
228289 {
229− void *htm_status_buf = filp->private_data;
290+ void *htm_status_data = filp->private_data;
230291 long rc, ret;
231292 u64 *num_entries;
232293 u64 to_copy;
233294 int htmstatus_flag;
295+ loff_t offset = 0;
296+ u64 status_offset = 0;
234297
235298 /*
236299 * Invoke H_HTM call with:
237300 * - operation as htm status (H_HTM_OP_STATUS)
238− * - last three values as addr, size and offset
301+ * - last three values as addr, size and offset.
302+ * "offset" is value from output buffer header
303+ * that points to next entry to dump. 0 is the first
304+ * entry to dump. next entry is read from the output
305+ * bufferbyte offset 0x8.
239306 */
307+ if (*ppos) {
308+ status_offset = *(u64 *)(htm_status_data + 0x8);
309+ if (status_offset == -1)
310+ return 0;
311+ }
240312 rc = htm_hcall_wrapper(htmflags, nodeindex, nodalchipindex, coreindexonchip,
241− htmtype, H_HTM_OP_STATUS, virt_to_phys(htm_status_buf),
242− PAGE_SIZE, 0);
313+ htmtype, H_HTM_OP_STATUS, virt_to_phys(htm_status_data),
314+ PAGE_SIZE, be64_to_cpu(status_offset));
243315
244316 ret = htm_return_check(rc);
245317 if (ret <= 0) {
@@ -255,13 +327,15 @@ static ssize_t htmstatus_read(struct file *filp, char __user *ubuf, · 9 unmodified lines
255327 * So total count to copy is:
256328 * 32 bytes (for first 7 fields) + (number of HTM entries * entry size)
257329 */
258− num_entries = htm_status_buf + 0x10;
330+ num_entries = htm_status_data + 0x10;
259331 if (htmtype == 0x2)
260332 htmstatus_flag = 0x8;
261333 else
262334 htmstatus_flag = 0x6;
263335 to_copy = 32 + (be64_to_cpu(*num_entries) * htmstatus_flag);
264− return simple_read_from_buffer(ubuf, count, ppos, htm_status_buf, to_copy);
336+ *ppos += to_copy;
337+
338+ return simple_read_from_buffer(ubuf, count, &offset, htm_status_data, to_copy);
265339 }
266340
267341 static const struct file_operations htmstatus_fops = {
@@ -273,19 +347,30 @@ static const struct file_operations htmstatus_fops = { · 5 unmodified lines
273347 static ssize_t htminfo_read(struct file *filp, char __user *ubuf,
274348 size_t count, loff_t *ppos)
275349 {
276− void *htm_info_buf = filp->private_data;
350+ void *htm_info_data = filp->private_data;
277351 long rc, ret;
278352 u64 *num_entries;
279353 u64 to_copy;
354+ loff_t offset = 0;
355+ u64 info_offset = 0;
280356
281357 /*
282358 * Invoke H_HTM call with:
283359 * - operation as htm status (H_HTM_OP_STATUS)
284360 * - last three values as addr, size and offset
361+ * "offset" is value from output buffer header
362+ * that points to next entry to dump. 0 is the first
363+ * entry to dump. next entry is read from the output
364+ * bufferbyte offset 0x8.
285365 */
366+ if (*ppos) {
367+ info_offset = *(u64 *)(htm_info_data + 0x8);
368+ if (info_offset == -1)
369+ return 0;
370+ }
286371 rc = htm_hcall_wrapper(htmflags, nodeindex, nodalchipindex, coreindexonchip,
287− htmtype, H_HTM_OP_DUMP_SYSPROC_CONF, virt_to_phys(htm_info_buf),
288− PAGE_SIZE, 0);
372+ htmtype, H_HTM_OP_DUMP_SYSPROC_CONF, virt_to_phys(htm_info_data),
373+ PAGE_SIZE, be64_to_cpu(info_offset));
289374
290375 ret = htm_return_check(rc);
291376 if (ret <= 0) {
@@ -301,15 +386,17 @@ static ssize_t htminfo_read(struct file *filp, char __user *ubuf, · 9 unmodified lines
301386 * So total count to copy is:
302387 * 32 bytes (for first 5 fields) + (number of HTM entries * entry size)
303388 */
304− num_entries = htm_info_buf + 0x10;
389+ num_entries = htm_info_data + 0x10;
305390 to_copy = 32 + (be64_to_cpu(*num_entries) * 16);
306− return simple_read_from_buffer(ubuf, count, ppos, htm_info_buf, to_copy);
391+
392+ *ppos += to_copy;
393+ return simple_read_from_buffer(ubuf, count, &offset, htm_info_data, to_copy);
307394 }
308395
309396 static ssize_t htmcaps_read(struct file *filp, char __user *ubuf,
310397 size_t count, loff_t *ppos)
311398 {
312− void *htm_caps_buf = filp->private_data;
399+ void *htm_caps_data = filp->private_data;
313400 long rc, ret;
314401
315402 /*
@@ -319,7 +406,7 @@ static ssize_t htmcaps_read(struct file *filp, char __user *ubuf, · 3 unmodified lines
319406 * and zero
320407 */
321408 rc = htm_hcall_wrapper(htmflags, nodeindex, nodalchipindex, coreindexonchip,
322− htmtype, H_HTM_OP_CAPABILITIES, virt_to_phys(htm_caps_buf),
409+ htmtype, H_HTM_OP_CAPABILITIES, virt_to_phys(htm_caps_data),
323410 0x80, 0);
324411
325412 ret = htm_return_check(rc);
@@ -328,7 +415,7 @@ static ssize_t htmcaps_read(struct file *filp, char __user *ubuf, · 2 unmodified lines
328415 return ret;
329416 }
330417
331− return simple_read_from_buffer(ubuf, count, ppos, htm_caps_buf, 0x80);
418+ return simple_read_from_buffer(ubuf, count, ppos, htm_caps_data, 0x80);
332419 }
333420
334421 static const struct file_operations htminfo_fops = {
@@ -457,9 +544,17 @@ static int htmdump_init_debugfs(void) · 122 unmodified lines
457544 return -ENOMEM;
458545 }
459546
547+ /* Memory to present HTM system memory configuration */
548+ htm_mem_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
549+ if (!htm_mem_buf) {
550+ pr_err("Failed to allocate htm mem buf\n");
551+ return -ENOMEM;
552+ }
553+
460554 debugfs_create_file("htmstatus", 0400, htmdump_debugfs_dir, htm_status_buf, &htmstatus_fops);
461555 debugfs_create_file("htminfo", 0400, htmdump_debugfs_dir, htm_info_buf, &htminfo_fops);
462556 debugfs_create_file("htmcaps", 0400, htmdump_debugfs_dir, htm_caps_buf, &htmcaps_fops);
557+ debugfs_create_file("htmsystem_mem", 0400, htmdump_debugfs_dir, htm_mem_buf, &htmsystem_mem_fops);
463558
464559 return 0;
465560 }
@@ -482,6 +577,10 @@ static void __exit htmdump_exit(void) · 16 unmodified lines
482577 {
483578 debugfs_remove_recursive(htmdump_debugfs_dir);
484579 kfree(htm_buf);
580+ kfree(htm_status_buf);
581+ kfree(htm_info_buf);
582+ kfree(htm_caps_buf);
583+ kfree(htm_mem_buf);
485584 }
486585
487586 module_init(htmdump_init);
arch/powerpc/platforms/pseries/papr-hvpipe.c+97−84
@@ -190,33 +190,34 @@ static int hvpipe_rtas_recv_msg(char __user *buf, int size) · 189 unmodified lines
190190 return -ENOMEM;
191191 }
192192
193− ret = rtas_ibm_receive_hvpipe_msg(work_area, &srcID,
194− &bytes_written);
195− if (!ret) {
196− /*
197− * Recv HVPIPE RTAS is successful.
198− * When releasing FD or no one is waiting on the
199− * specific source, issue recv HVPIPE RTAS call
200− * so that pipe is not blocked - this func is called
201− * with NULL buf.
202− */
203− if (buf) {
204− if (size < bytes_written) {
205− pr_err("Received the payload size = %d, but the buffer size = %d\n",
206− bytes_written, size);
207− bytes_written = size;
208− }
209− ret = copy_to_user(buf,
210− rtas_work_area_raw_buf(work_area),
211− bytes_written);
212− if (!ret)
213− ret = bytes_written;
214− }
215− } else {
216− pr_err("ibm,receive-hvpipe-msg failed with %d\n",
217− ret);
193+ /*
194+ * Recv HVPIPE RTAS is successful.
195+ * When releasing FD or no one is waiting on the
196+ * specific source, issue recv HVPIPE RTAS call
197+ * so that pipe is not blocked - this func is called
198+ * with NULL buf.
199+ */
200+ ret = rtas_ibm_receive_hvpipe_msg(work_area, &srcID, &bytes_written);
201+ if (ret) {
202+ pr_err("ibm,receive-hvpipe-msg failed with %d\n", ret);
203+ goto out;
218204 }
219205
206+ if (!buf)
207+ goto out;
208+
209+ if (size < bytes_written) {
210+ pr_err("Received the payload size = %d, but the buffer size = %d\n",
211+ bytes_written, size);
212+ bytes_written = size;
213+ }
214+
215+ if (copy_to_user(buf, rtas_work_area_raw_buf(work_area), bytes_written))
216+ ret = -EFAULT;
217+ else
218+ ret = bytes_written;
219+
220+out:
220221 rtas_work_area_free(work_area);
221222 return ret;
222223 }
@@ -327,8 +328,8 @@ static ssize_t papr_hvpipe_handle_read(struct file *file, · 104 unmodified lines
327328 {
328329
329330 struct hvpipe_source_info *src_info = file->private_data;
330− struct papr_hvpipe_hdr hdr;
331− long ret;
331+ struct papr_hvpipe_hdr hdr = {};
332+ ssize_t ret = 0;
332333
333334 /*
334335 * Return -ENXIO during migration
@@ -376,7 +377,7 @@ static ssize_t papr_hvpipe_handle_read(struct file *file, · 41 unmodified lines
376377
377378 ret = copy_to_user(buf, &hdr, HVPIPE_HDR_LEN);
378379 if (ret)
379− return ret;
380+ return -EFAULT;
380381
381382 /*
382383 * Message event has payload, so get the payload with
@@ -385,19 +386,23 @@ static ssize_t papr_hvpipe_handle_read(struct file *file, · 2 unmodified lines
385386 if (hdr.flags & HVPIPE_MSG_AVAILABLE) {
386387 ret = hvpipe_rtas_recv_msg(buf + HVPIPE_HDR_LEN,
387388 size - HVPIPE_HDR_LEN);
388− if (ret > 0) {
389+ /*
390+ * Always clear MSG_AVAILABLE once the RTAS call has drained
391+ * the message, regardless of whether copy_to_user succeeded.
392+ */
393+ if (ret >= 0 || ret == -EFAULT)
389394 src_info->hvpipe_status &= ~HVPIPE_MSG_AVAILABLE;
390− ret += HVPIPE_HDR_LEN;
391− }
392395 } else if (hdr.flags & HVPIPE_LOST_CONNECTION) {
393396 /*
394397 * Hypervisor is closing the pipe for the specific
395398 * source. So notify user space.
396399 */
397400 src_info->hvpipe_status &= ~HVPIPE_LOST_CONNECTION;
398− ret = HVPIPE_HDR_LEN;
399401 }
400402
403+ if (ret >= 0)
404+ ret += HVPIPE_HDR_LEN;
405+
401406 return ret;
402407 }
403408
@@ -444,16 +449,18 @@ static int papr_hvpipe_handle_release(struct inode *inode, · 40 unmodified lines
444449 struct file *file)
445450 {
446451 struct hvpipe_source_info *src_info;
452+ unsigned long flags;
447453
448454 /*
449455 * Hold the lock, remove source from src_list, reset the
450456 * hvpipe status and release the lock to prevent any race
451457 * with message event IRQ.
452458 */
453− spin_lock(&hvpipe_src_list_lock);
459+ spin_lock_irqsave(&hvpipe_src_list_lock, flags);
454460 src_info = file->private_data;
455461 list_del(&src_info->list);
456462 file->private_data = NULL;
463+ spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
457464 /*
458465 * If the pipe for this specific source has any pending
459466 * payload, issue recv HVPIPE RTAS so that pipe will not
@@ -461,10 +468,8 @@ static int papr_hvpipe_handle_release(struct inode *inode, · 1 unmodified line
461468 */
462469 if (src_info->hvpipe_status & HVPIPE_MSG_AVAILABLE) {
463470 src_info->hvpipe_status = 0;
464− spin_unlock(&hvpipe_src_list_lock);
465471 hvpipe_rtas_recv_msg(NULL, 0);
466− } else
467− spin_unlock(&hvpipe_src_list_lock);
472+ }
468473
469474 kfree(src_info);
470475 return 0;
@@ -479,50 +484,53 @@ static const struct file_operations papr_hvpipe_handle_ops = { · 8 unmodified lines
479484
480485 static int papr_hvpipe_dev_create_handle(u32 srcID)
481486 {
482− struct hvpipe_source_info *src_info __free(kfree) = NULL;
483−
484− spin_lock(&hvpipe_src_list_lock);
485− /*
486− * Do not allow more than one process communicates with
487− * each source.
488− */
489− src_info = hvpipe_find_source(srcID);
490− if (src_info) {
491− spin_unlock(&hvpipe_src_list_lock);
492− pr_err("pid(%d) is already using the source(%d)\n",
493− src_info->tsk->pid, srcID);
494− return -EALREADY;
495− }
496− spin_unlock(&hvpipe_src_list_lock);
487+ struct hvpipe_source_info *src_info;
488+ int fd;
489+ unsigned long flags;
497490
498491 src_info = kzalloc_obj(*src_info, GFP_KERNEL_ACCOUNT);
499492 if (!src_info)
500493 return -ENOMEM;
501494
502495 src_info->srcID = srcID;
503− src_info->tsk = current;
504496 init_waitqueue_head(&src_info->recv_wqh);
505497
506− FD_PREPARE(fdf, O_RDONLY | O_CLOEXEC,
507− anon_inode_getfile("[papr-hvpipe]", &papr_hvpipe_handle_ops,
508− (void *)src_info, O_RDWR));
509− if (fdf.err)
510− return fdf.err;
511−
512− retain_and_null_ptr(src_info);
513− spin_lock(&hvpipe_src_list_lock);
514498 /*
515− * If two processes are executing ioctl() for the same
516− * source ID concurrently, prevent the second process to
517− * acquire FD.
499+ * Do not allow more than one process communicates with
500+ * each source.
518501 */
502+ spin_lock_irqsave(&hvpipe_src_list_lock, flags);
519503 if (hvpipe_find_source(srcID)) {
520− spin_unlock(&hvpipe_src_list_lock);
504+ spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
505+ pr_err("pid(%s:%d) could not get the source(%d)\n",
506+ current->comm, task_pid_nr(current), srcID);
507+ kfree(src_info);
521508 return -EALREADY;
522509 }
523510 list_add(&src_info->list, &hvpipe_src_list);
524− spin_unlock(&hvpipe_src_list_lock);
525− return fd_publish(fdf);
511+ spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
512+
513+ fd = FD_ADD(O_RDONLY | O_CLOEXEC,
514+ anon_inode_getfile("[papr-hvpipe]", &papr_hvpipe_handle_ops,
515+ (void *)src_info, O_RDWR));
516+ if (fd < 0) {
517+ spin_lock_irqsave(&hvpipe_src_list_lock, flags);
518+ list_del(&src_info->list);
519+ spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
520+ /*
521+ * if we fail to add FD, that means no userspace program is
522+ * polling. In that case if there is a msg pending because the
523+ * interrupt was fired after the src_info was added to the
524+ * global list, then let's consume it here, to unblock the
525+ * hvpipe
526+ */
527+ if (src_info->hvpipe_status & HVPIPE_MSG_AVAILABLE)
528+ hvpipe_rtas_recv_msg(NULL, 0);
529+ kfree(src_info);
530+ return fd;
531+ }
532+
533+ return fd;
526534 }
527535
528536 /*
@@ -685,20 +693,19 @@ static int __init enable_hvpipe_IRQ(void) · 156 unmodified lines
685693 struct device_node *np;
686694
687695 hvpipe_check_exception_token = rtas_function_token(RTAS_FN_CHECK_EXCEPTION);
688− if (hvpipe_check_exception_token == RTAS_UNKNOWN_SERVICE)
696+ if (hvpipe_check_exception_token == RTAS_UNKNOWN_SERVICE)
689697 return -ENODEV;
690698
691699 /* hvpipe events */
692700 np = of_find_node_by_path("/event-sources/ibm,hvpipe-msg-events");
693− if (np != NULL) {
694− request_event_sources_irqs(np, hvpipe_event_interrupt,
695− "HPIPE_EVENT");
696− of_node_put(np);
697− } else {
698− pr_err("Can not enable hvpipe event IRQ\n");
701+ if (!np) {
702+ pr_err("No device node found, could not enable hvpipe event IRQ\n");
699703 return -ENODEV;
700704 }
701705
706+ request_event_sources_irqs(np, hvpipe_event_interrupt, "HPIPE_EVENT");
707+ of_node_put(np);
708+
702709 return 0;
703710 }
704711
@@ -775,23 +782,29 @@ static int __init papr_hvpipe_init(void) · 70 unmodified lines
775782 }
776783
777784 ret = enable_hvpipe_IRQ();
778− if (!ret) {
779− ret = set_hvpipe_sys_param(1);
780− if (!ret)
781− ret = misc_register(&papr_hvpipe_dev);
782− }
785+ if (ret)
786+ goto out_wq;
783787
784− if (!ret) {
785− pr_info("hvpipe feature is enabled\n");
786− hvpipe_feature = true;
787− return 0;
788− }
788+ ret = misc_register(&papr_hvpipe_dev);
789+ if (ret)
790+ goto out_wq;
789791
790− pr_err("hvpipe feature is not enabled %d\n", ret);
792+ ret = set_hvpipe_sys_param(1);
793+ if (ret)
794+ goto out_misc;
795+
796+ pr_info("hvpipe feature is enabled\n");
797+ hvpipe_feature = true;
798+ return 0;
799+
800+out_misc:
801+ misc_deregister(&papr_hvpipe_dev);
802+out_wq:
791803 destroy_workqueue(papr_hvpipe_wq);
792804 out:
793805 kfree(papr_hvpipe_work);
794806 papr_hvpipe_work = NULL;
807+ pr_err("hvpipe feature is not enabled %d\n", ret);
795808 return ret;
796809 }
797810 machine_device_initcall(pseries, papr_hvpipe_init);
arch/powerpc/platforms/pseries/papr-hvpipe.h+0−1
@@ -21,7 +21,6 @@ struct hvpipe_source_info { · 20 unmodified lines
2121 u32 srcID;
2222 u32 hvpipe_status;
2323 wait_queue_head_t recv_wqh; /* wake up poll() waitq */
24− struct task_struct *tsk;
2524 };
2625
2726 /*
arch/riscv/Kconfig+22−0
@@ -937,6 +937,28 @@ config RISCV_VECTOR_MISALIGNED · 936 unmodified lines
937937 help
938938 Enable detecting support for vector misaligned loads and stores.
939939
940+config RISCV_SBI_FWFT_DELEGATE_MISALIGNED
941+ bool "Request firmware delegation of unaligned access exceptions"
942+ depends on RISCV_SBI
943+ depends on NONPORTABLE
944+ help
945+ Use SBI FWFT to request delegation of load address misaligned and
946+ store address misaligned exceptions, if possible, and prefer Linux
947+ kernel emulation of these accesses to firmware emulation.
948+
949+ Unfortunately, Linux's emulation is still incomplete. Namely, it
950+ currently does not handle vector instructions and KVM guest accesses.
951+ On platforms where these accesses would have been handled by firmware,
952+ enabling this causes unexpected kernel oopses, userspaces crashes and
953+ KVM guest crashes. If you are sure that these are not a problem for
954+ your platform, you can say Y here, which may improve performance.
955+
956+ Saying N here will not worsen emulation support for unaligned accesses
957+ even in the case where the firmware also has incomplete support. It
958+ simply keeps the firmware's emulation enabled.
959+
960+ If you don't know what to do here, say N.
961+
940962 choice
941963 prompt "Unaligned Accesses Support"
942964 default RISCV_PROBE_UNALIGNED_ACCESS
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi+0−10
@@ -101,16 +101,6 @@ · 100 unmodified lines
101101 status = "okay";
102102 };
103103
104−&i2c0 {
105− pinctrl-names = "default";
106− pinctrl-0 = <&i2c0_fabric>;
107−};
108−
109−&i2c1 {
110− pinctrl-names = "default";
111− pinctrl-0 = <&i2c1_mssio>;
112−};
113−
114104 &mmuart1 {
115105 pinctrl-names = "default";
116106 pinctrl-0 = <&uart1_fabric>;
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-prod.dts+10−0
@@ -14,6 +14,16 @@ · 13 unmodified lines
1414 "microchip,mpfs";
1515 };
1616
17+&i2c0 {
18+ pinctrl-names = "default";
19+ pinctrl-0 = <&i2c0_fabric>;
20+};
21+
22+&i2c1 {
23+ pinctrl-names = "default";
24+ pinctrl-0 = <&i2c1_mssio>;
25+};
26+
1727 &syscontroller {
1828 microchip,bitstream-flash = <&sys_ctrl_flash>;
1929 };
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts+19−0
@@ -11,3 +11,22 @@ · 10 unmodified lines
1111 "microchip,mpfs-icicle-kit",
1212 "microchip,mpfs";
1313 };
14+
15+&i2c0 {
16+ pinctrl-names = "default";
17+ pinctrl-0 = <&i2c0_fabric>;
18+};
19+
20+/*
21+ * Due to silicon errata, routing via MSS IOs doesn't work on ES devices.
22+ * Instead, i2c1, appearing on B1/C1, which are normally MSS IOs, is routed
23+ * via the fabric and back to B1/C1 via "fabric-test" functionality.
24+ * This is done silently by Libero, so the iomux0 setting for i2c1 has to
25+ * be fabric IO, despite tooling etc saying that MSS IOs are used.
26+ *
27+ * See Section 3.3 of https://ww1.microchip.com/downloads/aemDocuments/documents/FPGA/ProductDocuments/Errata/polarfiresoc/microsemi_polarfire_soc_fpga_egineering_samples_errata_er0219_v1.pdf
28+ */
29+&i2c1 {
30+ pinctrl-names = "default";
31+ pinctrl-0 = <&i2c1_fabric>;
32+};
arch/riscv/boot/dts/starfive/jh7110-common.dtsi+1−26
@@ -135,29 +135,6 @@ · 134 unmodified lines
135135 clock-frequency = <49152000>;
136136 };
137137
138−&camss {
139− assigned-clocks = <&ispcrg JH7110_ISPCLK_DOM4_APB_FUNC>,
140− <&ispcrg JH7110_ISPCLK_MIPI_RX0_PXL>;
141− assigned-clock-rates = <49500000>, <198000000>;
142−
143− ports {
144− #address-cells = <1>;
145− #size-cells = <0>;
146−
147− port@0 {
148− reg = <0>;
149− };
150−
151− port@1 {
152− reg = <1>;
153−
154− camss_from_csi2rx: endpoint {
155− remote-endpoint = <&csi2rx_to_camss>;
156− };
157− };
158− };
159−};
160−
161138 &csi2rx {
162139 assigned-clocks = <&ispcrg JH7110_ISPCLK_VIN_SYS>;
163140 assigned-clock-rates = <297000000>;
@@ -175,9 +152,7 @@ · 11 unmodified lines
175152 port@1 {
176153 reg = <1>;
177154
178− csi2rx_to_camss: endpoint {
179− remote-endpoint = <&camss_from_csi2rx>;
180− };
155+ /* remote CAMSS endpoint */
181156 };
182157 };
183158 };
arch/riscv/boot/dts/starfive/jh7110.dtsi+0−28
@@ -1199,34 +1199,6 @@ · 1198 unmodified lines
11991199 #phy-cells = <0>;
12001200 };
12011201
1202− camss: isp@19840000 {
1203− compatible = "starfive,jh7110-camss";
1204− reg = <0x0 0x19840000 0x0 0x10000>,
1205− <0x0 0x19870000 0x0 0x30000>;
1206− reg-names = "syscon", "isp";
1207− clocks = <&ispcrg JH7110_ISPCLK_DOM4_APB_FUNC>,
1208− <&ispcrg JH7110_ISPCLK_ISPV2_TOP_WRAPPER_C>,
1209− <&ispcrg JH7110_ISPCLK_DVP_INV>,
1210− <&ispcrg JH7110_ISPCLK_VIN_P_AXI_WR>,
1211− <&ispcrg JH7110_ISPCLK_MIPI_RX0_PXL>,
1212− <&syscrg JH7110_SYSCLK_ISP_TOP_CORE>,
1213− <&syscrg JH7110_SYSCLK_ISP_TOP_AXI>;
1214− clock-names = "apb_func", "wrapper_clk_c", "dvp_inv",
1215− "axiwr", "mipi_rx0_pxl", "ispcore_2x",
1216− "isp_axi";
1217− resets = <&ispcrg JH7110_ISPRST_ISPV2_TOP_WRAPPER_P>,
1218− <&ispcrg JH7110_ISPRST_ISPV2_TOP_WRAPPER_C>,
1219− <&ispcrg JH7110_ISPRST_VIN_P_AXI_RD>,
1220− <&ispcrg JH7110_ISPRST_VIN_P_AXI_WR>,
1221− <&syscrg JH7110_SYSRST_ISP_TOP>,
1222− <&syscrg JH7110_SYSRST_ISP_TOP_AXI>;
1223− reset-names = "wrapper_p", "wrapper_c", "axird",
1224− "axiwr", "isp_top_n", "isp_top_axi";
1225− power-domains = <&pwrc JH7110_PD_ISP>;
1226− interrupts = <92>, <87>, <90>, <88>;
1227− status = "disabled";
1228− };
1229−
12301202 voutcrg: clock-controller@295c0000 {
12311203 compatible = "starfive,jh7110-voutcrg";
12321204 reg = <0x0 0x295c0000 0x0 0x10000>;
arch/riscv/errata/mips/errata.c+1−1
@@ -57,7 +57,7 @@ void mips_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, · 56 unmodified lines
5757 }
5858
5959 tmp = (1U << alt->patch_id);
60− if (cpu_req_errata && tmp) {
60+ if (cpu_req_errata & tmp) {
6161 mutex_lock(&text_mutex);
6262 patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt),
6363 alt->alt_len);
arch/riscv/include/asm/Kbuild+1−0
@@ -14,5 +14,6 @@ generic-y += ticket_spinlock.h · 13 unmodified lines
1414 generic-y += qrwlock.h
1515 generic-y += qrwlock_types.h
1616 generic-y += qspinlock.h
17+generic-y += ring_buffer.h
1718 generic-y += user.h
1819 generic-y += vmlinux.lds.h
arch/riscv/include/asm/syscall_wrapper.h+4−0
@@ -32,6 +32,10 @@ asmlinkage long __riscv_sys_ni_syscall(const struct pt_regs *); · 31 unmodified lines
3232 __diag_push(); \
3333 __diag_ignore(GCC, 8, "-Wattribute-alias", \
3434 "Type aliasing is used to sanitize syscall arguments"); \
35+ __diag_ignore(clang, 23, "-Wunknown-warning-option", \
36+ "Avoid breaking versions without -Wattribute-alias"); \
37+ __diag_ignore(clang, 23, "-Wattribute-alias", \
38+ "Type aliasing is used to sanitize syscall arguments"); \
3539 static long __se_##prefix##name(ulong, ulong, ulong, ulong, ulong, ulong, \
3640 ulong) \
3741 __attribute__((alias(__stringify(___se_##prefix##name)))); \
arch/riscv/kernel/compat_signal.c+2−0
@@ -107,6 +107,8 @@ static long compat_restore_sigcontext(struct pt_regs *regs, · 106 unmodified lines
107107
108108 /* sc_regs is structured the same as the start of pt_regs */
109109 err = __copy_from_user(&cregs, &sc->sc_regs, sizeof(sc->sc_regs));
110+ if (unlikely(err))
111+ return err;
110112
111113 cregs_to_regs(&cregs, regs);
112114
arch/riscv/kernel/copy-unaligned.S+3−2
@@ -1,6 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 /* Copyright (C) 2023 Rivos Inc. */
33
4+#include <linux/cfi_types.h>
45 #include <linux/linkage.h>
56 #include <asm/asm.h>
67
@@ -9,7 +10,7 @@ · 2 unmodified lines
910 /* void __riscv_copy_words_unaligned(void *, const void *, size_t) */
1011 /* Performs a memcpy without aligning buffers, using word loads and stores. */
1112 /* Note: The size is truncated to a multiple of 8 * SZREG */
12−SYM_FUNC_START(__riscv_copy_words_unaligned)
13+SYM_TYPED_FUNC_START(__riscv_copy_words_unaligned)
1314 andi a4, a2, ~((8*SZREG)-1)
1415 beqz a4, 2f
1516 add a3, a1, a4
@@ -41,7 +42,7 @@ SYM_FUNC_END(__riscv_copy_words_unaligned) · 25 unmodified lines
4142 /* void __riscv_copy_bytes_unaligned(void *, const void *, size_t) */
4243 /* Performs a memcpy without aligning buffers, using only byte accesses. */
4344 /* Note: The size is truncated to a multiple of 8 */
44−SYM_FUNC_START(__riscv_copy_bytes_unaligned)
45+SYM_TYPED_FUNC_START(__riscv_copy_bytes_unaligned)
4546 andi a4, a2, ~(8-1)
4647 beqz a4, 2f
4748 add a3, a1, a4
arch/riscv/kernel/cpufeature.c+9−11
@@ -896,10 +896,8 @@ static void __init riscv_fill_hwcap_from_isa_string(unsigned long *isa2hwcap) · 895 unmodified lines
896896 * CPU cores with the ratified spec will contain non-zero
897897 * marchid.
898898 */
899− if (acpi_disabled && boot_vendorid == THEAD_VENDOR_ID && boot_archid == 0x0) {
900− this_hwcap &= ~isa2hwcap[RISCV_ISA_EXT_v];
899+ if (acpi_disabled && boot_vendorid == THEAD_VENDOR_ID && boot_archid == 0x0)
901900 clear_bit(RISCV_ISA_EXT_v, source_isa);
902− }
903901
904902 riscv_resolve_isa(source_isa, isainfo->isa, &this_hwcap, isa2hwcap);
905903
@@ -1104,16 +1102,16 @@ early_param("riscv_isa_fallback", riscv_isa_fallback_setup); · 198 unmodified lines
11041102 void __init riscv_fill_hwcap(void)
11051103 {
11061104 char print_str[NUM_ALPHA_EXTS + 1];
1107− unsigned long isa2hwcap[26] = {0};
1105+ unsigned long isa2hwcap[RISCV_ISA_EXT_BASE] = {0};
11081106 int i, j;
11091107
1110− isa2hwcap['i' - 'a'] = COMPAT_HWCAP_ISA_I;
1111− isa2hwcap['m' - 'a'] = COMPAT_HWCAP_ISA_M;
1112− isa2hwcap['a' - 'a'] = COMPAT_HWCAP_ISA_A;
1113− isa2hwcap['f' - 'a'] = COMPAT_HWCAP_ISA_F;
1114− isa2hwcap['d' - 'a'] = COMPAT_HWCAP_ISA_D;
1115− isa2hwcap['c' - 'a'] = COMPAT_HWCAP_ISA_C;
1116− isa2hwcap['v' - 'a'] = COMPAT_HWCAP_ISA_V;
1108+ isa2hwcap[RISCV_ISA_EXT_i] = COMPAT_HWCAP_ISA_I;
1109+ isa2hwcap[RISCV_ISA_EXT_m] = COMPAT_HWCAP_ISA_M;
1110+ isa2hwcap[RISCV_ISA_EXT_a] = COMPAT_HWCAP_ISA_A;
1111+ isa2hwcap[RISCV_ISA_EXT_f] = COMPAT_HWCAP_ISA_F;
1112+ isa2hwcap[RISCV_ISA_EXT_d] = COMPAT_HWCAP_ISA_D;
1113+ isa2hwcap[RISCV_ISA_EXT_c] = COMPAT_HWCAP_ISA_C;
1114+ isa2hwcap[RISCV_ISA_EXT_v] = COMPAT_HWCAP_ISA_V;
11171115
11181116 if (!acpi_disabled) {
11191117 riscv_fill_hwcap_from_isa_string(isa2hwcap);
arch/riscv/kernel/ptrace.c+2−2
@@ -577,8 +577,8 @@ static int compat_riscv_gpr_set(struct task_struct *target, · 576 unmodified lines
577577 struct compat_user_regs_struct cregs;
578578
579579 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &cregs, 0, -1);
580−
581− cregs_to_regs(&cregs, task_pt_regs(target));
580+ if (!ret)
581+ cregs_to_regs(&cregs, task_pt_regs(target));
582582
583583 return ret;
584584 }
arch/riscv/kernel/traps_misaligned.c+1−1
@@ -584,7 +584,7 @@ static int cpu_online_check_unaligned_access_emulated(unsigned int cpu) · 583 unmodified lines
584584
585585 static bool misaligned_traps_delegated;
586586
587−#ifdef CONFIG_RISCV_SBI
587+#if defined(CONFIG_RISCV_SBI_FWFT_DELEGATE_MISALIGNED)
588588
589589 static int cpu_online_sbi_unaligned_setup(unsigned int cpu)
590590 {
arch/riscv/kernel/usercfi.c+4−3
@@ -109,15 +109,16 @@ void set_indir_lp_lock(struct task_struct *task, bool lock) · 108 unmodified lines
109109 task->thread_info.user_cfi_state.ufcfi_locked = lock;
110110 }
111111 /*
112− * If size is 0, then to be compatible with regular stack we want it to be as big as
113− * regular stack. Else PAGE_ALIGN it and return back
112+ * The shadow stack only stores the return address and not any variables
113+ * this should be more than sufficient for most applications.
114+ * Else PAGE_ALIGN it and return back
114115 */
115116 static unsigned long calc_shstk_size(unsigned long size)
116117 {
117118 if (size)
118119 return PAGE_ALIGN(size);
119120
120− return PAGE_ALIGN(min_t(unsigned long long, rlimit(RLIMIT_STACK), SZ_4G));
121+ return PAGE_ALIGN(min(rlimit(RLIMIT_STACK) / 2, SZ_2G));
121122 }
122123
123124 /*
arch/riscv/kernel/vec-copy-unaligned.S+3−2
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright (C) 2024 Rivos Inc. */
33
44 #include <linux/args.h>
5+#include <linux/cfi_types.h>
56 #include <linux/linkage.h>
67 #include <asm/asm.h>
78
@@ -16,7 +17,7 @@ · 8 unmodified lines
1617 /* void __riscv_copy_vec_words_unaligned(void *, const void *, size_t) */
1718 /* Performs a memcpy without aligning buffers, using word loads and stores. */
1819 /* Note: The size is truncated to a multiple of WORD_EEW */
19−SYM_FUNC_START(__riscv_copy_vec_words_unaligned)
20+SYM_TYPED_FUNC_START(__riscv_copy_vec_words_unaligned)
2021 andi a4, a2, ~(WORD_EEW-1)
2122 beqz a4, 2f
2223 add a3, a1, a4
@@ -38,7 +39,7 @@ SYM_FUNC_END(__riscv_copy_vec_words_unaligned) · 15 unmodified lines
3839 /* void __riscv_copy_vec_bytes_unaligned(void *, const void *, size_t) */
3940 /* Performs a memcpy without aligning buffers, using only byte accesses. */
4041 /* Note: The size is truncated to a multiple of 8 */
41−SYM_FUNC_START(__riscv_copy_vec_bytes_unaligned)
42+SYM_TYPED_FUNC_START(__riscv_copy_vec_bytes_unaligned)
4243 andi a4, a2, ~(8-1)
4344 beqz a4, 2f
4445 add a3, a1, a4
arch/riscv/kvm/vcpu_insn.c+4−5
@@ -415,7 +415,6 @@ int kvm_riscv_vcpu_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run, · 414 unmodified lines
415415 shift = 8 * (sizeof(ulong) - len);
416416 } else if ((insn & INSN_MASK_LBU) == INSN_MATCH_LBU) {
417417 len = 1;
418− shift = 8 * (sizeof(ulong) - len);
419418 #ifdef CONFIG_64BIT
420419 } else if ((insn & INSN_MASK_LD) == INSN_MATCH_LD) {
421420 len = 8;
@@ -649,22 +648,22 @@ int kvm_riscv_vcpu_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run) · 227 unmodified lines
649648 case 1:
650649 data8 = *((u8 *)run->mmio.data);
651650 SET_RD(insn, &vcpu->arch.guest_context,
652− (ulong)data8 << shift >> shift);
651+ (long)((ulong)data8 << shift) >> shift);
653652 break;
654653 case 2:
655654 data16 = *((u16 *)run->mmio.data);
656655 SET_RD(insn, &vcpu->arch.guest_context,
657− (ulong)data16 << shift >> shift);
656+ (long)((ulong)data16 << shift) >> shift);
658657 break;
659658 case 4:
660659 data32 = *((u32 *)run->mmio.data);
661660 SET_RD(insn, &vcpu->arch.guest_context,
662− (ulong)data32 << shift >> shift);
661+ (long)((ulong)data32 << shift) >> shift);
663662 break;
664663 case 8:
665664 data64 = *((u64 *)run->mmio.data);
666665 SET_RD(insn, &vcpu->arch.guest_context,
667− (ulong)data64 << shift >> shift);
666+ (long)((ulong)data64 << shift) >> shift);
668667 break;
669668 default:
670669 return -EOPNOTSUPP;
arch/riscv/kvm/vcpu_pmu.c+8−4
@@ -453,8 +453,10 @@ int kvm_riscv_vcpu_pmu_snapshot_set_shmem(struct kvm_vcpu *vcpu, unsigned long s · 452 unmodified lines
453453 }
454454
455455 kvpmu->sdata = kzalloc(snapshot_area_size, GFP_ATOMIC);
456− if (!kvpmu->sdata)
457− return -ENOMEM;
456+ if (!kvpmu->sdata) {
457+ sbiret = SBI_ERR_FAILURE;
458+ goto out;
459+ }
458460
459461 /* No need to check writable slot explicitly as kvm_vcpu_write_guest does it internally */
460462 if (kvm_vcpu_write_guest(vcpu, saddr, kvpmu->sdata, snapshot_area_size)) {
@@ -499,8 +501,10 @@ int kvm_riscv_vcpu_pmu_event_info(struct kvm_vcpu *vcpu, unsigned long saddr_low · 38 unmodified lines
499501 }
500502
501503 einfo = kzalloc(shmem_size, GFP_KERNEL);
502− if (!einfo)
503− return -ENOMEM;
504+ if (!einfo) {
505+ ret = SBI_ERR_FAILURE;
506+ goto out;
507+ }
504508
505509 ret = kvm_vcpu_read_guest(vcpu, shmem, einfo, shmem_size);
506510 if (ret) {
arch/riscv/kvm/vcpu_sbi_sta.c+1−1
@@ -46,7 +46,7 @@ void kvm_riscv_vcpu_record_steal_time(struct kvm_vcpu *vcpu) · 45 unmodified lines
4646 gfn = shmem >> PAGE_SHIFT;
4747 hva = kvm_vcpu_gfn_to_hva(vcpu, gfn);
4848
49− if (WARN_ON(kvm_is_error_hva(hva))) {
49+ if (kvm_is_error_hva(hva)) {
5050 vcpu->arch.sta.shmem = INVALID_GPA;
5151 return;
5252 }
arch/riscv/kvm/vcpu_sbi_v01.c+2−0
@@ -55,6 +55,8 @@ static int kvm_sbi_ext_v01_handler(struct kvm_vcpu *vcpu, struct kvm_run *run, · 54 unmodified lines
5555
5656 for_each_set_bit(i, &hmask, BITS_PER_LONG) {
5757 rvcpu = kvm_get_vcpu_by_id(vcpu->kvm, i);
58+ if (!rvcpu)
59+ continue;
5860 ret = kvm_riscv_vcpu_set_interrupt(rvcpu, IRQ_VS_SOFT);
5961 if (ret < 0)
6062 break;
arch/riscv/mm/init.c+25−0
@@ -792,6 +792,27 @@ static void __init set_mmap_rnd_bits_max(void) · 791 unmodified lines
792792 mmap_rnd_bits_max = MMAP_VA_BITS - PAGE_SHIFT - 3;
793793 }
794794
795+static bool __init is_vaddr_valid(unsigned long va)
796+{
797+ unsigned long up = 0;
798+
799+ switch (satp_mode) {
800+ case SATP_MODE_39:
801+ up = 1UL << 38;
802+ break;
803+ case SATP_MODE_48:
804+ up = 1UL << 47;
805+ break;
806+ case SATP_MODE_57:
807+ up = 1UL << 56;
808+ break;
809+ default:
810+ return false;
811+ }
812+
813+ return (va < up) || (va >= (ULONG_MAX - up + 1));
814+}
815+
795816 /*
796817 * There is a simple way to determine if 4-level is supported by the
797818 * underlying hardware: establish 1:1 mapping in 4-level page table mode
@@ -833,6 +854,9 @@ static __init void set_satp_mode(uintptr_t dtb_pa) · 35 unmodified lines
833854 set_satp_mode_pmd + PMD_SIZE,
834855 PMD_SIZE, PAGE_KERNEL_EXEC);
835856 retry:
857+ if (!is_vaddr_valid(set_satp_mode_pmd))
858+ goto out;
859+
836860 create_pgd_mapping(early_pg_dir,
837861 set_satp_mode_pmd,
838862 pgtable_l5_enabled ?
@@ -855,6 +879,7 @@ retry: · 16 unmodified lines
855879 disable_pgtable_l4();
856880 }
857881
882+out:
858883 memset(early_pg_dir, 0, PAGE_SIZE);
859884 memset(early_p4d, 0, PAGE_SIZE);
860885 memset(early_pud, 0, PAGE_SIZE);
arch/s390/include/asm/Kbuild+1−0
@@ -7,3 +7,4 @@ generated-y += unistd_nr.h · 6 unmodified lines
77 generic-y += asm-offsets.h
88 generic-y += mcs_spinlock.h
99 generic-y += mmzone.h
10+generic-y += ring_buffer.h
arch/s390/kernel/debug.c+8−0
@@ -1414,6 +1414,9 @@ static inline char *debug_get_user_string(const char __user *user_buf, · 1413 unmodified lines
14141414 {
14151415 char *buffer;
14161416
1417+ if (!user_len)
1418+ return ERR_PTR(-EINVAL);
1419+
14171420 buffer = memdup_user_nul(user_buf, user_len);
14181421 if (IS_ERR(buffer))
14191422 return buffer;
@@ -1584,6 +1587,11 @@ static int debug_input_flush_fn(debug_info_t *id, struct debug_view *view, · 164 unmodified lines
15841587 char input_buf[1];
15851588 int rc = user_len;
15861589
1590+ if (!user_len) {
1591+ rc = -EINVAL;
1592+ goto out;
1593+ }
1594+
15871595 if (user_len > 0x10000)
15881596 user_len = 0x10000;
15891597 if (*offset != 0) {
arch/s390/kernel/perf_pai.c+21−10
@@ -186,6 +186,13 @@ static u64 pai_getctr(unsigned long *page, int nr, unsigned long offset) · 185 unmodified lines
186186 return page[nr];
187187 }
188188
189+static void pai_setctr(unsigned long *page, int nr, unsigned long offset, u64 v)
190+{
191+ if (offset)
192+ nr += offset / sizeof(*page);
193+ page[nr] = v;
194+}
195+
189196 /* Read the counter values. Return value from location in CMP. For base
190197 * event xxx_ALL sum up all events. Returns counter value.
191198 */
@@ -551,6 +558,8 @@ static void paicrypt_del(struct perf_event *event, int flags) · 359 unmodified lines
551558 /* Create raw data and save it in buffer. Calculate the delta for each
552559 * counter between this invocation and the last invocation.
553560 * Returns number of bytes copied.
561+ * After reading from PAI counter page, save the read value to the old
562+ * page to calculate PAI counter deltas.
554563 * Saves only entries with positive counter difference of the form
555564 * 2 bytes: Number of counter
556565 * 8 bytes: Value of counter
@@ -562,16 +571,22 @@ static size_t pai_copy(struct pai_userdata *userdata, unsigned long *page, · 5 unmodified lines
562571 int i, outidx = 0;
563572
564573 for (i = 1; i <= pp->num_avail; i++) {
565− u64 val = 0, val_old = 0;
574+ u64 val = 0, val_old = 0, val_k = 0, val_old_k = 0;
566575
567576 if (!exclude_kernel) {
568− val += pai_getctr(page, i, pp->kernel_offset);
569− val_old += pai_getctr(page_old, i, pp->kernel_offset);
577+ val_k = pai_getctr(page, i, pp->kernel_offset);
578+ val_old_k = pai_getctr(page_old, i, pp->kernel_offset);
579+ if (val_k != val_old_k)
580+ pai_setctr(page_old, i, pp->kernel_offset, val_k);
570581 }
571582 if (!exclude_user) {
572− val += pai_getctr(page, i, 0);
573− val_old += pai_getctr(page_old, i, 0);
583+ val = pai_getctr(page, i, 0);
584+ val_old = pai_getctr(page_old, i, 0);
585+ if (val != val_old)
586+ pai_setctr(page_old, i, 0, val);
574587 }
588+ val += val_k;
589+ val_old += val_old_k;
575590 if (val >= val_old)
576591 val -= val_old;
577592 else
@@ -602,8 +617,6 @@ static size_t pai_copy(struct pai_userdata *userdata, unsigned long *page, · 24 unmodified lines
602617 static int pai_push_sample(size_t rawsize, struct pai_map *cpump,
603618 struct perf_event *event)
604619 {
605− int idx = PAI_PMU_IDX(event);
606− struct pai_pmu *pp = &pai_pmu[idx];
607620 struct perf_sample_data data;
608621 struct perf_raw_record raw;
609622 struct pt_regs regs;
@@ -634,8 +647,6 @@ static int pai_push_sample(size_t rawsize, struct pai_map *cpump, · 24 unmodified lines
634647
635648 overflow = perf_event_overflow(event, &data, &regs);
636649 perf_event_update_userpage(event);
637− /* Save crypto counter lowcore page after reading event data. */
638− memcpy((void *)PAI_SAVE_AREA(event), cpump->area, pp->area_size);
639650 return overflow;
640651 }
641652
@@ -651,7 +662,7 @@ static void pai_have_sample(struct perf_event *event, struct pai_map *cpump) · 9 unmodified lines
651662 rawsize = pai_copy(cpump->save, cpump->area, pp,
652663 (unsigned long *)PAI_SAVE_AREA(event),
653664 event->attr.exclude_user,
654− event->attr.exclude_kernel);
665+ !pp->kernel_offset ? true : event->attr.exclude_kernel);
655666 if (rawsize) /* No incremented counters */
656667 pai_push_sample(rawsize, cpump, event);
657668 }
arch/s390/kernel/topology.c+7−3
@@ -192,17 +192,21 @@ static void tl_to_masks(struct sysinfo_15_1_x *info) · 191 unmodified lines
192192 end = (union topology_entry *)((unsigned long)info + info->length);
193193 while (tle < end) {
194194 switch (tle->nl) {
195+ /*
196+ * Adjust drawer_id, book_id, and socked_id so they match the
197+ * numbering scheme of e.g. the hardware management console.
198+ */
195199 case 3:
196200 drawer = drawer->next;
197− drawer->id = tle->container.id;
201+ drawer->id = tle->container.id - 1;
198202 break;
199203 case 2:
200204 book = book->next;
201− book->id = tle->container.id;
205+ book->id = tle->container.id - 1;
202206 break;
203207 case 1:
204208 socket = socket->next;
205− socket->id = tle->container.id;
209+ socket->id = tle->container.id - 1;
206210 break;
207211 case 0:
208212 add_cpus_to_mask(&tle->cpu, drawer, book, socket);
arch/s390/kvm/dat.c+1−0
@@ -267,6 +267,7 @@ static int dat_split_ste(struct kvm_s390_mmu_cache *mc, union pmd *pmdp, gfn_t g · 266 unmodified lines
267267 /* No need to take locks as the page table is not installed yet. */
268268 pgste_init.prefix_notif = old.s.fc1.prefix_notif;
269269 pgste_init.vsie_notif = old.s.fc1.vsie_notif;
270+ pgste_init.vsie_gmem = old.s.fc1.vsie_notif;
270271 pgste_init.pcl = uses_skeys && init.h.i;
271272 dat_init_pgstes(pt, pgste_init.val);
272273 } else {
arch/s390/kvm/dat.h+2−1
@@ -145,7 +145,8 @@ union pgste { · 144 unmodified lines
145145 unsigned long cmma_d : 1; /* Dirty flag for CMMA bits */
146146 unsigned long prefix_notif : 1; /* Guest prefix invalidation notification */
147147 unsigned long vsie_notif : 1; /* Referenced in a shadow table */
148− unsigned long : 5;
148+ unsigned long vsie_gmem : 1; /* Contains nested guest memory */
149+ unsigned long : 4;
149150 unsigned long : 8;
150151 };
151152 struct {
arch/s390/kvm/gaccess.c+1−0
@@ -1445,6 +1445,7 @@ static int _do_shadow_pte(struct gmap *sg, gpa_t raddr, union pte *ptep_h, union · 1444 unmodified lines
14451445 } else {
14461446 pgste = _gmap_ptep_xchg(sg->parent, ptep_h, newpte, pgste, f->gfn, false);
14471447 pgste.vsie_notif = 1;
1448+ pgste.vsie_gmem = 1;
14481449 }
14491450 pgste_set_unlock(ptep_h, pgste);
14501451 if (rc)
arch/s390/kvm/gmap.c+11−7
@@ -125,7 +125,7 @@ struct gmap *gmap_new_child(struct gmap *parent, gfn_t limit) · 124 unmodified lines
125125
126126 int gmap_set_limit(struct gmap *gmap, gfn_t limit)
127127 {
128− struct kvm_s390_mmu_cache *mc;
128+ struct kvm_s390_mmu_cache *mc __free(kvm_s390_mmu_cache) = NULL;
129129 int rc, type;
130130
131131 type = gmap_limit_to_type(limit);
@@ -142,7 +142,6 @@ int gmap_set_limit(struct gmap *gmap, gfn_t limit) · 10 unmodified lines
142142 rc = dat_set_asce_limit(mc, &gmap->asce, type);
143143 } while (rc == -ENOMEM);
144144
145− kvm_s390_free_mmu_cache(mc);
146145 return 0;
147146 }
148147
@@ -822,8 +821,8 @@ int gmap_ucas_translate(struct kvm_s390_mmu_cache *mc, struct gmap *gmap, gpa_t · 673 unmodified lines
822821
823822 int gmap_ucas_map(struct gmap *gmap, gfn_t p_gfn, gfn_t c_gfn, unsigned long count)
824823 {
825− struct kvm_s390_mmu_cache *mc;
826− int rc;
824+ struct kvm_s390_mmu_cache *mc __free(kvm_s390_mmu_cache) = NULL;
825+ int rc = 0;
827826
828827 mc = kvm_s390_new_mmu_cache();
829828 if (!mc)
@@ -1026,13 +1025,15 @@ int gmap_insert_rmap(struct gmap *sg, gfn_t p_gfn, gfn_t r_gfn, int level) · 196 unmodified lines
10261025 int gmap_protect_rmap(struct kvm_s390_mmu_cache *mc, struct gmap *sg, gfn_t p_gfn, gfn_t r_gfn,
10271026 kvm_pfn_t pfn, int level, bool wr)
10281027 {
1028+ unsigned long bitmask;
10291029 union crste *crstep;
10301030 union pgste pgste;
10311031 union pte *ptep;
10321032 union pte pte;
10331033 int flags, rc;
10341034
1035− KVM_BUG_ON(!is_shadow(sg), sg->kvm);
1035+ if (KVM_BUG_ON(!is_shadow(sg) || level <= TABLE_TYPE_PAGE_TABLE, sg->kvm))
1036+ return -EINVAL;
10361037 lockdep_assert_held(&sg->parent->children_lock);
10371038
10381039 flags = DAT_WALK_SPLIT_ALLOC | (uses_skeys(sg->parent) ? DAT_WALK_USES_SKEYS : 0);
@@ -1041,8 +1042,9 @@ int gmap_protect_rmap(struct kvm_s390_mmu_cache *mc, struct gmap *sg, gfn_t p_gf · 2 unmodified lines
10411042 if (rc)
10421043 return rc;
10431044 if (level <= TABLE_TYPE_REGION1) {
1045+ bitmask = -1UL << (8 + 11 * level);
10441046 scoped_guard(spinlock, &sg->host_to_rmap_lock)
1045− rc = gmap_insert_rmap(sg, p_gfn, r_gfn, level);
1047+ rc = gmap_insert_rmap(sg, p_gfn, r_gfn & bitmask, level);
10461048 }
10471049 if (rc)
10481050 return rc;
@@ -1143,8 +1145,10 @@ void _gmap_handle_vsie_unshadow_event(struct gmap *parent, gfn_t gfn) · 94 unmodified lines
11431145 }
11441146 scoped_guard(spinlock, &sg->host_to_rmap_lock)
11451147 head = radix_tree_delete(&sg->host_to_rmap, gfn);
1146− gmap_for_each_rmap_safe(rmap, rnext, head)
1148+ gmap_for_each_rmap_safe(rmap, rnext, head) {
11471149 gmap_unshadow_level(sg, rmap->r_gfn, rmap->level);
1150+ kfree(rmap);
1151+ }
11481152 }
11491153 }
11501154
arch/s390/kvm/gmap.h+58−3
@@ -167,6 +167,36 @@ static inline bool gmap_unmap_prefix(struct gmap *gmap, gfn_t gfn, gfn_t end) · 166 unmodified lines
167167 return _gmap_unmap_prefix(gmap, gfn, end, false);
168168 }
169169
170+/**
171+ * pte_needs_unshadow() -- Check if the pte operations triggers unshadowing.
172+ * @oldpte: the previous value for the guest pte.
173+ * @newpte: the new pte being set.
174+ * @pgste: the pgste for the pte entry.
175+ *
176+ * If the pgste.vsie_notif bit is not set, return false: the page is not
177+ * involved in vsie and thus should not trigger an unshadow operation.
178+ *
179+ * If the pgste.vsie_gmem bit is set, this pte represents shadowed guest
180+ * memory. The access rights on g3's memory should be synchronized with g1's
181+ * and g2's. Therefore unshadowing is triggered if the new and old pte
182+ * differ in protection, or if the new pte is invalid.
183+ *
184+ * If the pgste.vsie_gmem bit is not set, this pte maps the g2 dat tables
185+ * for g3. If the entry becomes writable or absent, it becomes impossible to
186+ * guarantee that the shadow mapping will match g2's mapping. In that case,
187+ * trigger an unshadow event.
188+ *
189+ * Return: true if an unshadow event should be triggered, otherwise false.
190+ */
191+static inline bool pte_needs_unshadow(union pte oldpte, union pte newpte, union pgste pgste)
192+{
193+ if (!pgste.vsie_notif)
194+ return false;
195+ if (pgste.vsie_gmem)
196+ return (oldpte.h.p != newpte.h.p) || newpte.h.i;
197+ return !newpte.h.p || !newpte.s.pr;
198+}
199+
170200 static inline union pgste _gmap_ptep_xchg(struct gmap *gmap, union pte *ptep, union pte newpte,
171201 union pgste pgste, gfn_t gfn, bool needs_lock)
172202 {
@@ -180,8 +210,9 @@ static inline union pgste _gmap_ptep_xchg(struct gmap *gmap, union pte *ptep, un · 7 unmodified lines
180210 pgste.prefix_notif = 0;
181211 gmap_unmap_prefix(gmap, gfn, gfn + 1);
182212 }
183− if (pgste.vsie_notif && (ptep->h.p != newpte.h.p || newpte.h.i)) {
213+ if (pte_needs_unshadow(*ptep, newpte, pgste)) {
184214 pgste.vsie_notif = 0;
215+ pgste.vsie_gmem = 0;
185216 if (needs_lock)
186217 gmap_handle_vsie_unshadow_event(gmap, gfn);
187218 else
@@ -189,6 +220,7 @@ static inline union pgste _gmap_ptep_xchg(struct gmap *gmap, union pte *ptep, un · 1 unmodified line
189220 }
190221 if (!ptep->s.d && newpte.s.d && !newpte.s.s)
191222 SetPageDirty(pfn_to_page(newpte.h.pfra));
223+ pgste.zero = 0;
192224 return __dat_ptep_xchg(ptep, pgste, newpte, gfn, gmap->asce, uses_skeys(gmap));
193225 }
194226
@@ -198,6 +230,30 @@ static inline union pgste gmap_ptep_xchg(struct gmap *gmap, union pte *ptep, uni · 3 unmodified lines
198230 return _gmap_ptep_xchg(gmap, ptep, newpte, pgste, gfn, true);
199231 }
200232
233+/**
234+ * crste_needs_unshadow() -- Check if the crste operations triggers unshadowing.
235+ * @oldcrste: the previous value for the crste.
236+ * @newcrste: the new value for the crste.
237+ *
238+ * If the old crste did not have the vsie_notif bit set, return false: the
239+ * page is not involved in vsie and thus should not trigger an unshadow
240+ * operation. Conversely, if the bit is set, it can only be g3 memory, since
241+ * dat tables are never mapped using large pages.
242+ *
243+ * Similar to the pgste.vsie_gmem case of pte_needs_unshadow(), if the
244+ * protection bit is changing or the new page is invalid, trigger an
245+ * unshadow event. Also trigger an unshadow event if the new crste does not
246+ * have the vsie_notif bit set.
247+ *
248+ * Return: true if an unshadow event should be triggered, otherwise false.
249+ */
250+static inline bool crste_needs_unshadow(union crste oldcrste, union crste newcrste)
251+{
252+ if (!oldcrste.s.fc1.vsie_notif)
253+ return false;
254+ return (newcrste.h.p != oldcrste.h.p) || newcrste.h.i || !newcrste.s.fc1.vsie_notif;
255+}
256+
201257 static inline bool __must_check _gmap_crstep_xchg_atomic(struct gmap *gmap, union crste *crstep,
202258 union crste oldcrste, union crste newcrste,
203259 gfn_t gfn, bool needs_lock)
@@ -216,8 +272,7 @@ static inline bool __must_check _gmap_crstep_xchg_atomic(struct gmap *gmap, unio · 12 unmodified lines
216272 newcrste.s.fc1.prefix_notif = 0;
217273 gmap_unmap_prefix(gmap, gfn, gfn + align);
218274 }
219− if (crste_leaf(oldcrste) && oldcrste.s.fc1.vsie_notif &&
220− (newcrste.h.p || newcrste.h.i || !newcrste.s.fc1.vsie_notif)) {
275+ if (crste_leaf(oldcrste) && crste_needs_unshadow(oldcrste, newcrste)) {
221276 newcrste.s.fc1.vsie_notif = 0;
222277 if (needs_lock)
223278 gmap_handle_vsie_unshadow_event(gmap, gfn);
arch/s390/kvm/interrupt.c+1−2
@@ -3310,8 +3310,7 @@ static void aen_host_forward(unsigned long si) · 3309 unmodified lines
33103310 struct zpci_gaite *gaite;
33113311 struct kvm *kvm;
33123312
3313− gaite = (struct zpci_gaite *)aift->gait +
3314− (si * sizeof(struct zpci_gaite));
3313+ gaite = aift->gait + si;
33153314 if (gaite->count == 0)
33163315 return;
33173316 if (gaite->aisb != 0)
arch/s390/kvm/pci.c+4−6
@@ -166,7 +166,7 @@ static int kvm_zpci_set_airq(struct zpci_dev *zdev) · 165 unmodified lines
166166 fib.fmt0.noi = airq_iv_end(zdev->aibv);
167167 fib.fmt0.aibv = virt_to_phys(zdev->aibv->vector);
168168 fib.fmt0.aibvo = 0;
169− fib.fmt0.aisb = virt_to_phys(aift->sbv->vector + (zdev->aisb / 64) * 8);
169+ fib.fmt0.aisb = virt_to_phys(aift->sbv->vector) + (zdev->aisb / 64) * 8;
170170 fib.fmt0.aisbo = zdev->aisb & 63;
171171 fib.gd = zdev->gisa;
172172
@@ -290,8 +290,7 @@ static int kvm_s390_pci_aif_enable(struct zpci_dev *zdev, struct zpci_fib *fib, · 117 unmodified lines
290290 phys_to_virt(fib->fmt0.aibv));
291291
292292 spin_lock_irq(&aift->gait_lock);
293− gaite = (struct zpci_gaite *)aift->gait + (zdev->aisb *
294− sizeof(struct zpci_gaite));
293+ gaite = aift->gait + zdev->aisb;
295294
296295 /* If assist not requested, host will get all alerts */
297296 if (assist)
@@ -309,7 +308,7 @@ static int kvm_s390_pci_aif_enable(struct zpci_dev *zdev, struct zpci_fib *fib, · 11 unmodified lines
309308
310309 /* Update guest FIB for re-issue */
311310 fib->fmt0.aisbo = zdev->aisb & 63;
312− fib->fmt0.aisb = virt_to_phys(aift->sbv->vector + (zdev->aisb / 64) * 8);
311+ fib->fmt0.aisb = virt_to_phys(aift->sbv->vector) + (zdev->aisb / 64) * 8;
313312 fib->fmt0.isc = gisc;
314313
315314 /* Save some guest fib values in the host for later use */
@@ -357,8 +356,7 @@ static int kvm_s390_pci_aif_disable(struct zpci_dev *zdev, bool force) · 41 unmodified lines
357356 if (zdev->kzdev->fib.fmt0.aibv == 0)
358357 goto out;
359358 spin_lock_irq(&aift->gait_lock);
360− gaite = (struct zpci_gaite *)aift->gait + (zdev->aisb *
361− sizeof(struct zpci_gaite));
359+ gaite = aift->gait + zdev->aisb;
362360 isc = gaite->gisc;
363361 gaite->count--;
364362 if (gaite->count == 0) {
arch/s390/mm/fault.c+1−1
@@ -438,7 +438,7 @@ void do_secure_storage_access(struct pt_regs *regs) · 437 unmodified lines
438438 panic("Unexpected PGM 0x3d with TEID bit 61=0");
439439 }
440440 if (is_kernel_fault(regs)) {
441− folio = phys_to_folio(addr);
441+ folio = virt_to_folio((void *)addr);
442442 if (unlikely(!folio_try_get(folio)))
443443 return;
444444 rc = uv_convert_from_secure(folio_to_phys(folio));
arch/sh/include/asm/Kbuild+1−0
@@ -3,4 +3,5 @@ generated-y += syscall_table.h · 2 unmodified lines
33 generic-y += kvm_para.h
44 generic-y += mcs_spinlock.h
55 generic-y += parport.h
6+generic-y += ring_buffer.h
67 generic-y += text-patching.h
arch/sh/include/asm/setup.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 /*
88 * This is set up by the setup-routine at boot-time
99 */
10−extern unsigned char *boot_params_page;
10+extern unsigned char boot_params_page[];
1111 #define PARAM boot_params_page
1212
1313 #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
arch/sparc/include/asm/Kbuild+1−0
@@ -4,4 +4,5 @@ generated-y += syscall_table_64.h · 3 unmodified lines
44 generic-y += agp.h
55 generic-y += kvm_para.h
66 generic-y += mcs_spinlock.h
7+generic-y += ring_buffer.h
78 generic-y += text-patching.h
arch/um/include/asm/Kbuild+1−0
@@ -17,6 +17,7 @@ generic-y += module.lds.h · 16 unmodified lines
1717 generic-y += parport.h
1818 generic-y += percpu.h
1919 generic-y += preempt.h
20+generic-y += ring_buffer.h
2021 generic-y += runtime-const.h
2122 generic-y += softirq_stack.h
2223 generic-y += switch_to.h
arch/x86/entry/Makefile+1−1
@@ -13,7 +13,7 @@ CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE) · 12 unmodified lines
1313 CFLAGS_syscall_32.o += -fno-stack-protector
1414 CFLAGS_syscall_64.o += -fno-stack-protector
1515
16−obj-y := entry.o entry_$(BITS).o syscall_$(BITS).o
16+obj-y := entry.o entry_$(BITS).o syscall_$(BITS).o common.o
1717
1818 obj-y += vdso/
1919 obj-y += vsyscall/
arch/x86/entry/common.c+61−0
@@ -0,0 +1,61 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#include <linux/entry-common.h>
4+#include <linux/kvm_types.h>
5+#include <linux/hrtimer_rearm.h>
6+#include <asm/fred.h>
7+#include <asm/desc.h>
8+
9+#if IS_ENABLED(CONFIG_KVM_INTEL)
10+/*
11+ * On VMX, NMIs and IRQs (as configured by KVM) are acknowledged by hardware as
12+ * part of the VM-Exit, i.e. the event itself is consumed as part the VM-Exit.
13+ * x86_entry_from_kvm() is invoked by KVM to effectively forward NMIs and IRQs
14+ * to the kernel for servicing. On SVM, a.k.a. AMD, the NMI/IRQ VM-Exit is
15+ * purely a signal that an NMI/IRQ is pending, i.e. the event that triggered
16+ * the VM-Exit is held pending until it's unblocked in the host.
17+ */
18+noinstr void x86_entry_from_kvm(unsigned int event_type, unsigned int vector)
19+{
20+ if (event_type == EVENT_TYPE_EXTINT) {
21+#ifdef CONFIG_X86_64
22+ /*
23+ * Use FRED dispatch, even when running IDT. The dispatch
24+ * tables are kept in sync between FRED and IDT, and the FRED
25+ * dispatch works well with CFI.
26+ */
27+ fred_entry_from_kvm(event_type, vector);
28+#else
29+ idt_entry_from_kvm(vector);
30+#endif
31+ /*
32+ * Strictly speaking, only the NMI path requires noinstr.
33+ */
34+ instrumentation_begin();
35+ /*
36+ * KVM/VMX will dispatch from IRQ-disabled but for a context
37+ * that will have IRQs-enabled. This confuses the entry code
38+ * and it will not have reprogrammed the timer. Do so now.
39+ */
40+ hrtimer_rearm_deferred();
41+ instrumentation_end();
42+
43+ return;
44+ }
45+
46+ WARN_ON_ONCE(event_type != EVENT_TYPE_NMI);
47+
48+#ifdef CONFIG_X86_64
49+ if (cpu_feature_enabled(X86_FEATURE_FRED))
50+ return fred_entry_from_kvm(event_type, vector);
51+#endif
52+
53+ /*
54+ * Notably, we must use IDT dispatch for NMI when running in IDT mode.
55+ * The FRED NMI context is significantly different and will not work
56+ * right (specifically FRED fixed the NMI recursion issue).
57+ */
58+ idt_do_nmi_irqoff();
59+}
60+EXPORT_SYMBOL_FOR_KVM(x86_entry_from_kvm);
61+#endif
arch/x86/entry/entry.S+48−0
@@ -75,3 +75,51 @@ THUNK warn_thunk_thunk, __warn_thunk · 74 unmodified lines
7575 #if defined(CONFIG_STACKPROTECTOR) && defined(CONFIG_SMP)
7676 EXPORT_SYMBOL(__ref_stack_chk_guard);
7777 #endif
78+
79+#if IS_ENABLED(CONFIG_KVM_INTEL)
80+.macro IDT_DO_EVENT_IRQOFF call_insn call_target
81+ /*
82+ * Unconditionally create a stack frame, getting the correct RSP on the
83+ * stack (for x86-64) would take two instructions anyways, and RBP can
84+ * be used to restore RSP to make objtool happy (see below).
85+ */
86+ push %_ASM_BP
87+ mov %_ASM_SP, %_ASM_BP
88+
89+#ifdef CONFIG_X86_64
90+ /*
91+ * Align RSP to a 16-byte boundary (to emulate CPU behavior) before
92+ * creating the synthetic interrupt stack frame for the IRQ/NMI.
93+ */
94+ and $-16, %rsp
95+ push $__KERNEL_DS
96+ push %rbp
97+#endif
98+ pushf
99+ push $__KERNEL_CS
100+ \call_insn \call_target
101+
102+ /*
103+ * "Restore" RSP from RBP, even though IRET has already unwound RSP to
104+ * the correct value. objtool doesn't know the callee will IRET and,
105+ * without the explicit restore, thinks the stack is getting walloped.
106+ * Using an unwind hint is problematic due to x86-64's dynamic alignment.
107+ */
108+ leave
109+ RET
110+.endm
111+
112+#ifndef CONFIG_X86_64
113+.pushsection .text, "ax"
114+SYM_FUNC_START(idt_do_interrupt_irqoff)
115+ IDT_DO_EVENT_IRQOFF CALL_NOSPEC _ASM_ARG1
116+SYM_FUNC_END(idt_do_interrupt_irqoff)
117+.popsection
118+#endif
119+
120+.pushsection .noinstr.text, "ax"
121+SYM_FUNC_START(idt_do_nmi_irqoff)
122+ IDT_DO_EVENT_IRQOFF call asm_exc_nmi_kvm_vmx
123+SYM_FUNC_END(idt_do_nmi_irqoff)
124+.popsection
125+#endif
arch/x86/entry/entry_64_fred.S+0−1
@@ -147,5 +147,4 @@ SYM_FUNC_START(asm_fred_entry_from_kvm) · 146 unmodified lines
147147 RET
148148
149149 SYM_FUNC_END(asm_fred_entry_from_kvm)
150−EXPORT_SYMBOL_FOR_KVM(asm_fred_entry_from_kvm);
151150 #endif
arch/x86/entry/vdso/vma.c+1−1
@@ -178,7 +178,7 @@ static int map_vdso(const struct vdso_image *image, unsigned long addr) · 177 unmodified lines
178178 if (IS_ERR(vma)) {
179179 ret = PTR_ERR(vma);
180180 do_munmap(mm, text_start, image->size, NULL);
181− do_munmap(mm, addr, image->size, NULL);
181+ do_munmap(mm, addr, VDSO_NR_PAGES * PAGE_SIZE, NULL);
182182 goto up_fail;
183183 }
184184
arch/x86/events/core.c+8−5
@@ -1294,13 +1294,16 @@ int x86_perf_rdpmc_index(struct perf_event *event) · 1293 unmodified lines
12941294 return event->hw.event_base_rdpmc;
12951295 }
12961296
1297−static inline int match_prev_assignment(struct hw_perf_event *hwc,
1297+static inline int match_prev_assignment(struct perf_event *event,
12981298 struct cpu_hw_events *cpuc,
12991299 int i)
13001300 {
1301+ struct hw_perf_event *hwc = &event->hw;
1302+
13011303 return hwc->idx == cpuc->assign[i] &&
1302− hwc->last_cpu == smp_processor_id() &&
1303− hwc->last_tag == cpuc->tags[i];
1304+ hwc->last_cpu == smp_processor_id() &&
1305+ hwc->last_tag == cpuc->tags[i] &&
1306+ !is_acr_event_group(event);
13041307 }
13051308
13061309 static void x86_pmu_start(struct perf_event *event, int flags);
@@ -1346,7 +1349,7 @@ static void x86_pmu_enable(struct pmu *pmu) · 39 unmodified lines
13461349 * - no other event has used the counter since
13471350 */
13481351 if (hwc->idx == -1 ||
1349− match_prev_assignment(hwc, cpuc, i))
1352+ match_prev_assignment(event, cpuc, i))
13501353 continue;
13511354
13521355 /*
@@ -1367,7 +1370,7 @@ static void x86_pmu_enable(struct pmu *pmu) · 14 unmodified lines
13671370 event = cpuc->event_list[i];
13681371 hwc = &event->hw;
13691372
1370− if (!match_prev_assignment(hwc, cpuc, i))
1373+ if (!match_prev_assignment(event, cpuc, i))
13711374 x86_assign_hw_event(event, cpuc, i);
13721375 else if (i < n_running)
13731376 continue;
arch/x86/events/intel/core.c+39−11
@@ -3118,11 +3118,11 @@ static void intel_pmu_enable_fixed(struct perf_event *event) · 3117 unmodified lines
31183118 intel_set_masks(event, idx);
31193119
31203120 /*
3121− * Enable IRQ generation (0x8), if not PEBS,
3122− * and enable ring-3 counting (0x2) and ring-0 counting (0x1)
3123− * if requested:
3121+ * Enable IRQ generation (0x8), if not PEBS or self-reloaded
3122+ * ACR event, and enable ring-3 counting (0x2) and ring-0
3123+ * counting (0x1) if requested:
31243124 */
3125− if (!event->attr.precise_ip)
3125+ if (!event->attr.precise_ip && !is_acr_self_reload_event(event))
31263126 bits |= INTEL_FIXED_0_ENABLE_PMI;
31273127 if (hwc->config & ARCH_PERFMON_EVENTSEL_USR)
31283128 bits |= INTEL_FIXED_0_USER;
@@ -3306,6 +3306,15 @@ static void intel_pmu_enable_event(struct perf_event *event) · 177 unmodified lines
33063306 intel_set_masks(event, idx);
33073307 static_call_cond(intel_pmu_enable_acr_event)(event);
33083308 static_call_cond(intel_pmu_enable_event_ext)(event);
3309+ /*
3310+ * For self-reloaded ACR event, don't enable PMI since
3311+ * HW won't set overflow bit in GLOBAL_STATUS. Otherwise,
3312+ * the PMI would be recognized as a suspicious NMI.
3313+ */
3314+ if (is_acr_self_reload_event(event))
3315+ hwc->config &= ~ARCH_PERFMON_EVENTSEL_INT;
3316+ else if (!event->attr.precise_ip)
3317+ hwc->config |= ARCH_PERFMON_EVENTSEL_INT;
33093318 __x86_pmu_enable_event(hwc, enable_mask);
33103319 break;
33113320 case INTEL_PMC_IDX_FIXED ... INTEL_PMC_IDX_FIXED_BTS - 1:
@@ -3332,23 +3341,41 @@ static void intel_pmu_enable_event(struct perf_event *event) · 20 unmodified lines
33323341 static void intel_pmu_acr_late_setup(struct cpu_hw_events *cpuc)
33333342 {
33343343 struct perf_event *event, *leader;
3335− int i, j, idx;
3344+ int i, j, k, bit, idx;
33363345
3346+ /*
3347+ * FIXME: ACR mask parsing relies on cpuc->event_list[] (active events only).
3348+ * Disabling an ACR event causes bit-shifting errors in the acr_mask of
3349+ * remaining group members. As ACR sampling requires all events to be active,
3350+ * this limitation is acceptable for now. Revisit if independent event toggling
3351+ * is required.
3352+ */
33373353 for (i = 0; i < cpuc->n_events; i++) {
33383354 leader = cpuc->event_list[i];
33393355 if (!is_acr_event_group(leader))
33403356 continue;
33413357
3342− /* The ACR events must be contiguous. */
3358+ /* Find the last event of the ACR group. */
33433359 for (j = i; j < cpuc->n_events; j++) {
33443360 event = cpuc->event_list[j];
33453361 if (event->group_leader != leader->group_leader)
33463362 break;
3347− for_each_set_bit(idx, (unsigned long *)&event->attr.config2, X86_PMC_IDX_MAX) {
3348− if (i + idx >= cpuc->n_events ||
3349− !is_acr_event_group(cpuc->event_list[i + idx]))
3350− return;
3351− __set_bit(cpuc->assign[i + idx], (unsigned long *)&event->hw.config1);
3363+ }
3364+
3365+ /*
3366+ * Translate the user-space ACR mask (attr.config2) into the physical
3367+ * counter bitmask (hw.config1) for each ACR event in the group.
3368+ * NOTE: ACR event contiguity is guaranteed by intel_pmu_hw_config().
3369+ */
3370+ for (k = i; k < j; k++) {
3371+ event = cpuc->event_list[k];
3372+ event->hw.config1 = 0;
3373+ for_each_set_bit(bit, (unsigned long *)&event->attr.config2, X86_PMC_IDX_MAX) {
3374+ idx = i + bit;
3375+ /* Event index of ACR group must locate in [i, j). */
3376+ if (idx >= j || !is_acr_event_group(cpuc->event_list[idx]))
3377+ continue;
3378+ __set_bit(cpuc->assign[idx], (unsigned long *)&event->hw.config1);
33523379 }
33533380 }
33543381 i = j - 1;
@@ -7504,6 +7531,7 @@ static __always_inline void intel_pmu_init_pnc(struct pmu *pmu) · 4149 unmodified lines
75047531 hybrid(pmu, event_constraints) = intel_pnc_event_constraints;
75057532 hybrid(pmu, pebs_constraints) = intel_pnc_pebs_event_constraints;
75067533 hybrid(pmu, extra_regs) = intel_pnc_extra_regs;
7534+ static_call_update(intel_pmu_enable_acr_event, intel_pmu_enable_acr);
75077535 }
75087536
75097537 static __always_inline void intel_pmu_init_skt(struct pmu *pmu)
arch/x86/events/perf_event.h+10−0
@@ -137,6 +137,16 @@ static inline bool is_acr_event_group(struct perf_event *event) · 136 unmodified lines
137137 return check_leader_group(event->group_leader, PERF_X86_EVENT_ACR);
138138 }
139139
140+static inline bool is_acr_self_reload_event(struct perf_event *event)
141+{
142+ struct hw_perf_event *hwc = &event->hw;
143+
144+ if (hwc->idx < 0)
145+ return false;
146+
147+ return test_bit(hwc->idx, (unsigned long *)&hwc->config1);
148+}
149+
140150 struct amd_nb {
141151 int nb_id; /* NorthBridge id */
142152 int refcnt; /* reference count */
arch/x86/include/asm/Kbuild+1−0
@@ -14,3 +14,4 @@ generic-y += early_ioremap.h · 13 unmodified lines
1414 generic-y += fprobe.h
1515 generic-y += mcs_spinlock.h
1616 generic-y += mmzone.h
17+generic-y += ring_buffer.h
arch/x86/include/asm/desc.h+4−0
@@ -438,6 +438,10 @@ extern void idt_setup_traps(void); · 437 unmodified lines
438438 extern void idt_setup_apic_and_irq_gates(void);
439439 extern bool idt_is_f00f_address(unsigned long address);
440440
441+extern void idt_do_interrupt_irqoff(unsigned long address);
442+extern void idt_do_nmi_irqoff(void);
443+extern void idt_entry_from_kvm(unsigned int vector);
444+
441445 #ifdef CONFIG_X86_64
442446 extern void idt_setup_early_pf(void);
443447 #else
arch/x86/include/asm/desc_defs.h+1−1
@@ -145,7 +145,7 @@ struct gate_struct { · 144 unmodified lines
145145 typedef struct gate_struct gate_desc;
146146
147147 #ifndef _SETUP
148−static inline unsigned long gate_offset(const gate_desc *g)
148+static __always_inline unsigned long gate_offset(const gate_desc *g)
149149 {
150150 #ifdef CONFIG_X86_64
151151 return g->offset_low | ((unsigned long)g->offset_middle << 16) |
arch/x86/include/asm/efi.h+2−1
@@ -137,7 +137,8 @@ extern void __init efi_dump_pagetable(void); · 136 unmodified lines
137137 extern void __init efi_apply_memmap_quirks(void);
138138 extern int __init efi_reuse_config(u64 tables, int nr_tables);
139139 extern void efi_delete_dummy_variable(void);
140−extern void efi_crash_gracefully_on_page_fault(unsigned long phys_addr);
140+extern void efi_crash_gracefully_on_page_fault(unsigned long phys_addr,
141+ const struct pt_regs *regs);
141142 extern void efi_unmap_boot_services(void);
142143
143144 void arch_efi_call_virt_setup(void);
arch/x86/include/asm/entry-common.h+2−0
@@ -97,4 +97,6 @@ static __always_inline void arch_exit_to_user_mode(void) · 96 unmodified lines
9797 }
9898 #define arch_exit_to_user_mode arch_exit_to_user_mode
9999
100+extern void x86_entry_from_kvm(unsigned int entry_type, unsigned int vector);
101+
100102 #endif
arch/x86/include/asm/fred.h+0−1
@@ -110,7 +110,6 @@ static __always_inline unsigned long fred_event_data(struct pt_regs *regs) { ret · 109 unmodified lines
110110 static inline void cpu_init_fred_exceptions(void) { }
111111 static inline void cpu_init_fred_rsps(void) { }
112112 static inline void fred_complete_exception_setup(void) { }
113−static inline void fred_entry_from_kvm(unsigned int type, unsigned int vector) { }
114113 static inline void fred_sync_rsp0(unsigned long rsp0) { }
115114 static inline void fred_update_rsp0(void) { }
116115 #endif /* CONFIG_X86_FRED */
arch/x86/include/asm/kvm_host.h+1−0
@@ -1504,6 +1504,7 @@ struct kvm_arch { · 1503 unmodified lines
15041504 bool use_master_clock;
15051505 u64 master_kernel_ns;
15061506 u64 master_cycle_now;
1507+ struct ratelimit_state kvmclock_update_rs;
15071508
15081509 #ifdef CONFIG_KVM_HYPERV
15091510 struct kvm_hv hyperv;
arch/x86/include/asm/msr-index.h+2−1
@@ -803,9 +803,10 @@ · 802 unmodified lines
803803 #define MSR_AMD64_LBR_SELECT 0xc000010e
804804
805805 /* Zen4 */
806−#define MSR_ZEN4_BP_CFG 0xc001102e
806+#define MSR_ZEN4_BP_CFG 0xc001102e
807807 #define MSR_ZEN4_BP_CFG_BP_SPEC_REDUCE_BIT 4
808808 #define MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT 5
809+#define MSR_ZEN2_BP_CFG_BUG_FIX_BIT 33
809810
810811 /* Fam 19h MSRs */
811812 #define MSR_F19H_UMC_PERF_CTL 0xc0010800
arch/x86/include/asm/processor.h+1−0
@@ -733,6 +733,7 @@ bool xen_set_default_idle(void); · 732 unmodified lines
733733 #endif
734734
735735 void __noreturn stop_this_cpu(void *dummy);
736+extern bool x86_hypervisor_present;
736737 void microcode_check(struct cpuinfo_x86 *prev_info);
737738 void store_cpu_caps(struct cpuinfo_x86 *info);
738739
arch/x86/kernel/acpi/cppc.c+3−3
@@ -88,19 +88,19 @@ static void amd_set_max_freq_ratio(void) · 87 unmodified lines
8888
8989 rc = cppc_get_perf_caps(0, &perf_caps);
9090 if (rc) {
91− pr_warn("Could not retrieve perf counters (%d)\n", rc);
91+ pr_debug("Could not retrieve perf counters (%d)\n", rc);
9292 return;
9393 }
9494
9595 rc = amd_get_boost_ratio_numerator(0, &numerator);
9696 if (rc) {
97− pr_warn("Could not retrieve highest performance (%d)\n", rc);
97+ pr_debug("Could not retrieve highest performance (%d)\n", rc);
9898 return;
9999 }
100100 nominal_perf = perf_caps.nominal_perf;
101101
102102 if (!nominal_perf) {
103− pr_warn("Could not retrieve nominal performance\n");
103+ pr_debug("Could not retrieve nominal performance\n");
104104 return;
105105 }
106106
arch/x86/kernel/cpu/amd.c+3−0
@@ -989,6 +989,9 @@ static void init_amd_zen2(struct cpuinfo_x86 *c) · 988 unmodified lines
989989
990990 /* Correct misconfigured CPUID on some clients. */
991991 clear_cpu_cap(c, X86_FEATURE_INVLPGB);
992+
993+ if (!cpu_has(c, X86_FEATURE_HYPERVISOR))
994+ msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN2_BP_CFG_BUG_FIX_BIT);
992995 }
993996
994997 static void init_amd_zen3(struct cpuinfo_x86 *c)
arch/x86/kernel/cpu/cpuid-deps.c+1−0
@@ -92,6 +92,7 @@ static const struct cpuid_dep cpuid_deps[] = { · 91 unmodified lines
9292 { X86_FEATURE_FRED, X86_FEATURE_LKGS },
9393 { X86_FEATURE_SPEC_CTRL_SSBD, X86_FEATURE_SPEC_CTRL },
9494 { X86_FEATURE_LASS, X86_FEATURE_SMAP },
95+ { X86_FEATURE_INVLPGB, X86_FEATURE_PCID },
9596 {}
9697 };
9798
arch/x86/kernel/cpu/mce/core.c+5−28
@@ -90,7 +90,6 @@ struct mca_config mca_cfg __read_mostly = { · 89 unmodified lines
9090 };
9191
9292 static DEFINE_PER_CPU(struct mce_hw_err, hw_errs_seen);
93−static unsigned long mce_need_notify;
9493
9594 /*
9695 * MCA banks polled by the period polling timer for corrected events.
@@ -152,8 +151,10 @@ EXPORT_PER_CPU_SYMBOL_GPL(injectm); · 55 unmodified lines
152151
153152 void mce_log(struct mce_hw_err *err)
154153 {
155− if (mce_gen_pool_add(err))
154+ if (mce_gen_pool_add(err)) {
155+ pr_info(HW_ERR "Machine check events logged\n");
156156 irq_work_queue(&mce_irq_work);
157+ }
157158 }
158159 EXPORT_SYMBOL_GPL(mce_log);
159160
@@ -585,28 +586,6 @@ bool mce_is_correctable(struct mce *m) · 425 unmodified lines
585586 }
586587 EXPORT_SYMBOL_GPL(mce_is_correctable);
587588
588−/*
589− * Notify the user(s) about new machine check events.
590− * Can be called from interrupt context, but not from machine check/NMI
591− * context.
592− */
593−static bool mce_notify_irq(void)
594−{
595− /* Not more than two messages every minute */
596− static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
597−
598− if (test_and_clear_bit(0, &mce_need_notify)) {
599− mce_work_trigger();
600−
601− if (__ratelimit(&ratelimit))
602− pr_info(HW_ERR "Machine check events logged\n");
603−
604− return true;
605− }
606−
607− return false;
608−}
609−
610589 static int mce_early_notifier(struct notifier_block *nb, unsigned long val,
611590 void *data)
612591 {
@@ -618,9 +597,7 @@ static int mce_early_notifier(struct notifier_block *nb, unsigned long val, · 5 unmodified lines
618597 /* Emit the trace record: */
619598 trace_mce_record(err);
620599
621− set_bit(0, &mce_need_notify);
622−
623− mce_notify_irq();
600+ mce_work_trigger();
624601
625602 return NOTIFY_DONE;
626603 }
@@ -1804,7 +1781,7 @@ static void mce_timer_fn(struct timer_list *t) · 1177 unmodified lines
18041781 * Alert userspace if needed. If we logged an MCE, reduce the polling
18051782 * interval, otherwise increase the polling interval.
18061783 */
1807− if (mce_notify_irq())
1784+ if (!mce_gen_pool_empty())
18081785 iv = max(iv / 2, (unsigned long) HZ/100);
18091786 else
18101787 iv = min(iv * 2, round_jiffies_relative(check_interval * HZ));
arch/x86/kernel/cpu/microcode/amd.c+2−2
@@ -322,7 +322,7 @@ static u32 get_patch_level(void) · 321 unmodified lines
322322 {
323323 u32 rev, dummy __always_unused;
324324
325− if (IS_ENABLED(CONFIG_MICROCODE_DBG) && hypervisor_present) {
325+ if (IS_ENABLED(CONFIG_MICROCODE_DBG) && x86_hypervisor_present) {
326326 int cpu = smp_processor_id();
327327
328328 if (!microcode_rev[cpu]) {
@@ -714,7 +714,7 @@ static bool __apply_microcode_amd(struct microcode_amd *mc, u32 *cur_rev, · 385 unmodified lines
714714 invlpg(p_addr_end);
715715 }
716716
717− if (IS_ENABLED(CONFIG_MICROCODE_DBG) && hypervisor_present)
717+ if (IS_ENABLED(CONFIG_MICROCODE_DBG) && x86_hypervisor_present)
718718 microcode_rev[smp_processor_id()] = mc->hdr.patch_id;
719719
720720 /* verify patch application was successful */
arch/x86/kernel/cpu/microcode/core.c+10−12
@@ -57,7 +57,7 @@ bool force_minrev = IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV); · 56 unmodified lines
5757 u32 base_rev;
5858 u32 microcode_rev[NR_CPUS] = {};
5959
60−bool hypervisor_present;
60+bool __ro_after_init x86_hypervisor_present;
6161
6262 /*
6363 * Synchronization.
@@ -118,14 +118,9 @@ bool __init microcode_loader_disabled(void) · 54 unmodified lines
118118 /*
119119 * Disable when:
120120 *
121− * 1) The CPU does not support CPUID.
122− */
123− if (!cpuid_feature()) {
124− dis_ucode_ldr = true;
125− return dis_ucode_ldr;
126− }
127−
128− /*
121+ * 1) The CPU does not support CPUID, detected below in
122+ * load_ucode_bsp().
123+ *
129124 * 2) Bit 31 in CPUID[1]:ECX is clear
130125 * The bit is reserved for hypervisor use. This is still not
131126 * completely accurate as XEN PV guests don't see that CPUID bit
@@ -135,9 +130,7 @@ bool __init microcode_loader_disabled(void) · 3 unmodified lines
135130 * 3) Certain AMD patch levels are not allowed to be
136131 * overwritten.
137132 */
138− hypervisor_present = native_cpuid_ecx(1) & BIT(31);
139−
140− if ((hypervisor_present && !IS_ENABLED(CONFIG_MICROCODE_DBG)) ||
133+ if ((x86_hypervisor_present && !IS_ENABLED(CONFIG_MICROCODE_DBG)) ||
141134 amd_check_current_patch_level())
142135 dis_ucode_ldr = true;
143136
@@ -179,6 +172,11 @@ void __init load_ucode_bsp(void) · 35 unmodified lines
179172
180173 early_parse_cmdline();
181174
175+ if (!cpuid_feature())
176+ dis_ucode_ldr = true;
177+ else
178+ x86_hypervisor_present = native_cpuid_ecx(1) & BIT(31);
179+
182180 if (microcode_loader_disabled())
183181 return;
184182
arch/x86/kernel/cpu/microcode/intel.c+3−0
@@ -138,6 +138,9 @@ u32 intel_get_platform_id(void) · 137 unmodified lines
138138 {
139139 unsigned int val[2];
140140
141+ if (x86_hypervisor_present)
142+ return 0;
143+
141144 /*
142145 * This can be called early. Use CPUID directly instead of
143146 * relying on cpuinfo_x86 which may not be fully initialized.
arch/x86/kernel/cpu/microcode/internal.h+0−1
@@ -48,7 +48,6 @@ extern struct early_load_data early_data; · 47 unmodified lines
4848 extern struct ucode_cpu_info ucode_cpu_info[];
4949 extern u32 microcode_rev[NR_CPUS];
5050 extern u32 base_rev;
51−extern bool hypervisor_present;
5251
5352 struct cpio_data find_microcode_in_initrd(const char *path);
5453
arch/x86/kernel/e820.c+5−1
@@ -450,6 +450,10 @@ __init static int append_e820_table(struct boot_e820_entry *entries, u32 nr_entr · 449 unmodified lines
450450 {
451451 struct boot_e820_entry *entry = entries;
452452
453+ /* If there aren't any entries, we'll want to fall back to another source: */
454+ if (!nr_entries)
455+ return -ENOENT;
456+
453457 while (nr_entries) {
454458 u64 start = entry->addr;
455459 u64 size = entry->size;
@@ -458,7 +462,7 @@ __init static int append_e820_table(struct boot_e820_entry *entries, u32 nr_entr · 2 unmodified lines
458462
459463 /* Ignore the remaining entries on 64-bit overflow: */
460464 if (start > end && likely(size))
461− return -1;
465+ return -EINVAL;
462466
463467 e820__range_add(start, size, type);
464468
arch/x86/kernel/fpu/signal.c+8−3
@@ -27,14 +27,19 @@ · 26 unmodified lines
2727 static inline bool check_xstate_in_sigframe(struct fxregs_state __user *fxbuf,
2828 struct _fpx_sw_bytes *fx_sw)
2929 {
30+ int min_xstate_size = sizeof(struct fxregs_state) +
31+ sizeof(struct xstate_header);
3032 void __user *fpstate = fxbuf;
3133 unsigned int magic2;
3234
3335 if (__copy_from_user(fx_sw, &fxbuf->sw_reserved[0], sizeof(*fx_sw)))
3436 return false;
3537
36− /* Check for the first magic field */
37− if (fx_sw->magic1 != FP_XSTATE_MAGIC1)
38+ /* Check for the first magic field and other error scenarios. */
39+ if (fx_sw->magic1 != FP_XSTATE_MAGIC1 ||
40+ fx_sw->xstate_size < min_xstate_size ||
41+ fx_sw->xstate_size > x86_task_fpu(current)->fpstate->user_size ||
42+ fx_sw->xstate_size > fx_sw->extended_size)
3843 goto setfx;
3944
4045 /*
@@ -43,7 +48,7 @@ static inline bool check_xstate_in_sigframe(struct fxregs_state __user *fxbuf, · 2 unmodified lines
4348 * fpstate layout with out copying the extended state information
4449 * in the memory layout.
4550 */
46− if (__get_user(magic2, (__u32 __user *)(fpstate + x86_task_fpu(current)->fpstate->user_size)))
51+ if (__get_user(magic2, (__u32 __user *)(fpstate + fx_sw->xstate_size)))
4752 return false;
4853
4954 if (likely(magic2 == FP_XSTATE_MAGIC2))
arch/x86/kernel/ftrace.c+7−0
@@ -375,6 +375,13 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) · 374 unmodified lines
375375 goto fail;
376376 }
377377
378+ /*
379+ * Generated trampoline may contain rIP-relative addressing which
380+ * displacement needs to be fixed.
381+ */
382+ text_poke_apply_relocation(trampoline, trampoline, size,
383+ (void *)start_offset, size);
384+
378385 /*
379386 * The address of the ftrace_ops that is used for this trampoline
380387 * is stored at the end of the trampoline. This will be used to
arch/x86/kernel/idt.c+7−0
@@ -268,6 +268,13 @@ void __init idt_setup_early_pf(void) · 267 unmodified lines
268268 }
269269 #endif
270270
271+#if IS_ENABLED(CONFIG_KVM_INTEL) && !defined(CONFIG_X86_64)
272+void idt_entry_from_kvm(unsigned int vector)
273+{
274+ idt_do_interrupt_irqoff(gate_offset(idt_table + vector));
275+}
276+#endif
277+
271278 static void __init idt_map_in_cea(void)
272279 {
273280 /*
arch/x86/kernel/nmi.c+0−1
@@ -614,7 +614,6 @@ DEFINE_IDTENTRY_RAW(exc_nmi_kvm_vmx) · 613 unmodified lines
614614 {
615615 exc_nmi(regs);
616616 }
617−EXPORT_SYMBOL_FOR_KVM(asm_exc_nmi_kvm_vmx);
618617 #endif
619618
620619 #ifdef CONFIG_NMI_CHECK_CPU
arch/x86/kernel/relocate_kernel_64.S+8−0
@@ -136,6 +136,14 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) · 135 unmodified lines
136136 * %r13 original CR4 when relocate_kernel() was invoked
137137 */
138138
139+ /*
140+ * Set return address to 0 if not preserving context. The purgatory
141+ * shipped in kexec-tools will unconditionally look for the return
142+ * address on the stack and set a kexec_jump_back_entry= command
143+ * line option if it's non-zero. There's no other way that it can
144+ * tell a preserve-context (kjump) kexec from a normal one.
145+ */
146+ pushq $0
139147 /* store the start address on the stack */
140148 pushq %rdx
141149
arch/x86/kvm/emulate.c+1−1
@@ -4481,7 +4481,7 @@ static const struct opcode opcode_map_0f_38[256] = { · 4480 unmodified lines
44814481 X16(N), X16(N),
44824482 /* 0x20 - 0x2f */
44834483 X8(N),
4484− X2(N), GP(SrcReg | DstMem | ModRM | Mov | Aligned, &pfx_0f_e7_0f_38_2a), N, N, N, N, N,
4484+ X2(N), GP(SrcMem | DstReg | ModRM | Mov | Aligned, &pfx_0f_e7_0f_38_2a), N, N, N, N, N,
44854485 /* 0x30 - 0x7f */
44864486 X16(N), X16(N), X16(N), X16(N), X16(N),
44874487 /* 0x80 - 0xef */
arch/x86/kvm/hyperv.c+1−1
@@ -2040,7 +2040,7 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc) · 2039 unmodified lines
20402040 * flush). Translate the address here so the memory can be uniformly
20412041 * read with kvm_read_guest().
20422042 */
2043− if (!hc->fast && is_guest_mode(vcpu)) {
2043+ if (!hc->fast && mmu_is_nested(vcpu)) {
20442044 hc->ingpa = translate_nested_gpa(vcpu, hc->ingpa, 0, NULL);
20452045 if (unlikely(hc->ingpa == INVALID_GPA))
20462046 return HV_STATUS_INVALID_HYPERCALL_INPUT;
arch/x86/kvm/lapic.c+13−11
@@ -667,13 +667,15 @@ bool __kvm_apic_update_irr(unsigned long *pir, void *regs, int *max_irr) · 666 unmodified lines
667667 u32 *__pir = (void *)pir_vals;
668668 u32 i, vec;
669669 u32 irr_val, prev_irr_val;
670− int max_updated_irr;
670+ int max_new_irr;
671671
672− max_updated_irr = -1;
673− *max_irr = -1;
674−
675− if (!pi_harvest_pir(pir, pir_vals))
672+ if (!pi_harvest_pir(pir, pir_vals)) {
673+ *max_irr = apic_find_highest_vector(regs + APIC_IRR);
676674 return false;
675+ }
676+
677+ max_new_irr = -1;
678+ *max_irr = -1;
677679
678680 for (i = vec = 0; i <= 7; i++, vec += 32) {
679681 u32 *p_irr = (u32 *)(regs + APIC_IRR + i * 0x10);
@@ -688,25 +690,25 @@ bool __kvm_apic_update_irr(unsigned long *pir, void *regs, int *max_irr) · 8 unmodified lines
688690 !try_cmpxchg(p_irr, &prev_irr_val, irr_val));
689691
690692 if (prev_irr_val != irr_val)
691− max_updated_irr = __fls(irr_val ^ prev_irr_val) + vec;
693+ max_new_irr = __fls(irr_val ^ prev_irr_val) + vec;
692694 }
693695 if (irr_val)
694696 *max_irr = __fls(irr_val) + vec;
695697 }
696698
697− return ((max_updated_irr != -1) &&
698− (max_updated_irr == *max_irr));
699+ return max_new_irr != -1 && max_new_irr == *max_irr;
699700 }
700701 EXPORT_SYMBOL_FOR_KVM_INTERNAL(__kvm_apic_update_irr);
701702
702703 bool kvm_apic_update_irr(struct kvm_vcpu *vcpu, unsigned long *pir, int *max_irr)
703704 {
704705 struct kvm_lapic *apic = vcpu->arch.apic;
705− bool irr_updated = __kvm_apic_update_irr(pir, apic->regs, max_irr);
706+ bool max_irr_is_from_pir;
706707
707− if (unlikely(!apic->apicv_active && irr_updated))
708+ max_irr_is_from_pir = __kvm_apic_update_irr(pir, apic->regs, max_irr);
709+ if (unlikely(!apic->apicv_active && max_irr_is_from_pir))
708710 apic->irr_pending = true;
709− return irr_updated;
711+ return max_irr_is_from_pir;
710712 }
711713 EXPORT_SYMBOL_FOR_KVM_INTERNAL(kvm_apic_update_irr);
712714
arch/x86/kvm/mmu/mmu.c+33−21
@@ -182,6 +182,8 @@ static struct kmem_cache *pte_list_desc_cache; · 181 unmodified lines
182182 struct kmem_cache *mmu_page_header_cache;
183183
184184 static void mmu_spte_set(u64 *sptep, u64 spte);
185+static int mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,
186+ u64 *spte, struct list_head *invalid_list);
185187
186188 struct kvm_mmu_role_regs {
187189 const unsigned long cr0;
@@ -1287,19 +1289,6 @@ static void drop_spte(struct kvm *kvm, u64 *sptep) · 1099 unmodified lines
12871289 rmap_remove(kvm, sptep);
12881290 }
12891291
1290−static void drop_large_spte(struct kvm *kvm, u64 *sptep, bool flush)
1291−{
1292− struct kvm_mmu_page *sp;
1293−
1294− sp = sptep_to_sp(sptep);
1295− WARN_ON_ONCE(sp->role.level == PG_LEVEL_4K);
1296−
1297− drop_spte(kvm, sptep);
1298−
1299− if (flush)
1300− kvm_flush_remote_tlbs_sptep(kvm, sptep);
1301−}
1302−
13031292 /*
13041293 * Write-protect on the specified @sptep, @pt_protect indicates whether
13051294 * spte write-protection is caused by protecting shadow page table.
@@ -2466,7 +2455,8 @@ static struct kvm_mmu_page *kvm_mmu_get_child_sp(struct kvm_vcpu *vcpu, · 1160 unmodified lines
24662455 {
24672456 union kvm_mmu_page_role role;
24682457
2469− if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
2458+ if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep) &&
2459+ spte_to_child_sp(*sptep) && spte_to_child_sp(*sptep)->gfn == gfn)
24702460 return ERR_PTR(-EEXIST);
24712461
24722462 role = kvm_mmu_child_role(sptep, direct, access);
@@ -2536,6 +2526,23 @@ static void shadow_walk_next(struct kvm_shadow_walk_iterator *iterator) · 63 unmodified lines
25362526 __shadow_walk_next(iterator, *iterator->sptep);
25372527 }
25382528
2529+/*
2530+ * Note: while normally KVM uses a "bool flush" return value to let
2531+ * the caller batch flushes, __link_shadow_page() flushes immediately
2532+ * before populating the parent PTE with the new shadow page. The
2533+ * typical callers, direct_map() and FNAME(fetch)(), are not going
2534+ * to zap more than one huge SPTE anyway.
2535+ *
2536+ * The only exception, where @flush can be false, is when a huge SPTE
2537+ * is replaced with a shadow page SPTE with a fully populated page table,
2538+ * which can happen from shadow_mmu_split_huge_page(). In this case,
2539+ * no memory is unmapped across the change to the page tables and no
2540+ * immediate flush is needed for correctness.
2541+ *
2542+ * Even in that case, calls to kvm_mmu_commit_zap_page() are not
2543+ * batched. Doing so would require adding an invalid_list argument
2544+ * all the way down to __walk_slot_rmaps().
2545+ */
25392546 static void __link_shadow_page(struct kvm *kvm,
25402547 struct kvm_mmu_memory_cache *cache, u64 *sptep,
25412548 struct kvm_mmu_page *sp, bool flush)
@@ -2544,13 +2551,18 @@ static void __link_shadow_page(struct kvm *kvm, · 2 unmodified lines
25442551
25452552 BUILD_BUG_ON(VMX_EPT_WRITABLE_MASK != PT_WRITABLE_MASK);
25462553
2547− /*
2548− * If an SPTE is present already, it must be a leaf and therefore
2549− * a large one. Drop it, and flush the TLB if needed, before
2550− * installing sp.
2551− */
2552− if (is_shadow_present_pte(*sptep))
2553− drop_large_spte(kvm, sptep, flush);
2554+ if (is_shadow_present_pte(*sptep)) {
2555+ struct kvm_mmu_page *parent_sp;
2556+ LIST_HEAD(invalid_list);
2557+
2558+ parent_sp = sptep_to_sp(sptep);
2559+ WARN_ON_ONCE(parent_sp->role.level == PG_LEVEL_4K);
2560+
2561+ if (mmu_page_zap_pte(kvm, parent_sp, sptep, &invalid_list))
2562+ kvm_mmu_commit_zap_page(kvm, &invalid_list);
2563+ else if (flush)
2564+ kvm_flush_remote_tlbs_sptep(kvm, sptep);
2565+ }
25542566
25552567 spte = make_nonleaf_spte(sp->spt, sp_ad_disabled(sp));
25562568
arch/x86/kvm/svm/avic.c+36−11
@@ -206,6 +206,35 @@ static void avic_activate_vmcb(struct vcpu_svm *svm) · 205 unmodified lines
206206
207207 svm_clr_intercept(svm, INTERCEPT_CR8_WRITE);
208208
209+ /*
210+ * Flush the TLB when enabling (x2)AVIC and when transitioning between
211+ * xAVIC and x2AVIC, as the CPU may have inserted a TLB entry for the
212+ * "wrong" mapping.
213+ *
214+ * KVM uses a per-VM "scratch" page to back the APIC memslot, because
215+ * KVM also uses per-VM page tables *and* maintains the page table (NPT
216+ * or shadow page) mappings for said memslot even if one or more vCPUs
217+ * have their local APIC hardware-disabled or are in x2APIC mode, i.e.
218+ * even if one or more vCPUs' APIC MMIO BAR is effectively disabled.
219+ *
220+ * If xAVIC is fully enabled, hardware ignores the physical address in
221+ * KVM's page tables, i.e. in the leaf SPTE for the APIC memslot, and
222+ * instead redirects the access to the AVIC backing page, i.e. to the
223+ * vCPU's virtual APIC page. If xAVIC is not enabled (APIC is either
224+ * hardware-disabled or in x2APIC mode), then guest accesses will use
225+ * the page table mapping verbatim, i.e. will access the per-VM scratch
226+ * page, as normal memory.
227+ *
228+ * In both cases, the CPU is allowed to cache TLB entries for the APIC
229+ * base GPA. So, KVM needs to flush the TLB when enabling xAVIC, as
230+ * accesses need to be redirected to the virtual APIC page, but the TLB
231+ * may contain entries pointing at the scratch page. KVM also needs to
232+ * flush the TLB when enabling x2AVIC, as accesses need to go to the
233+ * scratch page, but the TLB may contain entries tagged as xAVIC, i.e.
234+ * entries pointing to the vCPU's virtual APIC page.
235+ */
236+ kvm_make_request(KVM_REQ_TLB_FLUSH_CURRENT, &svm->vcpu);
237+
209238 /*
210239 * Note: KVM supports hybrid-AVIC mode, where KVM emulates x2APIC MSR
211240 * accesses, while interrupt injection to a running vCPU can be
@@ -219,12 +248,6 @@ static void avic_activate_vmcb(struct vcpu_svm *svm) · 7 unmodified lines
219248 /* Disabling MSR intercept for x2APIC registers */
220249 avic_set_x2apic_msr_interception(svm, false);
221250 } else {
222− /*
223− * Flush the TLB, the guest may have inserted a non-APIC
224− * mapping into the TLB while AVIC was disabled.
225− */
226− kvm_make_request(KVM_REQ_TLB_FLUSH_CURRENT, &svm->vcpu);
227−
228251 /* Enabling MSR intercept for x2APIC registers */
229252 avic_set_x2apic_msr_interception(svm, true);
230253 }
@@ -1300,12 +1323,14 @@ bool __init avic_hardware_setup(void) · 1069 unmodified lines
13001323 }
13011324
13021325 /*
1303− * Disable IPI virtualization for AMD Family 17h CPUs (Zen1 and Zen2)
1304− * due to erratum 1235, which results in missed VM-Exits on the sender
1305− * and thus missed wake events for blocking vCPUs due to the CPU
1306− * failing to see a software update to clear IsRunning.
1326+ * Disable IPI virtualization for AMD Family 17h (Zen1 and Zen2) and
1327+ * Hygon Family 18h (derived from AMD Zen1) CPUs due to erratum 1235,
1328+ * which results in missed VM-Exits on the sender and thus missed wake
1329+ * events for blocking vCPUs due to the CPU failing to see a software
1330+ * update to clear IsRunning.
13071331 */
1308− enable_ipiv = enable_ipiv && boot_cpu_data.x86 != 0x17;
1332+ if (boot_cpu_data.x86 == 0x17 || boot_cpu_data.x86 == 0x18)
1333+ enable_ipiv = false;
13091334
13101335 amd_iommu_register_ga_log_notifier(&avic_ga_log_notifier);
13111336
arch/x86/kvm/svm/nested.c+14−29
@@ -160,6 +160,16 @@ void nested_vmcb02_recalc_intercepts(struct vcpu_svm *svm) · 159 unmodified lines
160160 if (!intercept_smi)
161161 vmcb_clr_intercept(&vmcb02->control, INTERCEPT_SMI);
162162
163+ /*
164+ * Intercept PAUSE if and only if L1 wants to. KVM intercepts PAUSE so
165+ * that a vCPU that may be spinning waiting for a lock can be scheduled
166+ * out in favor of the vCPU that holds said lock. KVM doesn't support
167+ * yielding across L2 vCPUs, as KVM has limited visilibity into which
168+ * L2 vCPUs are in the same L2 VM, i.e. may be contending for locks.
169+ */
170+ if (!vmcb12_is_intercept(&svm->nested.ctl, INTERCEPT_PAUSE))
171+ vmcb_clr_intercept(&vmcb02->control, INTERCEPT_PAUSE);
172+
163173 if (nested_vmcb_needs_vls_intercept(svm)) {
164174 /*
165175 * If the virtual VMLOAD/VMSAVE is not enabled for the L2,
@@ -819,7 +829,6 @@ static void nested_vmcb02_prepare_control(struct vcpu_svm *svm) · 653 unmodified lines
819829 struct vmcb *vmcb02 = svm->nested.vmcb02.ptr;
820830 struct vmcb *vmcb01 = svm->vmcb01.ptr;
821831 struct kvm_vcpu *vcpu = &svm->vcpu;
822− u32 pause_count12, pause_thresh12;
823832
824833 nested_svm_transition_tlb_flush(vcpu);
825834
@@ -947,31 +956,13 @@ static void nested_vmcb02_prepare_control(struct vcpu_svm *svm) · 121 unmodified lines
947956 vmcb02->control.misc_ctl2 |= SVM_MISC2_ENABLE_V_VMLOAD_VMSAVE;
948957
949958 if (guest_cpu_cap_has(vcpu, X86_FEATURE_PAUSEFILTER))
950− pause_count12 = vmcb12_ctrl->pause_filter_count;
959+ vmcb02->control.pause_filter_count = vmcb12_ctrl->pause_filter_count;
951960 else
952− pause_count12 = 0;
961+ vmcb02->control.pause_filter_count = 0;
953962 if (guest_cpu_cap_has(vcpu, X86_FEATURE_PFTHRESHOLD))
954− pause_thresh12 = vmcb12_ctrl->pause_filter_thresh;
963+ vmcb02->control.pause_filter_thresh = vmcb12_ctrl->pause_filter_thresh;
955964 else
956− pause_thresh12 = 0;
957− if (kvm_pause_in_guest(svm->vcpu.kvm)) {
958− /* use guest values since host doesn't intercept PAUSE */
959− vmcb02->control.pause_filter_count = pause_count12;
960− vmcb02->control.pause_filter_thresh = pause_thresh12;
961−
962− } else {
963− /* start from host values otherwise */
964− vmcb02->control.pause_filter_count = vmcb01->control.pause_filter_count;
965− vmcb02->control.pause_filter_thresh = vmcb01->control.pause_filter_thresh;
966−
967− /* ... but ensure filtering is disabled if so requested. */
968− if (vmcb12_is_intercept(vmcb12_ctrl, INTERCEPT_PAUSE)) {
969− if (!pause_count12)
970− vmcb02->control.pause_filter_count = 0;
971− if (!pause_thresh12)
972− vmcb02->control.pause_filter_thresh = 0;
973− }
974− }
965+ vmcb02->control.pause_filter_thresh = 0;
975966
976967 /*
977968 * Take ALLOW_LARGER_RAP from vmcb12 even though it should be safe to
@@ -1298,12 +1289,6 @@ void nested_svm_vmexit(struct vcpu_svm *svm) · 320 unmodified lines
12981289 /* in case we halted in L2 */
12991290 kvm_set_mp_state(vcpu, KVM_MP_STATE_RUNNABLE);
13001291
1301− if (!kvm_pause_in_guest(vcpu->kvm)) {
1302− vmcb01->control.pause_filter_count = vmcb02->control.pause_filter_count;
1303− vmcb_mark_dirty(vmcb01, VMCB_INTERCEPTS);
1304−
1305− }
1306−
13071292 /*
13081293 * Invalidate last_bus_lock_rip unless KVM is still waiting for the
13091294 * guest to make forward progress before re-enabling bus lock detection.
arch/x86/kvm/svm/sev.c+65−26
@@ -3662,23 +3662,26 @@ int pre_sev_run(struct vcpu_svm *svm, int cpu) · 3661 unmodified lines
36623662 }
36633663
36643664 #define GHCB_SCRATCH_AREA_LIMIT (16ULL * PAGE_SIZE)
3665−static int setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len)
3665+static int setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 min_len)
36663666 {
36673667 struct vmcb_control_area *control = &svm->vmcb->control;
36683668 u64 ghcb_scratch_beg, ghcb_scratch_end;
36693669 u64 scratch_gpa_beg, scratch_gpa_end;
36703670 void *scratch_va;
36713671
3672+ if (WARN_ON_ONCE(!min_len))
3673+ goto e_scratch;
3674+
36723675 scratch_gpa_beg = svm->sev_es.sw_scratch;
36733676 if (!scratch_gpa_beg) {
36743677 pr_err("vmgexit: scratch gpa not provided\n");
36753678 goto e_scratch;
36763679 }
36773680
3678− scratch_gpa_end = scratch_gpa_beg + len;
3681+ scratch_gpa_end = scratch_gpa_beg + min_len;
36793682 if (scratch_gpa_end < scratch_gpa_beg) {
36803683 pr_err("vmgexit: scratch length (%#llx) not valid for scratch address (%#llx)\n",
3681− len, scratch_gpa_beg);
3684+ min_len, scratch_gpa_beg);
36823685 goto e_scratch;
36833686 }
36843687
@@ -3702,21 +3705,27 @@ static int setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len) · 17 unmodified lines
37023705
37033706 scratch_va = (void *)svm->sev_es.ghcb;
37043707 scratch_va += (scratch_gpa_beg - control->ghcb_gpa);
3708+
3709+ svm->sev_es.ghcb_sa_len = ghcb_scratch_end - scratch_gpa_beg;
37053710 } else {
3711+ /* GHCB v2 requires the scratch area to be within the GHCB. */
3712+ if (to_kvm_sev_info(svm->vcpu.kvm)->ghcb_version >= 2)
3713+ goto e_scratch;
3714+
37063715 /*
37073716 * The guest memory must be read into a kernel buffer, so
37083717 * limit the size
37093718 */
3710− if (len > GHCB_SCRATCH_AREA_LIMIT) {
3719+ if (min_len > GHCB_SCRATCH_AREA_LIMIT) {
37113720 pr_err("vmgexit: scratch area exceeds KVM limits (%#llx requested, %#llx limit)\n",
3712− len, GHCB_SCRATCH_AREA_LIMIT);
3721+ min_len, GHCB_SCRATCH_AREA_LIMIT);
37133722 goto e_scratch;
37143723 }
3715− scratch_va = kvzalloc(len, GFP_KERNEL_ACCOUNT);
3724+ scratch_va = kvzalloc(min_len, GFP_KERNEL_ACCOUNT);
37163725 if (!scratch_va)
37173726 return -ENOMEM;
37183727
3719− if (kvm_read_guest(svm->vcpu.kvm, scratch_gpa_beg, scratch_va, len)) {
3728+ if (kvm_read_guest(svm->vcpu.kvm, scratch_gpa_beg, scratch_va, min_len)) {
37203729 /* Unable to copy scratch area from guest */
37213730 pr_err("vmgexit: kvm_read_guest for scratch area failed\n");
37223731
@@ -3732,11 +3741,10 @@ static int setup_vmgexit_scratch(struct vcpu_svm *svm, bool sync, u64 len) · 9 unmodified lines
37323741 */
37333742 svm->sev_es.ghcb_sa_sync = sync;
37343743 svm->sev_es.ghcb_sa_free = true;
3744+ svm->sev_es.ghcb_sa_len = min_len;
37353745 }
37363746
37373747 svm->sev_es.ghcb_sa = scratch_va;
3738− svm->sev_es.ghcb_sa_len = len;
3739−
37403748 return 0;
37413749
37423750 e_scratch:
@@ -3833,7 +3841,7 @@ struct psc_buffer { · 90 unmodified lines
38333841 struct psc_entry entries[];
38343842 } __packed;
38353843
3836−static int snp_begin_psc(struct vcpu_svm *svm, struct psc_buffer *psc);
3844+static int snp_begin_psc(struct vcpu_svm *svm);
38373845
38383846 static void snp_complete_psc(struct vcpu_svm *svm, u64 psc_ret)
38393847 {
@@ -3864,9 +3872,9 @@ static void __snp_complete_one_psc(struct vcpu_svm *svm) · 24 unmodified lines
38643872 */
38653873 for (idx = svm->sev_es.psc_idx; svm->sev_es.psc_inflight;
38663874 svm->sev_es.psc_inflight--, idx++) {
3867− struct psc_entry *entry = &entries[idx];
3875+ struct psc_entry entry = READ_ONCE(entries[idx]);
38683876
3869− entry->cur_page = entry->pagesize ? 512 : 1;
3877+ entries[idx].cur_page = entry.pagesize ? 512 : 1;
38703878 }
38713879
38723880 hdr->cur_entry = idx;
@@ -3875,7 +3883,6 @@ static void __snp_complete_one_psc(struct vcpu_svm *svm) · 2 unmodified lines
38753883 static int snp_complete_one_psc(struct kvm_vcpu *vcpu)
38763884 {
38773885 struct vcpu_svm *svm = to_svm(vcpu);
3878− struct psc_buffer *psc = svm->sev_es.ghcb_sa;
38793886
38803887 if (vcpu->run->hypercall.ret) {
38813888 snp_complete_psc(svm, VMGEXIT_PSC_ERROR_GENERIC);
@@ -3885,16 +3892,18 @@ static int snp_complete_one_psc(struct kvm_vcpu *vcpu) · 3 unmodified lines
38853892 __snp_complete_one_psc(svm);
38863893
38873894 /* Handle the next range (if any). */
3888− return snp_begin_psc(svm, psc);
3895+ return snp_begin_psc(svm);
38893896 }
38903897
3891−static int snp_begin_psc(struct vcpu_svm *svm, struct psc_buffer *psc)
3898+static int snp_begin_psc(struct vcpu_svm *svm)
38923899 {
3900+ struct vcpu_sev_es_state *sev_es = &svm->sev_es;
3901+ struct psc_buffer *psc = sev_es->ghcb_sa;
38933902 struct psc_entry *entries = psc->entries;
38943903 struct kvm_vcpu *vcpu = &svm->vcpu;
38953904 struct psc_hdr *hdr = &psc->hdr;
38963905 struct psc_entry entry_start;
3897− u16 idx, idx_start, idx_end;
3906+ u16 idx, idx_start, idx_end, max_nr_entries;
38983907 int npages;
38993908 bool huge;
39003909 u64 gfn;
@@ -3904,6 +3913,19 @@ static int snp_begin_psc(struct vcpu_svm *svm, struct psc_buffer *psc) · 3 unmodified lines
39043913 return 1;
39053914 }
39063915
3916+ /*
3917+ * GHCB v2 requires the scratch area to reside within the GHCB itself,
3918+ * and PSC requests are only supported for GHCB v2+. Thus it should be
3919+ * impossible to exceed the max PSC entry count (which is derived from
3920+ * the size of the shared GHCB buffer).
3921+ */
3922+ max_nr_entries = (sev_es->ghcb_sa_len - sizeof(struct psc_hdr)) /
3923+ sizeof(struct psc_entry);
3924+ if (WARN_ON_ONCE(max_nr_entries > VMGEXIT_PSC_MAX_COUNT)) {
3925+ snp_complete_psc(svm, VMGEXIT_PSC_ERROR_GENERIC);
3926+ return 1;
3927+ }
3928+
39073929 next_range:
39083930 /* There should be no other PSCs in-flight at this point. */
39093931 if (WARN_ON_ONCE(svm->sev_es.psc_inflight)) {
@@ -3916,17 +3938,17 @@ next_range: · 6 unmodified lines
39163938 * validation, so take care to only use validated copies of values used
39173939 * for things like array indexing.
39183940 */
3919− idx_start = hdr->cur_entry;
3920− idx_end = hdr->end_entry;
3941+ idx_start = READ_ONCE(hdr->cur_entry);
3942+ idx_end = READ_ONCE(hdr->end_entry);
39213943
3922− if (idx_end >= VMGEXIT_PSC_MAX_COUNT) {
3944+ if (idx_end >= max_nr_entries) {
39233945 snp_complete_psc(svm, VMGEXIT_PSC_ERROR_INVALID_HDR);
39243946 return 1;
39253947 }
39263948
39273949 /* Find the start of the next range which needs processing. */
39283950 for (idx = idx_start; idx <= idx_end; idx++, hdr->cur_entry++) {
3929− entry_start = entries[idx];
3951+ entry_start = READ_ONCE(entries[idx]);
39303952
39313953 gfn = entry_start.gfn;
39323954 huge = entry_start.pagesize;
@@ -3970,7 +3992,7 @@ next_range: · 37 unmodified lines
39703992 * KVM_HC_MAP_GPA_RANGE exit.
39713993 */
39723994 while (++idx <= idx_end) {
3973− struct psc_entry entry = entries[idx];
3995+ struct psc_entry entry = READ_ONCE(entries[idx]);
39743996
39753997 if (entry.operation != entry_start.operation ||
39763998 entry.gfn != entry_start.gfn + npages ||
@@ -4493,13 +4515,22 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) · 516 unmodified lines
44934515 case SVM_VMGEXIT_MMIO_READ:
44944516 case SVM_VMGEXIT_MMIO_WRITE: {
44954517 bool is_write = control->exit_code == SVM_VMGEXIT_MMIO_WRITE;
4518+ u64 len = control->exit_info_2;
44964519
4497− ret = setup_vmgexit_scratch(svm, !is_write, control->exit_info_2);
4520+ if (!len)
4521+ return 1;
4522+
4523+ if (to_kvm_sev_info(vcpu->kvm)->ghcb_version >= 2 && len > 8) {
4524+ svm_vmgexit_bad_input(svm, GHCB_ERR_INVALID_INPUT);
4525+ return 1;
4526+ }
4527+
4528+ ret = setup_vmgexit_scratch(svm, !is_write, len);
44984529 if (ret)
44994530 break;
45004531
4501− ret = kvm_sev_es_mmio(vcpu, is_write, control->exit_info_1,
4502− control->exit_info_2, svm->sev_es.ghcb_sa);
4532+ ret = kvm_sev_es_mmio(vcpu, is_write, control->exit_info_1, len,
4533+ svm->sev_es.ghcb_sa);
45034534 break;
45044535 }
45054536 case SVM_VMGEXIT_NMI_COMPLETE:
@@ -4546,11 +4577,11 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) · 40 unmodified lines
45464577 vcpu->run->system_event.data[0] = control->ghcb_gpa;
45474578 break;
45484579 case SVM_VMGEXIT_PSC:
4549− ret = setup_vmgexit_scratch(svm, true, control->exit_info_2);
4580+ ret = setup_vmgexit_scratch(svm, true, sizeof(struct psc_hdr));
45504581 if (ret)
45514582 break;
45524583
4553− ret = snp_begin_psc(svm, svm->sev_es.ghcb_sa);
4584+ ret = snp_begin_psc(svm);
45544585 break;
45554586 case SVM_VMGEXIT_AP_CREATION:
45564587 ret = sev_snp_ap_creation(svm);
@@ -4572,6 +4603,11 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) · 15 unmodified lines
45724603 control->exit_info_1, control->exit_info_2);
45734604 ret = -EINVAL;
45744605 break;
4606+ case SVM_EXIT_IOIO:
4607+ if (!((control->exit_info_1 & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT))
4608+ return 1;
4609+
4610+ fallthrough;
45754611 default:
45764612 ret = svm_invoke_exit_handler(vcpu, control->exit_code);
45774613 }
@@ -4592,6 +4628,9 @@ int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in) · 14 unmodified lines
45924628 if (unlikely(check_mul_overflow(count, size, &bytes)))
45934629 return -EINVAL;
45944630
4631+ if (!bytes)
4632+ return 1;
4633+
45954634 r = setup_vmgexit_scratch(svm, in, bytes);
45964635 if (r)
45974636 return r;
arch/x86/kvm/svm/svm.c+13−2
@@ -913,7 +913,15 @@ static void grow_ple_window(struct kvm_vcpu *vcpu) · 912 unmodified lines
913913 struct vmcb_control_area *control = &svm->vmcb->control;
914914 int old = control->pause_filter_count;
915915
916− if (kvm_pause_in_guest(vcpu->kvm))
916+ /* Adjusting pause_filter_count makes no sense if PLE is disabled. */
917+ WARN_ON_ONCE(kvm_pause_in_guest(vcpu->kvm));
918+
919+ /*
920+ * While running L2, KVM should intercept PAUSE if and only if L1 wants
921+ * to intercept PAUSE, and L1's intercept should take priority, i.e.
922+ * KVM should never handle a PAUSE intercept from L2.
923+ */
924+ if (WARN_ON_ONCE(is_guest_mode(vcpu)))
917925 return;
918926
919927 control->pause_filter_count = __grow_ple_window(old,
@@ -934,7 +942,10 @@ static void shrink_ple_window(struct kvm_vcpu *vcpu) · 14 unmodified lines
934942 struct vmcb_control_area *control = &svm->vmcb->control;
935943 int old = control->pause_filter_count;
936944
937− if (kvm_pause_in_guest(vcpu->kvm))
945+ /* Adjusting pause_filter_count makes no sense if PLE is disabled. */
946+ WARN_ON_ONCE(kvm_pause_in_guest(vcpu->kvm));
947+
948+ if (is_guest_mode(vcpu))
938949 return;
939950
940951 control->pause_filter_count =
arch/x86/kvm/trace.h+1−1
@@ -154,7 +154,7 @@ TRACE_EVENT(kvm_xen_hypercall, · 153 unmodified lines
154154 __entry->a2 = a2;
155155 __entry->a3 = a3;
156156 __entry->a4 = a4;
157− __entry->a4 = a5;
157+ __entry->a5 = a5;
158158 ),
159159
160160 TP_printk("cpl %d nr 0x%lx a0 0x%lx a1 0x%lx a2 0x%lx a3 0x%lx a4 0x%lx a5 %lx",
arch/x86/kvm/vmx/capabilities.h+1−0
@@ -14,6 +14,7 @@ extern bool __read_mostly flexpriority_enabled; · 13 unmodified lines
1414 extern bool __read_mostly enable_ept;
1515 extern bool __read_mostly enable_unrestricted_guest;
1616 extern bool __read_mostly enable_ept_ad_bits;
17+extern bool __read_mostly enable_cet;
1718 extern bool __read_mostly enable_pml;
1819 extern int __read_mostly pt_mode;
1920
arch/x86/kvm/vmx/vmenter.S+0−46
@@ -31,38 +31,6 @@ · 30 unmodified lines
3131 #define VCPU_R15 __VCPU_REGS_R15 * WORD_SIZE
3232 #endif
3333
34−.macro VMX_DO_EVENT_IRQOFF call_insn call_target
35− /*
36− * Unconditionally create a stack frame, getting the correct RSP on the
37− * stack (for x86-64) would take two instructions anyways, and RBP can
38− * be used to restore RSP to make objtool happy (see below).
39− */
40− push %_ASM_BP
41− mov %_ASM_SP, %_ASM_BP
42−
43−#ifdef CONFIG_X86_64
44− /*
45− * Align RSP to a 16-byte boundary (to emulate CPU behavior) before
46− * creating the synthetic interrupt stack frame for the IRQ/NMI.
47− */
48− and $-16, %rsp
49− push $__KERNEL_DS
50− push %rbp
51−#endif
52− pushf
53− push $__KERNEL_CS
54− \call_insn \call_target
55−
56− /*
57− * "Restore" RSP from RBP, even though IRET has already unwound RSP to
58− * the correct value. objtool doesn't know the callee will IRET and,
59− * without the explicit restore, thinks the stack is getting walloped.
60− * Using an unwind hint is problematic due to x86-64's dynamic alignment.
61− */
62− leave
63− RET
64−.endm
65−
6634 .section .noinstr.text, "ax"
6735
6836 /**
@@ -320,10 +288,6 @@ SYM_INNER_LABEL_ALIGN(vmx_vmexit, SYM_L_GLOBAL) · 251 unmodified lines
320288
321289 SYM_FUNC_END(__vmx_vcpu_run)
322290
323−SYM_FUNC_START(vmx_do_nmi_irqoff)
324− VMX_DO_EVENT_IRQOFF call asm_exc_nmi_kvm_vmx
325−SYM_FUNC_END(vmx_do_nmi_irqoff)
326−
327291 #ifndef CONFIG_CC_HAS_ASM_GOTO_OUTPUT
328292
329293 /**
@@ -375,13 +339,3 @@ SYM_FUNC_START(vmread_error_trampoline) · 45 unmodified lines
375339 RET
376340 SYM_FUNC_END(vmread_error_trampoline)
377341 #endif
378−
379−.section .text, "ax"
380−
381−#ifndef CONFIG_X86_FRED
382−
383−SYM_FUNC_START(vmx_do_interrupt_irqoff)
384− VMX_DO_EVENT_IRQOFF CALL_NOSPEC _ASM_ARG1
385−SYM_FUNC_END(vmx_do_interrupt_irqoff)
386−
387−#endif
arch/x86/kvm/vmx/vmx.c+49−27
@@ -108,6 +108,9 @@ module_param_named(unrestricted_guest, · 107 unmodified lines
108108 bool __read_mostly enable_ept_ad_bits = 1;
109109 module_param_named(eptad, enable_ept_ad_bits, bool, 0444);
110110
111+bool __read_mostly enable_cet = 1;
112+module_param_named(cet, enable_cet, bool, 0444);
113+
111114 static bool __read_mostly emulate_invalid_guest_state = true;
112115 module_param(emulate_invalid_guest_state, bool, 0444);
113116
@@ -4476,7 +4479,7 @@ void vmx_set_constant_host_state(struct vcpu_vmx *vmx) · 4362 unmodified lines
44764479 * SSP is reloaded from IA32_PL3_SSP. Check SDM Vol.2A/B Chapter
44774480 * 3 and 4 for details.
44784481 */
4479− if (cpu_has_load_cet_ctrl()) {
4482+ if (enable_cet) {
44804483 vmcs_writel(HOST_S_CET, kvm_host.s_cet);
44814484 vmcs_writel(HOST_SSP, 0);
44824485 vmcs_writel(HOST_INTR_SSP_TABLE, 0);
@@ -4532,6 +4535,10 @@ static u32 vmx_get_initial_vmentry_ctrl(void) · 49 unmodified lines
45324535 if (vmx_pt_mode_is_system())
45334536 vmentry_ctrl &= ~(VM_ENTRY_PT_CONCEAL_PIP |
45344537 VM_ENTRY_LOAD_IA32_RTIT_CTL);
4538+
4539+ if (!enable_cet)
4540+ vmentry_ctrl &= ~VM_ENTRY_LOAD_CET_STATE;
4541+
45354542 /*
45364543 * IA32e mode, and loading of EFER and PERF_GLOBAL_CTRL are toggled dynamically.
45374544 */
@@ -4546,6 +4553,9 @@ static u32 vmx_get_initial_vmexit_ctrl(void) · 8 unmodified lines
45464553 {
45474554 u32 vmexit_ctrl = vmcs_config.vmexit_ctrl;
45484555
4556+ if (!enable_cet)
4557+ vmexit_ctrl &= ~VM_EXIT_LOAD_CET_STATE;
4558+
45494559 /*
45504560 * Not used by KVM and never set in vmcs01 or vmcs02, but emulated for
45514561 * nested virtualization and thus allowed to be set in vmcs12.
@@ -7029,8 +7039,8 @@ static void vmx_set_rvi(int vector) · 2477 unmodified lines
70297039 int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu)
70307040 {
70317041 struct vcpu_vt *vt = to_vt(vcpu);
7042+ bool max_irr_is_from_pir;
70327043 int max_irr;
7033− bool got_posted_interrupt;
70347044
70357045 if (KVM_BUG_ON(!enable_apicv, vcpu->kvm))
70367046 return -EIO;
@@ -7042,17 +7052,22 @@ int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu) · 5 unmodified lines
70427052 * But on x86 this is just a compiler barrier anyway.
70437053 */
70447054 smp_mb__after_atomic();
7045− got_posted_interrupt =
7046− kvm_apic_update_irr(vcpu, vt->pi_desc.pir, &max_irr);
7055+ max_irr_is_from_pir = kvm_apic_update_irr(vcpu, vt->pi_desc.pir,
7056+ &max_irr);
70477057 } else {
70487058 max_irr = kvm_lapic_find_highest_irr(vcpu);
7049− got_posted_interrupt = false;
7059+ max_irr_is_from_pir = false;
70507060 }
70517061
70527062 /*
7053− * Newly recognized interrupts are injected via either virtual interrupt
7054− * delivery (RVI) or KVM_REQ_EVENT. Virtual interrupt delivery is
7055− * disabled in two cases:
7063+ * If APICv is enabled and L2 is not active, then update the Requesting
7064+ * Virtual Interrupt (RVI) portion of vmcs01.GUEST_INTR_STATUS with the
7065+ * highest priority IRR to deliver the IRQ via Virtual Interrupt
7066+ * Delivery. Note, this is required even if the highest priority IRQ
7067+ * was already pending in the IRR, as RVI isn't updated in lockstep with
7068+ * the IRR (unlike apic->irr_pending).
7069+ *
7070+ * For the cases where Virtual Interrupt Delivery can't be used:
70567071 *
70577072 * 1) If L2 is running and the vCPU has a new pending interrupt. If L1
70587073 * wants to exit on interrupts, KVM_REQ_EVENT is needed to synthesize a
@@ -7063,10 +7078,29 @@ int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu) · 4 unmodified lines
70637078 * 2) If APICv is disabled for this vCPU, assigned devices may still
70647079 * attempt to post interrupts. The posted interrupt vector will cause
70657080 * a VM-Exit and the subsequent entry will call sync_pir_to_irr.
7081+ *
7082+ * In both cases, set KVM_REQ_EVENT if and only if the highest priority
7083+ * pending IRQ came from the PIR, as setting KVM_REQ_EVENT if any IRQ
7084+ * is pending may put the vCPU into an infinite loop, e.g. if the IRQ
7085+ * is blocked, then it will stay pending until an IRQ window is opened.
7086+ *
7087+ * Note! It's possible that one or more IRQs were moved from the PIR
7088+ * to the IRR _without_ max_irr_is_from_pir being true! I.e. if there
7089+ * was a higher priority IRQ already pending in the IRR. Not setting
7090+ * KVM_REQ_EVENT in this case is intentional and safe. If APICv is
7091+ * inactive, or L2 is running with exit-on-interrupt off (in vmcs12),
7092+ * i.e. without nested virtual interrupt delivery, then there's no need
7093+ * to request an IRQ window as the lower priority IRQ only needs to be
7094+ * delivered when the higher priority IRQ is dismissed from the ISR,
7095+ * i.e. on the next EOI, and EOIs are always intercepted if APICv is
7096+ * disabled or if L2 is running without nested VID. If L2 is running
7097+ * exit-on-interrupt on (in vmcs12), then the higher priority IRQ will
7098+ * trigger a nested VM-Exit, at which point KVM will re-evaluate L1's
7099+ * pending IRQs.
70667100 */
70677101 if (!is_guest_mode(vcpu) && kvm_vcpu_apicv_active(vcpu))
70687102 vmx_set_rvi(max_irr);
7069− else if (got_posted_interrupt)
7103+ else if (max_irr_is_from_pir)
70707104 kvm_make_request(KVM_REQ_EVENT, vcpu);
70717105
70727106 return max_irr;
@@ -7083,9 +7117,6 @@ void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) · 10 unmodified lines
70837117 vmcs_write64(EOI_EXIT_BITMAP3, eoi_exit_bitmap[3]);
70847118 }
70857119
7086−void vmx_do_interrupt_irqoff(unsigned long entry);
7087−void vmx_do_nmi_irqoff(void);
7088−
70897120 static void handle_nm_fault_irqoff(struct kvm_vcpu *vcpu)
70907121 {
70917122 /*
@@ -7127,17 +7158,8 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu, · 35 unmodified lines
71277158 "unexpected VM-Exit interrupt info: 0x%x", intr_info))
71287159 return;
71297160
7130− /*
7131− * Invoke the kernel's IRQ handler for the vector. Use the FRED path
7132− * when it's available even if FRED isn't fully enabled, e.g. even if
7133− * FRED isn't supported in hardware, in order to avoid the indirect
7134− * CALL in the non-FRED path.
7135− */
71367161 kvm_before_interrupt(vcpu, KVM_HANDLING_IRQ);
7137− if (IS_ENABLED(CONFIG_X86_FRED))
7138− fred_entry_from_kvm(EVENT_TYPE_EXTINT, vector);
7139− else
7140− vmx_do_interrupt_irqoff(gate_offset((gate_desc *)host_idt_base + vector));
7162+ x86_entry_from_kvm(EVENT_TYPE_EXTINT, vector);
71417163 kvm_after_interrupt(vcpu);
71427164
71437165 vcpu->arch.at_instruction_boundary = true;
@@ -7447,10 +7469,7 @@ noinstr void vmx_handle_nmi(struct kvm_vcpu *vcpu) · 303 unmodified lines
74477469 return;
74487470
74497471 kvm_before_interrupt(vcpu, KVM_HANDLING_NMI);
7450− if (cpu_feature_enabled(X86_FEATURE_FRED))
7451− fred_entry_from_kvm(EVENT_TYPE_NMI, NMI_VECTOR);
7452− else
7453− vmx_do_nmi_irqoff();
7472+ x86_entry_from_kvm(EVENT_TYPE_NMI, NMI_VECTOR);
74547473 kvm_after_interrupt(vcpu);
74557474 }
74567475
@@ -8131,7 +8150,7 @@ static __init void vmx_set_cpu_caps(void) · 674 unmodified lines
81318150 * VMX_BASIC[bit56] == 0, inject #CP at VMX entry with error code
81328151 * fails, so disable CET in this case too.
81338152 */
8134− if (!cpu_has_load_cet_ctrl() || !enable_unrestricted_guest ||
8153+ if (!enable_cet || !enable_unrestricted_guest ||
81358154 !cpu_has_vmx_basic_no_hw_errcode_cc()) {
81368155 kvm_cpu_cap_clear(X86_FEATURE_SHSTK);
81378156 kvm_cpu_cap_clear(X86_FEATURE_IBT);
@@ -8606,6 +8625,9 @@ __init int vmx_hardware_setup(void) · 468 unmodified lines
86068625 !cpu_has_vmx_invept_global())
86078626 enable_ept = 0;
86088627
8628+ if (!cpu_has_load_cet_ctrl())
8629+ enable_cet = 0;
8630+
86098631 /* NX support is required for shadow paging. */
86108632 if (!enable_ept && !boot_cpu_has(X86_FEATURE_NX)) {
86118633 pr_err_ratelimited("NX (Execute Disable) not supported\n");
arch/x86/kvm/x86.c+11−4
@@ -4876,7 +4876,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 4875 unmodified lines
48764876 r = tdp_enabled;
48774877 break;
48784878 case KVM_CAP_X86_APIC_BUS_CYCLES_NS:
4879− r = APIC_BUS_CYCLE_NS_DEFAULT;
4879+ r = kvm ? kvm->arch.apic_bus_cycle_ns : APIC_BUS_CYCLE_NS_DEFAULT;
48804880 break;
48814881 case KVM_CAP_EXIT_HYPERCALL:
48824882 r = KVM_EXIT_HYPERCALL_VALID_MASK;
@@ -5227,8 +5227,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 344 unmodified lines
52275227 * On a host with synchronized TSC, there is no need to update
52285228 * kvmclock on vcpu->cpu migration
52295229 */
5230− if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1)
5231− kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
5230+ if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1) {
5231+ if (__ratelimit(&vcpu->kvm->arch.kvmclock_update_rs))
5232+ kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
5233+ else
5234+ kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
5235+ }
5236+
52325237 if (vcpu->cpu != cpu)
52335238 kvm_make_request(KVM_REQ_MIGRATE_TIMER, vcpu);
52345239 vcpu->cpu = cpu;
@@ -13366,6 +13371,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) · 8131 unmodified lines
1336613371 raw_spin_lock_init(&kvm->arch.tsc_write_lock);
1336713372 mutex_init(&kvm->arch.apic_map_lock);
1336813373 seqcount_raw_spinlock_init(&kvm->arch.pvclock_sc, &kvm->arch.tsc_write_lock);
13374+ ratelimit_state_init(&kvm->arch.kvmclock_update_rs, HZ, 10);
13375+ ratelimit_set_flags(&kvm->arch.kvmclock_update_rs, RATELIMIT_MSG_ON_RELEASE);
1336913376 kvm->arch.kvmclock_offset = -get_kvmclock_base_ns();
1337013377
1337113378 raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
@@ -14323,7 +14330,7 @@ int kvm_handle_invpcid(struct kvm_vcpu *vcpu, unsigned long type, gva_t gva) · 951 unmodified lines
1432314330 * the RAP (Return Address Predicator).
1432414331 */
1432514332 if (guest_cpu_cap_has(vcpu, X86_FEATURE_ERAPS))
14326− kvm_register_is_dirty(vcpu, VCPU_EXREG_ERAPS);
14333+ kvm_register_mark_dirty(vcpu, VCPU_EXREG_ERAPS);
1432714334
1432814335 kvm_invalidate_pcid(vcpu, operand.pcid);
1432914336 return kvm_skip_emulated_instruction(vcpu);
arch/x86/mm/fault.c+1−1
@@ -686,7 +686,7 @@ page_fault_oops(struct pt_regs *regs, unsigned long error_code, · 685 unmodified lines
686686 * avoid hanging the system.
687687 */
688688 if (IS_ENABLED(CONFIG_EFI))
689− efi_crash_gracefully_on_page_fault(address);
689+ efi_crash_gracefully_on_page_fault(address, regs);
690690
691691 /* Only not-present faults should be handled by KFENCE. */
692692 if (!(error_code & X86_PF_PROT) &&
arch/x86/platform/efi/quirks.c+11−2
@@ -761,7 +761,8 @@ int efi_capsule_setup_info(struct capsule_info *cap_info, void *kbuff, · 760 unmodified lines
761761 * @return: Returns, if the page fault is not handled. This function
762762 * will never return if the page fault is handled successfully.
763763 */
764−void efi_crash_gracefully_on_page_fault(unsigned long phys_addr)
764+void efi_crash_gracefully_on_page_fault(unsigned long phys_addr,
765+ const struct pt_regs *regs)
765766 {
766767 if (!IS_ENABLED(CONFIG_X86_64))
767768 return;
@@ -770,7 +771,7 @@ void efi_crash_gracefully_on_page_fault(unsigned long phys_addr) · 2 unmodified lines
770771 * If we get an interrupt/NMI while processing an EFI runtime service
771772 * then this is a regular OOPS, not an EFI failure.
772773 */
773− if (in_interrupt())
774+ if (!in_task())
774775 return;
775776
776777 /*
@@ -810,6 +811,14 @@ void efi_crash_gracefully_on_page_fault(unsigned long phys_addr) · 33 unmodified lines
810811 return;
811812 }
812813
814+ /*
815+ * The API does not permit entering a kernel mode FPU section with
816+ * interrupts enabled and leaving it with interrupts disabled. So
817+ * re-enable interrupts now if they were enabled when the page fault
818+ * occurred.
819+ */
820+ local_irq_restore(regs->flags);
821+
813822 /*
814823 * Before calling EFI Runtime Service, the kernel has switched the
815824 * calling process to efi_mm. Hence, switch back to task_mm.
arch/x86/virt/hw.c+14−1
@@ -49,7 +49,20 @@ static void x86_virt_invoke_kvm_emergency_callback(void) · 48 unmodified lines
4949 {
5050 cpu_emergency_virt_cb *kvm_callback;
5151
52− kvm_callback = rcu_dereference(kvm_emergency_callback);
52+ /*
53+ * RCU may not be watching the crashing CPU here, so rcu_dereference()
54+ * triggers a suspicious-RCU-usage splat. In principle, a concurrent
55+ * KVM module unload could race with this read; see commit 2baa33a8ddd6
56+ * ("KVM: x86: Leave user-return notifier registered on reboot/shutdown")
57+ * which notes that nothing prevents module unload during panic/reboot.
58+ *
59+ * However, taking a lock here would be riskier than the current race:
60+ * the system is going down via NMI shootdown, and any lock could be
61+ * held by an already-stopped CPU. Use rcu_dereference_raw() to silence
62+ * the lockdep splat and accept the comically small remaining race;
63+ * panic context inherently cannot guarantee complete correctness.
64+ */
65+ kvm_callback = rcu_dereference_raw(kvm_emergency_callback);
5366 if (kvm_callback)
5467 kvm_callback();
5568 }
arch/x86/xen/mmu_pv.c+6−2
@@ -2145,7 +2145,10 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) · 2144 unmodified lines
21452145
21462146 static void xen_enter_lazy_mmu(void)
21472147 {
2148− enter_lazy(XEN_LAZY_MMU);
2148+ preempt_disable();
2149+ if (xen_get_lazy_mode() != XEN_LAZY_MMU)
2150+ enter_lazy(XEN_LAZY_MMU);
2151+ preempt_enable();
21492152 }
21502153
21512154 static void xen_flush_lazy_mmu(void)
@@ -2182,7 +2185,8 @@ static void xen_leave_lazy_mmu(void) · 30 unmodified lines
21822185 {
21832186 preempt_disable();
21842187 xen_mc_flush();
2185− leave_lazy(XEN_LAZY_MMU);
2188+ if (xen_get_lazy_mode() != XEN_LAZY_NONE)
2189+ leave_lazy(XEN_LAZY_MMU);
21862190 preempt_enable();
21872191 }
21882192
arch/x86/xen/setup.c+10−5
@@ -655,7 +655,7 @@ static void __init xen_e820_swap_entry_with_ram(struct e820_entry *swap_entry) · 654 unmodified lines
655655 /* Fill new entry (keep size and page offset). */
656656 entry->type = swap_entry->type;
657657 entry->addr = entry_end - swap_size +
658− swap_addr - swap_entry->addr;
658+ swap_entry->addr - swap_addr;
659659 entry->size = swap_entry->size;
660660
661661 /* Convert old entry to RAM, align to pages. */
@@ -695,17 +695,22 @@ static void __init xen_e820_resolve_conflicts(phys_addr_t start, · 33 unmodified lines
695695 return;
696696
697697 end = start + size;
698− entry = xen_e820_table.entries;
698+ mapcnt = 0;
699699
700− for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
700+ while (mapcnt < xen_e820_table.nr_entries) {
701+ entry = xen_e820_table.entries + mapcnt;
701702 if (entry->addr >= end)
702703 return;
703704
704705 if (entry->addr + entry->size > start &&
705− entry->type == E820_TYPE_NVS)
706+ entry->type == E820_TYPE_NVS) {
706707 xen_e820_swap_entry_with_ram(entry);
708+ /* E820 map has been changed, restart loop! */
709+ mapcnt = 0;
710+ continue;
711+ }
707712
708− entry++;
713+ mapcnt++;
709714 }
710715 }
711716
arch/xtensa/include/asm/Kbuild+1−0
@@ -6,5 +6,6 @@ generic-y += mcs_spinlock.h · 5 unmodified lines
66 generic-y += parport.h
77 generic-y += qrwlock.h
88 generic-y += qspinlock.h
9+generic-y += ring_buffer.h
910 generic-y += user.h
1011 generic-y += text-patching.h
block/bio-integrity-fs.c+5−1
@@ -55,6 +55,10 @@ int fs_bio_integrity_verify(struct bio *bio, sector_t sector, unsigned int size) · 54 unmodified lines
5555 {
5656 struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk);
5757 struct bio_integrity_payload *bip = bio_integrity(bio);
58+ struct bvec_iter data_iter = {
59+ .bi_sector = sector,
60+ .bi_size = size,
61+ };
5862
5963 /*
6064 * Reinitialize bip->bip_iter.
@@ -65,7 +69,7 @@ int fs_bio_integrity_verify(struct bio *bio, sector_t sector, unsigned int size) · 4 unmodified lines
6569 memset(&bip->bip_iter, 0, sizeof(bip->bip_iter));
6670 bip->bip_iter.bi_sector = sector;
6771 bip->bip_iter.bi_size = bio_integrity_bytes(bi, size >> SECTOR_SHIFT);
68− return blk_status_to_errno(bio_integrity_verify(bio, &bip->bip_iter));
72+ return blk_status_to_errno(bio_integrity_verify(bio, &data_iter));
6973 }
7074
7175 static int __init fs_bio_integrity_init(void)
block/bio-integrity.c+18−1
@@ -308,7 +308,6 @@ static int bio_integrity_copy_user(struct bio *bio, struct bio_vec *bvec, · 307 unmodified lines
308308 }
309309
310310 bip->bip_flags |= BIP_COPY_USER;
311− bip->bip_vcnt = nr_vecs;
312311 return 0;
313312 free_bip:
314313 bio_integrity_free(bio);
@@ -403,6 +402,24 @@ int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter) · 88 unmodified lines
403402 if (unlikely(ret < 0))
404403 goto free_bvec;
405404
405+ /*
406+ * Handle partial pinning. This can happen when pin_user_pages_fast()
407+ * returns fewer pages than requested.
408+ */
409+ if (user_backed_iter(iter) && unlikely(ret != bytes)) {
410+ if (ret > 0) {
411+ int npinned = DIV_ROUND_UP(offset + ret, PAGE_SIZE);
412+ int i;
413+
414+ for (i = 0; i < npinned; i++)
415+ unpin_user_page(pages[i]);
416+ }
417+ if (pages != stack_pages)
418+ kvfree(pages);
419+ ret = -EFAULT;
420+ goto free_bvec;
421+ }
422+
406423 nr_bvecs = bvec_from_pages(bvec, pages, nr_vecs, bytes, offset,
407424 &is_p2p);
408425 if (pages != stack_pages)
block/bio.c+15−12
@@ -1279,11 +1279,12 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter, · 1278 unmodified lines
12791279 return bio_iov_iter_align_down(bio, iter, len_align_mask);
12801280 }
12811281
1282−static struct folio *folio_alloc_greedy(gfp_t gfp, size_t *size)
1282+static struct folio *folio_alloc_greedy(gfp_t gfp, size_t *size,
1283+ size_t minsize)
12831284 {
12841285 struct folio *folio;
12851286
1286− while (*size > PAGE_SIZE) {
1287+ while (*size > minsize) {
12871288 folio = folio_alloc(gfp | __GFP_NORETRY, get_order(*size));
12881289 if (folio)
12891290 return folio;
@@ -1307,7 +1308,7 @@ static void bio_free_folios(struct bio *bio) · 17 unmodified lines
13071308 }
13081309
13091310 static int bio_iov_iter_bounce_write(struct bio *bio, struct iov_iter *iter,
1310− size_t maxlen)
1311+ size_t maxlen, size_t minsize)
13111312 {
13121313 size_t total_len = min(maxlen, iov_iter_count(iter));
13131314
@@ -1322,13 +1323,13 @@ static int bio_iov_iter_bounce_write(struct bio *bio, struct iov_iter *iter, · 8 unmodified lines
13221323 size_t this_len = min(total_len, SZ_1M);
13231324 struct folio *folio;
13241325
1325− if (this_len > PAGE_SIZE * 2)
1326+ if (this_len > minsize * 2)
13261327 this_len = rounddown_pow_of_two(this_len);
13271328
13281329 if (bio->bi_iter.bi_size > BIO_MAX_SIZE - this_len)
13291330 break;
13301331
1331− folio = folio_alloc_greedy(GFP_KERNEL, &this_len);
1332+ folio = folio_alloc_greedy(GFP_KERNEL, &this_len, minsize);
13321333 if (!folio)
13331334 break;
13341335 bio_add_folio_nofail(bio, folio, this_len, 0);
@@ -1344,16 +1345,16 @@ static int bio_iov_iter_bounce_write(struct bio *bio, struct iov_iter *iter, · 9 unmodified lines
13441345
13451346 if (!bio->bi_iter.bi_size)
13461347 return -ENOMEM;
1347− return 0;
1348+ return bio_iov_iter_align_down(bio, iter, minsize - 1);
13481349 }
13491350
13501351 static int bio_iov_iter_bounce_read(struct bio *bio, struct iov_iter *iter,
1351− size_t maxlen)
1352+ size_t maxlen, size_t minsize)
13521353 {
13531354 size_t len = min3(iov_iter_count(iter), maxlen, SZ_1M);
13541355 struct folio *folio;
13551356
1356− folio = folio_alloc_greedy(GFP_KERNEL, &len);
1357+ folio = folio_alloc_greedy(GFP_KERNEL, &len, minsize);
13571358 if (!folio)
13581359 return -ENOMEM;
13591360
@@ -1382,7 +1383,7 @@ static int bio_iov_iter_bounce_read(struct bio *bio, struct iov_iter *iter, · 22 unmodified lines
13821383 bvec_set_folio(&bio->bi_io_vec[0], folio, bio->bi_iter.bi_size, 0);
13831384 if (iov_iter_extract_will_pin(iter))
13841385 bio_set_flag(bio, BIO_PAGE_PINNED);
1385− return 0;
1386+ return bio_iov_iter_align_down(bio, iter, minsize - 1);
13861387 }
13871388
13881389 /**
@@ -1390,6 +1391,7 @@ static int bio_iov_iter_bounce_read(struct bio *bio, struct iov_iter *iter, · 1 unmodified line
13901391 * @bio: bio to send
13911392 * @iter: iter to read from / write into
13921393 * @maxlen: maximum size to bounce
1394+ * @minsize: minimum folio allocation size
13931395 *
13941396 * Helper for direct I/O implementations that need to bounce buffer because
13951397 * we need to checksum the data or perform other operations that require
@@ -1397,11 +1399,12 @@ static int bio_iov_iter_bounce_read(struct bio *bio, struct iov_iter *iter, · 1 unmodified line
13971399 * copies the data into it. Needs to be paired with bio_iov_iter_unbounce()
13981400 * called on completion.
13991401 */
1400−int bio_iov_iter_bounce(struct bio *bio, struct iov_iter *iter, size_t maxlen)
1402+int bio_iov_iter_bounce(struct bio *bio, struct iov_iter *iter, size_t maxlen,
1403+ size_t minsize)
14011404 {
14021405 if (op_is_write(bio_op(bio)))
1403− return bio_iov_iter_bounce_write(bio, iter, maxlen);
1404− return bio_iov_iter_bounce_read(bio, iter, maxlen);
1406+ return bio_iov_iter_bounce_write(bio, iter, maxlen, minsize);
1407+ return bio_iov_iter_bounce_read(bio, iter, maxlen, minsize);
14051408 }
14061409
14071410 static void bvec_unpin(struct bio_vec *bv, bool mark_dirty)
block/blk-cgroup.c+1−1
@@ -2241,7 +2241,7 @@ void blk_cgroup_bio_start(struct bio *bio) · 2240 unmodified lines
22412241 }
22422242
22432243 u64_stats_update_end_irqrestore(&bis->sync, flags);
2244− css_rstat_updated(&blkcg->css, cpu);
2244+ __css_rstat_updated(&blkcg->css, cpu);
22452245 put_cpu();
22462246 }
22472247
block/blk-mq.c+28−25
@@ -3077,7 +3077,7 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q, · 3076 unmodified lines
30773077 /*
30783078 * Check if there is a suitable cached request and return it.
30793079 */
3080−static struct request *blk_mq_peek_cached_request(struct blk_plug *plug,
3080+static struct request *blk_mq_get_cached_request(struct blk_plug *plug,
30813081 struct request_queue *q, blk_opf_t opf)
30823082 {
30833083 enum hctx_type type = blk_mq_get_hctx_type(opf);
@@ -3093,27 +3093,10 @@ static struct request *blk_mq_peek_cached_request(struct blk_plug *plug, · 9 unmodified lines
30933093 return NULL;
30943094 if (op_is_flush(rq->cmd_flags) != op_is_flush(opf))
30953095 return NULL;
3096+ rq_list_pop(&plug->cached_rqs);
30963097 return rq;
30973098 }
30983099
3099−static void blk_mq_use_cached_rq(struct request *rq, struct blk_plug *plug,
3100− struct bio *bio)
3101−{
3102− if (rq_list_pop(&plug->cached_rqs) != rq)
3103− WARN_ON_ONCE(1);
3104−
3105− /*
3106− * If any qos ->throttle() end up blocking, we will have flushed the
3107− * plug and hence killed the cached_rq list as well. Pop this entry
3108− * before we throttle.
3109− */
3110− rq_qos_throttle(rq->q, bio);
3111−
3112− blk_mq_rq_time_init(rq, blk_time_get_ns());
3113− rq->cmd_flags = bio->bi_opf;
3114− INIT_LIST_HEAD(&rq->queuelist);
3115−}
3116−
31173100 static bool bio_unaligned(const struct bio *bio, struct request_queue *q)
31183101 {
31193102 unsigned int bs_mask = queue_logical_block_size(q) - 1;
@@ -3152,7 +3135,7 @@ void blk_mq_submit_bio(struct bio *bio) · 32 unmodified lines
31523135 /*
31533136 * If the plug has a cached request for this queue, try to use it.
31543137 */
3155− rq = blk_mq_peek_cached_request(plug, q, bio->bi_opf);
3138+ rq = blk_mq_get_cached_request(plug, q, bio->bi_opf);
31563139
31573140 /*
31583141 * A BIO that was released from a zone write plug has already been
@@ -3211,7 +3194,10 @@ void blk_mq_submit_bio(struct bio *bio) · 52 unmodified lines
32113194
32123195 new_request:
32133196 if (rq) {
3214− blk_mq_use_cached_rq(rq, plug, bio);
3197+ rq_qos_throttle(rq->q, bio);
3198+ blk_mq_rq_time_init(rq, blk_time_get_ns());
3199+ rq->cmd_flags = bio->bi_opf;
3200+ INIT_LIST_HEAD(&rq->queuelist);
32153201 } else {
32163202 rq = blk_mq_get_new_requests(q, plug, bio);
32173203 if (unlikely(!rq)) {
@@ -3257,12 +3243,10 @@ new_request: · 39 unmodified lines
32573243 return;
32583244
32593245 queue_exit:
3260− /*
3261− * Don't drop the queue reference if we were trying to use a cached
3262− * request and thus didn't acquire one.
3263− */
32643246 if (!rq)
32653247 blk_queue_exit(q);
3248+ else
3249+ rq_list_add_head(&plug->cached_rqs, rq);
32663250 }
32673251
32683252 #ifdef CONFIG_BLK_MQ_STACKING
@@ -3307,6 +3291,25 @@ blk_status_t blk_insert_cloned_request(struct request *rq) · 38 unmodified lines
33073291 return BLK_STS_IOERR;
33083292 }
33093293
3294+ /*
3295+ * Integrity segment counting depends on the same queue limits
3296+ * (virt_boundary_mask, seg_boundary_mask, max_segment_size) that
3297+ * vary across stacked queues, so recompute against the bottom
3298+ * queue just like nr_phys_segments above.
3299+ */
3300+ if (blk_integrity_rq(rq) && rq->bio) {
3301+ unsigned short max_int_segs = queue_max_integrity_segments(q);
3302+
3303+ rq->nr_integrity_segments =
3304+ blk_rq_count_integrity_sg(rq->q, rq->bio);
3305+ if (rq->nr_integrity_segments > max_int_segs) {
3306+ printk(KERN_ERR "%s: over max integrity segments limit. (%u > %u)\n",
3307+ __func__, rq->nr_integrity_segments,
3308+ max_int_segs);
3309+ return BLK_STS_IOERR;
3310+ }
3311+ }
3312+
33103313 if (q->disk && should_fail_request(q->disk->part0, blk_rq_bytes(rq)))
33113314 return BLK_STS_IOERR;
33123315
block/blk-zoned.c+30−9
@@ -623,6 +623,28 @@ static void disk_mark_zone_wplug_dead(struct blk_zone_wplug *zwplug) · 622 unmodified lines
623623 }
624624 }
625625
626+static inline bool disk_check_zone_wplug_dead(struct blk_zone_wplug *zwplug)
627+{
628+ if (!(zwplug->flags & BLK_ZONE_WPLUG_DEAD))
629+ return false;
630+
631+ /*
632+ * If a new write is received right after a zone reset completes and
633+ * while the disk_zone_wplugs_worker() thread has not yet released the
634+ * reference on the zone write plug after processing the last write to
635+ * the zone, then the new write BIO will see the zone write plug marked
636+ * as dead. This case is however a false positive and a perfectly valid
637+ * pattern. In such case, restore the zone write plug to a live one.
638+ */
639+ if (!zwplug->wp_offset && bio_list_empty(&zwplug->bio_list)) {
640+ zwplug->flags &= ~BLK_ZONE_WPLUG_DEAD;
641+ refcount_inc(&zwplug->ref);
642+ return false;
643+ }
644+
645+ return true;
646+}
647+
626648 static bool disk_zone_wplug_submit_bio(struct gendisk *disk,
627649 struct blk_zone_wplug *zwplug);
628650
@@ -1444,12 +1466,12 @@ static bool blk_zone_wplug_handle_write(struct bio *bio, unsigned int nr_segs) · 815 unmodified lines
14441466 spin_lock_irqsave(&zwplug->lock, flags);
14451467
14461468 /*
1447− * If we got a zone write plug marked as dead, then the user is issuing
1448− * writes to a full zone, or without synchronizing with zone reset or
1449− * zone finish operations. In such case, fail the BIO to signal this
1450− * invalid usage.
1469+ * Check if we got a zone write plug marked as dead. If yes, then the
1470+ * user is likely issuing writes to a full zone, or without
1471+ * synchronizing with zone reset or zone finish operations. In such
1472+ * case, fail the BIO to signal this invalid usage.
14511473 */
1452− if (zwplug->flags & BLK_ZONE_WPLUG_DEAD) {
1474+ if (disk_check_zone_wplug_dead(zwplug)) {
14531475 spin_unlock_irqrestore(&zwplug->lock, flags);
14541476 disk_put_zone_wplug(zwplug);
14551477 bio_io_error(bio);
@@ -1979,8 +2001,10 @@ static void disk_set_zones_cond_array(struct gendisk *disk, u8 *zones_cond) · 523 unmodified lines
19792001
19802002 void disk_free_zone_resources(struct gendisk *disk)
19812003 {
1982− if (disk->zone_wplugs_worker)
2004+ if (disk->zone_wplugs_worker) {
19832005 kthread_stop(disk->zone_wplugs_worker);
2006+ disk->zone_wplugs_worker = NULL;
2007+ }
19842008 WARN_ON_ONCE(!list_empty(&disk->zone_wplugs_list));
19852009
19862010 if (disk->zone_wplugs_wq) {
@@ -2113,9 +2137,6 @@ commit: · 126 unmodified lines
21132137 ret = queue_limits_commit_update(q, &lim);
21142138
21152139 unfreeze:
2116− if (ret)
2117− disk_free_zone_resources(disk);
2118−
21192140 blk_mq_unfreeze_queue(q, memflags);
21202141
21212142 return ret;
block/ioctl.c+15−9
@@ -857,6 +857,8 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) · 856 unmodified lines
857857 #endif
858858
859859 struct blk_iou_cmd {
860+ u64 start;
861+ u64 len;
860862 int res;
861863 bool nowait;
862864 };
@@ -946,23 +948,27 @@ int blkdev_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags) · 83 unmodified lines
946948 {
947949 struct block_device *bdev = I_BDEV(cmd->file->f_mapping->host);
948950 struct blk_iou_cmd *bic = io_uring_cmd_to_pdu(cmd, struct blk_iou_cmd);
949− const struct io_uring_sqe *sqe = cmd->sqe;
950951 u32 cmd_op = cmd->cmd_op;
951− uint64_t start, len;
952952
953− if (unlikely(sqe->ioprio || sqe->__pad1 || sqe->len ||
954− sqe->rw_flags || sqe->file_index))
955− return -EINVAL;
953+ /* Read what we need from the SQE on the first issue */
954+ if (!(issue_flags & IORING_URING_CMD_REISSUE)) {
955+ const struct io_uring_sqe *sqe = cmd->sqe;
956+
957+ if (unlikely(sqe->ioprio || sqe->__pad1 || sqe->len ||
958+ sqe->rw_flags || sqe->file_index))
959+ return -EINVAL;
960+
961+ bic->start = READ_ONCE(sqe->addr);
962+ bic->len = READ_ONCE(sqe->addr3);
963+ }
956964
957965 bic->res = 0;
958966 bic->nowait = issue_flags & IO_URING_F_NONBLOCK;
959967
960− start = READ_ONCE(sqe->addr);
961− len = READ_ONCE(sqe->addr3);
962−
963968 switch (cmd_op) {
964969 case BLOCK_URING_CMD_DISCARD:
965− return blkdev_cmd_discard(cmd, bdev, start, len, bic->nowait);
970+ return blkdev_cmd_discard(cmd, bdev, bic->start, bic->len,
971+ bic->nowait);
966972 }
967973 return -EINVAL;
968974 }
crypto/authencesn.c+5−0
@@ -390,6 +390,11 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl, · 389 unmodified lines
390390 auth = crypto_spawn_ahash_alg(&ctx->auth);
391391 auth_base = &auth->base;
392392
393+ if (auth->digestsize > 0 && auth->digestsize < 4) {
394+ err = -EINVAL;
395+ goto err_free_inst;
396+ }
397+
393398 err = crypto_grab_skcipher(&ctx->enc, aead_crypto_instance(inst),
394399 crypto_attr_alg_name(tb[2]), 0, mask);
395400 if (err)
crypto/krb5/krb5_api.c+48−6
@@ -134,27 +134,69 @@ EXPORT_SYMBOL(crypto_krb5_how_much_data); · 133 unmodified lines
134134 * Find the offset and size of the data in a secure message so that this
135135 * information can be used in the metadata buffer which will get added to the
136136 * digest by crypto_krb5_verify_mic().
137+ *
138+ * Return: 0 if successful, -EBADMSG if the message is too short or -EINVAL if
139+ * the mode is unsupported.
137140 */
138−void crypto_krb5_where_is_the_data(const struct krb5_enctype *krb5,
139− enum krb5_crypto_mode mode,
140− size_t *_offset, size_t *_len)
141+int crypto_krb5_where_is_the_data(const struct krb5_enctype *krb5,
142+ enum krb5_crypto_mode mode,
143+ size_t *_offset, size_t *_len)
141144 {
142145 switch (mode) {
143146 case KRB5_CHECKSUM_MODE:
147+ if (*_len < krb5->cksum_len)
148+ return -EBADMSG;
144149 *_offset += krb5->cksum_len;
145150 *_len -= krb5->cksum_len;
146− return;
151+ return 0;
147152 case KRB5_ENCRYPT_MODE:
153+ if (*_len < krb5->conf_len + krb5->cksum_len)
154+ return -EBADMSG;
148155 *_offset += krb5->conf_len;
149156 *_len -= krb5->conf_len + krb5->cksum_len;
150− return;
157+ return 0;
151158 default:
152159 WARN_ON_ONCE(1);
153− return;
160+ return -EINVAL;
154161 }
155162 }
156163 EXPORT_SYMBOL(crypto_krb5_where_is_the_data);
157164
165+/**
166+ * crypto_krb5_check_data_len - Check a message is big enough
167+ * @krb5: The encoding to use.
168+ * @mode: Mode of operation.
169+ * @len: The length of the secure blob.
170+ * @min_content: Minimum length of the content inside the blob.
171+ *
172+ * Check that a message is large enough to hold whatever bits the encryption
173+ * type wants to glue on (nonce, checksum) plus a minimum amount of content.
174+ *
175+ * Return: 0 if successful, -EBADMSG if the message is too short or -EINVAL if
176+ * the mode is unsupported.
177+ */
178+int crypto_krb5_check_data_len(const struct krb5_enctype *krb5,
179+ enum krb5_crypto_mode mode,
180+ size_t len, size_t min_content)
181+{
182+ switch (mode) {
183+ case KRB5_CHECKSUM_MODE:
184+ if (len < krb5->cksum_len ||
185+ len - krb5->cksum_len < min_content)
186+ return -EBADMSG;
187+ return 0;
188+ case KRB5_ENCRYPT_MODE:
189+ if (len < krb5->conf_len + krb5->cksum_len ||
190+ len - (krb5->conf_len + krb5->cksum_len) < min_content)
191+ return -EBADMSG;
192+ return 0;
193+ default:
194+ WARN_ON_ONCE(1);
195+ return -EINVAL;
196+ }
197+}
198+EXPORT_SYMBOL(crypto_krb5_check_data_len);
199+
158200 /*
159201 * Prepare the encryption with derived key data.
160202 */
drivers/accel/amdxdna/aie2_pci.c+5−0
@@ -511,6 +511,11 @@ static int aie2_init(struct amdxdna_dev *xdna) · 510 unmodified lines
511511 return -EINVAL;
512512 }
513513
514+ if (!xdna->group) {
515+ XDNA_ERR(xdna, "Running without IOMMU not supported");
516+ return -EINVAL;
517+ }
518+
514519 ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
515520 if (!ndev)
516521 return -ENOMEM;
drivers/accel/amdxdna/amdxdna_gem.c+8−1
@@ -490,6 +490,9 @@ static struct dma_buf *amdxdna_gem_prime_export(struct drm_gem_object *gobj, int · 489 unmodified lines
490490 struct amdxdna_gem_obj *abo = to_xdna_obj(gobj);
491491 DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
492492
493+ if (abo->private_buffer)
494+ return ERR_PTR(-EOPNOTSUPP);
495+
493496 if (abo->dma_buf) {
494497 get_dma_buf(abo->dma_buf);
495498 return abo->dma_buf;
@@ -685,6 +688,7 @@ amdxdna_gem_create_ubuf_object(struct drm_device *dev, struct amdxdna_drm_create · 189 unmodified lines
685688 {
686689 struct amdxdna_dev *xdna = to_xdna_dev(dev);
687690 struct amdxdna_drm_va_tbl va_tbl;
691+ struct amdxdna_gem_obj *abo;
688692 struct drm_gem_object *gobj;
689693 struct dma_buf *dma_buf;
690694
@@ -711,7 +715,10 @@ amdxdna_gem_create_ubuf_object(struct drm_device *dev, struct amdxdna_drm_create · 20 unmodified lines
711715
712716 dma_buf_put(dma_buf);
713717
714− return to_xdna_obj(gobj);
718+ abo = to_xdna_obj(gobj);
719+ abo->private_buffer = true;
720+
721+ return abo;
715722 }
716723
717724 struct drm_gem_object *
drivers/accel/amdxdna/amdxdna_gem.h+2−0
@@ -54,6 +54,8 @@ struct amdxdna_gem_obj { · 53 unmodified lines
5454
5555 /* True, if BO is managed by XRT, not application */
5656 bool internal;
57+ /* True, if BO is not exportable */
58+ bool private_buffer;
5759 };
5860
5961 #define to_gobj(obj) (&(obj)->base.base)
drivers/accel/amdxdna/amdxdna_ubuf.c+0−50
@@ -69,60 +69,10 @@ static void amdxdna_ubuf_release(struct dma_buf *dbuf) · 68 unmodified lines
6969 kfree(ubuf);
7070 }
7171
72−static vm_fault_t amdxdna_ubuf_vm_fault(struct vm_fault *vmf)
73−{
74− struct vm_area_struct *vma = vmf->vma;
75− struct amdxdna_ubuf_priv *ubuf;
76− unsigned long pfn;
77− pgoff_t pgoff;
78−
79− ubuf = vma->vm_private_data;
80− pgoff = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
81−
82− pfn = page_to_pfn(ubuf->pages[pgoff]);
83− return vmf_insert_pfn(vma, vmf->address, pfn);
84−}
85−
86−static const struct vm_operations_struct amdxdna_ubuf_vm_ops = {
87− .fault = amdxdna_ubuf_vm_fault,
88−};
89−
90−static int amdxdna_ubuf_mmap(struct dma_buf *dbuf, struct vm_area_struct *vma)
91−{
92− struct amdxdna_ubuf_priv *ubuf = dbuf->priv;
93−
94− vma->vm_ops = &amdxdna_ubuf_vm_ops;
95− vma->vm_private_data = ubuf;
96− vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
97−
98− return 0;
99−}
100−
101−static int amdxdna_ubuf_vmap(struct dma_buf *dbuf, struct iosys_map *map)
102−{
103− struct amdxdna_ubuf_priv *ubuf = dbuf->priv;
104− void *kva;
105−
106− kva = vmap(ubuf->pages, ubuf->nr_pages, VM_MAP, PAGE_KERNEL);
107− if (!kva)
108− return -EINVAL;
109−
110− iosys_map_set_vaddr(map, kva);
111− return 0;
112−}
113−
114−static void amdxdna_ubuf_vunmap(struct dma_buf *dbuf, struct iosys_map *map)
115−{
116− vunmap(map->vaddr);
117−}
118−
11972 static const struct dma_buf_ops amdxdna_ubuf_dmabuf_ops = {
12073 .map_dma_buf = amdxdna_ubuf_map,
12174 .unmap_dma_buf = amdxdna_ubuf_unmap,
12275 .release = amdxdna_ubuf_release,
123− .mmap = amdxdna_ubuf_mmap,
124− .vmap = amdxdna_ubuf_vmap,
125− .vunmap = amdxdna_ubuf_vunmap,
12676 };
12777
12878 struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev,
drivers/accel/ivpu/ivpu_debugfs.c+1−1
@@ -450,7 +450,7 @@ priority_bands_fops_write(struct file *file, const char __user *user_buf, size_t · 449 unmodified lines
450450 u32 band;
451451 int ret;
452452
453− if (size >= sizeof(buf))
453+ if (*pos != 0 || size >= sizeof(buf))
454454 return -EINVAL;
455455
456456 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, pos, user_buf, size);
drivers/accel/ivpu/ivpu_drv.c+21−0
@@ -537,6 +537,26 @@ static const struct file_operations ivpu_fops = { · 536 unmodified lines
537537 #endif
538538 };
539539
540+static int ivpu_gem_prime_handle_to_fd(struct drm_device *dev, struct drm_file *file_priv,
541+ u32 handle, u32 flags, int *prime_fd)
542+{
543+ struct drm_gem_object *obj;
544+
545+ obj = drm_gem_object_lookup(file_priv, handle);
546+ if (!obj)
547+ return -ENOENT;
548+
549+ if (drm_gem_is_imported(obj)) {
550+ /* Do not allow re-exporting */
551+ drm_gem_object_put(obj);
552+ return -EOPNOTSUPP;
553+ }
554+
555+ drm_gem_object_put(obj);
556+
557+ return drm_gem_prime_handle_to_fd(dev, file_priv, handle, flags, prime_fd);
558+}
559+
540560 static const struct drm_driver driver = {
541561 .driver_features = DRIVER_GEM | DRIVER_COMPUTE_ACCEL,
542562
@@ -545,6 +565,7 @@ static const struct drm_driver driver = { · 2 unmodified lines
545565
546566 .gem_create_object = ivpu_gem_create_object,
547567 .gem_prime_import = ivpu_gem_prime_import,
568+ .prime_handle_to_fd = ivpu_gem_prime_handle_to_fd,
548569
549570 .ioctls = ivpu_drm_ioctls,
550571 .num_ioctls = ARRAY_SIZE(ivpu_drm_ioctls),
drivers/accel/qaic/qaic_data.c+21−2
@@ -606,8 +606,11 @@ static const struct vm_operations_struct drm_vm_ops = { · 605 unmodified lines
606606 static int qaic_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
607607 {
608608 struct qaic_bo *bo = to_qaic_bo(obj);
609+ unsigned long remap_start;
609610 unsigned long offset = 0;
611+ unsigned long remap_end;
610612 struct scatterlist *sg;
613+ unsigned long length;
611614 int ret = 0;
612615
613616 if (drm_gem_is_imported(obj))
@@ -615,11 +618,27 @@ static int qaic_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struc · 1 unmodified line
615618
616619 for (sg = bo->sgt->sgl; sg; sg = sg_next(sg)) {
617620 if (sg_page(sg)) {
621+ /* if sg is too large for the VMA, so truncate it to fit */
622+ if (check_add_overflow(vma->vm_start, offset, &remap_start))
623+ return -EINVAL;
624+ if (check_add_overflow(remap_start, sg->length, &remap_end))
625+ return -EINVAL;
626+
627+ if (remap_end > vma->vm_end) {
628+ if (check_sub_overflow(vma->vm_end, remap_start, &length))
629+ return -EINVAL;
630+ } else {
631+ length = sg->length;
632+ }
633+
634+ if (length == 0)
635+ goto out;
636+
618637 ret = remap_pfn_range(vma, vma->vm_start + offset, page_to_pfn(sg_page(sg)),
619− sg->length, vma->vm_page_prot);
638+ length, vma->vm_page_prot);
620639 if (ret)
621640 goto out;
622− offset += sg->length;
641+ offset += length;
623642 }
624643 }
625644
drivers/accel/qaic/qaic_ras.c+2−2
@@ -497,11 +497,11 @@ static void decode_ras_msg(struct qaic_device *qdev, struct ras_data *msg) · 496 unmodified lines
497497 qdev->ce_count++;
498498 break;
499499 case UE:
500− if (qdev->ce_count != UINT_MAX)
500+ if (qdev->ue_count != UINT_MAX)
501501 qdev->ue_count++;
502502 break;
503503 case UE_NF:
504− if (qdev->ce_count != UINT_MAX)
504+ if (qdev->ue_nf_count != UINT_MAX)
505505 qdev->ue_nf_count++;
506506 break;
507507 default:
drivers/accel/rocket/rocket_gem.c+14−5
@@ -79,11 +79,6 @@ int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file * · 78 unmodified lines
7979 rkt_obj->size = args->size;
8080 rkt_obj->offset = 0;
8181
82− ret = drm_gem_handle_create(file, gem_obj, &args->handle);
83− drm_gem_object_put(gem_obj);
84− if (ret)
85− goto err;
86−
8782 sgt = drm_gem_shmem_get_pages_sgt(shmem_obj);
8883 if (IS_ERR(sgt)) {
8984 ret = PTR_ERR(sgt);
@@ -95,6 +90,8 @@ int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file * · 5 unmodified lines
9590 rkt_obj->size, PAGE_SIZE,
9691 0, 0);
9792 mutex_unlock(&rocket_priv->mm_lock);
93+ if (ret)
94+ goto err;
9895
9996 ret = iommu_map_sgtable(rocket_priv->domain->domain,
10097 rkt_obj->mm.start,
@@ -112,8 +109,18 @@ int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file * · 11 unmodified lines
112109 args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node);
113110 args->dma_address = rkt_obj->mm.start;
114111
112+ ret = drm_gem_handle_create(file, gem_obj, &args->handle);
113+ if (ret)
114+ goto err_unmap;
115+
116+ drm_gem_object_put(gem_obj);
117+
115118 return 0;
116119
120+err_unmap:
121+ iommu_unmap(rocket_priv->domain->domain,
122+ rkt_obj->mm.start, rkt_obj->size);
123+
117124 err_remove_node:
118125 mutex_lock(&rocket_priv->mm_lock);
119126 drm_mm_remove_node(&rkt_obj->mm);
@@ -145,6 +152,8 @@ int rocket_ioctl_prep_bo(struct drm_device *dev, void *data, struct drm_file *fi · 25 unmodified lines
145152 ret = dma_resv_wait_timeout(gem_obj->resv, DMA_RESV_USAGE_WRITE, true, timeout);
146153 if (!ret)
147154 ret = timeout ? -ETIMEDOUT : -EBUSY;
155+ else if (ret > 0)
156+ ret = 0;
148157
149158 shmem_obj = &to_rocket_bo(gem_obj)->base;
150159
drivers/acpi/ac.c+5−1
@@ -192,11 +192,15 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = { · 191 unmodified lines
192192
193193 static int acpi_ac_probe(struct platform_device *pdev)
194194 {
195− struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
196195 struct power_supply_config psy_cfg = {};
196+ struct acpi_device *adev;
197197 struct acpi_ac *ac;
198198 int result;
199199
200+ adev = ACPI_COMPANION(&pdev->dev);
201+ if (!adev)
202+ return -ENODEV;
203+
200204 ac = kzalloc_obj(struct acpi_ac);
201205 if (!ac)
202206 return -ENOMEM;
drivers/acpi/acpi_pad.c+5−1
@@ -423,7 +423,11 @@ static void acpi_pad_notify(acpi_handle handle, u32 event, void *data) · 422 unmodified lines
423423
424424 static int acpi_pad_probe(struct platform_device *pdev)
425425 {
426− struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
426+ struct acpi_device *adev;
427+
428+ adev = ACPI_COMPANION(&pdev->dev);
429+ if (!adev)
430+ return -ENODEV;
427431
428432 return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
429433 acpi_pad_notify, adev);
drivers/acpi/acpi_tad.c+24−17
@@ -605,15 +605,12 @@ static umode_t acpi_tad_attr_is_visible(struct kobject *kobj, · 604 unmodified lines
605605 return 0;
606606 }
607607
608−static const struct attribute_group acpi_tad_attr_group = {
608+static const struct attribute_group acpi_tad_group = {
609609 .attrs = acpi_tad_attrs,
610610 .is_visible = acpi_tad_attr_is_visible,
611611 };
612612
613−static const struct attribute_group *acpi_tad_attr_groups[] = {
614− &acpi_tad_attr_group,
615− NULL,
616−};
613+__ATTRIBUTE_GROUPS(acpi_tad);
617614
618615 #ifdef CONFIG_RTC_CLASS
619616 /* RTC class device interface */
@@ -683,9 +680,8 @@ static int acpi_tad_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *t) · 63 unmodified lines
683680
684681 acpi_tad_rt_to_tm(&rt, &tm_now);
685682
686− value = ktime_divns(ktime_sub(rtc_tm_to_ktime(t->time),
687− rtc_tm_to_ktime(tm_now)), NSEC_PER_SEC);
688− if (value <= 0 || value > U32_MAX)
683+ value = rtc_tm_to_time64(&t->time) - rtc_tm_to_time64(&tm_now);
684+ if (value <= 0 || value >= U32_MAX)
689685 return -EINVAL;
690686 }
691687
@@ -748,8 +744,7 @@ static int acpi_tad_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) · 56 unmodified lines
748744
749745 if (retval != ACPI_TAD_WAKE_DISABLED) {
750746 t->enabled = 1;
751− t->time = rtc_ktime_to_tm(ktime_add_ns(rtc_tm_to_ktime(tm_now),
752− (u64)retval * NSEC_PER_SEC));
747+ rtc_time64_to_tm(rtc_tm_to_time64(&tm_now) + retval, &t->time);
753748 } else {
754749 t->enabled = 0;
755750 t->time = tm_now;
@@ -795,9 +790,9 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id) · 39 unmodified lines
795790 return acpi_tad_wake_set(dev, "_STV", timer_id, ACPI_TAD_WAKE_DISABLED);
796791 }
797792
798−static void acpi_tad_remove(struct platform_device *pdev)
793+static void acpi_tad_remove(void *data)
799794 {
800− struct device *dev = &pdev->dev;
795+ struct device *dev = data;
801796 struct acpi_tad_driver_data *dd = dev_get_drvdata(dev);
802797
803798 device_init_wakeup(dev, false);
@@ -820,10 +815,15 @@ static void acpi_tad_remove(struct platform_device *pdev) · 16 unmodified lines
820815 static int acpi_tad_probe(struct platform_device *pdev)
821816 {
822817 struct device *dev = &pdev->dev;
823− acpi_handle handle = ACPI_HANDLE(dev);
824818 struct acpi_tad_driver_data *dd;
819+ acpi_handle handle;
825820 acpi_status status;
826821 unsigned long long caps;
822+ int ret;
823+
824+ handle = ACPI_HANDLE(dev);
825+ if (!handle)
826+ return -ENODEV;
827827
828828 /*
829829 * Initialization failure messages are mostly about firmware issues, so
@@ -863,13 +863,21 @@ static int acpi_tad_probe(struct platform_device *pdev) · 33 unmodified lines
863863 }
864864
865865 /*
866− * The platform bus type layer tells the ACPI PM domain powers up the
867− * device, so set the runtime PM status of it to "active".
866+ * The platform bus type probe callback tells the ACPI PM domain to
867+ * power up the device, so set the runtime PM status of it to "active".
868868 */
869869 pm_runtime_set_active(dev);
870870 pm_runtime_enable(dev);
871871 pm_runtime_suspend(dev);
872872
873+ /*
874+ * acpi_tad_remove() needs to run after unregistering the RTC class
875+ * device to avoid racing with the latter's callbacks.
876+ */
877+ ret = devm_add_action_or_reset(&pdev->dev, acpi_tad_remove, &pdev->dev);
878+ if (ret)
879+ return ret;
880+
873881 if (caps & ACPI_TAD_RT)
874882 acpi_tad_register_rtc(dev, caps);
875883
@@ -885,10 +893,9 @@ static struct platform_driver acpi_tad_driver = { · 9 unmodified lines
885893 .driver = {
886894 .name = "acpi-tad",
887895 .acpi_match_table = acpi_tad_ids,
888− .dev_groups = acpi_tad_attr_groups,
896+ .dev_groups = acpi_tad_groups,
889897 },
890898 .probe = acpi_tad_probe,
891− .remove = acpi_tad_remove,
892899 };
893900 MODULE_DEVICE_TABLE(acpi, acpi_tad_ids);
894901
drivers/acpi/acpica/evxfgpe.c+41−9
@@ -78,18 +78,22 @@ ACPI_EXPORT_SYMBOL(acpi_update_all_gpes) · 77 unmodified lines
7878
7979 /*******************************************************************************
8080 *
81− * FUNCTION: acpi_enable_gpe
81+ * FUNCTION: acpi_enable_gpe_cond
8282 *
8383 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
8484 * gpe_number - GPE level within the GPE block
85+ * dispatch_type - GPE dispatch type to match
8586 *
8687 * RETURN: Status
8788 *
88− * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
89− * hardware-enabled.
89+ * DESCRIPTION: Add a reference to a GPE so long as its dispatch type matches
90+ * the supplied one, or it is different from ACPI_GPE_DISPATCH_NONE
91+ * if the supplied one is ACPI_GPE_DISPATCH_MASK. On the first
92+ * reference, the GPE is hardware-enabled.
9093 *
9194 ******************************************************************************/
92−acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
95+acpi_status acpi_enable_gpe_cond(acpi_handle gpe_device, u32 gpe_number,
96+ u8 dispatch_type)
9397 {
9498 acpi_status status = AE_BAD_PARAMETER;
9599 struct acpi_gpe_event_info *gpe_event_info;
@@ -100,14 +104,18 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number) · 4 unmodified lines
100104 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
101105
102106 /*
103− * Ensure that we have a valid GPE number and that there is some way
104− * of handling the GPE (handler or a GPE method). In other words, we
105− * won't allow a valid GPE to be enabled if there is no way to handle it.
107+ * Ensure that we have a valid GPE number and that the dispatch type of
108+ * the GPE matches the supplied one (or it is not ACPI_GPE_DISPATCH_NONE
109+ * if the supplied one is ACPI_GPE_DISPATCH_MASK).
106110 */
107111 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
108112 if (gpe_event_info) {
109− if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
110− ACPI_GPE_DISPATCH_NONE) {
113+ if (dispatch_type == ACPI_GPE_DISPATCH_MASK)
114+ dispatch_type = ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags);
115+ else if (dispatch_type != ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags))
116+ dispatch_type = ACPI_GPE_DISPATCH_NONE;
117+
118+ if (dispatch_type != ACPI_GPE_DISPATCH_NONE) {
111119 status = acpi_ev_add_gpe_reference(gpe_event_info, TRUE);
112120 if (ACPI_SUCCESS(status) &&
113121 ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) {
@@ -128,6 +136,30 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number) · 14 unmodified lines
128136 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
129137 return_ACPI_STATUS(status);
130138 }
139+ACPI_EXPORT_SYMBOL(acpi_enable_gpe_cond)
140+
141+/*******************************************************************************
142+ *
143+ * FUNCTION: acpi_enable_gpe
144+ *
145+ * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
146+ * gpe_number - GPE level within the GPE block
147+ *
148+ * RETURN: Status
149+ *
150+ * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
151+ * hardware-enabled.
152+ *
153+ ******************************************************************************/
154+acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
155+{
156+ /*
157+ * Ensure that there is some way of handling the GPE (handler or a GPE
158+ * method). In other words, we won't allow a valid GPE to be enabled if
159+ * there is no way to handle it.
160+ */
161+ return acpi_enable_gpe_cond(gpe_device, gpe_number, ACPI_GPE_DISPATCH_MASK);
162+}
131163 ACPI_EXPORT_SYMBOL(acpi_enable_gpe)
132164
133165 /*******************************************************************************
drivers/acpi/apei/einj-core.c+25−20
@@ -401,8 +401,18 @@ static struct acpi_generic_address *einj_get_trigger_parameter_region( · 400 unmodified lines
401401
402402 return NULL;
403403 }
404+
405+static bool is_memory_injection(u32 type, u32 flags)
406+{
407+ if (flags & SETWA_FLAGS_EINJV2)
408+ return !!(type & ACPI_EINJV2_MEMORY);
409+ if (type & ACPI5_VENDOR_BIT)
410+ return !!(vendor_flags & SETWA_FLAGS_MEM);
411+ return !!(type & MEM_ERROR_MASK) || !!(flags & SETWA_FLAGS_MEM);
412+}
413+
404414 /* Execute instructions in trigger error action table */
405−static int __einj_error_trigger(u64 trigger_paddr, u32 type,
415+static int __einj_error_trigger(u64 trigger_paddr, u32 type, u32 flags,
406416 u64 param1, u64 param2)
407417 {
408418 struct acpi_einj_trigger trigger_tab;
@@ -480,7 +490,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, · 71 unmodified lines
480490 * This will cause resource conflict with regular memory. So
481491 * remove it from trigger table resources.
482492 */
483− if ((param_extension || acpi5) && (type & MEM_ERROR_MASK) && param2) {
493+ if ((param_extension || acpi5) && is_memory_injection(type, flags)) {
484494 struct apei_resources addr_resources;
485495
486496 apei_resources_init(&addr_resources);
@@ -660,7 +670,7 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, · 173 unmodified lines
660670 return rc;
661671 trigger_paddr = apei_exec_ctx_get_output(&ctx);
662672 if (notrigger == 0) {
663− rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
673+ rc = __einj_error_trigger(trigger_paddr, type, flags, param1, param2);
664674 if (rc)
665675 return rc;
666676 }
@@ -718,35 +728,30 @@ int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3, · 51 unmodified lines
718728 SETWA_FLAGS_PCIE_SBDF | SETWA_FLAGS_EINJV2)))
719729 return -EINVAL;
720730
731+ /*
732+ * Injections targeting a CXL 1.0/1.1 port have to be injected
733+ * via the einj_cxl_rch_error_inject() path as that does the proper
734+ * validation of the given RCRB base (MMIO) address.
735+ */
736+ if (einj_is_cxl_error_type(type) && (flags & SETWA_FLAGS_MEM))
737+ return -EINVAL;
738+
721739 /* check if type is a valid EINJv2 error type */
722740 if (is_v2) {
723741 if (!(type & available_error_type_v2))
724742 return -EINVAL;
725743 }
726− /*
727− * We need extra sanity checks for memory errors.
728− * Other types leap directly to injection.
729− */
730744
731745 /* ensure param1/param2 existed */
732746 if (!(param_extension || acpi5))
733747 goto inject;
734748
735− /* ensure injection is memory related */
736− if (type & ACPI5_VENDOR_BIT) {
737− if (vendor_flags != SETWA_FLAGS_MEM)
738− goto inject;
739− } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) {
740− goto inject;
741− }
742−
743749 /*
744− * Injections targeting a CXL 1.0/1.1 port have to be injected
745− * via the einj_cxl_rch_error_inject() path as that does the proper
746− * validation of the given RCRB base (MMIO) address.
750+ * We need extra sanity checks for memory errors.
751+ * Other types leap directly to injection.
747752 */
748− if (einj_is_cxl_error_type(type) && (flags & SETWA_FLAGS_MEM))
749− return -EINVAL;
753+ if (!is_memory_injection(type, flags))
754+ goto inject;
750755
751756 /*
752757 * Disallow crazy address masks that give BIOS leeway to pick
drivers/acpi/arm64/cpuidle.c+3−7
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616
1717 static int psci_acpi_cpu_init_idle(unsigned int cpu)
1818 {
19− int i, count;
19+ int i;
2020 struct acpi_lpi_state *lpi;
2121 struct acpi_processor *pr = per_cpu(processors, cpu);
2222
@@ -30,14 +30,10 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu) · 7 unmodified lines
3030 if (!psci_ops.cpu_suspend)
3131 return -EOPNOTSUPP;
3232
33− count = pr->power.count - 1;
34− if (count <= 0)
35− return -ENODEV;
36−
37− for (i = 0; i < count; i++) {
33+ for (i = 1; i < pr->power.count; i++) {
3834 u32 state;
3935
40− lpi = &pr->power.lpi_states[i + 1];
36+ lpi = &pr->power.lpi_states[i];
4137 /*
4238 * Only bits[31:0] represent a PSCI power_state while
4339 * bits[63:32] must be 0x0 as per ARM ACPI FFH Specification
drivers/acpi/battery.c+8−2
@@ -94,6 +94,7 @@ struct acpi_battery { · 93 unmodified lines
9494 struct power_supply *bat;
9595 struct power_supply_desc bat_desc;
9696 struct acpi_device *device;
97+ struct device *phys_dev;
9798 struct notifier_block pm_nb;
9899 struct list_head list;
99100 unsigned long update_time;
@@ -1033,7 +1034,7 @@ static int acpi_battery_update(struct acpi_battery *battery, bool resume) · 933 unmodified lines
10331034 if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) ||
10341035 (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&
10351036 (battery->capacity_now <= battery->alarm)))
1036− acpi_pm_wakeup_event(&battery->device->dev);
1037+ acpi_pm_wakeup_event(battery->phys_dev);
10371038
10381039 return result;
10391040 }
@@ -1214,10 +1215,14 @@ static void sysfs_battery_cleanup(struct acpi_battery *battery) · 174 unmodified lines
12141215
12151216 static int acpi_battery_probe(struct platform_device *pdev)
12161217 {
1217− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
12181218 struct acpi_battery *battery;
1219+ struct acpi_device *device;
12191220 int result;
12201221
1222+ device = ACPI_COMPANION(&pdev->dev);
1223+ if (!device)
1224+ return -ENODEV;
1225+
12211226 if (device->dep_unmet)
12221227 return -EPROBE_DEFER;
12231228
@@ -1227,6 +1232,7 @@ static int acpi_battery_probe(struct platform_device *pdev) · 3 unmodified lines
12271232
12281233 platform_set_drvdata(pdev, battery);
12291234
1235+ battery->phys_dev = &pdev->dev;
12301236 battery->device = device;
12311237
12321238 result = devm_mutex_init(&pdev->dev, &battery->update_lock);
drivers/acpi/button.c+31−3
@@ -179,6 +179,7 @@ struct acpi_button { · 178 unmodified lines
179179 ktime_t last_time;
180180 bool suspended;
181181 bool lid_state_initialized;
182+ bool gpe_enabled;
182183 };
183184
184185 static struct acpi_device *lid_device;
@@ -531,15 +532,20 @@ static int acpi_lid_input_open(struct input_dev *input) · 346 unmodified lines
531532
532533 static int acpi_button_probe(struct platform_device *pdev)
533534 {
534− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
535535 acpi_notify_handler handler;
536+ struct acpi_device *device;
536537 struct acpi_button *button;
537538 struct input_dev *input;
538− const char *hid = acpi_device_hid(device);
539539 acpi_status status;
540540 char *name, *class;
541+ const char *hid;
541542 int error = 0;
542543
544+ device = ACPI_COMPANION(&pdev->dev);
545+ if (!device)
546+ return -ENODEV;
547+
548+ hid = acpi_device_hid(device);
543549 if (!strcmp(hid, ACPI_BUTTON_HID_LID) &&
544550 lid_init_state == ACPI_BUTTON_LID_INIT_DISABLED)
545551 return -ENODEV;
@@ -641,6 +647,21 @@ static int acpi_button_probe(struct platform_device *pdev) · 95 unmodified lines
641647 status = acpi_install_notify_handler(device->handle,
642648 ACPI_ALL_NOTIFY, handler,
643649 button);
650+ if (ACPI_SUCCESS(status) && device->wakeup.flags.valid) {
651+ acpi_status st;
652+
653+ /*
654+ * If the wakeup GPE has a handler method, enable it in
655+ * case it is also used for signaling runtime events.
656+ */
657+ st = acpi_enable_gpe_cond(device->wakeup.gpe_device,
658+ device->wakeup.gpe_number,
659+ ACPI_GPE_DISPATCH_METHOD);
660+ button->gpe_enabled = ACPI_SUCCESS(st);
661+ if (button->gpe_enabled)
662+ dev_dbg(button->dev, "Enabled ACPI GPE%02llx\n",
663+ device->wakeup.gpe_number);
664+ }
644665 break;
645666 }
646667 if (ACPI_FAILURE(status)) {
@@ -666,6 +687,7 @@ err_remove_fs: · 19 unmodified lines
666687 acpi_button_remove_fs(button);
667688 err_free_button:
668689 kfree(button);
690+ memset(acpi_device_class(device), 0, sizeof(acpi_device_class));
669691 return error;
670692 }
671693
@@ -684,7 +706,13 @@ static void acpi_button_remove(struct platform_device *pdev) · 12 unmodified lines
684706 acpi_button_event);
685707 break;
686708 default:
687− acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
709+ if (button->gpe_enabled) {
710+ dev_dbg(button->dev, "Disabling ACPI GPE%02llx\n",
711+ adev->wakeup.gpe_number);
712+ acpi_disable_gpe(adev->wakeup.gpe_device,
713+ adev->wakeup.gpe_number);
714+ }
715+ acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY,
688716 button->type == ACPI_BUTTON_TYPE_LID ?
689717 acpi_lid_notify :
690718 acpi_button_notify);
drivers/acpi/cppc_acpi.c+3−3
@@ -362,7 +362,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd) · 361 unmodified lines
362362 end:
363363 if (cmd == CMD_WRITE) {
364364 if (unlikely(ret)) {
365− for_each_online_cpu(i) {
365+ for_each_possible_cpu(i) {
366366 struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i);
367367
368368 if (!desc)
@@ -524,13 +524,13 @@ int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data) · 155 unmodified lines
524524 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
525525 cpu_data->shared_type = CPUFREQ_SHARED_TYPE_ANY;
526526
527− for_each_online_cpu(i) {
527+ for_each_possible_cpu(i) {
528528 if (i == cpu)
529529 continue;
530530
531531 match_cpc_ptr = per_cpu(cpc_desc_ptr, i);
532532 if (!match_cpc_ptr)
533− goto err_fault;
533+ continue;
534534
535535 match_pdomain = &(match_cpc_ptr->domain_info);
536536 if (match_pdomain->domain != pdomain->domain)
drivers/acpi/ec.c+5−1
@@ -1676,10 +1676,14 @@ static int acpi_ec_setup(struct acpi_ec *ec, struct acpi_device *device, bool ca · 1675 unmodified lines
16761676
16771677 static int acpi_ec_probe(struct platform_device *pdev)
16781678 {
1679− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
1679+ struct acpi_device *device;
16801680 struct acpi_ec *ec;
16811681 int ret;
16821682
1683+ device = ACPI_COMPANION(&pdev->dev);
1684+ if (!device)
1685+ return -ENODEV;
1686+
16831687 if (boot_ec && (boot_ec->handle == device->handle ||
16841688 !strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) {
16851689 /* Fast path: this device corresponds to the boot EC. */
drivers/acpi/hed.c+5−1
@@ -50,9 +50,13 @@ static void acpi_hed_notify(acpi_handle handle, u32 event, void *data) · 49 unmodified lines
5050
5151 static int acpi_hed_probe(struct platform_device *pdev)
5252 {
53− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
53+ struct acpi_device *device;
5454 int err;
5555
56+ device = ACPI_COMPANION(&pdev->dev);
57+ if (!device)
58+ return -ENODEV;
59+
5660 /* Only one hardware error device */
5761 if (hed_handle)
5862 return -EINVAL;
drivers/acpi/nfit/core.c+5−1
@@ -3341,12 +3341,16 @@ static int acpi_nfit_probe(struct platform_device *pdev) · 3340 unmodified lines
33413341 struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
33423342 struct acpi_nfit_desc *acpi_desc;
33433343 struct device *dev = &pdev->dev;
3344− struct acpi_device *adev = ACPI_COMPANION(dev);
33453344 struct acpi_table_header *tbl;
3345+ struct acpi_device *adev;
33463346 acpi_status status = AE_OK;
33473347 acpi_size sz;
33483348 int rc = 0;
33493349
3350+ adev = ACPI_COMPANION(&pdev->dev);
3351+ if (!adev)
3352+ return -ENODEV;
3353+
33503354 rc = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
33513355 acpi_nfit_notify, dev);
33523356 if (rc)
drivers/acpi/pfr_telemetry.c+5−1
@@ -360,10 +360,14 @@ static void pfrt_log_put_idx(void *data) · 359 unmodified lines
360360
361361 static int acpi_pfrt_log_probe(struct platform_device *pdev)
362362 {
363− acpi_handle handle = ACPI_HANDLE(&pdev->dev);
364363 struct pfrt_log_device *pfrt_log_dev;
364+ acpi_handle handle;
365365 int ret;
366366
367+ handle = ACPI_HANDLE(&pdev->dev);
368+ if (!handle)
369+ return -ENODEV;
370+
367371 if (!acpi_has_method(handle, "_DSM")) {
368372 dev_dbg(&pdev->dev, "Missing _DSM\n");
369373 return -ENODEV;
drivers/acpi/pfr_update.c+5−1
@@ -538,10 +538,14 @@ static void pfru_put_idx(void *data) · 537 unmodified lines
538538
539539 static int acpi_pfru_probe(struct platform_device *pdev)
540540 {
541− acpi_handle handle = ACPI_HANDLE(&pdev->dev);
542541 struct pfru_device *pfru_dev;
542+ acpi_handle handle;
543543 int ret;
544544
545+ handle = ACPI_HANDLE(&pdev->dev);
546+ if (!handle)
547+ return -ENODEV;
548+
545549 if (!acpi_has_method(handle, "_DSM")) {
546550 dev_dbg(&pdev->dev, "Missing _DSM\n");
547551 return -ENODEV;
drivers/acpi/sbs.c+5−1
@@ -629,11 +629,15 @@ static void acpi_sbs_callback(void *context) · 628 unmodified lines
629629
630630 static int acpi_sbs_probe(struct platform_device *pdev)
631631 {
632− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
632+ struct acpi_device *device;
633633 struct acpi_sbs *sbs;
634634 int result = 0;
635635 int id;
636636
637+ device = ACPI_COMPANION(&pdev->dev);
638+ if (!device)
639+ return -ENODEV;
640+
637641 sbs = kzalloc_obj(struct acpi_sbs);
638642 if (!sbs) {
639643 result = -ENOMEM;
drivers/acpi/sbshc.c+5−1
@@ -237,11 +237,15 @@ static int smbus_alarm(void *context) · 236 unmodified lines
237237
238238 static int acpi_smbus_hc_probe(struct platform_device *pdev)
239239 {
240− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
240+ struct acpi_device *device;
241241 int status;
242242 unsigned long long val;
243243 struct acpi_smb_hc *hc;
244244
245+ device = ACPI_COMPANION(&pdev->dev);
246+ if (!device)
247+ return -ENODEV;
248+
245249 status = acpi_evaluate_integer(device->handle, "_EC", NULL, &val);
246250 if (ACPI_FAILURE(status)) {
247251 pr_err("error obtaining _EC.\n");
drivers/acpi/thermal.c+1−1
@@ -789,7 +789,7 @@ static int acpi_thermal_probe(struct platform_device *pdev) · 788 unmodified lines
789789 int i;
790790
791791 if (!device)
792− return -EINVAL;
792+ return -ENODEV;
793793
794794 tz = kzalloc_obj(struct acpi_thermal);
795795 if (!tz)
drivers/acpi/tiny-power-button.c+5−1
@@ -38,9 +38,13 @@ static u32 acpi_tiny_power_button_event(void *not_used) · 37 unmodified lines
3838
3939 static int acpi_tiny_power_button_probe(struct platform_device *pdev)
4040 {
41− struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
41+ struct acpi_device *device;
4242 acpi_status status;
4343
44+ device = ACPI_COMPANION(&pdev->dev);
45+ if (!device)
46+ return -ENODEV;
47+
4448 if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON) {
4549 status = acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
4650 acpi_tiny_power_button_event,
drivers/acpi/video_detect.c+8−0
@@ -916,6 +916,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { · 915 unmodified lines
916916 DMI_MATCH(DMI_PRODUCT_NAME, "82K8"),
917917 },
918918 },
919+ {
920+ .callback = video_detect_force_native,
921+ /* HP OMEN Gaming Laptop 16-n0xxx */
922+ .matches = {
923+ DMI_MATCH(DMI_SYS_VENDOR, "HP"),
924+ DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-n0xxx"),
925+ },
926+ },
919927
920928 /*
921929 * x86 android tablets which directly control the backlight through
drivers/android/binder/allocation.rs+8−0
@@ -157,6 +157,14 @@ impl Allocation { · 156 unmodified lines
157157 self.get_or_init_info().target_node = Some(target_node);
158158 }
159159
160+ pub(crate) fn take_oneway_node(&mut self) -> Option<DArc<Node>> {
161+ if let Some(info) = self.allocation_info.as_mut() {
162+ info.oneway_node.take()
163+ } else {
164+ None
165+ }
166+ }
167+
160168 /// Reserve enough space to push at least `num_fds` fds.
161169 pub(crate) fn info_add_fd_reserve(&mut self, num_fds: usize) -> Result {
162170 self.get_or_init_info()
drivers/android/binder/process.rs+6−1
@@ -1402,7 +1402,12 @@ impl Process { · 1401 unmodified lines
14021402 // Clear delivered_deaths list.
14031403 //
14041404 // Scope ensures that MutexGuard is dropped while executing the body.
1405− while let Some(delivered_death) = { self.inner.lock().delivered_deaths.pop_front() } {
1405+ while let Some(delivered_death) = {
1406+ // Explicitly bind to avoid tail expression lifetime extension of the lockguard
1407+ // Can be removed when the kernel moves to edition 2024
1408+ let maybe_death = self.inner.lock().delivered_deaths.pop_front();
1409+ maybe_death
1410+ } {
14061411 drop(delivered_death);
14071412 }
14081413
drivers/android/binder/range_alloc/array.rs+0−1
@@ -204,7 +204,6 @@ impl<T> ArrayRangeAllocator<T> { · 203 unmodified lines
204204 // caller will mark them as unused, which means that they can be freed if the system comes
205205 // under memory pressure.
206206 let mut freed_range = FreedRange::interior_pages(offset, size);
207− #[expect(clippy::collapsible_if)] // reads better like this
208207 if offset % PAGE_SIZE != 0 {
209208 if i == 0 || self.ranges[i - 1].endpoint() <= (offset & PAGE_MASK) {
210209 freed_range.start_page_idx -= 1;
drivers/android/binder/transaction.rs+10−1
@@ -270,7 +270,8 @@ impl Transaction { · 269 unmodified lines
270270 /// Not used for replies.
271271 pub(crate) fn submit(self: DLArc<Self>, info: &mut TransactionInfo) -> BinderResult {
272272 // Defined before `process_inner` so that the destructor runs after releasing the lock.
273− let mut _t_outdated;
273+ let _t_outdated;
274+ let _oneway_node;
274275
275276 let oneway = self.flags & TF_ONE_WAY != 0;
276277 let process = self.to.clone();
@@ -287,6 +288,14 @@ impl Transaction { · 10 unmodified lines
287288 if let Some(t_outdated) =
288289 target_node.take_outdated_transaction(&self, &mut process_inner)
289290 {
291+ let mut alloc_guard = t_outdated.allocation.lock();
292+ if let Some(alloc) = (*alloc_guard).as_mut() {
293+ // Take the oneway node to prevent `Allocation::drop` from calling
294+ // `pending_oneway_finished()`, which would be incorrect as this
295+ // transaction is not being submitted.
296+ _oneway_node = alloc.take_oneway_node();
297+ }
298+ drop(alloc_guard);
290299 // Save the transaction to be dropped after locks are released.
291300 _t_outdated = t_outdated;
292301 }
drivers/ata/libata-core.c+6−3
@@ -5584,6 +5584,7 @@ void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp) · 5583 unmodified lines
55845584 link->pmp = pmp;
55855585 link->active_tag = ATA_TAG_POISON;
55865586 link->hw_sata_spd_limit = UINT_MAX;
5587+ INIT_WORK(&link->deferred_qc_work, ata_scsi_deferred_qc_work);
55875588
55885589 /* can't use iterator, ap isn't initialized yet */
55895590 for (i = 0; i < ATA_MAX_DEVICES; i++) {
@@ -5666,7 +5667,6 @@ struct ata_port *ata_port_alloc(struct ata_host *host) · 76 unmodified lines
56665667 mutex_init(&ap->scsi_scan_mutex);
56675668 INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug);
56685669 INIT_DELAYED_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan);
5669− INIT_WORK(&ap->deferred_qc_work, ata_scsi_deferred_qc_work);
56705670 INIT_LIST_HEAD(&ap->eh_done_q);
56715671 init_waitqueue_head(&ap->eh_wait_q);
56725672 init_completion(&ap->park_req_pending);
@@ -6291,12 +6291,15 @@ static void ata_port_detach(struct ata_port *ap) · 618 unmodified lines
62916291
62926292 /* It better be dead now and not have any remaining deferred qc. */
62936293 WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED));
6294− WARN_ON(ap->deferred_qc);
62956294
6296− cancel_work_sync(&ap->deferred_qc_work);
62976295 cancel_delayed_work_sync(&ap->hotplug_task);
62986296 cancel_delayed_work_sync(&ap->scsi_rescan_task);
62996297
6298+ ata_for_each_link(link, ap, PMP_FIRST) {
6299+ WARN_ON(link->deferred_qc);
6300+ cancel_work_sync(&link->deferred_qc_work);
6301+ }
6302+
63006303 /* Delete port multiplier link transport devices */
63016304 if (ap->pmp_link) {
63026305 int i;
drivers/ata/libata-eh.c+4−4
@@ -651,11 +651,11 @@ int ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, · 650 unmodified lines
651651 if (qc->scsicmd != scmd)
652652 continue;
653653 if ((qc->flags & ATA_QCFLAG_ACTIVE) ||
654− qc == ap->deferred_qc)
654+ qc == qc->dev->link->deferred_qc)
655655 break;
656656 }
657657
658− if (i < ATA_MAX_QUEUE && qc == ap->deferred_qc) {
658+ if (i < ATA_MAX_QUEUE && qc == qc->dev->link->deferred_qc) {
659659 /*
660660 * This is a deferred command that timed out while
661661 * waiting for the command queue to drain. Since the qc
@@ -666,8 +666,8 @@ int ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, · 4 unmodified lines
666666 * deferred qc work from issuing this qc.
667667 */
668668 WARN_ON_ONCE(qc->flags & ATA_QCFLAG_ACTIVE);
669− ap->deferred_qc = NULL;
670− cancel_work(&ap->deferred_qc_work);
669+ qc->dev->link->deferred_qc = NULL;
670+ cancel_work(&qc->dev->link->deferred_qc_work);
671671 set_host_byte(scmd, DID_TIME_OUT);
672672 scsi_eh_finish_cmd(scmd, &ap->eh_done_q);
673673 } else if (i < ATA_MAX_QUEUE) {
drivers/ata/libata-pmp.c+16−2
@@ -110,13 +110,24 @@ int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc) · 109 unmodified lines
110110 {
111111 struct ata_link *link = qc->dev->link;
112112 struct ata_port *ap = link->ap;
113+ int ret;
113114
114115 if (ap->excl_link == NULL || ap->excl_link == link) {
115116 if (ap->nr_active_links == 0 || ata_link_active(link)) {
116117 qc->flags |= ATA_QCFLAG_CLEAR_EXCL;
117− return ata_std_qc_defer(qc);
118+ ret = ata_std_qc_defer(qc);
119+ if (ret == ATA_DEFER_LINK)
120+ return ATA_DEFER_LINK_EXCL;
121+ return ret;
118122 }
119123
124+ /*
125+ * Note: ap->excl_link contains the link that is next in line,
126+ * i.e. implicit round robin. If there is only one link
127+ * dispatching, ap->excl_link will be left unclaimed, allowing
128+ * other links to set ap->excl_link, ensuring that the currently
129+ * active link cannot queue any more.
130+ */
120131 ap->excl_link = link;
121132 }
122133
@@ -571,8 +582,11 @@ static void sata_pmp_detach(struct ata_device *dev) · 448 unmodified lines
571582 if (ap->ops->pmp_detach)
572583 ap->ops->pmp_detach(ap);
573584
574− ata_for_each_link(tlink, ap, EDGE)
585+ ata_for_each_link(tlink, ap, EDGE) {
586+ WARN_ON(tlink->deferred_qc);
587+ cancel_work_sync(&tlink->deferred_qc_work);
575588 ata_eh_detach_dev(tlink->device);
589+ }
576590
577591 spin_lock_irqsave(ap->lock, flags);
578592 ap->nr_pmp_links = 0;
drivers/ata/libata-scsi.c+52−37
@@ -1664,8 +1664,9 @@ static void ata_scsi_qc_done(struct ata_queued_cmd *qc, bool set_result, · 1663 unmodified lines
16641664
16651665 void ata_scsi_deferred_qc_work(struct work_struct *work)
16661666 {
1667− struct ata_port *ap =
1668− container_of(work, struct ata_port, deferred_qc_work);
1667+ struct ata_link *link =
1668+ container_of(work, struct ata_link, deferred_qc_work);
1669+ struct ata_port *ap = link->ap;
16691670 struct ata_queued_cmd *qc;
16701671 unsigned long flags;
16711672
@@ -1676,10 +1677,10 @@ void ata_scsi_deferred_qc_work(struct work_struct *work) · 4 unmodified lines
16761677 * such case, we should not need any more deferring the qc, so warn if
16771678 * qc_defer() says otherwise.
16781679 */
1679− qc = ap->deferred_qc;
1680+ qc = link->deferred_qc;
16801681 if (qc && !ata_port_eh_scheduled(ap)) {
16811682 WARN_ON_ONCE(ap->ops->qc_defer(qc));
1682− ap->deferred_qc = NULL;
1683+ link->deferred_qc = NULL;
16831684 ata_qc_issue(qc);
16841685 }
16851686
@@ -1688,7 +1689,7 @@ void ata_scsi_deferred_qc_work(struct work_struct *work) · 2 unmodified lines
16881689
16891690 void ata_scsi_requeue_deferred_qc(struct ata_port *ap)
16901691 {
1691− struct ata_queued_cmd *qc = ap->deferred_qc;
1692+ struct ata_link *link;
16921693
16931694 lockdep_assert_held(ap->lock);
16941695
@@ -1697,16 +1698,21 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap) · 2 unmodified lines
16971698 * do not try to be smart about what to do with this deferred command
16981699 * and simply requeue it by completing it with DID_REQUEUE.
16991700 */
1700− if (qc) {
1701− ap->deferred_qc = NULL;
1702− cancel_work(&ap->deferred_qc_work);
1703− ata_scsi_qc_done(qc, true, DID_REQUEUE << 16);
1701+ ata_for_each_link(link, ap, PMP_FIRST) {
1702+ struct ata_queued_cmd *qc = link->deferred_qc;
1703+
1704+ if (qc) {
1705+ link->deferred_qc = NULL;
1706+ cancel_work(&link->deferred_qc_work);
1707+ ata_scsi_qc_done(qc, true, DID_REQUEUE << 16);
1708+ }
17041709 }
17051710 }
17061711
1707−static void ata_scsi_schedule_deferred_qc(struct ata_port *ap)
1712+static void ata_scsi_schedule_deferred_qc(struct ata_link *link)
17081713 {
1709− struct ata_queued_cmd *qc = ap->deferred_qc;
1714+ struct ata_queued_cmd *qc = link->deferred_qc;
1715+ struct ata_port *ap = link->ap;
17101716
17111717 lockdep_assert_held(ap->lock);
17121718
@@ -1723,12 +1729,12 @@ static void ata_scsi_schedule_deferred_qc(struct ata_port *ap) · 10 unmodified lines
17231729 return;
17241730 }
17251731 if (!ap->ops->qc_defer(qc))
1726− queue_work(system_highpri_wq, &ap->deferred_qc_work);
1732+ queue_work(system_highpri_wq, &link->deferred_qc_work);
17271733 }
17281734
17291735 static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
17301736 {
1731− struct ata_port *ap = qc->ap;
1737+ struct ata_link *link = qc->dev->link;
17321738 struct scsi_cmnd *cmd = qc->scsicmd;
17331739 u8 *cdb = cmd->cmnd;
17341740 bool have_sense = qc->flags & ATA_QCFLAG_SENSE_VALID;
@@ -1759,22 +1765,23 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) · 24 unmodified lines
17591765
17601766 ata_scsi_qc_done(qc, false, 0);
17611767
1762− ata_scsi_schedule_deferred_qc(ap);
1768+ ata_scsi_schedule_deferred_qc(link);
17631769 }
17641770
17651771 static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
17661772 {
1773+ struct ata_link *link = qc->dev->link;
17671774 int ret;
17681775
17691776 if (!ap->ops->qc_defer)
1770− goto issue;
1777+ goto issue_qc;
17711778
17721779 /*
17731780 * If we already have a deferred qc, then rely on the SCSI layer to
17741781 * requeue and defer all incoming commands until the deferred qc is
17751782 * processed, once all on-going commands complete.
17761783 */
1777− if (ap->deferred_qc) {
1784+ if (link->deferred_qc) {
17781785 ata_qc_free(qc);
17791786 return SCSI_MLQUEUE_DEVICE_BUSY;
17801787 }
@@ -1786,38 +1793,46 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc) · 5 unmodified lines
17861793 break;
17871794 case ATA_DEFER_LINK:
17881795 ret = SCSI_MLQUEUE_DEVICE_BUSY;
1789− break;
1796+ goto defer_qc;
1797+ case ATA_DEFER_LINK_EXCL:
1798+ /*
1799+ * Drivers making use of ap->excl_link cannot store the QC in
1800+ * link->deferred_qc, because the ap->excl_link handling is
1801+ * incompatible with the link->deferred_qc workqueue handling.
1802+ */
1803+ ret = SCSI_MLQUEUE_DEVICE_BUSY;
1804+ goto free_qc;
17901805 case ATA_DEFER_PORT:
17911806 ret = SCSI_MLQUEUE_HOST_BUSY;
1792− break;
1807+ goto free_qc;
17931808 default:
17941809 WARN_ON_ONCE(1);
17951810 ret = SCSI_MLQUEUE_HOST_BUSY;
1796− break;
1811+ goto free_qc;
17971812 }
17981813
1799− if (ret) {
1800− /*
1801− * We must defer this qc: if this is not an NCQ command, keep
1802− * this qc as a deferred one and report to the SCSI layer that
1803− * we issued it so that it is not requeued. The deferred qc will
1804− * be issued with the port deferred_qc_work once all on-going
1805− * commands complete.
1806− */
1807− if (!ata_is_ncq(qc->tf.protocol)) {
1808− ap->deferred_qc = qc;
1809− return 0;
1810− }
1814+issue_qc:
1815+ ata_qc_issue(qc);
1816+ return 0;
18111817
1812− /* Force a requeue of the command to defer its execution. */
1813− ata_qc_free(qc);
1814− return ret;
1818+defer_qc:
1819+ /*
1820+ * We must defer this qc: if this is not an NCQ command, keep
1821+ * this qc as a deferred one and report to the SCSI layer that
1822+ * we issued it so that it is not requeued. The deferred qc will
1823+ * be issued with the port deferred_qc_work once all on-going
1824+ * commands complete.
1825+ */
1826+ if (!ata_is_ncq(qc->tf.protocol)) {
1827+ link->deferred_qc = qc;
1828+ return 0;
18151829 }
18161830
1817−issue:
1818− ata_qc_issue(qc);
1831+free_qc:
1832+ /* Force a requeue of the command to defer its execution. */
1833+ ata_qc_free(qc);
18191834
1820− return 0;
1835+ return ret;
18211836 }
18221837
18231838 /**
drivers/ata/pata_parport/pata_parport.c+7−14
@@ -459,19 +459,11 @@ static void pata_parport_dev_release(struct device *dev) · 458 unmodified lines
459459 kfree(pi);
460460 }
461461
462−static void pata_parport_bus_release(struct device *dev)
463−{
464− /* nothing to do here but required to avoid warning on device removal */
465−}
466−
467462 static const struct bus_type pata_parport_bus_type = {
468463 .name = DRV_NAME,
469464 };
470465
471−static struct device pata_parport_bus = {
472− .init_name = DRV_NAME,
473− .release = pata_parport_bus_release,
474−};
466+static struct device *pata_parport_bus;
475467
476468 static const struct scsi_host_template pata_parport_sht = {
477469 PATA_PARPORT_SHT("pata_parport")
@@ -518,7 +510,7 @@ static struct pi_adapter *pi_init_one(struct parport *parport, · 40 unmodified lines
518510 }
519511
520512 /* set up pi->dev before pi_probe_unit() so it can use dev_printk() */
521− pi->dev.parent = &pata_parport_bus;
513+ pi->dev.parent = pata_parport_bus;
522514 pi->dev.bus = &pata_parport_bus_type;
523515 pi->dev.driver = &pr->driver;
524516 pi->dev.release = pata_parport_dev_release;
@@ -780,8 +772,9 @@ static __init int pata_parport_init(void) · 255 unmodified lines
780772 return error;
781773 }
782774
783− error = device_register(&pata_parport_bus);
784− if (error) {
775+ pata_parport_bus = root_device_register(DRV_NAME);
776+ if (IS_ERR(pata_parport_bus)) {
777+ error = PTR_ERR(pata_parport_bus);
785778 pr_err("failed to register pata_parport bus, error: %d\n", error);
786779 goto out_unregister_bus;
787780 }
@@ -811,7 +804,7 @@ out_remove_del: · 23 unmodified lines
811804 out_remove_new:
812805 bus_remove_file(&pata_parport_bus_type, &bus_attr_new_device);
813806 out_unregister_dev:
814− device_unregister(&pata_parport_bus);
807+ root_device_unregister(pata_parport_bus);
815808 out_unregister_bus:
816809 bus_unregister(&pata_parport_bus_type);
817810 return error;
@@ -822,7 +815,7 @@ static __exit void pata_parport_exit(void) · 4 unmodified lines
822815 parport_unregister_driver(&pata_parport_driver);
823816 bus_remove_file(&pata_parport_bus_type, &bus_attr_new_device);
824817 bus_remove_file(&pata_parport_bus_type, &bus_attr_delete_device);
825− device_unregister(&pata_parport_bus);
818+ root_device_unregister(pata_parport_bus);
826819 bus_unregister(&pata_parport_bus_type);
827820 }
828821
drivers/ata/sata_sil24.c+5−1
@@ -789,6 +789,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc) · 788 unmodified lines
789789 struct ata_link *link = qc->dev->link;
790790 struct ata_port *ap = link->ap;
791791 u8 prot = qc->tf.protocol;
792+ int ret;
792793
793794 /*
794795 * There is a bug in the chip:
@@ -826,7 +827,10 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc) · 31 unmodified lines
826827 qc->flags |= ATA_QCFLAG_CLEAR_EXCL;
827828 }
828829
829− return ata_std_qc_defer(qc);
830+ ret = ata_std_qc_defer(qc);
831+ if (ret == ATA_DEFER_LINK)
832+ return ATA_DEFER_LINK_EXCL;
833+ return ret;
830834 }
831835
832836 static enum ata_completion_errors sil24_qc_prep(struct ata_queued_cmd *qc)
drivers/base/memory.c+6−2
@@ -1230,8 +1230,10 @@ void memblk_nr_poison_inc(unsigned long pfn) · 1229 unmodified lines
12301230 const unsigned long block_id = pfn_to_block_id(pfn);
12311231 struct memory_block *mem = find_memory_block_by_id(block_id);
12321232
1233− if (mem)
1233+ if (mem) {
12341234 atomic_long_inc(&mem->nr_hwpoison);
1235+ put_device(&mem->dev);
1236+ }
12351237 }
12361238
12371239 void memblk_nr_poison_sub(unsigned long pfn, long i)
@@ -1239,8 +1241,10 @@ void memblk_nr_poison_sub(unsigned long pfn, long i) · 1 unmodified line
12391241 const unsigned long block_id = pfn_to_block_id(pfn);
12401242 struct memory_block *mem = find_memory_block_by_id(block_id);
12411243
1242− if (mem)
1244+ if (mem) {
12431245 atomic_long_sub(i, &mem->nr_hwpoison);
1246+ put_device(&mem->dev);
1247+ }
12441248 }
12451249
12461250 static unsigned long memblk_nr_poison(struct memory_block *mem)
drivers/base/platform.c+15−1
@@ -606,6 +606,12 @@ static void platform_device_release(struct device *dev) · 605 unmodified lines
606606 kfree(pa);
607607 }
608608
609+static void platform_device_release_full(struct device *dev)
610+{
611+ device_remove_software_node(dev);
612+ platform_device_release(dev);
613+}
614+
609615 /**
610616 * platform_device_alloc - create a platform device
611617 * @name: base name of the device we're adding
@@ -848,7 +854,13 @@ struct platform_device *platform_device_register_full(const struct platform_devi · 236 unmodified lines
848854 int ret;
849855 struct platform_device *pdev;
850856
851− if (pdevinfo->swnode && pdevinfo->properties)
857+ /*
858+ * Only one software node per device is allowed. Make sure we don't
859+ * accept or create two.
860+ */
861+ if ((pdevinfo->swnode && pdevinfo->properties) ||
862+ (pdevinfo->swnode && is_software_node(pdevinfo->fwnode)) ||
863+ (pdevinfo->properties && is_software_node(pdevinfo->fwnode)))
852864 return ERR_PTR(-EINVAL);
853865
854866 pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id);
@@ -878,6 +890,8 @@ struct platform_device *platform_device_register_full(const struct platform_devi · 23 unmodified lines
878890 ret = device_add_software_node(&pdev->dev, pdevinfo->swnode);
879891 if (ret)
880892 goto err;
893+
894+ pdev->dev.release = platform_device_release_full;
881895 } else if (pdevinfo->properties) {
882896 ret = device_create_managed_software_node(&pdev->dev,
883897 pdevinfo->properties, NULL);
drivers/base/regmap/regmap-sdw-mbq.c+1−1
@@ -172,7 +172,7 @@ static int regmap_sdw_mbq_read(void *context, unsigned int reg, unsigned int *va · 171 unmodified lines
172172 ret = regmap_sdw_mbq_read_impl(slave, reg, val, mbq_size);
173173 if (ret == -ENODATA) {
174174 if (!deferrable)
175− dev_warn(dev, "Defer on undeferable control: %x\n", reg);
175+ dev_warn(dev, "Defer on undeferrable control: %x\n", reg);
176176
177177 ret = regmap_sdw_mbq_poll_busy(slave, reg, ctx);
178178 if (ret)
drivers/base/regmap/regmap.c+3−0
@@ -3257,6 +3257,9 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg, · 3256 unmodified lines
32573257 *change = false;
32583258
32593259 if (regmap_volatile(map, reg) && map->reg_update_bits) {
3260+ if (map->cache_only)
3261+ return -EBUSY;
3262+
32603263 reg = regmap_reg_addr(map, reg);
32613264 ret = map->reg_update_bits(map->bus_context, reg, mask, val);
32623265 if (ret == 0 && change)
drivers/block/rbd.c+8−12
@@ -4565,24 +4565,12 @@ out: · 4564 unmodified lines
45654565 return ret;
45664566 }
45674567
4568−static void cancel_tasks_sync(struct rbd_device *rbd_dev)
4569−{
4570− dout("%s rbd_dev %p\n", __func__, rbd_dev);
4571−
4572− cancel_work_sync(&rbd_dev->acquired_lock_work);
4573− cancel_work_sync(&rbd_dev->released_lock_work);
4574− cancel_delayed_work_sync(&rbd_dev->lock_dwork);
4575− cancel_work_sync(&rbd_dev->unlock_work);
4576−}
4577−
45784568 /*
45794569 * header_rwsem must not be held to avoid a deadlock with
45804570 * rbd_dev_refresh() when flushing notifies.
45814571 */
45824572 static void rbd_unregister_watch(struct rbd_device *rbd_dev)
45834573 {
4584− cancel_tasks_sync(rbd_dev);
4585−
45864574 mutex_lock(&rbd_dev->watch_mutex);
45874575 if (rbd_dev->watch_state == RBD_WATCH_STATE_REGISTERED)
45884576 __rbd_unregister_watch(rbd_dev);
@@ -6548,10 +6536,18 @@ out_err: · 1959 unmodified lines
65486536
65496537 static void rbd_dev_image_unlock(struct rbd_device *rbd_dev)
65506538 {
6539+ dout("%s rbd_dev %p\n", __func__, rbd_dev);
6540+
6541+ disable_delayed_work_sync(&rbd_dev->lock_dwork);
6542+ disable_work_sync(&rbd_dev->unlock_work);
6543+
65516544 down_write(&rbd_dev->lock_rwsem);
65526545 if (__rbd_is_lock_owner(rbd_dev))
65536546 __rbd_release_lock(rbd_dev);
65546547 up_write(&rbd_dev->lock_rwsem);
6548+
6549+ flush_work(&rbd_dev->acquired_lock_work);
6550+ flush_work(&rbd_dev->released_lock_work);
65556551 }
65566552
65576553 /*
drivers/block/ublk_drv.c+38−7
@@ -900,12 +900,29 @@ static int ublk_validate_params(const struct ublk_device *ub) · 899 unmodified lines
900900 if (p->logical_bs_shift > PAGE_SHIFT || p->logical_bs_shift < 9)
901901 return -EINVAL;
902902
903+ /*
904+ * 256M is a reasonable upper bound for physical block size,
905+ * io_min and io_opt; it aligns with the maximum physical
906+ * block size possible in NVMe.
907+ */
908+ if (p->physical_bs_shift > ilog2(SZ_256M))
909+ return -EINVAL;
910+
911+ if (p->io_min_shift > ilog2(SZ_256M))
912+ return -EINVAL;
913+
914+ if (p->io_opt_shift > ilog2(SZ_256M))
915+ return -EINVAL;
916+
903917 if (p->logical_bs_shift > p->physical_bs_shift)
904918 return -EINVAL;
905919
906920 if (p->max_sectors > (ub->dev_info.max_io_buf_bytes >> 9))
907921 return -EINVAL;
908922
923+ if (p->max_sectors < PAGE_SECTORS)
924+ return -EINVAL;
925+
909926 if (ublk_dev_is_zoned(ub) && !p->chunk_sectors)
910927 return -EINVAL;
911928 } else
@@ -2397,8 +2414,14 @@ static void ublk_reset_ch_dev(struct ublk_device *ub) · 1485 unmodified lines
23972414 {
23982415 int i;
23992416
2400− for (i = 0; i < ub->dev_info.nr_hw_queues; i++)
2401− ublk_queue_reinit(ub, ublk_get_queue(ub, i));
2417+ for (i = 0; i < ub->dev_info.nr_hw_queues; i++) {
2418+ struct ublk_queue *ubq = ublk_get_queue(ub, i);
2419+
2420+ /* Sync with ublk_cancel_cmd() */
2421+ spin_lock(&ubq->cancel_lock);
2422+ ublk_queue_reinit(ub, ubq);
2423+ spin_unlock(&ubq->cancel_lock);
2424+ }
24022425
24032426 /* set to NULL, otherwise new tasks cannot mmap io_cmd_buf */
24042427 ub->mm = NULL;
@@ -2739,6 +2762,7 @@ static void ublk_cancel_cmd(struct ublk_queue *ubq, unsigned tag, · 334 unmodified lines
27392762 {
27402763 struct ublk_io *io = &ubq->ios[tag];
27412764 struct ublk_device *ub = ubq->dev;
2765+ struct io_uring_cmd *cmd = NULL;
27422766 struct request *req;
27432767 bool done;
27442768
@@ -2761,12 +2785,15 @@ static void ublk_cancel_cmd(struct ublk_queue *ubq, unsigned tag, · 16 unmodified lines
27612785
27622786 spin_lock(&ubq->cancel_lock);
27632787 done = !!(io->flags & UBLK_IO_FLAG_CANCELED);
2764− if (!done)
2788+ if (!done) {
27652789 io->flags |= UBLK_IO_FLAG_CANCELED;
2790+ cmd = io->cmd;
2791+ io->cmd = NULL;
2792+ }
27662793 spin_unlock(&ubq->cancel_lock);
27672794
2768− if (!done)
2769− io_uring_cmd_done(io->cmd, UBLK_IO_RES_ABORT, issue_flags);
2795+ if (!done && cmd)
2796+ io_uring_cmd_done(cmd, UBLK_IO_RES_ABORT, issue_flags);
27702797 }
27712798
27722799 /*
@@ -3496,8 +3523,10 @@ static void ublk_ch_uring_cmd_cb(struct io_tw_req tw_req, io_tw_token_t tw) · 723 unmodified lines
34963523 {
34973524 unsigned int issue_flags = IO_URING_CMD_TASK_WORK_ISSUE_FLAGS;
34983525 struct io_uring_cmd *cmd = io_uring_cmd_from_tw(tw_req);
3499− int ret = ublk_ch_uring_cmd_local(cmd, issue_flags);
3526+ int ret = -ECANCELED;
35003527
3528+ if (!tw.cancel)
3529+ ret = ublk_ch_uring_cmd_local(cmd, issue_flags);
35013530 if (ret != -EIOCBQUEUED)
35023531 io_uring_cmd_done(cmd, ret, issue_flags);
35033532 }
@@ -4990,13 +5019,15 @@ static int ublk_ctrl_set_params(struct ublk_device *ub, · 1486 unmodified lines
49905019 */
49915020 ret = -EACCES;
49925021 } else if (copy_from_user(&ub->params, argp, ph.len)) {
5022+ /* zero out partial copy so no stale params survive */
5023+ memset(&ub->params, 0, sizeof(ub->params));
49935024 ret = -EFAULT;
49945025 } else {
49955026 /* clear all we don't support yet */
49965027 ub->params.types &= UBLK_PARAM_TYPE_ALL;
49975028 ret = ublk_validate_params(ub);
49985029 if (ret)
4999− ub->params.types = 0;
5030+ memset(&ub->params, 0, sizeof(ub->params));
50005031 }
50015032 mutex_unlock(&ub->mutex);
50025033
drivers/block/zram/zram_drv.c+5−1
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <linux/cpuhotplug.h>
3434 #include <linux/part_stat.h>
3535 #include <linux/kernel_read_file.h>
36+#include <linux/rcupdate.h>
3637
3738 #include "zram_drv.h"
3839
@@ -504,6 +505,7 @@ struct zram_wb_ctl { · 465 unmodified lines
504505 wait_queue_head_t done_wait;
505506 spinlock_t done_lock;
506507 atomic_t num_inflight;
508+ struct rcu_head rcu;
507509 };
508510
509511 struct zram_wb_req {
@@ -847,7 +849,7 @@ static void release_wb_ctl(struct zram_wb_ctl *wb_ctl) · 337 unmodified lines
847849 release_wb_req(req);
848850 }
849851
850− kfree(wb_ctl);
852+ kfree_rcu(wb_ctl, rcu);
851853 }
852854
853855 static struct zram_wb_ctl *init_wb_ctl(struct zram *zram)
@@ -964,11 +966,13 @@ static void zram_writeback_endio(struct bio *bio) · 110 unmodified lines
964966 struct zram_wb_ctl *wb_ctl = bio->bi_private;
965967 unsigned long flags;
966968
969+ rcu_read_lock();
967970 spin_lock_irqsave(&wb_ctl->done_lock, flags);
968971 list_add(&req->entry, &wb_ctl->done_reqs);
969972 spin_unlock_irqrestore(&wb_ctl->done_lock, flags);
970973
971974 wake_up(&wb_ctl->done_wait);
975+ rcu_read_unlock();
972976 }
973977
974978 static void zram_submit_wb_request(struct zram *zram,
drivers/bluetooth/btintel_pcie.c+16−17
@@ -289,6 +289,9 @@ static inline void btintel_pcie_dump_debug_registers(struct hci_dev *hdev) · 288 unmodified lines
289289 skb_put_data(skb, buf, strlen(buf));
290290 data->boot_stage_cache = reg;
291291
292+ if (reg & BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_WARNING)
293+ bt_dev_warn(hdev, "Controller device warning (boot_stage: 0x%8.8x)", reg);
294+
292295 reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_IPC_STATUS_REG);
293296 snprintf(buf, sizeof(buf), "ipc status: 0x%8.8x", reg);
294297 skb_put_data(skb, buf, strlen(buf));
@@ -579,12 +582,10 @@ static int btintel_pcie_get_mac_access(struct btintel_pcie_data *data) · 284 unmodified lines
579582
580583 reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG);
581584
582− reg |= BTINTEL_PCIE_CSR_FUNC_CTRL_STOP_MAC_ACCESS_DIS;
583− reg |= BTINTEL_PCIE_CSR_FUNC_CTRL_XTAL_CLK_REQ;
584− if ((reg & BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_STS) == 0)
585+ if (!(reg & BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ)) {
585586 reg |= BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ;
586−
587− btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
587+ btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
588+ }
588589
589590 do {
590591 reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG);
@@ -604,16 +605,10 @@ static void btintel_pcie_release_mac_access(struct btintel_pcie_data *data) · 13 unmodified lines
604605
605606 reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG);
606607
607− if (reg & BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ)
608+ if (reg & BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ) {
608609 reg &= ~BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ;
609−
610− if (reg & BTINTEL_PCIE_CSR_FUNC_CTRL_STOP_MAC_ACCESS_DIS)
611− reg &= ~BTINTEL_PCIE_CSR_FUNC_CTRL_STOP_MAC_ACCESS_DIS;
612−
613− if (reg & BTINTEL_PCIE_CSR_FUNC_CTRL_XTAL_CLK_REQ)
614− reg &= ~BTINTEL_PCIE_CSR_FUNC_CTRL_XTAL_CLK_REQ;
615−
616− btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
610+ btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
611+ }
617612 }
618613
619614 static void *btintel_pcie_copy_tlv(void *dest, enum btintel_pcie_tlv_type type,
@@ -880,8 +875,11 @@ static inline bool btintel_pcie_in_lockdown(struct btintel_pcie_data *data) · 260 unmodified lines
880875
881876 static inline bool btintel_pcie_in_error(struct btintel_pcie_data *data)
882877 {
883− return (data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_ERR) ||
884− (data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_ABORT_HANDLER);
878+ if (data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_WARNING)
879+ bt_dev_warn(data->hdev, "Controller device warning (boot_stage: 0x%8.8x)",
880+ data->boot_stage_cache);
881+
882+ return data->boot_stage_cache & BTINTEL_PCIE_CSR_BOOT_STAGE_ABORT_HANDLER;
885883 }
886884
887885 static void btintel_pcie_msix_gp1_handler(struct btintel_pcie_data *data)
@@ -914,7 +912,8 @@ static void btintel_pcie_msix_gp0_handler(struct btintel_pcie_data *data) · 26 unmodified lines
914912 data->img_resp_cache = reg;
915913
916914 if (btintel_pcie_in_error(data)) {
917− bt_dev_err(data->hdev, "Controller in error state");
915+ bt_dev_err(data->hdev, "Controller in error state (boot_stage: 0x%8.8x)",
916+ data->boot_stage_cache);
918917 btintel_pcie_dump_debug_registers(data->hdev);
919918 return;
920919 }
drivers/bluetooth/btintel_pcie.h+1−4
@@ -34,9 +34,6 @@ · 33 unmodified lines
3434 #define BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_STS (BIT(20))
3535
3636 #define BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ (BIT(21))
37−/* Stop MAC Access disconnection request */
38−#define BTINTEL_PCIE_CSR_FUNC_CTRL_STOP_MAC_ACCESS_DIS (BIT(22))
39−#define BTINTEL_PCIE_CSR_FUNC_CTRL_XTAL_CLK_REQ (BIT(23))
4037
4138 #define BTINTEL_PCIE_CSR_FUNC_CTRL_BUS_MASTER_STS (BIT(28))
4239 #define BTINTEL_PCIE_CSR_FUNC_CTRL_BUS_MASTER_DISCON (BIT(29))
@@ -48,7 +45,7 @@ · 5 unmodified lines
4845 #define BTINTEL_PCIE_CSR_BOOT_STAGE_OPFW (BIT(2))
4946 #define BTINTEL_PCIE_CSR_BOOT_STAGE_ROM_LOCKDOWN (BIT(10))
5047 #define BTINTEL_PCIE_CSR_BOOT_STAGE_IML_LOCKDOWN (BIT(11))
51−#define BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_ERR (BIT(12))
48+#define BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_WARNING (BIT(12))
5249 #define BTINTEL_PCIE_CSR_BOOT_STAGE_ABORT_HANDLER (BIT(13))
5350 #define BTINTEL_PCIE_CSR_BOOT_STAGE_DEVICE_HALTED (BIT(14))
5451 #define BTINTEL_PCIE_CSR_BOOT_STAGE_MAC_ACCESS_ON (BIT(16))
drivers/bluetooth/btmtk.c+15−2
@@ -537,6 +537,7 @@ static void btmtk_usb_wmt_recv(struct urb *urb) · 536 unmodified lines
537537 return;
538538 } else if (urb->status == -ENOENT) {
539539 /* Avoid suspend failed when usb_kill_urb */
540+ kfree(urb->setup_packet);
540541 return;
541542 }
542543
@@ -610,6 +611,7 @@ static int btmtk_usb_submit_wmt_recv_urb(struct hci_dev *hdev) · 67 unmodified lines
610611 if (err != -EPERM && err != -ENODEV)
611612 bt_dev_err(hdev, "urb %p submission failed (%d)",
612613 urb, -err);
614+ kfree(dr);
613615 usb_unanchor_urb(urb);
614616 }
615617
@@ -695,8 +697,13 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev, · 79 unmodified lines
695697 if (data->evt_skb == NULL)
696698 goto err_free_wc;
697699
698− /* Parse and handle the return WMT event */
699− wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data;
700+ wmt_evt = skb_pull_data(data->evt_skb, sizeof(*wmt_evt));
701+ if (!wmt_evt) {
702+ bt_dev_err(hdev, "WMT event too short (%u bytes)",
703+ data->evt_skb->len);
704+ err = -EINVAL;
705+ goto err_free_skb;
706+ }
700707 if (wmt_evt->whdr.op != hdr->op) {
701708 bt_dev_err(hdev, "Wrong op received %d expected %d",
702709 wmt_evt->whdr.op, hdr->op);
@@ -712,6 +719,12 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev, · 9 unmodified lines
712719 status = BTMTK_WMT_PATCH_DONE;
713720 break;
714721 case BTMTK_WMT_FUNC_CTRL:
722+ if (!skb_pull_data(data->evt_skb,
723+ sizeof(wmt_evt_funcc->status))) {
724+ status = BTMTK_WMT_ON_UNDONE;
725+ break;
726+ }
727+
715728 wmt_evt_funcc = (struct btmtk_hci_wmt_evt_funcc *)wmt_evt;
716729 if (be16_to_cpu(wmt_evt_funcc->status) == 0x404)
717730 status = BTMTK_WMT_ON_DONE;
drivers/bluetooth/btusb.c+7−1
@@ -3540,7 +3540,13 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev, · 3539 unmodified lines
35403540 "firmware rome 0x%x build 0x%x",
35413541 rver_rom, rver_patch, ver_rom, ver_patch);
35423542
3543− if (rver_rom != ver_rom || rver_patch <= ver_patch) {
3543+ /* Allow rampatch when the patch version equals the firmware version.
3544+ * A firmware download may be aborted by a transient USB error (e.g.
3545+ * disconnect) after the controller updates version info but before
3546+ * completion.
3547+ * Allowing equal versions enables re-flashing during recovery.
3548+ */
3549+ if (rver_rom != ver_rom || rver_patch < ver_patch) {
35443550 bt_dev_err(hdev, "rampatch file version did not match with firmware");
35453551 err = -EINVAL;
35463552 goto done;
drivers/bluetooth/hci_ath.c+3−0
@@ -191,6 +191,9 @@ static int ath_recv(struct hci_uart *hu, const void *data, int count) · 190 unmodified lines
191191 {
192192 struct ath_struct *ath = hu->priv;
193193
194+ if (!ath)
195+ return -ENODEV;
196+
194197 ath->rx_skb = h4_recv_buf(hu, ath->rx_skb, data, count,
195198 ath_recv_pkts, ARRAY_SIZE(ath_recv_pkts));
196199 if (IS_ERR(ath->rx_skb)) {
drivers/bluetooth/hci_bcsp.c+3−0
@@ -585,6 +585,9 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count) · 584 unmodified lines
585585 if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
586586 return -EUNATCH;
587587
588+ if (!bcsp)
589+ return -ENODEV;
590+
588591 BT_DBG("hu %p count %d rx_state %d rx_count %ld",
589592 hu, count, bcsp->rx_state, bcsp->rx_count);
590593
drivers/bluetooth/hci_h4.c+3−0
@@ -109,6 +109,9 @@ static int h4_recv(struct hci_uart *hu, const void *data, int count) · 108 unmodified lines
109109 {
110110 struct h4_struct *h4 = hu->priv;
111111
112+ if (!h4)
113+ return -ENODEV;
114+
112115 h4->rx_skb = h4_recv_buf(hu, h4->rx_skb, data, count,
113116 h4_recv_pkts, ARRAY_SIZE(h4_recv_pkts));
114117 if (IS_ERR(h4->rx_skb)) {
drivers/bluetooth/hci_h5.c+3−0
@@ -587,6 +587,9 @@ static int h5_recv(struct hci_uart *hu, const void *data, int count) · 586 unmodified lines
587587 struct h5 *h5 = hu->priv;
588588 const unsigned char *ptr = data;
589589
590+ if (!h5)
591+ return -ENODEV;
592+
590593 BT_DBG("%s pending %zu count %d", hu->hdev->name, h5->rx_pending,
591594 count);
592595
drivers/bluetooth/hci_ldisc.c+40−8
@@ -194,7 +194,15 @@ void hci_uart_init_work(struct work_struct *work) · 193 unmodified lines
194194 err = hci_register_dev(hu->hdev);
195195 if (err < 0) {
196196 BT_ERR("Can't register HCI device");
197+
198+ percpu_down_write(&hu->proto_lock);
197199 clear_bit(HCI_UART_PROTO_READY, &hu->flags);
200+ percpu_up_write(&hu->proto_lock);
201+
202+ /* Safely cancel work after clearing flags */
203+ cancel_work_sync(&hu->write_work);
204+
205+ /* Close protocol before freeing hdev */
198206 hu->proto->close(hu);
199207 hdev = hu->hdev;
200208 hu->hdev = NULL;
@@ -263,8 +271,12 @@ static int hci_uart_open(struct hci_dev *hdev) · 62 unmodified lines
263271 /* Close device */
264272 static int hci_uart_close(struct hci_dev *hdev)
265273 {
274+ struct hci_uart *hu = hci_get_drvdata(hdev);
275+
266276 BT_DBG("hdev %p", hdev);
267277
278+ cancel_work_sync(&hu->write_work);
279+
268280 hci_uart_flush(hdev);
269281 hdev->flush = NULL;
270282 return 0;
@@ -531,6 +543,7 @@ static void hci_uart_tty_close(struct tty_struct *tty) · 260 unmodified lines
531543 {
532544 struct hci_uart *hu = tty->disc_data;
533545 struct hci_dev *hdev;
546+ bool proto_ready;
534547
535548 BT_DBG("tty %p", tty);
536549
@@ -540,24 +553,38 @@ static void hci_uart_tty_close(struct tty_struct *tty) · 3 unmodified lines
540553 if (!hu)
541554 return;
542555
543− hdev = hu->hdev;
544− if (hdev)
545− hci_uart_close(hdev);
556+ /* Wait for init_ready to finish to prevent registration races */
557+ cancel_work_sync(&hu->init_ready);
546558
547− if (test_bit(HCI_UART_PROTO_READY, &hu->flags)) {
559+ proto_ready = test_bit(HCI_UART_PROTO_READY, &hu->flags);
560+ if (proto_ready) {
548561 percpu_down_write(&hu->proto_lock);
549562 clear_bit(HCI_UART_PROTO_READY, &hu->flags);
550563 percpu_up_write(&hu->proto_lock);
564+ }
551565
552− cancel_work_sync(&hu->init_ready);
553− cancel_work_sync(&hu->write_work);
566+ /*
567+ * Unconditionally cancel write_work AFTER clearing PROTO_READY.
568+ * This ensures that concurrent protocol timers cannot requeue
569+ * write_work via hci_uart_tx_wakeup(), permanently preventing
570+ * double-free races and UAFs.
571+ */
572+ cancel_work_sync(&hu->write_work);
573+
574+ hdev = hu->hdev;
575+ if (hdev)
576+ hci_uart_close(hdev); /* proto->flush is safely skipped */
554577
578+ if (proto_ready) {
555579 if (hdev) {
556580 if (test_bit(HCI_UART_REGISTERED, &hu->flags))
557581 hci_unregister_dev(hdev);
558− hci_free_dev(hdev);
559582 }
583+ /* Close protocol before freeing hdev (intrinsically purges queues) */
560584 hu->proto->close(hu);
585+
586+ if (hdev)
587+ hci_free_dev(hdev);
561588 }
562589 clear_bit(HCI_UART_PROTO_SET, &hu->flags);
563590
@@ -625,11 +652,12 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, · 61 unmodified lines
625652 * tty caller
626653 */
627654 hu->proto->recv(hu, data, count);
628− percpu_up_read(&hu->proto_lock);
629655
630656 if (hu->hdev)
631657 hu->hdev->stat.byte_rx += count;
632658
659+ percpu_up_read(&hu->proto_lock);
660+
633661 tty_unthrottle(tty);
634662 }
635663
@@ -695,6 +723,10 @@ static int hci_uart_register_dev(struct hci_uart *hu) · 59 unmodified lines
695723 percpu_down_write(&hu->proto_lock);
696724 clear_bit(HCI_UART_PROTO_INIT, &hu->flags);
697725 percpu_up_write(&hu->proto_lock);
726+ /* Cancel work after clearing flags */
727+ cancel_work_sync(&hu->write_work);
728+
729+ /* Close protocol before freeing hdev */
698730 hu->proto->close(hu);
699731 hu->hdev = NULL;
700732 hci_free_dev(hdev);
drivers/bluetooth/hci_qca.c+18−19
@@ -48,13 +48,12 @@ · 47 unmodified lines
4848 #define HCI_MAX_IBS_SIZE 10
4949
5050 #define IBS_WAKE_RETRANS_TIMEOUT_MS 100
51−#define IBS_BTSOC_TX_IDLE_TIMEOUT_MS 200
51+#define IBS_BTSOC_TX_IDLE_TIMEOUT msecs_to_jiffies(200)
5252 #define IBS_HOST_TX_IDLE_TIMEOUT_MS 2000
53−#define CMD_TRANS_TIMEOUT_MS 100
54−#define MEMDUMP_TIMEOUT_MS 8000
55−#define IBS_DISABLE_SSR_TIMEOUT_MS \
56− (MEMDUMP_TIMEOUT_MS + FW_DOWNLOAD_TIMEOUT_MS)
57−#define FW_DOWNLOAD_TIMEOUT_MS 3000
53+#define CMD_TRANS_TIMEOUT msecs_to_jiffies(100)
54+#define MEMDUMP_TIMEOUT msecs_to_jiffies(8000)
55+#define FW_DOWNLOAD_TIMEOUT msecs_to_jiffies(3000)
56+#define IBS_DISABLE_SSR_TIMEOUT (MEMDUMP_TIMEOUT + FW_DOWNLOAD_TIMEOUT)
5857
5958 /* susclk rate */
6059 #define SUSCLK_RATE_32KHZ 32768
@@ -1096,7 +1095,7 @@ static void qca_controller_memdump(struct work_struct *work) · 1035 unmodified lines
10961095
10971096 queue_delayed_work(qca->workqueue,
10981097 &qca->ctrl_memdump_timeout,
1099− msecs_to_jiffies(MEMDUMP_TIMEOUT_MS));
1098+ MEMDUMP_TIMEOUT);
11001099 skb_pull(skb, sizeof(qca_memdump->ram_dump_size));
11011100 qca_memdump->current_seq_no = 0;
11021101 qca_memdump->received_dump = 0;
@@ -1369,7 +1368,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) · 266 unmodified lines
13691368
13701369 if (hu->serdev)
13711370 serdev_device_wait_until_sent(hu->serdev,
1372− msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS));
1371+ CMD_TRANS_TIMEOUT);
13731372
13741373 /* Give the controller time to process the request */
13751374 switch (qca_soc_type(hu)) {
@@ -1401,8 +1400,8 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) · 25 unmodified lines
14011400
14021401 static int qca_send_power_pulse(struct hci_uart *hu, bool on)
14031402 {
1403+ int timeout = CMD_TRANS_TIMEOUT;
14041404 int ret;
1405− int timeout = msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS);
14061405 u8 cmd = on ? QCA_WCN3990_POWERON_PULSE : QCA_WCN3990_POWEROFF_PULSE;
14071406
14081407 /* These power pulses are single byte command which are sent
@@ -1607,7 +1606,7 @@ static void qca_wait_for_dump_collection(struct hci_dev *hdev) · 198 unmodified lines
16071606 struct qca_data *qca = hu->priv;
16081607
16091608 wait_on_bit_timeout(&qca->flags, QCA_MEMDUMP_COLLECTION,
1610− TASK_UNINTERRUPTIBLE, MEMDUMP_TIMEOUT_MS);
1609+ TASK_UNINTERRUPTIBLE, MEMDUMP_TIMEOUT);
16111610
16121611 clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flags);
16131612 }
@@ -1681,8 +1680,8 @@ static void qca_hw_error(struct hci_dev *hdev, u8 code) · 67 unmodified lines
16811680 mod_timer(&qca->tx_idle_timer, jiffies +
16821681 msecs_to_jiffies(qca->tx_idle_delay));
16831682
1684− /* Controller reset completion time is 50ms */
1685− msleep(50);
1683+ /* Wait for the controller to load the rampatch and NVM. */
1684+ msleep(100);
16861685
16871686 clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
16881687 clear_bit(QCA_IBS_DISABLED, &qca->flags);
@@ -2591,7 +2590,7 @@ static void qca_serdev_remove(struct serdev_device *serdev) · 902 unmodified lines
25912590 static void qca_serdev_shutdown(struct serdev_device *serdev)
25922591 {
25932592 int ret;
2594− int timeout = msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS);
2593+ int timeout = CMD_TRANS_TIMEOUT;
25952594 struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
25962595 struct hci_uart *hu = &qcadev->serdev_hu;
25972596 struct hci_dev *hdev = hu->hdev;
@@ -2648,7 +2647,7 @@ static int __maybe_unused qca_suspend(struct device *dev) · 50 unmodified lines
26482647 bool tx_pending = false;
26492648 int ret = 0;
26502649 u8 cmd;
2651− u32 wait_timeout = 0;
2650+ unsigned long wait_timeout = 0;
26522651
26532652 set_bit(QCA_SUSPENDING, &qca->flags);
26542653
@@ -2669,15 +2668,15 @@ static int __maybe_unused qca_suspend(struct device *dev) · 14 unmodified lines
26692668 if (test_bit(QCA_IBS_DISABLED, &qca->flags) ||
26702669 test_bit(QCA_SSR_TRIGGERED, &qca->flags)) {
26712670 wait_timeout = test_bit(QCA_SSR_TRIGGERED, &qca->flags) ?
2672− IBS_DISABLE_SSR_TIMEOUT_MS :
2673− FW_DOWNLOAD_TIMEOUT_MS;
2671+ IBS_DISABLE_SSR_TIMEOUT :
2672+ FW_DOWNLOAD_TIMEOUT;
26742673
26752674 /* QCA_IBS_DISABLED flag is set to true, During FW download
26762675 * and during memory dump collection. It is reset to false,
26772676 * After FW download complete.
26782677 */
26792678 wait_on_bit_timeout(&qca->flags, QCA_IBS_DISABLED,
2680− TASK_UNINTERRUPTIBLE, msecs_to_jiffies(wait_timeout));
2679+ TASK_UNINTERRUPTIBLE, wait_timeout);
26812680
26822681 if (test_bit(QCA_IBS_DISABLED, &qca->flags)) {
26832682 bt_dev_err(hu->hdev, "SSR or FW download time out");
@@ -2729,7 +2728,7 @@ static int __maybe_unused qca_suspend(struct device *dev) · 45 unmodified lines
27292728
27302729 if (tx_pending) {
27312730 serdev_device_wait_until_sent(hu->serdev,
2732− msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS));
2731+ CMD_TRANS_TIMEOUT);
27332732 serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_OFF, hu);
27342733 }
27352734
@@ -2738,7 +2737,7 @@ static int __maybe_unused qca_suspend(struct device *dev) · 2 unmodified lines
27382737 */
27392738 ret = wait_event_interruptible_timeout(qca->suspend_wait_q,
27402739 qca->rx_ibs_state == HCI_IBS_RX_ASLEEP,
2741− msecs_to_jiffies(IBS_BTSOC_TX_IDLE_TIMEOUT_MS));
2740+ IBS_BTSOC_TX_IDLE_TIMEOUT);
27422741 if (ret == 0) {
27432742 ret = -ETIMEDOUT;
27442743 goto error;
drivers/bluetooth/virtio_bt.c+32−7
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <net/bluetooth/hci_core.h>
1313
1414 #define VERSION "0.1"
15+#define VIRTBT_RX_BUF_SIZE 1000
1516
1617 enum {
1718 VIRTBT_VQ_TX,
@@ -33,11 +34,11 @@ static int virtbt_add_inbuf(struct virtio_bluetooth *vbt) · 15 unmodified lines
3334 struct sk_buff *skb;
3435 int err;
3536
36− skb = alloc_skb(1000, GFP_KERNEL);
37+ skb = alloc_skb(VIRTBT_RX_BUF_SIZE, GFP_KERNEL);
3738 if (!skb)
3839 return -ENOMEM;
3940
40− sg_init_one(sg, skb->data, 1000);
41+ sg_init_one(sg, skb->data, VIRTBT_RX_BUF_SIZE);
4142
4243 err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL);
4344 if (err < 0) {
@@ -197,6 +198,7 @@ static int virtbt_shutdown_generic(struct hci_dev *hdev) · 153 unmodified lines
197198
198199 static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb)
199200 {
201+ size_t min_hdr;
200202 __u8 pkt_type;
201203
202204 pkt_type = *((__u8 *) skb->data);
@@ -204,16 +206,32 @@ static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb) · 1 unmodified line
204206
205207 switch (pkt_type) {
206208 case HCI_EVENT_PKT:
209+ min_hdr = sizeof(struct hci_event_hdr);
210+ break;
207211 case HCI_ACLDATA_PKT:
212+ min_hdr = sizeof(struct hci_acl_hdr);
213+ break;
208214 case HCI_SCODATA_PKT:
215+ min_hdr = sizeof(struct hci_sco_hdr);
216+ break;
209217 case HCI_ISODATA_PKT:
210− hci_skb_pkt_type(skb) = pkt_type;
211− hci_recv_frame(vbt->hdev, skb);
218+ min_hdr = sizeof(struct hci_iso_hdr);
212219 break;
213220 default:
214221 kfree_skb(skb);
215− break;
222+ return;
223+ }
224+
225+ if (skb->len < min_hdr) {
226+ bt_dev_err_ratelimited(vbt->hdev,
227+ "rx pkt_type 0x%02x payload %u < hdr %zu\n",
228+ pkt_type, skb->len, min_hdr);
229+ kfree_skb(skb);
230+ return;
216231 }
232+
233+ hci_skb_pkt_type(skb) = pkt_type;
234+ hci_recv_frame(vbt->hdev, skb);
217235 }
218236
219237 static void virtbt_rx_work(struct work_struct *work)
@@ -227,8 +245,15 @@ static void virtbt_rx_work(struct work_struct *work) · 7 unmodified lines
227245 if (!skb)
228246 return;
229247
230− skb_put(skb, len);
231− virtbt_rx_handle(vbt, skb);
248+ if (!len || len > VIRTBT_RX_BUF_SIZE) {
249+ bt_dev_err_ratelimited(vbt->hdev,
250+ "rx reply len %u outside [1, %u]\n",
251+ len, VIRTBT_RX_BUF_SIZE);
252+ kfree_skb(skb);
253+ } else {
254+ skb_put(skb, len);
255+ virtbt_rx_handle(vbt, skb);
256+ }
232257
233258 if (virtbt_add_inbuf(vbt) < 0)
234259 return;
drivers/cdrom/cdrom.c+48−25
@@ -631,6 +631,16 @@ int register_cdrom(struct gendisk *disk, struct cdrom_device_info *cdi) · 630 unmodified lines
631631
632632 WARN_ON(!cdo->generic_packet);
633633
634+ /*
635+ * Propagate the drive's write support to the block layer so BLKROGET
636+ * reflects actual write capability. Drivers that use GET CONFIGURATION
637+ * features (CDC_MRW_W, CDC_RAM) must have called
638+ * cdrom_probe_write_features() before register_cdrom() so the mask is
639+ * complete here.
640+ */
641+ set_disk_ro(disk, !CDROM_CAN(CDC_DVD_RAM | CDC_MRW_W | CDC_RAM |
642+ CDC_CD_RW));
643+
634644 cd_dbg(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
635645 mutex_lock(&cdrom_mutex);
636646 list_add(&cdi->list, &cdrom_list);
@@ -742,6 +752,44 @@ static int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write) · 105 unmodified lines
742752 return 0;
743753 }
744754
755+/*
756+ * Probe write-related MMC features via GET CONFIGURATION and update
757+ * cdi->mask accordingly. Drivers that populate cdi->mask from the MODE SENSE
758+ * capabilities page (e.g. sr) should call this after those MODE SENSE bits
759+ * have been set but before register_cdrom(), so that the full set of
760+ * write-capability bits is known by the time register_cdrom() decides on the
761+ * initial read-only state of the disk.
762+ */
763+void cdrom_probe_write_features(struct cdrom_device_info *cdi)
764+{
765+ int mrw, mrw_write, ram_write;
766+
767+ mrw = 0;
768+ if (!cdrom_is_mrw(cdi, &mrw_write))
769+ mrw = 1;
770+
771+ if (CDROM_CAN(CDC_MO_DRIVE))
772+ ram_write = 1;
773+ else
774+ (void) cdrom_is_random_writable(cdi, &ram_write);
775+
776+ if (mrw)
777+ cdi->mask &= ~CDC_MRW;
778+ else
779+ cdi->mask |= CDC_MRW;
780+
781+ if (mrw_write)
782+ cdi->mask &= ~CDC_MRW_W;
783+ else
784+ cdi->mask |= CDC_MRW_W;
785+
786+ if (ram_write)
787+ cdi->mask &= ~CDC_RAM;
788+ else
789+ cdi->mask |= CDC_RAM;
790+}
791+EXPORT_SYMBOL(cdrom_probe_write_features);
792+
745793 static int cdrom_media_erasable(struct cdrom_device_info *cdi)
746794 {
747795 disc_information di;
@@ -894,33 +942,8 @@ static int cdrom_is_dvd_rw(struct cdrom_device_info *cdi) · 146 unmodified lines
894942 */
895943 static int cdrom_open_write(struct cdrom_device_info *cdi)
896944 {
897− int mrw, mrw_write, ram_write;
898945 int ret = 1;
899946
900− mrw = 0;
901− if (!cdrom_is_mrw(cdi, &mrw_write))
902− mrw = 1;
903−
904− if (CDROM_CAN(CDC_MO_DRIVE))
905− ram_write = 1;
906− else
907− (void) cdrom_is_random_writable(cdi, &ram_write);
908−
909− if (mrw)
910− cdi->mask &= ~CDC_MRW;
911− else
912− cdi->mask |= CDC_MRW;
913−
914− if (mrw_write)
915− cdi->mask &= ~CDC_MRW_W;
916− else
917− cdi->mask |= CDC_MRW_W;
918−
919− if (ram_write)
920− cdi->mask &= ~CDC_RAM;
921− else
922− cdi->mask |= CDC_RAM;
923−
924947 if (CDROM_CAN(CDC_MRW_W))
925948 ret = cdrom_mrw_open_write(cdi);
926949 else if (CDROM_CAN(CDC_DVD_RAM))
drivers/char/ipmi/ipmi_si_intf.c+56−14
@@ -168,6 +168,10 @@ struct smi_info { · 167 unmodified lines
168168 OEM2_DATA_AVAIL)
169169 unsigned char msg_flags;
170170
171+ /* When requesting events and messages, don't do it forever. */
172+ unsigned int num_requests_in_a_row;
173+ bool last_was_flag_fetch;
174+
171175 /* Does the BMC have an event buffer? */
172176 bool has_event_buffer;
173177
@@ -410,7 +414,10 @@ static void start_getting_msg_queue(struct smi_info *smi_info) · 236 unmodified lines
410414
411415 start_new_msg(smi_info, smi_info->curr_msg->data,
412416 smi_info->curr_msg->data_size);
413− smi_info->si_state = SI_GETTING_MESSAGES;
417+ if (smi_info->si_state != SI_GETTING_MESSAGES) {
418+ smi_info->num_requests_in_a_row = 0;
419+ smi_info->si_state = SI_GETTING_MESSAGES;
420+ }
414421 }
415422
416423 static void start_getting_events(struct smi_info *smi_info)
@@ -421,7 +428,10 @@ static void start_getting_events(struct smi_info *smi_info) · 4 unmodified lines
421428
422429 start_new_msg(smi_info, smi_info->curr_msg->data,
423430 smi_info->curr_msg->data_size);
424− smi_info->si_state = SI_GETTING_EVENTS;
431+ if (smi_info->si_state != SI_GETTING_EVENTS) {
432+ smi_info->num_requests_in_a_row = 0;
433+ smi_info->si_state = SI_GETTING_EVENTS;
434+ }
425435 }
426436
427437 /*
@@ -487,15 +497,19 @@ retry: · 59 unmodified lines
487497 } else if (smi_info->msg_flags & RECEIVE_MSG_AVAIL) {
488498 /* Messages available. */
489499 smi_info->curr_msg = alloc_msg_handle_irq(smi_info);
490− if (!smi_info->curr_msg)
500+ if (!smi_info->curr_msg) {
501+ smi_info->si_state = SI_NORMAL;
491502 return;
503+ }
492504
493505 start_getting_msg_queue(smi_info);
494506 } else if (smi_info->msg_flags & EVENT_MSG_BUFFER_FULL) {
495507 /* Events available. */
496508 smi_info->curr_msg = alloc_msg_handle_irq(smi_info);
497− if (!smi_info->curr_msg)
509+ if (!smi_info->curr_msg) {
510+ smi_info->si_state = SI_NORMAL;
498511 return;
512+ }
499513
500514 start_getting_events(smi_info);
501515 } else if (smi_info->msg_flags & OEM_DATA_AVAIL &&
@@ -595,6 +609,7 @@ static void handle_transaction_done(struct smi_info *smi_info) · 93 unmodified lines
595609 smi_info->si_state = SI_NORMAL;
596610 } else {
597611 smi_info->msg_flags = msg[3];
612+ smi_info->last_was_flag_fetch = true;
598613 handle_flags(smi_info);
599614 }
600615 break;
@@ -630,7 +645,13 @@ static void handle_transaction_done(struct smi_info *smi_info) · 29 unmodified lines
630645 */
631646 msg = smi_info->curr_msg;
632647 smi_info->curr_msg = NULL;
633− if (msg->rsp[2] != 0) {
648+ /*
649+ * It appears some BMCs, with no event data, return no
650+ * data in the message and not a 0x80 error as the
651+ * spec says they should. Shut down processing if
652+ * the data is not the right length.
653+ */
654+ if (msg->rsp[2] != 0 || msg->rsp_size != 19) {
634655 /* Error getting event, probably done. */
635656 msg->done(msg);
636657
@@ -640,6 +661,11 @@ static void handle_transaction_done(struct smi_info *smi_info) · 3 unmodified lines
640661 } else {
641662 smi_inc_stat(smi_info, events);
642663
664+ smi_info->num_requests_in_a_row++;
665+ if (smi_info->num_requests_in_a_row > 10)
666+ /* Stop if we do this too many times. */
667+ smi_info->msg_flags &= ~EVENT_MSG_BUFFER_FULL;
668+
643669 /*
644670 * Do this before we deliver the message
645671 * because delivering the message releases the
@@ -678,6 +704,11 @@ static void handle_transaction_done(struct smi_info *smi_info) · 32 unmodified lines
678704 } else {
679705 smi_inc_stat(smi_info, incoming_messages);
680706
707+ smi_info->num_requests_in_a_row++;
708+ if (smi_info->num_requests_in_a_row > 10)
709+ /* Stop if we do this too many times. */
710+ smi_info->msg_flags &= ~RECEIVE_MSG_AVAIL;
711+
681712 /*
682713 * Do this before we deliver the message
683714 * because delivering the message releases the
@@ -819,6 +850,26 @@ restart: · 135 unmodified lines
819850 goto out;
820851 }
821852
853+ /*
854+ * If we are currently idle, or if the last thing that was
855+ * done was a flag fetch and there is a message pending, try
856+ * to start the next message.
857+ *
858+ * We do the waiting message check to avoid a stuck flag
859+ * completely wedging the driver. Let a message through
860+ * in between flag operations if that happens.
861+ */
862+ if (si_sm_result == SI_SM_IDLE ||
863+ (si_sm_result == SI_SM_ATTN && smi_info->waiting_msg &&
864+ smi_info->last_was_flag_fetch)) {
865+ smi_info->last_was_flag_fetch = false;
866+ smi_inc_stat(smi_info, idles);
867+
868+ si_sm_result = start_next_msg(smi_info);
869+ if (si_sm_result != SI_SM_IDLE)
870+ goto restart;
871+ }
872+
822873 /*
823874 * We prefer handling attn over new messages. But don't do
824875 * this if there is not yet an upper layer to handle anything.
@@ -846,15 +897,6 @@ restart: · 21 unmodified lines
846897 }
847898 }
848899
849− /* If we are currently idle, try to start the next message. */
850− if (si_sm_result == SI_SM_IDLE) {
851− smi_inc_stat(smi_info, idles);
852−
853− si_sm_result = start_next_msg(smi_info);
854− if (si_sm_result != SI_SM_IDLE)
855− goto restart;
856− }
857−
858900 if ((si_sm_result == SI_SM_IDLE)
859901 && (atomic_read(&smi_info->req_events))) {
860902 /*
drivers/char/ipmi/ipmi_ssif.c+22−2
@@ -225,6 +225,9 @@ struct ssif_info { · 224 unmodified lines
225225 bool has_event_buffer;
226226 bool supports_alert;
227227
228+ /* When requesting events and messages, don't do it forever. */
229+ unsigned int num_requests_in_a_row;
230+
228231 /*
229232 * Used to tell what we should do with alerts. If we are
230233 * waiting on a response, read the data immediately.
@@ -413,7 +416,10 @@ static void start_event_fetch(struct ssif_info *ssif_info, unsigned long *flags) · 182 unmodified lines
413416 }
414417
415418 ssif_info->curr_msg = msg;
416− ssif_info->ssif_state = SSIF_GETTING_EVENTS;
419+ if (ssif_info->ssif_state != SSIF_GETTING_EVENTS) {
420+ ssif_info->num_requests_in_a_row = 0;
421+ ssif_info->ssif_state = SSIF_GETTING_EVENTS;
422+ }
417423 ipmi_ssif_unlock_cond(ssif_info, flags);
418424
419425 msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2);
@@ -436,7 +442,10 @@ static void start_recv_msg_fetch(struct ssif_info *ssif_info, · 16 unmodified lines
436442 }
437443
438444 ssif_info->curr_msg = msg;
439− ssif_info->ssif_state = SSIF_GETTING_MESSAGES;
445+ if (ssif_info->ssif_state != SSIF_GETTING_MESSAGES) {
446+ ssif_info->num_requests_in_a_row = 0;
447+ ssif_info->ssif_state = SSIF_GETTING_MESSAGES;
448+ }
440449 ipmi_ssif_unlock_cond(ssif_info, flags);
441450
442451 msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2);
@@ -843,6 +852,11 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 400 unmodified lines
843852 ssif_info->msg_flags &= ~EVENT_MSG_BUFFER_FULL;
844853 handle_flags(ssif_info, flags);
845854 } else {
855+ ssif_info->num_requests_in_a_row++;
856+ if (ssif_info->num_requests_in_a_row > 10)
857+ /* Stop if we do this too many times. */
858+ ssif_info->msg_flags &= ~EVENT_MSG_BUFFER_FULL;
859+
846860 handle_flags(ssif_info, flags);
847861 ssif_inc_stat(ssif_info, events);
848862 deliver_recv_msg(ssif_info, msg);
@@ -876,6 +890,11 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 27 unmodified lines
876890 ssif_info->msg_flags &= ~RECEIVE_MSG_AVAIL;
877891 handle_flags(ssif_info, flags);
878892 } else {
893+ ssif_info->num_requests_in_a_row++;
894+ if (ssif_info->num_requests_in_a_row > 10)
895+ /* Stop if we do this too many times. */
896+ ssif_info->msg_flags &= ~RECEIVE_MSG_AVAIL;
897+
879898 ssif_inc_stat(ssif_info, incoming_messages);
880899 handle_flags(ssif_info, flags);
881900 deliver_recv_msg(ssif_info, msg);
@@ -1886,6 +1905,7 @@ static int ssif_probe(struct i2c_client *client) · 1004 unmodified lines
18861905 "kssif%4.4x", thread_num);
18871906 if (IS_ERR(ssif_info->thread)) {
18881907 rv = PTR_ERR(ssif_info->thread);
1908+ ssif_info->thread = NULL;
18891909 dev_notice(&ssif_info->client->dev,
18901910 "Could not start kernel thread: error %d\n",
18911911 rv);
drivers/clk/clk-eyeq.c+15−45
@@ -110,6 +110,7 @@ struct eqc_match_data { · 109 unmodified lines
110110
111111 const char *reset_auxdev_name;
112112 const char *pinctrl_auxdev_name;
113+ const char *eth_phy_auxdev_name;
113114
114115 unsigned int early_clk_count;
115116 };
@@ -321,38 +322,18 @@ static void eqc_probe_init_fixed_factors(struct device *dev, · 205 unmodified lines
321322 }
322323 }
323324
324−static void eqc_auxdev_release(struct device *dev)
325−{
326− struct auxiliary_device *adev = to_auxiliary_dev(dev);
327−
328− kfree(adev);
329−}
330−
331−static int eqc_auxdev_create(struct device *dev, void __iomem *base,
332− const char *name, u32 id)
325+static void eqc_auxdev_create_optional(struct device *dev, void __iomem *base,
326+ const char *name)
333327 {
334328 struct auxiliary_device *adev;
335− int ret;
336−
337− adev = kzalloc_obj(*adev);
338− if (!adev)
339− return -ENOMEM;
340−
341− adev->name = name;
342− adev->dev.parent = dev;
343− adev->dev.platform_data = (void __force *)base;
344− adev->dev.release = eqc_auxdev_release;
345− adev->id = id;
346329
347− ret = auxiliary_device_init(adev);
348− if (ret)
349− return ret;
350−
351− ret = auxiliary_device_add(adev);
352− if (ret)
353− auxiliary_device_uninit(adev);
354−
355− return ret;
330+ if (name) {
331+ adev = devm_auxiliary_device_create(dev, name,
332+ (void __force *)base);
333+ if (!adev)
334+ dev_warn(dev, "failed creating auxiliary device %s.%s\n",
335+ KBUILD_MODNAME, name);
336+ }
356337 }
357338
358339 static int eqc_probe(struct platform_device *pdev)
@@ -364,7 +345,6 @@ static int eqc_probe(struct platform_device *pdev) · 5 unmodified lines
364345 unsigned int i, clk_count;
365346 struct resource *res;
366347 void __iomem *base;
367− int ret;
368348
369349 data = device_get_match_data(dev);
370350 if (!data)
@@ -378,21 +358,10 @@ static int eqc_probe(struct platform_device *pdev) · 7 unmodified lines
378358 if (!base)
379359 return -ENOMEM;
380360
381− /* Init optional reset auxiliary device. */
382− if (data->reset_auxdev_name) {
383− ret = eqc_auxdev_create(dev, base, data->reset_auxdev_name, 0);
384− if (ret)
385− dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n",
386− KBUILD_MODNAME, data->reset_auxdev_name, ret);
387− }
388−
389− /* Init optional pinctrl auxiliary device. */
390− if (data->pinctrl_auxdev_name) {
391− ret = eqc_auxdev_create(dev, base, data->pinctrl_auxdev_name, 0);
392− if (ret)
393− dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n",
394− KBUILD_MODNAME, data->pinctrl_auxdev_name, ret);
395− }
361+ /* Init optional auxiliary devices. */
362+ eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name);
363+ eqc_auxdev_create_optional(dev, base, data->pinctrl_auxdev_name);
364+ eqc_auxdev_create_optional(dev, base, data->eth_phy_auxdev_name);
396365
397366 if (data->pll_count + data->div_count + data->fixed_factor_count == 0)
398367 return 0; /* Zero clocks, we are done. */
@@ -553,6 +522,7 @@ static const struct eqc_match_data eqc_eyeq5_match_data = { · 154 unmodified lines
553522
554523 .reset_auxdev_name = "reset",
555524 .pinctrl_auxdev_name = "pinctrl",
525+ .eth_phy_auxdev_name = "phy",
556526
557527 .early_clk_count = ARRAY_SIZE(eqc_eyeq5_early_plls) +
558528 ARRAY_SIZE(eqc_eyeq5_early_fixed_factors),
drivers/clk/clk-rk808.c+1−1
@@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev) · 152 unmodified lines
153153 struct rk808_clkout *rk808_clkout;
154154 int ret;
155155
156− dev->of_node = pdev->dev.parent->of_node;
156+ device_set_of_node_from_dev(dev, dev->parent);
157157
158158 rk808_clkout = devm_kzalloc(dev,
159159 sizeof(*rk808_clkout), GFP_KERNEL);
drivers/clk/spacemit/ccu-k3.c+1−1
@@ -846,7 +846,7 @@ static const struct clk_parent_data top_parents[] = { · 845 unmodified lines
846846 CCU_PARENT_HW(pll6_d3),
847847 };
848848 CCU_MUX_DIV_GATE_FC_DEFINE(top_dclk, top_parents, APMU_TOP_DCLK_CTRL, 5, 3,
849− BIT(8), 2, 3, BIT(1), 0);
849+ BIT(8), 2, 3, BIT(1), CLK_IS_CRITICAL);
850850
851851 static const struct clk_parent_data ucie_parents[] = {
852852 CCU_PARENT_HW(pll1_d8_307p2),
drivers/comedi/drivers/comedi_test.c+3−2
@@ -274,6 +274,7 @@ static int waveform_ai_cmdtest(struct comedi_device *dev, · 273 unmodified lines
274274 /* Step 2a : make sure trigger sources are unique */
275275
276276 err |= comedi_check_trigger_is_unique(cmd->convert_src);
277+ err |= comedi_check_trigger_is_unique(cmd->scan_begin_src);
277278 err |= comedi_check_trigger_is_unique(cmd->stop_src);
278279
279280 /* Step 2b : and mutually compatible */
@@ -324,10 +325,10 @@ static int waveform_ai_cmdtest(struct comedi_device *dev, · 44 unmodified lines
324325 arg = min(arg,
325326 rounddown(UINT_MAX, (unsigned int)NSEC_PER_USEC));
326327 arg = NSEC_PER_USEC * DIV_ROUND_CLOSEST(arg, NSEC_PER_USEC);
327− if (cmd->scan_begin_arg == TRIG_TIMER) {
328+ if (cmd->scan_begin_src == TRIG_TIMER) {
328329 /* limit convert_arg to keep scan_begin_arg in range */
329330 limit = UINT_MAX / cmd->scan_end_arg;
330− limit = rounddown(limit, (unsigned int)NSEC_PER_SEC);
331+ limit = rounddown(limit, (unsigned int)NSEC_PER_USEC);
331332 arg = min(arg, limit);
332333 }
333334 err |= comedi_check_trigger_arg_is(&cmd->convert_arg, arg);
drivers/counter/counter-core.c+2−1
@@ -124,7 +124,8 @@ struct counter_device *counter_alloc(size_t sizeof_priv) · 123 unmodified lines
124124
125125 err_dev_set_name:
126126
127− counter_chrdev_remove(counter);
127+ put_device(dev);
128+ return NULL;
128129 err_chrdev_add:
129130
130131 ida_free(&counter_ida, dev->id);
drivers/cpufreq/Kconfig.x86+0−12
@@ -70,18 +70,6 @@ config X86_AMD_PSTATE_DEFAULT_MODE · 69 unmodified lines
7070 For details, take a look at:
7171 <file:Documentation/admin-guide/pm/amd-pstate.rst>.
7272
73−config X86_AMD_PSTATE_DYNAMIC_EPP
74− bool "AMD Processor P-State dynamic EPP support"
75− depends on X86_AMD_PSTATE
76− default n
77− help
78− Allow the kernel to dynamically change the energy performance
79− value from events like ACPI platform profile and AC adapter plug
80− events.
81−
82− This feature can also be changed at runtime, this configuration
83− option only sets the kernel default value behavior.
84−
8573 config X86_AMD_PSTATE_UT
8674 tristate "selftest for AMD Processor P-State driver"
8775 depends on X86 && ACPI_PROCESSOR
drivers/cpufreq/amd-pstate-ut.c+38−12
@@ -274,20 +274,21 @@ static int amd_pstate_set_mode(enum amd_pstate_mode mode) · 273 unmodified lines
274274
275275 static int amd_pstate_ut_epp(u32 index)
276276 {
277− struct cpufreq_policy *policy __free(put_cpufreq_policy) = NULL;
278− char *buf __free(cleanup_page) = NULL;
279277 static const char * const epp_strings[] = {
280− "performance",
281− "balance_performance",
282− "balance_power",
283278 "power",
279+ "balance_power",
280+ "balance_performance",
281+ "performance",
284282 };
285− struct amd_cpudata *cpudata;
283+ char *buf __free(cleanup_page) = NULL;
284+ struct cpufreq_policy *policy = NULL;
286285 enum amd_pstate_mode orig_mode;
286+ struct amd_cpudata *cpudata;
287+ unsigned long orig_policy;
287288 bool orig_dynamic_epp;
288289 int ret, cpu = 0;
289− int i;
290290 u16 epp;
291+ int i;
291292
292293 policy = cpufreq_cpu_get(cpu);
293294 if (!policy)
@@ -297,11 +298,9 @@ static int amd_pstate_ut_epp(u32 index) · 3 unmodified lines
297298 orig_mode = amd_pstate_get_status();
298299 orig_dynamic_epp = cpudata->dynamic_epp;
299300
300− /* disable dynamic EPP before running test */
301− if (cpudata->dynamic_epp) {
302− pr_debug("Dynamic EPP is enabled, disabling it\n");
303− amd_pstate_clear_dynamic_epp(policy);
304− }
301+ /* Drop reference before potential driver change. */
302+ cpufreq_cpu_put(policy);
303+ policy = NULL;
305304
306305 buf = (char *)__get_free_page(GFP_KERNEL);
307306 if (!buf)
@@ -311,6 +310,27 @@ static int amd_pstate_ut_epp(u32 index) · 3 unmodified lines
311310 if (ret)
312311 goto out;
313312
313+ policy = cpufreq_cpu_get(cpu);
314+ if (!policy) {
315+ ret = -ENODEV;
316+ goto out;
317+ }
318+
319+ down_write(&policy->rwsem);
320+ cpudata = policy->driver_data;
321+ orig_policy = cpudata->policy;
322+ cpudata->policy = CPUFREQ_POLICY_POWERSAVE;
323+
324+ /*
325+ * Disable dynamic EPP before running test. If "orig_dynamic_epp" is
326+ * true, the driver will do a redundant switch at the end and there
327+ * is no need for enabling it again at the end of the test.
328+ */
329+ if (cpudata->dynamic_epp) {
330+ pr_debug("Dynamic EPP is enabled, disabling it\n");
331+ amd_pstate_clear_dynamic_epp(policy);
332+ }
333+
314334 for (epp = 0; epp <= U8_MAX; epp++) {
315335 u8 val;
316336
@@ -358,6 +378,12 @@ static int amd_pstate_ut_epp(u32 index) · 41 unmodified lines
358378 ret = 0;
359379
360380 out:
381+ if (policy) {
382+ cpudata->policy = orig_policy;
383+ up_write(&policy->rwsem);
384+ cpufreq_cpu_put(policy);
385+ }
386+
361387 if (orig_dynamic_epp) {
362388 int ret2;
363389
drivers/cpufreq/amd-pstate.c+18−9
@@ -87,11 +87,7 @@ static struct cpufreq_driver amd_pstate_driver; · 86 unmodified lines
8787 static struct cpufreq_driver amd_pstate_epp_driver;
8888 static int cppc_state = AMD_PSTATE_UNDEFINED;
8989 static bool amd_pstate_prefcore = true;
90−#ifdef CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP
91−static bool dynamic_epp = CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP;
92−#else
9390 static bool dynamic_epp;
94−#endif
9591 static struct quirk_entry *quirks;
9692
9793 /*
@@ -1291,6 +1287,8 @@ static int amd_pstate_set_dynamic_epp(struct cpufreq_policy *policy) · 1193 unmodified lines
12911287 return ret;
12921288
12931289 cpudata->profile_name = kasprintf(GFP_KERNEL, "amd-pstate-epp-cpu%d", cpudata->cpu);
1290+ if (!cpudata->profile_name)
1291+ return -ENOMEM;
12941292
12951293 cpudata->ppdev = platform_profile_register(get_cpu_device(policy->cpu),
12961294 cpudata->profile_name,
@@ -1427,7 +1425,7 @@ ssize_t store_energy_performance_preference(struct cpufreq_policy *policy, · 130 unmodified lines
14271425 if (ret)
14281426 epp = epp_values[ret];
14291427 else
1430− epp = amd_pstate_get_balanced_epp(policy);
1428+ epp = cpudata->epp_default_dc;
14311429 }
14321430
14331431 if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {
@@ -1707,6 +1705,8 @@ static int amd_pstate_change_driver_mode(int mode) · 273 unmodified lines
17071705 {
17081706 int ret;
17091707
1708+ lockdep_assert_held(&amd_pstate_driver_lock);
1709+
17101710 ret = amd_pstate_unregister_driver(0);
17111711 if (ret)
17121712 return ret;
@@ -1821,8 +1821,16 @@ static ssize_t dynamic_epp_store(struct device *a, struct device_attribute *b, · 108 unmodified lines
18211821 if (ret)
18221822 return ret;
18231823
1824− if (dynamic_epp == enabled)
1824+ guard(mutex)(&amd_pstate_driver_lock);
1825+
1826+ if (cppc_state != AMD_PSTATE_ACTIVE) {
1827+ pr_debug("dynamic_epp can only be toggled in active mode\n");
18251828 return -EINVAL;
1829+ }
1830+
1831+ /* Nothing to do */
1832+ if (dynamic_epp == enabled)
1833+ return count;
18261834
18271835 /* reinitialize with desired dynamic EPP value */
18281836 dynamic_epp = enabled;
@@ -1942,7 +1950,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) · 113 unmodified lines
19421950 if (dynamic_epp)
19431951 ret = amd_pstate_set_dynamic_epp(policy);
19441952 else
1945− ret = amd_pstate_set_epp(policy, amd_pstate_get_balanced_epp(policy));
1953+ ret = amd_pstate_set_epp(policy, cpudata->epp_default_dc);
19461954 if (ret)
19471955 goto free_cpudata1;
19481956
@@ -1970,12 +1978,13 @@ static void amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy) · 21 unmodified lines
19701978 if (cpudata) {
19711979 union perf_cached perf = READ_ONCE(cpudata->perf);
19721980
1981+ if (cpudata->dynamic_epp)
1982+ amd_pstate_clear_dynamic_epp(policy);
1983+
19731984 /* Reset CPPC_REQ MSR to the BIOS value */
19741985 amd_pstate_update_perf(policy, perf.bios_min_perf, 0U, 0U, 0U, false);
19751986 amd_pstate_set_floor_perf(policy, cpudata->bios_floor_perf);
19761987
1977− if (cpudata->dynamic_epp)
1978− amd_pstate_clear_dynamic_epp(policy);
19791988 kfree(cpudata);
19801989 policy->driver_data = NULL;
19811990 }
drivers/cpufreq/intel_pstate.c+2−1
@@ -2279,7 +2279,7 @@ static int hwp_get_cpu_scaling(int cpu) · 2278 unmodified lines
22792279 * Return the hybrid scaling factor for P-cores and use the
22802280 * default core scaling for E-cores.
22812281 */
2282− if (hybrid_get_cpu_type(cpu) == INTEL_CPU_TYPE_CORE)
2282+ if (hybrid_get_cpu_type(cpu) != INTEL_CPU_TYPE_ATOM)
22832283 return hybrid_scaling_factor;
22842284
22852285 return core_get_scaling();
@@ -3734,6 +3734,7 @@ static const struct x86_cpu_id intel_hybrid_scaling_factor[] = { · 1448 unmodified lines
37343734 X86_MATCH_VFM(INTEL_RAPTORLAKE, HYBRID_SCALING_FACTOR_ADL),
37353735 X86_MATCH_VFM(INTEL_RAPTORLAKE_P, HYBRID_SCALING_FACTOR_ADL),
37363736 X86_MATCH_VFM(INTEL_RAPTORLAKE_S, HYBRID_SCALING_FACTOR_ADL),
3737+ X86_MATCH_VFM(INTEL_BARTLETTLAKE, HYBRID_SCALING_FACTOR_ADL),
37373738 X86_MATCH_VFM(INTEL_METEORLAKE_L, HYBRID_SCALING_FACTOR_MTL),
37383739 X86_MATCH_VFM(INTEL_LUNARLAKE_M, HYBRID_SCALING_FACTOR_LNL),
37393740 {}
drivers/dma-buf/dma-buf.c+5−1
@@ -792,9 +792,13 @@ int dma_buf_fd(struct dma_buf *dmabuf, int flags) · 791 unmodified lines
792792 if (!dmabuf || !dmabuf->file)
793793 return -EINVAL;
794794
795− fd = FD_ADD(flags, dmabuf->file);
795+ fd = get_unused_fd_flags(flags);
796+ if (fd < 0)
797+ return fd;
798+
796799 DMA_BUF_TRACE(trace_dma_buf_fd, dmabuf, fd);
797800
801+ fd_install(fd, dmabuf->file);
798802 return fd;
799803 }
800804 EXPORT_SYMBOL_NS_GPL(dma_buf_fd, "DMA_BUF");
drivers/dpll/dpll_netlink.c+21−2
@@ -829,12 +829,21 @@ int dpll_device_delete_ntf(struct dpll_device *dpll) · 828 unmodified lines
829829 return dpll_device_event_send(DPLL_CMD_DEVICE_DELETE_NTF, dpll);
830830 }
831831
832−static int
833−__dpll_device_change_ntf(struct dpll_device *dpll)
832+/**
833+ * __dpll_device_change_ntf - notify that the dpll device has been changed
834+ * @dpll: registered dpll pointer
835+ *
836+ * Context: caller must hold dpll_lock. Suitable for use inside device
837+ * callbacks which are already invoked under dpll_lock.
838+ * Return: 0 if succeeds, error code otherwise.
839+ */
840+int __dpll_device_change_ntf(struct dpll_device *dpll)
834841 {
842+ lockdep_assert_held(&dpll_lock);
835843 dpll_device_notify(dpll, DPLL_DEVICE_CHANGED);
836844 return dpll_device_event_send(DPLL_CMD_DEVICE_CHANGE_NTF, dpll);
837845 }
846+EXPORT_SYMBOL_GPL(__dpll_device_change_ntf);
838847
839848 /**
840849 * dpll_device_change_ntf - notify that the dpll device has been changed
@@ -900,11 +909,21 @@ int dpll_pin_delete_ntf(struct dpll_pin *pin) · 59 unmodified lines
900909 return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin);
901910 }
902911
912+/**
913+ * __dpll_pin_change_ntf - notify that the pin has been changed
914+ * @pin: registered pin pointer
915+ *
916+ * Context: caller must hold dpll_lock. Suitable for use inside pin
917+ * callbacks which are already invoked under dpll_lock.
918+ * Return: 0 if succeeds, error code otherwise.
919+ */
903920 int __dpll_pin_change_ntf(struct dpll_pin *pin)
904921 {
922+ lockdep_assert_held(&dpll_lock);
905923 dpll_pin_notify(pin, DPLL_PIN_CHANGED);
906924 return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin);
907925 }
926+EXPORT_SYMBOL_GPL(__dpll_pin_change_ntf);
908927
909928 /**
910929 * dpll_pin_change_ntf - notify that the pin has been changed
drivers/dpll/dpll_netlink.h+0−2
@@ -11,5 +11,3 @@ int dpll_device_delete_ntf(struct dpll_device *dpll); · 10 unmodified lines
1111 int dpll_pin_create_ntf(struct dpll_pin *pin);
1212
1313 int dpll_pin_delete_ntf(struct dpll_pin *pin);
14−
15−int __dpll_pin_change_ntf(struct dpll_pin *pin);
drivers/dpll/zl3073x/core.c+8−11
@@ -762,18 +762,15 @@ zl3073x_dev_periodic_work(struct kthread_work *work) · 761 unmodified lines
762762 dev_warn(zldev->dev, "Failed to update phase offsets: %pe\n",
763763 ERR_PTR(rc));
764764
765− /* Update measured input reference frequencies if any DPLL has
766− * frequency monitoring enabled.
765+ /* Update measured input reference frequencies if frequency
766+ * monitoring is enabled.
767767 */
768− list_for_each_entry(zldpll, &zldev->dplls, list) {
769− if (zldpll->freq_monitor) {
770− rc = zl3073x_ref_freq_meas_update(zldev);
771− if (rc)
772− dev_warn(zldev->dev,
773− "Failed to update measured frequencies: %pe\n",
774− ERR_PTR(rc));
775− break;
776− }
768+ if (zldev->freq_monitor) {
769+ rc = zl3073x_ref_freq_meas_update(zldev);
770+ if (rc)
771+ dev_warn(zldev->dev,
772+ "Failed to update measured frequencies: %pe\n",
773+ ERR_PTR(rc));
777774 }
778775
779776 /* Update references' fractional frequency offsets */
drivers/dpll/zl3073x/core.h+3−1
@@ -57,6 +57,7 @@ struct zl3073x_chip_info { · 56 unmodified lines
5757 * @work: periodic work
5858 * @clock_id: clock id of the device
5959 * @phase_avg_factor: phase offset measurement averaging factor
60+ * @freq_monitor: is frequency monitor enabled
6061 */
6162 struct zl3073x_dev {
6263 struct device *dev;
@@ -77,9 +78,10 @@ struct zl3073x_dev { · 14 unmodified lines
7778 struct kthread_worker *kworker;
7879 struct kthread_delayed_work work;
7980
80− /* Devlink parameters */
81+ /* Per-chip parameters */
8182 u64 clock_id;
8283 u8 phase_avg_factor;
84+ bool freq_monitor;
8385 };
8486
8587 extern const struct regmap_config zl3073x_regmap_config;
drivers/dpll/zl3073x/dpll.c+27−34
@@ -1079,15 +1079,6 @@ zl3073x_dpll_phase_offset_avg_factor_get(const struct dpll_device *dpll, · 1078 unmodified lines
10791079 return 0;
10801080 }
10811081
1082−static void
1083−zl3073x_dpll_change_work(struct work_struct *work)
1084−{
1085− struct zl3073x_dpll *zldpll;
1086−
1087− zldpll = container_of(work, struct zl3073x_dpll, change_work);
1088− dpll_device_change_ntf(zldpll->dpll_dev);
1089−}
1090−
10911082 static int
10921083 zl3073x_dpll_phase_offset_avg_factor_set(const struct dpll_device *dpll,
10931084 void *dpll_priv, u32 factor,
@@ -1113,8 +1104,10 @@ zl3073x_dpll_phase_offset_avg_factor_set(const struct dpll_device *dpll, · 19 unmodified lines
11131104 * we have to send a notification for other DPLL devices.
11141105 */
11151106 list_for_each_entry(item, &zldpll->dev->dplls, list) {
1116− if (item != zldpll)
1117− schedule_work(&item->change_work);
1107+ struct dpll_device *dpll_dev = READ_ONCE(item->dpll_dev);
1108+
1109+ if (item != zldpll && dpll_dev)
1110+ __dpll_device_change_ntf(dpll_dev);
11181111 }
11191112
11201113 return 0;
@@ -1219,7 +1212,7 @@ zl3073x_dpll_freq_monitor_get(const struct dpll_device *dpll, · 98 unmodified lines
12191212 {
12201213 struct zl3073x_dpll *zldpll = dpll_priv;
12211214
1222− if (zldpll->freq_monitor)
1215+ if (zldpll->dev->freq_monitor)
12231216 *state = DPLL_FEATURE_STATE_ENABLE;
12241217 else
12251218 *state = DPLL_FEATURE_STATE_DISABLE;
@@ -1233,9 +1226,19 @@ zl3073x_dpll_freq_monitor_set(const struct dpll_device *dpll, · 7 unmodified lines
12331226 enum dpll_feature_state state,
12341227 struct netlink_ext_ack *extack)
12351228 {
1236− struct zl3073x_dpll *zldpll = dpll_priv;
1229+ struct zl3073x_dpll *item, *zldpll = dpll_priv;
1230+
1231+ zldpll->dev->freq_monitor = (state == DPLL_FEATURE_STATE_ENABLE);
1232+
1233+ /* The frequency monitoring is common for all DPLL channels so after
1234+ * change we have to send a notification for other DPLL devices.
1235+ */
1236+ list_for_each_entry(item, &zldpll->dev->dplls, list) {
1237+ struct dpll_device *dpll_dev = READ_ONCE(item->dpll_dev);
12371238
1238− zldpll->freq_monitor = (state == DPLL_FEATURE_STATE_ENABLE);
1239+ if (item != zldpll && dpll_dev)
1240+ __dpll_device_change_ntf(dpll_dev);
1241+ }
12391242
12401243 return 0;
12411244 }
@@ -1394,8 +1397,8 @@ zl3073x_dpll_pin_register(struct zl3073x_dpll_pin *pin, u32 index) · 152 unmodified lines
13941397
13951398 err_register:
13961399 dpll_pin_put(pin->dpll_pin, &pin->tracker);
1397− pin->dpll_pin = NULL;
13981400 err_pin_get:
1401+ pin->dpll_pin = NULL;
13991402 fwnode_handle_put(pin->fwnode);
14001403 pin->fwnode = NULL;
14011404 zl3073x_pin_props_put(props);
@@ -1563,8 +1566,10 @@ zl3073x_dpll_pins_register(struct zl3073x_dpll *zldpll) · 161 unmodified lines
15631566 }
15641567
15651568 rc = zl3073x_dpll_pin_register(pin, index);
1566− if (rc)
1569+ if (rc) {
1570+ zl3073x_dpll_pin_free(pin);
15671571 goto error;
1572+ }
15681573
15691574 list_add(&pin->list, &zldpll->pins);
15701575 }
@@ -1625,13 +1630,13 @@ zl3073x_dpll_device_register(struct zl3073x_dpll *zldpll) · 54 unmodified lines
16251630 static void
16261631 zl3073x_dpll_device_unregister(struct zl3073x_dpll *zldpll)
16271632 {
1628− WARN(!zldpll->dpll_dev, "DPLL device is not registered\n");
1633+ struct dpll_device *dpll_dev = READ_ONCE(zldpll->dpll_dev);
16291634
1630− cancel_work_sync(&zldpll->change_work);
1635+ WARN(!dpll_dev, "DPLL device is not registered\n");
16311636
1632− dpll_device_unregister(zldpll->dpll_dev, &zldpll->ops, zldpll);
1633− dpll_device_put(zldpll->dpll_dev, &zldpll->tracker);
1634− zldpll->dpll_dev = NULL;
1637+ WRITE_ONCE(zldpll->dpll_dev, NULL);
1638+ dpll_device_unregister(dpll_dev, &zldpll->ops, zldpll);
1639+ dpll_device_put(dpll_dev, &zldpll->tracker);
16351640 }
16361641
16371642 /**
@@ -1750,7 +1755,7 @@ zl3073x_dpll_pin_measured_freq_check(struct zl3073x_dpll_pin *pin) · 112 unmodified lines
17501755 u8 ref_id;
17511756 u32 freq;
17521757
1753− if (!zldpll->freq_monitor)
1758+ if (!zldpll->dev->freq_monitor)
17541759 return false;
17551760
17561761 ref_id = zl3073x_input_pin_ref_get(pin->id);
@@ -1783,10 +1788,8 @@ zl3073x_dpll_changes_check(struct zl3073x_dpll *zldpll) · 26 unmodified lines
17831788 struct zl3073x_dev *zldev = zldpll->dev;
17841789 enum dpll_lock_status lock_status;
17851790 struct device *dev = zldev->dev;
1786− const struct zl3073x_chan *chan;
17871791 struct zl3073x_dpll_pin *pin;
17881792 int rc;
1789− u8 mode;
17901793
17911794 zldpll->check_count++;
17921795
@@ -1805,15 +1808,6 @@ zl3073x_dpll_changes_check(struct zl3073x_dpll *zldpll) · 12 unmodified lines
18051808 dpll_device_change_ntf(zldpll->dpll_dev);
18061809 }
18071810
1808− /* Input pin monitoring does make sense only in automatic
1809− * or forced reference modes.
1810− */
1811− chan = zl3073x_chan_state_get(zldev, zldpll->id);
1812− mode = zl3073x_chan_mode_get(chan);
1813− if (mode != ZL_DPLL_MODE_REFSEL_MODE_AUTO &&
1814− mode != ZL_DPLL_MODE_REFSEL_MODE_REFLOCK)
1815− return;
1816−
18171811 /* Update phase offset latch registers for this DPLL if the phase
18181812 * offset monitor feature is enabled.
18191813 */
@@ -1924,7 +1918,6 @@ zl3073x_dpll_alloc(struct zl3073x_dev *zldev, u8 ch) · 104 unmodified lines
19241918 zldpll->dev = zldev;
19251919 zldpll->id = ch;
19261920 INIT_LIST_HEAD(&zldpll->pins);
1927− INIT_WORK(&zldpll->change_work, zl3073x_dpll_change_work);
19281921
19291922 return zldpll;
19301923 }
drivers/dpll/zl3073x/dpll.h+0−4
@@ -15,13 +15,11 @@ · 14 unmodified lines
1515 * @id: DPLL index
1616 * @check_count: periodic check counter
1717 * @phase_monitor: is phase offset monitor enabled
18− * @freq_monitor: is frequency monitor enabled
1918 * @ops: DPLL device operations for this instance
2019 * @dpll_dev: pointer to registered DPLL device
2120 * @tracker: tracking object for the acquired reference
2221 * @lock_status: last saved DPLL lock status
2322 * @pins: list of pins
24− * @change_work: device change notification work
2523 */
2624 struct zl3073x_dpll {
2725 struct list_head list;
@@ -29,13 +27,11 @@ struct zl3073x_dpll { · 1 unmodified line
2927 u8 id;
3028 u8 check_count;
3129 bool phase_monitor;
32− bool freq_monitor;
3330 struct dpll_device_ops ops;
3431 struct dpll_device *dpll_dev;
3532 dpll_tracker tracker;
3633 enum dpll_lock_status lock_status;
3734 struct list_head pins;
38− struct work_struct change_work;
3935 };
4036
4137 struct zl3073x_dpll *zl3073x_dpll_alloc(struct zl3073x_dev *zldev, u8 ch);
drivers/edac/versalnet_edac.c+2−8
@@ -777,9 +777,9 @@ static int init_one_mc(struct mc_priv *priv, struct platform_device *pdev, int i · 776 unmodified lines
777777 u32 num_chans, rank, dwidth, config;
778778 struct edac_mc_layer layers[2];
779779 struct mem_ctl_info *mci;
780+ char name[MC_NAME_LEN];
780781 struct device *dev;
781782 enum dev_type dt;
782− char *name;
783783 int rc;
784784
785785 config = priv->adec[CONF + i * ADEC_NUM];
@@ -813,13 +813,9 @@ static int init_one_mc(struct mc_priv *priv, struct platform_device *pdev, int i · 27 unmodified lines
813813 layers[1].is_virt_csrow = false;
814814
815815 rc = -ENOMEM;
816− name = kzalloc(MC_NAME_LEN, GFP_KERNEL);
817− if (!name)
818− return rc;
819−
820816 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
821817 if (!dev)
822− goto err_name_free;
818+ return rc;
823819
824820 mci = edac_mc_alloc(i, ARRAY_SIZE(layers), layers, sizeof(struct mc_priv));
825821 if (!mci) {
@@ -858,8 +854,6 @@ err_mc_free: · 32 unmodified lines
858854 edac_mc_free(mci);
859855 err_dev_free:
860856 kfree(dev);
861−err_name_free:
862− kfree(name);
863857
864858 return rc;
865859 }
drivers/firmware/arm_ffa/bus.c+3−1
@@ -26,6 +26,8 @@ static int ffa_device_match(struct device *dev, const struct device_driver *drv) · 25 unmodified lines
2626
2727 id_table = to_ffa_driver(drv)->id_table;
2828 ffa_dev = to_ffa_dev(dev);
29+ if (!id_table)
30+ return 0;
2931
3032 while (!uuid_is_null(&id_table->uuid)) {
3133 /*
@@ -123,7 +125,7 @@ int ffa_driver_register(struct ffa_driver *driver, struct module *owner, · 91 unmodified lines
123125 {
124126 int ret;
125127
126− if (!driver->probe)
128+ if (!driver->probe || !driver->id_table)
127129 return -EINVAL;
128130
129131 driver->driver.bus = &ffa_bus_type;
drivers/firmware/arm_ffa/driver.c+101−43
@@ -87,6 +87,7 @@ static inline int ffa_to_linux_errno(int errno) · 86 unmodified lines
8787
8888 struct ffa_pcpu_irq {
8989 struct ffa_drv_info *info;
90+ struct work_struct notif_pcpu_work;
9091 };
9192
9293 struct ffa_drv_info {
@@ -100,13 +101,13 @@ struct ffa_drv_info { · 7 unmodified lines
100101 bool mem_ops_native;
101102 bool msg_direct_req2_supp;
102103 bool bitmap_created;
104+ bool bus_notifier_registered;
103105 bool notif_enabled;
104106 unsigned int sched_recv_irq;
105107 unsigned int notif_pend_irq;
106108 unsigned int cpuhp_state;
107109 struct ffa_pcpu_irq __percpu *irq_pcpu;
108110 struct workqueue_struct *notif_pcpu_wq;
109− struct work_struct notif_pcpu_work;
110111 struct work_struct sched_recv_irq_work;
111112 struct xarray partition_info;
112113 DECLARE_HASHTABLE(notifier_hash, ilog2(FFA_MAX_NOTIFICATIONS));
@@ -322,6 +323,12 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, · 209 unmodified lines
322323 #define PART_INFO_ID_MASK GENMASK(15, 0)
323324 #define PART_INFO_EXEC_CXT_MASK GENMASK(31, 16)
324325 #define PART_INFO_PROPS_MASK GENMASK(63, 32)
326+#define FFA_PART_INFO_GET_REGS_FIRST_REG 3
327+#define FFA_PART_INFO_GET_REGS_REGS_PER_DESC 3
328+#define FFA_PART_INFO_GET_REGS_MAX_DESC \
329+ (((sizeof(ffa_value_t) / sizeof_field(ffa_value_t, a0)) - \
330+ FFA_PART_INFO_GET_REGS_FIRST_REG) / \
331+ FFA_PART_INFO_GET_REGS_REGS_PER_DESC)
325332 #define PART_INFO_ID(x) ((u16)(FIELD_GET(PART_INFO_ID_MASK, (x))))
326333 #define PART_INFO_EXEC_CXT(x) ((u16)(FIELD_GET(PART_INFO_EXEC_CXT_MASK, (x))))
327334 #define PART_INFO_PROPERTIES(x) ((u32)(FIELD_GET(PART_INFO_PROPS_MASK, (x))))
@@ -329,15 +336,13 @@ static int · 1 unmodified line
329336 __ffa_partition_info_get_regs(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3,
330337 struct ffa_partition_info *buffer, int num_parts)
331338 {
332− u16 buf_sz, start_idx, cur_idx, count = 0, prev_idx = 0, tag = 0;
339+ u16 buf_sz, start_idx = 0, cur_idx, count = 0, tag = 0;
333340 struct ffa_partition_info *buf = buffer;
334341 ffa_value_t partition_info;
335342
336343 do {
337344 __le64 *regs;
338− int idx;
339−
340− start_idx = prev_idx ? prev_idx + 1 : 0;
345+ int idx, nr_desc, buf_idx;
341346
342347 invoke_ffa_fn((ffa_value_t){
343348 .a0 = FFA_PARTITION_INFO_GET_REGS,
@@ -353,15 +358,28 @@ __ffa_partition_info_get_regs(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, · 9 unmodified lines
353358 count = PARTITION_COUNT(partition_info.a2);
354359 if (!buffer || !num_parts) /* count only */
355360 return count;
361+ if (count > num_parts)
362+ return -EINVAL;
356363
357364 cur_idx = CURRENT_INDEX(partition_info.a2);
365+ if (cur_idx < start_idx || cur_idx >= count)
366+ return -EINVAL;
367+
368+ nr_desc = cur_idx - start_idx + 1;
369+ if (nr_desc > FFA_PART_INFO_GET_REGS_MAX_DESC)
370+ return -EINVAL;
371+
372+ buf_idx = buf - buffer;
373+ if (buf_idx + nr_desc > num_parts)
374+ return -EINVAL;
375+
358376 tag = UUID_INFO_TAG(partition_info.a2);
359377 buf_sz = PARTITION_INFO_SZ(partition_info.a2);
360378 if (buf_sz > sizeof(*buffer))
361379 buf_sz = sizeof(*buffer);
362380
363381 regs = (void *)&partition_info.a3;
364− for (idx = 0; idx < cur_idx - start_idx + 1; idx++, buf++) {
382+ for (idx = 0; idx < nr_desc; idx++, buf++) {
365383 union {
366384 uuid_t uuid;
367385 u64 regs[2];
@@ -379,7 +397,7 @@ __ffa_partition_info_get_regs(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, · 11 unmodified lines
379397 uuid_copy(&buf->uuid, &uuid_regs.uuid);
380398 regs += 3;
381399 }
382− prev_idx = cur_idx;
400+ start_idx = cur_idx + 1;
383401
384402 } while (cur_idx < (count - 1));
385403
@@ -1189,7 +1207,7 @@ static int · 803 unmodified lines
11891207 ffa_sched_recv_cb_update(struct ffa_device *dev, ffa_sched_recv_cb callback,
11901208 void *cb_data, bool is_registration)
11911209 {
1192− struct ffa_dev_part_info *partition = NULL, *tmp;
1210+ struct ffa_dev_part_info *partition = NULL;
11931211 struct list_head *phead;
11941212 bool cb_valid;
11951213
@@ -1202,11 +1220,11 @@ ffa_sched_recv_cb_update(struct ffa_device *dev, ffa_sched_recv_cb callback, · 6 unmodified lines
12021220 return -EINVAL;
12031221 }
12041222
1205− list_for_each_entry_safe(partition, tmp, phead, node)
1223+ list_for_each_entry(partition, phead, node)
12061224 if (partition->dev == dev)
12071225 break;
12081226
1209− if (!partition) {
1227+ if (&partition->node == phead) {
12101228 pr_err("%s: No such partition ID 0x%x\n", __func__, dev->vm_id);
12111229 return -EINVAL;
12121230 }
@@ -1445,20 +1463,25 @@ static int ffa_notify_send(struct ffa_device *dev, int notify_id, · 232 unmodified lines
14451463
14461464 static void handle_notif_callbacks(u64 bitmap, enum notify_type type)
14471465 {
1466+ ffa_notifier_cb cb;
1467+ void *cb_data;
14481468 int notify_id;
1449− struct notifier_cb_info *cb_info = NULL;
14501469
14511470 for (notify_id = 0; notify_id <= FFA_MAX_NOTIFICATIONS && bitmap;
14521471 notify_id++, bitmap >>= 1) {
14531472 if (!(bitmap & 1))
14541473 continue;
14551474
1456− read_lock(&drv_info->notify_lock);
1457− cb_info = notifier_hnode_get_by_type(notify_id, type);
1458− read_unlock(&drv_info->notify_lock);
1475+ scoped_guard(read_lock, &drv_info->notify_lock) {
1476+ struct notifier_cb_info *cb_info;
14591477
1460− if (cb_info && cb_info->cb)
1461− cb_info->cb(notify_id, cb_info->cb_data);
1478+ cb_info = notifier_hnode_get_by_type(notify_id, type);
1479+ cb = cb_info ? cb_info->cb : NULL;
1480+ cb_data = cb_info ? cb_info->cb_data : NULL;
1481+ }
1482+
1483+ if (cb)
1484+ cb(notify_id, cb_data);
14621485 }
14631486 }
14641487
@@ -1466,39 +1489,56 @@ static void handle_fwk_notif_callbacks(u32 bitmap) · 1 unmodified line
14661489 {
14671490 void *buf;
14681491 uuid_t uuid;
1492+ void *fwk_cb_data;
14691493 int notify_id = 0, target;
1494+ ffa_fwk_notifier_cb fwk_cb;
14701495 struct ffa_indirect_msg_hdr *msg;
1471− struct notifier_cb_info *cb_info = NULL;
1496+ size_t min_offset = offsetof(struct ffa_indirect_msg_hdr, uuid);
14721497
14731498 /* Only one framework notification defined and supported for now */
14741499 if (!(bitmap & FRAMEWORK_NOTIFY_RX_BUFFER_FULL))
14751500 return;
14761501
1477− mutex_lock(&drv_info->rx_lock);
1502+ scoped_guard(mutex, &drv_info->rx_lock) {
1503+ u32 offset, size;
14781504
1479− msg = drv_info->rx_buffer;
1480− buf = kmemdup((void *)msg + msg->offset, msg->size, GFP_KERNEL);
1481− if (!buf) {
1482− mutex_unlock(&drv_info->rx_lock);
1483− return;
1484− }
1505+ msg = drv_info->rx_buffer;
1506+ offset = msg->offset;
1507+ size = msg->size;
14851508
1486− target = SENDER_ID(msg->send_recv_id);
1487− if (msg->offset >= sizeof(*msg))
1488− uuid_copy(&uuid, &msg->uuid);
1489− else
1490− uuid_copy(&uuid, &uuid_null);
1509+ if (!size || (offset != min_offset && offset < sizeof(*msg)) ||
1510+ offset > drv_info->rxtx_bufsz ||
1511+ size > drv_info->rxtx_bufsz - offset) {
1512+ pr_err("invalid framework notification message\n");
1513+ ffa_rx_release();
1514+ return;
1515+ }
14911516
1492− mutex_unlock(&drv_info->rx_lock);
1517+ buf = kmemdup((void *)msg + offset, size, GFP_KERNEL);
1518+ if (!buf) {
1519+ ffa_rx_release();
1520+ return;
1521+ }
1522+
1523+ target = SENDER_ID(msg->send_recv_id);
1524+ if (offset >= sizeof(*msg))
1525+ uuid_copy(&uuid, &msg->uuid);
1526+ else
1527+ uuid_copy(&uuid, &uuid_null);
1528+ ffa_rx_release();
1529+ }
14931530
1494− ffa_rx_release();
1531+ scoped_guard(read_lock, &drv_info->notify_lock) {
1532+ struct notifier_cb_info *cb_info;
14951533
1496− read_lock(&drv_info->notify_lock);
1497− cb_info = notifier_hnode_get_by_vmid_uuid(notify_id, target, &uuid);
1498− read_unlock(&drv_info->notify_lock);
1534+ cb_info = notifier_hnode_get_by_vmid_uuid(notify_id, target,
1535+ &uuid);
1536+ fwk_cb = cb_info ? cb_info->fwk_cb : NULL;
1537+ fwk_cb_data = cb_info ? cb_info->cb_data : NULL;
1538+ }
14991539
1500− if (cb_info && cb_info->fwk_cb)
1501− cb_info->fwk_cb(notify_id, cb_info->cb_data, buf);
1540+ if (fwk_cb)
1541+ fwk_cb(notify_id, fwk_cb_data, buf);
15021542 kfree(buf);
15031543 }
15041544
@@ -1539,10 +1579,11 @@ ffa_self_notif_handle(u16 vcpu, bool is_per_vcpu, void *cb_data) · 34 unmodified lines
15391579
15401580 static void notif_pcpu_irq_work_fn(struct work_struct *work)
15411581 {
1542− struct ffa_drv_info *info = container_of(work, struct ffa_drv_info,
1582+ struct ffa_pcpu_irq *pcpu = container_of(work, struct ffa_pcpu_irq,
15431583 notif_pcpu_work);
1584+ struct ffa_drv_info *info = pcpu->info;
15441585
1545− ffa_self_notif_handle(smp_processor_id(), true, info);
1586+ notif_get_and_handle(info);
15461587 }
15471588
15481589 static const struct ffa_info_ops ffa_drv_info_ops = {
@@ -1629,6 +1670,15 @@ static struct notifier_block ffa_bus_nb = { · 80 unmodified lines
16291670 .notifier_call = ffa_bus_notifier,
16301671 };
16311672
1673+static void ffa_bus_notifier_unregister(void)
1674+{
1675+ if (!drv_info->bus_notifier_registered)
1676+ return;
1677+
1678+ bus_unregister_notifier(&ffa_bus_type, &ffa_bus_nb);
1679+ drv_info->bus_notifier_registered = false;
1680+}
1681+
16321682 static int ffa_xa_add_partition_info(struct ffa_device *dev)
16331683 {
16341684 struct ffa_dev_part_info *info;
@@ -1712,6 +1762,8 @@ static void ffa_partitions_cleanup(void) · 77 unmodified lines
17121762 struct list_head *phead;
17131763 unsigned long idx;
17141764
1765+ ffa_bus_notifier_unregister();
1766+
17151767 /* Clean up/free all registered devices */
17161768 ffa_devices_unregister();
17171769
@@ -1739,11 +1791,14 @@ static int ffa_setup_partitions(void) · 21 unmodified lines
17391791 ret = bus_register_notifier(&ffa_bus_type, &ffa_bus_nb);
17401792 if (ret)
17411793 pr_err("Failed to register FF-A bus notifiers\n");
1794+ else
1795+ drv_info->bus_notifier_registered = true;
17421796 }
17431797
17441798 count = ffa_partition_probe(&uuid_null, &pbuf);
17451799 if (count <= 0) {
17461800 pr_info("%s: No partitions found, error %d\n", __func__, count);
1801+ ffa_bus_notifier_unregister();
17471802 return -EINVAL;
17481803 }
17491804
@@ -1811,7 +1866,7 @@ static irqreturn_t notif_pend_irq_handler(int irq, void *irq_data) · 61 unmodified lines
18111866 struct ffa_drv_info *info = pcpu->info;
18121867
18131868 queue_work_on(smp_processor_id(), info->notif_pcpu_wq,
1814− &info->notif_pcpu_work);
1869+ &pcpu->notif_pcpu_work);
18151870
18161871 return IRQ_HANDLED;
18171872 }
@@ -1928,8 +1983,11 @@ static int ffa_init_pcpu_irq(void) · 110 unmodified lines
19281983 if (!irq_pcpu)
19291984 return -ENOMEM;
19301985
1931− for_each_present_cpu(cpu)
1986+ for_each_present_cpu(cpu) {
19321987 per_cpu_ptr(irq_pcpu, cpu)->info = drv_info;
1988+ INIT_WORK(&per_cpu_ptr(irq_pcpu, cpu)->notif_pcpu_work,
1989+ notif_pcpu_irq_work_fn);
1990+ }
19331991
19341992 drv_info->irq_pcpu = irq_pcpu;
19351993
@@ -1958,7 +2016,6 @@ static int ffa_init_pcpu_irq(void) · 22 unmodified lines
19582016 }
19592017
19602018 INIT_WORK(&drv_info->sched_recv_irq_work, ffa_sched_recv_irq_work_fn);
1961− INIT_WORK(&drv_info->notif_pcpu_work, notif_pcpu_irq_work_fn);
19622019 drv_info->notif_pcpu_wq = create_workqueue("ffa_pcpu_irq_notification");
19632020 if (!drv_info->notif_pcpu_wq)
19642021 return -EINVAL;
@@ -2063,11 +2120,12 @@ static int __init ffa_init(void) · 98 unmodified lines
20632120 rxtx_bufsz = SZ_4K;
20642121 }
20652122
2123+ rxtx_bufsz = PAGE_ALIGN(rxtx_bufsz);
20662124 drv_info->rxtx_bufsz = rxtx_bufsz;
20672125 drv_info->rx_buffer = alloc_pages_exact(rxtx_bufsz, GFP_KERNEL);
20682126 if (!drv_info->rx_buffer) {
20692127 ret = -ENOMEM;
2070− goto free_pages;
2128+ goto free_drv_info;
20712129 }
20722130
20732131 drv_info->tx_buffer = alloc_pages_exact(rxtx_bufsz, GFP_KERNEL);
@@ -2078,7 +2136,7 @@ static int __init ffa_init(void) · 4 unmodified lines
20782136
20792137 ret = ffa_rxtx_map(virt_to_phys(drv_info->tx_buffer),
20802138 virt_to_phys(drv_info->rx_buffer),
2081− PAGE_ALIGN(rxtx_bufsz) / FFA_PAGE_SIZE);
2139+ rxtx_bufsz / FFA_PAGE_SIZE);
20822140 if (ret) {
20832141 pr_err("failed to register FFA RxTx buffers\n");
20842142 goto free_pages;
drivers/firmware/efi/efi-pstore.c+3−1
@@ -60,8 +60,10 @@ static int efi_pstore_open(struct pstore_info *psi) · 59 unmodified lines
6060 return err;
6161
6262 psi->data = kzalloc(record_size, GFP_KERNEL);
63− if (!psi->data)
63+ if (!psi->data) {
64+ efivar_unlock();
6465 return -ENOMEM;
66+ }
6567
6668 return 0;
6769 }
drivers/firmware/efi/efi.c+16−12
@@ -402,21 +402,11 @@ static void __init efi_debugfs_init(void) · 401 unmodified lines
402402 static inline void efi_debugfs_init(void) {}
403403 #endif
404404
405−/*
406− * We register the efi subsystem with the firmware subsystem and the
407− * efivars subsystem with the efi subsystem, if the system was booted with
408− * EFI.
409− */
410−static int __init efisubsys_init(void)
405+static int __init efipostcore_init(void)
411406 {
412− int error;
413−
414407 if (!efi_enabled(EFI_RUNTIME_SERVICES))
415408 efi.runtime_supported_mask = 0;
416409
417− if (!efi_enabled(EFI_BOOT))
418− return 0;
419−
420410 if (efi.runtime_supported_mask) {
421411 /*
422412 * Since we process only one efi_runtime_service() at a time, an
@@ -428,9 +418,23 @@ static int __init efisubsys_init(void) · 5 unmodified lines
428418 pr_err("Creating efi_rts_wq failed, EFI runtime services disabled.\n");
429419 clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
430420 efi.runtime_supported_mask = 0;
431− return 0;
432421 }
433422 }
423+ return 0;
424+}
425+postcore_initcall(efipostcore_init);
426+
427+/*
428+ * We register the efi subsystem with the firmware subsystem and the
429+ * efivars subsystem with the efi subsystem, if the system was booted with
430+ * EFI.
431+ */
432+static int __init efisubsys_init(void)
433+{
434+ int error;
435+
436+ if (!efi_enabled(EFI_BOOT))
437+ return 0;
434438
435439 if (efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES))
436440 platform_device_register_simple("rtc-efi", 0, NULL, 0);
drivers/firmware/efi/libstub/Makefile+1−1
@@ -66,7 +66,7 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ · 65 unmodified lines
6666 lib-y := efi-stub-helper.o gop.o secureboot.o tpm.o \
6767 file.o mem.o random.o randomalloc.o pci.o \
6868 skip_spaces.o lib-cmdline.o lib-ctype.o \
69− alignedmem.o relocate.o printk.o vsprintf.o
69+ alignedmem.o printk.o vsprintf.o
7070
7171 # include the stub's libfdt dependencies from lib/ when needed
7272 libfdt-deps := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c \
drivers/firmware/efi/libstub/efi-stub-helper.c+4−0
@@ -79,6 +79,10 @@ efi_status_t efi_parse_options(char const *cmdline) · 78 unmodified lines
7979 efi_noinitrd = true;
8080 } else if (IS_ENABLED(CONFIG_X86_64) && !strcmp(param, "no5lvl")) {
8181 efi_no5lvl = true;
82+ } else if (IS_ENABLED(CONFIG_LOONGARCH) &&
83+ IS_ENABLED(CONFIG_HIBERNATION) &&
84+ !strcmp(param, "resume") && val) {
85+ efi_nokaslr = true; /* LoongArch can't KASLR for hibernation */
8286 } else if (IS_ENABLED(CONFIG_ARCH_HAS_MEM_ENCRYPT) &&
8387 !strcmp(param, "mem_encrypt") && val) {
8488 if (parse_option_str(val, "on"))
drivers/firmware/efi/libstub/efistub.h+0−7
@@ -1104,13 +1104,6 @@ efi_status_t efi_allocate_pages_aligned(unsigned long size, unsigned long *addr, · 1103 unmodified lines
11041104 efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align,
11051105 unsigned long *addr, unsigned long min);
11061106
1107−efi_status_t efi_relocate_kernel(unsigned long *image_addr,
1108− unsigned long image_size,
1109− unsigned long alloc_size,
1110− unsigned long preferred_addr,
1111− unsigned long alignment,
1112− unsigned long min_addr);
1113−
11141107 efi_status_t efi_parse_options(char const *cmdline);
11151108
11161109 void efi_parse_option_graphics(char *option);
drivers/firmware/efi/libstub/loongarch-stub.c+80−0
@@ -14,6 +14,86 @@ extern int kernel_asize; · 13 unmodified lines
1414 extern int kernel_fsize;
1515 extern int kernel_entry;
1616
17+/**
18+ * efi_relocate_kernel() - copy memory area
19+ * @image_addr: pointer to address of memory area to copy
20+ * @image_size: size of memory area to copy
21+ * @alloc_size: minimum size of memory to allocate, must be greater or
22+ * equal to image_size
23+ * @preferred_addr: preferred target address
24+ * @alignment: minimum alignment of the allocated memory area. It
25+ * should be a power of two.
26+ * @min_addr: minimum target address
27+ *
28+ * Copy a memory area to a newly allocated memory area aligned according
29+ * to @alignment but at least EFI_ALLOC_ALIGN. If the preferred address
30+ * is not available, the allocated address will not be below @min_addr.
31+ * On exit, @image_addr is updated to the target copy address that was used.
32+ *
33+ * This function is used to copy the Linux kernel verbatim. It does not apply
34+ * any relocation changes.
35+ *
36+ * Return: status code
37+ */
38+static
39+efi_status_t efi_relocate_kernel(unsigned long *image_addr,
40+ unsigned long image_size,
41+ unsigned long alloc_size,
42+ unsigned long preferred_addr,
43+ unsigned long alignment,
44+ unsigned long min_addr)
45+{
46+ unsigned long cur_image_addr;
47+ unsigned long new_addr = 0;
48+ efi_status_t status;
49+ unsigned long nr_pages;
50+ efi_physical_addr_t efi_addr = preferred_addr;
51+
52+ if (!image_addr || !image_size || !alloc_size)
53+ return EFI_INVALID_PARAMETER;
54+ if (alloc_size < image_size)
55+ return EFI_INVALID_PARAMETER;
56+
57+ cur_image_addr = *image_addr;
58+
59+ /*
60+ * The EFI firmware loader could have placed the kernel image
61+ * anywhere in memory, but the kernel has restrictions on the
62+ * max physical address it can run at. Some architectures
63+ * also have a preferred address, so first try to relocate
64+ * to the preferred address. If that fails, allocate as low
65+ * as possible while respecting the required alignment.
66+ */
67+ nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE;
68+ status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
69+ EFI_LOADER_DATA, nr_pages, &efi_addr);
70+ new_addr = efi_addr;
71+ /*
72+ * If preferred address allocation failed allocate as low as
73+ * possible.
74+ */
75+ if (status != EFI_SUCCESS) {
76+ status = efi_low_alloc_above(alloc_size, alignment, &new_addr,
77+ min_addr);
78+ }
79+ if (status != EFI_SUCCESS) {
80+ efi_err("Failed to allocate usable memory for kernel.\n");
81+ return status;
82+ }
83+
84+ /*
85+ * We know source/dest won't overlap since both memory ranges
86+ * have been allocated by UEFI, so we can safely use memcpy.
87+ */
88+ memcpy((void *)new_addr, (void *)cur_image_addr, image_size);
89+ efi_cache_sync_image(new_addr, image_size);
90+
91+ /* Return the new address of the relocated image. */
92+ *image_addr = new_addr;
93+
94+ return status;
95+}
96+
1797 efi_status_t handle_kernel_image(unsigned long *image_addr,
1898 unsigned long *image_size,
1999 unsigned long *reserve_addr,
drivers/firmware/efi/libstub/loongarch.c+21−0
@@ -18,6 +18,27 @@ efi_status_t check_platform_features(void) · 17 unmodified lines
1818 return EFI_SUCCESS;
1919 }
2020
21+void efi_cache_sync_image(unsigned long image_base, unsigned long alloc_size)
22+{
23+ asm volatile ("ibar 0" ::: "memory");
24+}
25+
26+unsigned long efi_get_kimg_kaslr_address(void)
27+{
28+ unsigned int random_offset = 0;
29+
30+#ifdef CONFIG_RANDOMIZE_BASE
31+ if (!efi_nokaslr) {
32+ efi_get_random_bytes(sizeof(random_offset), (u8 *)&random_offset);
33+ random_offset ^= (random_get_entropy() << 16);
34+ random_offset &= (CONFIG_RANDOMIZE_BASE_MAX_OFFSET - 1);
35+ random_offset = ALIGN(random_offset + SZ_64K, SZ_64K);
36+ }
37+#endif
38+
39+ return PHYSADDR(VMLINUX_LOAD_ADDRESS) + random_offset;
40+}
41+
2142 struct exit_boot_struct {
2243 efi_memory_desc_t *runtime_map;
2344 int runtime_entry_count;
drivers/firmware/efi/libstub/mem.c+82−0
@@ -124,3 +124,85 @@ void efi_free(unsigned long size, unsigned long addr) · 123 unmodified lines
124124 nr_pages = round_up(size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE;
125125 efi_bs_call(free_pages, addr, nr_pages);
126126 }
127+
128+/**
129+ * efi_low_alloc_above() - allocate pages at or above given address
130+ * @size: size of the memory area to allocate
131+ * @align: minimum alignment of the allocated memory area. It should
132+ * a power of two.
133+ * @addr: on exit the address of the allocated memory
134+ * @min: minimum address to used for the memory allocation
135+ *
136+ * Allocate at the lowest possible address that is not below @min as
137+ * EFI_LOADER_DATA. The allocated pages are aligned according to @align but at
138+ * least EFI_ALLOC_ALIGN. The first allocated page will not below the address
139+ * given by @min.
140+ *
141+ * Return: status code
142+ */
143+efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align,
144+ unsigned long *addr, unsigned long min)
145+{
146+ struct efi_boot_memmap *map __free(efi_pool) = NULL;
147+ efi_status_t status;
148+ unsigned long nr_pages;
149+ int i;
150+
151+ status = efi_get_memory_map(&map, false);
152+ if (status != EFI_SUCCESS)
153+ return status;
154+
155+ /*
156+ * Enforce minimum alignment that EFI or Linux requires when
157+ * requesting a specific address. We are doing page-based (or
158+ * larger) allocations, and both the address and size must meet
159+ * alignment constraints.
160+ */
161+ if (align < EFI_ALLOC_ALIGN)
162+ align = EFI_ALLOC_ALIGN;
163+
164+ size = round_up(size, EFI_ALLOC_ALIGN);
165+ nr_pages = size / EFI_PAGE_SIZE;
166+ for (i = 0; i < map->map_size / map->desc_size; i++) {
167+ efi_memory_desc_t *desc;
168+ unsigned long m = (unsigned long)map->map;
169+ u64 start, end;
170+
171+ desc = efi_memdesc_ptr(m, map->desc_size, i);
172+
173+ if (desc->type != EFI_CONVENTIONAL_MEMORY)
174+ continue;
175+
176+ if (desc->attribute & EFI_MEMORY_HOT_PLUGGABLE)
177+ continue;
178+
179+ if (efi_soft_reserve_enabled() &&
180+ (desc->attribute & EFI_MEMORY_SP))
181+ continue;
182+
183+ if (desc->num_pages < nr_pages)
184+ continue;
185+
186+ start = desc->phys_addr;
187+ end = start + desc->num_pages * EFI_PAGE_SIZE;
188+
189+ if (start < min)
190+ start = min;
191+
192+ start = round_up(start, align);
193+ if ((start + size) > end)
194+ continue;
195+
196+ status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
197+ EFI_LOADER_DATA, nr_pages, &start);
198+ if (status == EFI_SUCCESS) {
199+ *addr = start;
200+ break;
201+ }
202+ }
203+
204+ if (i == map->map_size / map->desc_size)
205+ return EFI_NOT_FOUND;
206+
207+ return EFI_SUCCESS;
208+}
drivers/firmware/efi/libstub/relocate.c+0−166
@@ -1,166 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−
3−#include <linux/efi.h>
4−#include <asm/efi.h>
5−
6−#include "efistub.h"
7−
8−/**
9− * efi_low_alloc_above() - allocate pages at or above given address
10− * @size: size of the memory area to allocate
11− * @align: minimum alignment of the allocated memory area. It should
12− * a power of two.
13− * @addr: on exit the address of the allocated memory
14− * @min: minimum address to used for the memory allocation
15− *
16− * Allocate at the lowest possible address that is not below @min as
17− * EFI_LOADER_DATA. The allocated pages are aligned according to @align but at
18− * least EFI_ALLOC_ALIGN. The first allocated page will not below the address
19− * given by @min.
20− *
21− * Return: status code
22− */
23−efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align,
24− unsigned long *addr, unsigned long min)
25−{
26− struct efi_boot_memmap *map __free(efi_pool) = NULL;
27− efi_status_t status;
28− unsigned long nr_pages;
29− int i;
30−
31− status = efi_get_memory_map(&map, false);
32− if (status != EFI_SUCCESS)
33− return status;
34−
35− /*
36− * Enforce minimum alignment that EFI or Linux requires when
37− * requesting a specific address. We are doing page-based (or
38− * larger) allocations, and both the address and size must meet
39− * alignment constraints.
40− */
41− if (align < EFI_ALLOC_ALIGN)
42− align = EFI_ALLOC_ALIGN;
43−
44− size = round_up(size, EFI_ALLOC_ALIGN);
45− nr_pages = size / EFI_PAGE_SIZE;
46− for (i = 0; i < map->map_size / map->desc_size; i++) {
47− efi_memory_desc_t *desc;
48− unsigned long m = (unsigned long)map->map;
49− u64 start, end;
50−
51− desc = efi_memdesc_ptr(m, map->desc_size, i);
52−
53− if (desc->type != EFI_CONVENTIONAL_MEMORY)
54− continue;
55−
56− if (desc->attribute & EFI_MEMORY_HOT_PLUGGABLE)
57− continue;
58−
59− if (efi_soft_reserve_enabled() &&
60− (desc->attribute & EFI_MEMORY_SP))
61− continue;
62−
63− if (desc->num_pages < nr_pages)
64− continue;
65−
66− start = desc->phys_addr;
67− end = start + desc->num_pages * EFI_PAGE_SIZE;
68−
69− if (start < min)
70− start = min;
71−
72− start = round_up(start, align);
73− if ((start + size) > end)
74− continue;
75−
76− status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
77− EFI_LOADER_DATA, nr_pages, &start);
78− if (status == EFI_SUCCESS) {
79− *addr = start;
80− break;
81− }
82− }
83−
84− if (i == map->map_size / map->desc_size)
85− return EFI_NOT_FOUND;
86−
87− return EFI_SUCCESS;
88−}
89−
90−/**
91− * efi_relocate_kernel() - copy memory area
92− * @image_addr: pointer to address of memory area to copy
93− * @image_size: size of memory area to copy
94− * @alloc_size: minimum size of memory to allocate, must be greater or
95− * equal to image_size
96− * @preferred_addr: preferred target address
97− * @alignment: minimum alignment of the allocated memory area. It
98− * should be a power of two.
99− * @min_addr: minimum target address
100− *
101− * Copy a memory area to a newly allocated memory area aligned according
102− * to @alignment but at least EFI_ALLOC_ALIGN. If the preferred address
103− * is not available, the allocated address will not be below @min_addr.
104− * On exit, @image_addr is updated to the target copy address that was used.
105− *
106− * This function is used to copy the Linux kernel verbatim. It does not apply
107− * any relocation changes.
108− *
109− * Return: status code
110− */
111−efi_status_t efi_relocate_kernel(unsigned long *image_addr,
112− unsigned long image_size,
113− unsigned long alloc_size,
114− unsigned long preferred_addr,
115− unsigned long alignment,
116− unsigned long min_addr)
117−{
118− unsigned long cur_image_addr;
119− unsigned long new_addr = 0;
120− efi_status_t status;
121− unsigned long nr_pages;
122− efi_physical_addr_t efi_addr = preferred_addr;
123−
124− if (!image_addr || !image_size || !alloc_size)
125− return EFI_INVALID_PARAMETER;
126− if (alloc_size < image_size)
127− return EFI_INVALID_PARAMETER;
128−
129− cur_image_addr = *image_addr;
130−
131− /*
132− * The EFI firmware loader could have placed the kernel image
133− * anywhere in memory, but the kernel has restrictions on the
134− * max physical address it can run at. Some architectures
135− * also have a preferred address, so first try to relocate
136− * to the preferred address. If that fails, allocate as low
137− * as possible while respecting the required alignment.
138− */
139− nr_pages = round_up(alloc_size, EFI_ALLOC_ALIGN) / EFI_PAGE_SIZE;
140− status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
141− EFI_LOADER_DATA, nr_pages, &efi_addr);
142− new_addr = efi_addr;
143− /*
144− * If preferred address allocation failed allocate as low as
145− * possible.
146− */
147− if (status != EFI_SUCCESS) {
148− status = efi_low_alloc_above(alloc_size, alignment, &new_addr,
149− min_addr);
150− }
151− if (status != EFI_SUCCESS) {
152− efi_err("Failed to allocate usable memory for kernel.\n");
153− return status;
154− }
155−
156− /*
157− * We know source/dest won't overlap since both memory ranges
158− * have been allocated by UEFI, so we can safely use memcpy.
159− */
160− memcpy((void *)new_addr, (void *)cur_image_addr, image_size);
161−
162− /* Return the new address of the relocated image. */
163− *image_addr = new_addr;
164−
165− return status;
166−}
drivers/firmware/efi/sysfb_efi.c+6−3
@@ -311,11 +311,14 @@ static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { · 310 unmodified lines
311311 .callback = efifb_swap_width_height,
312312 },
313313 {
314− /* Lenovo IdeaPad Duet 3 10IGL5 with 1200x1920 portrait screen */
314+ /*
315+ * Lenovo IdeaPad Duet 3 10IGL5 and 10IGL5-LTE with
316+ * 1200x1920 portrait screen
317+ */
315318 .matches = {
316319 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
317− DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
318− "IdeaPad Duet 3 10IGL5"),
320+ /* Non exact match to also match the LTE version */
321+ DMI_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"),
319322 },
320323 .callback = efifb_swap_width_height,
321324 },
drivers/firmware/psci/psci.c+10−0
@@ -539,12 +539,22 @@ static int psci_system_suspend(unsigned long unused) · 538 unmodified lines
539539
540540 static int psci_system_suspend_enter(suspend_state_t state)
541541 {
542+ pm_set_resume_via_firmware();
543+
542544 return cpu_suspend(0, psci_system_suspend);
543545 }
544546
547+static int psci_system_suspend_begin(suspend_state_t state)
548+{
549+ pm_set_suspend_via_firmware();
550+
551+ return 0;
552+}
553+
545554 static const struct platform_suspend_ops psci_suspend_ops = {
546555 .valid = suspend_valid_only_mem,
547556 .enter = psci_system_suspend_enter,
557+ .begin = psci_system_suspend_begin,
548558 };
549559
550560 static void __init psci_init_system_reset2(void)
drivers/fwctl/pds/main.c+3−0
@@ -362,6 +362,9 @@ static void *pdsfc_fw_rpc(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope, · 361 unmodified lines
362362 void *out = NULL;
363363 int err;
364364
365+ if (in_len < sizeof(*rpc))
366+ return ERR_PTR(-EINVAL);
367+
365368 err = pdsfc_validate_rpc(pdsfc, rpc, scope);
366369 if (err)
367370 return ERR_PTR(err);
drivers/gpio/gpio-adnp.c+3−1
@@ -237,7 +237,9 @@ static irqreturn_t adnp_irq(int irq, void *data) · 236 unmodified lines
237237 unsigned long pending;
238238 int err;
239239
240− scoped_guard(mutex, &adnp->i2c_lock) {
240+ {
241+ guard(mutex)(&adnp->i2c_lock);
242+
241243 err = adnp_read(adnp, GPIO_PLR(adnp) + i, &level);
242244 if (err < 0)
243245 continue;
drivers/gpio/gpio-aggregator.c+11−4
@@ -968,9 +968,12 @@ static int gpio_aggregator_activate(struct gpio_aggregator *aggr) · 967 unmodified lines
968968 }
969969
970970 wait_for_device_probe();
971− if (!device_is_bound(&pdev->dev)) {
972− ret = -ENXIO;
973− goto err_unregister_pdev;
971+
972+ scoped_guard(device, &pdev->dev) {
973+ if (!device_is_bound(&pdev->dev)) {
974+ ret = -ENXIO;
975+ goto err_unregister_pdev;
976+ }
974977 }
975978
976979 aggr->pdev = pdev;
@@ -979,8 +982,8 @@ static int gpio_aggregator_activate(struct gpio_aggregator *aggr) · 2 unmodified lines
979982 err_unregister_pdev:
980983 platform_device_unregister(pdev);
981984 err_remove_lookup_table:
982− kfree(aggr->lookups->dev_id);
983985 gpiod_remove_lookup_table(aggr->lookups);
986+ kfree(aggr->lookups->dev_id);
984987 err_remove_swnode:
985988 fwnode_remove_software_node(swnode);
986989 err_remove_lookups:
@@ -991,11 +994,15 @@ err_remove_lookups: · 4 unmodified lines
991994
992995 static void gpio_aggregator_deactivate(struct gpio_aggregator *aggr)
993996 {
997+ struct fwnode_handle *swnode;
998+
999+ swnode = dev_fwnode(&aggr->pdev->dev);
9941000 platform_device_unregister(aggr->pdev);
9951001 aggr->pdev = NULL;
9961002 gpiod_remove_lookup_table(aggr->lookups);
9971003 kfree(aggr->lookups->dev_id);
9981004 kfree(aggr->lookups);
1005+ fwnode_remove_software_node(swnode);
9991006 }
10001007
10011008 static void gpio_aggregator_lockup_configfs(struct gpio_aggregator *aggr,
drivers/gpio/gpio-mxc.c+1−1
@@ -469,7 +469,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) · 468 unmodified lines
469469 * the handler is needed only once, but doing it for every port
470470 * is more robust and easier.
471471 */
472− port->irq_high = -1;
472+ port->irq_high = 0;
473473 port->mx_irq_handler = mx2_gpio_irq_handler;
474474 } else
475475 port->mx_irq_handler = mx3_gpio_irq_handler;
drivers/gpio/gpio-pca953x.c+1−1
@@ -1411,7 +1411,7 @@ static int pca953x_resume(struct device *dev) · 1410 unmodified lines
14111411 ret = regulator_enable(chip->regulator);
14121412 if (ret) {
14131413 dev_err(dev, "Failed to enable regulator: %d\n", ret);
1414− return 0;
1414+ return ret;
14151415 }
14161416 }
14171417
drivers/gpio/gpio-rockchip.c+17−6
@@ -638,10 +638,17 @@ fail: · 637 unmodified lines
638638 return ret;
639639 }
640640
641+static void rockchip_clk_put(void *data)
642+{
643+ struct clk *clk = data;
644+
645+ clk_put(clk);
646+}
647+
641648 static int rockchip_get_bank_data(struct rockchip_pin_bank *bank)
642649 {
643650 struct resource res;
644− int id = 0;
651+ int id = 0, ret;
645652
646653 if (of_address_to_resource(bank->of_node, 0, &res)) {
647654 dev_err(bank->dev, "cannot find IO resource for bank\n");
@@ -656,11 +663,10 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank) · 8 unmodified lines
656663 if (!bank->irq)
657664 return -EINVAL;
658665
659− bank->clk = of_clk_get(bank->of_node, 0);
666+ bank->clk = devm_clk_get_enabled(bank->dev, NULL);
660667 if (IS_ERR(bank->clk))
661668 return PTR_ERR(bank->clk);
662669
663− clk_prepare_enable(bank->clk);
664670 id = readl(bank->reg_base + gpio_regs_v2.version_id);
665671
666672 switch (id) {
@@ -672,9 +678,13 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank) · 5 unmodified lines
672678 bank->db_clk = of_clk_get(bank->of_node, 1);
673679 if (IS_ERR(bank->db_clk)) {
674680 dev_err(bank->dev, "cannot find debounce clk\n");
675− clk_disable_unprepare(bank->clk);
676681 return -EINVAL;
677682 }
683+
684+ ret = devm_add_action_or_reset(bank->dev, rockchip_clk_put,
685+ bank->db_clk);
686+ if (ret)
687+ return ret;
678688 break;
679689 case GPIO_TYPE_V1:
680690 bank->gpio_regs = &gpio_regs_v1;
@@ -751,7 +761,6 @@ static int rockchip_gpio_probe(struct platform_device *pdev) · 70 unmodified lines
751761
752762 ret = rockchip_gpiolib_register(bank);
753763 if (ret) {
754− clk_disable_unprepare(bank->clk);
755764 mutex_unlock(&bank->deferred_lock);
756765 return ret;
757766 }
@@ -792,7 +801,9 @@ static void rockchip_gpio_remove(struct platform_device *pdev) · 34 unmodified lines
792801 {
793802 struct rockchip_pin_bank *bank = platform_get_drvdata(pdev);
794803
795− clk_disable_unprepare(bank->clk);
804+ irq_set_chained_handler_and_data(bank->irq, NULL, NULL);
805+ if (bank->domain)
806+ irq_domain_remove(bank->domain);
796807 gpiochip_remove(&bank->gpio_chip);
797808 }
798809
drivers/gpio/gpio-shared-proxy.c+9−0
@@ -103,9 +103,18 @@ static void gpio_shared_proxy_free(struct gpio_chip *gc, unsigned int offset) · 102 unmodified lines
103103 {
104104 struct gpio_shared_proxy_data *proxy = gpiochip_get_data(gc);
105105 struct gpio_shared_desc *shared_desc = proxy->shared_desc;
106+ int ret;
106107
107108 guard(gpio_shared_desc_lock)(shared_desc);
108109
110+ if (proxy->voted_high) {
111+ ret = gpio_shared_proxy_set_unlocked(proxy,
112+ shared_desc->can_sleep ? gpiod_set_value_cansleep : gpiod_set_value, 0);
113+ if (ret)
114+ dev_err(proxy->dev,
115+ "Failed to unset the shared GPIO value on release: %d\n", ret);
116+ }
117+
109118 proxy->shared_desc->usecnt--;
110119
111120 dev_dbg(proxy->dev, "Shared GPIO freed, number of users: %u\n",
drivers/gpio/gpio-sim.c+7−4
@@ -901,7 +901,7 @@ static int gpio_sim_device_activate(struct gpio_sim_device *dev) · 900 unmodified lines
901901 struct platform_device *pdev;
902902 struct fwnode_handle *swnode;
903903 struct gpio_sim_bank *bank;
904− int ret;
904+ int ret = 0;
905905
906906 lockdep_assert_held(&dev->lock);
907907
@@ -945,9 +945,12 @@ static int gpio_sim_device_activate(struct gpio_sim_device *dev) · 37 unmodified lines
945945 }
946946
947947 wait_for_device_probe();
948− if (!device_is_bound(&pdev->dev)) {
949− ret = -ENXIO;
950− goto err_unregister_pdev;
948+
949+ scoped_guard(device, &pdev->dev) {
950+ if (!device_is_bound(&pdev->dev)) {
951+ ret = -ENXIO;
952+ goto err_unregister_pdev;
953+ }
951954 }
952955
953956 dev->pdev = pdev;
drivers/gpio/gpio-virtuser.c+8−5
@@ -397,7 +397,7 @@ static ssize_t gpio_virtuser_direction_do_write(struct file *file, · 396 unmodified lines
397397 char buf[32], *trimmed;
398398 int ret, dir, val = 0;
399399
400− if (count >= sizeof(buf))
400+ if (*ppos != 0 || count >= sizeof(buf))
401401 return -EINVAL;
402402
403403 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
@@ -622,7 +622,7 @@ static ssize_t gpio_virtuser_consumer_write(struct file *file, · 218 unmodified lines
622622 char buf[GPIO_VIRTUSER_NAME_BUF_LEN + 2];
623623 int ret;
624624
625− if (count >= sizeof(buf))
625+ if (*ppos != 0 || count >= sizeof(buf))
626626 return -EINVAL;
627627
628628 ret = simple_write_to_buffer(buf, GPIO_VIRTUSER_NAME_BUF_LEN, ppos,
@@ -1477,9 +1477,12 @@ gpio_virtuser_device_activate(struct gpio_virtuser_device *dev) · 848 unmodified lines
14771477 }
14781478
14791479 wait_for_device_probe();
1480− if (!device_is_bound(&pdev->dev)) {
1481− ret = -ENXIO;
1482− goto err_unregister_pdev;
1480+
1481+ scoped_guard(device, &pdev->dev) {
1482+ if (!device_is_bound(&pdev->dev)) {
1483+ ret = -ENXIO;
1484+ goto err_unregister_pdev;
1485+ }
14831486 }
14841487
14851488 dev->pdev = pdev;
drivers/gpio/gpiolib-cdev.c+13−0
@@ -1184,6 +1184,7 @@ static int gpio_v2_line_flags_validate(u64 flags) · 1183 unmodified lines
11841184 static int gpio_v2_line_config_validate(struct gpio_v2_line_config *lc,
11851185 unsigned int num_lines)
11861186 {
1187+ size_t unused_attrs;
11871188 unsigned int i;
11881189 u64 flags;
11891190 int ret;
@@ -1191,9 +1192,21 @@ static int gpio_v2_line_config_validate(struct gpio_v2_line_config *lc, · 1 unmodified line
11911192 if (lc->num_attrs > GPIO_V2_LINE_NUM_ATTRS_MAX)
11921193 return -EINVAL;
11931194
1195+ unused_attrs = GPIO_V2_LINE_NUM_ATTRS_MAX - lc->num_attrs;
1196+
11941197 if (!mem_is_zero(lc->padding, sizeof(lc->padding)))
11951198 return -EINVAL;
11961199
1200+ for (i = 0; i < lc->num_attrs; i++) {
1201+ if (lc->attrs[i].attr.padding != 0)
1202+ return -EINVAL;
1203+ }
1204+
1205+ if (unused_attrs) {
1206+ if (!mem_is_zero(&lc->attrs[lc->num_attrs], unused_attrs * sizeof(*lc->attrs)))
1207+ return -EINVAL;
1208+ }
1209+
11971210 for (i = 0; i < num_lines; i++) {
11981211 flags = gpio_v2_line_config_flags(lc, i);
11991212 ret = gpio_v2_line_flags_validate(flags);
drivers/gpio/gpiolib-shared.c+3−6
@@ -53,7 +53,7 @@ struct gpio_shared_entry { · 52 unmodified lines
5353 unsigned int offset;
5454 /* Index in the property value array. */
5555 size_t index;
56− /* Synchronizes the modification of shared_desc. */
56+ /* Synchronizes the modification of shared_desc and offset. */
5757 struct mutex lock;
5858 struct gpio_shared_desc *shared_desc;
5959 struct kref ref;
@@ -598,16 +598,13 @@ void gpio_device_teardown_shared(struct gpio_device *gdev) · 538 unmodified lines
598598 struct gpio_shared_ref *ref;
599599
600600 list_for_each_entry(entry, &gpio_shared_list, list) {
601− guard(mutex)(&entry->lock);
602−
603601 if (!device_match_fwnode(&gdev->dev, entry->fwnode))
604602 continue;
605603
606− gpiod_free_commit(&gdev->descs[entry->offset]);
604+ scoped_guard(mutex, &entry->lock)
605+ gpiod_free_commit(&gdev->descs[entry->offset]);
607606
608607 list_for_each_entry(ref, &entry->refs, list) {
609− guard(mutex)(&ref->lock);
610−
611608 if (ref->lookup) {
612609 gpiod_remove_lookup_table(ref->lookup);
613610 kfree(ref->lookup->table[0].key);
drivers/gpu/drm/amd/amdgpu/amdgpu.h+0−1
@@ -1190,7 +1190,6 @@ struct amdgpu_device { · 1189 unmodified lines
11901190 bool apu_prefer_gtt;
11911191
11921192 bool userq_halt_for_enforce_isolation;
1193− struct work_struct userq_reset_work;
11941193 struct amdgpu_uid *uid_info;
11951194
11961195 struct amdgpu_uma_carveout_info uma_info;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c+25−0
@@ -36,6 +36,9 @@ · 35 unmodified lines
3636 #include "amdgpu_ras.h"
3737 #include "amdgpu_umc.h"
3838 #include "amdgpu_reset.h"
39+#if IS_ENABLED(CONFIG_HSA_AMD)
40+#include "kfd_priv.h"
41+#endif
3942
4043 /* Total memory size in system memory and all GPU VRAM. Used to
4144 * estimate worst case amount of memory to reserve for page tables
@@ -320,6 +323,28 @@ void amdgpu_amdkfd_gpu_reset(struct amdgpu_device *adev) · 278 unmodified lines
320323 (void)amdgpu_reset_domain_schedule(adev->reset_domain, &adev->kfd.reset_work);
321324 }
322325
326+void amdgpu_amdkfd_clear_kfd_mapping(struct amdgpu_device *adev)
327+{
328+#if IS_ENABLED(CONFIG_HSA_AMD)
329+ struct kfd_dev *kfd = adev->kfd.dev;
330+ unsigned int i;
331+
332+ if (!kfd)
333+ return;
334+
335+ for (i = 0; i < kfd->num_nodes; i++) {
336+ struct kfd_node *node = kfd->nodes[i];
337+
338+ kfd_dev_unmap_mapping_range(KFD_MMAP_TYPE_DOORBELL |
339+ KFD_MMAP_GPU_ID(node->id),
340+ kfd_doorbell_process_slice(kfd));
341+ kfd_dev_unmap_mapping_range(KFD_MMAP_TYPE_MMIO |
342+ KFD_MMAP_GPU_ID(node->id),
343+ PAGE_SIZE);
344+ }
345+#endif
346+}
347+
323348 int amdgpu_amdkfd_alloc_kernel_mem(struct amdgpu_device *adev, size_t size,
324349 u32 domain, void **mem_obj, uint64_t *gpu_addr,
325350 void **cpu_ptr, bool cp_mqd_gfx9)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h+1−0
@@ -358,6 +358,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, · 357 unmodified lines
358358 uint64_t size, u32 alloc_flag, int8_t xcp_id);
359359 void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
360360 uint64_t size, u32 alloc_flag, int8_t xcp_id);
361+void amdgpu_amdkfd_clear_kfd_mapping(struct amdgpu_device *adev);
361362
362363 u64 amdgpu_amdkfd_xcp_memory_size(struct amdgpu_device *adev, int xcp_id);
363364
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+12−3
@@ -2839,8 +2839,12 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev) · 2838 unmodified lines
28392839 * that checks whether the PSP is running. A solution for those issues
28402840 * in the APU is to trigger a GPU reset, but this should be done during
28412841 * the unload phase to avoid adding boot latency and screen flicker.
2842+ * GFX V11 has GC block as default off IP. Every time AMDGPU driver sends
2843+ * a request to PMFW to unload MP1, PMFW will put GC in reset and power down
2844+ * the voltage. Hence, skipping reset for APUs with GFX V11 or later.
28422845 */
2843− if ((adev->flags & AMD_IS_APU) && !adev->gmc.is_app_apu) {
2846+ if ((adev->flags & AMD_IS_APU) && !adev->gmc.is_app_apu &&
2847+ amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(11, 0, 0)) {
28442848 r = amdgpu_asic_reset(adev);
28452849 if (r)
28462850 dev_err(adev->dev, "asic reset on %s failed\n", __func__);
@@ -3783,7 +3787,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, · 936 unmodified lines
37833787 }
37843788
37853789 INIT_WORK(&adev->xgmi_reset_work, amdgpu_device_xgmi_reset_func);
3786− INIT_WORK(&adev->userq_reset_work, amdgpu_userq_reset_work);
37873790
37883791 amdgpu_coredump_init(adev);
37893792
@@ -5474,7 +5477,7 @@ static inline void amdgpu_device_stop_pending_resets(struct amdgpu_device *adev) · 1684 unmodified lines
54745477 if (!amdgpu_sriov_vf(adev))
54755478 cancel_work(&adev->reset_work);
54765479 #endif
5477− cancel_work(&adev->userq_reset_work);
5480+ amdgpu_userq_mgr_cancel_reset_work(adev);
54785481
54795482 if (adev->kfd.dev)
54805483 cancel_work(&adev->kfd.reset_work);
@@ -5832,6 +5835,12 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · 351 unmodified lines
58325835 /* We need to lock reset domain only once both for XGMI and single device */
58335836 amdgpu_device_recovery_get_reset_lock(adev, &device_list);
58345837
5838+ /* unmap all the mappings of doorbell and framebuffer to prevent user space from
5839+ * accessing them
5840+ */
5841+ unmap_mapping_range(adev->ddev.anon_inode->i_mapping, 0, 0, 1);
5842+ amdgpu_amdkfd_clear_kfd_mapping(adev);
5843+
58355844 amdgpu_device_halt_activities(adev, job, reset_context, &device_list,
58365845 hive, need_emergency_restart);
58375846 if (need_emergency_restart)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c+2−4
@@ -304,7 +304,7 @@ static int amdgpu_discovery_get_tmr_info(struct amdgpu_device *adev, · 303 unmodified lines
304304 adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID].offset;
305305 adev->discovery.size =
306306 adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID].size_kb << 10;
307− if (!adev->discovery.offset || !adev->discovery.size)
307+ if (!adev->discovery.size)
308308 return -EINVAL;
309309 } else {
310310 goto out;
@@ -3090,10 +3090,8 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 2779 unmodified lines
30903090 case IP_VERSION(11, 5, 1):
30913091 case IP_VERSION(11, 5, 2):
30923092 case IP_VERSION(11, 5, 3):
3093− adev->family = AMDGPU_FAMILY_GC_11_5_0;
3094− break;
30953093 case IP_VERSION(11, 5, 4):
3096− adev->family = AMDGPU_FAMILY_GC_11_5_4;
3094+ adev->family = AMDGPU_FAMILY_GC_11_5_0;
30973095 break;
30983096 case IP_VERSION(12, 0, 0):
30993097 case IP_VERSION(12, 0, 1):
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+6−11
@@ -3149,17 +3149,15 @@ static int __init amdgpu_init(void) · 3148 unmodified lines
31493149
31503150 r = amdgpu_sync_init();
31513151 if (r)
3152− goto error_sync;
3153−
3154− r = amdgpu_userq_fence_slab_init();
3155− if (r)
3156− goto error_fence;
3152+ return r;
31573153
31583154 amdgpu_register_atpx_handler();
31593155 amdgpu_acpi_detect();
31603156
3161− /* Ignore KFD init failures. Normal when CONFIG_HSA_AMD is not set. */
3162− amdgpu_amdkfd_init();
3157+ /* Ignore KFD init failures when CONFIG_HSA_AMD is not set. */
3158+ r = amdgpu_amdkfd_init();
3159+ if (r && r != -ENOENT)
3160+ goto error_fini_sync;
31633161
31643162 if (amdgpu_pp_feature_mask & PP_OVERDRIVE_MASK) {
31653163 add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
@@ -3170,10 +3168,8 @@ static int __init amdgpu_init(void) · 4 unmodified lines
31703168 /* let modprobe override vga console setting */
31713169 return pci_register_driver(&amdgpu_kms_pci_driver);
31723170
3173−error_fence:
3171+error_fini_sync:
31743172 amdgpu_sync_fini();
3175−
3176−error_sync:
31773173 return r;
31783174 }
31793175
@@ -3184,7 +3180,6 @@ static void __exit amdgpu_exit(void) · 4 unmodified lines
31843180 amdgpu_unregister_atpx_handler();
31853181 amdgpu_acpi_release();
31863182 amdgpu_sync_fini();
3187− amdgpu_userq_fence_slab_fini();
31883183 mmu_notifier_synchronize();
31893184 amdgpu_xcp_drv_release();
31903185 }
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c+10−3
@@ -262,12 +262,19 @@ void amdgpu_gart_table_ram_free(struct amdgpu_device *adev) · 261 unmodified lines
262262 */
263263 int amdgpu_gart_table_vram_alloc(struct amdgpu_device *adev)
264264 {
265+ int r;
266+
265267 if (adev->gart.bo != NULL)
266268 return 0;
267269
268− return amdgpu_bo_create_kernel(adev, adev->gart.table_size, PAGE_SIZE,
269− AMDGPU_GEM_DOMAIN_VRAM, &adev->gart.bo,
270− NULL, (void *)&adev->gart.ptr);
270+ r = amdgpu_bo_create_kernel(adev, adev->gart.table_size, PAGE_SIZE,
271+ AMDGPU_GEM_DOMAIN_VRAM, &adev->gart.bo,
272+ NULL, (void *)&adev->gart.ptr);
273+ if (r)
274+ return r;
275+
276+ memset_io(adev->gart.ptr, adev->gart.gart_pte_flags, adev->gart.table_size);
277+ return 0;
271278 }
272279
273280 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c+15−4
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include <linux/pci.h>
3232 #include <linux/dma-buf.h>
3333 #include <linux/dma-fence-unwrap.h>
34+#include <linux/uaccess.h>
3435
3536 #include <drm/amdgpu_drm.h>
3637 #include <drm/drm_drv.h>
@@ -508,6 +509,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, · 471 unmodified lines
508509 if (offset_in_page(args->addr | args->size))
509510 return -EINVAL;
510511
512+ if (!access_ok((void __user *)(uintptr_t)args->addr, args->size))
513+ return -EFAULT;
514+
511515 /* reject unknown flag values */
512516 if (args->flags & ~(AMDGPU_GEM_USERPTR_READONLY |
513517 AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_VALIDATE |
@@ -821,7 +825,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, · 307 unmodified lines
821825 struct drm_syncobj *timeline_syncobj = NULL;
822826 struct dma_fence_chain *timeline_chain = NULL;
823827 struct drm_exec exec;
824− uint64_t vm_size;
828+ uint64_t vm_size, tmp;
825829 int r = 0;
826830
827831 /* Validate virtual address range against reserved regions. */
@@ -845,7 +849,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, · 17 unmodified lines
845849
846850 vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
847851 vm_size -= AMDGPU_VA_RESERVED_TOP;
848− if (args->va_address + args->map_size > vm_size) {
852+ if (check_add_overflow(args->va_address, args->map_size, &tmp) || tmp > vm_size) {
849853 dev_dbg(dev->dev,
850854 "va_address 0x%llx is in top reserved area 0x%llx\n",
851855 args->va_address + args->map_size, vm_size);
@@ -1089,9 +1093,16 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data, · 237 unmodified lines
10891093 * If that number is larger than the size of the array, the ioctl must
10901094 * be retried.
10911095 */
1096+ if (args->num_entries > INT_MAX / sizeof(*vm_entries)) {
1097+ r = -EINVAL;
1098+ goto out_exec;
1099+ }
1100+
10921101 vm_entries = kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL);
1093− if (!vm_entries)
1094− return -ENOMEM;
1102+ if (!vm_entries) {
1103+ r = -ENOMEM;
1104+ goto out_exec;
1105+ }
10951106
10961107 amdgpu_vm_bo_va_for_each_valid_mapping(bo_va, mapping) {
10971108 if (num_mappings < args->num_entries) {
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+4−1
@@ -314,7 +314,10 @@ void amdgpu_gmc_gart_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc, · 313 unmodified lines
314314 mc->gart_start = max_mc_address - mc->gart_size + 1;
315315 break;
316316 case AMDGPU_GART_PLACEMENT_LOW:
317− mc->gart_start = 0;
317+ if (size_bf >= mc->gart_size)
318+ mc->gart_start = 0;
319+ else
320+ mc->gart_start = ALIGN(mc->fb_end, four_gb);
318321 break;
319322 case AMDGPU_GART_PLACEMENT_BEST_FIT:
320323 default:
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c+8−1
@@ -199,11 +199,18 @@ int amdgpu_gtt_mgr_alloc_entries(struct amdgpu_gtt_mgr *mgr, · 198 unmodified lines
199199 enum drm_mm_insert_mode mode)
200200 {
201201 struct amdgpu_device *adev = container_of(mgr, typeof(*adev), mman.gtt_mgr);
202+ u32 alignment = 0;
202203 int r;
203204
205+ /* Align to TLB L2 cache entry size to work around "V bit HW bug" */
206+ if (adev->asic_type == CHIP_TAHITI) {
207+ alignment = 32 * 1024 / AMDGPU_GPU_PAGE_SIZE;
208+ num_pages = ALIGN(num_pages, alignment);
209+ }
210+
204211 spin_lock(&mgr->lock);
205212 r = drm_mm_insert_node_in_range(&mgr->mm, mm_node, num_pages,
206− 0, GART_ENTRY_WITHOUT_BO_COLOR, 0,
213+ alignment, GART_ENTRY_WITHOUT_BO_COLOR, 0,
207214 adev->gmc.gart_size >> PAGE_SHIFT,
208215 mode);
209216 spin_unlock(&mgr->lock);
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c+9−8
@@ -51,8 +51,6 @@ · 50 unmodified lines
5151 #include "amdgpu_amdkfd.h"
5252 #include "amdgpu_hmm.h"
5353
54−#define MAX_WALK_BYTE (2UL << 30)
55−
5654 /**
5755 * amdgpu_hmm_invalidate_gfx - callback to notify about mm change
5856 *
@@ -78,6 +76,7 @@ static bool amdgpu_hmm_invalidate_gfx(struct mmu_interval_notifier *mni, · 19 unmodified lines
7876
7977 mmu_interval_set_seq(mni, cur_seq);
8078
79+ amdgpu_vm_bo_invalidate(bo, false);
8180 r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_BOOKKEEP,
8281 false, MAX_SCHEDULE_TIMEOUT);
8382 mutex_unlock(&adev->notifier_lock);
@@ -170,11 +169,13 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier, · 86 unmodified lines
170169 void *owner,
171170 struct amdgpu_hmm_range *range)
172171 {
173− unsigned long end;
172+ const u64 max_bytes = SZ_2G;
173+
174+ struct hmm_range *hmm_range = &range->hmm_range;
174175 unsigned long timeout;
175176 unsigned long *pfns;
176− int r = 0;
177− struct hmm_range *hmm_range = &range->hmm_range;
177+ unsigned long end;
178+ int r;
178179
179180 pfns = kvmalloc_array(npages, sizeof(*pfns), GFP_KERNEL);
180181 if (unlikely(!pfns)) {
@@ -191,8 +192,9 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier, · 10 unmodified lines
191192 end = start + npages * PAGE_SIZE;
192193 hmm_range->dev_private_owner = owner;
193194
195+ hmm_range->notifier_seq = mmu_interval_read_begin(notifier);
194196 do {
195− hmm_range->end = min(hmm_range->start + MAX_WALK_BYTE, end);
197+ hmm_range->end = min(hmm_range->start + max_bytes, end);
196198
197199 pr_debug("hmm range: start = 0x%lx, end = 0x%lx",
198200 hmm_range->start, hmm_range->end);
@@ -200,7 +202,6 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier, · 1 unmodified line
200202 timeout = jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
201203
202204 retry:
203− hmm_range->notifier_seq = mmu_interval_read_begin(notifier);
204205 r = hmm_range_fault(hmm_range);
205206 if (unlikely(r)) {
206207 if (r == -EBUSY && !time_after(jiffies, timeout))
@@ -210,7 +211,7 @@ retry: · 3 unmodified lines
210211
211212 if (hmm_range->end == end)
212213 break;
213− hmm_range->hmm_pfns += MAX_WALK_BYTE >> PAGE_SHIFT;
214+ hmm_range->hmm_pfns += max_bytes >> PAGE_SHIFT;
214215 hmm_range->start = hmm_range->end;
215216 } while (hmm_range->end < end);
216217
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+24−33
@@ -873,68 +873,59 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 872 unmodified lines
873873 ? -EFAULT : 0;
874874 }
875875 case AMDGPU_INFO_READ_MMR_REG: {
876− int ret = 0;
877− unsigned int n, alloc_size;
878− uint32_t *regs;
879876 unsigned int se_num = (info->read_mmr_reg.instance >>
880877 AMDGPU_INFO_MMR_SE_INDEX_SHIFT) &
881878 AMDGPU_INFO_MMR_SE_INDEX_MASK;
882879 unsigned int sh_num = (info->read_mmr_reg.instance >>
883880 AMDGPU_INFO_MMR_SH_INDEX_SHIFT) &
884881 AMDGPU_INFO_MMR_SH_INDEX_MASK;
885−
886− if (!down_read_trylock(&adev->reset_domain->sem))
887− return -ENOENT;
882+ unsigned int alloc_size;
883+ uint32_t *regs;
884+ int ret;
888885
889886 /* set full masks if the userspace set all bits
890887 * in the bitfields
891888 */
892− if (se_num == AMDGPU_INFO_MMR_SE_INDEX_MASK) {
889+ if (se_num == AMDGPU_INFO_MMR_SE_INDEX_MASK)
893890 se_num = 0xffffffff;
894− } else if (se_num >= AMDGPU_GFX_MAX_SE) {
895− ret = -EINVAL;
896− goto out;
897− }
891+ else if (se_num >= AMDGPU_GFX_MAX_SE)
892+ return -EINVAL;
898893
899− if (sh_num == AMDGPU_INFO_MMR_SH_INDEX_MASK) {
894+ if (sh_num == AMDGPU_INFO_MMR_SH_INDEX_MASK)
900895 sh_num = 0xffffffff;
901− } else if (sh_num >= AMDGPU_GFX_MAX_SH_PER_SE) {
902− ret = -EINVAL;
903− goto out;
904− }
896+ else if (sh_num >= AMDGPU_GFX_MAX_SH_PER_SE)
897+ return -EINVAL;
905898
906− if (info->read_mmr_reg.count > 128) {
907− ret = -EINVAL;
908− goto out;
909− }
899+ if (info->read_mmr_reg.count > 128)
900+ return -EINVAL;
910901
911− regs = kmalloc_array(info->read_mmr_reg.count, sizeof(*regs), GFP_KERNEL);
912− if (!regs) {
913− ret = -ENOMEM;
914− goto out;
915− }
902+ regs = kmalloc_array(info->read_mmr_reg.count, sizeof(*regs),
903+ GFP_KERNEL);
904+ if (!regs)
905+ return -ENOMEM;
916906
907+ down_read(&adev->reset_domain->sem);
917908 alloc_size = info->read_mmr_reg.count * sizeof(*regs);
918−
919909 amdgpu_gfx_off_ctrl(adev, false);
910+ ret = 0;
920911 for (i = 0; i < info->read_mmr_reg.count; i++) {
921912 if (amdgpu_asic_read_register(adev, se_num, sh_num,
922913 info->read_mmr_reg.dword_offset + i,
923914 &regs[i])) {
924915 DRM_DEBUG_KMS("unallowed offset %#x\n",
925916 info->read_mmr_reg.dword_offset + i);
926− kfree(regs);
927− amdgpu_gfx_off_ctrl(adev, true);
928917 ret = -EFAULT;
929− goto out;
918+ break;
930919 }
931920 }
932921 amdgpu_gfx_off_ctrl(adev, true);
933− n = copy_to_user(out, regs, min(size, alloc_size));
934− kfree(regs);
935− ret = (n ? -EFAULT : 0);
936−out:
937922 up_read(&adev->reset_domain->sem);
923+
924+ if (!ret) {
925+ ret = copy_to_user(out, regs, min(size, alloc_size))
926+ ? -EFAULT : 0;
927+ }
928+ kfree(regs);
938929 return ret;
939930 }
940931 case AMDGPU_INFO_DEV_INFO: {
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h+2−1
@@ -96,7 +96,8 @@ struct amdgpu_bo_va { · 95 unmodified lines
9696 * if non-zero, cannot unmap from GPU because user queues may still access it
9797 */
9898 unsigned int queue_refcount;
99− atomic_t userq_va_mapped;
99+ /* Indicates if this buffer is mapped for any user queue. Once set, never reset. */
100+ bool userq_va_mapped;
100101 };
101102
102103 struct amdgpu_bo {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c+2−1
@@ -2280,7 +2280,8 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev) · 2279 unmodified lines
22802280 list_for_each_entry(obj, &con->head, node) {
22812281 if (amdgpu_ras_is_supported(adev, obj->head.block) &&
22822282 (obj->attr_inuse == 1)) {
2283− sprintf(fs_info.debugfs_name, "%s_err_inject",
2283+ snprintf(fs_info.debugfs_name, sizeof(fs_info.debugfs_name),
2284+ "%s_err_inject",
22842285 get_ras_block_str(&obj->head));
22852286 fs_info.head = obj->head;
22862287 amdgpu_ras_debugfs_create(adev, &fs_info, dir);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c+1−1
@@ -1950,7 +1950,7 @@ void amdgpu_ras_check_bad_page_status(struct amdgpu_device *adev) · 1949 unmodified lines
19501950 if (!control || amdgpu_bad_page_threshold == 0)
19511951 return;
19521952
1953− if (control->ras_num_bad_pages >= ras->bad_page_cnt_threshold) {
1953+ if (control->ras_num_bad_pages > ras->bad_page_cnt_threshold) {
19541954 if (amdgpu_dpm_send_rma_reason(adev))
19551955 dev_warn(adev->dev, "Unable to send out-of-band RMA CPER");
19561956 else
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c+21−8
@@ -552,8 +552,9 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, · 551 unmodified lines
552552 size_t size, loff_t *pos)
553553 {
554554 struct amdgpu_ring *ring = file_inode(f)->i_private;
555− uint32_t value, result, early[3];
555+ u32 value, result, early[3] = { 0 };
556556 uint64_t p;
557+ u32 avail_dw, start_dw, read_dw;
557558 loff_t i;
558559 int r;
559560
@@ -565,10 +566,10 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, · 5 unmodified lines
565566
566567 result = 0;
567568
568− if (*pos < 12) {
569− if (ring->funcs->type == AMDGPU_RING_TYPE_CPER)
570− mutex_lock(&ring->adev->cper.ring_lock);
569+ if (ring->funcs->type == AMDGPU_RING_TYPE_CPER)
570+ mutex_lock(&ring->adev->cper.ring_lock);
571571
572+ if (*pos < 12) {
572573 early[0] = amdgpu_ring_get_rptr(ring) & ring->buf_mask;
573574 early[1] = amdgpu_ring_get_wptr(ring) & ring->buf_mask;
574575 early[2] = ring->wptr & ring->buf_mask;
@@ -600,13 +601,24 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, · 25 unmodified lines
600601 *pos += 4;
601602 }
602603 } else {
604+ early[0] = amdgpu_ring_get_rptr(ring) & ring->buf_mask;
605+ early[1] = amdgpu_ring_get_wptr(ring) & ring->buf_mask;
606+
603607 p = early[0];
604608 if (early[0] <= early[1])
605− size = (early[1] - early[0]);
609+ avail_dw = early[1] - early[0];
606610 else
607− size = ring->ring_size - (early[0] - early[1]);
611+ avail_dw = ring->buf_mask + 1 - (early[0] - early[1]);
608612
609− while (size) {
613+ start_dw = (*pos > 12) ? ((*pos - 12) >> 2) : 0;
614+ if (start_dw >= avail_dw)
615+ goto out;
616+
617+ p = (p + start_dw) & ring->ptr_mask;
618+ avail_dw -= start_dw;
619+ read_dw = min_t(u32, avail_dw, size >> 2);
620+
621+ while (read_dw) {
610622 if (p == early[1])
611623 goto out;
612624
@@ -619,9 +631,10 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, · 6 unmodified lines
619631
620632 buf += 4;
621633 result += 4;
622− size--;
634+ read_dw--;
623635 p++;
624636 p &= ring->ptr_mask;
637+ *pos += 4;
625638 }
626639 }
627640
drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c+8−5
@@ -175,11 +175,14 @@ int amdgpu_seq64_alloc(struct amdgpu_device *adev, u64 *va, · 174 unmodified lines
175175 {
176176 unsigned long bit_pos;
177177
178− bit_pos = find_first_zero_bit(adev->seq64.used, adev->seq64.num_sem);
179− if (bit_pos >= adev->seq64.num_sem)
180− return -ENOSPC;
178+ for (;;) {
179+ bit_pos = find_first_zero_bit(adev->seq64.used, adev->seq64.num_sem);
180+ if (bit_pos >= adev->seq64.num_sem)
181+ return -ENOSPC;
181182
182− __set_bit(bit_pos, adev->seq64.used);
183+ if (!test_and_set_bit(bit_pos, adev->seq64.used))
184+ break;
185+ }
183186
184187 *va = bit_pos * sizeof(u64) + amdgpu_seq64_get_va_base(adev);
185188
@@ -205,7 +208,7 @@ void amdgpu_seq64_free(struct amdgpu_device *adev, u64 va) · 19 unmodified lines
205208
206209 bit_pos = (va - amdgpu_seq64_get_va_base(adev)) / sizeof(u64);
207210 if (bit_pos < adev->seq64.num_sem)
208− __clear_bit(bit_pos, adev->seq64.used);
211+ clear_bit(bit_pos, adev->seq64.used);
209212 }
210213
211214 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+3−0
@@ -75,6 +75,9 @@ static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev, · 74 unmodified lines
7575 unsigned int type,
7676 uint64_t size_in_page)
7777 {
78+ if (!size_in_page)
79+ return 0;
80+
7881 return ttm_range_man_init(&adev->mman.bdev, type,
7982 false, size_in_page);
8083 }
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c+2−0
@@ -130,6 +130,7 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev, · 129 unmodified lines
130130 if (adev->umc.ras && adev->umc.ras->ras_block.hw_ops &&
131131 adev->umc.ras->ras_block.hw_ops->query_ras_error_address &&
132132 adev->umc.max_ras_err_cnt_per_query) {
133+ kfree(err_data->err_addr);
133134 err_data->err_addr =
134135 kzalloc_objs(struct eeprom_table_record,
135136 adev->umc.max_ras_err_cnt_per_query);
@@ -160,6 +161,7 @@ void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev, · 24 unmodified lines
160161 if (adev->umc.ras &&
161162 adev->umc.ras->ecc_info_query_ras_error_address &&
162163 adev->umc.max_ras_err_cnt_per_query) {
164+ kfree(err_data->err_addr);
163165 err_data->err_addr =
164166 kzalloc_objs(struct eeprom_table_record,
165167 adev->umc.max_ras_err_cnt_per_query);
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c+204−331
@@ -82,19 +82,11 @@ static bool amdgpu_userq_is_reset_type_supported(struct amdgpu_device *adev, · 81 unmodified lines
8282 return false;
8383 }
8484
85−static void amdgpu_userq_gpu_reset(struct amdgpu_device *adev)
86−{
87− if (amdgpu_device_should_recover_gpu(adev)) {
88− amdgpu_reset_domain_schedule(adev->reset_domain,
89− &adev->userq_reset_work);
90− /* Wait for the reset job to complete */
91− flush_work(&adev->userq_reset_work);
92− }
93−}
94−
95−static int
96−amdgpu_userq_detect_and_reset_queues(struct amdgpu_userq_mgr *uq_mgr)
85+static void amdgpu_userq_mgr_reset_work(struct work_struct *work)
9786 {
87+ struct amdgpu_userq_mgr *uq_mgr =
88+ container_of(work, struct amdgpu_userq_mgr,
89+ reset_work);
9890 struct amdgpu_device *adev = uq_mgr->adev;
9991 const int queue_types[] = {
10092 AMDGPU_RING_TYPE_COMPUTE,
@@ -103,15 +95,11 @@ amdgpu_userq_detect_and_reset_queues(struct amdgpu_userq_mgr *uq_mgr) · 2 unmodified lines
10395 };
10496 const int num_queue_types = ARRAY_SIZE(queue_types);
10597 bool gpu_reset = false;
106− int r = 0;
107− int i;
108−
109− /* Warning if current process mutex is not held */
110− WARN_ON(!mutex_is_locked(&uq_mgr->userq_mutex));
98+ int i, r;
11199
112100 if (unlikely(adev->debug_disable_gpu_ring_reset)) {
113101 dev_err(adev->dev, "userq reset disabled by debug mask\n");
114− return 0;
102+ return;
115103 }
116104
117105 /*
@@ -119,7 +107,7 @@ amdgpu_userq_detect_and_reset_queues(struct amdgpu_userq_mgr *uq_mgr) · 1 unmodified line
119107 * skip all reset detection logic
120108 */
121109 if (!amdgpu_gpu_recovery)
122− return 0;
110+ return;
123111
124112 /*
125113 * Iterate through all queue types to detect and reset problematic queues
@@ -127,9 +115,11 @@ amdgpu_userq_detect_and_reset_queues(struct amdgpu_userq_mgr *uq_mgr) · 1 unmodified line
127115 */
128116 for (i = 0; i < num_queue_types; i++) {
129117 int ring_type = queue_types[i];
130− const struct amdgpu_userq_funcs *funcs = adev->userq_funcs[ring_type];
118+ const struct amdgpu_userq_funcs *funcs =
119+ adev->userq_funcs[ring_type];
131120
132− if (!amdgpu_userq_is_reset_type_supported(adev, ring_type, AMDGPU_RESET_TYPE_PER_QUEUE))
121+ if (!amdgpu_userq_is_reset_type_supported(adev, ring_type,
122+ AMDGPU_RESET_TYPE_PER_QUEUE))
133123 continue;
134124
135125 if (atomic_read(&uq_mgr->userq_count[ring_type]) > 0 &&
@@ -142,46 +132,43 @@ amdgpu_userq_detect_and_reset_queues(struct amdgpu_userq_mgr *uq_mgr) · 6 unmodified lines
142132 }
143133 }
144134
145− if (gpu_reset)
146− amdgpu_userq_gpu_reset(adev);
135+ if (gpu_reset) {
136+ struct amdgpu_reset_context reset_context;
147137
148− return r;
138+ memset(&reset_context, 0, sizeof(reset_context));
139+
140+ reset_context.method = AMD_RESET_METHOD_NONE;
141+ reset_context.reset_req_dev = adev;
142+ reset_context.src = AMDGPU_RESET_SRC_USERQ;
143+ set_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags);
144+ /*set_bit(AMDGPU_SKIP_COREDUMP, &reset_context.flags);*/
145+
146+ amdgpu_device_gpu_recover(adev, NULL, &reset_context);
147+ }
149148 }
150149
151150 static void amdgpu_userq_hang_detect_work(struct work_struct *work)
152151 {
153− struct amdgpu_usermode_queue *queue = container_of(work,
154− struct amdgpu_usermode_queue,
155− hang_detect_work.work);
156− struct dma_fence *fence;
157− struct amdgpu_userq_mgr *uq_mgr;
158−
159− if (!queue->userq_mgr)
160− return;
161−
162− uq_mgr = queue->userq_mgr;
163− fence = READ_ONCE(queue->hang_detect_fence);
164− /* Fence already signaled – no action needed */
165− if (!fence || dma_fence_is_signaled(fence))
166− return;
152+ struct amdgpu_usermode_queue *queue =
153+ container_of(work, struct amdgpu_usermode_queue,
154+ hang_detect_work.work);
167155
168− mutex_lock(&uq_mgr->userq_mutex);
169− amdgpu_userq_detect_and_reset_queues(uq_mgr);
170− mutex_unlock(&uq_mgr->userq_mutex);
156+ /*
157+ * Don't schedule the work here! Scheduling or queue work from one reset
158+ * handler to another is illegal if you don't take extra precautions!
159+ */
160+ amdgpu_userq_mgr_reset_work(&queue->userq_mgr->reset_work);
171161 }
172162
173163 /*
174164 * Start hang detection for a user queue fence. A delayed work will be scheduled
175− * to check if the fence is still pending after the timeout period.
176−*/
165+ * to reset the queues when the fence doesn't signal in time.
166+ */
177167 void amdgpu_userq_start_hang_detect_work(struct amdgpu_usermode_queue *queue)
178168 {
179169 struct amdgpu_device *adev;
180170 unsigned long timeout_ms;
181171
182− if (!queue || !queue->userq_mgr || !queue->userq_mgr->adev)
183− return;
184−
185172 adev = queue->userq_mgr->adev;
186173 /* Determine timeout based on queue type */
187174 switch (queue->queue_type) {
@@ -199,45 +186,44 @@ void amdgpu_userq_start_hang_detect_work(struct amdgpu_usermode_queue *queue) · 11 unmodified lines
199186 break;
200187 }
201188
202− /* Store the fence to monitor and schedule hang detection */
203− WRITE_ONCE(queue->hang_detect_fence, queue->last_fence);
204− schedule_delayed_work(&queue->hang_detect_work,
205− msecs_to_jiffies(timeout_ms));
206−}
207−
208−static void amdgpu_userq_init_hang_detect_work(struct amdgpu_usermode_queue *queue)
209−{
210− INIT_DELAYED_WORK(&queue->hang_detect_work, amdgpu_userq_hang_detect_work);
211− queue->hang_detect_fence = NULL;
189+ queue_delayed_work(adev->reset_domain->wq, &queue->hang_detect_work,
190+ msecs_to_jiffies(timeout_ms));
212191 }
213192
214−static int amdgpu_userq_buffer_va_list_add(struct amdgpu_usermode_queue *queue,
215− struct amdgpu_bo_va_mapping *va_map, u64 addr)
193+void amdgpu_userq_process_fence_irq(struct amdgpu_device *adev, u32 doorbell)
216194 {
217− struct amdgpu_userq_va_cursor *va_cursor;
218− struct userq_va_list;
219−
220− va_cursor = kzalloc_obj(*va_cursor);
221− if (!va_cursor)
222− return -ENOMEM;
195+ struct xarray *xa = &adev->userq_doorbell_xa;
196+ struct amdgpu_usermode_queue *queue;
197+ unsigned long flags;
198+ int r;
223199
224− INIT_LIST_HEAD(&va_cursor->list);
225− va_cursor->gpu_addr = addr;
226− atomic_set(&va_map->bo_va->userq_va_mapped, 1);
227− list_add(&va_cursor->list, &queue->userq_va_list);
200+ xa_lock_irqsave(xa, flags);
201+ queue = xa_load(xa, doorbell);
202+ if (queue) {
203+ r = amdgpu_userq_fence_driver_process(queue->fence_drv);
204+ /*
205+ * We are in interrupt context here, this *can't* wait for
206+ * reset work to finish.
207+ */
208+ if (r >= 0)
209+ cancel_delayed_work(&queue->hang_detect_work);
228210
229− return 0;
211+ /* Restart the timer when there are still fences pending */
212+ if (r == 1)
213+ amdgpu_userq_start_hang_detect_work(queue);
214+ }
215+ xa_unlock_irqrestore(xa, flags);
230216 }
231217
232218 int amdgpu_userq_input_va_validate(struct amdgpu_device *adev,
233219 struct amdgpu_usermode_queue *queue,
234− u64 addr, u64 expected_size)
220+ u64 addr, u64 expected_size,
221+ u64 *va_out)
235222 {
236223 struct amdgpu_bo_va_mapping *va_map;
237224 struct amdgpu_vm *vm = queue->vm;
238225 u64 user_addr;
239226 u64 size;
240− int r = 0;
241227
242228 /* Caller must hold vm->root.bo reservation */
243229 dma_resv_assert_held(queue->vm->root.bo->tbo.base.resv);
@@ -246,20 +232,18 @@ int amdgpu_userq_input_va_validate(struct amdgpu_device *adev, · 2 unmodified lines
246232 size = expected_size >> AMDGPU_GPU_PAGE_SHIFT;
247233
248234 va_map = amdgpu_vm_bo_lookup_mapping(vm, user_addr);
249− if (!va_map) {
250− r = -EINVAL;
251− goto out_err;
252− }
235+ if (!va_map)
236+ return -EINVAL;
237+
253238 /* Only validate the userq whether resident in the VM mapping range */
254239 if (user_addr >= va_map->start &&
255240 va_map->last - user_addr + 1 >= size) {
256− amdgpu_userq_buffer_va_list_add(queue, va_map, user_addr);
241+ va_map->bo_va->userq_va_mapped = true;
242+ *va_out = user_addr;
257243 return 0;
258244 }
259245
260− r = -EINVAL;
261−out_err:
262− return r;
246+ return -EINVAL;
263247 }
264248
265249 static bool amdgpu_userq_buffer_va_mapped(struct amdgpu_vm *vm, u64 addr)
@@ -270,7 +254,7 @@ static bool amdgpu_userq_buffer_va_mapped(struct amdgpu_vm *vm, u64 addr) · 4 unmodified lines
270254 dma_resv_assert_held(vm->root.bo->tbo.base.resv);
271255
272256 mapping = amdgpu_vm_bo_lookup_mapping(vm, addr);
273− if (!IS_ERR_OR_NULL(mapping) && atomic_read(&mapping->bo_va->userq_va_mapped))
257+ if (!IS_ERR_OR_NULL(mapping) && mapping->bo_va->userq_va_mapped)
274258 r = true;
275259 else
276260 r = false;
@@ -280,14 +264,16 @@ static bool amdgpu_userq_buffer_va_mapped(struct amdgpu_vm *vm, u64 addr) · 3 unmodified lines
280264
281265 static bool amdgpu_userq_buffer_vas_mapped(struct amdgpu_usermode_queue *queue)
282266 {
283− struct amdgpu_userq_va_cursor *va_cursor, *tmp;
284− int r = 0;
267+ int i, r = 0;
285268
286− list_for_each_entry_safe(va_cursor, tmp, &queue->userq_va_list, list) {
287− r += amdgpu_userq_buffer_va_mapped(queue->vm, va_cursor->gpu_addr);
269+ for (i = 0; i < ARRAY_SIZE(queue->userq_vas.va_array); i++) {
270+ if (!queue->userq_vas.va_array[i])
271+ continue;
272+ r += amdgpu_userq_buffer_va_mapped(queue->vm,
273+ queue->userq_vas.va_array[i]);
288274 dev_dbg(queue->userq_mgr->adev->dev,
289275 "validate the userq mapping:%p va:%llx r:%d\n",
290− queue, va_cursor->gpu_addr, r);
276+ queue, queue->userq_vas.va_array[i], r);
291277 }
292278
293279 if (r != 0)
@@ -296,35 +282,7 @@ static bool amdgpu_userq_buffer_vas_mapped(struct amdgpu_usermode_queue *queue) · 2 unmodified lines
296282 return false;
297283 }
298284
299−static void amdgpu_userq_buffer_va_list_del(struct amdgpu_bo_va_mapping *mapping,
300− struct amdgpu_userq_va_cursor *va_cursor)
301−{
302− atomic_set(&mapping->bo_va->userq_va_mapped, 0);
303− list_del(&va_cursor->list);
304− kfree(va_cursor);
305−}
306−
307−static int amdgpu_userq_buffer_vas_list_cleanup(struct amdgpu_device *adev,
308− struct amdgpu_usermode_queue *queue)
309−{
310− struct amdgpu_userq_va_cursor *va_cursor, *tmp;
311− struct amdgpu_bo_va_mapping *mapping;
312−
313− /* Caller must hold vm->root.bo reservation */
314− dma_resv_assert_held(queue->vm->root.bo->tbo.base.resv);
315−
316− list_for_each_entry_safe(va_cursor, tmp, &queue->userq_va_list, list) {
317− mapping = amdgpu_vm_bo_lookup_mapping(queue->vm, va_cursor->gpu_addr);
318− if (!mapping) {
319− return -EINVAL;
320− }
321− dev_dbg(adev->dev, "delete the userq:%p va:%llx\n",
322− queue, va_cursor->gpu_addr);
323− amdgpu_userq_buffer_va_list_del(mapping, va_cursor);
324− }
325285
326− return 0;
327−}
328286
329287 static int amdgpu_userq_preempt_helper(struct amdgpu_usermode_queue *queue)
330288 {
@@ -332,23 +290,18 @@ static int amdgpu_userq_preempt_helper(struct amdgpu_usermode_queue *queue) · 1 unmodified line
332290 struct amdgpu_device *adev = uq_mgr->adev;
333291 const struct amdgpu_userq_funcs *userq_funcs =
334292 adev->userq_funcs[queue->queue_type];
335− bool found_hung_queue = false;
336− int r = 0;
293+ int r;
337294
338295 if (queue->state == AMDGPU_USERQ_STATE_MAPPED) {
339296 r = userq_funcs->preempt(queue);
340297 if (r) {
341298 queue->state = AMDGPU_USERQ_STATE_HUNG;
342− found_hung_queue = true;
299+ return r;
343300 } else {
344301 queue->state = AMDGPU_USERQ_STATE_PREEMPTED;
345302 }
346303 }
347−
348− if (found_hung_queue)
349− amdgpu_userq_detect_and_reset_queues(uq_mgr);
350−
351− return r;
304+ return 0;
352305 }
353306
354307 static int amdgpu_userq_restore_helper(struct amdgpu_usermode_queue *queue)
@@ -377,24 +330,21 @@ static int amdgpu_userq_unmap_helper(struct amdgpu_usermode_queue *queue) · 22 unmodified lines
377330 struct amdgpu_device *adev = uq_mgr->adev;
378331 const struct amdgpu_userq_funcs *userq_funcs =
379332 adev->userq_funcs[queue->queue_type];
380− bool found_hung_queue = false;
381− int r = 0;
333+ int r;
382334
383335 if ((queue->state == AMDGPU_USERQ_STATE_MAPPED) ||
384− (queue->state == AMDGPU_USERQ_STATE_PREEMPTED)) {
336+ (queue->state == AMDGPU_USERQ_STATE_PREEMPTED)) {
337+
385338 r = userq_funcs->unmap(queue);
386339 if (r) {
387340 queue->state = AMDGPU_USERQ_STATE_HUNG;
388− found_hung_queue = true;
341+ return r;
389342 } else {
390343 queue->state = AMDGPU_USERQ_STATE_UNMAPPED;
391344 }
392345 }
393346
394− if (found_hung_queue)
395− amdgpu_userq_detect_and_reset_queues(uq_mgr);
396−
397− return r;
347+ return 0;
398348 }
399349
400350 static int amdgpu_userq_map_helper(struct amdgpu_usermode_queue *queue)
@@ -403,19 +353,19 @@ static int amdgpu_userq_map_helper(struct amdgpu_usermode_queue *queue) · 2 unmodified lines
403353 struct amdgpu_device *adev = uq_mgr->adev;
404354 const struct amdgpu_userq_funcs *userq_funcs =
405355 adev->userq_funcs[queue->queue_type];
406− int r = 0;
356+ int r;
407357
408358 if (queue->state == AMDGPU_USERQ_STATE_UNMAPPED) {
409359 r = userq_funcs->map(queue);
410360 if (r) {
411361 queue->state = AMDGPU_USERQ_STATE_HUNG;
412− amdgpu_userq_detect_and_reset_queues(uq_mgr);
362+ return r;
413363 } else {
414364 queue->state = AMDGPU_USERQ_STATE_MAPPED;
415365 }
416366 }
417367
418− return r;
368+ return 0;
419369 }
420370
421371 static void amdgpu_userq_wait_for_last_fence(struct amdgpu_usermode_queue *queue)
@@ -432,18 +382,14 @@ static void amdgpu_userq_cleanup(struct amdgpu_usermode_queue *queue) · 10 unmodified lines
432382 {
433383 struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;
434384 struct amdgpu_device *adev = uq_mgr->adev;
435− const struct amdgpu_userq_funcs *uq_funcs = adev->userq_funcs[queue->queue_type];
436385
437386 /* Wait for mode-1 reset to complete */
438387 down_read(&adev->reset_domain->sem);
439388
440− uq_funcs->mqd_destroy(queue);
441389 /* Use interrupt-safe locking since IRQ handlers may access these XArrays */
442390 xa_erase_irq(&adev->userq_doorbell_xa, queue->doorbell_index);
443391 amdgpu_userq_fence_driver_free(queue);
444392 queue->fence_drv = NULL;
445− queue->userq_mgr = NULL;
446− list_del(&queue->userq_va_list);
447393
448394 up_read(&adev->reset_domain->sem);
449395 }
@@ -482,74 +428,15 @@ retry: · 32 unmodified lines
482428 dma_fence_put(ev_fence);
483429 }
484430
485−int amdgpu_userq_create_object(struct amdgpu_userq_mgr *uq_mgr,
486− struct amdgpu_userq_obj *userq_obj,
487− int size)
488−{
489− struct amdgpu_device *adev = uq_mgr->adev;
490− struct amdgpu_bo_param bp;
491− int r;
492−
493− memset(&bp, 0, sizeof(bp));
494− bp.byte_align = PAGE_SIZE;
495− bp.domain = AMDGPU_GEM_DOMAIN_GTT;
496− bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
497− AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
498− bp.type = ttm_bo_type_kernel;
499− bp.size = size;
500− bp.resv = NULL;
501− bp.bo_ptr_size = sizeof(struct amdgpu_bo);
502−
503− r = amdgpu_bo_create(adev, &bp, &userq_obj->obj);
504− if (r) {
505− drm_file_err(uq_mgr->file, "Failed to allocate BO for userqueue (%d)", r);
506− return r;
507− }
508−
509− r = amdgpu_bo_reserve(userq_obj->obj, true);
510− if (r) {
511− drm_file_err(uq_mgr->file, "Failed to reserve BO to map (%d)", r);
512− goto free_obj;
513− }
514−
515− r = amdgpu_ttm_alloc_gart(&(userq_obj->obj)->tbo);
516− if (r) {
517− drm_file_err(uq_mgr->file, "Failed to alloc GART for userqueue object (%d)", r);
518− goto unresv;
519− }
520−
521− r = amdgpu_bo_kmap(userq_obj->obj, &userq_obj->cpu_ptr);
522− if (r) {
523− drm_file_err(uq_mgr->file, "Failed to map BO for userqueue (%d)", r);
524− goto unresv;
525− }
526−
527− userq_obj->gpu_addr = amdgpu_bo_gpu_offset(userq_obj->obj);
528− amdgpu_bo_unreserve(userq_obj->obj);
529− memset(userq_obj->cpu_ptr, 0, size);
530− return 0;
531431
532−unresv:
533− amdgpu_bo_unreserve(userq_obj->obj);
534−
535−free_obj:
536− amdgpu_bo_unref(&userq_obj->obj);
537− return r;
538−}
539−
540−void amdgpu_userq_destroy_object(struct amdgpu_userq_mgr *uq_mgr,
541− struct amdgpu_userq_obj *userq_obj)
542−{
543− amdgpu_bo_kunmap(userq_obj->obj);
544− amdgpu_bo_unref(&userq_obj->obj);
545−}
546432
547−uint64_t
433+static int
548434 amdgpu_userq_get_doorbell_index(struct amdgpu_userq_mgr *uq_mgr,
549435 struct amdgpu_db_info *db_info,
550− struct drm_file *filp)
436+ struct drm_file *filp,
437+ u64 *index)
551438 {
552− uint64_t index;
439+ u64 doorbell_index;
553440 struct drm_gem_object *gobj;
554441 struct amdgpu_userq_obj *db_obj = db_info->db_obj;
555442 int r, db_size;
@@ -596,12 +483,13 @@ amdgpu_userq_get_doorbell_index(struct amdgpu_userq_mgr *uq_mgr, · 40 unmodified lines
596483 goto unpin_bo;
597484 }
598485
599− index = amdgpu_doorbell_index_on_bar(uq_mgr->adev, db_obj->obj,
600− db_info->doorbell_offset, db_size);
486+ doorbell_index = amdgpu_doorbell_index_on_bar(uq_mgr->adev, db_obj->obj,
487+ db_info->doorbell_offset, db_size);
601488 drm_dbg_driver(adev_to_drm(uq_mgr->adev),
602− "[Usermode queues] doorbell index=%lld\n", index);
489+ "[Usermode queues] doorbell index=%lld\n", doorbell_index);
603490 amdgpu_bo_unreserve(db_obj->obj);
604− return index;
491+ *index = doorbell_index;
492+ return 0;
605493
606494 unpin_bo:
607495 amdgpu_bo_unpin(db_obj->obj);
@@ -616,9 +504,7 @@ static int · 8 unmodified lines
616504 amdgpu_userq_destroy(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_usermode_queue *queue)
617505 {
618506 struct amdgpu_device *adev = uq_mgr->adev;
619− struct amdgpu_fpriv *fpriv = uq_mgr_to_fpriv(uq_mgr);
620− struct amdgpu_vm *vm = &fpriv->vm;
621−
507+ const struct amdgpu_userq_funcs *uq_funcs = adev->userq_funcs[queue->queue_type];
622508 int r = 0;
623509
624510 cancel_delayed_work_sync(&uq_mgr->resume_work);
@@ -626,33 +512,21 @@ amdgpu_userq_destroy(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_usermode_que · 1 unmodified line
626512 /* Cancel any pending hang detection work and cleanup */
627513 cancel_delayed_work_sync(&queue->hang_detect_work);
628514
629− r = amdgpu_bo_reserve(vm->root.bo, false);
630− if (r) {
631− drm_file_err(uq_mgr->file, "Failed to reserve root bo during userqueue destroy\n");
632− return r;
633− }
634− amdgpu_userq_buffer_vas_list_cleanup(adev, queue);
635− amdgpu_bo_unreserve(vm->root.bo);
636−
637515 mutex_lock(&uq_mgr->userq_mutex);
638− queue->hang_detect_fence = NULL;
639516 amdgpu_userq_wait_for_last_fence(queue);
640517
641518 #if defined(CONFIG_DEBUG_FS)
642519 debugfs_remove_recursive(queue->debugfs_queue);
643520 #endif
644− amdgpu_userq_detect_and_reset_queues(uq_mgr);
645521 r = amdgpu_userq_unmap_helper(queue);
646− /*TODO: It requires a reset for userq hw unmap error*/
647− if (r) {
648− drm_warn(adev_to_drm(uq_mgr->adev), "trying to destroy a HW mapping userq\n");
649− queue->state = AMDGPU_USERQ_STATE_HUNG;
650− }
651−
652522 atomic_dec(&uq_mgr->userq_count[queue->queue_type]);
653523 amdgpu_userq_cleanup(queue);
654524 mutex_unlock(&uq_mgr->userq_mutex);
655525
526+ cancel_delayed_work_sync(&queue->hang_detect_work);
527+ uq_funcs->mqd_destroy(queue);
528+ queue->userq_mgr = NULL;
529+
656530 amdgpu_bo_reserve(queue->db_obj.obj, true);
657531 amdgpu_bo_unpin(queue->db_obj.obj);
658532 amdgpu_bo_unreserve(queue->db_obj.obj);
@@ -724,14 +598,14 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args) · 65 unmodified lines
724598 const struct amdgpu_userq_funcs *uq_funcs;
725599 struct amdgpu_usermode_queue *queue;
726600 struct amdgpu_db_info db_info;
727− bool skip_map_queue;
728− u32 qid;
729601 uint64_t index;
730− int r = 0;
731− int priority =
732− (args->in.flags & AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK) >>
733− AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_SHIFT;
602+ int priority;
603+ u32 qid;
604+ int r;
734605
606+ priority =
607+ (args->in.flags & AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK)
608+ >> AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_SHIFT;
735609 r = amdgpu_userq_priority_permit(filp, priority);
736610 if (r)
737611 return r;
@@ -744,128 +618,121 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args) · 6 unmodified lines
744618
745619 uq_funcs = adev->userq_funcs[args->in.ip_type];
746620 if (!uq_funcs) {
747− drm_file_err(uq_mgr->file, "Usermode queue is not supported for this IP (%u)\n",
748− args->in.ip_type);
749621 r = -EINVAL;
750622 goto err_pm_runtime;
751623 }
752624
753625 queue = kzalloc_obj(struct amdgpu_usermode_queue);
754626 if (!queue) {
755− drm_file_err(uq_mgr->file, "Failed to allocate memory for queue\n");
756627 r = -ENOMEM;
757628 goto err_pm_runtime;
758629 }
759630
760− INIT_LIST_HEAD(&queue->userq_va_list);
631+ kref_init(&queue->refcount);
761632 queue->doorbell_handle = args->in.doorbell_handle;
762633 queue->queue_type = args->in.ip_type;
763634 queue->vm = &fpriv->vm;
764635 queue->priority = priority;
765−
766− db_info.queue_type = queue->queue_type;
767− db_info.doorbell_handle = queue->doorbell_handle;
768− db_info.db_obj = &queue->db_obj;
769− db_info.doorbell_offset = args->in.doorbell_offset;
770−
771636 queue->userq_mgr = uq_mgr;
637+ INIT_DELAYED_WORK(&queue->hang_detect_work,
638+ amdgpu_userq_hang_detect_work);
772639
773− /* Validate the userq virtual address.*/
774− r = amdgpu_bo_reserve(fpriv->vm.root.bo, false);
640+ r = amdgpu_userq_fence_driver_alloc(adev, &queue->fence_drv);
775641 if (r)
776642 goto free_queue;
777643
778− if (amdgpu_userq_input_va_validate(adev, queue, args->in.queue_va, args->in.queue_size) ||
779− amdgpu_userq_input_va_validate(adev, queue, args->in.rptr_va, AMDGPU_GPU_PAGE_SIZE) ||
780− amdgpu_userq_input_va_validate(adev, queue, args->in.wptr_va, AMDGPU_GPU_PAGE_SIZE)) {
644+ xa_init_flags(&queue->fence_drv_xa, XA_FLAGS_ALLOC);
645+ mutex_init(&queue->fence_drv_lock);
646+ /* Make sure the queue can actually run with those virtual addresses. */
647+ r = amdgpu_bo_reserve(fpriv->vm.root.bo, false);
648+ if (r)
649+ goto free_fence_drv;
650+
651+ if (amdgpu_userq_input_va_validate(adev, queue, args->in.queue_va,
652+ args->in.queue_size,
653+ &queue->userq_vas.va.queue_rb) ||
654+ amdgpu_userq_input_va_validate(adev, queue, args->in.rptr_va,
655+ AMDGPU_GPU_PAGE_SIZE,
656+ &queue->userq_vas.va.rptr) ||
657+ amdgpu_userq_input_va_validate(adev, queue, args->in.wptr_va,
658+ AMDGPU_GPU_PAGE_SIZE,
659+ &queue->userq_vas.va.wptr)) {
781660 r = -EINVAL;
782661 amdgpu_bo_unreserve(fpriv->vm.root.bo);
783− goto clean_mapping;
662+ goto free_fence_drv;
784663 }
785664 amdgpu_bo_unreserve(fpriv->vm.root.bo);
786665
787666 /* Convert relative doorbell offset into absolute doorbell index */
788− index = amdgpu_userq_get_doorbell_index(uq_mgr, &db_info, filp);
789− if (index == (uint64_t)-EINVAL) {
667+ db_info.queue_type = queue->queue_type;
668+ db_info.doorbell_handle = queue->doorbell_handle;
669+ db_info.db_obj = &queue->db_obj;
670+ db_info.doorbell_offset = args->in.doorbell_offset;
671+ r = amdgpu_userq_get_doorbell_index(uq_mgr, &db_info, filp, &index);
672+ if (r) {
790673 drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n");
791− r = -EINVAL;
792− goto clean_mapping;
674+ goto free_fence_drv;
793675 }
794676
795677 queue->doorbell_index = index;
796− xa_init_flags(&queue->fence_drv_xa, XA_FLAGS_ALLOC);
797− r = amdgpu_userq_fence_driver_alloc(adev, &queue->fence_drv);
798− if (r) {
799− drm_file_err(uq_mgr->file, "Failed to alloc fence driver\n");
800− goto clean_mapping;
801− }
802−
803678 r = uq_funcs->mqd_create(queue, &args->in);
804679 if (r) {
805680 drm_file_err(uq_mgr->file, "Failed to create Queue\n");
806− goto clean_fence_driver;
681+ goto clean_doorbell_bo;
807682 }
808683
684+ /* Update VM owner at userq submit-time for page-fault attribution. */
685+ amdgpu_vm_set_task_info(&fpriv->vm);
686+
687+ r = xa_err(xa_store_irq(&adev->userq_doorbell_xa, index, queue,
688+ GFP_KERNEL));
689+ if (r)
690+ goto clean_mqd;
691+
809692 amdgpu_userq_ensure_ev_fence(&fpriv->userq_mgr, &fpriv->evf_mgr);
810693
811694 /* don't map the queue if scheduling is halted */
812− if (adev->userq_halt_for_enforce_isolation &&
813− ((queue->queue_type == AMDGPU_HW_IP_GFX) ||
814− (queue->queue_type == AMDGPU_HW_IP_COMPUTE)))
815− skip_map_queue = true;
816− else
817− skip_map_queue = false;
818− if (!skip_map_queue) {
695+ if (!adev->userq_halt_for_enforce_isolation ||
696+ ((queue->queue_type != AMDGPU_HW_IP_GFX) &&
697+ (queue->queue_type != AMDGPU_HW_IP_COMPUTE))) {
819698 r = amdgpu_userq_map_helper(queue);
820699 if (r) {
821700 drm_file_err(uq_mgr->file, "Failed to map Queue\n");
822− goto clean_mqd;
701+ mutex_unlock(&uq_mgr->userq_mutex);
702+ goto erase_doorbell;
823703 }
824704 }
825705
826− /* drop this refcount during queue destroy */
827− kref_init(&queue->refcount);
828−
829− /* Wait for mode-1 reset to complete */
830− down_read(&adev->reset_domain->sem);
706+ atomic_inc(&uq_mgr->userq_count[queue->queue_type]);
707+ mutex_unlock(&uq_mgr->userq_mutex);
831708
832709 r = xa_alloc(&uq_mgr->userq_xa, &qid, queue,
833− XA_LIMIT(1, AMDGPU_MAX_USERQ_COUNT), GFP_KERNEL);
834− if (r) {
835− if (!skip_map_queue)
836− amdgpu_userq_unmap_helper(queue);
837− r = -ENOMEM;
838− goto clean_reset_domain;
839− }
840−
841− r = xa_err(xa_store_irq(&adev->userq_doorbell_xa, index, queue, GFP_KERNEL));
710+ XA_LIMIT(1, AMDGPU_MAX_USERQ_COUNT),
711+ GFP_KERNEL);
842712 if (r) {
843− xa_erase(&uq_mgr->userq_xa, qid);
844− if (!skip_map_queue)
845− amdgpu_userq_unmap_helper(queue);
846− goto clean_reset_domain;
713+ /*
714+ * This drops the last reference which should take care of
715+ * all cleanup.
716+ */
717+ amdgpu_userq_put(queue);
718+ return r;
847719 }
848− up_read(&adev->reset_domain->sem);
849720
850721 amdgpu_debugfs_userq_init(filp, queue, qid);
851− amdgpu_userq_init_hang_detect_work(queue);
852−
853722 args->out.queue_id = qid;
854− atomic_inc(&uq_mgr->userq_count[queue->queue_type]);
855− mutex_unlock(&uq_mgr->userq_mutex);
856723 return 0;
857724
858−clean_reset_domain:
859− up_read(&adev->reset_domain->sem);
725+erase_doorbell:
726+ xa_erase_irq(&adev->userq_doorbell_xa, index);
860727 clean_mqd:
861− mutex_unlock(&uq_mgr->userq_mutex);
862728 uq_funcs->mqd_destroy(queue);
863−clean_fence_driver:
729+clean_doorbell_bo:
730+ amdgpu_bo_reserve(queue->db_obj.obj, true);
731+ amdgpu_bo_unpin(queue->db_obj.obj);
732+ amdgpu_bo_unreserve(queue->db_obj.obj);
733+ amdgpu_bo_unref(&queue->db_obj.obj);
734+free_fence_drv:
864735 amdgpu_userq_fence_driver_free(queue);
865−clean_mapping:
866− amdgpu_bo_reserve(fpriv->vm.root.bo, true);
867− amdgpu_userq_buffer_vas_list_cleanup(adev, queue);
868− amdgpu_bo_unreserve(fpriv->vm.root.bo);
869736 free_queue:
870737 kfree(queue);
871738 err_pm_runtime:
@@ -1187,7 +1054,7 @@ retry_lock: · 315 unmodified lines
11871054 bo = range->bo;
11881055 ret = amdgpu_ttm_tt_get_user_pages(bo, range);
11891056 if (ret)
1190− goto unlock_all;
1057+ goto free_ranges;
11911058 }
11921059
11931060 invalidated = true;
@@ -1214,6 +1081,7 @@ retry_lock: · 20 unmodified lines
12141081
12151082 unlock_all:
12161083 drm_exec_fini(&exec);
1084+free_ranges:
12171085 xa_for_each(&xa, tmp_key, range) {
12181086 if (!range)
12191087 continue;
@@ -1254,7 +1122,6 @@ amdgpu_userq_evict_all(struct amdgpu_userq_mgr *uq_mgr) · 34 unmodified lines
12541122 unsigned long queue_id;
12551123 int ret = 0, r;
12561124
1257− amdgpu_userq_detect_and_reset_queues(uq_mgr);
12581125 /* Try to unmap all the queues in this process ctx */
12591126 xa_for_each(&uq_mgr->userq_xa, queue_id, queue) {
12601127 r = amdgpu_userq_preempt_helper(queue);
@@ -1262,29 +1129,16 @@ amdgpu_userq_evict_all(struct amdgpu_userq_mgr *uq_mgr) · 1 unmodified line
12621129 ret = r;
12631130 }
12641131
1265− if (ret)
1132+ if (ret) {
12661133 drm_file_err(uq_mgr->file,
12671134 "Couldn't unmap all the queues, eviction failed ret=%d\n", ret);
1135+ amdgpu_reset_domain_schedule(uq_mgr->adev->reset_domain,
1136+ &uq_mgr->reset_work);
1137+ flush_work(&uq_mgr->reset_work);
1138+ }
12681139 return ret;
12691140 }
12701141
1271−void amdgpu_userq_reset_work(struct work_struct *work)
1272−{
1273− struct amdgpu_device *adev = container_of(work, struct amdgpu_device,
1274− userq_reset_work);
1275− struct amdgpu_reset_context reset_context;
1276−
1277− memset(&reset_context, 0, sizeof(reset_context));
1278−
1279− reset_context.method = AMD_RESET_METHOD_NONE;
1280− reset_context.reset_req_dev = adev;
1281− reset_context.src = AMDGPU_RESET_SRC_USERQ;
1282− set_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags);
1283− /*set_bit(AMDGPU_SKIP_COREDUMP, &reset_context.flags);*/
1284−
1285− amdgpu_device_gpu_recover(adev, NULL, &reset_context);
1286−}
1287−
12881142 static void
12891143 amdgpu_userq_wait_for_signal(struct amdgpu_userq_mgr *uq_mgr)
12901144 {
@@ -1318,9 +1172,24 @@ int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *f · 27 unmodified lines
13181172 userq_mgr->file = file_priv;
13191173
13201174 INIT_DELAYED_WORK(&userq_mgr->resume_work, amdgpu_userq_restore_worker);
1175+ INIT_WORK(&userq_mgr->reset_work, amdgpu_userq_mgr_reset_work);
13211176 return 0;
13221177 }
13231178
1179+void amdgpu_userq_mgr_cancel_reset_work(struct amdgpu_device *adev)
1180+{
1181+ struct xarray *xa = &adev->userq_doorbell_xa;
1182+ struct amdgpu_usermode_queue *queue;
1183+ unsigned long flags, queue_id;
1184+
1185+ xa_lock_irqsave(xa, flags);
1186+ xa_for_each(xa, queue_id, queue) {
1187+ cancel_delayed_work(&queue->hang_detect_work);
1188+ cancel_work(&queue->userq_mgr->reset_work);
1189+ }
1190+ xa_unlock_irqrestore(xa, flags);
1191+}
1192+
13241193 void amdgpu_userq_mgr_cancel_resume(struct amdgpu_userq_mgr *userq_mgr)
13251194 {
13261195 cancel_delayed_work_sync(&userq_mgr->resume_work);
@@ -1346,6 +1215,14 @@ void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr) · 19 unmodified lines
13461215 }
13471216
13481217 xa_destroy(&userq_mgr->userq_xa);
1218+
1219+ /*
1220+ * Drain any in-flight reset_work. By this point all queues are freed
1221+ * and userq_count is 0, so if reset_work starts now it exits early.
1222+ * We still need to wait in case it was already executing gpu_recover.
1223+ */
1224+ cancel_work_sync(&userq_mgr->reset_work);
1225+
13491226 mutex_destroy(&userq_mgr->userq_mutex);
13501227 }
13511228
@@ -1364,7 +1241,6 @@ int amdgpu_userq_suspend(struct amdgpu_device *adev) · 12 unmodified lines
13641241 uqm = queue->userq_mgr;
13651242 cancel_delayed_work_sync(&uqm->resume_work);
13661243 guard(mutex)(&uqm->userq_mutex);
1367− amdgpu_userq_detect_and_reset_queues(uqm);
13681244 if (adev->in_s0ix)
13691245 r = amdgpu_userq_preempt_helper(queue);
13701246 else
@@ -1423,7 +1299,6 @@ int amdgpu_userq_stop_sched_for_enforce_isolation(struct amdgpu_device *adev, · 52 unmodified lines
14231299 if (((queue->queue_type == AMDGPU_HW_IP_GFX) ||
14241300 (queue->queue_type == AMDGPU_HW_IP_COMPUTE)) &&
14251301 (queue->xcp_id == idx)) {
1426− amdgpu_userq_detect_and_reset_queues(uqm);
14271302 r = amdgpu_userq_preempt_helper(queue);
14281303 if (r)
14291304 ret = r;
@@ -1496,23 +1371,21 @@ void amdgpu_userq_pre_reset(struct amdgpu_device *adev) · 66 unmodified lines
14961371 {
14971372 const struct amdgpu_userq_funcs *userq_funcs;
14981373 struct amdgpu_usermode_queue *queue;
1499− struct amdgpu_userq_mgr *uqm;
15001374 unsigned long queue_id;
15011375
1376+ /* TODO: We probably need a new lock for the queue state */
15021377 xa_for_each(&adev->userq_doorbell_xa, queue_id, queue) {
1503− uqm = queue->userq_mgr;
1504− cancel_delayed_work_sync(&uqm->resume_work);
1505− if (queue->state == AMDGPU_USERQ_STATE_MAPPED) {
1506− amdgpu_userq_wait_for_last_fence(queue);
1507− userq_funcs = adev->userq_funcs[queue->queue_type];
1508− userq_funcs->unmap(queue);
1509− /* just mark all queues as hung at this point.
1510− * if unmap succeeds, we could map again
1511− * in amdgpu_userq_post_reset() if vram is not lost
1512− */
1513− queue->state = AMDGPU_USERQ_STATE_HUNG;
1514− amdgpu_userq_fence_driver_force_completion(queue);
1515− }
1378+ if (queue->state != AMDGPU_USERQ_STATE_MAPPED)
1379+ continue;
1380+
1381+ userq_funcs = adev->userq_funcs[queue->queue_type];
1382+ userq_funcs->unmap(queue);
1383+ /* just mark all queues as hung at this point.
1384+ * if unmap succeeds, we could map again
1385+ * in amdgpu_userq_post_reset() if vram is not lost
1386+ */
1387+ queue->state = AMDGPU_USERQ_STATE_HUNG;
1388+ amdgpu_userq_fence_driver_force_completion(queue);
15161389 }
15171390 }
15181391
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h+41−20
@@ -48,11 +48,6 @@ struct amdgpu_userq_obj { · 47 unmodified lines
4848 struct amdgpu_bo *obj;
4949 };
5050
51−struct amdgpu_userq_va_cursor {
52− u64 gpu_addr;
53− struct list_head list;
54−};
55−
5651 struct amdgpu_usermode_queue {
5752 int queue_type;
5853 enum amdgpu_userq_state state;
@@ -66,17 +61,44 @@ struct amdgpu_usermode_queue { · 7 unmodified lines
6661 struct amdgpu_userq_obj db_obj;
6762 struct amdgpu_userq_obj fw_obj;
6863 struct amdgpu_userq_obj wptr_obj;
64+
65+ /**
66+ * @fence_drv_lock: Protecting @fence_drv_xa.
67+ */
68+ struct mutex fence_drv_lock;
69+
70+ /**
71+ * @fence_drv_xa:
72+ *
73+ * References to the external fence drivers returned by wait_ioctl.
74+ * Dropped on the next signaled dma_fence or queue destruction.
75+ */
6976 struct xarray fence_drv_xa;
7077 struct amdgpu_userq_fence_driver *fence_drv;
7178 struct dma_fence *last_fence;
7279 u32 xcp_id;
7380 int priority;
7481 struct dentry *debugfs_queue;
75− struct delayed_work hang_detect_work;
76− struct dma_fence *hang_detect_fence;
82+
83+ /**
84+ * @hang_detect_work:
85+ *
86+ * Delayed work which runs when userq_fences time out.
87+ */
88+ struct delayed_work hang_detect_work;
7789 struct kref refcount;
7890
79− struct list_head userq_va_list;
91+ union {
92+ struct {
93+ u64 queue_rb;
94+ u64 wptr;
95+ u64 rptr;
96+ u64 eop;
97+ u64 shadow;
98+ u64 csa;
99+ } va;
100+ u64 va_array[6];
101+ } userq_vas;
80102 };
81103
82104 struct amdgpu_userq_funcs {
@@ -105,6 +127,13 @@ struct amdgpu_userq_mgr { · 22 unmodified lines
105127 struct amdgpu_device *adev;
106128 struct delayed_work resume_work;
107129 struct drm_file *file;
130+
131+ /**
132+ * @reset_work:
133+ *
134+ * Reset work which is used when eviction fails.
135+ */
136+ struct work_struct reset_work;
108137 atomic_t userq_count[AMDGPU_RING_TYPE_MAX];
109138 };
110139
@@ -123,25 +152,15 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data, struct drm_file *filp · 12 unmodified lines
123152 int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *file_priv,
124153 struct amdgpu_device *adev);
125154
155+void amdgpu_userq_mgr_cancel_reset_work(struct amdgpu_device *adev);
126156 void amdgpu_userq_mgr_cancel_resume(struct amdgpu_userq_mgr *userq_mgr);
127157 void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr);
128158
129−int amdgpu_userq_create_object(struct amdgpu_userq_mgr *uq_mgr,
130− struct amdgpu_userq_obj *userq_obj,
131− int size);
132−
133−void amdgpu_userq_destroy_object(struct amdgpu_userq_mgr *uq_mgr,
134− struct amdgpu_userq_obj *userq_obj);
135−
136159 void amdgpu_userq_evict(struct amdgpu_userq_mgr *uq_mgr);
137160
138161 void amdgpu_userq_ensure_ev_fence(struct amdgpu_userq_mgr *userq_mgr,
139162 struct amdgpu_eviction_fence_mgr *evf_mgr);
140163
141−uint64_t amdgpu_userq_get_doorbell_index(struct amdgpu_userq_mgr *uq_mgr,
142− struct amdgpu_db_info *db_info,
143− struct drm_file *filp);
144−
145164 u32 amdgpu_userq_get_supported_ip_mask(struct amdgpu_device *adev);
146165 bool amdgpu_userq_enabled(struct drm_device *dev);
147166
@@ -156,10 +175,12 @@ void amdgpu_userq_reset_work(struct work_struct *work); · 8 unmodified lines
156175 void amdgpu_userq_pre_reset(struct amdgpu_device *adev);
157176 int amdgpu_userq_post_reset(struct amdgpu_device *adev, bool vram_lost);
158177 void amdgpu_userq_start_hang_detect_work(struct amdgpu_usermode_queue *queue);
178+void amdgpu_userq_process_fence_irq(struct amdgpu_device *adev, u32 doorbell);
159179
160180 int amdgpu_userq_input_va_validate(struct amdgpu_device *adev,
161181 struct amdgpu_usermode_queue *queue,
162− u64 addr, u64 expected_size);
182+ u64 addr, u64 expected_size, u64 *va_out);
183+
163184 void amdgpu_userq_gem_va_unmap_validate(struct amdgpu_device *adev,
164185 struct amdgpu_bo_va_mapping *mapping,
165186 uint64_t saddr);
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c+146−176
@@ -32,29 +32,9 @@ · 31 unmodified lines
3232 #include "amdgpu.h"
3333 #include "amdgpu_userq_fence.h"
3434
35−static const struct dma_fence_ops amdgpu_userq_fence_ops;
36−static struct kmem_cache *amdgpu_userq_fence_slab;
37−
3835 #define AMDGPU_USERQ_MAX_HANDLES (1U << 16)
3936
40−int amdgpu_userq_fence_slab_init(void)
41−{
42− amdgpu_userq_fence_slab = kmem_cache_create("amdgpu_userq_fence",
43− sizeof(struct amdgpu_userq_fence),
44− 0,
45− SLAB_HWCACHE_ALIGN,
46− NULL);
47− if (!amdgpu_userq_fence_slab)
48− return -ENOMEM;
49−
50− return 0;
51−}
52−
53−void amdgpu_userq_fence_slab_fini(void)
54−{
55− rcu_barrier();
56− kmem_cache_destroy(amdgpu_userq_fence_slab);
57−}
37+static const struct dma_fence_ops amdgpu_userq_fence_ops;
5838
5939 static inline struct amdgpu_userq_fence *to_amdgpu_userq_fence(struct dma_fence *f)
6040 {
@@ -141,6 +121,7 @@ amdgpu_userq_fence_driver_free(struct amdgpu_usermode_queue *userq) · 80 unmodified lines
141121 userq->last_fence = NULL;
142122 amdgpu_userq_walk_and_drop_fence_drv(&userq->fence_drv_xa);
143123 xa_destroy(&userq->fence_drv_xa);
124+ mutex_destroy(&userq->fence_drv_lock);
144125 /* Drop the queue's ownership reference to fence_drv explicitly */
145126 amdgpu_userq_fence_driver_put(userq->fence_drv);
146127 }
@@ -154,7 +135,14 @@ amdgpu_userq_fence_put_fence_drv_array(struct amdgpu_userq_fence *userq_fence) · 7 unmodified lines
154135 userq_fence->fence_drv_array_count = 0;
155136 }
156137
157−void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_drv)
138+/*
139+ * Returns:
140+ * -ENOENT when no fences were processes
141+ * 1 when more fences are pending
142+ * 0 when no fences are pending any more
143+ */
144+int
145+amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_drv)
158146 {
159147 struct amdgpu_userq_fence *userq_fence, *tmp;
160148 LIST_HEAD(to_be_signaled);
@@ -162,9 +150,6 @@ void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_d · 1 unmodified line
162150 unsigned long flags;
163151 u64 rptr;
164152
165− if (!fence_drv)
166− return;
167−
168153 spin_lock_irqsave(&fence_drv->fence_list_lock, flags);
169154 rptr = amdgpu_userq_fence_read(fence_drv);
170155
@@ -177,6 +162,9 @@ void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_d · 6 unmodified lines
177162 &userq_fence->link);
178163 spin_unlock_irqrestore(&fence_drv->fence_list_lock, flags);
179164
165+ if (list_empty(&to_be_signaled))
166+ return -ENOENT;
167+
180168 list_for_each_entry_safe(userq_fence, tmp, &to_be_signaled, link) {
181169 fence = &userq_fence->base;
182170 list_del_init(&userq_fence->link);
@@ -188,6 +176,8 @@ void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_d · 5 unmodified lines
188176 dma_fence_put(fence);
189177 }
190178
179+ /* That doesn't need to be accurate so no locking */
180+ return list_empty(&fence_drv->fences) ? 0 : 1;
191181 }
192182
193183 void amdgpu_userq_fence_driver_destroy(struct kref *ref)
@@ -229,80 +219,84 @@ void amdgpu_userq_fence_driver_put(struct amdgpu_userq_fence_driver *fence_drv) · 35 unmodified lines
229219 kref_put(&fence_drv->refcount, amdgpu_userq_fence_driver_destroy);
230220 }
231221
232−static int amdgpu_userq_fence_alloc(struct amdgpu_userq_fence **userq_fence)
222+static int amdgpu_userq_fence_alloc(struct amdgpu_usermode_queue *userq,
223+ struct amdgpu_userq_fence **pfence)
233224 {
234− *userq_fence = kmem_cache_alloc(amdgpu_userq_fence_slab, GFP_ATOMIC);
235− return *userq_fence ? 0 : -ENOMEM;
225+ struct amdgpu_userq_fence_driver *fence_drv = userq->fence_drv;
226+ struct amdgpu_userq_fence *userq_fence;
227+ void *entry;
228+
229+ userq_fence = kmalloc(sizeof(*userq_fence), GFP_KERNEL);
230+ if (!userq_fence)
231+ return -ENOMEM;
232+
233+ /*
234+ * Get the next unused entry, since we fill from the start this can be
235+ * used as size to allocate the array.
236+ */
237+ mutex_lock(&userq->fence_drv_lock);
238+ XA_STATE(xas, &userq->fence_drv_xa, 0);
239+
240+ rcu_read_lock();
241+ do {
242+ entry = xas_find_marked(&xas, ULONG_MAX, XA_FREE_MARK);
243+ } while (xas_retry(&xas, entry));
244+ rcu_read_unlock();
245+
246+ userq_fence->fence_drv_array = kvmalloc_array(xas.xa_index,
247+ sizeof(fence_drv),
248+ GFP_KERNEL);
249+ if (!userq_fence->fence_drv_array) {
250+ mutex_unlock(&userq->fence_drv_lock);
251+ kfree(userq_fence);
252+ return -ENOMEM;
253+ }
254+
255+ userq_fence->fence_drv_array_count = xas.xa_index;
256+ xa_extract(&userq->fence_drv_xa, (void **)userq_fence->fence_drv_array,
257+ 0, ULONG_MAX, xas.xa_index, XA_PRESENT);
258+ xa_destroy(&userq->fence_drv_xa);
259+
260+ mutex_unlock(&userq->fence_drv_lock);
261+
262+ amdgpu_userq_fence_driver_get(fence_drv);
263+ userq_fence->fence_drv = fence_drv;
264+
265+ *pfence = userq_fence;
266+ return 0;
236267 }
237268
238−static int amdgpu_userq_fence_create(struct amdgpu_usermode_queue *userq,
239− struct amdgpu_userq_fence *userq_fence,
240− u64 seq, struct dma_fence **f)
269+static void amdgpu_userq_fence_init(struct amdgpu_usermode_queue *userq,
270+ struct amdgpu_userq_fence *fence,
271+ u64 seq)
241272 {
242− struct amdgpu_userq_fence_driver *fence_drv;
243− struct dma_fence *fence;
273+ struct amdgpu_userq_fence_driver *fence_drv = userq->fence_drv;
244274 unsigned long flags;
245275 bool signaled = false;
246276
247− fence_drv = userq->fence_drv;
248− if (!fence_drv)
249− return -EINVAL;
250−
251− spin_lock_init(&userq_fence->lock);
252− INIT_LIST_HEAD(&userq_fence->link);
253− fence = &userq_fence->base;
254− userq_fence->fence_drv = fence_drv;
255−
256− dma_fence_init64(fence, &amdgpu_userq_fence_ops, &userq_fence->lock,
277+ spin_lock_init(&fence->lock);
278+ dma_fence_init64(&fence->base, &amdgpu_userq_fence_ops, &fence->lock,
257279 fence_drv->context, seq);
258280
259− amdgpu_userq_fence_driver_get(fence_drv);
260− dma_fence_get(fence);
261−
262− if (!xa_empty(&userq->fence_drv_xa)) {
263− struct amdgpu_userq_fence_driver *stored_fence_drv;
264− unsigned long index, count = 0;
265− int i = 0;
266−
267− xa_lock(&userq->fence_drv_xa);
268− xa_for_each(&userq->fence_drv_xa, index, stored_fence_drv)
269− count++;
270−
271− userq_fence->fence_drv_array =
272− kvmalloc_objs(struct amdgpu_userq_fence_driver *, count,
273− GFP_ATOMIC);
274−
275− if (userq_fence->fence_drv_array) {
276− xa_for_each(&userq->fence_drv_xa, index, stored_fence_drv) {
277− userq_fence->fence_drv_array[i] = stored_fence_drv;
278− __xa_erase(&userq->fence_drv_xa, index);
279− i++;
280− }
281− }
282−
283− userq_fence->fence_drv_array_count = i;
284− xa_unlock(&userq->fence_drv_xa);
285− } else {
286− userq_fence->fence_drv_array = NULL;
287− userq_fence->fence_drv_array_count = 0;
288− }
281+ /* Make sure the fence is visible to the hang detect worker */
282+ dma_fence_put(userq->last_fence);
283+ userq->last_fence = dma_fence_get(&fence->base);
289284
290− /* Check if hardware has already processed the job */
285+ /* Check if hardware has already processed the fence */
291286 spin_lock_irqsave(&fence_drv->fence_list_lock, flags);
292− if (!dma_fence_is_signaled(fence)) {
293− list_add_tail(&userq_fence->link, &fence_drv->fences);
287+ if (!dma_fence_is_signaled(&fence->base)) {
288+ dma_fence_get(&fence->base);
289+ list_add_tail(&fence->link, &fence_drv->fences);
294290 } else {
291+ INIT_LIST_HEAD(&fence->link);
295292 signaled = true;
296− dma_fence_put(fence);
297293 }
298294 spin_unlock_irqrestore(&fence_drv->fence_list_lock, flags);
299295
300296 if (signaled)
301− amdgpu_userq_fence_put_fence_drv_array(userq_fence);
302−
303− *f = fence;
304−
305− return 0;
297+ amdgpu_userq_fence_put_fence_drv_array(fence);
298+ else
299+ amdgpu_userq_start_hang_detect_work(userq);
306300 }
307301
308302 static const char *amdgpu_userq_fence_get_driver_name(struct dma_fence *f)
@@ -342,7 +336,7 @@ static void amdgpu_userq_fence_free(struct rcu_head *rcu) · 33 unmodified lines
342336 amdgpu_userq_fence_driver_put(fence_drv);
343337
344338 kvfree(userq_fence->fence_drv_array);
345− kmem_cache_free(amdgpu_userq_fence_slab, userq_fence);
339+ kfree(userq_fence);
346340 }
347341
348342 static void amdgpu_userq_fence_release(struct dma_fence *f)
@@ -376,56 +370,48 @@ static int amdgpu_userq_fence_read_wptr(struct amdgpu_device *adev, · 27 unmodified lines
376370 {
377371 struct amdgpu_bo_va_mapping *mapping;
378372 struct amdgpu_bo *bo;
373+ struct drm_exec exec;
379374 u64 addr, *ptr;
380− int r;
381−
382− r = amdgpu_bo_reserve(queue->vm->root.bo, false);
383− if (r)
384− return r;
375+ int ret;
385376
386377 addr = queue->userq_prop->wptr_gpu_addr;
387378 addr &= AMDGPU_GMC_HOLE_MASK;
388379
389− mapping = amdgpu_vm_bo_lookup_mapping(queue->vm, addr >> PAGE_SHIFT);
390− if (!mapping) {
391− amdgpu_bo_unreserve(queue->vm->root.bo);
392− DRM_ERROR("Failed to lookup amdgpu_bo_va_mapping\n");
393− return -EINVAL;
394− }
380+ drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 2);
381+ drm_exec_until_all_locked(&exec) {
382+ ret = amdgpu_vm_lock_pd(queue->vm, &exec, 1);
383+ drm_exec_retry_on_contention(&exec);
384+ if (unlikely(ret))
385+ goto lock_error;
386+
387+ mapping = amdgpu_vm_bo_lookup_mapping(queue->vm, addr >> PAGE_SHIFT);
388+ if (!mapping) {
389+ ret = -EINVAL;
390+ goto lock_error;
391+ }
395392
396− bo = amdgpu_bo_ref(mapping->bo_va->base.bo);
397− amdgpu_bo_unreserve(queue->vm->root.bo);
398− r = amdgpu_bo_reserve(bo, true);
399− if (r) {
400− amdgpu_bo_unref(&bo);
401− DRM_ERROR("Failed to reserve userqueue wptr bo");
402− return r;
393+ ret = drm_exec_lock_obj(&exec, &mapping->bo_va->base.bo->tbo.base);
394+ drm_exec_retry_on_contention(&exec);
395+ if (unlikely(ret))
396+ goto lock_error;
403397 }
404398
405− r = amdgpu_bo_kmap(bo, (void **)&ptr);
406− if (r) {
399+ bo = mapping->bo_va->base.bo;
400+ ret = amdgpu_bo_kmap(bo, (void **)&ptr);
401+ if (ret) {
407402 DRM_ERROR("Failed mapping the userqueue wptr bo");
408− goto map_error;
403+ goto lock_error;
409404 }
410405
411406 *wptr = le64_to_cpu(*ptr);
412407
413408 amdgpu_bo_kunmap(bo);
414− amdgpu_bo_unreserve(bo);
415− amdgpu_bo_unref(&bo);
416−
409+ drm_exec_fini(&exec);
417410 return 0;
418411
419−map_error:
420− amdgpu_bo_unreserve(bo);
421− amdgpu_bo_unref(&bo);
422−
423− return r;
424−}
425−
426−static void amdgpu_userq_fence_cleanup(struct dma_fence *fence)
427−{
428− dma_fence_put(fence);
412+lock_error:
413+ drm_exec_fini(&exec);
414+ return ret;
429415 }
430416
431417 static void
@@ -471,13 +457,14 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 39 unmodified lines
471457 const unsigned int num_read_bo_handles = args->num_bo_read_handles;
472458 struct amdgpu_fpriv *fpriv = filp->driver_priv;
473459 struct amdgpu_userq_mgr *userq_mgr = &fpriv->userq_mgr;
460+
474461 struct drm_gem_object **gobj_write, **gobj_read;
475462 u32 *syncobj_handles, num_syncobj_handles;
476− struct amdgpu_userq_fence *userq_fence;
477− struct amdgpu_usermode_queue *queue = NULL;
478− struct drm_syncobj **syncobj = NULL;
479− struct dma_fence *fence;
463+ struct amdgpu_usermode_queue *queue;
464+ struct amdgpu_userq_fence *fence;
465+ struct drm_syncobj **syncobj;
480466 struct drm_exec exec;
467+ void __user *ptr;
481468 int r, i, entry;
482469 u64 wptr;
483470
@@ -489,13 +476,14 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 5 unmodified lines
489476 return -EINVAL;
490477
491478 num_syncobj_handles = args->num_syncobj_handles;
492− syncobj_handles = memdup_array_user(u64_to_user_ptr(args->syncobj_handles),
493− num_syncobj_handles, sizeof(u32));
479+ ptr = u64_to_user_ptr(args->syncobj_handles);
480+ syncobj_handles = memdup_array_user(ptr, num_syncobj_handles,
481+ sizeof(u32));
494482 if (IS_ERR(syncobj_handles))
495483 return PTR_ERR(syncobj_handles);
496484
497− /* Array of pointers to the looked up syncobjs */
498− syncobj = kmalloc_array(num_syncobj_handles, sizeof(*syncobj), GFP_KERNEL);
485+ syncobj = kmalloc_array(num_syncobj_handles, sizeof(*syncobj),
486+ GFP_KERNEL);
499487 if (!syncobj) {
500488 r = -ENOMEM;
501489 goto free_syncobj_handles;
@@ -509,21 +497,17 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 7 unmodified lines
509497 }
510498 }
511499
512− r = drm_gem_objects_lookup(filp,
513− u64_to_user_ptr(args->bo_read_handles),
514− num_read_bo_handles,
515− &gobj_read);
500+ ptr = u64_to_user_ptr(args->bo_read_handles);
501+ r = drm_gem_objects_lookup(filp, ptr, num_read_bo_handles, &gobj_read);
516502 if (r)
517503 goto free_syncobj;
518504
519− r = drm_gem_objects_lookup(filp,
520− u64_to_user_ptr(args->bo_write_handles),
521− num_write_bo_handles,
505+ ptr = u64_to_user_ptr(args->bo_write_handles);
506+ r = drm_gem_objects_lookup(filp, ptr, num_write_bo_handles,
522507 &gobj_write);
523508 if (r)
524509 goto put_gobj_read;
525510
526− /* Retrieve the user queue */
527511 queue = amdgpu_userq_get(userq_mgr, args->queue_id);
528512 if (!queue) {
529513 r = -ENOENT;
@@ -532,73 +516,61 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · 2 unmodified lines
532516
533517 r = amdgpu_userq_fence_read_wptr(adev, queue, &wptr);
534518 if (r)
535− goto put_gobj_write;
519+ goto put_queue;
536520
537− r = amdgpu_userq_fence_alloc(&userq_fence);
521+ r = amdgpu_userq_fence_alloc(queue, &fence);
538522 if (r)
539− goto put_gobj_write;
523+ goto put_queue;
540524
541525 /* We are here means UQ is active, make sure the eviction fence is valid */
542526 amdgpu_userq_ensure_ev_fence(&fpriv->userq_mgr, &fpriv->evf_mgr);
543527
544− /* Create a new fence */
545− r = amdgpu_userq_fence_create(queue, userq_fence, wptr, &fence);
546− if (r) {
547− mutex_unlock(&userq_mgr->userq_mutex);
548− kmem_cache_free(amdgpu_userq_fence_slab, userq_fence);
549− goto put_gobj_write;
550− }
528+ /* Create the new fence */
529+ amdgpu_userq_fence_init(queue, fence, wptr);
551530
552− dma_fence_put(queue->last_fence);
553− queue->last_fence = dma_fence_get(fence);
554− amdgpu_userq_start_hang_detect_work(queue);
555531 mutex_unlock(&userq_mgr->userq_mutex);
556532
533+ /*
534+ * This needs to come after the fence is created since
535+ * amdgpu_userq_ensure_ev_fence() can't be called while holding the resv
536+ * locks.
537+ */
557538 drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT,
558539 (num_read_bo_handles + num_write_bo_handles));
559540
560− /* Lock all BOs with retry handling */
561541 drm_exec_until_all_locked(&exec) {
562− r = drm_exec_prepare_array(&exec, gobj_read, num_read_bo_handles, 1);
542+ r = drm_exec_prepare_array(&exec, gobj_read,
543+ num_read_bo_handles, 1);
563544 drm_exec_retry_on_contention(&exec);
564− if (r) {
565− amdgpu_userq_fence_cleanup(fence);
545+ if (r)
566546 goto exec_fini;
567− }
568547
569− r = drm_exec_prepare_array(&exec, gobj_write, num_write_bo_handles, 1);
548+ r = drm_exec_prepare_array(&exec, gobj_write,
549+ num_write_bo_handles, 1);
570550 drm_exec_retry_on_contention(&exec);
571− if (r) {
572− amdgpu_userq_fence_cleanup(fence);
551+ if (r)
573552 goto exec_fini;
574− }
575553 }
576554
577− for (i = 0; i < num_read_bo_handles; i++) {
578− if (!gobj_read || !gobj_read[i]->resv)
579− continue;
580−
581− dma_resv_add_fence(gobj_read[i]->resv, fence,
555+ /* And publish the new fence in the BOs and syncobj */
556+ for (i = 0; i < num_read_bo_handles; i++)
557+ dma_resv_add_fence(gobj_read[i]->resv, &fence->base,
582558 DMA_RESV_USAGE_READ);
583− }
584559
585− for (i = 0; i < num_write_bo_handles; i++) {
586− if (!gobj_write || !gobj_write[i]->resv)
587− continue;
588−
589− dma_resv_add_fence(gobj_write[i]->resv, fence,
560+ for (i = 0; i < num_write_bo_handles; i++)
561+ dma_resv_add_fence(gobj_write[i]->resv, &fence->base,
590562 DMA_RESV_USAGE_WRITE);
591− }
592563
593− /* Add the created fence to syncobj/BO's */
594564 for (i = 0; i < num_syncobj_handles; i++)
595− drm_syncobj_replace_fence(syncobj[i], fence);
565+ drm_syncobj_replace_fence(syncobj[i], &fence->base);
596566
567+exec_fini:
597568 /* drop the reference acquired in fence creation function */
598− dma_fence_put(fence);
569+ dma_fence_put(&fence->base);
599570
600−exec_fini:
601571 drm_exec_fini(&exec);
572+put_queue:
573+ amdgpu_userq_put(queue);
602574 put_gobj_write:
603575 for (i = 0; i < num_write_bo_handles; i++)
604576 drm_gem_object_put(gobj_write[i]);
@@ -609,15 +581,11 @@ put_gobj_read: · 4 unmodified lines
609581 kvfree(gobj_read);
610582 free_syncobj:
611583 while (entry-- > 0)
612− if (syncobj[entry])
613− drm_syncobj_put(syncobj[entry]);
584+ drm_syncobj_put(syncobj[entry]);
614585 kfree(syncobj);
615586 free_syncobj_handles:
616587 kfree(syncobj_handles);
617588
618− if (queue)
619− amdgpu_userq_put(queue);
620−
621589 return r;
622590 }
623591
@@ -892,8 +860,10 @@ amdgpu_userq_wait_return_fence_info(struct drm_file *filp, · 268 unmodified lines
892860 * Otherwise, we would gather those references until we don't
893861 * have any more space left and crash.
894862 */
863+ mutex_lock(&waitq->fence_drv_lock);
895864 r = xa_alloc(&waitq->fence_drv_xa, &index, fence_drv,
896865 xa_limit_32b, GFP_KERNEL);
866+ mutex_unlock(&waitq->fence_drv_lock);
897867 if (r)
898868 goto put_waitq;
899869
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.h+1−4
@@ -58,15 +58,12 @@ struct amdgpu_userq_fence_driver { · 57 unmodified lines
5858 char timeline_name[TASK_COMM_LEN];
5959 };
6060
61−int amdgpu_userq_fence_slab_init(void);
62−void amdgpu_userq_fence_slab_fini(void);
63−
6461 void amdgpu_userq_fence_driver_get(struct amdgpu_userq_fence_driver *fence_drv);
6562 void amdgpu_userq_fence_driver_put(struct amdgpu_userq_fence_driver *fence_drv);
6663 int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev,
6764 struct amdgpu_userq_fence_driver **fence_drv_req);
6865 void amdgpu_userq_fence_driver_free(struct amdgpu_usermode_queue *userq);
69−void amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_drv);
66+int amdgpu_userq_fence_driver_process(struct amdgpu_userq_fence_driver *fence_drv);
7067 void amdgpu_userq_fence_driver_force_completion(struct amdgpu_usermode_queue *userq);
7168 void amdgpu_userq_fence_driver_destroy(struct kref *ref);
7269 int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data,
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+20−6
@@ -1631,6 +1631,7 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev, · 1630 unmodified lines
16311631 {
16321632 struct amdgpu_bo_va *bo_va;
16331633 struct dma_resv *resv;
1634+ struct amdgpu_bo *bo;
16341635 bool clear, unlock;
16351636 int r;
16361637
@@ -1650,11 +1651,13 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev, · 13 unmodified lines
16501651 while (!list_empty(&vm->invalidated)) {
16511652 bo_va = list_first_entry(&vm->invalidated, struct amdgpu_bo_va,
16521653 base.vm_status);
1653− resv = bo_va->base.bo->tbo.base.resv;
1654+ bo = bo_va->base.bo;
1655+ resv = bo->tbo.base.resv;
16541656 spin_unlock(&vm->status_lock);
16551657
16561658 /* Try to reserve the BO to avoid clearing its ptes */
1657− if (!adev->debug_vm && dma_resv_trylock(resv)) {
1659+ if (!adev->debug_vm && !amdgpu_ttm_tt_get_usermm(bo->tbo.ttm) &&
1660+ dma_resv_trylock(resv)) {
16581661 clear = false;
16591662 unlock = true;
16601663 /* The caller is already holding the reservation lock */
@@ -2002,7 +2005,7 @@ int amdgpu_vm_bo_unmap(struct amdgpu_device *adev, · 341 unmodified lines
20022005 * during user requests GEM unmap IOCTL except for forcing the unmap
20032006 * from user space.
20042007 */
2005− if (unlikely(atomic_read(&bo_va->userq_va_mapped) > 0))
2008+ if (unlikely(bo_va->userq_va_mapped))
20062009 amdgpu_userq_gem_va_unmap_validate(adev, mapping, saddr);
20072010
20082011 list_del(&mapping->list);
@@ -3023,11 +3026,22 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid, · 1014 unmodified lines
30233026
30243027 is_compute_context = vm->is_compute_context;
30253028
3026− if (is_compute_context && !svm_range_restore_pages(adev, pasid, vmid,
3027− node_id, addr >> PAGE_SHIFT, ts, write_fault)) {
3029+ if (is_compute_context) {
3030+ /* Unreserve root since svm_range_restore_pages might try to reserve it. */
3031+ /* TODO: rework svm_range_restore_pages so that this isn't necessary. */
30283032 amdgpu_bo_unreserve(root);
3033+
3034+ if (!svm_range_restore_pages(adev, pasid, vmid,
3035+ node_id, addr >> PAGE_SHIFT, ts, write_fault)) {
3036+ amdgpu_bo_unref(&root);
3037+ return true;
3038+ }
30293039 amdgpu_bo_unref(&root);
3030− return true;
3040+
3041+ /* Re-acquire the VM lock, could be that the VM was freed in between. */
3042+ vm = amdgpu_vm_lock_by_pasid(adev, &root, pasid);
3043+ if (!vm)
3044+ return false;
30313045 }
30323046
30333047 addr /= AMDGPU_GPU_PAGE_SIZE;
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c+6−1
@@ -562,6 +562,11 @@ static void vpe_ring_emit_fence(struct amdgpu_ring *ring, uint64_t addr, · 561 unmodified lines
562562 amdgpu_ring_write(ring, 0);
563563 }
564564
565+ /* WA: Force sync after TRAP to avoid VPE1 fail to power off */
566+ if (ring->adev->vpe.collaborate_mode) {
567+ amdgpu_ring_write(ring, VPE_CMD_HEADER(VPE_CMD_OPCODE_COLLAB_SYNC, 0));
568+ amdgpu_ring_write(ring, 0xabcd);
569+ }
565570 }
566571
567572 static void vpe_ring_emit_pipeline_sync(struct amdgpu_ring *ring)
@@ -968,7 +973,7 @@ static const struct amdgpu_ring_funcs vpe_ring_funcs = { · 400 unmodified lines
968973 .emit_frame_size =
969974 5 + /* vpe_ring_init_cond_exec */
970975 6 + /* vpe_ring_emit_pipeline_sync */
971− 10 + 10 + 10 + /* vpe_ring_emit_fence */
976+ 12 + 12 + 12 + /* vpe_ring_emit_fence */
972977 /* vpe_ring_emit_vm_flush */
973978 SOC15_FLUSH_GPU_TLB_NUM_WREG * 3 +
974979 SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 6,
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+1−9
@@ -6523,15 +6523,7 @@ static int gfx_v11_0_eop_irq(struct amdgpu_device *adev, · 6522 unmodified lines
65236523 DRM_DEBUG("IH: CP EOP\n");
65246524
65256525 if (adev->enable_mes && doorbell_offset) {
6526− struct amdgpu_usermode_queue *queue;
6527− struct xarray *xa = &adev->userq_doorbell_xa;
6528− unsigned long flags;
6529−
6530− xa_lock_irqsave(xa, flags);
6531− queue = xa_load(xa, doorbell_offset);
6532− if (queue)
6533− amdgpu_userq_fence_driver_process(queue->fence_drv);
6534− xa_unlock_irqrestore(xa, flags);
6526+ amdgpu_userq_process_fence_irq(adev, doorbell_offset);
65356527 } else {
65366528 me_id = (entry->ring_id & 0x0c) >> 2;
65376529 pipe_id = (entry->ring_id & 0x03) >> 0;
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c+8−9
@@ -602,6 +602,13 @@ static int gfx_v12_0_init_microcode(struct amdgpu_device *adev) · 601 unmodified lines
602602 "amdgpu/%s_pfp.bin", ucode_prefix);
603603 if (err)
604604 goto out;
605+
606+ adev->gfx.rs64_enable = amdgpu_ucode_hdr_version(
607+ (union amdgpu_firmware_header *)
608+ adev->gfx.pfp_fw->data, 2, 0);
609+ if (adev->gfx.rs64_enable)
610+ dev_dbg(adev->dev, "CP RS64 enable\n");
611+
605612 amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_PFP);
606613 amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK);
607614
@@ -4854,15 +4861,7 @@ static int gfx_v12_0_eop_irq(struct amdgpu_device *adev, · 4246 unmodified lines
48544861 DRM_DEBUG("IH: CP EOP\n");
48554862
48564863 if (adev->enable_mes && doorbell_offset) {
4857− struct xarray *xa = &adev->userq_doorbell_xa;
4858− struct amdgpu_usermode_queue *queue;
4859− unsigned long flags;
4860−
4861− xa_lock_irqsave(xa, flags);
4862− queue = xa_load(xa, doorbell_offset);
4863− if (queue)
4864− amdgpu_userq_fence_driver_process(queue->fence_drv);
4865− xa_unlock_irqrestore(xa, flags);
4864+ amdgpu_userq_process_fence_irq(adev, doorbell_offset);
48664865 } else {
48674866 me_id = (entry->ring_id & 0x0c) >> 2;
48684867 pipe_id = (entry->ring_id & 0x03) >> 0;
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c+1−10
@@ -3643,16 +3643,7 @@ static int gfx_v12_1_eop_irq(struct amdgpu_device *adev, · 3642 unmodified lines
36433643 DRM_DEBUG("IH: CP EOP\n");
36443644
36453645 if (adev->enable_mes && doorbell_offset) {
3646− struct xarray *xa = &adev->userq_doorbell_xa;
3647− struct amdgpu_usermode_queue *queue;
3648− unsigned long flags;
3649−
3650− xa_lock_irqsave(xa, flags);
3651− queue = xa_load(xa, doorbell_offset);
3652− if (queue)
3653− amdgpu_userq_fence_driver_process(queue->fence_drv);
3654−
3655− xa_unlock_irqrestore(xa, flags);
3646+ amdgpu_userq_process_fence_irq(adev, doorbell_offset);
36563647 } else {
36573648 me_id = (entry->ring_id & 0x0c) >> 2;
36583649 pipe_id = (entry->ring_id & 0x03) >> 0;
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c+66−0
@@ -1571,6 +1571,71 @@ static void gfx_v6_0_setup_spi(struct amdgpu_device *adev) · 1570 unmodified lines
15711571 mutex_unlock(&adev->grbm_idx_mutex);
15721572 }
15731573
1574+/**
1575+ * gfx_v6_0_setup_tcc() - setup which TCCs are used
1576+ *
1577+ * @adev: amdgpu_device pointer
1578+ *
1579+ * Verify whether the current GPU has any TCCs disabled,
1580+ * which can happen when the GPU is harvested and some
1581+ * memory channels are disabled, reducing the memory bus width.
1582+ * For example, on the Radeon HD 7870 XT (Tahiti LE).
1583+ *
1584+ * If some TCCs are disabled, we need to make sure that
1585+ * the disabled TCCs are not used, and the remaining TCCs
1586+ * are used optimally.
1587+ *
1588+ * TCP_CHAN_STEER_LO/HI control which TCC is used by TCP channels.
1589+ * TCP_ADDR_CONFIG.NUM_TCC_BANKS controls how many channels are used.
1590+ *
1591+ * For optimal performance:
1592+ * - Rely on the CHAN_STEER from the golden registers table,
1593+ * only skip disabled TCCs but keep the mapping order.
1594+ * - Limit NUM_TCC_BANKS to number of active TCCs to avoid thrashing,
1595+ * which performs better than using the same TCC twice.
1596+ */
1597+static void gfx_v6_0_setup_tcc(struct amdgpu_device *adev)
1598+{
1599+ u32 i, tcc, tcp_addr_config, num_active_tcc = 0;
1600+ u64 chan_steer, patched_chan_steer = 0;
1601+ const u32 num_max_tcc = adev->gfx.config.max_texture_channel_caches;
1602+ const u32 dis_tcc_mask =
1603+ amdgpu_gfx_create_bitmask(num_max_tcc) &
1604+ (REG_GET_FIELD(RREG32(mmCGTS_TCC_DISABLE),
1605+ CGTS_TCC_DISABLE, TCC_DISABLE) |
1606+ REG_GET_FIELD(RREG32(mmCGTS_USER_TCC_DISABLE),
1607+ CGTS_USER_TCC_DISABLE, TCC_DISABLE));
1608+
1609+ /* When no TCC is disabled, the golden registers table already has optimal TCC setup */
1610+ if (!dis_tcc_mask)
1611+ return;
1612+
1613+ /* Each 4-bit nibble contains the index of a TCC used by all TCPs */
1614+ chan_steer = RREG32(mmTCP_CHAN_STEER_LO) | ((u64)RREG32(mmTCP_CHAN_STEER_HI) << 32ull);
1615+
1616+ /* Patch the TCP to TCC mapping to skip disabled TCCs */
1617+ for (i = 0; i < num_max_tcc; ++i) {
1618+ tcc = (chan_steer >> (u64)(4 * i)) & 0xf;
1619+
1620+ if (!((1 << tcc) & dis_tcc_mask)) {
1621+ /* Copy enabled TCC indices to the patched register value. */
1622+ patched_chan_steer |= (u64)tcc << (u64)(4 * num_active_tcc);
1623+ ++num_active_tcc;
1624+ }
1625+ }
1626+
1627+ WARN_ON(num_active_tcc != num_max_tcc - hweight32(dis_tcc_mask));
1628+
1629+ /* Patch number of TCCs used by TCPs */
1630+ tcp_addr_config = REG_SET_FIELD(RREG32(mmTCP_ADDR_CONFIG),
1631+ TCP_ADDR_CONFIG, NUM_TCC_BANKS,
1632+ num_active_tcc - 1);
1633+
1634+ WREG32(mmTCP_ADDR_CONFIG, tcp_addr_config);
1635+ WREG32(mmTCP_CHAN_STEER_HI, upper_32_bits(patched_chan_steer));
1636+ WREG32(mmTCP_CHAN_STEER_LO, lower_32_bits(patched_chan_steer));
1637+}
1638+
15741639 static void gfx_v6_0_config_init(struct amdgpu_device *adev)
15751640 {
15761641 adev->gfx.config.double_offchip_lds_buf = 0;
@@ -1729,6 +1794,7 @@ static void gfx_v6_0_constants_init(struct amdgpu_device *adev) · 152 unmodified lines
17291794 gfx_v6_0_tiling_mode_table_init(adev);
17301795
17311796 gfx_v6_0_setup_rb(adev);
1797+ gfx_v6_0_setup_tcc(adev);
17321798
17331799 gfx_v6_0_setup_spi(adev);
17341800
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+0−3
@@ -5660,9 +5660,6 @@ static void gfx_v9_0_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, · 5659 unmodified lines
56605660 {
56615661 struct amdgpu_device *adev = ring->adev;
56625662
5663− /* we only allocate 32bit for each seq wb address */
5664− BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT);
5665−
56665663 /* write fence seq to the "addr" */
56675664 amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
56685665 amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c+1−0
@@ -802,6 +802,7 @@ static const struct amd_ip_funcs jpeg_v2_0_ip_funcs = { · 801 unmodified lines
802802 static const struct amdgpu_ring_funcs jpeg_v2_0_dec_ring_vm_funcs = {
803803 .type = AMDGPU_RING_TYPE_VCN_JPEG,
804804 .align_mask = 0xf,
805+ .no_user_fence = true,
805806 .get_rptr = jpeg_v2_0_dec_ring_get_rptr,
806807 .get_wptr = jpeg_v2_0_dec_ring_get_wptr,
807808 .set_wptr = jpeg_v2_0_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c+2−0
@@ -693,6 +693,7 @@ static const struct amd_ip_funcs jpeg_v2_6_ip_funcs = { · 692 unmodified lines
693693 static const struct amdgpu_ring_funcs jpeg_v2_5_dec_ring_vm_funcs = {
694694 .type = AMDGPU_RING_TYPE_VCN_JPEG,
695695 .align_mask = 0xf,
696+ .no_user_fence = true,
696697 .get_rptr = jpeg_v2_5_dec_ring_get_rptr,
697698 .get_wptr = jpeg_v2_5_dec_ring_get_wptr,
698699 .set_wptr = jpeg_v2_5_dec_ring_set_wptr,
@@ -724,6 +725,7 @@ static const struct amdgpu_ring_funcs jpeg_v2_5_dec_ring_vm_funcs = { · 25 unmodified lines
724725 static const struct amdgpu_ring_funcs jpeg_v2_6_dec_ring_vm_funcs = {
725726 .type = AMDGPU_RING_TYPE_VCN_JPEG,
726727 .align_mask = 0xf,
728+ .no_user_fence = true,
727729 .get_rptr = jpeg_v2_5_dec_ring_get_rptr,
728730 .get_wptr = jpeg_v2_5_dec_ring_get_wptr,
729731 .set_wptr = jpeg_v2_5_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c+1−0
@@ -594,6 +594,7 @@ static const struct amd_ip_funcs jpeg_v3_0_ip_funcs = { · 593 unmodified lines
594594 static const struct amdgpu_ring_funcs jpeg_v3_0_dec_ring_vm_funcs = {
595595 .type = AMDGPU_RING_TYPE_VCN_JPEG,
596596 .align_mask = 0xf,
597+ .no_user_fence = true,
597598 .get_rptr = jpeg_v3_0_dec_ring_get_rptr,
598599 .get_wptr = jpeg_v3_0_dec_ring_get_wptr,
599600 .set_wptr = jpeg_v3_0_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c+1−0
@@ -759,6 +759,7 @@ static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = { · 758 unmodified lines
759759 static const struct amdgpu_ring_funcs jpeg_v4_0_dec_ring_vm_funcs = {
760760 .type = AMDGPU_RING_TYPE_VCN_JPEG,
761761 .align_mask = 0xf,
762+ .no_user_fence = true,
762763 .get_rptr = jpeg_v4_0_dec_ring_get_rptr,
763764 .get_wptr = jpeg_v4_0_dec_ring_get_wptr,
764765 .set_wptr = jpeg_v4_0_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c+1−0
@@ -1219,6 +1219,7 @@ static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = { · 1218 unmodified lines
12191219 static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
12201220 .type = AMDGPU_RING_TYPE_VCN_JPEG,
12211221 .align_mask = 0xf,
1222+ .no_user_fence = true,
12221223 .get_rptr = jpeg_v4_0_3_dec_ring_get_rptr,
12231224 .get_wptr = jpeg_v4_0_3_dec_ring_get_wptr,
12241225 .set_wptr = jpeg_v4_0_3_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c+1−0
@@ -804,6 +804,7 @@ static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = { · 803 unmodified lines
804804 static const struct amdgpu_ring_funcs jpeg_v4_0_5_dec_ring_vm_funcs = {
805805 .type = AMDGPU_RING_TYPE_VCN_JPEG,
806806 .align_mask = 0xf,
807+ .no_user_fence = true,
807808 .get_rptr = jpeg_v4_0_5_dec_ring_get_rptr,
808809 .get_wptr = jpeg_v4_0_5_dec_ring_get_wptr,
809810 .set_wptr = jpeg_v4_0_5_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c+1−0
@@ -680,6 +680,7 @@ static const struct amd_ip_funcs jpeg_v5_0_0_ip_funcs = { · 679 unmodified lines
680680 static const struct amdgpu_ring_funcs jpeg_v5_0_0_dec_ring_vm_funcs = {
681681 .type = AMDGPU_RING_TYPE_VCN_JPEG,
682682 .align_mask = 0xf,
683+ .no_user_fence = true,
683684 .get_rptr = jpeg_v5_0_0_dec_ring_get_rptr,
684685 .get_wptr = jpeg_v5_0_0_dec_ring_get_wptr,
685686 .set_wptr = jpeg_v5_0_0_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c+1−0
@@ -884,6 +884,7 @@ static const struct amd_ip_funcs jpeg_v5_0_1_ip_funcs = { · 883 unmodified lines
884884 static const struct amdgpu_ring_funcs jpeg_v5_0_1_dec_ring_vm_funcs = {
885885 .type = AMDGPU_RING_TYPE_VCN_JPEG,
886886 .align_mask = 0xf,
887+ .no_user_fence = true,
887888 .get_rptr = jpeg_v5_0_1_dec_ring_get_rptr,
888889 .get_wptr = jpeg_v5_0_1_dec_ring_get_wptr,
889890 .set_wptr = jpeg_v5_0_1_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_2.c+1−0
@@ -703,6 +703,7 @@ static const struct amd_ip_funcs jpeg_v5_0_2_ip_funcs = { · 702 unmodified lines
703703 static const struct amdgpu_ring_funcs jpeg_v5_0_2_dec_ring_vm_funcs = {
704704 .type = AMDGPU_RING_TYPE_VCN_JPEG,
705705 .align_mask = 0xf,
706+ .no_user_fence = true,
706707 .get_rptr = jpeg_v5_0_2_dec_ring_get_rptr,
707708 .get_wptr = jpeg_v5_0_2_dec_ring_get_wptr,
708709 .set_wptr = jpeg_v5_0_2_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/jpeg_v5_3_0.c+1−0
@@ -661,6 +661,7 @@ static const struct amd_ip_funcs jpeg_v5_3_0_ip_funcs = { · 660 unmodified lines
661661 static const struct amdgpu_ring_funcs jpeg_v5_3_0_dec_ring_vm_funcs = {
662662 .type = AMDGPU_RING_TYPE_VCN_JPEG,
663663 .align_mask = 0xf,
664+ .no_user_fence = true,
664665 .get_rptr = jpeg_v5_3_0_dec_ring_get_rptr,
665666 .get_wptr = jpeg_v5_3_0_dec_ring_get_wptr,
666667 .set_wptr = jpeg_v5_3_0_dec_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/mes_userqueue.c+69−71
@@ -30,34 +30,6 @@ · 29 unmodified lines
3030 #define AMDGPU_USERQ_PROC_CTX_SZ PAGE_SIZE
3131 #define AMDGPU_USERQ_GANG_CTX_SZ PAGE_SIZE
3232
33−static int
34−mes_userq_map_gtt_bo_to_gart(struct amdgpu_bo *bo)
35−{
36− int ret;
37−
38− ret = amdgpu_bo_reserve(bo, true);
39− if (ret) {
40− DRM_ERROR("Failed to reserve bo. ret %d\n", ret);
41− goto err_reserve_bo_failed;
42− }
43−
44− ret = amdgpu_ttm_alloc_gart(&bo->tbo);
45− if (ret) {
46− DRM_ERROR("Failed to bind bo to GART. ret %d\n", ret);
47− goto err_map_bo_gart_failed;
48− }
49−
50− amdgpu_bo_unreserve(bo);
51− bo = amdgpu_bo_ref(bo);
52−
53− return 0;
54−
55−err_map_bo_gart_failed:
56− amdgpu_bo_unreserve(bo);
57−err_reserve_bo_failed:
58− return ret;
59−}
60−
6133 static int
6234 mes_userq_create_wptr_mapping(struct amdgpu_device *adev,
6335 struct amdgpu_userq_mgr *uq_mgr,
@@ -65,55 +37,64 @@ mes_userq_create_wptr_mapping(struct amdgpu_device *adev, · 1 unmodified line
6537 uint64_t wptr)
6638 {
6739 struct amdgpu_bo_va_mapping *wptr_mapping;
68− struct amdgpu_vm *wptr_vm;
6940 struct amdgpu_userq_obj *wptr_obj = &queue->wptr_obj;
41+ struct amdgpu_bo *obj;
42+ struct amdgpu_vm *vm = queue->vm;
43+ struct drm_exec exec;
7044 int ret;
7145
72− wptr_vm = queue->vm;
73− ret = amdgpu_bo_reserve(wptr_vm->root.bo, false);
74− if (ret)
75− return ret;
76−
7746 wptr &= AMDGPU_GMC_HOLE_MASK;
78− wptr_mapping = amdgpu_vm_bo_lookup_mapping(wptr_vm, wptr >> PAGE_SHIFT);
79− amdgpu_bo_unreserve(wptr_vm->root.bo);
80− if (!wptr_mapping) {
81− DRM_ERROR("Failed to lookup wptr bo\n");
82− return -EINVAL;
83− }
8447
85− wptr_obj->obj = wptr_mapping->bo_va->base.bo;
86− if (wptr_obj->obj->tbo.base.size > PAGE_SIZE) {
87− DRM_ERROR("Requested GART mapping for wptr bo larger than one page\n");
88− return -EINVAL;
89− }
48+ drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 2);
49+ drm_exec_until_all_locked(&exec) {
50+ ret = amdgpu_vm_lock_pd(vm, &exec, 1);
51+ drm_exec_retry_on_contention(&exec);
52+ if (unlikely(ret))
53+ goto fail_lock;
54+
55+ wptr_mapping = amdgpu_vm_bo_lookup_mapping(vm, wptr >> PAGE_SHIFT);
56+ if (!wptr_mapping) {
57+ ret = -EINVAL;
58+ goto fail_lock;
59+ }
9060
91− ret = mes_userq_map_gtt_bo_to_gart(wptr_obj->obj);
92− if (ret) {
93− DRM_ERROR("Failed to map wptr bo to GART\n");
94− return ret;
61+ obj = wptr_mapping->bo_va->base.bo;
62+ ret = drm_exec_lock_obj(&exec, &obj->tbo.base);
63+ drm_exec_retry_on_contention(&exec);
64+ if (unlikely(ret))
65+ goto fail_lock;
9566 }
9667
97− ret = amdgpu_bo_reserve(wptr_obj->obj, true);
98− if (ret) {
99− DRM_ERROR("Failed to reserve wptr bo\n");
100− return ret;
68+ wptr_obj->obj = amdgpu_bo_ref(wptr_mapping->bo_va->base.bo);
69+ if (wptr_obj->obj->tbo.base.size > PAGE_SIZE) {
70+ ret = -EINVAL;
71+ goto fail_map;
10172 }
10273
10374 /* TODO use eviction fence instead of pinning. */
10475 ret = amdgpu_bo_pin(wptr_obj->obj, AMDGPU_GEM_DOMAIN_GTT);
10576 if (ret) {
106− drm_file_err(uq_mgr->file, "[Usermode queues] Failed to pin wptr bo\n");
107− goto unresv_bo;
77+ DRM_ERROR("Failed to pin wptr bo. ret %d\n", ret);
78+ goto fail_map;
79+ }
80+
81+ ret = amdgpu_ttm_alloc_gart(&wptr_obj->obj->tbo);
82+ if (ret) {
83+ DRM_ERROR("Failed to bind bo to GART. ret %d\n", ret);
84+ goto fail_alloc_gart;
10885 }
10986
11087 queue->wptr_obj.gpu_addr = amdgpu_bo_gpu_offset(wptr_obj->obj);
111− amdgpu_bo_unreserve(wptr_obj->obj);
11288
89+ drm_exec_fini(&exec);
11390 return 0;
11491
115−unresv_bo:
116− amdgpu_bo_unreserve(wptr_obj->obj);
92+fail_alloc_gart:
93+ amdgpu_bo_unpin(wptr_obj->obj);
94+fail_map:
95+ amdgpu_bo_unref(&wptr_obj->obj);
96+fail_lock:
97+ drm_exec_fini(&exec);
11798 return ret;
11899
119100 }
@@ -211,12 +192,16 @@ static int mes_userq_create_ctx_space(struct amdgpu_userq_mgr *uq_mgr, · 91 unmodified lines
211192 * for the same.
212193 */
213194 size = AMDGPU_USERQ_PROC_CTX_SZ + AMDGPU_USERQ_GANG_CTX_SZ;
214− r = amdgpu_userq_create_object(uq_mgr, ctx, size);
195+ r = amdgpu_bo_create_kernel(uq_mgr->adev, size, 0,
196+ AMDGPU_GEM_DOMAIN_GTT,
197+ &ctx->obj, &ctx->gpu_addr,
198+ &ctx->cpu_ptr);
215199 if (r) {
216200 DRM_ERROR("Failed to allocate ctx space bo for userqueue, err:%d\n", r);
217201 return r;
218202 }
219203
204+ memset(ctx->cpu_ptr, 0, size);
220205 return 0;
221206 }
222207
@@ -289,13 +274,19 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, · 66 unmodified lines
289274 return -ENOMEM;
290275 }
291276
292− r = amdgpu_userq_create_object(uq_mgr, &queue->mqd,
293− AMDGPU_MQD_SIZE_ALIGN(mqd_hw_default->mqd_size));
277+ r = amdgpu_bo_create_kernel(adev,
278+ AMDGPU_MQD_SIZE_ALIGN(mqd_hw_default->mqd_size),
279+ 0, AMDGPU_GEM_DOMAIN_GTT,
280+ &queue->mqd.obj, &queue->mqd.gpu_addr,
281+ &queue->mqd.cpu_ptr);
294282 if (r) {
295283 DRM_ERROR("Failed to create MQD object for userqueue\n");
296284 goto free_props;
297285 }
298286
287+ memset(queue->mqd.cpu_ptr, 0,
288+ AMDGPU_MQD_SIZE_ALIGN(mqd_hw_default->mqd_size));
289+
299290 /* Initialize the MQD BO with user given values */
300291 userq_props->wptr_gpu_addr = mqd_user->wptr_va;
301292 userq_props->rptr_gpu_addr = mqd_user->rptr_va;
@@ -327,8 +318,9 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, · 25 unmodified lines
327318 kfree(compute_mqd);
328319 goto free_mqd;
329320 }
330− r = amdgpu_userq_input_va_validate(adev, queue, compute_mqd->eop_va,
331− 2048);
321+ r = amdgpu_userq_input_va_validate(adev, queue,
322+ compute_mqd->eop_va, 2048,
323+ &queue->userq_vas.va.eop);
332324 amdgpu_bo_unreserve(queue->vm->root.bo);
333325 if (r) {
334326 kfree(compute_mqd);
@@ -377,7 +369,8 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, · 42 unmodified lines
377369 goto free_mqd;
378370 }
379371 r = amdgpu_userq_input_va_validate(adev, queue, mqd_gfx_v11->shadow_va,
380− shadow_info.shadow_size);
372+ shadow_info.shadow_size,
373+ &queue->userq_vas.va.shadow);
381374 if (r) {
382375 amdgpu_bo_unreserve(queue->vm->root.bo);
383376 kfree(mqd_gfx_v11);
@@ -385,7 +378,8 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, · 1 unmodified line
385378 }
386379
387380 r = amdgpu_userq_input_va_validate(adev, queue, mqd_gfx_v11->csa_va,
388− shadow_info.csa_size);
381+ shadow_info.csa_size,
382+ &queue->userq_vas.va.csa);
389383 amdgpu_bo_unreserve(queue->vm->root.bo);
390384 if (r) {
391385 kfree(mqd_gfx_v11);
@@ -415,7 +409,8 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, · 23 unmodified lines
415409 goto free_mqd;
416410 }
417411 r = amdgpu_userq_input_va_validate(adev, queue, mqd_sdma_v11->csa_va,
418− 32);
412+ 32,
413+ &queue->userq_vas.va.csa);
419414 amdgpu_bo_unreserve(queue->vm->root.bo);
420415 if (r) {
421416 kfree(mqd_sdma_v11);
@@ -451,10 +446,12 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, · 29 unmodified lines
451446 return 0;
452447
453448 free_ctx:
454− amdgpu_userq_destroy_object(uq_mgr, &queue->fw_obj);
449+ amdgpu_bo_free_kernel(&queue->fw_obj.obj, &queue->fw_obj.gpu_addr,
450+ &queue->fw_obj.cpu_ptr);
455451
456452 free_mqd:
457− amdgpu_userq_destroy_object(uq_mgr, &queue->mqd);
453+ amdgpu_bo_free_kernel(&queue->mqd.obj, &queue->mqd.gpu_addr,
454+ &queue->mqd.cpu_ptr);
458455
459456 free_props:
460457 kfree(userq_props);
@@ -464,11 +461,12 @@ free_props: · 3 unmodified lines
464461
465462 static void mes_userq_mqd_destroy(struct amdgpu_usermode_queue *queue)
466463 {
467− struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;
468464
469− amdgpu_userq_destroy_object(uq_mgr, &queue->fw_obj);
465+ amdgpu_bo_free_kernel(&queue->fw_obj.obj, &queue->fw_obj.gpu_addr,
466+ &queue->fw_obj.cpu_ptr);
470467 kfree(queue->userq_prop);
471− amdgpu_userq_destroy_object(uq_mgr, &queue->mqd);
468+ amdgpu_bo_free_kernel(&queue->mqd.obj, &queue->mqd.gpu_addr,
469+ &queue->mqd.cpu_ptr);
472470 }
473471
474472 static int mes_userq_preempt(struct amdgpu_usermode_queue *queue)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c+2−2
@@ -889,7 +889,7 @@ static void sdma_v4_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 se · 888 unmodified lines
889889 /* write the fence */
890890 amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_FENCE));
891891 /* zero in first two bits */
892− BUG_ON(addr & 0x3);
892+ WARN_ON(addr & 0x3);
893893 amdgpu_ring_write(ring, lower_32_bits(addr));
894894 amdgpu_ring_write(ring, upper_32_bits(addr));
895895 amdgpu_ring_write(ring, lower_32_bits(seq));
@@ -899,7 +899,7 @@ static void sdma_v4_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 se · 3 unmodified lines
899899 addr += 4;
900900 amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_FENCE));
901901 /* zero in first two bits */
902− BUG_ON(addr & 0x3);
902+ WARN_ON(addr & 0x3);
903903 amdgpu_ring_write(ring, lower_32_bits(addr));
904904 amdgpu_ring_write(ring, upper_32_bits(addr));
905905 amdgpu_ring_write(ring, upper_32_bits(seq));
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c+1−10
@@ -1662,17 +1662,8 @@ static int sdma_v6_0_process_fence_irq(struct amdgpu_device *adev, · 1661 unmodified lines
16621662 u32 doorbell_offset = entry->src_data[0];
16631663
16641664 if (adev->enable_mes && doorbell_offset) {
1665− struct amdgpu_usermode_queue *queue;
1666− struct xarray *xa = &adev->userq_doorbell_xa;
1667− unsigned long flags;
1668−
16691665 doorbell_offset >>= SDMA0_QUEUE0_DOORBELL_OFFSET__OFFSET__SHIFT;
1670−
1671− xa_lock_irqsave(xa, flags);
1672− queue = xa_load(xa, doorbell_offset);
1673− if (queue)
1674− amdgpu_userq_fence_driver_process(queue->fence_drv);
1675− xa_unlock_irqrestore(xa, flags);
1666+ amdgpu_userq_process_fence_irq(adev, doorbell_offset);
16761667 }
16771668
16781669 return 0;
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c+1−10
@@ -1594,17 +1594,8 @@ static int sdma_v7_0_process_fence_irq(struct amdgpu_device *adev, · 1593 unmodified lines
15941594 u32 doorbell_offset = entry->src_data[0];
15951595
15961596 if (adev->enable_mes && doorbell_offset) {
1597− struct xarray *xa = &adev->userq_doorbell_xa;
1598− struct amdgpu_usermode_queue *queue;
1599− unsigned long flags;
1600−
16011597 doorbell_offset >>= SDMA0_QUEUE0_DOORBELL_OFFSET__OFFSET__SHIFT;
1602−
1603− xa_lock_irqsave(xa, flags);
1604− queue = xa_load(xa, doorbell_offset);
1605− if (queue)
1606− amdgpu_userq_fence_driver_process(queue->fence_drv);
1607− xa_unlock_irqrestore(xa, flags);
1598+ amdgpu_userq_process_fence_irq(adev, doorbell_offset);
16081599 }
16091600
16101601 return 0;
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c+10−0
@@ -242,6 +242,10 @@ static void uvd_v3_1_mc_resume(struct amdgpu_device *adev) · 241 unmodified lines
242242 uint64_t addr;
243243 uint32_t size;
244244
245+ /* When the keyselect is already set, don't perturb it. */
246+ if (RREG32(mmUVD_FW_START))
247+ return;
248+
245249 /* program the VCPU memory controller bits 0-27 */
246250 addr = (adev->uvd.inst->gpu_addr + AMDGPU_UVD_FIRMWARE_OFFSET) >> 3;
247251 size = AMDGPU_UVD_FIRMWARE_SIZE(adev) >> 3;
@@ -284,6 +288,12 @@ static int uvd_v3_1_fw_validate(struct amdgpu_device *adev) · 36 unmodified lines
284288 int i;
285289 uint32_t keysel = adev->uvd.keyselect;
286290
291+ if (RREG32(mmUVD_FW_START) & UVD_FW_STATUS__PASS_MASK) {
292+ dev_dbg(adev->dev, "UVD keyselect already set: 0x%x (on CPU: 0x%x)\n",
293+ RREG32(mmUVD_FW_START), adev->uvd.keyselect);
294+ return 0;
295+ }
296+
287297 WREG32(mmUVD_FW_START, keysel);
288298
289299 for (i = 0; i < 10; ++i) {
drivers/gpu/drm/amd/amdgpu/vce_v1_0.c+39−25
@@ -42,9 +42,10 @@ · 41 unmodified lines
4242 #include "oss/oss_1_0_d.h"
4343 #include "oss/oss_1_0_sh_mask.h"
4444
45+#define VCE_V1_0_ALIGNMENT (32 * 1024)
4546 #define VCE_V1_0_FW_SIZE (256 * 1024)
4647 #define VCE_V1_0_STACK_SIZE (64 * 1024)
47−#define VCE_V1_0_DATA_SIZE (7808 * (AMDGPU_MAX_VCE_HANDLES + 1))
48+#define VCE_V1_0_DATA_SIZE (ALIGN(7808 * (AMDGPU_MAX_VCE_HANDLES + 1), VCE_V1_0_ALIGNMENT))
4849 #define VCE_STATUS_VCPU_REPORT_FW_LOADED_MASK 0x02
4950
5051 static void vce_v1_0_set_ring_funcs(struct amdgpu_device *adev);
@@ -177,7 +178,7 @@ static void vce_v1_0_init_cg(struct amdgpu_device *adev) · 126 unmodified lines
177178 }
178179
179180 /**
180− * vce_v1_0_load_fw_signature - load firmware signature into VCPU BO
181+ * vce_v1_0_load_fw() - load firmware signature into VCPU BO
181182 *
182183 * @adev: amdgpu_device pointer
183184 *
@@ -185,21 +186,26 @@ static void vce_v1_0_init_cg(struct amdgpu_device *adev) · 1 unmodified line
185186 * This function finds the signature appropriate for the current
186187 * ASIC and writes that into the VCPU BO.
187188 */
188−static int vce_v1_0_load_fw_signature(struct amdgpu_device *adev)
189+static int vce_v1_0_load_fw(struct amdgpu_device *adev)
189190 {
190191 const struct common_firmware_header *hdr;
191192 struct vce_v1_0_fw_signature *sign;
192− unsigned int ucode_offset;
193+ u32 ucode_offset;
194+ u32 ucode_size;
193195 uint32_t chip_id;
194196 u32 *cpu_addr;
195197 int i;
196198
197199 hdr = (const struct common_firmware_header *)adev->vce.fw->data;
198200 ucode_offset = le32_to_cpu(hdr->ucode_array_offset_bytes);
201+ ucode_size = hdr->ucode_size_bytes - sizeof(struct vce_v1_0_fw_signature *);
199202 cpu_addr = adev->vce.cpu_addr;
200203
201204 sign = (void *)adev->vce.fw->data + ucode_offset;
202205
206+ if (ucode_size > VCE_V1_0_FW_SIZE - AMDGPU_VCE_FIRMWARE_OFFSET)
207+ return -EINVAL;
208+
203209 switch (adev->asic_type) {
204210 case CHIP_TAHITI:
205211 chip_id = 0x01000014;
@@ -226,12 +232,14 @@ static int vce_v1_0_load_fw_signature(struct amdgpu_device *adev) · 20 unmodified lines
226232 return -EINVAL;
227233 }
228234
235+ memset_io(&cpu_addr[0], 0, amdgpu_bo_size(adev->vce.vcpu_bo));
236+
229237 cpu_addr += (256 - 64) / 4;
230238 memcpy_toio(&cpu_addr[0], &sign->val[i].nonce[0], 16);
231239 cpu_addr[4] = cpu_to_le32(le32_to_cpu(sign->length) + 64);
232240
233241 memset_io(&cpu_addr[5], 0, 44);
234− memcpy_toio(&cpu_addr[16], &sign[1], hdr->ucode_size_bytes - sizeof(*sign));
242+ memcpy_toio(&cpu_addr[16], &sign[1], ucode_size);
235243
236244 cpu_addr += (le32_to_cpu(sign->length) + 64) / 4;
237245 memcpy_toio(&cpu_addr[0], &sign->val[i].sigval[0], 16);
@@ -312,18 +320,23 @@ static int vce_v1_0_mc_resume(struct amdgpu_device *adev) · 74 unmodified lines
312320 WREG32(mmVCE_VCPU_SCRATCH7, AMDGPU_MAX_VCE_HANDLES);
313321
314322 offset = adev->vce.gpu_addr + AMDGPU_VCE_FIRMWARE_OFFSET;
315− size = VCE_V1_0_FW_SIZE;
316− WREG32(mmVCE_VCPU_CACHE_OFFSET0, offset & 0x7fffffff);
323+ size = VCE_V1_0_FW_SIZE - AMDGPU_VCE_FIRMWARE_OFFSET;
324+ WREG32(mmVCE_VCPU_CACHE_OFFSET0, offset);
317325 WREG32(mmVCE_VCPU_CACHE_SIZE0, size);
318326
319327 offset += size;
320328 size = VCE_V1_0_STACK_SIZE;
321− WREG32(mmVCE_VCPU_CACHE_OFFSET1, offset & 0x7fffffff);
329+ WARN_ON(!IS_ALIGNED(offset, VCE_V1_0_ALIGNMENT));
330+ WARN_ON(!IS_ALIGNED(size, VCE_V1_0_ALIGNMENT));
331+ WREG32(mmVCE_VCPU_CACHE_OFFSET1, offset);
322332 WREG32(mmVCE_VCPU_CACHE_SIZE1, size);
323333
324334 offset += size;
325335 size = VCE_V1_0_DATA_SIZE;
326− WREG32(mmVCE_VCPU_CACHE_OFFSET2, offset & 0x7fffffff);
336+ WARN_ON(!IS_ALIGNED(offset, VCE_V1_0_ALIGNMENT));
337+ WARN_ON(!IS_ALIGNED(size, VCE_V1_0_ALIGNMENT));
338+ WARN_ON((offset + size - adev->vce.gpu_addr) > amdgpu_bo_size(adev->vce.vcpu_bo));
339+ WREG32(mmVCE_VCPU_CACHE_OFFSET2, offset);
327340 WREG32(mmVCE_VCPU_CACHE_SIZE2, size);
328341
329342 WREG32_P(mmVCE_LMI_CTRL2, 0x0, ~0x100);
@@ -527,22 +540,31 @@ static int vce_v1_0_early_init(struct amdgpu_ip_block *ip_block) · 197 unmodified lines
527540 * To accomodate that, we put GART to the LOW address range
528541 * and reserve some GART pages where we map the VCPU BO,
529542 * so that it gets a 32-bit address.
543+ *
544+ * The BAR address is zero and we can't change it
545+ * due to the firmware validation mechanism.
546+ * It seems that it fails to initialize if the address is >= 128 MiB.
530547 */
531548 static int vce_v1_0_ensure_vcpu_bo_32bit_addr(struct amdgpu_device *adev)
532549 {
533550 u64 bo_size = amdgpu_bo_size(adev->vce.vcpu_bo);
534− u64 max_vcpu_bo_addr = 0xffffffff - bo_size;
551+ u64 max_vcpu_bo_addr = 0x07ffffff - bo_size;
535552 u64 num_pages = ALIGN(bo_size, AMDGPU_GPU_PAGE_SIZE) / AMDGPU_GPU_PAGE_SIZE;
536553 u64 pa = amdgpu_gmc_vram_pa(adev, adev->vce.vcpu_bo);
537554 u64 flags = AMDGPU_PTE_READABLE | AMDGPU_PTE_WRITEABLE | AMDGPU_PTE_VALID;
538555 u64 vce_gart_start_offs;
539556 int r;
540557
541− r = amdgpu_gtt_mgr_alloc_entries(&adev->mman.gtt_mgr,
542− &adev->vce.gart_node, num_pages,
543− DRM_MM_INSERT_LOW);
544− if (r)
545− return r;
558+ if (adev->gmc.vram_start < adev->gmc.gart_start)
559+ return amdgpu_bo_gpu_offset(adev->vce.vcpu_bo) <= max_vcpu_bo_addr ? 0 : -EINVAL;
560+
561+ if (!drm_mm_node_allocated(&adev->vce.gart_node)) {
562+ r = amdgpu_gtt_mgr_alloc_entries(&adev->mman.gtt_mgr,
563+ &adev->vce.gart_node, num_pages,
564+ DRM_MM_INSERT_LOW);
565+ if (r)
566+ return r;
567+ }
546568
547569 vce_gart_start_offs = amdgpu_gtt_node_to_byte_offset(&adev->vce.gart_node);
548570
@@ -553,8 +575,6 @@ static int vce_v1_0_ensure_vcpu_bo_32bit_addr(struct amdgpu_device *adev) · 4 unmodified lines
553575 amdgpu_gart_map_vram_range(adev, pa, adev->vce.gart_node.start,
554576 num_pages, flags, adev->gart.ptr);
555577 adev->vce.gpu_addr = adev->gmc.gart_start + vce_gart_start_offs;
556− if (adev->vce.gpu_addr > max_vcpu_bo_addr)
557− return -EINVAL;
558578
559579 return 0;
560580 }
@@ -574,10 +594,7 @@ static int vce_v1_0_sw_init(struct amdgpu_ip_block *ip_block) · 13 unmodified lines
574594 if (r)
575595 return r;
576596
577− r = amdgpu_vce_resume(adev);
578− if (r)
579− return r;
580− r = vce_v1_0_load_fw_signature(adev);
597+ r = vce_v1_0_load_fw(adev);
581598 if (r)
582599 return r;
583600 r = vce_v1_0_ensure_vcpu_bo_32bit_addr(adev);
@@ -696,10 +713,7 @@ static int vce_v1_0_resume(struct amdgpu_ip_block *ip_block) · 112 unmodified lines
696713 struct amdgpu_device *adev = ip_block->adev;
697714 int r;
698715
699− r = amdgpu_vce_resume(adev);
700− if (r)
701− return r;
702− r = vce_v1_0_load_fw_signature(adev);
716+ r = vce_v1_0_load_fw(adev);
703717 if (r)
704718 return r;
705719 r = vce_v1_0_ensure_vcpu_bo_32bit_addr(adev);
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c+7−2
@@ -37,9 +37,14 @@ · 36 unmodified lines
3737 #include "oss/oss_2_0_d.h"
3838 #include "oss/oss_2_0_sh_mask.h"
3939
40+
41+/* Use 24K to be safe. The FW supposedly only requires 23744 bytes. */
42+#define VCE_V2_0_DATA_ENTRY_SIZE (24 * 1024)
43+
4044 #define VCE_V2_0_FW_SIZE (256 * 1024)
4145 #define VCE_V2_0_STACK_SIZE (64 * 1024)
42−#define VCE_V2_0_DATA_SIZE (23552 * AMDGPU_MAX_VCE_HANDLES)
46+#define VCE_V2_0_DATA_SIZE (VCE_V2_0_DATA_ENTRY_SIZE * (AMDGPU_MAX_VCE_HANDLES + 1))
47+
4348 #define VCE_STATUS_VCPU_REPORT_FW_LOADED_MASK 0x02
4449
4550 static void vce_v2_0_set_ring_funcs(struct amdgpu_device *adev);
@@ -183,7 +188,7 @@ static void vce_v2_0_mc_resume(struct amdgpu_device *adev) · 137 unmodified lines
183188 WREG32(mmVCE_LMI_VCPU_CACHE_40BIT_BAR, (adev->vce.gpu_addr >> 8));
184189
185190 offset = AMDGPU_VCE_FIRMWARE_OFFSET;
186− size = VCE_V2_0_FW_SIZE;
191+ size = VCE_V2_0_FW_SIZE - AMDGPU_VCE_FIRMWARE_OFFSET;
187192 WREG32(mmVCE_VCPU_CACHE_OFFSET0, offset & 0x7fffffff);
188193 WREG32(mmVCE_VCPU_CACHE_SIZE0, size);
189194
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c+1−1
@@ -574,7 +574,7 @@ static void vce_v3_0_mc_resume(struct amdgpu_device *adev, int idx) · 573 unmodified lines
574574 } else
575575 WREG32(mmVCE_LMI_VCPU_CACHE_40BIT_BAR, (adev->vce.gpu_addr >> 8));
576576 offset = AMDGPU_VCE_FIRMWARE_OFFSET;
577− size = VCE_V3_0_FW_SIZE;
577+ size = VCE_V3_0_FW_SIZE - AMDGPU_VCE_FIRMWARE_OFFSET;
578578 WREG32(mmVCE_VCPU_CACHE_OFFSET0, offset & 0x7fffffff);
579579 WREG32(mmVCE_VCPU_CACHE_SIZE0, size);
580580
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c+2−0
@@ -2113,6 +2113,7 @@ static const struct amd_ip_funcs vcn_v2_0_ip_funcs = { · 2112 unmodified lines
21132113 static const struct amdgpu_ring_funcs vcn_v2_0_dec_ring_vm_funcs = {
21142114 .type = AMDGPU_RING_TYPE_VCN_DEC,
21152115 .align_mask = 0xf,
2116+ .no_user_fence = true,
21162117 .secure_submission_supported = true,
21172118 .get_rptr = vcn_v2_0_dec_ring_get_rptr,
21182119 .get_wptr = vcn_v2_0_dec_ring_get_wptr,
@@ -2145,6 +2146,7 @@ static const struct amdgpu_ring_funcs vcn_v2_0_enc_ring_vm_funcs = { · 26 unmodified lines
21452146 .type = AMDGPU_RING_TYPE_VCN_ENC,
21462147 .align_mask = 0x3f,
21472148 .nop = VCN_ENC_CMD_NO_OP,
2149+ .no_user_fence = true,
21482150 .get_rptr = vcn_v2_0_enc_ring_get_rptr,
21492151 .get_wptr = vcn_v2_0_enc_ring_get_wptr,
21502152 .set_wptr = vcn_v2_0_enc_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c+2−0
@@ -1778,6 +1778,7 @@ static void vcn_v2_5_dec_ring_set_wptr(struct amdgpu_ring *ring) · 1777 unmodified lines
17781778 static const struct amdgpu_ring_funcs vcn_v2_5_dec_ring_vm_funcs = {
17791779 .type = AMDGPU_RING_TYPE_VCN_DEC,
17801780 .align_mask = 0xf,
1781+ .no_user_fence = true,
17811782 .secure_submission_supported = true,
17821783 .get_rptr = vcn_v2_5_dec_ring_get_rptr,
17831784 .get_wptr = vcn_v2_5_dec_ring_get_wptr,
@@ -1879,6 +1880,7 @@ static const struct amdgpu_ring_funcs vcn_v2_5_enc_ring_vm_funcs = { · 95 unmodified lines
18791880 .type = AMDGPU_RING_TYPE_VCN_ENC,
18801881 .align_mask = 0x3f,
18811882 .nop = VCN_ENC_CMD_NO_OP,
1883+ .no_user_fence = true,
18821884 .get_rptr = vcn_v2_5_enc_ring_get_rptr,
18831885 .get_wptr = vcn_v2_5_enc_ring_get_wptr,
18841886 .set_wptr = vcn_v2_5_enc_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c+6−1
@@ -1856,6 +1856,7 @@ static const struct amdgpu_ring_funcs vcn_v3_0_dec_sw_ring_vm_funcs = { · 1855 unmodified lines
18561856 .type = AMDGPU_RING_TYPE_VCN_DEC,
18571857 .align_mask = 0x3f,
18581858 .nop = VCN_DEC_SW_CMD_NO_OP,
1859+ .no_user_fence = true,
18591860 .secure_submission_supported = true,
18601861 .get_rptr = vcn_v3_0_dec_ring_get_rptr,
18611862 .get_wptr = vcn_v3_0_dec_ring_get_wptr,
@@ -1972,6 +1973,7 @@ static int vcn_v3_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job, · 110 unmodified lines
19721973
19731974 for (i = 0, msg = &msg[6]; i < num_buffers; ++i, msg += 4) {
19741975 uint32_t offset, size, *create;
1976+ uint64_t buf_end;
19751977
19761978 if (msg[0] != RDECODE_MESSAGE_CREATE)
19771979 continue;
@@ -1979,7 +1981,8 @@ static int vcn_v3_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job, · 1 unmodified line
19791981 offset = msg[1];
19801982 size = msg[2];
19811983
1982− if (size < 4 || offset + size > end - addr) {
1984+ if (size < 4 || check_add_overflow(offset, size, &buf_end) ||
1985+ buf_end > end - addr) {
19831986 DRM_ERROR("VCN message buffer exceeds BO bounds!\n");
19841987 r = -EINVAL;
19851988 goto out;
@@ -2036,6 +2039,7 @@ static int vcn_v3_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p, · 50 unmodified lines
20362039 static const struct amdgpu_ring_funcs vcn_v3_0_dec_ring_vm_funcs = {
20372040 .type = AMDGPU_RING_TYPE_VCN_DEC,
20382041 .align_mask = 0xf,
2042+ .no_user_fence = true,
20392043 .secure_submission_supported = true,
20402044 .get_rptr = vcn_v3_0_dec_ring_get_rptr,
20412045 .get_wptr = vcn_v3_0_dec_ring_get_wptr,
@@ -2138,6 +2142,7 @@ static const struct amdgpu_ring_funcs vcn_v3_0_enc_ring_vm_funcs = { · 96 unmodified lines
21382142 .type = AMDGPU_RING_TYPE_VCN_ENC,
21392143 .align_mask = 0x3f,
21402144 .nop = VCN_ENC_CMD_NO_OP,
2145+ .no_user_fence = true,
21412146 .get_rptr = vcn_v3_0_enc_ring_get_rptr,
21422147 .get_wptr = vcn_v3_0_enc_ring_get_wptr,
21432148 .set_wptr = vcn_v3_0_enc_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c+4−1
@@ -1889,6 +1889,7 @@ static int vcn_v4_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job, · 1888 unmodified lines
18891889
18901890 for (i = 0, msg = &msg[6]; i < num_buffers; ++i, msg += 4) {
18911891 uint32_t offset, size, *create;
1892+ uint64_t buf_end;
18921893
18931894 if (msg[0] != RDECODE_MESSAGE_CREATE)
18941895 continue;
@@ -1896,7 +1897,8 @@ static int vcn_v4_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job, · 1 unmodified line
18961897 offset = msg[1];
18971898 size = msg[2];
18981899
1899− if (size < 4 || offset + size > end - addr) {
1900+ if (size < 4 || check_add_overflow(offset, size, &buf_end) ||
1901+ buf_end > end - addr) {
19001902 DRM_ERROR("VCN message buffer exceeds BO bounds!\n");
19011903 r = -EINVAL;
19021904 goto out;
@@ -1994,6 +1996,7 @@ static struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = { · 91 unmodified lines
19941996 .type = AMDGPU_RING_TYPE_VCN_ENC,
19951997 .align_mask = 0x3f,
19961998 .nop = VCN_ENC_CMD_NO_OP,
1999+ .no_user_fence = true,
19972000 .extra_bytes = sizeof(struct amdgpu_vcn_rb_metadata),
19982001 .get_rptr = vcn_v4_0_unified_ring_get_rptr,
19992002 .get_wptr = vcn_v4_0_unified_ring_get_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c+1−0
@@ -1775,6 +1775,7 @@ static const struct amdgpu_ring_funcs vcn_v4_0_3_unified_ring_vm_funcs = { · 1774 unmodified lines
17751775 .type = AMDGPU_RING_TYPE_VCN_ENC,
17761776 .align_mask = 0x3f,
17771777 .nop = VCN_ENC_CMD_NO_OP,
1778+ .no_user_fence = true,
17781779 .get_rptr = vcn_v4_0_3_unified_ring_get_rptr,
17791780 .get_wptr = vcn_v4_0_3_unified_ring_get_wptr,
17801781 .set_wptr = vcn_v4_0_3_unified_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c+1−0
@@ -1483,6 +1483,7 @@ static struct amdgpu_ring_funcs vcn_v4_0_5_unified_ring_vm_funcs = { · 1482 unmodified lines
14831483 .type = AMDGPU_RING_TYPE_VCN_ENC,
14841484 .align_mask = 0x3f,
14851485 .nop = VCN_ENC_CMD_NO_OP,
1486+ .no_user_fence = true,
14861487 .get_rptr = vcn_v4_0_5_unified_ring_get_rptr,
14871488 .get_wptr = vcn_v4_0_5_unified_ring_get_wptr,
14881489 .set_wptr = vcn_v4_0_5_unified_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c+1−0
@@ -1207,6 +1207,7 @@ static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = { · 1206 unmodified lines
12071207 .type = AMDGPU_RING_TYPE_VCN_ENC,
12081208 .align_mask = 0x3f,
12091209 .nop = VCN_ENC_CMD_NO_OP,
1210+ .no_user_fence = true,
12101211 .get_rptr = vcn_v5_0_0_unified_ring_get_rptr,
12111212 .get_wptr = vcn_v5_0_0_unified_ring_get_wptr,
12121213 .set_wptr = vcn_v5_0_0_unified_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c+1−0
@@ -1419,6 +1419,7 @@ static const struct amdgpu_ring_funcs vcn_v5_0_1_unified_ring_vm_funcs = { · 1418 unmodified lines
14191419 .type = AMDGPU_RING_TYPE_VCN_ENC,
14201420 .align_mask = 0x3f,
14211421 .nop = VCN_ENC_CMD_NO_OP,
1422+ .no_user_fence = true,
14221423 .get_rptr = vcn_v5_0_1_unified_ring_get_rptr,
14231424 .get_wptr = vcn_v5_0_1_unified_ring_get_wptr,
14241425 .set_wptr = vcn_v5_0_1_unified_ring_set_wptr,
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_2.c+1−0
@@ -994,6 +994,7 @@ static const struct amdgpu_ring_funcs vcn_v5_0_2_unified_ring_vm_funcs = { · 993 unmodified lines
994994 .type = AMDGPU_RING_TYPE_VCN_ENC,
995995 .align_mask = 0x3f,
996996 .nop = VCN_ENC_CMD_NO_OP,
997+ .no_user_fence = true,
997998 .get_rptr = vcn_v5_0_2_unified_ring_get_rptr,
998999 .get_wptr = vcn_v5_0_2_unified_ring_get_wptr,
9991000 .set_wptr = vcn_v5_0_2_unified_ring_set_wptr,
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+53−9
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/err.h>
2626 #include <linux/fs.h>
2727 #include <linux/file.h>
28+#include <linux/overflow.h>
2829 #include <linux/sched.h>
2930 #include <linux/slab.h>
3031 #include <linux/uaccess.h>
@@ -66,6 +67,21 @@ static const struct class kfd_class = { · 35 unmodified lines
6667 .name = kfd_dev_name,
6768 };
6869
70+/*
71+ * Cache the address space of the chardev on first open so that the reset
72+ * path can drop all userspace mappings of doorbell and MMIO ranges via
73+ * unmap_mapping_range().
74+ */
75+static struct address_space *kfd_dev_mapping;
76+
77+void kfd_dev_unmap_mapping_range(loff_t const holebegin, loff_t const holelen)
78+{
79+ struct address_space *mapping = READ_ONCE(kfd_dev_mapping);
80+
81+ if (mapping)
82+ unmap_mapping_range(mapping, holebegin, holelen, 1);
83+}
84+
6985 static inline struct kfd_process_device *kfd_lock_pdd_by_id(struct kfd_process *p, __u32 gpu_id)
7086 {
7187 struct kfd_process_device *pdd;
@@ -132,6 +148,13 @@ static int kfd_open(struct inode *inode, struct file *filep) · 60 unmodified lines
132148 if (iminor(inode) != 0)
133149 return -ENODEV;
134150
151+ /*
152+ * /dev/kfd is a single chardev so all opens share one inode. Cache
153+ * its address_space on the first open for use by the reset path.
154+ */
155+ if (!READ_ONCE(kfd_dev_mapping))
156+ cmpxchg(&kfd_dev_mapping, NULL, inode->i_mapping);
157+
135158 is_32bit_user_mode = in_compat_syscall();
136159
137160 if (is_32bit_user_mode) {
@@ -1359,7 +1382,7 @@ static int kfd_ioctl_map_memory_to_gpu(struct file *filep, · 1221 unmodified lines
13591382 peer_pdd = kfd_process_device_data_by_id(p, devices_arr[i]);
13601383 if (WARN_ON_ONCE(!peer_pdd))
13611384 continue;
1362− kfd_flush_tlb(peer_pdd, TLB_FLUSH_LEGACY);
1385+ kfd_flush_tlb(peer_pdd);
13631386 }
13641387 kfree(devices_arr);
13651388
@@ -1454,7 +1477,7 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep, · 88 unmodified lines
14541477 if (WARN_ON_ONCE(!peer_pdd))
14551478 continue;
14561479 if (flush_tlb)
1457− kfd_flush_tlb(peer_pdd, TLB_FLUSH_HEAVYWEIGHT);
1480+ kfd_flush_tlb(peer_pdd);
14581481
14591482 /* Remove dma mapping after tlb flush to avoid IO_PAGE_FAULT */
14601483 err = amdgpu_amdkfd_gpuvm_dmaunmap_mem(mem, peer_pdd->drm_priv);
@@ -1695,6 +1718,16 @@ static int kfd_ioctl_smi_events(struct file *filep, · 234 unmodified lines
16951718 return kfd_smi_event_open(pdd->dev, &args->anon_fd);
16961719 }
16971720
1721+static int kfd_ioctl_svm_validate(void *kdata, unsigned int usize)
1722+{
1723+ struct kfd_ioctl_svm_args *args = kdata;
1724+ size_t expected = struct_size(args, attrs, args->nattr);
1725+
1726+ if (expected == SIZE_MAX || usize < expected)
1727+ return -EINVAL;
1728+ return 0;
1729+}
1730+
16981731 #if IS_ENABLED(CONFIG_HSA_AMD_SVM)
16991732
17001733 static int kfd_ioctl_set_xnack_mode(struct file *filep,
@@ -2267,6 +2300,11 @@ static int criu_restore_devices(struct kfd_process *p, · 566 unmodified lines
22672300 ret = -EINVAL;
22682301 goto exit;
22692302 }
2303+
2304+ if (pdd->drm_file) {
2305+ ret = -EINVAL;
2306+ goto exit;
2307+ }
22702308 pdd->user_gpu_id = device_buckets[i].user_gpu_id;
22712309
22722310 drm_file = fget(device_buckets[i].drm_fd);
@@ -2277,11 +2315,6 @@ static int criu_restore_devices(struct kfd_process *p, · 4 unmodified lines
22772315 goto exit;
22782316 }
22792317
2280− if (pdd->drm_file) {
2281− ret = -EINVAL;
2282− goto exit;
2283− }
2284−
22852318 /* create the vm using render nodes for kfd pdd */
22862319 if (kfd_process_device_init_vm(pdd, drm_file)) {
22872320 pr_err("could not init vm for given pdd\n");
@@ -3209,7 +3242,11 @@ static int kfd_ioctl_create_process(struct file *filep, struct kfd_process *p, v · 921 unmodified lines
32093242
32103243 #define AMDKFD_IOCTL_DEF(ioctl, _func, _flags) \
32113244 [_IOC_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, \
3212− .cmd_drv = 0, .name = #ioctl}
3245+ .validate = NULL, .cmd_drv = 0, .name = #ioctl}
3246+
3247+#define AMDKFD_IOCTL_DEF_V(ioctl, _func, _validate, _flags) \
3248+ [_IOC_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, \
3249+ .validate = _validate, .cmd_drv = 0, .name = #ioctl}
32133250
32143251 /** Ioctl table */
32153252 static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = {
@@ -3306,7 +3343,8 @@ static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = { · 90 unmodified lines
33063343 AMDKFD_IOCTL_DEF(AMDKFD_IOC_SMI_EVENTS,
33073344 kfd_ioctl_smi_events, 0),
33083345
3309− AMDKFD_IOCTL_DEF(AMDKFD_IOC_SVM, kfd_ioctl_svm, 0),
3346+ AMDKFD_IOCTL_DEF_V(AMDKFD_IOC_SVM, kfd_ioctl_svm,
3347+ kfd_ioctl_svm_validate, 0),
33103348
33113349 AMDKFD_IOCTL_DEF(AMDKFD_IOC_SET_XNACK_MODE,
33123350 kfd_ioctl_set_xnack_mode, 0),
@@ -3431,6 +3469,12 @@ static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) · 118 unmodified lines
34313469 memset(kdata, 0, usize);
34323470 }
34333471
3472+ if (ioctl->validate) {
3473+ retcode = ioctl->validate(kdata, usize);
3474+ if (retcode)
3475+ goto err_i1;
3476+ }
3477+
34343478 retcode = func(filep, process, kdata);
34353479
34363480 if (cmd & IOC_OUT)
drivers/gpu/drm/amd/amdkfd/kfd_device.c+1−32
@@ -1737,37 +1737,6 @@ bool kgd2kfd_vmfault_fast_path(struct amdgpu_device *adev, struct amdgpu_iv_entr · 1736 unmodified lines
17371737 return false;
17381738 }
17391739
1740−/* check if there is kfd process still uses adev */
1741−static bool kgd2kfd_check_device_idle(struct amdgpu_device *adev)
1742−{
1743− struct kfd_process *p;
1744− struct hlist_node *p_temp;
1745− unsigned int temp;
1746− struct kfd_node *dev;
1747−
1748− mutex_lock(&kfd_processes_mutex);
1749−
1750− if (hash_empty(kfd_processes_table)) {
1751− mutex_unlock(&kfd_processes_mutex);
1752− return true;
1753− }
1754−
1755− /* check if there is device still use adev */
1756− hash_for_each_safe(kfd_processes_table, temp, p_temp, p, kfd_processes) {
1757− for (int i = 0; i < p->n_pdds; i++) {
1758− dev = p->pdds[i]->dev;
1759− if (dev->adev == adev) {
1760− mutex_unlock(&kfd_processes_mutex);
1761− return false;
1762− }
1763− }
1764− }
1765−
1766− mutex_unlock(&kfd_processes_mutex);
1767−
1768− return true;
1769−}
1770−
17711740 /** kgd2kfd_teardown_processes - gracefully tear down existing
17721741 * kfd processes that use adev
17731742 *
@@ -1800,7 +1769,7 @@ void kgd2kfd_teardown_processes(struct amdgpu_device *adev) · 26 unmodified lines
18001769 mutex_unlock(&kfd_processes_mutex);
18011770
18021771 /* wait all kfd processes use adev terminate */
1803− while (!kgd2kfd_check_device_idle(adev))
1772+ while (!!atomic_read(&adev->kfd.dev->kfd_processes_count))
18041773 cond_resched();
18051774 }
18061775
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c+17−6
@@ -475,6 +475,9 @@ static int allocate_doorbell(struct qcm_process_device *qpd, · 474 unmodified lines
475475 } else {
476476 /* For CP queues on SOC15 */
477477 if (restore_id) {
478+ if (*restore_id >= KFD_MAX_NUM_OF_QUEUES_PER_PROCESS)
479+ return -EINVAL;
480+
478481 /* make sure that ID is free */
479482 if (__test_and_set_bit(*restore_id, qpd->doorbell_bitmap))
480483 return -EINVAL;
@@ -572,7 +575,7 @@ static int allocate_vmid(struct device_queue_manager *dqm, · 91 unmodified lines
572575 qpd->vmid,
573576 qpd->page_table_base);
574577 /* invalidate the VM context after pasid and vmid mapping is set up */
575− kfd_flush_tlb(qpd_to_pdd(qpd), TLB_FLUSH_LEGACY);
578+ kfd_flush_tlb(qpd_to_pdd(qpd));
576579
577580 if (dqm->dev->kfd2kgd->set_scratch_backing_va)
578581 dqm->dev->kfd2kgd->set_scratch_backing_va(dqm->dev->adev,
@@ -610,7 +613,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm, · 31 unmodified lines
610613 if (flush_texture_cache_nocpsch(q->device, qpd))
611614 dev_err(dev, "Failed to flush TC\n");
612615
613− kfd_flush_tlb(qpd_to_pdd(qpd), TLB_FLUSH_LEGACY);
616+ kfd_flush_tlb(qpd_to_pdd(qpd));
614617
615618 /* Release the vmid mapping */
616619 set_pasid_vmid_mapping(dqm, 0, qpd->vmid);
@@ -1284,7 +1287,7 @@ static int restore_process_queues_nocpsch(struct device_queue_manager *dqm, · 667 unmodified lines
12841287 dqm->dev->adev,
12851288 qpd->vmid,
12861289 qpd->page_table_base);
1287− kfd_flush_tlb(pdd, TLB_FLUSH_LEGACY);
1290+ kfd_flush_tlb(pdd);
12881291 }
12891292
12901293 /* Take a safe reference to the mm_struct, which may otherwise
@@ -1587,6 +1590,9 @@ static int allocate_sdma_queue(struct device_queue_manager *dqm, · 296 unmodified lines
15871590 }
15881591
15891592 if (restore_sdma_id) {
1593+ if (*restore_sdma_id >= get_num_sdma_queues(dqm))
1594+ return -EINVAL;
1595+
15901596 /* Re-use existing sdma_id */
15911597 if (!test_bit(*restore_sdma_id, dqm->sdma_bitmap)) {
15921598 dev_err(dev, "SDMA queue already in use\n");
@@ -1613,6 +1619,9 @@ static int allocate_sdma_queue(struct device_queue_manager *dqm, · 20 unmodified lines
16131619 return -ENOMEM;
16141620 }
16151621 if (restore_sdma_id) {
1622+ if (*restore_sdma_id >= get_num_xgmi_sdma_queues(dqm))
1623+ return -EINVAL;
1624+
16161625 /* Re-use existing sdma_id */
16171626 if (!test_bit(*restore_sdma_id, dqm->xgmi_sdma_bitmap)) {
16181627 dev_err(dev, "SDMA queue already in use\n");
@@ -3299,12 +3308,14 @@ static void copy_context_work_handler(struct work_struct *work) · 1680 unmodified lines
32993308
33003309 static uint32_t *get_queue_ids(uint32_t num_queues, uint32_t *usr_queue_id_array)
33013310 {
3302− size_t array_size = num_queues * sizeof(uint32_t);
3303−
33043311 if (!usr_queue_id_array)
33053312 return NULL;
33063313
3307− return memdup_user(usr_queue_id_array, array_size);
3314+ if (num_queues > KFD_MAX_NUM_OF_QUEUES_PER_PROCESS)
3315+ return ERR_PTR(-EINVAL);
3316+
3317+ return memdup_user(usr_queue_id_array,
3318+ array_size(num_queues, sizeof(uint32_t)));
33083319 }
33093320
33103321 int resume_queues(struct kfd_process *p,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c+8−3
@@ -364,11 +364,15 @@ static int get_wave_state(struct mqd_manager *mm, void *mqd, · 363 unmodified lines
364364 {
365365 struct v9_mqd *m;
366366 struct kfd_context_save_area_header header;
367+ u32 cntl_stack_size;
368+ u32 cntl_stack_offset;
367369
368370 /* Control stack is located one page after MQD. */
369371 void *mqd_ctl_stack = (void *)((uintptr_t)mqd + AMDGPU_GPU_PAGE_SIZE);
370372
371373 m = get_mqd(mqd);
374+ cntl_stack_size = min_t(u32, m->cp_hqd_cntl_stack_size, q->ctl_stack_size);
375+ cntl_stack_offset = min_t(u32, m->cp_hqd_cntl_stack_offset, cntl_stack_size);
372376
373377 *ctl_stack_used_size = m->cp_hqd_cntl_stack_size -
374378 m->cp_hqd_cntl_stack_offset;
@@ -384,9 +388,10 @@ static int get_wave_state(struct mqd_manager *mm, void *mqd, · 9 unmodified lines
384388 if (copy_to_user(ctl_stack, &header, sizeof(header.wave_state)))
385389 return -EFAULT;
386390
387− if (copy_to_user(ctl_stack + m->cp_hqd_cntl_stack_offset,
388− mqd_ctl_stack + m->cp_hqd_cntl_stack_offset,
389− *ctl_stack_used_size))
391+ *ctl_stack_used_size = cntl_stack_size - cntl_stack_offset;
392+
393+ if (copy_to_user(ctl_stack + cntl_stack_offset, mqd_ctl_stack + cntl_stack_offset,
394+ *ctl_stack_used_size))
390395 return -EFAULT;
391396
392397 return 0;
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+7−3
@@ -395,6 +395,7 @@ enum kfd_mempool { · 394 unmodified lines
395395 /* Character device interface */
396396 int kfd_chardev_init(void);
397397 void kfd_chardev_exit(void);
398+void kfd_dev_unmap_mapping_range(loff_t const holebegin, loff_t const holelen);
398399
399400 /**
400401 * enum kfd_unmap_queues_filter - Enum for queue filters.
@@ -1047,10 +1048,13 @@ extern struct srcu_struct kfd_processes_srcu; · 646 unmodified lines
10471048 typedef int amdkfd_ioctl_t(struct file *filep, struct kfd_process *p,
10481049 void *data);
10491050
1051+typedef int amdkfd_ioctl_validate_t(void *kdata, unsigned int usize);
1052+
10501053 struct amdkfd_ioctl_desc {
10511054 unsigned int cmd;
10521055 int flags;
10531056 amdkfd_ioctl_t *func;
1057+ amdkfd_ioctl_validate_t *validate;
10541058 unsigned int cmd_drv;
10551059 const char *name;
10561060 };
@@ -1551,13 +1555,13 @@ void kfd_signal_reset_event(struct kfd_node *dev); · 494 unmodified lines
15511555 void kfd_signal_poison_consumed_event(struct kfd_node *dev, u32 pasid);
15521556 void kfd_signal_process_terminate_event(struct kfd_process *p);
15531557
1554−static inline void kfd_flush_tlb(struct kfd_process_device *pdd,
1555− enum TLB_FLUSH_TYPE type)
1558+static inline void kfd_flush_tlb(struct kfd_process_device *pdd)
15561559 {
15571560 struct amdgpu_device *adev = pdd->dev->adev;
15581561 struct amdgpu_vm *vm = drm_priv_to_vm(pdd->drm_priv);
15591562
1560− amdgpu_vm_flush_compute_tlb(adev, vm, type, pdd->dev->xcc_mask);
1563+ amdgpu_vm_flush_compute_tlb(adev, vm, TLB_FLUSH_HEAVYWEIGHT,
1564+ pdd->dev->xcc_mask);
15611565 }
15621566
15631567 static inline bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c+16−2
@@ -1366,6 +1366,12 @@ svm_range_unmap_from_gpu(struct amdgpu_device *adev, struct amdgpu_vm *vm, · 1365 unmodified lines
13661366
13671367 pr_debug("CPU[0x%llx 0x%llx] -> GPU[0x%llx 0x%llx]\n", start, last,
13681368 gpu_start, gpu_end);
1369+
1370+ if (!amdgpu_vm_ready(vm)) {
1371+ pr_debug("VM not ready, canceling unmap\n");
1372+ return -EINVAL;
1373+ }
1374+
13691375 return amdgpu_vm_update_range(adev, vm, false, true, true, false, NULL, gpu_start,
13701376 gpu_end, init_pte_value, 0, 0, NULL, NULL,
13711377 fence);
@@ -1418,7 +1424,7 @@ svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start, · 46 unmodified lines
14181424 if (r)
14191425 break;
14201426 }
1421− kfd_flush_tlb(pdd, TLB_FLUSH_HEAVYWEIGHT);
1427+ kfd_flush_tlb(pdd);
14221428 }
14231429
14241430 return r;
@@ -1443,6 +1449,11 @@ svm_range_map_to_gpu(struct kfd_process_device *pdd, struct svm_range *prange, · 18 unmodified lines
14431449 pr_debug("svms 0x%p [0x%lx 0x%lx] readonly %d\n", prange->svms,
14441450 last_start, last_start + npages - 1, readonly);
14451451
1452+ if (!amdgpu_vm_ready(vm)) {
1453+ pr_debug("VM not ready, canceling map\n");
1454+ return -EINVAL;
1455+ }
1456+
14461457 for (i = offset; i < offset + npages; i++) {
14471458 uint64_t gpu_start;
14481459 uint64_t gpu_end;
@@ -1560,7 +1571,7 @@ svm_range_map_to_gpus(struct svm_range *prange, unsigned long offset, · 111 unmodified lines
15601571 }
15611572 }
15621573
1563− kfd_flush_tlb(pdd, TLB_FLUSH_LEGACY);
1574+ kfd_flush_tlb(pdd);
15641575 }
15651576
15661577 return r;
@@ -3721,6 +3732,9 @@ svm_range_set_attr(struct kfd_process *p, struct mm_struct *mm, · 2154 unmodified lines
37213732
37223733 svms = &p->svms;
37233734
3735+ if (!process_info)
3736+ return -EINVAL;
3737+
37243738 mutex_lock(&process_info->lock);
37253739
37263740 svm_range_list_lock_and_flush_work(svms, mm);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+20−4
@@ -1903,7 +1903,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1902 unmodified lines
19031903 goto error;
19041904 }
19051905
1906− init_data.asic_id.chip_family = adev->family;
1906+ /* special handling for early revisions of GC 11.5.4 */
1907+ if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 5, 4))
1908+ init_data.asic_id.chip_family = AMDGPU_FAMILY_GC_11_5_4;
1909+ else
1910+ init_data.asic_id.chip_family = adev->family;
19071911
19081912 init_data.asic_id.pci_revision_id = adev->pdev->revision;
19091913 init_data.asic_id.hw_internal_rev = adev->external_rev_id;
@@ -9404,9 +9408,21 @@ static void manage_dm_interrupts(struct amdgpu_device *adev, · 7494 unmodified lines
94049408 if (acrtc_state) {
94059409 timing = &acrtc_state->stream->timing;
94069410
9407− if (amdgpu_ip_version(adev, DCE_HWIP, 0) <
9408− IP_VERSION(3, 5, 0) ||
9409− !(adev->flags & AMD_IS_APU)) {
9411+ if (amdgpu_ip_version(adev, DCE_HWIP, 0) >=
9412+ IP_VERSION(3, 2, 0) &&
9413+ !(adev->flags & AMD_IS_APU)) {
9414+ /*
9415+ * DGPUs NV3x and newer that support idle optimizations
9416+ * experience intermittent flip-done timeouts on cursor
9417+ * updates. Restore 5s offdelay behavior for now.
9418+ *
9419+ * Discussion on the issue:
9420+ * https://lore.kernel.org/amd-gfx/20260217191632.1243826-1-sysdadmin@m1k.cloud/
9421+ */
9422+ config.offdelay_ms = 5000;
9423+ config.disable_immediate = false;
9424+ } else if (amdgpu_ip_version(adev, DCE_HWIP, 0) <
9425+ IP_VERSION(3, 5, 0)) {
94109426 /*
94119427 * Older HW and DGPU have issues with instant off;
94129428 * use a 2 frame offdelay.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c+44−0
@@ -1032,6 +1032,45 @@ dm_helpers_read_acpi_edid(struct amdgpu_dm_connector *aconnector) · 1031 unmodified lines
10321032 return drm_edid_read_custom(connector, dm_helpers_probe_acpi_edid, connector);
10331033 }
10341034
1035+static const struct drm_edid *
1036+dm_helpers_read_vbios_hardcoded_edid(struct dc_link *link, struct amdgpu_dm_connector *aconnector)
1037+{
1038+ struct dc_bios *bios = link->ctx->dc_bios;
1039+ struct embedded_panel_info info;
1040+ const struct drm_edid *edid;
1041+ enum bp_result r;
1042+
1043+ if (!dc_is_embedded_signal(link->connector_signal) ||
1044+ !bios->funcs->get_embedded_panel_info)
1045+ return NULL;
1046+
1047+ memset(&info, 0, sizeof(info));
1048+ r = bios->funcs->get_embedded_panel_info(bios, &info);
1049+
1050+ if (r != BP_RESULT_OK) {
1051+ dm_error("Error when reading embedded panel info: %u\n", r);
1052+ return NULL;
1053+ }
1054+
1055+ if (!info.fake_edid || !info.fake_edid_size) {
1056+ dm_error("Embedded panel info doesn't contain an EDID\n");
1057+ return NULL;
1058+ }
1059+
1060+ edid = drm_edid_alloc(info.fake_edid, info.fake_edid_size);
1061+
1062+ if (!drm_edid_valid(edid)) {
1063+ dm_error("EDID from embedded panel info is invalid\n");
1064+ drm_edid_free(edid);
1065+ return NULL;
1066+ }
1067+
1068+ aconnector->base.display_info.width_mm = info.panel_width_mm;
1069+ aconnector->base.display_info.height_mm = info.panel_height_mm;
1070+
1071+ return edid;
1072+}
1073+
10351074 void populate_hdmi_info_from_connector(struct drm_hdmi_info *hdmi, struct dc_edid_caps *edid_caps)
10361075 {
10371076 edid_caps->scdc_present = hdmi->scdc.supported;
@@ -1052,6 +1091,9 @@ enum dc_edid_status dm_helpers_read_local_edid( · 14 unmodified lines
10521091
10531092 if (link->aux_mode)
10541093 ddc = &aconnector->dm_dp_aux.aux.ddc;
1094+ else if (link->ddc_hw_inst == GPIO_DDC_LINE_UNKNOWN &&
1095+ dc_is_embedded_signal(link->connector_signal))
1096+ ddc = NULL;
10551097 else
10561098 ddc = &aconnector->i2c->base;
10571099
@@ -1065,6 +1107,8 @@ enum dc_edid_status dm_helpers_read_local_edid( · 7 unmodified lines
10651107 drm_edid = dm_helpers_read_acpi_edid(aconnector);
10661108 if (drm_edid)
10671109 drm_info(connector->dev, "Using ACPI provided EDID for %s\n", connector->name);
1110+ else if (!ddc)
1111+ drm_edid = dm_helpers_read_vbios_hardcoded_edid(link, aconnector);
10681112 else
10691113 drm_edid = drm_edid_read_ddc(connector, ddc);
10701114 drm_edid_connector_update(connector, drm_edid);
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c+72−1
@@ -794,11 +794,13 @@ static enum bp_result bios_parser_external_encoder_control( · 793 unmodified lines
794794
795795 static enum bp_result bios_parser_dac_load_detection(
796796 struct dc_bios *dcb,
797− enum engine_id engine_id)
797+ enum engine_id engine_id,
798+ struct graphics_object_id ext_enc_id)
798799 {
799800 struct bios_parser *bp = BP_FROM_DCB(dcb);
800801 struct dc_context *ctx = dcb->ctx;
801802 struct bp_load_detection_parameters bp_params = {0};
803+ struct bp_external_encoder_control ext_cntl = {0};
802804 enum bp_result bp_result = BP_RESULT_UNSUPPORTED;
803805 uint32_t bios_0_scratch;
804806 uint32_t device_id_mask = 0;
@@ -824,6 +826,13 @@ static enum bp_result bios_parser_dac_load_detection( · 19 unmodified lines
824826
825827 bp_params.engine_id = engine_id;
826828 bp_result = bp->cmd_tbl.dac_load_detection(bp, &bp_params);
829+ } else if (ext_enc_id.id) {
830+ if (!bp->cmd_tbl.external_encoder_control)
831+ return BP_RESULT_UNSUPPORTED;
832+
833+ ext_cntl.action = EXTERNAL_ENCODER_CONTROL_DAC_LOAD_DETECT;
834+ ext_cntl.encoder_id = ext_enc_id;
835+ bp_result = bp->cmd_tbl.external_encoder_control(bp, &ext_cntl);
827836 }
828837
829838 if (bp_result != BP_RESULT_OK)
@@ -1304,6 +1313,60 @@ static enum bp_result bios_parser_get_embedded_panel_info( · 474 unmodified lines
13041313 return BP_RESULT_FAILURE;
13051314 }
13061315
1316+static enum bp_result get_embedded_panel_extra_info(
1317+ struct bios_parser *bp,
1318+ struct embedded_panel_info *info,
1319+ const uint32_t table_offset)
1320+{
1321+ uint8_t *record = bios_get_image(&bp->base, table_offset, 1);
1322+ ATOM_PANEL_RESOLUTION_PATCH_RECORD *panel_res_record;
1323+ ATOM_FAKE_EDID_PATCH_RECORD *fake_edid_record;
1324+
1325+ while (*record != ATOM_RECORD_END_TYPE) {
1326+ switch (*record) {
1327+ case LCD_MODE_PATCH_RECORD_MODE_TYPE:
1328+ record += sizeof(ATOM_PATCH_RECORD_MODE);
1329+ break;
1330+ case LCD_RTS_RECORD_TYPE:
1331+ record += sizeof(ATOM_LCD_RTS_RECORD);
1332+ break;
1333+ case LCD_CAP_RECORD_TYPE:
1334+ record += sizeof(ATOM_LCD_MODE_CONTROL_CAP);
1335+ break;
1336+ case LCD_FAKE_EDID_PATCH_RECORD_TYPE:
1337+ fake_edid_record = (ATOM_FAKE_EDID_PATCH_RECORD *)record;
1338+ if (fake_edid_record->ucFakeEDIDLength) {
1339+ if (fake_edid_record->ucFakeEDIDLength == 128)
1340+ info->fake_edid_size =
1341+ fake_edid_record->ucFakeEDIDLength;
1342+ else
1343+ info->fake_edid_size =
1344+ fake_edid_record->ucFakeEDIDLength * 128;
1345+
1346+ info->fake_edid = fake_edid_record->ucFakeEDIDString;
1347+
1348+ record += struct_size(fake_edid_record,
1349+ ucFakeEDIDString,
1350+ info->fake_edid_size);
1351+ } else {
1352+ /* empty fake edid record must be 3 bytes long */
1353+ record += sizeof(ATOM_FAKE_EDID_PATCH_RECORD) + 1;
1354+ }
1355+ break;
1356+ case LCD_PANEL_RESOLUTION_RECORD_TYPE:
1357+ panel_res_record = (ATOM_PANEL_RESOLUTION_PATCH_RECORD *)record;
1358+ info->panel_width_mm = panel_res_record->usHSize;
1359+ info->panel_height_mm = panel_res_record->usVSize;
1360+ record += sizeof(ATOM_PANEL_RESOLUTION_PATCH_RECORD);
1361+ break;
1362+ default:
1363+ return BP_RESULT_BADBIOSTABLE;
1364+ }
1365+ }
1366+
1367+ return BP_RESULT_OK;
1368+}
1369+
13071370 static enum bp_result get_embedded_panel_info_v1_2(
13081371 struct bios_parser *bp,
13091372 struct embedded_panel_info *info)
@@ -1420,6 +1483,10 @@ static enum bp_result get_embedded_panel_info_v1_2( · 110 unmodified lines
14201483 if (ATOM_PANEL_MISC_API_ENABLED & lvds->ucLVDS_Misc)
14211484 info->lcd_timing.misc_info.API_ENABLED = true;
14221485
1486+ if (lvds->usExtInfoTableOffset)
1487+ return get_embedded_panel_extra_info(bp, info,
1488+ le16_to_cpu(lvds->usExtInfoTableOffset) + DATA_TABLES(LCD_Info));
1489+
14231490 return BP_RESULT_OK;
14241491 }
14251492
@@ -1545,6 +1612,10 @@ static enum bp_result get_embedded_panel_info_v1_3( · 119 unmodified lines
15451612 (uint32_t) (ATOM_PANEL_MISC_V13_GREY_LEVEL &
15461613 lvds->ucLCD_Misc) >> ATOM_PANEL_MISC_V13_GREY_LEVEL_SHIFT;
15471614
1615+ if (lvds->usExtInfoTableOffset)
1616+ return get_embedded_panel_extra_info(bp, info,
1617+ le16_to_cpu(lvds->usExtInfoTableOffset) + DATA_TABLES(LCD_Info));
1618+
15481619 return BP_RESULT_OK;
15491620 }
15501621
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c+9−0
@@ -493,6 +493,10 @@ static enum bp_result get_gpio_i2c_info( · 492 unmodified lines
493493 - sizeof(struct atom_common_table_header))
494494 / sizeof(struct atom_gpio_pin_assignment);
495495
496+ if (!bios_get_image(&bp->base, DATA_TABLES(gpio_pin_lut),
497+ le16_to_cpu(header->table_header.structuresize)))
498+ return BP_RESULT_BADBIOSTABLE;
499+
496500 pin = (struct atom_gpio_pin_assignment *) header->gpio_pin;
497501
498502 for (table_index = 0; table_index < count; table_index++) {
@@ -681,6 +685,11 @@ static enum bp_result bios_parser_get_gpio_pin_info( · 182 unmodified lines
681685 count = (le16_to_cpu(header->table_header.structuresize)
682686 - sizeof(struct atom_common_table_header))
683687 / sizeof(struct atom_gpio_pin_assignment);
688+
689+ if (!bios_get_image(&bp->base, DATA_TABLES(gpio_pin_lut),
690+ le16_to_cpu(header->table_header.structuresize)))
691+ return BP_RESULT_BADBIOSTABLE;
692+
684693 for (i = 0; i < count; ++i) {
685694 if (header->gpio_pin[i].gpio_id != gpio_id)
686695 continue;
drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c+6−3
@@ -37,10 +37,13 @@ uint8_t *bios_get_image(struct dc_bios *bp, · 36 unmodified lines
3737 uint32_t offset,
3838 uint32_t size)
3939 {
40− if (bp->bios && offset + size < bp->bios_size)
41− return bp->bios + offset;
42− else
40+ if (!bp->bios)
4341 return NULL;
42+
43+ if (offset > bp->bios_size || size > bp->bios_size - offset)
44+ return NULL;
45+
46+ return bp->bios + offset;
4447 }
4548
4649 #include "reg_helper.h"
drivers/gpu/drm/amd/display/dc/core/dc.c+5−1
@@ -6071,7 +6071,11 @@ bool dc_process_dmub_aux_transfer_async(struct dc *dc, · 6070 unmodified lines
60716071 uint8_t action;
60726072 union dmub_rb_cmd cmd = {0};
60736073
6074− ASSERT(payload->length <= 16);
6074+ if (link_index >= dc->link_count || !dc->links[link_index])
6075+ return false;
6076+
6077+ if (payload->length > sizeof(cmd.dp_aux_access.aux_control.dpaux.data))
6078+ return false;
60756079
60766080 cmd.dp_aux_access.header.type = DMUB_CMD__DP_AUX_ACCESS;
60776081 cmd.dp_aux_access.header.payload_bytes = 0;
drivers/gpu/drm/amd/display/dc/dc.h+1−1
@@ -1682,7 +1682,7 @@ struct dc_scratch_space { · 1681 unmodified lines
16821682 struct dc_link_training_overrides preferred_training_settings;
16831683 struct dp_audio_test_data audio_test_data;
16841684
1685− uint8_t ddc_hw_inst;
1685+ enum gpio_ddc_line ddc_hw_inst;
16861686
16871687 uint8_t hpd_src;
16881688
drivers/gpu/drm/amd/display/dc/dc_bios_types.h+2−1
@@ -102,7 +102,8 @@ struct dc_vbios_funcs { · 101 unmodified lines
102102 struct bp_external_encoder_control *cntl);
103103 enum bp_result (*dac_load_detection)(
104104 struct dc_bios *bios,
105− enum engine_id engine_id);
105+ enum engine_id engine_id,
106+ struct graphics_object_id ext_enc_id);
106107 enum bp_result (*transmitter_control)(
107108 struct dc_bios *bios,
108109 struct bp_transmitter_control *cntl);
drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c+13−2
@@ -105,15 +105,26 @@ static void dccg21_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppcl · 104 unmodified lines
105105 * dccg2_init() unconditionally overwrites MICROSECOND_TIME_BASE_DIV to
106106 * 0x00120264, destroying the marker before it can be read.
107107 *
108− * Guard the call: if the S0i3 marker is present, skip dccg2_init() so the
108+ * Guard the call: if the S0i3 marker is present, skip init so the
109109 * WA can function correctly. bios_golden_init() will handle init in that case.
110+ *
111+ * DCN21 uses 48MHz refclk, not 100MHz, so we must explicitly set the correct
112+ * values (48MHz is taken from rn_clk_mgr_construct()).
110113 */
111114 static void dccg21_init(struct dccg *dccg)
112115 {
116+ struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
117+
113118 if (dccg2_is_s0i3_golden_init_wa_done(dccg))
114119 return;
115120
116− dccg2_init(dccg);
121+ /* 48MHz refclk from rn_clk_mgr_construct() */
122+ REG_WRITE(MICROSECOND_TIME_BASE_DIV, 0x00120230);
123+ REG_WRITE(MILLISECOND_TIME_BASE_DIV, 0x0010bb80);
124+ REG_WRITE(DISPCLK_FREQ_CHANGE_CNTL, 0x0e01003c);
125+
126+ if (REG(REFCLK_CNTL))
127+ REG_WRITE(REFCLK_CNTL, 0);
117128 }
118129
119130 static const struct dccg_funcs dccg21_funcs = {
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c+3−1
@@ -1102,7 +1102,9 @@ void dce110_link_encoder_hw_init( · 1101 unmodified lines
11021102 ASSERT(result == BP_RESULT_OK);
11031103
11041104 }
1105− aux_initialize(enc110);
1105+
1106+ if (enc110->aux_regs)
1107+ aux_initialize(enc110);
11061108
11071109 /* reinitialize HPD.
11081110 * hpd_initialize() will pass DIG_FE id to HW context.
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mmhubbub.c+2−2
@@ -40,8 +40,8 @@ · 39 unmodified lines
4040 #define FN(reg_name, field_name) \
4141 mcif_wb30->mcif_wb_shift->field_name, mcif_wb30->mcif_wb_mask->field_name
4242
43−#define MCIF_ADDR(addr) (((unsigned long long)addr & 0xffffffffff) + 0xFE) >> 8
44−#define MCIF_ADDR_HIGH(addr) (unsigned long long)addr >> 40
43+#define MCIF_ADDR(addr) ((uint32_t)((((unsigned long long)(addr) & 0xffffffffffULL) + 0xFEULL) >> 8))
44+#define MCIF_ADDR_HIGH(addr) ((uint32_t)(((unsigned long long)(addr)) >> 40))
4545
4646 /* wbif programming guide:
4747 * 1. set up wbif parameter:
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c+3−0
@@ -646,6 +646,9 @@ failure: · 645 unmodified lines
646646 enum gpio_ddc_line dal_ddc_get_line(
647647 const struct ddc *ddc)
648648 {
649+ if (!ddc)
650+ return GPIO_DDC_LINE_UNKNOWN;
651+
649652 return (enum gpio_ddc_line)dal_gpio_get_enum(ddc->pin_data);
650653 }
651654
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c+59−35
@@ -665,16 +665,45 @@ void dce110_update_info_frame(struct pipe_ctx *pipe_ctx) · 664 unmodified lines
665665 }
666666
667667 static void
668−dce110_dac_encoder_control(struct pipe_ctx *pipe_ctx, bool enable)
668+dce110_external_encoder_control(enum bp_external_encoder_control_action action,
669+ struct dc_link *link,
670+ struct dc_crtc_timing *timing)
669671 {
670− struct dc_link *link = pipe_ctx->stream->link;
672+ struct dc *dc = link->ctx->dc;
671673 struct dc_bios *bios = link->ctx->dc_bios;
672− struct bp_encoder_control encoder_control = {0};
674+ const struct dc_link_settings *link_settings = &link->cur_link_settings;
675+ enum bp_result bp_result = BP_RESULT_OK;
676+ struct bp_external_encoder_control ext_cntl = {
677+ .action = action,
678+ .connector_obj_id = link->link_enc->connector,
679+ .encoder_id = link->ext_enc_id,
680+ .lanes_number = link_settings->lane_count,
681+ .link_rate = link_settings->link_rate,
682+
683+ /* Use signal type of the real link encoder, ie. DP */
684+ .signal = link->connector_signal,
685+
686+ /* We don't know the timing yet when executing the SETUP action,
687+ * so use a reasonably high default value. It seems that ENABLE
688+ * can change the actual pixel clock but doesn't work with higher
689+ * pixel clocks than what SETUP was called with.
690+ */
691+ .pixel_clock = timing ? timing->pix_clk_100hz / 10 : 300000,
692+ .color_depth = timing ? timing->display_color_depth : COLOR_DEPTH_888,
693+ };
694+ DC_LOGGER_INIT(dc->ctx);
673695
674− encoder_control.action = enable ? ENCODER_CONTROL_ENABLE : ENCODER_CONTROL_DISABLE;
675− encoder_control.engine_id = link->link_enc->analog_engine;
676− encoder_control.pixel_clock = pipe_ctx->stream->timing.pix_clk_100hz / 10;
677− bios->funcs->encoder_control(bios, &encoder_control);
696+ bp_result = bios->funcs->external_encoder_control(bios, &ext_cntl);
697+
698+ if (bp_result != BP_RESULT_OK)
699+ DC_LOG_ERROR("Failed to execute external encoder action: 0x%x\n", action);
700+}
701+
702+static void
703+dce110_prepare_ddc(struct dc_link *link)
704+{
705+ if (link->ext_enc_id.id)
706+ dce110_external_encoder_control(EXTERNAL_ENCODER_CONTROL_DDC_SETUP, link, NULL);
678707 }
679708
680709 static bool
@@ -684,7 +713,8 @@ dce110_dac_load_detect(struct dc_link *link) · 3 unmodified lines
684713 struct link_encoder *link_enc = link->link_enc;
685714 enum bp_result bp_result;
686715
687− bp_result = bios->funcs->dac_load_detection(bios, link_enc->analog_engine);
716+ bp_result = bios->funcs->dac_load_detection(
717+ bios, link_enc->analog_engine, link->ext_enc_id);
688718 return bp_result == BP_RESULT_OK;
689719 }
690720
@@ -700,7 +730,6 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx) · 9 unmodified lines
700730 uint32_t early_control = 0;
701731 struct timing_generator *tg = pipe_ctx->stream_res.tg;
702732
703− link_hwss->setup_stream_attribute(pipe_ctx);
704733 link_hwss->setup_stream_encoder(pipe_ctx);
705734
706735 dc->hwss.update_info_frame(pipe_ctx);
@@ -719,8 +748,8 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx) · 12 unmodified lines
719748
720749 tg->funcs->set_early_control(tg, early_control);
721750
722− if (dc_is_rgb_signal(pipe_ctx->stream->signal))
723− dce110_dac_encoder_control(pipe_ctx, true);
751+ if (link->ext_enc_id.id)
752+ dce110_external_encoder_control(EXTERNAL_ENCODER_CONTROL_ENABLE, link, timing);
724753 }
725754
726755 static enum bp_result link_transmitter_control(
@@ -1219,8 +1248,8 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) · 492 unmodified lines
12191248 link_enc->transmitter - TRANSMITTER_UNIPHY_A);
12201249 }
12211250
1222− if (dc_is_rgb_signal(pipe_ctx->stream->signal))
1223− dce110_dac_encoder_control(pipe_ctx, false);
1251+ if (link->ext_enc_id.id)
1252+ dce110_external_encoder_control(EXTERNAL_ENCODER_CONTROL_DISABLE, link, NULL);
12241253 }
12251254
12261255 void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,
@@ -1603,22 +1632,6 @@ static enum dc_status dce110_enable_stream_timing( · 376 unmodified lines
16031632
16041633 return DC_OK;
16051634 }
1606−static void
1607−dce110_select_crtc_source(struct pipe_ctx *pipe_ctx)
1608−{
1609− struct dc_link *link = pipe_ctx->stream->link;
1610− struct dc_bios *bios = link->ctx->dc_bios;
1611− struct bp_crtc_source_select crtc_source_select = {0};
1612− enum engine_id engine_id = link->link_enc->preferred_engine;
1613−
1614− if (dc_is_rgb_signal(pipe_ctx->stream->signal))
1615− engine_id = link->link_enc->analog_engine;
1616− crtc_source_select.controller_id = CONTROLLER_ID_D0 + pipe_ctx->stream_res.tg->inst;
1617− crtc_source_select.color_depth = pipe_ctx->stream->timing.display_color_depth;
1618− crtc_source_select.engine_id = engine_id;
1619− crtc_source_select.sink_signal = pipe_ctx->stream->signal;
1620− bios->funcs->select_crtc_source(bios, &crtc_source_select);
1621−}
16221635
16231636 enum dc_status dce110_apply_single_controller_ctx_to_hw(
16241637 struct pipe_ctx *pipe_ctx,
@@ -1639,10 +1652,6 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw( · 14 unmodified lines
16391652 hws->funcs.disable_stream_gating(dc, pipe_ctx);
16401653 }
16411654
1642− if (pipe_ctx->stream->signal == SIGNAL_TYPE_RGB) {
1643− dce110_select_crtc_source(pipe_ctx);
1644− }
1645−
16461655 if (pipe_ctx->stream_res.audio != NULL) {
16471656 struct audio_output audio_output = {0};
16481657
@@ -1722,8 +1731,7 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw( · 73 unmodified lines
17221731 pipe_ctx->stream_res.tg->funcs->set_static_screen_control(
17231732 pipe_ctx->stream_res.tg, event_triggers, 2);
17241733
1725− if (!dc_is_virtual_signal(pipe_ctx->stream->signal) &&
1726− !dc_is_rgb_signal(pipe_ctx->stream->signal))
1734+ if (!dc_is_virtual_signal(pipe_ctx->stream->signal))
17271735 pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg(
17281736 pipe_ctx->stream_res.stream_enc,
17291737 pipe_ctx->stream_res.tg->inst);
@@ -3376,6 +3384,15 @@ void dce110_enable_tmds_link_output(struct dc_link *link, · 1646 unmodified lines
33763384 link->phy_state.symclk_state = SYMCLK_ON_TX_ON;
33773385 }
33783386
3387+static void dce110_enable_analog_link_output(
3388+ struct dc_link *link,
3389+ uint32_t pix_clk_100hz)
3390+{
3391+ link->link_enc->funcs->enable_analog_output(
3392+ link->link_enc,
3393+ pix_clk_100hz);
3394+}
3395+
33793396 void dce110_enable_dp_link_output(
33803397 struct dc_link *link,
33813398 const struct link_resource *link_res,
@@ -3423,6 +3440,11 @@ void dce110_enable_dp_link_output( · 41 unmodified lines
34233440 }
34243441 }
34253442
3443+ if (link->ext_enc_id.id) {
3444+ dce110_external_encoder_control(EXTERNAL_ENCODER_CONTROL_INIT, link, NULL);
3445+ dce110_external_encoder_control(EXTERNAL_ENCODER_CONTROL_SETUP, link, NULL);
3446+ }
3447+
34263448 if (dc->link_srv->dp_get_encoding_format(link_settings) == DP_8b_10b_ENCODING) {
34273449 if (dc->clk_mgr->funcs->notify_link_rate_change)
34283450 dc->clk_mgr->funcs->notify_link_rate_change(dc->clk_mgr, link);
@@ -3513,8 +3535,10 @@ static const struct hw_sequencer_funcs dce110_funcs = { · 84 unmodified lines
35133535 .enable_lvds_link_output = dce110_enable_lvds_link_output,
35143536 .enable_tmds_link_output = dce110_enable_tmds_link_output,
35153537 .enable_dp_link_output = dce110_enable_dp_link_output,
3538+ .enable_analog_link_output = dce110_enable_analog_link_output,
35163539 .disable_link_output = dce110_disable_link_output,
35173540 .dac_load_detect = dce110_dac_load_detect,
3541+ .prepare_ddc = dce110_prepare_ddc,
35183542 };
35193543
35203544 static const struct hwseq_private_funcs dce110_private_funcs = {
drivers/gpu/drm/amd/display/dc/link/link_factory.c+3−1
@@ -568,7 +568,9 @@ static bool construct_phy(struct dc_link *link, · 567 unmodified lines
568568 goto ddc_create_fail;
569569 }
570570
571− if (!link->ddc->ddc_pin) {
571+ /* Embedded display connectors such as LVDS may not have DDC. */
572+ if (!link->ddc->ddc_pin &&
573+ !dc_is_embedded_signal(link->connector_signal)) {
572574 DC_ERROR("Failed to get I2C info for connector!\n");
573575 goto ddc_create_fail;
574576 }
drivers/gpu/drm/amd/display/dc/resource/dce60/dce60_resource.c+2−1
@@ -753,7 +753,8 @@ static struct link_encoder *dce60_link_encoder_create( · 752 unmodified lines
753753 enc_init_data,
754754 &link_enc_feature,
755755 &link_enc_regs[link_regs_id],
756− &link_enc_aux_regs[enc_init_data->channel - 1],
756+ enc_init_data->channel == CHANNEL_ID_UNKNOWN ?
757+ NULL : &link_enc_aux_regs[enc_init_data->channel - 1],
757758 enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
758759 NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);
759760 return &enc110->base;
drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c+2−1
@@ -760,7 +760,8 @@ static struct link_encoder *dce80_link_encoder_create( · 759 unmodified lines
760760 enc_init_data,
761761 &link_enc_feature,
762762 &link_enc_regs[link_regs_id],
763− &link_enc_aux_regs[enc_init_data->channel - 1],
763+ enc_init_data->channel == CHANNEL_ID_UNKNOWN ?
764+ NULL : &link_enc_aux_regs[enc_init_data->channel - 1],
764765 enc_init_data->hpd_source >= ARRAY_SIZE(link_enc_hpd_regs) ?
765766 NULL : &link_enc_hpd_regs[enc_init_data->hpd_source]);
766767 return &enc110->base;
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c+7−1
@@ -92,9 +92,14 @@ · 91 unmodified lines
9292 #include "dml/dcn32/dcn32_fpu.h"
9393
9494 #include "dc_state_priv.h"
95+#include "dc_fpu.h"
9596
9697 #include "dml2_0/dml2_wrapper.h"
9798
99+#if !defined(DC_RUN_WITH_PREEMPTION_ENABLED)
100+#define DC_RUN_WITH_PREEMPTION_ENABLED(code) code
101+#endif
102+
98103 #define DC_LOGGER_INIT(logger)
99104
100105 enum dcn32_clk_src_array_id {
@@ -1684,7 +1689,8 @@ static void dcn32_enable_phantom_plane(struct dc *dc, · 1583 unmodified lines
16841689 if (curr_pipe->top_pipe && curr_pipe->top_pipe->plane_state == curr_pipe->plane_state)
16851690 phantom_plane = prev_phantom_plane;
16861691 else
1687− phantom_plane = dc_state_create_phantom_plane(dc, context, curr_pipe->plane_state);
1692+ DC_RUN_WITH_PREEMPTION_ENABLED(phantom_plane =
1693+ dc_state_create_phantom_plane(dc, context, curr_pipe->plane_state));
16881694
16891695 if (!phantom_plane)
16901696 continue;
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h+4−0
@@ -153,6 +153,10 @@ struct embedded_panel_info { · 152 unmodified lines
153153 uint32_t drr_enabled;
154154 uint32_t min_drr_refresh_rate;
155155 bool realtek_eDPToLVDS;
156+ uint16_t panel_width_mm;
157+ uint16_t panel_height_mm;
158+ uint16_t fake_edid_size;
159+ const uint8_t *fake_edid;
156160 };
157161
158162 struct dc_firmware_info {
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c+4−0
@@ -3076,6 +3076,10 @@ static bool si_dpm_vblank_too_short(void *handle) · 3075 unmodified lines
30763076 /* we never hit the non-gddr5 limit so disable it */
30773077 u32 switch_limit = adev->gmc.vram_type == AMDGPU_VRAM_TYPE_GDDR5 ? 450 : 0;
30783078
3079+ /* Disregard vblank time when there are no displays connected */
3080+ if (!adev->pm.pm_display_cfg.num_display)
3081+ return false;
3082+
30793083 /* Consider zero vblank time too short and disable MCLK switching.
30803084 * Note that the vblank time is set to maximum when no displays are attached,
30813085 * so we'll still enable MCLK switching in that case.
drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c+7−6
@@ -1333,12 +1333,13 @@ static int ci_populate_all_memory_levels(struct pp_hwmgr *hwmgr) · 1332 unmodified lines
13331333
13341334 dev_id = adev->pdev->device;
13351335
1336− if ((dpm_table->mclk_table.count >= 2)
1337− && ((dev_id == 0x67B0) || (dev_id == 0x67B1))) {
1338− smu_data->smc_state_table.MemoryLevel[1].MinVddci =
1339− smu_data->smc_state_table.MemoryLevel[0].MinVddci;
1340− smu_data->smc_state_table.MemoryLevel[1].MinMvdd =
1341− smu_data->smc_state_table.MemoryLevel[0].MinMvdd;
1336+ if ((dpm_table->mclk_table.count >= 2) &&
1337+ ((dev_id == 0x67B0) || (dev_id == 0x67B1)) &&
1338+ (adev->pdev->revision == 0)) {
1339+ smu_data->smc_state_table.MemoryLevel[1].MinVddc =
1340+ smu_data->smc_state_table.MemoryLevel[0].MinVddc;
1341+ smu_data->smc_state_table.MemoryLevel[1].MinVddcPhases =
1342+ smu_data->smc_state_table.MemoryLevel[0].MinVddcPhases;
13421343 }
13431344 smu_data->smc_state_table.MemoryLevel[0].ActivityLevel = 0x1F;
13441345 CONVERT_FROM_HOST_TO_SMC_US(smu_data->smc_state_table.MemoryLevel[0].ActivityLevel);
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c+1−0
@@ -425,6 +425,7 @@ static int aldebaran_set_default_dpm_table(struct smu_context *smu) · 424 unmodified lines
425425 dpm_table->dpm_levels[0].enabled = true;
426426 dpm_table->dpm_levels[1].value = pptable->GfxclkFmax;
427427 dpm_table->dpm_levels[1].enabled = true;
428+ dpm_table->flags |= SMU_DPM_TABLE_FINE_GRAINED;
428429 } else {
429430 dpm_table->count = 1;
430431 dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.gfxclk / 100;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c+1−0
@@ -1129,6 +1129,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu) · 1128 unmodified lines
11291129 /* gfxclk dpm table setup */
11301130 dpm_table = &dpm_context->dpm_tables.gfx_table;
11311131 dpm_table->clk_type = SMU_GFXCLK;
1132+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
11321133 if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
11331134 /* In the case of gfxclk, only fine-grained dpm is honored.
11341135 * Get min/max values from FW.
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c+2−0
@@ -435,10 +435,12 @@ int smu_v15_0_fini_smc_tables(struct smu_context *smu) · 434 unmodified lines
435435 smu_table->watermarks_table = NULL;
436436 smu_table->metrics_time = 0;
437437
438+ kfree(smu_dpm->dpm_policies);
438439 kfree(smu_dpm->dpm_context);
439440 kfree(smu_dpm->golden_dpm_context);
440441 kfree(smu_dpm->dpm_current_power_state);
441442 kfree(smu_dpm->dpm_request_power_state);
443+ smu_dpm->dpm_policies = NULL;
442444 smu_dpm->dpm_context = NULL;
443445 smu_dpm->golden_dpm_context = NULL;
444446 smu_dpm->dpm_context_size = 0;
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c+1−1
@@ -1370,7 +1370,7 @@ int smu_cmn_print_dpm_clk_levels(struct smu_context *smu, · 1369 unmodified lines
13701370 level_index = 1;
13711371 }
13721372
1373− if (!is_fine_grained) {
1373+ if (!is_fine_grained || count == 1) {
13741374 for (i = 0; i < count; i++) {
13751375 freq_match = !is_deep_sleep &&
13761376 smu_cmn_freqs_match(
drivers/gpu/drm/bridge/chipone-icn6211.c+3−1
@@ -758,7 +758,9 @@ static int chipone_i2c_probe(struct i2c_client *client) · 757 unmodified lines
758758 dev_set_drvdata(dev, icn);
759759 i2c_set_clientdata(client, icn);
760760
761− drm_bridge_add(&icn->bridge);
761+ ret = devm_drm_bridge_add(dev, &icn->bridge);
762+ if (ret)
763+ return ret;
762764
763765 return chipone_dsi_host_attach(icn);
764766 }
drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c+23−17
@@ -222,52 +222,58 @@ static const struct drm_bridge_funcs imx8qxp_pxl2dpi_bridge_funcs = { · 221 unmodified lines
222222 imx8qxp_pxl2dpi_bridge_atomic_get_output_bus_fmts,
223223 };
224224
225−static struct device_node *
225+static int
226226 imx8qxp_pxl2dpi_get_available_ep_from_port(struct imx8qxp_pxl2dpi *p2d,
227− u32 port_id)
227+ u32 port_id,
228+ struct device_node **ep)
228229 {
229− struct device_node *port, *ep;
230+ struct device_node *port;
231+ int ret = 0;
230232 int ep_cnt;
231233
234+ *ep = NULL;
235+
232236 port = of_graph_get_port_by_id(p2d->dev->of_node, port_id);
233237 if (!port) {
234238 DRM_DEV_ERROR(p2d->dev, "failed to get port@%u\n", port_id);
235− return ERR_PTR(-ENODEV);
239+ return -ENODEV;
236240 }
237241
238242 ep_cnt = of_get_available_child_count(port);
239243 if (ep_cnt == 0) {
240244 DRM_DEV_ERROR(p2d->dev, "no available endpoints of port@%u\n",
241245 port_id);
242− ep = ERR_PTR(-ENODEV);
246+ ret = -ENODEV;
243247 goto out;
244248 } else if (ep_cnt > 1) {
245249 DRM_DEV_ERROR(p2d->dev,
246250 "invalid available endpoints of port@%u\n",
247251 port_id);
248− ep = ERR_PTR(-EINVAL);
252+ ret = -EINVAL;
249253 goto out;
250254 }
251255
252− ep = of_get_next_available_child(port, NULL);
253− if (!ep) {
256+ *ep = of_get_next_available_child(port, NULL);
257+ if (!*ep) {
254258 DRM_DEV_ERROR(p2d->dev,
255259 "failed to get available endpoint of port@%u\n",
256260 port_id);
257− ep = ERR_PTR(-ENODEV);
261+ ret = -ENODEV;
258262 goto out;
259263 }
260264 out:
261265 of_node_put(port);
262− return ep;
266+ return ret;
263267 }
264268
265269 static int imx8qxp_pxl2dpi_find_next_bridge(struct imx8qxp_pxl2dpi *p2d)
266270 {
267− struct device_node *ep __free(device_node) =
268− imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 1);
269− if (IS_ERR(ep))
270− return PTR_ERR(ep);
271+ struct device_node *ep __free(device_node) = NULL;
272+ int ret;
273+
274+ ret = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 1, &ep);
275+ if (ret)
276+ return ret;
271277
272278 struct device_node *remote __free(device_node) = of_graph_get_remote_port_parent(ep);
273279 if (!remote || !of_device_is_available(remote)) {
@@ -291,9 +297,9 @@ static int imx8qxp_pxl2dpi_set_pixel_link_sel(struct imx8qxp_pxl2dpi *p2d) · 17 unmodified lines
291297 struct of_endpoint endpoint;
292298 int ret;
293299
294− ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 0);
295− if (IS_ERR(ep))
296− return PTR_ERR(ep);
300+ ret = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 0, &ep);
301+ if (ret)
302+ return ret;
297303
298304 ret = of_graph_parse_endpoint(ep, &endpoint);
299305 if (ret) {
drivers/gpu/drm/bridge/ite-it66121.c+5−0
@@ -1559,6 +1559,11 @@ static int it66121_probe(struct i2c_client *client) · 1558 unmodified lines
15591559 return ret;
15601560 }
15611561
1562+ ctx->gpio_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
1563+ if (IS_ERR(ctx->gpio_reset))
1564+ return dev_err_probe(dev, PTR_ERR(ctx->gpio_reset),
1565+ "Failed to get reset GPIO\n");
1566+
15621567 it66121_hw_reset(ctx);
15631568
15641569 ctx->regmap = devm_regmap_init_i2c(client, &it66121_regmap_config);
drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c+10−6
@@ -251,7 +251,6 @@ static void ge_b850v3_lvds_remove(void) · 250 unmodified lines
251251 goto out;
252252
253253 drm_bridge_remove(&ge_b850v3_lvds_ptr->bridge);
254−
255254 ge_b850v3_lvds_ptr = NULL;
256255 out:
257256 mutex_unlock(&ge_b850v3_lvds_dev_mutex);
@@ -261,6 +260,7 @@ static int ge_b850v3_register(void) · 3 unmodified lines
261260 {
262261 struct i2c_client *stdp4028_i2c = ge_b850v3_lvds_ptr->stdp4028_i2c;
263262 struct device *dev = &stdp4028_i2c->dev;
263+ int ret;
264264
265265 /* drm bridge initialization */
266266 ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT |
@@ -277,11 +277,15 @@ static int ge_b850v3_register(void) · 10 unmodified lines
277277 if (!stdp4028_i2c->irq)
278278 return 0;
279279
280− return devm_request_threaded_irq(&stdp4028_i2c->dev,
281− stdp4028_i2c->irq, NULL,
282− ge_b850v3_lvds_irq_handler,
283− IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
284− "ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
280+ ret = devm_request_threaded_irq(&stdp4028_i2c->dev,
281+ stdp4028_i2c->irq, NULL,
282+ ge_b850v3_lvds_irq_handler,
283+ IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
284+ "ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
285+ if (ret)
286+ drm_bridge_remove(&ge_b850v3_lvds_ptr->bridge);
287+
288+ return ret;
285289 }
286290
287291 static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c)
drivers/gpu/drm/bridge/tda998x_drv.c+2−2
@@ -1293,7 +1293,7 @@ static const struct drm_edid *tda998x_edid_read(struct tda998x_priv *priv, · 1292 unmodified lines
12931293 * can't handle signals gracefully.
12941294 */
12951295 if (tda998x_edid_delay_wait(priv))
1296− return 0;
1296+ return NULL;
12971297
12981298 if (priv->rev == TDA19988)
12991299 reg_clear(priv, REG_TX4, TX4_PD_RAM);
@@ -1762,7 +1762,7 @@ static const struct drm_bridge_funcs tda998x_bridge_funcs = { · 462 unmodified lines
17621762 static int tda998x_get_audio_ports(struct tda998x_priv *priv,
17631763 struct device_node *np)
17641764 {
1765− const u32 *port_data;
1765+ const __be32 *port_data;
17661766 u32 size;
17671767 int i;
17681768
drivers/gpu/drm/drm_color_mgmt.c+1−1
@@ -831,7 +831,7 @@ static void fill_palette_332(struct drm_crtc *crtc, u16 r, u16 g, u16 b, · 830 unmodified lines
831831 }
832832
833833 /**
834− * drm_crtc_fill_palette_332 - Programs a default palette for R332-like formats
834+ * drm_crtc_fill_palette_332 - Programs a default palette for RGB332-like formats
835835 * @crtc: The displaying CRTC
836836 * @set_palette: Callback for programming the hardware gamma LUT
837837 *
drivers/gpu/drm/drm_drv.c+2−0
@@ -697,6 +697,7 @@ static void drm_dev_init_release(struct drm_device *dev, void *res) · 696 unmodified lines
697697 mutex_destroy(&dev->master_mutex);
698698 mutex_destroy(&dev->clientlist_mutex);
699699 mutex_destroy(&dev->filelist_mutex);
700+ mutex_destroy(&dev->gem_lru_mutex);
700701 }
701702
702703 static int drm_dev_init(struct drm_device *dev,
@@ -738,6 +739,7 @@ static int drm_dev_init(struct drm_device *dev, · 35 unmodified lines
738739 INIT_LIST_HEAD(&dev->vblank_event_list);
739740
740741 spin_lock_init(&dev->event_lock);
742+ mutex_init(&dev->gem_lru_mutex);
741743 mutex_init(&dev->filelist_mutex);
742744 mutex_init(&dev->clientlist_mutex);
743745 mutex_init(&dev->master_mutex);
drivers/gpu/drm/drm_dumb_buffers.c+12−2
@@ -70,8 +70,11 @@ static int drm_mode_align_dumb(struct drm_mode_create_dumb *args, · 69 unmodified lines
7070 if (!pitch)
7171 return -EINVAL;
7272
73− if (hw_pitch_align)
73+ if (hw_pitch_align) {
7474 pitch = roundup(pitch, hw_pitch_align);
75+ if (pitch < hw_pitch_align)
76+ return -EINVAL;
77+ }
7578
7679 if (!hw_size_align)
7780 hw_size_align = PAGE_SIZE;
@@ -80,7 +83,7 @@ static int drm_mode_align_dumb(struct drm_mode_create_dumb *args, · 2 unmodified lines
8083
8184 if (check_mul_overflow(args->height, pitch, &size))
8285 return -EINVAL;
83− size = ALIGN(size, hw_size_align);
86+ size = roundup(size, hw_size_align);
8487 if (!size)
8588 return -EINVAL;
8689
@@ -199,6 +202,13 @@ int drm_mode_create_dumb(struct drm_device *dev, · 112 unmodified lines
199202 if (!args->width || !args->height || !args->bpp)
200203 return -EINVAL;
201204
205+ /* Reject unreasonable inputs early. Dumb buffers are for software
206+ * rendering; nothing legitimate needs more than 8192x8192 at 32bpp.
207+ * This prevents overflows in downstream alignment helpers.
208+ */
209+ if (args->width >= 8192 || args->height >= 8192 || args->bpp > 32)
210+ return -EINVAL;
211+
202212 /* overflow checks for 32bit size calculations */
203213 if (args->bpp > U32_MAX - 8)
204214 return -EINVAL;
drivers/gpu/drm/drm_fb_helper.c+1−1
@@ -490,7 +490,7 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, · 489 unmodified lines
490490 * the number of horizontal pixels that need an update.
491491 */
492492 off_t bit_off = (off % line_length) * 8;
493− off_t bit_end = (end % line_length) * 8;
493+ off_t bit_end = bit_off + len * 8;
494494
495495 x1 = bit_off / info->var.bits_per_pixel;
496496 x2 = DIV_ROUND_UP(bit_end, info->var.bits_per_pixel);
drivers/gpu/drm/drm_gem.c+42−24
@@ -1019,7 +1019,7 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data, · 1018 unmodified lines
10191019 struct drm_file *file_priv)
10201020 {
10211021 struct drm_gem_change_handle *args = data;
1022− struct drm_gem_object *obj;
1022+ struct drm_gem_object *obj, *idrobj;
10231023 int handle, ret;
10241024
10251025 if (!drm_core_check_feature(dev, DRIVER_GEM))
@@ -1042,12 +1042,31 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data, · 16 unmodified lines
10421042 mutex_lock(&file_priv->prime.lock);
10431043
10441044 spin_lock(&file_priv->table_lock);
1045+
1046+ /* When create_tail allocs an obj idr, it needs to first alloc as NULL,
1047+ * then later replace with the correct object. This is not necessary
1048+ * here, because the only operations that could race are drm_prime
1049+ * bookkeeping, and we hold the prime lock.
1050+ */
10451051 ret = idr_alloc(&file_priv->object_idr, obj, handle, handle + 1,
10461052 GFP_NOWAIT);
1047− spin_unlock(&file_priv->table_lock);
10481053
1049− if (ret < 0)
1050− goto out_unlock;
1054+ if (ret < 0) {
1055+ spin_unlock(&file_priv->table_lock);
1056+ goto out_unlock;
1057+ }
1058+
1059+ idrobj = idr_replace(&file_priv->object_idr, NULL, handle);
1060+ if (idrobj != obj) {
1061+ idr_replace(&file_priv->object_idr, idrobj, handle);
1062+ idr_remove(&file_priv->object_idr, args->new_handle);
1063+ spin_unlock(&file_priv->table_lock);
1064+ ret = -ENOENT;
1065+ goto out_unlock;
1066+ }
1067+
1068+ idr_replace(&file_priv->object_idr, NULL, args->handle);
1069+ spin_unlock(&file_priv->table_lock);
10511070
10521071 if (obj->dma_buf) {
10531072 ret = drm_prime_add_buf_handle(&file_priv->prime, obj->dma_buf,
@@ -1055,6 +1074,7 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data, · 1 unmodified line
10551074 if (ret < 0) {
10561075 spin_lock(&file_priv->table_lock);
10571076 idr_remove(&file_priv->object_idr, handle);
1077+ idr_replace(&file_priv->object_idr, obj, args->handle);
10581078 spin_unlock(&file_priv->table_lock);
10591079 goto out_unlock;
10601080 }
@@ -1066,7 +1086,9 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data, · 5 unmodified lines
10661086
10671087 spin_lock(&file_priv->table_lock);
10681088 idr_remove(&file_priv->object_idr, args->handle);
1089+ idrobj = idr_replace(&file_priv->object_idr, obj, handle);
10691090 spin_unlock(&file_priv->table_lock);
1091+ WARN_ON(idrobj != NULL);
10701092
10711093 out_unlock:
10721094 mutex_unlock(&file_priv->prime.lock);
@@ -1541,12 +1563,10 @@ EXPORT_SYMBOL(drm_gem_unlock_reservations); · 468 unmodified lines
15411563 * drm_gem_lru_init - initialize a LRU
15421564 *
15431565 * @lru: The LRU to initialize
1544− * @lock: The lock protecting the LRU
15451566 */
15461567 void
1547−drm_gem_lru_init(struct drm_gem_lru *lru, struct mutex *lock)
1568+drm_gem_lru_init(struct drm_gem_lru *lru)
15481569 {
1549− lru->lock = lock;
15501570 lru->count = 0;
15511571 INIT_LIST_HEAD(&lru->list);
15521572 }
@@ -1571,14 +1591,10 @@ drm_gem_lru_remove_locked(struct drm_gem_object *obj) · 18 unmodified lines
15711591 void
15721592 drm_gem_lru_remove(struct drm_gem_object *obj)
15731593 {
1574− struct drm_gem_lru *lru = obj->lru;
1575−
1576− if (!lru)
1577− return;
1578−
1579− mutex_lock(lru->lock);
1580− drm_gem_lru_remove_locked(obj);
1581− mutex_unlock(lru->lock);
1594+ mutex_lock(&obj->dev->gem_lru_mutex);
1595+ if (obj->lru)
1596+ drm_gem_lru_remove_locked(obj);
1597+ mutex_unlock(&obj->dev->gem_lru_mutex);
15821598 }
15831599 EXPORT_SYMBOL(drm_gem_lru_remove);
15841600
@@ -1593,7 +1609,7 @@ EXPORT_SYMBOL(drm_gem_lru_remove); · 8 unmodified lines
15931609 void
15941610 drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj)
15951611 {
1596− lockdep_assert_held_once(lru->lock);
1612+ lockdep_assert_held_once(&obj->dev->gem_lru_mutex);
15971613
15981614 if (obj->lru)
15991615 drm_gem_lru_remove_locked(obj);
@@ -1617,9 +1633,9 @@ EXPORT_SYMBOL(drm_gem_lru_move_tail_locked); · 17 unmodified lines
16171633 void
16181634 drm_gem_lru_move_tail(struct drm_gem_lru *lru, struct drm_gem_object *obj)
16191635 {
1620− mutex_lock(lru->lock);
1636+ mutex_lock(&obj->dev->gem_lru_mutex);
16211637 drm_gem_lru_move_tail_locked(lru, obj);
1622− mutex_unlock(lru->lock);
1638+ mutex_unlock(&obj->dev->gem_lru_mutex);
16231639 }
16241640 EXPORT_SYMBOL(drm_gem_lru_move_tail);
16251641
@@ -1633,6 +1649,7 @@ EXPORT_SYMBOL(drm_gem_lru_move_tail); · 7 unmodified lines
16331649 * of the shrink callback to check for this (ie. dma_resv_test_signaled())
16341650 * or if necessary block until the buffer becomes idle.
16351651 *
1652+ * @dev: DRM device the LRU belongs to
16361653 * @lru: The LRU to scan
16371654 * @nr_to_scan: The number of pages to try to reclaim
16381655 * @remaining: The number of pages left to reclaim, should be initialized by caller
@@ -1640,7 +1657,8 @@ EXPORT_SYMBOL(drm_gem_lru_move_tail); · 1 unmodified line
16401657 * @ticket: Optional ww_acquire_ctx context to use for locking
16411658 */
16421659 unsigned long
1643−drm_gem_lru_scan(struct drm_gem_lru *lru,
1660+drm_gem_lru_scan(struct drm_device *dev,
1661+ struct drm_gem_lru *lru,
16441662 unsigned int nr_to_scan,
16451663 unsigned long *remaining,
16461664 bool (*shrink)(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket),
@@ -1650,9 +1668,9 @@ drm_gem_lru_scan(struct drm_gem_lru *lru, · 3 unmodified lines
16501668 struct drm_gem_object *obj;
16511669 unsigned freed = 0;
16521670
1653− drm_gem_lru_init(&still_in_lru, lru->lock);
1671+ drm_gem_lru_init(&still_in_lru);
16541672
1655− mutex_lock(lru->lock);
1673+ mutex_lock(&dev->gem_lru_mutex);
16561674
16571675 while (freed < nr_to_scan) {
16581676 obj = list_first_entry_or_null(&lru->list, typeof(*obj), lru_node);
@@ -1675,7 +1693,7 @@ drm_gem_lru_scan(struct drm_gem_lru *lru, · 16 unmodified lines
16751693 * rest of the loop body, to reduce contention with other
16761694 * code paths that need the LRU lock
16771695 */
1678− mutex_unlock(lru->lock);
1696+ mutex_unlock(&dev->gem_lru_mutex);
16791697
16801698 if (ticket)
16811699 ww_acquire_init(ticket, &reservation_ww_class);
@@ -1709,7 +1727,7 @@ drm_gem_lru_scan(struct drm_gem_lru *lru, · 27 unmodified lines
17091727
17101728 tail:
17111729 drm_gem_object_put(obj);
1712− mutex_lock(lru->lock);
1730+ mutex_lock(&dev->gem_lru_mutex);
17131731 }
17141732
17151733 /*
@@ -1721,7 +1739,7 @@ tail: · 5 unmodified lines
17211739 list_splice_tail(&still_in_lru.list, &lru->list);
17221740 lru->count += still_in_lru.count;
17231741
1724− mutex_unlock(lru->lock);
1742+ mutex_unlock(&dev->gem_lru_mutex);
17251743
17261744 return freed;
17271745 }
drivers/gpu/drm/drm_gem_framebuffer_helper.c+2−2
@@ -172,8 +172,8 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev, · 171 unmodified lines
172172 }
173173
174174 for (i = 0; i < info->num_planes; i++) {
175− unsigned int width = mode_cmd->width / (i ? info->hsub : 1);
176− unsigned int height = mode_cmd->height / (i ? info->vsub : 1);
175+ unsigned int width = drm_format_info_plane_width(info, mode_cmd->width, i);
176+ unsigned int height = drm_format_info_plane_height(info, mode_cmd->height, i);
177177 unsigned int min_size;
178178
179179 objs[i] = drm_gem_object_lookup(file, mode_cmd->handles[i]);
drivers/gpu/drm/etnaviv/etnaviv_sched.c+9−7
@@ -116,16 +116,18 @@ int etnaviv_sched_push_job(struct etnaviv_gem_submit *submit) · 115 unmodified lines
116116 */
117117 mutex_lock(&gpu->sched_lock);
118118
119+ ret = xa_alloc_cyclic(&gpu->user_fences, &submit->out_fence_id,
120+ NULL, xa_limit_32b, &gpu->next_user_fence,
121+ GFP_KERNEL);
122+ if (ret < 0)
123+ goto out_unlock;
124+
119125 drm_sched_job_arm(&submit->sched_job);
120126
121127 submit->out_fence = dma_fence_get(&submit->sched_job.s_fence->finished);
122− ret = xa_alloc_cyclic(&gpu->user_fences, &submit->out_fence_id,
123− submit->out_fence, xa_limit_32b,
124− &gpu->next_user_fence, GFP_KERNEL);
125− if (ret < 0) {
126− drm_sched_job_cleanup(&submit->sched_job);
127− goto out_unlock;
128− }
128+
129+ xa_store(&gpu->user_fences, submit->out_fence_id,
130+ submit->out_fence, GFP_KERNEL);
129131
130132 /* the scheduler holds on to the job now */
131133 kref_get(&submit->refcount);
drivers/gpu/drm/exynos/exynos_drm_mic.c+3−5
@@ -423,7 +423,9 @@ static int exynos_mic_probe(struct platform_device *pdev) · 422 unmodified lines
423423
424424 mic->bridge.of_node = dev->of_node;
425425
426− drm_bridge_add(&mic->bridge);
426+ ret = devm_drm_bridge_add(dev, &mic->bridge);
427+ if (ret)
428+ goto err;
427429
428430 pm_runtime_enable(dev);
429431
@@ -443,12 +445,8 @@ err: · 13 unmodified lines
443445
444446 static void exynos_mic_remove(struct platform_device *pdev)
445447 {
446− struct exynos_mic *mic = platform_get_drvdata(pdev);
447−
448448 component_del(&pdev->dev, &exynos_mic_component_ops);
449449 pm_runtime_disable(&pdev->dev);
450−
451− drm_bridge_remove(&mic->bridge);
452450 }
453451
454452 static const struct of_device_id exynos_mic_of_match[] = {
drivers/gpu/drm/gma500/oaktrail_hdmi.c+1−0
@@ -580,6 +580,7 @@ static int oaktrail_hdmi_get_modes(struct drm_connector *connector) · 579 unmodified lines
580580 } else {
581581 edid = (struct edid *)raw_edid;
582582 /* FIXME ? edid = drm_get_edid(connector, i2c_adap); */
583+ i2c_put_adapter(i2c_adap);
583584 }
584585
585586 if (edid) {
drivers/gpu/drm/gma500/oaktrail_lvds.c+7−2
@@ -293,7 +293,7 @@ void oaktrail_lvds_init(struct drm_device *dev, · 292 unmodified lines
293293 {
294294 struct gma_encoder *gma_encoder;
295295 struct gma_connector *gma_connector;
296− struct gma_i2c_chan *ddc_bus;
296+ struct gma_i2c_chan *ddc_bus = NULL;
297297 struct drm_connector *connector;
298298 struct drm_encoder *encoder;
299299 struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
@@ -367,6 +367,8 @@ void oaktrail_lvds_init(struct drm_device *dev, · 67 unmodified lines
367367 if (edid == NULL && dev_priv->lpc_gpio_base) {
368368 ddc_bus = oaktrail_lvds_i2c_init(dev);
369369 if (!IS_ERR(ddc_bus)) {
370+ if (i2c_adap)
371+ i2c_put_adapter(i2c_adap);
370372 i2c_adap = &ddc_bus->base;
371373 edid = drm_get_edid(connector, i2c_adap);
372374 }
@@ -421,7 +423,10 @@ out: · 48 unmodified lines
421423
422424 err_unlock:
423425 mutex_unlock(&dev->mode_config.mutex);
424− gma_i2c_destroy(to_gma_i2c_chan(connector->ddc));
426+ if (!IS_ERR_OR_NULL(ddc_bus))
427+ gma_i2c_destroy(ddc_bus);
428+ else if (i2c_adap)
429+ i2c_put_adapter(i2c_adap);
425430 drm_encoder_cleanup(encoder);
426431 err_connector_cleanup:
427432 drm_connector_cleanup(connector);
drivers/gpu/drm/hyperv/hyperv_drm_proto.c+97−16
@@ -391,8 +391,11 @@ static int hyperv_get_supported_resolution(struct hv_device *hdev) · 390 unmodified lines
391391 return -ETIMEDOUT;
392392 }
393393
394− if (msg->resolution_resp.resolution_count == 0) {
395− drm_err(dev, "No supported resolutions\n");
394+ if (msg->resolution_resp.resolution_count == 0 ||
395+ msg->resolution_resp.resolution_count >
396+ SYNTHVID_MAX_RESOLUTION_COUNT) {
397+ drm_err(dev, "Invalid resolution count: %d\n",
398+ msg->resolution_resp.resolution_count);
396399 return -ENODEV;
397400 }
398401
@@ -417,30 +420,92 @@ static int hyperv_get_supported_resolution(struct hv_device *hdev) · 18 unmodified lines
417420 return 0;
418421 }
419422
420−static void hyperv_receive_sub(struct hv_device *hdev)
423+static void hyperv_receive_sub(struct hv_device *hdev, u32 bytes_recvd)
421424 {
422425 struct hyperv_drm_device *hv = hv_get_drvdata(hdev);
423426 struct synthvid_msg *msg;
427+ size_t hdr_size;
428+ size_t need;
424429
425430 if (!hv)
426431 return;
427432
428− msg = (struct synthvid_msg *)hv->recv_buf;
429−
430− /* Complete the wait event */
431− if (msg->vid_hdr.type == SYNTHVID_VERSION_RESPONSE ||
432− msg->vid_hdr.type == SYNTHVID_RESOLUTION_RESPONSE ||
433− msg->vid_hdr.type == SYNTHVID_VRAM_LOCATION_ACK) {
434− memcpy(hv->init_buf, msg, VMBUS_MAX_PACKET_SIZE);
435− complete(&hv->wait);
433+ hdr_size = sizeof(struct pipe_msg_hdr) +
434+ sizeof(struct synthvid_msg_hdr);
435+ if (bytes_recvd < hdr_size) {
436+ drm_err_ratelimited(&hv->dev,
437+ "synthvid packet too small for header: %u\n",
438+ bytes_recvd);
436439 return;
437440 }
438441
439− if (msg->vid_hdr.type == SYNTHVID_FEATURE_CHANGE) {
442+ msg = (struct synthvid_msg *)hv->recv_buf;
443+ need = hdr_size;
444+
445+ switch (msg->vid_hdr.type) {
446+ case SYNTHVID_VERSION_RESPONSE:
447+ need += sizeof(struct synthvid_version_resp);
448+ break;
449+ case SYNTHVID_RESOLUTION_RESPONSE:
450+ /*
451+ * The resolution response is variable length: the host
452+ * fills resolution_count entries, not the full
453+ * SYNTHVID_MAX_RESOLUTION_COUNT array. Require the fixed
454+ * prefix first so resolution_count can be read, then
455+ * demand exactly the count-sized array.
456+ */
457+ need += offsetof(struct synthvid_supported_resolution_resp,
458+ supported_resolution);
459+ if (bytes_recvd < need)
460+ break;
461+ if (msg->resolution_resp.resolution_count >
462+ SYNTHVID_MAX_RESOLUTION_COUNT) {
463+ drm_err_ratelimited(&hv->dev,
464+ "synthvid resolution count too large: %u\n",
465+ msg->resolution_resp.resolution_count);
466+ return;
467+ }
468+ need += msg->resolution_resp.resolution_count *
469+ sizeof(struct hvd_screen_info);
470+ break;
471+ case SYNTHVID_VRAM_LOCATION_ACK:
472+ need += sizeof(struct synthvid_vram_location_ack);
473+ break;
474+ case SYNTHVID_FEATURE_CHANGE:
475+ /*
476+ * Not a completion-driving message: validate its own payload
477+ * and consume it here rather than falling through to the
478+ * memcpy/complete shared by the wait-event responses.
479+ */
480+ if (bytes_recvd < need +
481+ sizeof(struct synthvid_feature_change)) {
482+ drm_err_ratelimited(&hv->dev,
483+ "synthvid feature change packet too small: %u\n",
484+ bytes_recvd);
485+ return;
486+ }
440487 hv->dirt_needed = msg->feature_chg.is_dirt_needed;
441488 if (hv->dirt_needed)
442489 hyperv_hide_hw_ptr(hv->hdev);
490+ return;
491+ default:
492+ return;
493+ }
494+
495+ /*
496+ * Shared completion path for the wait-event responses
497+ * (VERSION_RESPONSE, RESOLUTION_RESPONSE, VRAM_LOCATION_ACK):
498+ * require the type-specific payload before handing the buffer to
499+ * the waiter.
500+ */
501+ if (bytes_recvd < need) {
502+ drm_err_ratelimited(&hv->dev,
503+ "synthvid packet too small for type %u: %u < %zu\n",
504+ msg->vid_hdr.type, bytes_recvd, need);
505+ return;
443506 }
507+ memcpy(hv->init_buf, msg, bytes_recvd);
508+ complete(&hv->wait);
444509 }
445510
446511 static void hyperv_receive(void *ctx)
@@ -461,9 +526,21 @@ static void hyperv_receive(void *ctx) · 14 unmodified lines
461526 ret = vmbus_recvpacket(hdev->channel, recv_buf,
462527 VMBUS_MAX_PACKET_SIZE,
463528 &bytes_recvd, &req_id);
464− if (bytes_recvd > 0 &&
465− recv_buf->pipe_hdr.type == PIPE_MSG_DATA)
466− hyperv_receive_sub(hdev);
529+ if (ret) {
530+ /*
531+ * A nonzero return (e.g. -ENOBUFS for an oversized
532+ * packet) is itself a malformed message: bytes_recvd
533+ * then reports the required length rather than a copied
534+ * payload, so it must not be forwarded to the
535+ * sub-handler. Channel recovery is not attempted.
536+ */
537+ drm_err_ratelimited(&hv->dev,
538+ "vmbus_recvpacket failed: %d (need %u)\n",
539+ ret, bytes_recvd);
540+ } else if (bytes_recvd > 0 &&
541+ recv_buf->pipe_hdr.type == PIPE_MSG_DATA) {
542+ hyperv_receive_sub(hdev, bytes_recvd);
543+ }
467544 } while (bytes_recvd > 0 && ret == 0);
468545 }
469546
@@ -508,9 +585,13 @@ int hyperv_connect_vsp(struct hv_device *hdev) · 38 unmodified lines
508585 ret = hyperv_get_supported_resolution(hdev);
509586 if (ret)
510587 drm_err(dev, "Failed to get supported resolution from host, use default\n");
511− } else {
588+ }
589+
590+ if (!hv->screen_width_max) {
512591 hv->screen_width_max = SYNTHVID_WIDTH_WIN8;
513592 hv->screen_height_max = SYNTHVID_HEIGHT_WIN8;
593+ hv->preferred_width = SYNTHVID_WIDTH_WIN8;
594+ hv->preferred_height = SYNTHVID_HEIGHT_WIN8;
514595 }
515596
516597 hv->mmio_megabytes = hdev->channel->offermsg.offer.mmio_megabytes;
drivers/gpu/drm/i915/display/intel_color.c+1−1
@@ -3976,7 +3976,7 @@ xelpd_program_plane_pre_csc_lut(struct intel_dsb *dsb, · 3975 unmodified lines
39763976 intel_de_write_dsb(display, dsb,
39773977 PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
39783978 (1 << 24));
3979− } while (i++ > 130);
3979+ } while (i++ < 130);
39803980 } else {
39813981 for (i = 0; i < lut_size; i++) {
39823982 u32 v = (i * ((1 << 24) - 1)) / (lut_size - 1);
drivers/gpu/drm/i915/display/intel_display_core.h+1−0
@@ -497,6 +497,7 @@ struct intel_display { · 496 unmodified lines
497497 u8 vblank_enabled;
498498
499499 int vblank_enable_count;
500+ bool vblank_status_last_notified;
500501
501502 struct work_struct vblank_notify_work;
502503
drivers/gpu/drm/i915/display/intel_display_irq.c+6−2
@@ -1773,8 +1773,12 @@ static void intel_display_vblank_notify_work(struct work_struct *work) · 1772 unmodified lines
17731773 struct intel_display *display =
17741774 container_of(work, typeof(*display), irq.vblank_notify_work);
17751775 int vblank_enable_count = READ_ONCE(display->irq.vblank_enable_count);
1776+ bool vblank_status = !!vblank_enable_count;
17761777
1777− intel_psr_notify_vblank_enable_disable(display, vblank_enable_count);
1778+ if (display->irq.vblank_status_last_notified != vblank_status) {
1779+ intel_psr_notify_vblank_enable_disable(display, vblank_status);
1780+ display->irq.vblank_status_last_notified = vblank_status;
1781+ }
17781782 }
17791783
17801784 int bdw_enable_vblank(struct drm_crtc *_crtc)
@@ -1787,10 +1791,10 @@ int bdw_enable_vblank(struct drm_crtc *_crtc) · 6 unmodified lines
17871791 if (gen11_dsi_configure_te(crtc, true))
17881792 return 0;
17891793
1794+ spin_lock_irqsave(&display->irq.lock, irqflags);
17901795 if (crtc->vblank_psr_notify && display->irq.vblank_enable_count++ == 0)
17911796 schedule_work(&display->irq.vblank_notify_work);
17921797
1793− spin_lock_irqsave(&display->irq.lock, irqflags);
17941798 bdw_enable_pipe_irq(display, pipe, GEN8_PIPE_VBLANK);
17951799 spin_unlock_irqrestore(&display->irq.lock, irqflags);
17961800
drivers/gpu/drm/i915/display/intel_display_types.h+3−0
@@ -584,6 +584,7 @@ struct intel_connector { · 583 unmodified lines
584584
585585 struct {
586586 u8 dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
587+ u8 intel_wa_dpcd;
587588
588589 bool support;
589590 bool su_support;
@@ -1789,6 +1790,8 @@ struct intel_psr { · 1199 unmodified lines
17891790 u8 active_non_psr_pipes;
17901791
17911792 const char *no_psr_reason;
1793+
1794+ struct ref_tracker *vblank_wakeref;
17921795 };
17931796
17941797 struct intel_dp {
drivers/gpu/drm/i915/display/intel_dp.c+8−3
@@ -3119,8 +3119,13 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc · 3118 unmodified lines
31193119 drm_WARN_ON(display->drm,
31203120 vsc->bpc == 6 && vsc->pixelformat != DP_PIXELFORMAT_RGB);
31213121
3122− /* all YCbCr are always limited range */
3123− vsc->dynamic_range = DP_DYNAMIC_RANGE_CTA;
3122+ /* All YCbCr formats are always limited range. */
3123+ if (vsc->pixelformat == DP_PIXELFORMAT_RGB)
3124+ vsc->dynamic_range = crtc_state->limited_color_range ?
3125+ DP_DYNAMIC_RANGE_CTA : DP_DYNAMIC_RANGE_VESA;
3126+ else
3127+ vsc->dynamic_range = DP_DYNAMIC_RANGE_CTA;
3128+
31243129 vsc->content_type = DP_CONTENT_TYPE_NOT_DEFINED;
31253130 }
31263131
@@ -5298,7 +5303,7 @@ int intel_dp_as_sdp_unpack(struct drm_dp_as_sdp *as_sdp, · 2171 unmodified lines
52985303 as_sdp->length = sdp->sdp_header.HB3 & DP_ADAPTIVE_SYNC_SDP_LENGTH;
52995304 as_sdp->mode = sdp->db[0] & DP_ADAPTIVE_SYNC_SDP_OPERATION_MODE;
53005305 as_sdp->vtotal = (sdp->db[2] << 8) | sdp->db[1];
5301− as_sdp->target_rr = (u64)sdp->db[3] | ((u64)sdp->db[4] & 0x3);
5306+ as_sdp->target_rr = ((sdp->db[4] & 0x3) << 8) | sdp->db[3];
53025307 as_sdp->target_rr_divider = sdp->db[4] & 0x20 ? true : false;
53035308
53045309 return 0;
drivers/gpu/drm/i915/display/intel_dp_aux.c+16−4
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include "intel_dp.h"
1313 #include "intel_dp_aux.h"
1414 #include "intel_dp_aux_regs.h"
15+#include "intel_parent.h"
1516 #include "intel_pps.h"
1617 #include "intel_quirks.h"
1718 #include "intel_tc.h"
@@ -60,18 +61,29 @@ intel_dp_aux_wait_done(struct intel_dp *intel_dp) · 42 unmodified lines
6061 struct intel_display *display = to_intel_display(intel_dp);
6162 i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg(intel_dp);
6263 const unsigned int timeout_ms = 10;
64+ bool done = true;
6365 u32 status;
64− bool done;
66+ int ret;
6567
68+ if (intel_parent_irq_enabled(display)) {
6669 #define C (((status = intel_de_read_notrace(display, ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0)
67− done = wait_event_timeout(display->gmbus.wait_queue, C,
68− msecs_to_jiffies_timeout(timeout_ms));
70+ done = wait_event_timeout(display->gmbus.wait_queue, C,
71+ msecs_to_jiffies_timeout(timeout_ms));
72+
73+#undef C
74+ } else {
75+ ret = intel_de_wait_ms(display, ch_ctl,
76+ DP_AUX_CH_CTL_SEND_BUSY, 0,
77+ timeout_ms, &status);
78+
79+ if (ret == -ETIMEDOUT)
80+ done = false;
81+ }
6982
7083 if (!done)
7184 drm_err(display->drm,
7285 "%s: did not complete or timeout within %ums (status 0x%08x)\n",
7386 intel_dp->aux.name, timeout_ms, status);
74−#undef C
7587
7688 return status;
7789 }
drivers/gpu/drm/i915/display/intel_dpcd.h+15−0
@@ -0,0 +1,15 @@
1+/* SPDX-License-Identifier: MIT */
2+/*
3+ * Copyright © 2026 Intel Corporation
4+ */
5+
6+#ifndef __INTEL_DPCD_H__
7+#define __INTEL_DPCD_H__
8+
9+#define INTEL_DPCD_INTEL_WA_REGISTER_CAPS 0x3f0
10+# define INTEL_DPCD_INTEL_WA_REGISTER_CAPS_PSR2_EARLYSCANLINE_SDP_SUPPORT_MASK REG_GENMASK(1, 0)
11+# define INTEL_DPCD_INTEL_WA_REGISTER_CAPS_FALL_BACK_TO_PSR1 0
12+# define INTEL_DPCD_INTEL_WA_REGISTER_CAPS_PSR2_WITH_EARLY_SCANLINE 1
13+# define INTEL_DPCD_INTEL_WA_REGISTER_CAPS_PSR2_WITHOUT_EARLY_SCANLINE 2
14+
15+#endif /* __INTEL_DPCD_H__ */
drivers/gpu/drm/i915/display/intel_plane.c+1−1
@@ -373,7 +373,7 @@ intel_plane_color_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, · 372 unmodified lines
373373 bool changed = false;
374374 int i = 0;
375375
376− iter_colorop = plane_state->uapi.color_pipeline;
376+ iter_colorop = from_plane_state->uapi.color_pipeline;
377377
378378 while (iter_colorop) {
379379 for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) {
drivers/gpu/drm/i915/display/intel_psr.c+49−20
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include "intel_display_wa.h"
4444 #include "intel_dmc.h"
4545 #include "intel_dp.h"
46+#include "intel_dpcd.h"
4647 #include "intel_dp_aux.h"
4748 #include "intel_dsb.h"
4849 #include "intel_frontbuffer.h"
@@ -716,8 +717,14 @@ static void _psr_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *co · 667 unmodified lines
716717 connector->dp.psr_caps.su_support ? "" : "not ");
717718 }
718719
719− if (connector->dp.psr_caps.su_support)
720+ if (connector->dp.psr_caps.su_support) {
721+ ret = drm_dp_dpcd_read_byte(&intel_dp->aux,
722+ INTEL_DPCD_INTEL_WA_REGISTER_CAPS,
723+ &connector->dp.psr_caps.intel_wa_dpcd);
724+ if (ret < 0)
725+ return;
720726 _psr_compute_su_granularity(intel_dp, connector);
727+ }
721728 }
722729
723730 void intel_psr_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector)
@@ -1358,9 +1365,35 @@ static bool psr2_granularity_check(struct intel_crtc_state *crtc_state, · 634 unmodified lines
13581365 return true;
13591366 }
13601367
1361−static bool _compute_psr2_sdp_prior_scanline_indication(struct intel_dp *intel_dp,
1362− struct intel_crtc_state *crtc_state)
1368+static bool apply_scanline_indication_wa(struct intel_crtc_state *crtc_state,
1369+ struct intel_connector *connector)
13631370 {
1371+ struct intel_dp *intel_dp = intel_attached_dp(connector);
1372+ u8 early_scanline_support = connector->dp.psr_caps.intel_wa_dpcd &
1373+ INTEL_DPCD_INTEL_WA_REGISTER_CAPS_PSR2_EARLYSCANLINE_SDP_SUPPORT_MASK;
1374+
1375+ if (intel_dp->edp_dpcd[0] >= DP_EDP_15)
1376+ return true;
1377+
1378+ switch (early_scanline_support) {
1379+ case INTEL_DPCD_INTEL_WA_REGISTER_CAPS_FALL_BACK_TO_PSR1:
1380+ crtc_state->req_psr2_sdp_prior_scanline = false;
1381+ return false;
1382+ case INTEL_DPCD_INTEL_WA_REGISTER_CAPS_PSR2_WITH_EARLY_SCANLINE:
1383+ return true;
1384+ case INTEL_DPCD_INTEL_WA_REGISTER_CAPS_PSR2_WITHOUT_EARLY_SCANLINE:
1385+ crtc_state->req_psr2_sdp_prior_scanline = false;
1386+ return true;
1387+ default:
1388+ MISSING_CASE(early_scanline_support);
1389+ return false;
1390+ }
1391+}
1392+
1393+static bool _compute_psr2_sdp_prior_scanline_indication(struct intel_crtc_state *crtc_state,
1394+ struct intel_connector *connector)
1395+{
1396+ struct intel_dp *intel_dp = intel_attached_dp(connector);
13641397 struct intel_display *display = to_intel_display(intel_dp);
13651398 const struct drm_display_mode *adjusted_mode = &crtc_state->uapi.adjusted_mode;
13661399 u32 hblank_total, hblank_ns, req_ns;
@@ -1379,7 +1412,8 @@ static bool _compute_psr2_sdp_prior_scanline_indication(struct intel_dp *intel_d · 12 unmodified lines
13791412 return false;
13801413
13811414 crtc_state->req_psr2_sdp_prior_scanline = true;
1382− return true;
1415+
1416+ return apply_scanline_indication_wa(crtc_state, connector);
13831417 }
13841418
13851419 static int intel_psr_entry_setup_frames(struct intel_dp *intel_dp,
@@ -1660,7 +1694,7 @@ static bool intel_sel_update_config_valid(struct intel_crtc_state *crtc_state, · 274 unmodified lines
16601694 conn_state))
16611695 goto unsupported;
16621696
1663− if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp, crtc_state)) {
1697+ if (!_compute_psr2_sdp_prior_scanline_indication(crtc_state, connector)) {
16641698 drm_dbg_kms(display->drm,
16651699 "Selective update not enabled, SDP indication do not fit in hblank\n");
16661700 goto unsupported;
@@ -4122,27 +4156,22 @@ void intel_psr_notify_vblank_enable_disable(struct intel_display *display, · 2455 unmodified lines
41224156 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
41234157
41244158 mutex_lock(&intel_dp->psr.lock);
4125− if (intel_dp->psr.panel_replay_enabled) {
4126− mutex_unlock(&intel_dp->psr.lock);
4127− break;
4159+ if (CAN_PANEL_REPLAY(intel_dp)) {
4160+ if (enable)
4161+ intel_dp->psr.vblank_wakeref =
4162+ intel_display_power_get(display,
4163+ POWER_DOMAIN_DC_OFF);
4164+ else
4165+ intel_display_power_put(display, POWER_DOMAIN_DC_OFF,
4166+ intel_dp->psr.vblank_wakeref);
41284167 }
41294168
4130− if (intel_dp->psr.enabled && intel_dp->psr.pkg_c_latency_used)
4169+ if (intel_dp->psr.enabled && !intel_dp->psr.panel_replay_enabled &&
4170+ intel_dp->psr.pkg_c_latency_used)
41314171 intel_psr_apply_underrun_on_idle_wa_locked(intel_dp);
41324172
41334173 mutex_unlock(&intel_dp->psr.lock);
4134− return;
41354174 }
4136−
4137− /*
4138− * NOTE: intel_display_power_set_target_dc_state is used
4139− * only by PSR * code for DC3CO handling. DC3CO target
4140− * state is currently disabled in * PSR code. If DC3CO
4141− * is taken into use we need take that into account here
4142− * as well.
4143− */
4144− intel_display_power_set_target_dc_state(display, enable ? DC_STATE_DISABLE :
4145− DC_STATE_EN_UPTO_DC6);
41464175 }
41474176
41484177 static void
drivers/gpu/drm/i915/gem/i915_gem_ttm.c+16−12
@@ -419,8 +419,6 @@ void i915_ttm_free_cached_io_rsgt(struct drm_i915_gem_object *obj) · 418 unmodified lines
419419 int i915_ttm_purge(struct drm_i915_gem_object *obj)
420420 {
421421 struct ttm_buffer_object *bo = i915_gem_to_ttm(obj);
422− struct i915_ttm_tt *i915_tt =
423− container_of(bo->ttm, typeof(*i915_tt), ttm);
424422 struct ttm_operation_ctx ctx = {
425423 .interruptible = true,
426424 .no_wait_gpu = false,
@@ -435,16 +433,22 @@ int i915_ttm_purge(struct drm_i915_gem_object *obj) · 8 unmodified lines
435433 if (ret)
436434 return ret;
437435
438− if (bo->ttm && i915_tt->filp) {
439− /*
440− * The below fput(which eventually calls shmem_truncate) might
441− * be delayed by worker, so when directly called to purge the
442− * pages(like by the shrinker) we should try to be more
443− * aggressive and release the pages immediately.
444− */
445− shmem_truncate_range(file_inode(i915_tt->filp),
446− 0, (loff_t)-1);
447− fput(fetch_and_zero(&i915_tt->filp));
436+ if (bo->ttm) {
437+ struct i915_ttm_tt *i915_tt =
438+ container_of(bo->ttm, typeof(*i915_tt), ttm);
439+
440+ if (i915_tt->filp) {
441+ /*
442+ * The below fput(which eventually calls shmem_truncate)
443+ * might be delayed by worker, so when directly called
444+ * to purge the pages(like by the shrinker) we should
445+ * try to be more aggressive and release the pages
446+ * immediately.
447+ */
448+ shmem_truncate_range(file_inode(i915_tt->filp),
449+ 0, (loff_t)-1);
450+ fput(fetch_and_zero(&i915_tt->filp));
451+ }
448452 }
449453
450454 obj->write_domain = 0;
drivers/gpu/drm/i915/gt/intel_reset.c+2−1
@@ -132,7 +132,8 @@ void __i915_request_reset(struct i915_request *rq, bool guilty) · 131 unmodified lines
132132 rcu_read_lock(); /* protect the GEM context */
133133 if (guilty) {
134134 i915_request_set_error_once(rq, -EIO);
135− __i915_request_skip(rq);
135+ if (!i915_request_signaled(rq))
136+ __i915_request_skip(rq);
136137 banned = mark_guilty(rq);
137138 } else {
138139 i915_request_set_error_once(rq, -EAGAIN);
drivers/gpu/drm/i915/i915_driver.c+2−3
@@ -750,9 +750,8 @@ static bool has_auxccs(struct drm_device *drm) · 749 unmodified lines
750750 {
751751 struct drm_i915_private *i915 = to_i915(drm);
752752
753− return IS_GRAPHICS_VER(i915, 9, 12) ||
754− IS_ALDERLAKE_P(i915) ||
755− IS_METEORLAKE(i915);
753+ return IS_GRAPHICS_VER(i915, 9, 12) &&
754+ !HAS_FLAT_CCS(i915);
756755 }
757756
758757 static bool has_fenced_regions(struct drm_device *drm)
drivers/gpu/drm/imagination/pvr_fw_trace.c+1−1
@@ -558,6 +558,6 @@ pvr_fw_trace_debugfs_init(struct pvr_device *pvr_dev, struct dentry *dir) · 557 unmodified lines
558558 &pvr_fw_trace_fops);
559559 }
560560
561− debugfs_create_file("trace_mask", 0600, dir, fw_trace,
561+ debugfs_create_file("trace_mask", 0600, dir, pvr_dev,
562562 &pvr_fw_trace_mask_fops);
563563 }
drivers/gpu/drm/loongson/lsdc_drv.c+1−1
@@ -293,7 +293,7 @@ static int lsdc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 292 unmodified lines
293293
294294 vga_client_register(pdev, lsdc_vga_set_decode);
295295
296− drm_kms_helper_poll_init(ddev);
296+ drmm_kms_helper_poll_init(ddev);
297297
298298 if (loongson_vblank) {
299299 ret = drm_vblank_init(ddev, descp->num_of_crtc);
drivers/gpu/drm/mediatek/mtk_cec.c+1−1
@@ -240,7 +240,7 @@ static const struct of_device_id mtk_cec_of_ids[] = { · 239 unmodified lines
240240 };
241241 MODULE_DEVICE_TABLE(of, mtk_cec_of_ids);
242242
243−struct platform_driver mtk_cec_driver = {
243+static struct platform_driver mtk_cec_driver = {
244244 .probe = mtk_cec_probe,
245245 .remove = mtk_cec_remove,
246246 .driver = {
drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c+1−1
@@ -328,7 +328,7 @@ static const struct of_device_id mtk_hdmi_ddc_match[] = { · 327 unmodified lines
328328 };
329329 MODULE_DEVICE_TABLE(of, mtk_hdmi_ddc_match);
330330
331−struct platform_driver mtk_hdmi_ddc_driver = {
331+static struct platform_driver mtk_hdmi_ddc_driver = {
332332 .probe = mtk_hdmi_ddc_probe,
333333 .remove = mtk_hdmi_ddc_remove,
334334 .driver = {
drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c+1−1
@@ -389,7 +389,7 @@ static const struct of_device_id mtk_hdmi_ddc_v2_match[] = { · 388 unmodified lines
389389 };
390390 MODULE_DEVICE_TABLE(of, mtk_hdmi_ddc_v2_match);
391391
392−struct platform_driver mtk_hdmi_ddc_v2_driver = {
392+static struct platform_driver mtk_hdmi_ddc_v2_driver = {
393393 .probe = mtk_hdmi_ddc_v2_probe,
394394 .driver = {
395395 .name = "mediatek-hdmi-ddc-v2",
drivers/gpu/drm/mediatek/mtk_hdmi_v2.c+1−1
@@ -50,7 +50,7 @@ enum mtk_hdmi_v2_clk_id { · 49 unmodified lines
5050 MTK_HDMI_V2_CLK_COUNT,
5151 };
5252
53−const char *const mtk_hdmi_v2_clk_names[MTK_HDMI_V2_CLK_COUNT] = {
53+static const char *const mtk_hdmi_v2_clk_names[MTK_HDMI_V2_CLK_COUNT] = {
5454 [MTK_HDMI_V2_CLK_HDMI_APB_SEL] = "bus",
5555 [MTK_HDMI_V2_CLK_HDCP_SEL] = "hdcp",
5656 [MTK_HDMI_V2_CLK_HDCP_24M_SEL] = "hdcp24m",
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+4−3
@@ -2621,7 +2621,6 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) · 2620 unmodified lines
26212621 struct platform_device *pdev = priv->gpu_pdev;
26222622 struct adreno_platform_config *config = pdev->dev.platform_data;
26232623 const struct adreno_info *info = config->info;
2624− struct device_node *node;
26252624 struct a6xx_gpu *a6xx_gpu;
26262625 struct adreno_gpu *adreno_gpu;
26272626 struct msm_gpu *gpu;
@@ -2643,7 +2642,8 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) · 15 unmodified lines
26432642 adreno_gpu->registers = NULL;
26442643
26452644 /* Check if there is a GMU phandle and set it up */
2646− node = of_parse_phandle(pdev->dev.of_node, "qcom,gmu", 0);
2645+ struct device_node *node __free(device_node) =
2646+ of_parse_phandle(pdev->dev.of_node, "qcom,gmu", 0);
26472647 /* FIXME: How do we gracefully handle this? */
26482648 BUG_ON(!node);
26492649
@@ -2690,7 +2690,6 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) · 40 unmodified lines
26902690 ret = a6xx_gmu_wrapper_init(a6xx_gpu, node);
26912691 else
26922692 ret = a6xx_gmu_init(a6xx_gpu, node);
2693− of_node_put(node);
26942693 if (ret) {
26952694 a6xx_destroy(&(a6xx_gpu->base.base));
26962695 return ERR_PTR(ret);
@@ -2740,6 +2739,7 @@ const struct adreno_gpu_funcs a6xx_gpu_funcs = { · 43 unmodified lines
27402739 .create_private_vm = a6xx_create_private_vm,
27412740 .get_rptr = a6xx_get_rptr,
27422741 .progress = a6xx_progress,
2742+ .sysprof_setup = a6xx_gmu_sysprof_setup,
27432743 },
27442744 .init = a6xx_gpu_init,
27452745 .get_timestamp = a6xx_gmu_get_timestamp,
@@ -2808,6 +2808,7 @@ const struct adreno_gpu_funcs a7xx_gpu_funcs = { · 62 unmodified lines
28082808 .create_private_vm = a6xx_create_private_vm,
28092809 .get_rptr = a6xx_get_rptr,
28102810 .progress = a6xx_progress,
2811+ .sysprof_setup = a6xx_gmu_sysprof_setup,
28112812 },
28122813 .init = a6xx_gpu_init,
28132814 .get_timestamp = a6xx_gmu_get_timestamp,
drivers/gpu/drm/msm/adreno/a6xx_hfi.c+2−0
@@ -289,6 +289,8 @@ static int a8xx_hfi_send_perf_table(struct a6xx_gmu *gmu) · 288 unmodified lines
289289 (gmu->nr_gpu_freqs * num_gx_votes * sizeof(gmu->gx_arc_votes[0])) +
290290 (gmu->nr_gmu_freqs * num_cx_votes * sizeof(gmu->cx_arc_votes[0]));
291291 tbl = kzalloc(size, GFP_KERNEL);
292+ if (!tbl)
293+ return -ENOMEM;
292294 tbl->type = HFI_TABLE_GPU_PERF;
293295
294296 /* First fill GX votes */
drivers/gpu/drm/msm/adreno/adreno_device.c+1−1
@@ -17,7 +17,7 @@ MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU devcoredum · 16 unmodified lines
1717 module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
1818
1919 int enable_preemption = -1;
20−MODULE_PARM_DESC(enable_preemption, "Enable preemption (A7xx only) (1=on , 0=disable, -1=auto (default))");
20+MODULE_PARM_DESC(enable_preemption, "Enable preemption (A7xx+ only) (1=on , 0=disable, -1=auto (default))");
2121 module_param(enable_preemption, int, 0600);
2222
2323 bool disable_acd;
drivers/gpu/drm/msm/adreno/adreno_gpu.c+7−1
@@ -376,7 +376,7 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx, · 375 unmodified lines
376376 *value = adreno_gpu->info->gmem;
377377 return 0;
378378 case MSM_PARAM_GMEM_BASE:
379− if (adreno_gpu->info->family >= ADRENO_6XX_GEN4)
379+ if (adreno_gpu->info->family >= ADRENO_6XX_GEN3)
380380 *value = 0;
381381 else
382382 *value = 0x100000;
@@ -424,15 +424,21 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx, · 41 unmodified lines
424424 *value = vm->mm_range;
425425 return 0;
426426 case MSM_PARAM_HIGHEST_BANK_BIT:
427+ if (!adreno_gpu->ubwc_config)
428+ return UERR(ENOENT, drm, "no UBWC on this platform");
427429 *value = adreno_gpu->ubwc_config->highest_bank_bit;
428430 return 0;
429431 case MSM_PARAM_RAYTRACING:
430432 *value = adreno_gpu->has_ray_tracing;
431433 return 0;
432434 case MSM_PARAM_UBWC_SWIZZLE:
435+ if (!adreno_gpu->ubwc_config)
436+ return UERR(ENOENT, drm, "no UBWC on this platform");
433437 *value = adreno_gpu->ubwc_config->ubwc_swizzle;
434438 return 0;
435439 case MSM_PARAM_MACROTILE_MODE:
440+ if (!adreno_gpu->ubwc_config)
441+ return UERR(ENOENT, drm, "no UBWC on this platform");
436442 *value = adreno_gpu->ubwc_config->macrotile_mode;
437443 return 0;
438444 case MSM_PARAM_UCHE_TRAP_BASE:
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_13_0_kaanapali.h+1−1
@@ -480,7 +480,7 @@ const struct dpu_mdss_cfg dpu_kaanapali_cfg = { · 479 unmodified lines
480480 .wb_count = ARRAY_SIZE(kaanapali_wb),
481481 .wb = kaanapali_wb,
482482 .cwb_count = ARRAY_SIZE(kaanapali_cwb),
483− .cwb = sm8650_cwb,
483+ .cwb = kaanapali_cwb,
484484 .intf_count = ARRAY_SIZE(kaanapali_intf),
485485 .intf = kaanapali_intf,
486486 .vbif = &sm8650_vbif,
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c+7−5
@@ -61,7 +61,7 @@ static int _dpu_format_populate_plane_sizes_ubwc( · 60 unmodified lines
6161 bool meta = MSM_FORMAT_IS_UBWC(fmt);
6262
6363 if (MSM_FORMAT_IS_YUV(fmt)) {
64− unsigned int stride, sclines;
64+ unsigned int stride, y_sclines, uv_sclines;
6565 unsigned int y_tile_width, y_tile_height;
6666 unsigned int y_meta_stride, y_meta_scanlines;
6767 unsigned int uv_meta_stride, uv_meta_scanlines;
@@ -77,23 +77,25 @@ static int _dpu_format_populate_plane_sizes_ubwc( · 9 unmodified lines
7777 y_tile_width = 32;
7878 }
7979
80− sclines = round_up(fb->height, 16);
80+ y_sclines = round_up(fb->height, 16);
81+ uv_sclines = round_up((fb->height+1)>>1, 16);
8182 y_tile_height = 4;
8283 } else {
8384 stride = round_up(fb->width, 128);
8485 y_tile_width = 32;
8586
86− sclines = round_up(fb->height, 32);
87+ y_sclines = round_up(fb->height, 32);
88+ uv_sclines = round_up((fb->height+1)>>1, 32);
8789 y_tile_height = 8;
8890 }
8991
9092 layout->plane_pitch[0] = stride;
9193 layout->plane_size[0] = round_up(layout->plane_pitch[0] *
92− sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
94+ y_sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
9395
9496 layout->plane_pitch[1] = stride;
9597 layout->plane_size[1] = round_up(layout->plane_pitch[1] *
96− sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
98+ uv_sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
9799
98100 if (!meta)
99101 return 0;
drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c+2−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
55
66 #include <drm/drm_edid.h>
77 #include <drm/drm_framebuffer.h>
8+#include <drm/drm_managed.h>
89
910 #include "dpu_writeback.h"
1011
@@ -125,7 +126,7 @@ int dpu_writeback_init(struct drm_device *dev, struct drm_encoder *enc, · 114 unmodified lines
125126 struct dpu_wb_connector *dpu_wb_conn;
126127 int rc = 0;
127128
128− dpu_wb_conn = devm_kzalloc(dev->dev, sizeof(*dpu_wb_conn), GFP_KERNEL);
129+ dpu_wb_conn = drmm_kzalloc(dev, sizeof(*dpu_wb_conn), GFP_KERNEL);
129130 if (!dpu_wb_conn)
130131 return -ENOMEM;
131132
drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c+20−8
@@ -5,11 +5,11 @@ · 4 unmodified lines
55
66 #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
77
8−#include <generated/utsrelease.h>
8+#include <linux/utsname.h>
99
1010 #include "msm_disp_snapshot.h"
1111
12−static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *base_addr)
12+static void msm_disp_state_dump_regs(u32 **reg, u32 len, void __iomem *base_addr)
1313 {
1414 u32 len_padded;
1515 u32 num_rows;
@@ -19,11 +19,11 @@ static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *b · 3 unmodified lines
1919 void __iomem *end_addr;
2020 int i;
2121
22− len_padded = aligned_len * REG_DUMP_ALIGN;
23− num_rows = aligned_len / REG_DUMP_ALIGN;
22+ len_padded = round_up(len, REG_DUMP_ALIGN);
23+ num_rows = DIV_ROUND_UP(len, REG_DUMP_ALIGN);
2424
2525 addr = base_addr;
26− end_addr = base_addr + aligned_len;
26+ end_addr = base_addr + len;
2727
2828 *reg = kvzalloc(len_padded, GFP_KERNEL);
2929 if (!*reg)
@@ -48,8 +48,8 @@ static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *b · 18 unmodified lines
4848 static void msm_disp_state_print_regs(const u32 *dump_addr, u32 len,
4949 void __iomem *base_addr, struct drm_printer *p)
5050 {
51+ void __iomem *addr, *end_addr;
5152 int i;
52− void __iomem *addr;
5353 u32 num_rows;
5454
5555 if (!dump_addr) {
@@ -58,6 +58,7 @@ static void msm_disp_state_print_regs(const u32 *dump_addr, u32 len, · 2 unmodified lines
5858 }
5959
6060 addr = base_addr;
61+ end_addr = base_addr + len;
6162 num_rows = len / REG_DUMP_ALIGN;
6263
6364 for (i = 0; i < num_rows; i++) {
@@ -67,6 +68,17 @@ static void msm_disp_state_print_regs(const u32 *dump_addr, u32 len, · 3 unmodified lines
6768 dump_addr[i * 4 + 2], dump_addr[i * 4 + 3]);
6869 addr += REG_DUMP_ALIGN;
6970 }
71+
72+ if (addr != end_addr) {
73+ drm_printf(p, "0x%lx : %08x",
74+ (unsigned long)(addr - base_addr),
75+ dump_addr[i * 4]);
76+ if (addr + 0x4 < end_addr)
77+ drm_printf(p, " %08x", dump_addr[i * 4 + 1]);
78+ if (addr + 0x8 < end_addr)
79+ drm_printf(p, " %08x", dump_addr[i * 4 + 2]);
80+ drm_printf(p, "\n");
81+ }
7082 }
7183
7284 void msm_disp_state_print(struct msm_disp_state *state, struct drm_printer *p)
@@ -79,7 +91,7 @@ void msm_disp_state_print(struct msm_disp_state *state, struct drm_printer *p) · 6 unmodified lines
7991 }
8092
8193 drm_printf(p, "---\n");
82− drm_printf(p, "kernel: " UTS_RELEASE "\n");
94+ drm_printf(p, "kernel: %s\n", init_utsname()->release);
8395 drm_printf(p, "module: " KBUILD_MODNAME "\n");
8496 drm_printf(p, "dpu devcoredump\n");
8597 drm_printf(p, "time: %ptSp\n", &state->time);
@@ -185,7 +197,7 @@ void msm_disp_snapshot_add_block(struct msm_disp_state *disp_state, u32 len, · 99 unmodified lines
185197 va_end(va);
186198
187199 INIT_LIST_HEAD(&new_blk->node);
188− new_blk->size = ALIGN(len, REG_DUMP_ALIGN);
200+ new_blk->size = len;
189201 new_blk->base_addr = base_addr;
190202
191203 msm_disp_state_dump_regs(&new_blk->state, new_blk->size, base_addr);
drivers/gpu/drm/msm/dsi/dsi_host.c+1−0
@@ -2033,6 +2033,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) · 2032 unmodified lines
20332033
20342034 /* fixup base address by io offset */
20352035 msm_host->ctrl_base += cfg->io_offset;
2036+ msm_host->ctrl_size -= cfg->io_offset;
20362037
20372038 ret = devm_regulator_bulk_get_const(&pdev->dev, cfg->num_regulators,
20382039 cfg->regulator_data,
drivers/gpu/drm/msm/msm_drv.c+5−6
@@ -128,11 +128,10 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv, · 127 unmodified lines
128128 /*
129129 * Initialize the LRUs:
130130 */
131− mutex_init(&priv->lru.lock);
132− drm_gem_lru_init(&priv->lru.unbacked, &priv->lru.lock);
133− drm_gem_lru_init(&priv->lru.pinned, &priv->lru.lock);
134− drm_gem_lru_init(&priv->lru.willneed, &priv->lru.lock);
135− drm_gem_lru_init(&priv->lru.dontneed, &priv->lru.lock);
131+ drm_gem_lru_init(&priv->lru.unbacked);
132+ drm_gem_lru_init(&priv->lru.pinned);
133+ drm_gem_lru_init(&priv->lru.willneed);
134+ drm_gem_lru_init(&priv->lru.dontneed);
136135
137136 /* Initialize stall-on-fault */
138137 spin_lock_init(&priv->fault_stall_lock);
@@ -140,7 +139,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv, · 1 unmodified line
140139
141140 /* Teach lockdep about lock ordering wrt. shrinker: */
142141 fs_reclaim_acquire(GFP_KERNEL);
143− might_lock(&priv->lru.lock);
142+ might_lock(&ddev->gem_lru_mutex);
144143 fs_reclaim_release(GFP_KERNEL);
145144
146145 if (priv->kms_init) {
drivers/gpu/drm/msm/msm_drv.h+0−7
@@ -150,13 +150,6 @@ struct msm_drm_private { · 149 unmodified lines
150150 * DONTNEED state (ie. can be purged)
151151 */
152152 struct drm_gem_lru dontneed;
153−
154− /**
155− * lock:
156− *
157− * Protects manipulation of all of the LRUs.
158− */
159− struct mutex lock;
160153 } lru;
161154
162155 struct notifier_block vmap_notifier;
drivers/gpu/drm/msm/msm_gem.c+16−17
@@ -177,11 +177,11 @@ static void update_lru_locked(struct drm_gem_object *obj) · 176 unmodified lines
177177
178178 static void update_lru(struct drm_gem_object *obj)
179179 {
180− struct msm_drm_private *priv = obj->dev->dev_private;
180+ struct drm_device *dev = obj->dev;
181181
182− mutex_lock(&priv->lru.lock);
182+ mutex_lock(&dev->gem_lru_mutex);
183183 update_lru_locked(obj);
184− mutex_unlock(&priv->lru.lock);
184+ mutex_unlock(&dev->gem_lru_mutex);
185185 }
186186
187187 static struct page **get_pages(struct drm_gem_object *obj)
@@ -292,11 +292,11 @@ void msm_gem_pin_obj_locked(struct drm_gem_object *obj) · 104 unmodified lines
292292
293293 static void pin_obj_locked(struct drm_gem_object *obj)
294294 {
295− struct msm_drm_private *priv = obj->dev->dev_private;
295+ struct drm_device *dev = obj->dev;
296296
297− mutex_lock(&priv->lru.lock);
297+ mutex_lock(&dev->gem_lru_mutex);
298298 msm_gem_pin_obj_locked(obj);
299− mutex_unlock(&priv->lru.lock);
299+ mutex_unlock(&dev->gem_lru_mutex);
300300 }
301301
302302 struct page **msm_gem_pin_pages_locked(struct drm_gem_object *obj)
@@ -487,16 +487,16 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct drm_gpuva *vma) · 184 unmodified lines
487487
488488 void msm_gem_unpin_locked(struct drm_gem_object *obj)
489489 {
490− struct msm_drm_private *priv = obj->dev->dev_private;
490+ struct drm_device *dev = obj->dev;
491491 struct msm_gem_object *msm_obj = to_msm_bo(obj);
492492
493493 msm_gem_assert_locked(obj);
494494
495− mutex_lock(&priv->lru.lock);
495+ mutex_lock(&dev->gem_lru_mutex);
496496 msm_obj->pin_count--;
497497 GEM_WARN_ON(msm_obj->pin_count < 0);
498498 update_lru_locked(obj);
499− mutex_unlock(&priv->lru.lock);
499+ mutex_unlock(&dev->gem_lru_mutex);
500500 }
501501
502502 /* Special unpin path for use in fence-signaling path, avoiding the need
@@ -507,10 +507,10 @@ void msm_gem_unpin_locked(struct drm_gem_object *obj) · 4 unmodified lines
507507 */
508508 void msm_gem_unpin_active(struct drm_gem_object *obj)
509509 {
510− struct msm_drm_private *priv = obj->dev->dev_private;
510+ struct drm_device *dev = obj->dev;
511511 struct msm_gem_object *msm_obj = to_msm_bo(obj);
512512
513− GEM_WARN_ON(!mutex_is_locked(&priv->lru.lock));
513+ GEM_WARN_ON(!mutex_is_locked(&dev->gem_lru_mutex));
514514
515515 msm_obj->pin_count--;
516516 GEM_WARN_ON(msm_obj->pin_count < 0);
@@ -797,12 +797,12 @@ void msm_gem_put_vaddr(struct drm_gem_object *obj) · 280 unmodified lines
797797 */
798798 int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv)
799799 {
800− struct msm_drm_private *priv = obj->dev->dev_private;
800+ struct drm_device *dev = obj->dev;
801801 struct msm_gem_object *msm_obj = to_msm_bo(obj);
802802
803803 msm_gem_lock(obj);
804804
805− mutex_lock(&priv->lru.lock);
805+ mutex_lock(&dev->gem_lru_mutex);
806806
807807 if (msm_obj->madv != __MSM_MADV_PURGED)
808808 msm_obj->madv = madv;
@@ -814,7 +814,7 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) · 5 unmodified lines
814814 */
815815 update_lru_locked(obj);
816816
817− mutex_unlock(&priv->lru.lock);
817+ mutex_unlock(&dev->gem_lru_mutex);
818818
819819 msm_gem_unlock(obj);
820820
@@ -824,7 +824,6 @@ int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv) · 3 unmodified lines
824824 void msm_gem_purge(struct drm_gem_object *obj)
825825 {
826826 struct drm_device *dev = obj->dev;
827− struct msm_drm_private *priv = obj->dev->dev_private;
828827 struct msm_gem_object *msm_obj = to_msm_bo(obj);
829828
830829 msm_gem_assert_locked(obj);
@@ -839,10 +838,10 @@ void msm_gem_purge(struct drm_gem_object *obj) · 8 unmodified lines
839838
840839 put_pages(obj);
841840
842− mutex_lock(&priv->lru.lock);
841+ mutex_lock(&dev->gem_lru_mutex);
843842 /* A one-way transition: */
844843 msm_obj->madv = __MSM_MADV_PURGED;
845− mutex_unlock(&priv->lru.lock);
844+ mutex_unlock(&dev->gem_lru_mutex);
846845
847846 drm_gem_free_mmap_offset(obj);
848847
drivers/gpu/drm/msm/msm_gem_shrinker.c+18−26
@@ -43,8 +43,7 @@ msm_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc) · 42 unmodified lines
4343 }
4444
4545 static bool
46−with_vm_locks(struct ww_acquire_ctx *ticket,
47− void (*fn)(struct drm_gem_object *obj),
46+with_vm_locks(void (*fn)(struct drm_gem_object *obj),
4847 struct drm_gem_object *obj)
4948 {
5049 /*
@@ -52,7 +51,7 @@ with_vm_locks(struct ww_acquire_ctx *ticket, · 1 unmodified line
5251 * success paths
5352 */
5453 struct drm_gpuvm_bo *vm_bo, *last_locked = NULL;
55− int ret = 0;
54+ bool locked = true;
5655
5756 drm_gem_for_each_gpuvm_bo (vm_bo, obj) {
5857 struct dma_resv *resv = drm_gpuvm_resv(vm_bo->vm);
@@ -60,23 +59,14 @@ with_vm_locks(struct ww_acquire_ctx *ticket, · 1 unmodified line
6059 if (resv == obj->resv)
6160 continue;
6261
63− ret = dma_resv_lock(resv, ticket);
64−
65− /*
66− * Since we already skip the case when the VM and obj
67− * share a resv (ie. _NO_SHARE objs), we don't expect
68− * to hit a double-locking scenario... which the lock
69− * unwinding cannot really cope with.
70− */
71− WARN_ON(ret == -EALREADY);
72−
7362 /*
74− * Don't bother with slow-lock / backoff / retry sequence,
75− * if we can't get the lock just give up and move on to
76− * the next object.
63+ * dma_resv_lock can't be used due to acquiring 'ticket' before the
64+ * fs_reclaim lock, which is held in shrinker context
7765 */
78− if (ret)
66+ if (!dma_resv_trylock(resv)) {
67+ locked = false;
7968 goto out_unlock;
69+ }
8070
8171 /*
8272 * Hold a ref to prevent the vm_bo from being freed
@@ -108,11 +98,11 @@ out_unlock: · 25 unmodified lines
10898 }
10999 }
110100
111− return ret == 0;
101+ return locked;
112102 }
113103
114104 static bool
115−purge(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket)
105+purge(struct drm_gem_object *obj, struct ww_acquire_ctx *unused)
116106 {
117107 if (!is_purgeable(to_msm_bo(obj)))
118108 return false;
@@ -120,11 +110,11 @@ purge(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket) · 1 unmodified line
120110 if (msm_gem_active(obj))
121111 return false;
122112
123− return with_vm_locks(ticket, msm_gem_purge, obj);
113+ return with_vm_locks(msm_gem_purge, obj);
124114 }
125115
126116 static bool
127−evict(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket)
117+evict(struct drm_gem_object *obj, struct ww_acquire_ctx *unused)
128118 {
129119 if (is_unevictable(to_msm_bo(obj)))
130120 return false;
@@ -132,7 +122,7 @@ evict(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket) · 1 unmodified line
132122 if (msm_gem_active(obj))
133123 return false;
134124
135− return with_vm_locks(ticket, msm_gem_evict, obj);
125+ return with_vm_locks(msm_gem_evict, obj);
136126 }
137127
138128 static bool
@@ -164,7 +154,6 @@ static unsigned long · 25 unmodified lines
164154 msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
165155 {
166156 struct msm_drm_private *priv = shrinker->private_data;
167− struct ww_acquire_ctx ticket;
168157 struct {
169158 struct drm_gem_lru *lru;
170159 bool (*shrink)(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket);
@@ -185,11 +174,14 @@ msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc) · 14 unmodified lines
185174 for (unsigned i = 0; (nr > 0) && (i < ARRAY_SIZE(stages)); i++) {
186175 if (!stages[i].cond)
187176 continue;
177+ /*
178+ * 'ticket' not needed on trylock paths
179+ */
188180 stages[i].freed =
189− drm_gem_lru_scan(stages[i].lru, nr,
181+ drm_gem_lru_scan(priv->dev, stages[i].lru, nr,
190182 &stages[i].remaining,
191183 stages[i].shrink,
192− &ticket);
184+ NULL);
193185 nr -= stages[i].freed;
194186 freed += stages[i].freed;
195187 remaining += stages[i].remaining;
@@ -255,7 +247,7 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr) · 59 unmodified lines
255247 unsigned long remaining = 0;
256248
257249 for (idx = 0; lrus[idx] && unmapped < vmap_shrink_limit; idx++) {
258− unmapped += drm_gem_lru_scan(lrus[idx],
250+ unmapped += drm_gem_lru_scan(priv->dev, lrus[idx],
259251 vmap_shrink_limit - unmapped,
260252 &remaining,
261253 vmap_shrink,
drivers/gpu/drm/msm/msm_gem_submit.c+3−3
@@ -352,7 +352,7 @@ static int submit_fence_sync(struct msm_gem_submit *submit) · 351 unmodified lines
352352
353353 static int submit_pin_objects(struct msm_gem_submit *submit)
354354 {
355− struct msm_drm_private *priv = submit->dev->dev_private;
355+ struct drm_device *dev = submit->dev;
356356 int i, ret = 0;
357357
358358 for (i = 0; i < submit->nr_bos; i++) {
@@ -381,11 +381,11 @@ static int submit_pin_objects(struct msm_gem_submit *submit) · 22 unmodified lines
381381 * get_pages() which could trigger reclaim.. and if we held the LRU lock
382382 * could trigger deadlock with the shrinker).
383383 */
384− mutex_lock(&priv->lru.lock);
384+ mutex_lock(&dev->gem_lru_mutex);
385385 for (i = 0; i < submit->nr_bos; i++) {
386386 msm_gem_pin_obj_locked(submit->bos[i].obj);
387387 }
388− mutex_unlock(&priv->lru.lock);
388+ mutex_unlock(&dev->gem_lru_mutex);
389389
390390 submit->bos_pinned = true;
391391
drivers/gpu/drm/msm/msm_gem_vma.c+6−6
@@ -702,7 +702,7 @@ static struct dma_fence * · 701 unmodified lines
702702 msm_vma_job_run(struct drm_sched_job *_job)
703703 {
704704 struct msm_vm_bind_job *job = to_msm_vm_bind_job(_job);
705− struct msm_drm_private *priv = job->vm->drm->dev_private;
705+ struct drm_device *dev = job->vm->drm;
706706 struct msm_gem_vm *vm = to_msm_vm(job->vm);
707707 struct drm_gem_object *obj;
708708 int ret = vm->unusable ? -EINVAL : 0;
@@ -745,13 +745,13 @@ msm_vma_job_run(struct drm_sched_job *_job) · 36 unmodified lines
745745 if (ret)
746746 msm_gem_vm_unusable(job->vm);
747747
748− mutex_lock(&priv->lru.lock);
748+ mutex_lock(&dev->gem_lru_mutex);
749749
750750 job_foreach_bo (obj, job) {
751751 msm_gem_unpin_active(obj);
752752 }
753753
754− mutex_unlock(&priv->lru.lock);
754+ mutex_unlock(&dev->gem_lru_mutex);
755755
756756 /* VM_BIND ops are synchronous, so no fence to wait on: */
757757 return NULL;
@@ -1305,7 +1305,7 @@ vm_bind_job_pin_objects(struct msm_vm_bind_job *job) · 547 unmodified lines
13051305 return PTR_ERR(pages);
13061306 }
13071307
1308− struct msm_drm_private *priv = job->vm->drm->dev_private;
1308+ struct drm_device *dev = job->vm->drm;
13091309
13101310 /*
13111311 * A second loop while holding the LRU lock (a) avoids acquiring/dropping
@@ -1314,10 +1314,10 @@ vm_bind_job_pin_objects(struct msm_vm_bind_job *job) · 2 unmodified lines
13141314 * get_pages() which could trigger reclaim.. and if we held the LRU lock
13151315 * could trigger deadlock with the shrinker).
13161316 */
1317− mutex_lock(&priv->lru.lock);
1317+ mutex_lock(&dev->gem_lru_mutex);
13181318 job_foreach_bo (obj, job)
13191319 msm_gem_pin_obj_locked(obj);
1320− mutex_unlock(&priv->lru.lock);
1320+ mutex_unlock(&dev->gem_lru_mutex);
13211321
13221322 job->bos_pinned = true;
13231323
drivers/gpu/drm/msm/msm_gpu.c+2−2
@@ -13,11 +13,11 @@ · 12 unmodified lines
1313 #include "msm_gpu_trace.h"
1414 //#include "adreno/adreno_gpu.h"
1515
16−#include <generated/utsrelease.h>
1716 #include <linux/string_helpers.h>
1817 #include <linux/devcoredump.h>
1918 #include <linux/sched/task.h>
2019 #include <linux/sched/mm.h>
20+#include <linux/utsname.h>
2121
2222 /*
2323 * Power Management:
@@ -196,7 +196,7 @@ static ssize_t msm_gpu_devcoredump_read(char *buffer, loff_t offset, · 172 unmodified lines
196196 p = drm_coredump_printer(&iter);
197197
198198 drm_printf(&p, "---\n");
199− drm_printf(&p, "kernel: " UTS_RELEASE "\n");
199+ drm_printf(&p, "kernel: %s\n", init_utsname()->release);
200200 drm_printf(&p, "module: " KBUILD_MODNAME "\n");
201201 drm_printf(&p, "time: %ptSp\n", &state->time);
202202 if (state->comm)
drivers/gpu/drm/msm/msm_iommu.c+3−2
@@ -677,7 +677,7 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, · 676 unmodified lines
677677 int prot)
678678 {
679679 struct msm_iommu *iommu = to_msm_iommu(mmu);
680− size_t ret;
680+ ssize_t ret;
681681
682682 WARN_ON(off != 0);
683683
@@ -686,7 +686,8 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, · 2 unmodified lines
686686 iova |= GENMASK_ULL(63, 49);
687687
688688 ret = iommu_map_sgtable(iommu->domain, iova, sgt, prot);
689− WARN_ON(!ret);
689+ if (ret < 0)
690+ return ret;
690691
691692 return (ret == len) ? 0 : -EINVAL;
692693 }
drivers/gpu/drm/msm/msm_ringbuffer.c+3−3
@@ -16,13 +16,13 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job) · 15 unmodified lines
1616 struct msm_gem_submit *submit = to_msm_submit(job);
1717 struct msm_fence_context *fctx = submit->ring->fctx;
1818 struct msm_gpu *gpu = submit->gpu;
19− struct msm_drm_private *priv = gpu->dev->dev_private;
19+ struct drm_device *dev = gpu->dev;
2020 unsigned nr_cmds = submit->nr_cmds;
2121 int i;
2222
2323 msm_fence_init(submit->hw_fence, fctx);
2424
25− mutex_lock(&priv->lru.lock);
25+ mutex_lock(&dev->gem_lru_mutex);
2626
2727 for (i = 0; i < submit->nr_bos; i++) {
2828 struct drm_gem_object *obj = submit->bos[i].obj;
@@ -32,7 +32,7 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job) · 3 unmodified lines
3232
3333 submit->bos_pinned = false;
3434
35− mutex_unlock(&priv->lru.lock);
35+ mutex_unlock(&dev->gem_lru_mutex);
3636
3737 /* TODO move submit path over to using a per-ring lock.. */
3838 mutex_lock(&gpu->lock);
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+9−2
@@ -2513,6 +2513,7 @@ static const struct nvkm_device_chip · 2512 unmodified lines
25132513 nv170_chipset = {
25142514 .name = "GA100",
25152515 .bar = { 0x00000001, tu102_bar_new },
2516+ .bios = { 0x00000001, nvkm_bios_new },
25162517 .devinit = { 0x00000001, ga100_devinit_new },
25172518 .fault = { 0x00000001, tu102_fault_new },
25182519 .fb = { 0x00000001, ga100_fb_new },
@@ -2529,7 +2530,6 @@ nv170_chipset = { · 10 unmodified lines
25292530 .vfn = { 0x00000001, ga100_vfn_new },
25302531 .ce = { 0x000003ff, ga100_ce_new },
25312532 .fifo = { 0x00000001, ga100_fifo_new },
2532− .sec2 = { 0x00000001, tu102_sec2_new },
25332533 };
25342534
25352535 static const struct nvkm_device_chip
@@ -3341,7 +3341,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 805 unmodified lines
33413341 case 0x166: device->chip = &nv166_chipset; break;
33423342 case 0x167: device->chip = &nv167_chipset; break;
33433343 case 0x168: device->chip = &nv168_chipset; break;
3344− case 0x170: device->chip = &nv170_chipset; break;
33453344 case 0x172: device->chip = &nv172_chipset; break;
33463345 case 0x173: device->chip = &nv173_chipset; break;
33473346 case 0x174: device->chip = &nv174_chipset; break;
@@ -3361,6 +3360,14 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 13 unmodified lines
33613360 case 0x1b6: device->chip = &nv1b6_chipset; break;
33623361 case 0x1b7: device->chip = &nv1b7_chipset; break;
33633362 default:
3363+ if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
3364+ switch (device->chipset) {
3365+ case 0x170: device->chip = &nv170_chipset; break;
3366+ default:
3367+ break;
3368+ }
3369+ }
3370+
33643371 if (!device->chip) {
33653372 nvdev_error(device, "unknown chipset (%08x)\n", boot0);
33663373 ret = -ENODEV;
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c+4−0
@@ -41,11 +41,15 @@ ga100_gsp_flcn = { · 40 unmodified lines
4141 static const struct nvkm_gsp_func
4242 ga100_gsp = {
4343 .flcn = &ga100_gsp_flcn,
44+ .fwsec = &tu102_gsp_fwsec,
4445
4546 .sig_section = ".fwsignature_ga100",
4647
4748 .booter.ctor = tu102_gsp_booter_ctor,
4849
50+ .fwsec_sb.ctor = tu102_gsp_fwsec_sb_ctor,
51+ .fwsec_sb.dtor = tu102_gsp_fwsec_sb_dtor,
52+
4953 .dtor = r535_gsp_dtor,
5054 .oneinit = tu102_gsp_oneinit,
5155 .init = tu102_gsp_init,
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c+5−13
@@ -318,13 +318,8 @@ tu102_gsp_oneinit(struct nvkm_gsp *gsp) · 317 unmodified lines
318318 if (ret)
319319 return ret;
320320
321− /*
322− * Calculate FB layout. FRTS is a memory region created by the FWSEC-FRTS firmware.
323− * FWSEC comes from VBIOS. So on systems with no VBIOS (e.g. GA100), the FRTS does
324− * not exist. Therefore, use the existence of VBIOS to determine whether to reserve
325− * an FRTS region.
326− */
327− gsp->fb.wpr2.frts.size = device->bios ? 0x100000 : 0;
321+ /* Calculate FB layout. */
322+ gsp->fb.wpr2.frts.size = 0x100000;
328323 gsp->fb.wpr2.frts.addr = ALIGN_DOWN(gsp->fb.bios.addr, 0x20000) - gsp->fb.wpr2.frts.size;
329324
330325 gsp->fb.wpr2.boot.size = gsp->boot.fw.size;
@@ -348,12 +343,9 @@ tu102_gsp_oneinit(struct nvkm_gsp *gsp) · 17 unmodified lines
348343 if (ret)
349344 return ret;
350345
351− /* Only boot FWSEC-FRTS if it actually exists */
352− if (gsp->fb.wpr2.frts.size) {
353− ret = nvkm_gsp_fwsec_frts(gsp);
354− if (WARN_ON(ret))
355− return ret;
356− }
346+ ret = nvkm_gsp_fwsec_frts(gsp);
347+ if (WARN_ON(ret))
348+ return ret;
357349
358350 /* Reset GSP into RISC-V mode. */
359351 ret = gsp->func->reset(gsp);
drivers/gpu/drm/panel/Kconfig+1−0
@@ -208,6 +208,7 @@ config DRM_PANEL_HIMAX_HX83121A · 207 unmodified lines
208208 depends on OF
209209 depends on DRM_MIPI_DSI
210210 depends on BACKLIGHT_CLASS_DEVICE
211+ select DRM_DISPLAY_DSC_HELPER
211212 select DRM_KMS_HELPER
212213 help
213214 Say Y here if you want to enable support for Himax HX83121A-based
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c+2−0
@@ -1324,6 +1324,8 @@ static int boe_panel_disable(struct drm_panel *panel) · 1323 unmodified lines
13241324 mipi_dsi_dcs_set_display_off_multi(&ctx);
13251325 mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
13261326
1327+ boe->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
1328+
13271329 mipi_dsi_msleep(&ctx, 150);
13281330
13291331 return ctx.accum_err;
drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c+1−3
@@ -98,9 +98,7 @@ static int feiyang_enable(struct drm_panel *panel) · 97 unmodified lines
9898 /* T12 (video & logic signal rise + backlight rise) T12 >= 200ms */
9999 msleep(200);
100100
101− mipi_dsi_dcs_set_display_on(ctx->dsi);
102−
103− return 0;
101+ return mipi_dsi_dcs_set_display_on(ctx->dsi);
104102 }
105103
106104 static int feiyang_disable(struct drm_panel *panel)
drivers/gpu/drm/panel/panel-himax-hx83102.c+2−0
@@ -937,6 +937,8 @@ static int hx83102_disable(struct drm_panel *panel) · 936 unmodified lines
937937 mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
938938 mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
939939
940+ dsi->mode_flags |= MIPI_DSI_MODE_LPM;
941+
940942 mipi_dsi_msleep(&dsi_ctx, 150);
941943
942944 return dsi_ctx.accum_err;
drivers/gpu/drm/panel/panel-himax-hx83121a.c+2−2
@@ -596,8 +596,8 @@ static int himax_probe(struct mipi_dsi_device *dsi) · 595 unmodified lines
596596
597597 ctx = devm_drm_panel_alloc(dev, struct himax, panel, &himax_panel_funcs,
598598 DRM_MODE_CONNECTOR_DSI);
599− if (!ctx)
600− return -ENOMEM;
599+ if (IS_ERR(ctx))
600+ return PTR_ERR(ctx);
601601
602602 ret = devm_regulator_bulk_get_const(&dsi->dev,
603603 ARRAY_SIZE(himax_supplies),
drivers/gpu/drm/panfrost/panfrost_drv.c+2−0
@@ -390,6 +390,8 @@ panfrost_ioctl_wait_bo(struct drm_device *dev, void *data, · 389 unmodified lines
390390 true, timeout);
391391 if (!ret)
392392 ret = timeout ? -ETIMEDOUT : -EBUSY;
393+ else if (ret > 0)
394+ ret = 0;
393395
394396 drm_gem_object_put(gem_obj);
395397
drivers/gpu/drm/qxl/qxl_drv.c+4−2
@@ -118,12 +118,13 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 117 unmodified lines
118118 /* Complete initialization. */
119119 ret = drm_dev_register(&qdev->ddev, ent->driver_data);
120120 if (ret)
121− goto modeset_cleanup;
121+ goto poll_fini;
122122
123123 drm_client_setup(&qdev->ddev, NULL);
124124 return 0;
125125
126−modeset_cleanup:
126+poll_fini:
127+ drm_kms_helper_poll_fini(&qdev->ddev);
127128 qxl_modeset_fini(qdev);
128129 unload:
129130 qxl_device_fini(qdev);
@@ -154,6 +155,7 @@ qxl_pci_remove(struct pci_dev *pdev) · 24 unmodified lines
154155 {
155156 struct drm_device *dev = pci_get_drvdata(pdev);
156157
158+ drm_kms_helper_poll_fini(dev);
157159 drm_dev_unregister(dev);
158160 drm_atomic_helper_shutdown(dev);
159161 if (pci_is_vga(pdev) && pdev->revision < 5)
drivers/gpu/drm/radeon/ci_dpm.c+6−3
@@ -2461,7 +2461,8 @@ static void ci_register_patching_mc_arb(struct radeon_device *rdev, · 2460 unmodified lines
24612461
24622462 if (patch &&
24632463 ((rdev->pdev->device == 0x67B0) ||
2464− (rdev->pdev->device == 0x67B1))) {
2464+ (rdev->pdev->device == 0x67B1)) &&
2465+ (rdev->pdev->revision == 0)) {
24652466 if ((memory_clock > 100000) && (memory_clock <= 125000)) {
24662467 tmp2 = (((0x31 * engine_clock) / 125000) - 1) & 0xff;
24672468 *dram_timimg2 &= ~0x00ff0000;
@@ -3304,7 +3305,8 @@ static int ci_populate_all_memory_levels(struct radeon_device *rdev) · 836 unmodified lines
33043305 pi->smc_state_table.MemoryLevel[0].EnabledForActivity = 1;
33053306
33063307 if ((dpm_table->mclk_table.count >= 2) &&
3307− ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 0x67B1))) {
3308+ ((rdev->pdev->device == 0x67B0) || (rdev->pdev->device == 0x67B1)) &&
3309+ (rdev->pdev->revision == 0)) {
33083310 pi->smc_state_table.MemoryLevel[1].MinVddc =
33093311 pi->smc_state_table.MemoryLevel[0].MinVddc;
33103312 pi->smc_state_table.MemoryLevel[1].MinVddcPhases =
@@ -4493,7 +4495,8 @@ static int ci_register_patching_mc_seq(struct radeon_device *rdev, · 1182 unmodified lines
44934495
44944496 if (patch &&
44954497 ((rdev->pdev->device == 0x67B0) ||
4496− (rdev->pdev->device == 0x67B1))) {
4498+ (rdev->pdev->device == 0x67B1)) &&
4499+ (rdev->pdev->revision == 0)) {
44974500 for (i = 0; i < table->last; i++) {
44984501 if (table->last >= SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE)
44994502 return -EINVAL;
drivers/gpu/drm/radeon/evergreen_cs.c+4−2
@@ -312,8 +312,10 @@ static int evergreen_surface_check(struct radeon_cs_parser *p, · 311 unmodified lines
312312 case ARRAY_2D_TILED_THIN1:
313313 return evergreen_surface_check_2d(p, surf, prefix);
314314 default:
315− dev_warn(p->dev, "%s:%d %s invalid array mode %d\n",
316− __func__, __LINE__, prefix, surf->mode);
315+ if (prefix) {
316+ dev_warn(p->dev, "%s:%d %s invalid array mode %d\n",
317+ __func__, __LINE__, prefix, surf->mode);
318+ }
317319 return -EINVAL;
318320 }
319321 return -EINVAL;
drivers/gpu/drm/sti/sti_hda.c+4−4
@@ -741,6 +741,7 @@ static int sti_hda_probe(struct platform_device *pdev) · 740 unmodified lines
741741 struct device *dev = &pdev->dev;
742742 struct sti_hda *hda;
743743 struct resource *res;
744+ int ret;
744745
745746 DRM_INFO("%s\n", __func__);
746747
@@ -779,7 +780,9 @@ static int sti_hda_probe(struct platform_device *pdev) · 32 unmodified lines
779780 return PTR_ERR(hda->clk_hddac);
780781 }
781782
782− drm_bridge_add(&hda->bridge);
783+ ret = devm_drm_bridge_add(dev, &hda->bridge);
784+ if (ret)
785+ return ret;
783786
784787 platform_set_drvdata(pdev, hda);
785788
@@ -788,10 +791,7 @@ static int sti_hda_probe(struct platform_device *pdev) · 2 unmodified lines
788791
789792 static void sti_hda_remove(struct platform_device *pdev)
790793 {
791− struct sti_hda *hda = platform_get_drvdata(pdev);
792−
793794 component_del(&pdev->dev, &sti_hda_ops);
794− drm_bridge_remove(&hda->bridge);
795795 }
796796
797797 static const struct of_device_id hda_of_match[] = {
drivers/gpu/drm/sysfb/ofdrm.c+2−0
@@ -350,6 +350,7 @@ static void ofdrm_pci_release(void *data) · 349 unmodified lines
350350 struct pci_dev *pcidev = data;
351351
352352 pci_disable_device(pcidev);
353+ pci_dev_put(pcidev);
353354 }
354355
355356 static int ofdrm_device_init_pci(struct ofdrm_device *odev)
@@ -375,6 +376,7 @@ static int ofdrm_device_init_pci(struct ofdrm_device *odev) · 19 unmodified lines
375376 if (ret) {
376377 drm_err(dev, "pci_enable_device(%s) failed: %d\n",
377378 dev_name(&pcidev->dev), ret);
379+ pci_dev_put(pcidev);
378380 return ret;
379381 }
380382 ret = devm_add_action_or_reset(&pdev->dev, ofdrm_pci_release, pcidev);
drivers/gpu/drm/tiny/appletbdrm.c+2−2
@@ -353,7 +353,7 @@ static int appletbdrm_primary_plane_helper_atomic_check(struct drm_plane *plane, · 352 unmodified lines
353353 frames_size +
354354 sizeof(struct appletbdrm_fb_request_footer), 16);
355355
356− appletbdrm_state->request = kzalloc(request_size, GFP_KERNEL);
356+ appletbdrm_state->request = kvzalloc(request_size, GFP_KERNEL);
357357
358358 if (!appletbdrm_state->request)
359359 return -ENOMEM;
@@ -543,7 +543,7 @@ static void appletbdrm_primary_plane_destroy_state(struct drm_plane *plane, · 183 unmodified lines
543543 {
544544 struct appletbdrm_plane_state *appletbdrm_state = to_appletbdrm_plane_state(state);
545545
546− kfree(appletbdrm_state->request);
546+ kvfree(appletbdrm_state->request);
547547 kfree(appletbdrm_state->response);
548548
549549 __drm_gem_destroy_shadow_plane_state(&appletbdrm_state->base);
drivers/gpu/drm/tiny/bochs.c+3−7
@@ -761,25 +761,21 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent · 760 unmodified lines
761761
762762 ret = pcim_enable_device(pdev);
763763 if (ret)
764− goto err_free_dev;
764+ return ret;
765765
766766 pci_set_drvdata(pdev, dev);
767767
768768 ret = bochs_load(bochs);
769769 if (ret)
770− goto err_free_dev;
770+ return ret;
771771
772772 ret = drm_dev_register(dev, 0);
773773 if (ret)
774− goto err_free_dev;
774+ return ret;
775775
776776 drm_client_setup(dev, NULL);
777777
778778 return ret;
779−
780−err_free_dev:
781− drm_dev_put(dev);
782− return ret;
783779 }
784780
785781 static void bochs_pci_remove(struct pci_dev *pdev)
drivers/gpu/drm/ttm/ttm_bo.c+7−11
@@ -739,7 +739,7 @@ static int ttm_bo_alloc_resource(struct ttm_buffer_object *bo, · 738 unmodified lines
739739 may_evict = (force_space && place->mem_type != TTM_PL_SYSTEM);
740740 ret = ttm_resource_alloc(bo, place, res, force_space ? &limit_pool : NULL);
741741 if (ret) {
742− if (ret != -ENOSPC && ret != -EAGAIN) {
742+ if (ret != -ENOSPC) {
743743 dmem_cgroup_pool_state_put(limit_pool);
744744 return ret;
745745 }
@@ -1177,17 +1177,13 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo) · 431 unmodified lines
11771177 bdev->funcs->swap_notify(bo);
11781178
11791179 if (ttm_tt_is_populated(tt)) {
1180− spin_lock(&bdev->lru_lock);
1181− ttm_resource_del_bulk_move(bo->resource, bo);
1182− spin_unlock(&bdev->lru_lock);
1183−
11841180 ret = ttm_tt_swapout(bdev, tt, swapout_walk->gfp_flags);
1185−
1186− spin_lock(&bdev->lru_lock);
1187− if (ret)
1188− ttm_resource_add_bulk_move(bo->resource, bo);
1189− ttm_resource_move_to_lru_tail(bo->resource);
1190− spin_unlock(&bdev->lru_lock);
1181+ if (!ret) {
1182+ spin_lock(&bdev->lru_lock);
1183+ ttm_resource_del_bulk_move_unevictable(bo->resource, bo);
1184+ ttm_resource_move_to_lru_tail(bo->resource);
1185+ spin_unlock(&bdev->lru_lock);
1186+ }
11911187 }
11921188
11931189 out:
drivers/gpu/drm/ttm/ttm_bo_util.c+3−8
@@ -1112,19 +1112,14 @@ long ttm_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo, · 1111 unmodified lines
11121112 if (lret < 0)
11131113 return lret;
11141114
1115− if (bo->bulk_move) {
1116− spin_lock(&bdev->lru_lock);
1117− ttm_resource_del_bulk_move(bo->resource, bo);
1118− spin_unlock(&bdev->lru_lock);
1119− }
1120−
11211115 lret = ttm_tt_backup(bdev, bo->ttm, (struct ttm_backup_flags)
11221116 {.purge = flags.purge,
11231117 .writeback = flags.writeback});
11241118
1125− if (lret <= 0 && bo->bulk_move) {
1119+ if (lret > 0) {
11261120 spin_lock(&bdev->lru_lock);
1127− ttm_resource_add_bulk_move(bo->resource, bo);
1121+ ttm_resource_del_bulk_move_unevictable(bo->resource, bo);
1122+ ttm_resource_move_to_lru_tail(bo->resource);
11281123 spin_unlock(&bdev->lru_lock);
11291124 }
11301125
drivers/gpu/drm/ttm/ttm_pool.c+12−6
@@ -206,6 +206,14 @@ error_free: · 205 unmodified lines
206206 return NULL;
207207 }
208208
209+static void __free_pages_gpu_account(struct page *p, unsigned int order,
210+ bool reclaim)
211+{
212+ mod_lruvec_page_state(p, reclaim ? NR_GPU_RECLAIM : NR_GPU_ACTIVE,
213+ -(1 << order));
214+ __free_pages(p, order);
215+}
216+
209217 /* Reset the caching and pages of size 1 << order */
210218 static void ttm_pool_free_page(struct ttm_pool *pool, enum ttm_caching caching,
211219 unsigned int order, struct page *p, bool reclaim)
@@ -223,9 +231,7 @@ static void ttm_pool_free_page(struct ttm_pool *pool, enum ttm_caching caching, · 11 unmodified lines
223231 #endif
224232
225233 if (!pool || !ttm_pool_uses_dma_alloc(pool)) {
226− mod_lruvec_page_state(p, reclaim ? NR_GPU_RECLAIM : NR_GPU_ACTIVE,
227− -(1 << order));
228− __free_pages(p, order);
234+ __free_pages_gpu_account(p, order, reclaim);
229235 return;
230236 }
231237
@@ -606,7 +612,7 @@ static int ttm_pool_restore_commit(struct ttm_pool_tt_restore *restore, · 374 unmodified lines
606612 */
607613 ttm_pool_split_for_swap(restore->pool, p);
608614 copy_highpage(restore->alloced_page + i, p);
609− __free_pages(p, 0);
615+ __free_pages_gpu_account(p, 0, false);
610616 }
611617
612618 restore->restored_pages++;
@@ -1068,7 +1074,7 @@ long ttm_pool_backup(struct ttm_pool *pool, struct ttm_tt *tt, · 455 unmodified lines
10681074 if (flags->purge) {
10691075 shrunken += num_pages;
10701076 page->private = 0;
1071− __free_pages(page, order);
1077+ __free_pages_gpu_account(page, order, false);
10721078 memset(tt->pages + i, 0,
10731079 num_pages * sizeof(*tt->pages));
10741080 }
@@ -1109,7 +1115,7 @@ long ttm_pool_backup(struct ttm_pool *pool, struct ttm_tt *tt, · 34 unmodified lines
11091115 }
11101116 handle = shandle;
11111117 tt->pages[i] = ttm_backup_handle_to_page_ptr(handle);
1112− put_page(page);
1118+ __free_pages_gpu_account(page, 0, false);
11131119 shrunken++;
11141120 }
11151121
drivers/gpu/drm/ttm/ttm_resource.c+17−1
@@ -292,6 +292,19 @@ void ttm_resource_del_bulk_move(struct ttm_resource *res, · 291 unmodified lines
292292 ttm_lru_bulk_move_del(bo->bulk_move, res);
293293 }
294294
295+/*
296+ * Remove a resource from its bulk_move, bypassing the unevictable check.
297+ * Use only when the resource is known to still be tracked in the range despite
298+ * the BO having just become unevictable; asserts that this is the case.
299+ */
300+void ttm_resource_del_bulk_move_unevictable(struct ttm_resource *res,
301+ struct ttm_buffer_object *bo)
302+{
303+ WARN_ON_ONCE(!ttm_resource_unevictable(res, bo));
304+ if (bo->bulk_move)
305+ ttm_lru_bulk_move_del(bo->bulk_move, res);
306+}
307+
295308 /* Move a resource to the LRU or bulk tail */
296309 void ttm_resource_move_to_lru_tail(struct ttm_resource *res)
297310 {
@@ -385,8 +398,11 @@ int ttm_resource_alloc(struct ttm_buffer_object *bo, · 87 unmodified lines
385398
386399 if (man->cg) {
387400 ret = dmem_cgroup_try_charge(man->cg, bo->base.size, &pool, ret_limit_pool);
388− if (ret)
401+ if (ret) {
402+ if (ret == -EAGAIN)
403+ ret = -ENOSPC;
389404 return ret;
405+ }
390406 }
391407
392408 ret = man->func->alloc(man, bo, place, res_ptr);
drivers/gpu/drm/udl/udl_main.c+1−2
@@ -285,13 +285,12 @@ static struct urb *udl_get_urb_locked(struct udl_device *udl, long timeout) · 284 unmodified lines
285285 return unode->urb;
286286 }
287287
288−#define GET_URB_TIMEOUT HZ
289288 struct urb *udl_get_urb(struct udl_device *udl)
290289 {
291290 struct urb *urb;
292291
293292 spin_lock_irq(&udl->urbs.lock);
294− urb = udl_get_urb_locked(udl, GET_URB_TIMEOUT);
293+ urb = udl_get_urb_locked(udl, HZ * 2);
295294 spin_unlock_irq(&udl->urbs.lock);
296295 return urb;
297296 }
drivers/gpu/drm/udl/udl_modeset.c+4−1
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <drm/drm_gem_framebuffer_helper.h>
2222 #include <drm/drm_gem_shmem_helper.h>
2323 #include <drm/drm_modeset_helper_vtables.h>
24+#include <drm/drm_print.h>
2425 #include <drm/drm_probe_helper.h>
2526 #include <drm/drm_vblank.h>
2627
@@ -342,8 +343,10 @@ static void udl_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atom · 315 unmodified lines
342343 return;
343344
344345 urb = udl_get_urb(udl);
345− if (!urb)
346+ if (!urb) {
347+ drm_err_ratelimited(dev, "get urb failed when enabling crtc\n");
346348 goto out;
349+ }
347350
348351 buf = (char *)urb->transfer_buffer;
349352 buf = udl_vidreg_lock(buf);
drivers/gpu/drm/v3d/v3d_sched.c+1−15
@@ -125,20 +125,6 @@ v3d_performance_query_info_free(struct v3d_performance_query_info *query_info, · 124 unmodified lines
125125 }
126126 }
127127
128−static void
129−v3d_cpu_job_free(struct drm_sched_job *sched_job)
130−{
131− struct v3d_cpu_job *job = to_cpu_job(sched_job);
132−
133− v3d_timestamp_query_info_free(&job->timestamp_query,
134− job->timestamp_query.count);
135−
136− v3d_performance_query_info_free(&job->performance_query,
137− job->performance_query.count);
138−
139− v3d_job_cleanup(&job->base);
140−}
141−
142128 static void
143129 v3d_switch_perfmon(struct v3d_dev *v3d, struct v3d_job *job)
144130 {
@@ -830,7 +816,7 @@ static const struct drm_sched_backend_ops v3d_cache_clean_sched_ops = { · 685 unmodified lines
830816
831817 static const struct drm_sched_backend_ops v3d_cpu_sched_ops = {
832818 .run_job = v3d_cpu_job_run,
833− .free_job = v3d_cpu_job_free
819+ .free_job = v3d_sched_job_free
834820 };
835821
836822 static int
drivers/gpu/drm/v3d/v3d_submit.c+19−3
@@ -123,6 +123,24 @@ v3d_render_job_free(struct kref *ref) · 122 unmodified lines
123123 v3d_job_free(ref);
124124 }
125125
126+static void
127+v3d_cpu_job_free(struct kref *ref)
128+{
129+ struct v3d_cpu_job *job = container_of(ref, struct v3d_cpu_job,
130+ base.refcount);
131+
132+ v3d_timestamp_query_info_free(&job->timestamp_query,
133+ job->timestamp_query.count);
134+
135+ v3d_performance_query_info_free(&job->performance_query,
136+ job->performance_query.count);
137+
138+ if (job->indirect_csd.indirect)
139+ drm_gem_object_put(job->indirect_csd.indirect);
140+
141+ v3d_job_free(ref);
142+}
143+
126144 void v3d_job_cleanup(struct v3d_job *job)
127145 {
128146 if (!job)
@@ -1302,7 +1320,7 @@ v3d_submit_cpu_ioctl(struct drm_device *dev, void *data, · 1173 unmodified lines
13021320 trace_v3d_submit_cpu_ioctl(&v3d->drm, cpu_job->job_type);
13031321
13041322 ret = v3d_job_init(v3d, file_priv, &cpu_job->base,
1305− v3d_job_free, 0, &se, V3D_CPU);
1323+ v3d_cpu_job_free, 0, &se, V3D_CPU);
13061324 if (ret) {
13071325 v3d_job_deallocate((void *)&cpu_job);
13081326 goto fail;
@@ -1385,8 +1403,6 @@ fail: · 76 unmodified lines
13851403 v3d_job_cleanup((void *)csd_job);
13861404 v3d_job_cleanup(clean_job);
13871405 v3d_put_multisync_post_deps(&se);
1388− kvfree(cpu_job->timestamp_query.queries);
1389− kvfree(cpu_job->performance_query.queries);
13901406
13911407 return ret;
13921408 }
drivers/gpu/drm/virtio/virtgpu_drv.h+1−0
@@ -317,6 +317,7 @@ virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents · 316 unmodified lines
317317 void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs,
318318 struct drm_gem_object *obj);
319319 int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs);
320+int virtio_gpu_lock_one_resv_uninterruptible(struct virtio_gpu_object_array *objs);
320321 void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs);
321322 void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs,
322323 struct dma_fence *fence);
drivers/gpu/drm/virtio/virtgpu_gem.c+17−0
@@ -238,6 +238,23 @@ int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs) · 237 unmodified lines
238238 return ret;
239239 }
240240
241+int virtio_gpu_lock_one_resv_uninterruptible(struct virtio_gpu_object_array *objs)
242+{
243+ int ret;
244+
245+ if (objs->nents != 1)
246+ return -EINVAL;
247+
248+ dma_resv_lock(objs->objs[0]->resv, NULL);
249+
250+ ret = dma_resv_reserve_fences(objs->objs[0]->resv, 1);
251+ if (ret) {
252+ virtio_gpu_array_unlock_resv(objs);
253+ return ret;
254+ }
255+ return 0;
256+}
257+
241258 void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs)
242259 {
243260 if (objs->nents == 1) {
drivers/gpu/drm/virtio/virtgpu_plane.c+8−2
@@ -215,7 +215,10 @@ static void virtio_gpu_resource_flush(struct drm_plane *plane, · 214 unmodified lines
215215 if (!objs)
216216 return;
217217 virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);
218− virtio_gpu_array_lock_resv(objs);
218+ if (virtio_gpu_lock_one_resv_uninterruptible(objs)) {
219+ virtio_gpu_array_put_free(objs);
220+ return;
221+ }
219222 virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle, x, y,
220223 width, height, objs,
221224 vgplane_st->fence);
@@ -459,7 +462,10 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, · 237 unmodified lines
459462 if (!objs)
460463 return;
461464 virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);
462− virtio_gpu_array_lock_resv(objs);
465+ if (virtio_gpu_lock_one_resv_uninterruptible(objs)) {
466+ virtio_gpu_array_put_free(objs);
467+ return;
468+ }
463469 virtio_gpu_cmd_transfer_to_host_2d
464470 (vgdev, 0,
465471 plane->state->crtc_w,
drivers/gpu/drm/xe/Makefile+1−0
@@ -88,6 +88,7 @@ xe-y += xe_bb.o \ · 87 unmodified lines
8888 xe_irq.o \
8989 xe_late_bind_fw.o \
9090 xe_lrc.o \
91+ xe_mem_pool.o \
9192 xe_migrate.o \
9293 xe_mmio.o \
9394 xe_mmio_gem.o \
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c+10−2
@@ -37,9 +37,17 @@ static bool intel_hdcp_gsc_check_status(struct drm_device *drm) · 36 unmodified lines
3737 struct xe_device *xe = to_xe_device(drm);
3838 struct xe_tile *tile = xe_device_get_root_tile(xe);
3939 struct xe_gt *gt = tile->media_gt;
40− struct xe_gsc *gsc = &gt->uc.gsc;
40+ struct xe_gsc *gsc;
41+
42+ if (!gt) {
43+ drm_dbg_kms(&xe->drm,
44+ "not checking GSC status for HDCP2.x: media GT not present or disabled\n");
45+ return false;
46+ }
47+
48+ gsc = &gt->uc.gsc;
4149
42− if (!gsc || !xe_uc_fw_is_available(&gsc->fw)) {
50+ if (!xe_uc_fw_is_available(&gsc->fw)) {
4351 drm_dbg_kms(&xe->drm,
4452 "GSC Components not ready for HDCP2.x\n");
4553 return false;
drivers/gpu/drm/xe/regs/xe_gt_regs.h+4−2
@@ -152,10 +152,11 @@ · 151 unmodified lines
152152
153153 #define XEHPG_INSTDONE_GEOM_SVGUNIT XE_REG_MCR(0x666c)
154154
155−#define CACHE_MODE_1 XE_REG(0x7004, XE_REG_OPTION_MASKED)
155+#define CACHE_MODE_1 XE_REG_MCR(0x7004, XE_REG_OPTION_MASKED)
156156 #define MSAA_OPTIMIZATION_REDUC_DISABLE REG_BIT(11)
157157
158158 #define COMMON_SLICE_CHICKEN1 XE_REG(0x7010, XE_REG_OPTION_MASKED)
159+#define XEHP_COMMON_SLICE_CHICKEN1 XE_REG_MCR(0x7010, XE_REG_OPTION_MASKED)
159160 #define DISABLE_BOTTOM_CLIP_RECTANGLE_TEST REG_BIT(14)
160161
161162 #define HIZ_CHICKEN XE_REG(0x7018, XE_REG_OPTION_MASKED)
@@ -178,6 +179,7 @@ · 16 unmodified lines
178179 #define XEHPG_SC_INSTDONE_EXTRA2 XE_REG_MCR(0x7108)
179180
180181 #define COMMON_SLICE_CHICKEN4 XE_REG(0x7300, XE_REG_OPTION_MASKED)
182+#define XEHP_COMMON_SLICE_CHICKEN4 XE_REG_MCR(0x7300, XE_REG_OPTION_MASKED)
181183 #define SBE_PUSH_CONSTANT_BEHIND_FIX_ENABLE REG_BIT(12)
182184 #define DISABLE_TDC_LOAD_BALANCING_CALC REG_BIT(6)
183185 #define HW_FILTERING REG_BIT(5)
@@ -583,7 +585,7 @@ · 399 unmodified lines
583585 #define DISABLE_128B_EVICTION_COMMAND_UDW REG_BIT(36 - 32)
584586 #define LSCFE_SAME_ADDRESS_ATOMICS_COALESCING_DISABLE REG_BIT(35 - 32)
585587
586−#define ROW_CHICKEN5 XE_REG_MCR(0xe7f0)
588+#define ROW_CHICKEN5 XE_REG_MCR(0xe7f0, XE_REG_OPTION_MASKED)
587589 #define CPSS_AWARE_DIS REG_BIT(3)
588590
589591 #define SARB_CHICKEN1 XE_REG_MCR(0xe90c)
drivers/gpu/drm/xe/xe_bo.c+9−5
@@ -897,10 +897,10 @@ void xe_bo_set_purgeable_state(struct xe_bo *bo, · 896 unmodified lines
897897 new_state == XE_MADV_PURGEABLE_PURGED);
898898
899899 /* Once purged, always purged - cannot transition out */
900− xe_assert(xe, !(bo->madv_purgeable == XE_MADV_PURGEABLE_PURGED &&
900+ xe_assert(xe, !(bo->purgeable.state == XE_MADV_PURGEABLE_PURGED &&
901901 new_state != XE_MADV_PURGEABLE_PURGED));
902902
903− bo->madv_purgeable = new_state;
903+ bo->purgeable.state = new_state;
904904 xe_bo_set_purgeable_shrinker(bo, new_state);
905905 }
906906
@@ -2322,8 +2322,10 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo, · 1415 unmodified lines
23222322 }
23232323
23242324 /* XE_BO_FLAG_GGTTx requires XE_BO_FLAG_GGTT also be set */
2325− if ((flags & XE_BO_FLAG_GGTT_ALL) && !(flags & XE_BO_FLAG_GGTT))
2325+ if ((flags & XE_BO_FLAG_GGTT_ALL) && !(flags & XE_BO_FLAG_GGTT)) {
2326+ xe_bo_free(bo);
23262327 return ERR_PTR(-EINVAL);
2328+ }
23272329
23282330 if (flags & (XE_BO_FLAG_VRAM_MASK | XE_BO_FLAG_STOLEN) &&
23292331 !(flags & XE_BO_FLAG_IGNORE_MIN_PAGE_SIZE) &&
@@ -2342,8 +2344,10 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo, · 12 unmodified lines
23422344 alignment = SZ_4K >> PAGE_SHIFT;
23432345 }
23442346
2345− if (type == ttm_bo_type_device && aligned_size != size)
2347+ if (type == ttm_bo_type_device && aligned_size != size) {
2348+ xe_bo_free(bo);
23462349 return ERR_PTR(-EINVAL);
2350+ }
23472351
23482352 if (!bo) {
23492353 bo = xe_bo_alloc();
@@ -2364,7 +2368,7 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo, · 14 unmodified lines
23642368 INIT_LIST_HEAD(&bo->vram_userfault_link);
23652369
23662370 /* Initialize purge advisory state */
2367− bo->madv_purgeable = XE_MADV_PURGEABLE_WILLNEED;
2371+ bo->purgeable.state = XE_MADV_PURGEABLE_WILLNEED;
23682372
23692373 drm_gem_private_object_init(&xe->drm, &bo->ttm.base, size);
23702374
drivers/gpu/drm/xe/xe_bo.h+86−2
@@ -251,7 +251,7 @@ static inline bool xe_bo_is_protected(const struct xe_bo *bo) · 250 unmodified lines
251251 static inline bool xe_bo_is_purged(struct xe_bo *bo)
252252 {
253253 xe_bo_assert_held(bo);
254− return bo->madv_purgeable == XE_MADV_PURGEABLE_PURGED;
254+ return bo->purgeable.state == XE_MADV_PURGEABLE_PURGED;
255255 }
256256
257257 /**
@@ -268,11 +268,95 @@ static inline bool xe_bo_is_purged(struct xe_bo *bo) · 10 unmodified lines
268268 static inline bool xe_bo_madv_is_dontneed(struct xe_bo *bo)
269269 {
270270 xe_bo_assert_held(bo);
271− return bo->madv_purgeable == XE_MADV_PURGEABLE_DONTNEED;
271+ return bo->purgeable.state == XE_MADV_PURGEABLE_DONTNEED;
272272 }
273273
274274 void xe_bo_set_purgeable_state(struct xe_bo *bo, enum xe_madv_purgeable_state new_state);
275275
276+/**
277+ * xe_bo_willneed_get_locked() - Acquire a WILLNEED holder on a BO
278+ * @bo: Buffer object
279+ *
280+ * Increments willneed_count and, on a 0->1 transition, promotes the BO
281+ * from DONTNEED to WILLNEED. PURGED is terminal and is never modified.
282+ *
283+ * Caller must hold the BO's dma-resv lock.
284+ */
285+static inline void xe_bo_willneed_get_locked(struct xe_bo *bo)
286+{
287+ xe_bo_assert_held(bo);
288+
289+ /* Imported BOs are owned externally; do not track purgeability. */
290+ if (drm_gem_is_imported(&bo->ttm.base))
291+ return;
292+
293+ if (bo->purgeable.willneed_count++ == 0 && xe_bo_madv_is_dontneed(bo))
294+ xe_bo_set_purgeable_state(bo, XE_MADV_PURGEABLE_WILLNEED);
295+}
296+
297+/**
298+ * xe_bo_willneed_put_locked() - Release a WILLNEED holder on a BO
299+ * @bo: Buffer object
300+ *
301+ * Decrements willneed_count and, on a 1->0 transition, marks the BO
302+ * DONTNEED only if it still has VMAs (implying all active VMAs are
303+ * DONTNEED). If the last VMA is being removed, preserve the current BO
304+ * state to match the previous VMA-walk semantics.
305+ *
306+ * PURGED is terminal and the BO state is never modified.
307+ *
308+ * Caller must hold the BO's dma-resv lock.
309+ */
310+static inline void xe_bo_willneed_put_locked(struct xe_bo *bo)
311+{
312+ xe_bo_assert_held(bo);
313+
314+ if (drm_gem_is_imported(&bo->ttm.base))
315+ return;
316+
317+ xe_assert(xe_bo_device(bo), bo->purgeable.willneed_count > 0);
318+ if (--bo->purgeable.willneed_count == 0 && bo->purgeable.vma_count > 0 &&
319+ !xe_bo_is_purged(bo))
320+ xe_bo_set_purgeable_state(bo, XE_MADV_PURGEABLE_DONTNEED);
321+}
322+
323+/**
324+ * xe_bo_vma_count_inc_locked() - Account a new VMA on a BO
325+ * @bo: Buffer object
326+ *
327+ * Increments vma_count.
328+ *
329+ * Caller must hold the BO's dma-resv lock.
330+ */
331+static inline void xe_bo_vma_count_inc_locked(struct xe_bo *bo)
332+{
333+ xe_bo_assert_held(bo);
334+
335+ if (drm_gem_is_imported(&bo->ttm.base))
336+ return;
337+
338+ bo->purgeable.vma_count++;
339+}
340+
341+/**
342+ * xe_bo_vma_count_dec_locked() - Account a VMA removal on a BO
343+ * @bo: Buffer object
344+ *
345+ * Decrements vma_count.
346+ *
347+ * Caller must hold the BO's dma-resv lock.
348+ */
349+static inline void xe_bo_vma_count_dec_locked(struct xe_bo *bo)
350+{
351+ xe_bo_assert_held(bo);
352+
353+ if (drm_gem_is_imported(&bo->ttm.base))
354+ return;
355+
356+ xe_assert(xe_bo_device(bo), bo->purgeable.vma_count > 0);
357+ bo->purgeable.vma_count--;
358+}
359+
276360 static inline void xe_bo_unpin_map_no_vm(struct xe_bo *bo)
277361 {
278362 if (likely(bo)) {
drivers/gpu/drm/xe/xe_bo_types.h+27−4
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include "xe_ggtt_types.h"
1919
2020 struct xe_device;
21+struct xe_mem_pool_node;
2122 struct xe_vm;
2223
2324 #define XE_BO_MAX_PLACEMENTS 3
@@ -88,7 +89,7 @@ struct xe_bo { · 64 unmodified lines
8889 bool ccs_cleared;
8990
9091 /** @bb_ccs: BB instructions of CCS read/write. Valid only for VF */
91− struct xe_bb *bb_ccs[XE_SRIOV_VF_CCS_CTX_COUNT];
92+ struct xe_mem_pool_node *bb_ccs[XE_SRIOV_VF_CCS_CTX_COUNT];
9293
9394 /**
9495 * @cpu_caching: CPU caching mode. Currently only used for userspace
@@ -110,10 +111,32 @@ struct xe_bo { · 15 unmodified lines
110111 u64 min_align;
111112
112113 /**
113− * @madv_purgeable: user space advise on BO purgeability, protected
114− * by BO's dma-resv lock.
114+ * @purgeable: Purgeability state and accounting.
115+ *
116+ * All fields are protected by the BO's dma-resv lock.
115117 */
116− u32 madv_purgeable;
118+ struct {
119+ /**
120+ * @purgeable.state: BO purgeability state
121+ * (WILLNEED/DONTNEED/PURGED).
122+ */
123+ u32 state;
124+
125+ /**
126+ * @purgeable.vma_count: Number of VMAs currently mapping this BO.
127+ */
128+ u32 vma_count;
129+
130+ /**
131+ * @purgeable.willneed_count: Number of active WILLNEED holders.
132+ *
133+ * Counts WILLNEED VMAs plus active dma-buf exports for
134+ * non-imported BOs. The BO flips to DONTNEED on a 1->0
135+ * transition only when VMAs still exist; if the last VMA is
136+ * removed, the previous BO state is preserved.
137+ */
138+ u32 willneed_count;
139+ } purgeable;
117140 };
118141
119142 #endif
drivers/gpu/drm/xe/xe_dma_buf.c+37−28
@@ -193,6 +193,18 @@ static int xe_dma_buf_begin_cpu_access(struct dma_buf *dma_buf, · 192 unmodified lines
193193 return 0;
194194 }
195195
196+static void xe_dma_buf_release(struct dma_buf *dmabuf)
197+{
198+ struct drm_gem_object *obj = dmabuf->priv;
199+ struct xe_bo *bo = gem_to_xe_bo(obj);
200+
201+ xe_bo_lock(bo, false);
202+ xe_bo_willneed_put_locked(bo);
203+ xe_bo_unlock(bo);
204+
205+ drm_gem_dmabuf_release(dmabuf);
206+}
207+
196208 static const struct dma_buf_ops xe_dmabuf_ops = {
197209 .attach = xe_dma_buf_attach,
198210 .detach = xe_dma_buf_detach,
@@ -200,7 +212,7 @@ static const struct dma_buf_ops xe_dmabuf_ops = { · 1 unmodified line
200212 .unpin = xe_dma_buf_unpin,
201213 .map_dma_buf = xe_dma_buf_map,
202214 .unmap_dma_buf = xe_dma_buf_unmap,
203− .release = drm_gem_dmabuf_release,
215+ .release = xe_dma_buf_release,
204216 .begin_cpu_access = xe_dma_buf_begin_cpu_access,
205217 .mmap = drm_gem_dmabuf_mmap,
206218 .vmap = drm_gem_dmabuf_vmap,
@@ -241,26 +253,33 @@ struct dma_buf *xe_gem_prime_export(struct drm_gem_object *obj, int flags) · 34 unmodified lines
241253 ret = -EINVAL;
242254 goto out_unlock;
243255 }
256+
257+ xe_bo_willneed_get_locked(bo);
244258 xe_bo_unlock(bo);
245259
246260 ret = ttm_bo_setup_export(&bo->ttm, &ctx);
247261 if (ret)
248− return ERR_PTR(ret);
262+ goto out_put;
249263
250264 buf = drm_gem_prime_export(obj, flags);
251− if (!IS_ERR(buf))
252− buf->ops = &xe_dmabuf_ops;
265+ if (IS_ERR(buf)) {
266+ ret = PTR_ERR(buf);
267+ goto out_put;
268+ }
253269
270+ buf->ops = &xe_dmabuf_ops;
254271 return buf;
255272
273+out_put:
274+ xe_bo_lock(bo, false);
275+ xe_bo_willneed_put_locked(bo);
256276 out_unlock:
257277 xe_bo_unlock(bo);
258278 return ERR_PTR(ret);
259279 }
260280
261281 static struct drm_gem_object *
262−xe_dma_buf_init_obj(struct drm_device *dev, struct xe_bo *storage,
263− struct dma_buf *dma_buf)
282+xe_dma_buf_create_obj(struct drm_device *dev, struct dma_buf *dma_buf)
264283 {
265284 struct dma_resv *resv = dma_buf->resv;
266285 struct xe_device *xe = to_xe_device(dev);
@@ -281,7 +300,7 @@ xe_dma_buf_init_obj(struct drm_device *dev, struct xe_bo *storage, · 14 unmodified lines
281300 if (ret)
282301 break;
283302
284− bo = xe_bo_init_locked(xe, storage, NULL, resv, NULL, dma_buf->size,
303+ bo = xe_bo_init_locked(xe, NULL, NULL, resv, NULL, dma_buf->size,
285304 0, /* Will require 1way or 2way for vm_bind */
286305 ttm_bo_type_sg, XE_BO_FLAG_SYSTEM, &exec);
287306 drm_exec_retry_on_contention(&exec);
@@ -332,7 +351,6 @@ struct drm_gem_object *xe_gem_prime_import(struct drm_device *dev, · 44 unmodified lines
332351 const struct dma_buf_attach_ops *attach_ops;
333352 struct dma_buf_attachment *attach;
334353 struct drm_gem_object *obj;
335− struct xe_bo *bo;
336354
337355 if (dma_buf->ops == &xe_dmabuf_ops) {
338356 obj = dma_buf->priv;
@@ -348,13 +366,15 @@ struct drm_gem_object *xe_gem_prime_import(struct drm_device *dev, · 9 unmodified lines
348366 }
349367
350368 /*
351− * Don't publish the bo until we have a valid attachment, and a
352− * valid attachment needs the bo address. So pre-create a bo before
353− * creating the attachment and publish.
369+ * This needs to happen before the attach, since it will create a new
370+ * attachment for this, and add it to the list of attachments, at which
371+ * point it is globally visible, and at any point the export side can
372+ * call into on invalidate_mappings callback, which require a working
373+ * object.
354374 */
355− bo = xe_bo_alloc();
356− if (IS_ERR(bo))
357− return ERR_CAST(bo);
375+ obj = xe_dma_buf_create_obj(dev, dma_buf);
376+ if (IS_ERR(obj))
377+ return obj;
358378
359379 attach_ops = &xe_dma_buf_attach_ops;
360380 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
@@ -362,26 +382,15 @@ struct drm_gem_object *xe_gem_prime_import(struct drm_device *dev, · 1 unmodified line
362382 attach_ops = test->attach_ops;
363383 #endif
364384
365− attach = dma_buf_dynamic_attach(dma_buf, dev->dev, attach_ops, &bo->ttm.base);
385+ attach = dma_buf_dynamic_attach(dma_buf, dev->dev, attach_ops, obj);
366386 if (IS_ERR(attach)) {
367− obj = ERR_CAST(attach);
368− goto out_err;
387+ xe_bo_put(gem_to_xe_bo(obj));
388+ return ERR_CAST(attach);
369389 }
370390
371− /* Errors here will take care of freeing the bo. */
372− obj = xe_dma_buf_init_obj(dev, bo, dma_buf);
373− if (IS_ERR(obj))
374− return obj;
375−
376−
377391 get_dma_buf(dma_buf);
378392 obj->import_attach = attach;
379393 return obj;
380−
381−out_err:
382− xe_bo_free(bo);
383−
384− return obj;
385394 }
386395
387396 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
drivers/gpu/drm/xe/xe_eu_stall.c+2−2
@@ -869,14 +869,14 @@ static int xe_eu_stall_stream_close(struct inode *inode, struct file *file) · 868 unmodified lines
869869 struct xe_eu_stall_data_stream *stream = file->private_data;
870870 struct xe_gt *gt = stream->gt;
871871
872− drm_dev_put(&gt->tile->xe->drm);
873−
874872 mutex_lock(&gt->eu_stall->stream_lock);
875873 xe_eu_stall_disable_locked(stream);
876874 xe_eu_stall_data_buf_destroy(stream);
877875 xe_eu_stall_stream_free(stream);
878876 mutex_unlock(&gt->eu_stall->stream_lock);
879877
878+ drm_dev_put(&gt->tile->xe->drm);
879+
880880 return 0;
881881 }
882882
drivers/gpu/drm/xe/xe_exec_queue.c+6−3
@@ -1405,7 +1405,7 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data, · 1404 unmodified lines
14051405 if (q->vm && q->hwe->hw_engine_group) {
14061406 err = xe_hw_engine_group_add_exec_queue(q->hwe->hw_engine_group, q);
14071407 if (err)
1408− goto put_exec_queue;
1408+ goto kill_exec_queue;
14091409 }
14101410 }
14111411
@@ -1416,12 +1416,15 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data, · 4 unmodified lines
14161416 /* user id alloc must always be last in ioctl to prevent UAF */
14171417 err = xa_alloc(&xef->exec_queue.xa, &id, q, xa_limit_32b, GFP_KERNEL);
14181418 if (err)
1419− goto kill_exec_queue;
1419+ goto del_hw_engine_group;
14201420
14211421 args->exec_queue_id = id;
14221422
14231423 return 0;
14241424
1425+del_hw_engine_group:
1426+ if (q->vm && q->hwe && q->hwe->hw_engine_group)
1427+ xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
14251428 kill_exec_queue:
14261429 xe_exec_queue_kill(q);
14271430 delete_queue_group:
@@ -1760,7 +1763,7 @@ void xe_exec_queue_tlb_inval_last_fence_put(struct xe_exec_queue *q, · 332 unmodified lines
17601763 void xe_exec_queue_tlb_inval_last_fence_put_unlocked(struct xe_exec_queue *q,
17611764 unsigned int type)
17621765 {
1763− xe_assert(q->vm->xe, type == XE_EXEC_QUEUE_TLB_INVAL_MEDIA_GT ||
1766+ xe_assert(gt_to_xe(q->gt), type == XE_EXEC_QUEUE_TLB_INVAL_MEDIA_GT ||
17641767 type == XE_EXEC_QUEUE_TLB_INVAL_PRIMARY_GT);
17651768
17661769 dma_fence_put(q->tlb_inval[type].last_fence);
drivers/gpu/drm/xe/xe_gsc.c+2−5
@@ -166,7 +166,7 @@ static int query_compatibility_version(struct xe_gsc *gsc) · 165 unmodified lines
166166 &rd_offset);
167167 if (err) {
168168 xe_gt_err(gt, "HuC: invalid GSC reply for version query (err=%d)\n", err);
169− return err;
169+ goto out_bo;
170170 }
171171
172172 compat->major = version_query_rd(xe, &bo->vmap, rd_offset, proj_major);
@@ -482,8 +482,7 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc) · 309 unmodified lines
482482 EXEC_QUEUE_FLAG_PERMANENT, 0);
483483 if (IS_ERR(q)) {
484484 xe_gt_err(gt, "Failed to create queue for GSC submission\n");
485− err = PTR_ERR(q);
486− goto out_bo;
485+ return PTR_ERR(q);
487486 }
488487
489488 wq = alloc_ordered_workqueue("gsc-ordered-wq", 0);
@@ -506,8 +505,6 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc) · 16 unmodified lines
506505
507506 out_q:
508507 xe_exec_queue_put(q);
509−out_bo:
510− xe_bo_unpin_map_no_vm(bo);
511508 return err;
512509 }
513510
drivers/gpu/drm/xe/xe_gt_sriov_pf_migration.c+4−4
@@ -385,10 +385,10 @@ static int pf_migration_mmio_save(struct xe_gt *gt, unsigned int vfid, void *buf · 384 unmodified lines
385385
386386 if (xe_gt_is_media_type(gt))
387387 for (n = 0; n < MED_VF_SW_FLAG_COUNT; n++)
388− regs[n] = xe_mmio_read32(&gt->mmio, MED_VF_SW_FLAG(n));
388+ regs[n] = xe_mmio_read32(&mmio, MED_VF_SW_FLAG(n));
389389 else
390390 for (n = 0; n < VF_SW_FLAG_COUNT; n++)
391− regs[n] = xe_mmio_read32(&gt->mmio, VF_SW_FLAG(n));
391+ regs[n] = xe_mmio_read32(&mmio, VF_SW_FLAG(n));
392392
393393 return 0;
394394 }
@@ -407,10 +407,10 @@ static int pf_migration_mmio_restore(struct xe_gt *gt, unsigned int vfid, · 12 unmodified lines
407407
408408 if (xe_gt_is_media_type(gt))
409409 for (n = 0; n < MED_VF_SW_FLAG_COUNT; n++)
410− xe_mmio_write32(&gt->mmio, MED_VF_SW_FLAG(n), regs[n]);
410+ xe_mmio_write32(&mmio, MED_VF_SW_FLAG(n), regs[n]);
411411 else
412412 for (n = 0; n < VF_SW_FLAG_COUNT; n++)
413− xe_mmio_write32(&gt->mmio, VF_SW_FLAG(n), regs[n]);
413+ xe_mmio_write32(&mmio, VF_SW_FLAG(n), regs[n]);
414414
415415 return 0;
416416 }
drivers/gpu/drm/xe/xe_gt_sriov_pf_monitor.c+5−1
@@ -114,8 +114,10 @@ int xe_gt_sriov_pf_monitor_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 · 113 unmodified lines
114114 * VFs with no events are not printed.
115115 *
116116 * This function can only be called on PF.
117+ *
118+ * Return: always 0
117119 */
118−void xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p)
120+int xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p)
119121 {
120122 unsigned int n, total_vfs = xe_gt_sriov_pf_get_totalvfs(gt);
121123 const struct xe_gt_sriov_monitor *data;
@@ -144,4 +146,6 @@ void xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p · 22 unmodified lines
144146 #undef __format
145147 #undef __value
146148 }
149+
150+ return 0;
147151 }
drivers/gpu/drm/xe/xe_gt_sriov_pf_monitor.h+1−1
@@ -13,7 +13,7 @@ struct drm_printer; · 12 unmodified lines
1313 struct xe_gt;
1414
1515 void xe_gt_sriov_pf_monitor_flr(struct xe_gt *gt, u32 vfid);
16−void xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p);
16+int xe_gt_sriov_pf_monitor_print_events(struct xe_gt *gt, struct drm_printer *p);
1717
1818 #ifdef CONFIG_PCI_IOV
1919 int xe_gt_sriov_pf_monitor_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len);
drivers/gpu/drm/xe/xe_gt_sriov_vf.c+18−6
@@ -1137,13 +1137,15 @@ void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val) · 1136 unmodified lines
11371137 }
11381138
11391139 /**
1140− * xe_gt_sriov_vf_print_config - Print VF self config.
1140+ * xe_gt_sriov_vf_print_config() - Print VF self config.
11411141 * @gt: the &xe_gt
11421142 * @p: the &drm_printer
11431143 *
11441144 * This function is for VF use only.
1145+ *
1146+ * Return: always 0.
11451147 */
1146−void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
1148+int xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
11471149 {
11481150 struct xe_gt_sriov_vf_selfconfig *config = &gt->sriov.vf.self_config;
11491151 struct xe_device *xe = gt_to_xe(gt);
@@ -1170,16 +1172,20 @@ void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p) · 20 unmodified lines
11701172
11711173 drm_printf(p, "GuC contexts:\t%u\n", config->num_ctxs);
11721174 drm_printf(p, "GuC doorbells:\t%u\n", config->num_dbs);
1175+
1176+ return 0;
11731177 }
11741178
11751179 /**
1176− * xe_gt_sriov_vf_print_runtime - Print VF's runtime regs received from PF.
1180+ * xe_gt_sriov_vf_print_runtime() - Print VF's runtime regs received from PF.
11771181 * @gt: the &xe_gt
11781182 * @p: the &drm_printer
11791183 *
11801184 * This function is for VF use only.
1185+ *
1186+ * Return: always 0.
11811187 */
1182−void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
1188+int xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
11831189 {
11841190 struct vf_runtime_reg *vf_regs = gt->sriov.vf.runtime.regs;
11851191 unsigned int size = gt->sriov.vf.runtime.num_regs;
@@ -1188,16 +1194,20 @@ void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p) · 2 unmodified lines
11881194
11891195 for (; size--; vf_regs++)
11901196 drm_printf(p, "%#x = %#x\n", vf_regs->offset, vf_regs->value);
1197+
1198+ return 0;
11911199 }
11921200
11931201 /**
1194− * xe_gt_sriov_vf_print_version - Print VF ABI versions.
1202+ * xe_gt_sriov_vf_print_version() - Print VF ABI versions.
11951203 * @gt: the &xe_gt
11961204 * @p: the &drm_printer
11971205 *
11981206 * This function is for VF use only.
1207+ *
1208+ * Return: always 0.
11991209 */
1200−void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
1210+int xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
12011211 {
12021212 struct xe_device *xe = gt_to_xe(gt);
12031213 struct xe_uc_fw_version *guc_version = &gt->sriov.vf.guc_version;
@@ -1227,6 +1237,8 @@ void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p) · 23 unmodified lines
12271237 GUC_RELAY_VERSION_LATEST_MAJOR, GUC_RELAY_VERSION_LATEST_MINOR);
12281238 drm_printf(p, "\thandshake:\t%u.%u\n",
12291239 pf_version->major, pf_version->minor);
1240+
1241+ return 0;
12301242 }
12311243
12321244 static bool vf_post_migration_shutdown(struct xe_gt *gt)
drivers/gpu/drm/xe/xe_gt_sriov_vf.h+3−3
@@ -35,9 +35,9 @@ bool xe_gt_sriov_vf_sched_groups_enabled(struct xe_gt *gt); · 34 unmodified lines
3535 u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg);
3636 void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val);
3737
38−void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
39−void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
40−void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
38+int xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
39+int xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
40+int xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
4141
4242 int xe_gt_sriov_vf_wait_valid_ggtt(struct xe_gt *gt);
4343 int xe_vf_migration_fixups_complete_count(struct xe_gt *gt);
drivers/gpu/drm/xe/xe_gt_types.h+7−0
@@ -144,6 +144,13 @@ struct xe_gt { · 143 unmodified lines
144144 u8 id;
145145 /** @info.has_indirect_ring_state: GT has indirect ring state support */
146146 u8 has_indirect_ring_state:1;
147+ /**
148+ * @info.has_xe2_blt_instructions: GT supports Xe2-style MEM_SET
149+ * and MEM_COPY blitter functionality. Note that despite the
150+ * name, some Xe1 platforms may also support this "Xe2-style"
151+ * feature.
152+ */
153+ u8 has_xe2_blt_instructions:1;
147154 /**
148155 * @info.num_geometry_xecore_fuse_regs: Number of 32b-bit fuse
149156 * registers the geometry XeCore mask spans.
drivers/gpu/drm/xe/xe_guc_ads.c+6−4
@@ -512,12 +512,9 @@ static void guc_golden_lrc_init(struct xe_guc_ads *ads) · 511 unmodified lines
512512 * that starts after the execlists LRC registers. This is
513513 * required to allow the GuC to restore just the engine state
514514 * when a watchdog reset occurs.
515− * We calculate the engine state size by removing the size of
516− * what comes before it in the context image (which is identical
517− * on all engines).
518515 */
519516 ads_blob_write(ads, ads.eng_state_size[guc_class],
520− real_size - xe_lrc_skip_size(xe));
517+ xe_lrc_engine_state_size(gt, class));
521518 ads_blob_write(ads, ads.golden_context_lrca[guc_class],
522519 addr_ggtt);
523520
@@ -770,6 +767,11 @@ static unsigned int guc_mmio_regset_write(struct xe_guc_ads *ads, · 246 unmodified lines
770767 }
771768 }
772769
770+ if (XE_GT_WA(hwe->gt, 16023105232))
771+ guc_mmio_regset_write_one(ads, regset_map,
772+ RING_IDLEDLY(hwe->mmio_base),
773+ count++);
774+
773775 return count;
774776 }
775777
drivers/gpu/drm/xe/xe_guc_submit.c+17−32
@@ -259,24 +259,12 @@ static void guc_submit_sw_fini(struct drm_device *drm, void *arg) · 258 unmodified lines
259259 }
260260
261261 static void guc_submit_fini(void *arg)
262−{
263− struct xe_guc *guc = arg;
264−
265− /* Forcefully kill any remaining exec queues */
266− xe_guc_ct_stop(&guc->ct);
267− guc_submit_reset_prepare(guc);
268− xe_guc_softreset(guc);
269− xe_guc_submit_stop(guc);
270− xe_uc_fw_sanitize(&guc->fw);
271− xe_guc_submit_pause_abort(guc);
272−}
273−
274−static void guc_submit_wedged_fini(void *arg)
275262 {
276263 struct xe_guc *guc = arg;
277264 struct xe_exec_queue *q;
278265 unsigned long index;
279266
267+ /* Drop any wedged queue refs */
280268 mutex_lock(&guc->submission_state.lock);
281269 xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
282270 if (exec_queue_wedged(q)) {
@@ -286,6 +274,14 @@ static void guc_submit_wedged_fini(void *arg) · 3 unmodified lines
286274 }
287275 }
288276 mutex_unlock(&guc->submission_state.lock);
277+
278+ /* Forcefully kill any remaining exec queues */
279+ xe_guc_ct_stop(&guc->ct);
280+ guc_submit_reset_prepare(guc);
281+ xe_guc_softreset(guc);
282+ xe_guc_submit_stop(guc);
283+ xe_uc_fw_sanitize(&guc->fw);
284+ xe_guc_submit_pause_abort(guc);
289285 }
290286
291287 static const struct xe_exec_queue_ops guc_exec_queue_ops;
@@ -1320,10 +1316,8 @@ static void disable_scheduling_deregister(struct xe_guc *guc, · 1028 unmodified lines
13201316 void xe_guc_submit_wedge(struct xe_guc *guc)
13211317 {
13221318 struct xe_device *xe = guc_to_xe(guc);
1323− struct xe_gt *gt = guc_to_gt(guc);
13241319 struct xe_exec_queue *q;
13251320 unsigned long index;
1326− int err;
13271321
13281322 xe_gt_assert(guc_to_gt(guc), guc_to_xe(guc)->wedged.mode);
13291323
@@ -1335,15 +1329,6 @@ void xe_guc_submit_wedge(struct xe_guc *guc) · 5 unmodified lines
13351329 return;
13361330
13371331 if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
1338− err = devm_add_action_or_reset(guc_to_xe(guc)->drm.dev,
1339− guc_submit_wedged_fini, guc);
1340− if (err) {
1341− xe_gt_err(gt, "Failed to register clean-up on wedged.mode=%s; "
1342− "Although device is wedged.\n",
1343− xe_wedged_mode_to_string(XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET));
1344− return;
1345− }
1346−
13471332 mutex_lock(&guc->submission_state.lock);
13481333 xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
13491334 if (xe_exec_queue_get_unless_zero(q))
@@ -1688,6 +1673,14 @@ static void guc_exec_queue_fini(struct xe_exec_queue *q) · 338 unmodified lines
16881673 struct xe_guc_exec_queue *ge = q->guc;
16891674 struct xe_guc *guc = exec_queue_to_guc(q);
16901675
1676+ if (xe_exec_queue_is_multi_queue_secondary(q)) {
1677+ struct xe_exec_queue_group *group = q->multi_queue.group;
1678+
1679+ mutex_lock(&group->list_lock);
1680+ list_del(&q->multi_queue.link);
1681+ mutex_unlock(&group->list_lock);
1682+ }
1683+
16911684 release_guc_id(guc, q);
16921685 xe_sched_entity_fini(&ge->entity);
16931686 xe_sched_fini(&ge->sched);
@@ -1709,14 +1702,6 @@ static void __guc_exec_queue_destroy_async(struct work_struct *w) · 15 unmodified lines
17091702 guard(xe_pm_runtime)(guc_to_xe(guc));
17101703 trace_xe_exec_queue_destroy(q);
17111704
1712− if (xe_exec_queue_is_multi_queue_secondary(q)) {
1713− struct xe_exec_queue_group *group = q->multi_queue.group;
1714−
1715− mutex_lock(&group->list_lock);
1716− list_del(&q->multi_queue.link);
1717− mutex_unlock(&group->list_lock);
1718− }
1719−
17201705 /* Confirm no work left behind accessing device structures */
17211706 cancel_delayed_work_sync(&ge->sched.base.work_tdr);
17221707
drivers/gpu/drm/xe/xe_lrc.c+10−3
@@ -746,9 +746,16 @@ size_t xe_lrc_reg_size(struct xe_device *xe) · 745 unmodified lines
746746 return 80 * sizeof(u32);
747747 }
748748
749−size_t xe_lrc_skip_size(struct xe_device *xe)
749+/**
750+ * xe_lrc_engine_state_size() - Get size of the engine state within LRC
751+ * @gt: the &xe_gt struct instance
752+ * @class: Hardware engine class
753+ *
754+ * Returns: Size of the engine state
755+ */
756+size_t xe_lrc_engine_state_size(struct xe_gt *gt, enum xe_engine_class class)
750757 {
751− return LRC_PPHWSP_SIZE + xe_lrc_reg_size(xe);
758+ return xe_gt_lrc_hang_replay_size(gt, class) - xe_lrc_reg_size(gt_to_xe(gt));
752759 }
753760
754761 static inline u32 __xe_lrc_seqno_offset(struct xe_lrc *lrc)
@@ -1214,7 +1221,7 @@ static ssize_t setup_invalidate_state_cache_wa(struct xe_lrc *lrc, · 459 unmodified lines
12141221 if (xe_gt_WARN_ON(lrc->gt, max_len < 3))
12151222 return -ENOSPC;
12161223
1217− *cmd++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1);
1224+ *cmd++ = MI_LOAD_REGISTER_IMM | MI_LRI_LRM_CS_MMIO | MI_LRI_NUM_REGS(1);
12181225 *cmd++ = CS_DEBUG_MODE2(0).addr;
12191226 *cmd++ = REG_MASKED_FIELD_ENABLE(INSTRUCTION_STATE_CACHE_INVALIDATE);
12201227
drivers/gpu/drm/xe/xe_lrc.h+1−1
@@ -130,7 +130,7 @@ u32 xe_lrc_parallel_ggtt_addr(struct xe_lrc *lrc); · 129 unmodified lines
130130 struct iosys_map xe_lrc_parallel_map(struct xe_lrc *lrc);
131131
132132 size_t xe_lrc_reg_size(struct xe_device *xe);
133−size_t xe_lrc_skip_size(struct xe_device *xe);
133+size_t xe_lrc_engine_state_size(struct xe_gt *gt, enum xe_engine_class class);
134134
135135 void xe_lrc_dump_default(struct drm_printer *p,
136136 struct xe_gt *gt,
drivers/gpu/drm/xe/xe_mem_pool.c+403−0
@@ -0,0 +1,403 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright © 2026 Intel Corporation
4+ */
5+
6+#include <linux/kernel.h>
7+
8+#include <drm/drm_managed.h>
9+
10+#include "instructions/xe_mi_commands.h"
11+#include "xe_bo.h"
12+#include "xe_device_types.h"
13+#include "xe_map.h"
14+#include "xe_mem_pool.h"
15+#include "xe_mem_pool_types.h"
16+#include "xe_tile_printk.h"
17+
18+/**
19+ * struct xe_mem_pool - DRM MM pool for sub-allocating memory from a BO on an
20+ * XE tile.
21+ *
22+ * The XE memory pool is a DRM MM manager that provides sub-allocation of memory
23+ * from a backing buffer object (BO) on a specific XE tile. It is designed to
24+ * manage memory for GPU workloads, allowing for efficient allocation and
25+ * deallocation of memory regions within the BO.
26+ *
27+ * The memory pool maintains a primary BO that is pinned in the GGTT and mapped
28+ * into the CPU address space for direct access. Optionally, it can also maintain
29+ * a shadow BO that can be used for atomic updates to the primary BO's contents.
30+ *
31+ * The API provided by the memory pool allows clients to allocate and free memory
32+ * regions, retrieve GPU and CPU addresses, and synchronize data between the
33+ * primary and shadow BOs as needed.
34+ */
35+struct xe_mem_pool {
36+ /** @base: Range allocator over [0, @size) in bytes */
37+ struct drm_mm base;
38+ /** @bo: Active pool BO (GGTT-pinned, CPU-mapped). */
39+ struct xe_bo *bo;
40+ /** @shadow: Shadow BO for atomic command updates. */

363 more lines aren’t shown here.

drivers/gpu/drm/xe/xe_mem_pool.h+35−0

This diff is large: its 36 lines aren’t shown here.

drivers/gpu/drm/xe/xe_mem_pool_types.h+21−0

This diff is large: its 22 lines aren’t shown here.

drivers/gpu/drm/xe/xe_memirq.c+22−4

This diff is large: its 45 lines aren’t shown here.

drivers/gpu/drm/xe/xe_migrate.c+33−41

This diff is large: its 164 lines aren’t shown here.

drivers/gpu/drm/xe/xe_oa.c+4−2

This diff is large: its 13 lines aren’t shown here.

drivers/gpu/drm/xe/xe_pci.c+10−0

This diff is large: its 24 lines aren’t shown here.

drivers/gpu/drm/xe/xe_reg_whitelist.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/gpu/drm/xe/xe_sriov_pf_migration.c+4−3

This diff is large: its 15 lines aren’t shown here.

drivers/gpu/drm/xe/xe_sriov_vf_ccs.c+29−25

This diff is large: its 125 lines aren’t shown here.

drivers/gpu/drm/xe/xe_sriov_vf_ccs_types.h+1−4

This diff is large: its 19 lines aren’t shown here.

drivers/gpu/drm/xe/xe_tile_types.h+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/gpu/drm/xe/xe_tuning.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/gpu/drm/xe/xe_vm.c+46−10

This diff is large: its 140 lines aren’t shown here.

drivers/gpu/drm/xe/xe_vm_madvise.c+57−152

This diff is large: its 254 lines aren’t shown here.

drivers/gpu/drm/xe/xe_vm_madvise.h+0−2

This diff is large: its 7 lines aren’t shown here.

drivers/gpu/drm/xe/xe_wa.c+3−11

This diff is large: its 42 lines aren’t shown here.

drivers/hid/bpf/hid_bpf_dispatch.c+4−2

This diff is large: its 27 lines aren’t shown here.

drivers/hid/hid-appletb-kbd.c+36−20

This diff is large: its 124 lines aren’t shown here.

drivers/hid/hid-core.c+53−14

This diff is large: its 147 lines aren’t shown here.

drivers/hid/hid-elan.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/hid/hid-ft260.c+14−2

This diff is large: its 25 lines aren’t shown here.

drivers/hid/hid-gfrm.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/hid/hid-google-hammer.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/hid/hid-ids.h+5−0

This diff is large: its 26 lines aren’t shown here.

drivers/hid/hid-lenovo-go-s.c+50−5

This diff is large: its 95 lines aren’t shown here.

drivers/hid/hid-lenovo-go.c+3−3

This diff is large: its 20 lines aren’t shown here.

drivers/hid/hid-lenovo.c+3−2

This diff is large: its 19 lines aren’t shown here.

drivers/hid/hid-logitech-hidpp.c+39−1

This diff is large: its 54 lines aren’t shown here.

drivers/hid/hid-magicmouse.c+16−0

This diff is large: its 30 lines aren’t shown here.

drivers/hid/hid-mcp2221.c+7−0

This diff is large: its 34 lines aren’t shown here.

drivers/hid/hid-multitouch.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/hid/hid-playstation.c+4−2

This diff is large: its 20 lines aren’t shown here.

drivers/hid/hid-primax.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/hid/hid-quirks.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/hid/hid-sjoy.c+6−6

This diff is large: its 24 lines aren’t shown here.

drivers/hid/hid-sony.c+5−10

This diff is large: its 46 lines aren’t shown here.

drivers/hid/hid-u2fzero.c+13−9

This diff is large: its 43 lines aren’t shown here.

drivers/hid/hid-uclogic-core.c+3−1

This diff is large: its 11 lines aren’t shown here.

drivers/hid/hid-vivaldi-common.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/hid/i2c-hid/i2c-hid-core.c+6−3

This diff is large: its 23 lines aren’t shown here.

drivers/hid/intel-thc-hid/intel-quickspi/quickspi-protocol.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/hid/usbhid/hid-core.c+6−5

This diff is large: its 26 lines aren’t shown here.

drivers/hid/usbhid/hid-pidff.c+5−2

This diff is large: its 21 lines aren’t shown here.

drivers/hid/wacom_sys.c+13−6

This diff is large: its 61 lines aren’t shown here.

drivers/hid/wacom_wac.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/hwmon/Makefile+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/hwmon/acpi_power_meter.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/hwmon/ads7871.c+5−1

This diff is large: its 15 lines aren’t shown here.

drivers/hwmon/asus_atk0110.c+6−1

This diff is large: its 22 lines aren’t shown here.

drivers/hwmon/corsair-psu.c+2−2

This diff is large: its 16 lines aren’t shown here.

drivers/hwmon/lenovo-ec-sensors.c+7−13

This diff is large: its 57 lines aren’t shown here.

drivers/hwmon/lm63.c+30−9

This diff is large: its 95 lines aren’t shown here.

drivers/hwmon/lm75.c+5−5

This diff is large: its 38 lines aren’t shown here.

drivers/hwmon/lm90.c+22−4

This diff is large: its 74 lines aren’t shown here.

drivers/hwmon/ltc2992.c+33−10

This diff is large: its 73 lines aren’t shown here.

drivers/hwmon/pmbus/adm1266.c+33−13

This diff is large: its 165 lines aren’t shown here.

drivers/i2c/busses/i2c-davinci.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/i2c/busses/i2c-stm32f7.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/i2c/busses/i2c-tegra.c+9−10

This diff is large: its 52 lines aren’t shown here.

drivers/i2c/busses/i2c-virtio.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/i2c/i2c-core-acpi.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/i2c/i2c-core-base.c+1−2

This diff is large: its 10 lines aren’t shown here.

drivers/i2c/i2c-core-smbus.c+13−0

This diff is large: its 27 lines aren’t shown here.

drivers/i2c/i2c-dev.c+5−4

This diff is large: its 18 lines aren’t shown here.

drivers/i2c/i2c-slave-testunit.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/i2c/i2c-stub.c+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/iio/adc/ad4695.c+8−15

This diff is large: its 47 lines aren’t shown here.

drivers/iio/adc/meson_saradc.c+3−1

This diff is large: its 13 lines aren’t shown here.

drivers/iio/adc/mt6359-auxadc.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/iio/adc/npcm_adc.c+8−17

This diff is large: its 70 lines aren’t shown here.

drivers/iio/adc/nxp-sar-adc.c+20−4

This diff is large: its 66 lines aren’t shown here.

drivers/iio/adc/qcom-spmi-adc5-gen3.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/iio/adc/viperboard_adc.c+3−1

This diff is large: its 12 lines aren’t shown here.

drivers/iio/adc/xilinx-xadc-core.c+9−2

This diff is large: its 35 lines aren’t shown here.

drivers/iio/buffer/industrialio-hw-consumer.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/iio/chemical/mhz19b.c+17−0

This diff is large: its 45 lines aren’t shown here.

drivers/iio/chemical/scd30_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/iio/common/ssp_sensors/ssp_dev.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/iio/dac/ad3530r.c+40−14

This diff is large: its 88 lines aren’t shown here.

drivers/iio/dac/ad5686.c+42−14

This diff is large: its 131 lines aren’t shown here.

drivers/iio/dac/ad5686.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/iio/dac/max5821.c+8−1

This diff is large: its 23 lines aren’t shown here.

drivers/iio/gyro/adis16260.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/iio/gyro/itg3200_buffer.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/iio/imu/adis16550.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/iio/industrialio-buffer.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/iio/inkern.c+5−1

This diff is large: its 13 lines aren’t shown here.

drivers/iio/light/cm3323.c+2−3

This diff is large: its 18 lines aren’t shown here.

drivers/iio/light/veml6070.c+2−12

This diff is large: its 35 lines aren’t shown here.

drivers/iio/magnetometer/st_magn_core.c+11−2

This diff is large: its 27 lines aren’t shown here.

drivers/iio/pressure/bmp280-core.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/iio/temperature/tsys01.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/infiniband/core/addr.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/infiniband/core/ib_core_uverbs.c+87−0

This diff is large: its 98 lines aren’t shown here.

drivers/infiniband/core/nldev.c+3−0

This diff is large: its 18 lines aren’t shown here.

drivers/infiniband/core/uverbs.h+34−0

This diff is large: its 41 lines aren’t shown here.

drivers/infiniband/core/uverbs_cmd.c+7−2

This diff is large: its 33 lines aren’t shown here.

drivers/infiniband/core/uverbs_ioctl.c+14−134

This diff is large: its 209 lines aren’t shown here.

drivers/infiniband/hw/bnxt_re/ib_verbs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/infiniband/hw/hfi1/pio.c+4−1

This diff is large: its 18 lines aren’t shown here.

drivers/infiniband/hw/hfi1/sdma.c+3−1

This diff is large: its 21 lines aren’t shown here.

drivers/infiniband/hw/hns/hns_roce_qp.c+10−3

This diff is large: its 40 lines aren’t shown here.

drivers/infiniband/hw/hns/hns_roce_srq.c+6−6

This diff is large: its 33 lines aren’t shown here.

drivers/infiniband/hw/ionic/ionic_ibdev.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/infiniband/hw/mana/cq.c+3−2

This diff is large: its 12 lines aren’t shown here.

drivers/infiniband/hw/mana/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/infiniband/hw/mana/qp.c+10−6

This diff is large: its 52 lines aren’t shown here.

drivers/infiniband/hw/mlx4/srq.c+3−1

This diff is large: its 17 lines aren’t shown here.

drivers/infiniband/hw/mlx5/main.c+5−4

This diff is large: its 40 lines aren’t shown here.

drivers/infiniband/hw/mlx5/qp.c+6−1

This diff is large: its 21 lines aren’t shown here.

drivers/infiniband/hw/mlx5/qpc.c+8−1

This diff is large: its 16 lines aren’t shown here.

drivers/infiniband/hw/mlx5/srq_cmd.c+8−1

This diff is large: its 16 lines aren’t shown here.

drivers/infiniband/hw/mlx5/umr.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+4−4

This diff is large: its 30 lines aren’t shown here.

drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/infiniband/sw/rxe/rxe_recv.c+11−0

This diff is large: its 18 lines aren’t shown here.

drivers/infiniband/sw/rxe/rxe_resp.c+13−1

This diff is large: its 21 lines aren’t shown here.

drivers/infiniband/sw/siw/siw_qp_rx.c+15−0

This diff is large: its 22 lines aren’t shown here.

drivers/infiniband/ulp/ipoib/ipoib_main.c+5−3

This diff is large: its 29 lines aren’t shown here.

drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c+1−1

This diff is large: its 10 lines aren’t shown here.

drivers/input/gameport/fm801-gp.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/input/joystick/xpad.c+10−4

This diff is large: its 42 lines aren’t shown here.

drivers/input/misc/atlas_btns.c+5−1

This diff is large: its 17 lines aren’t shown here.

drivers/input/misc/ims-pcu.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/input/mouse/elan_i2c_core.c+8−0

This diff is large: its 22 lines aren’t shown here.

drivers/input/mouse/elan_i2c_i2c.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/input/mouse/synaptics.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/input/touchscreen/atmel_mxt_ts.c+10−3

This diff is large: its 34 lines aren’t shown here.

drivers/input/touchscreen/usbtouchscreen.c+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/iommu/amd/amd_iommu.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/iommu/amd/amd_iommu_types.h+13−8

This diff is large: its 44 lines aren’t shown here.

drivers/iommu/amd/debugfs.c+5−4

This diff is large: its 30 lines aren’t shown here.

drivers/iommu/amd/init.c+88−35

This diff is large: its 218 lines aren’t shown here.

drivers/iommu/amd/iommu.c+9−4

This diff is large: its 34 lines aren’t shown here.

drivers/iommu/amd/ppr.c+5−3

This diff is large: its 29 lines aren’t shown here.

drivers/iommu/generic_pt/iommu_pt.h+15−9

This diff is large: its 57 lines aren’t shown here.

drivers/iommu/intel/cache.c+19−32

This diff is large: its 70 lines aren’t shown here.

drivers/iommu/intel/iommu.c+10−6

This diff is large: its 39 lines aren’t shown here.

drivers/iommu/io-pgtable-arm-v7s.c+12−6

This diff is large: its 34 lines aren’t shown here.

drivers/iommu/iommu-pages.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/iommu/iommu.c+217−88

This diff is large: its 554 lines aren’t shown here.

drivers/irqchip/exynos-combiner.c+3−3

This diff is large: its 21 lines aren’t shown here.

drivers/irqchip/irq-ath79-cpu.c+0−7

This diff is large: its 11 lines aren’t shown here.

drivers/irqchip/irq-gic-v5-its.c+8−26

This diff is large: its 76 lines aren’t shown here.

drivers/irqchip/irq-gic-v5.c+52−46

This diff is large: its 152 lines aren’t shown here.

drivers/irqchip/irq-meson-gpio.c+1−2

This diff is large: its 10 lines aren’t shown here.

drivers/irqchip/irq-renesas-rzt2h.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/irqchip/irq-riscv-imsic-early.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/mailbox/cix-mailbox.c+2−4

This diff is large: its 27 lines aren’t shown here.

drivers/mailbox/exynos-mailbox.c+0−4

This diff is large: its 18 lines aren’t shown here.

drivers/mailbox/hi3660-mailbox.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/mailbox/hi6220-mailbox.c+5−9

This diff is large: its 35 lines aren’t shown here.

drivers/mailbox/imx-mailbox.c+1−3

This diff is large: its 18 lines aren’t shown here.

drivers/mailbox/mailbox-sti.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/mailbox/mailbox-test.c+46−34

This diff is large: its 170 lines aren’t shown here.

drivers/mailbox/mailbox.c+44−23

This diff is large: its 179 lines aren’t shown here.

drivers/mailbox/mailbox.h+0−12

This diff is large: its 13 lines aren’t shown here.

drivers/mailbox/mtk-cmdq-mailbox.c+5−5

This diff is large: its 28 lines aren’t shown here.

drivers/mailbox/mtk-vcp-mailbox.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/mailbox/omap-mailbox.c+1−3

This diff is large: its 18 lines aren’t shown here.

drivers/mailbox/pcc.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/mailbox/rockchip-mailbox.c+2−7

This diff is large: its 26 lines aren’t shown here.

drivers/mailbox/tegra-hsp.c+2−4

This diff is large: its 27 lines aren’t shown here.

drivers/md/dm-vdo/vdo.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/md/md-bitmap.c+119−12

This diff is large: its 206 lines aren’t shown here.

drivers/md/md-bitmap.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/md/md-llbitmap.c+6−1

This diff is large: its 21 lines aren’t shown here.

drivers/md/md.c+102−80

This diff is large: its 380 lines aren’t shown here.

drivers/md/md.h+4−2

This diff is large: its 27 lines aren’t shown here.

drivers/md/persistent-data/dm-btree-remove.c+8−0

This diff is large: its 21 lines aren’t shown here.

drivers/md/raid1-10.c+6−1

This diff is large: its 15 lines aren’t shown here.

drivers/md/raid1.c+4−11

This diff is large: its 26 lines aren’t shown here.

drivers/md/raid10.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/md/raid5.c+6−1

This diff is large: its 14 lines aren’t shown here.

drivers/media/platform/qcom/camss/camss-csid-gen3.c+3−3

This diff is large: its 13 lines aren’t shown here.

drivers/media/platform/qcom/camss/camss-csiphy.c+7−3

This diff is large: its 20 lines aren’t shown here.

drivers/media/platform/qcom/camss/camss.c+40−40

This diff is large: its 185 lines aren’t shown here.

drivers/media/platform/qcom/iris/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_buffer.c+4−2

This diff is large: its 15 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_core.c+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_hfi_common.c+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_hfi_queue.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vdec.c+0−6

This diff is large: its 13 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vdec.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_venc.c+0−6

This diff is large: its 13 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_venc.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vidc.c+2−4

This diff is large: its 20 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vpu2.c+1−0

This diff is large: its 6 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vpu3x.c+3−6

This diff is large: its 37 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vpu4x.c+13−11

This diff is large: its 47 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vpu_buffer.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vpu_common.c+10−6

This diff is large: its 32 lines aren’t shown here.

drivers/media/platform/qcom/iris/iris_vpu_common.h+3−0

This diff is large: its 17 lines aren’t shown here.

drivers/media/platform/qcom/venus/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/media/platform/renesas/vsp1/vsp1_brx.c+2−8

This diff is large: its 23 lines aren’t shown here.

drivers/media/platform/renesas/vsp1/vsp1_entity.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/media/rc/igorplugusb.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/media/rc/ttusbir.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/misc/rp1/rp1_pci.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/mtd/nand/spi/core.c+21−3

This diff is large: its 46 lines aren’t shown here.

drivers/mtd/nand/spi/winbond.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/mtd/spi-nor/debugfs.c+3−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/bareudp.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/bonding/bond_3ad.c+60−49

This diff is large: its 311 lines aren’t shown here.

drivers/net/bonding/bond_main.c+11−3

This diff is large: its 49 lines aren’t shown here.

drivers/net/bonding/bond_netlink.c+10−6

This diff is large: its 45 lines aren’t shown here.

drivers/net/bonding/bond_procfs.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/bonding/bond_sysfs_slave.c+11−6

This diff is large: its 38 lines aren’t shown here.

drivers/net/dsa/mt7530.c+165−70

This diff is large: its 386 lines aren’t shown here.

drivers/net/dsa/mt7530.h+8−0

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/3com/3c509.c+1543−0

This diff is large: its 1544 lines aren’t shown here.

drivers/net/ethernet/3com/Kconfig+14−0

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/3com/Makefile+1−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/airoha/airoha_eth.c+38−29

This diff is large: its 172 lines aren’t shown here.

drivers/net/ethernet/airoha/airoha_eth.h+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/amazon/ena/ena_com.c+5−2

This diff is large: its 26 lines aren’t shown here.

drivers/net/ethernet/amazon/ena/ena_phc.c+4−1

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/amd/pds_core/debugfs.c+6−1

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/amd/pds_core/dev.c+9−2

This diff is large: its 22 lines aren’t shown here.

drivers/net/ethernet/amd/pds_core/devlink.c+4−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/amd/xgbe/xgbe.h+2−2

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/apm/xgene/xgene_enet_hw.c+3−1

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/atheros/ag71xx.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnxt/bnxt.c+12−4

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c+5−24

This diff is large: its 56 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c+8−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/broadcom/genet/bcmgenet.c+4−5

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/cirrus/cs89x0.c+0−2

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/cortina/gemini.c+19−2

This diff is large: its 87 lines aren’t shown here.

drivers/net/ethernet/freescale/enetc/enetc.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/freescale/enetc/enetc_hw.h+12−3

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/freescale/enetc/enetc_msg.c+58−48

This diff is large: its 187 lines aren’t shown here.

drivers/net/ethernet/freescale/enetc/enetc_pf.c+56−19

This diff is large: its 134 lines aren’t shown here.

drivers/net/ethernet/freescale/enetc/enetc_pf.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/freescale/enetc/enetc_vf.c+34−8

This diff is large: its 94 lines aren’t shown here.

drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c+3−3

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/ibm/ibmveth.c+22−0

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/ibm/ibmveth.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/i40e/i40e.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/i40e/i40e_main.c+2−0

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/intel/i40e/i40e_ptp.c+2−1

This diff is large: its 15 lines aren’t shown here.

drivers/net/ethernet/intel/iavf/iavf.h+4−5

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/intel/iavf/iavf_main.c+12−40

This diff is large: its 113 lines aren’t shown here.

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c+36−40

This diff is large: its 155 lines aren’t shown here.

drivers/net/ethernet/intel/ice/devlink/devlink.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_common.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_dcb_lib.c+2−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_dpll.c+139−12

This diff is large: its 303 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_dpll.h+16−16

This diff is large: its 43 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_main.c+10−2

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_ptp_hw.c+26−7

This diff is large: its 102 lines aren’t shown here.

drivers/net/ethernet/intel/ice/ice_vf_lib.c+6−1

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/intel/ice/virt/queues.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/idpf/idpf_idc.c+6−0

This diff is large: its 22 lines aren’t shown here.

drivers/net/ethernet/intel/idpf/idpf_ptp.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/intel/igc/igc_tsn.c+8−1

This diff is large: its 26 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/cgx.c+6−1

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c+10−23

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c+250−124

This diff is large: its 653 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h+12−12

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/rvu.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/rvu.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c+200−33

This diff is large: its 439 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c+22−8

This diff is large: its 60 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c+8−0

This diff is large: its 15 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c+2−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c+2−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/marvell/octeontx2/nic/rep.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/srq.c+7−6

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c+3−3

This diff is large: its 25 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c+4−3

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c+20−16

This diff is large: its 73 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+4−1

This diff is large: its 13 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+23−7

This diff is large: its 87 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+21−0

This diff is large: its 35 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c+99−15

This diff is large: its 218 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/lib/sd.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c+3−1

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/meta/fbnic/fbnic_netdev.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/microchip/lan966x/lan966x_main.c+5−3

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/microchip/sparx5/sparx5_main.h+5−5

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/microchip/sparx5/sparx5_port.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/microsoft/mana/gdma_main.c+35−5

This diff is large: its 70 lines aren’t shown here.

drivers/net/ethernet/microsoft/mana/hw_channel.c+19−10

This diff is large: its 65 lines aren’t shown here.

drivers/net/ethernet/microsoft/mana/mana_en.c+52−34

This diff is large: its 142 lines aren’t shown here.

drivers/net/ethernet/microsoft/mana/shm_channel.c+0−5

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/qlogic/qed/qed_cxt.c+2−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/qlogic/qed/qed_dev.c+7−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c+4−4

This diff is large: its 23 lines aren’t shown here.

drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/renesas/ravb_main.c+6−3

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/renesas/rtsn.c+4−2

This diff is large: its 23 lines aren’t shown here.

drivers/net/ethernet/sfc/efx_devlink.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c+89−37

This diff is large: its 200 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/dwmac-nuvoton.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+12−7

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/ti/icssm/icssm_prueth.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/wangxun/libwx/wx_hw.c+5−2

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/wangxun/libwx/wx_vf_common.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/fddi/defza.c+9−2

This diff is large: its 47 lines aren’t shown here.

drivers/net/ifb.c+5−6

This diff is large: its 40 lines aren’t shown here.

drivers/net/macsec.c+30−12

This diff is large: its 128 lines aren’t shown here.

drivers/net/mctp/mctp-i2c.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/net_failover.c+6−6

This diff is large: its 37 lines aren’t shown here.

drivers/net/netconsole.c+30−19

This diff is large: its 168 lines aren’t shown here.

drivers/net/netdevsim/dev.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/netdevsim/netdev.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/netdevsim/netdevsim.h+3−1

This diff is large: its 11 lines aren’t shown here.

drivers/net/netdevsim/psp.c+46−19

This diff is large: its 112 lines aren’t shown here.

drivers/net/ovpn/io.c+13−6

This diff is large: its 79 lines aren’t shown here.

drivers/net/ovpn/main.c+2−10

This diff is large: its 33 lines aren’t shown here.

drivers/net/ovpn/netlink.c+5−3

This diff is large: its 16 lines aren’t shown here.

drivers/net/ovpn/peer.c+19−4

This diff is large: its 42 lines aren’t shown here.

drivers/net/ovpn/peer.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ovpn/stats.h+16−0

This diff is large: its 28 lines aren’t shown here.

drivers/net/ovpn/tcp.c+12−7

This diff is large: its 61 lines aren’t shown here.

drivers/net/ovpn/udp.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/pcs/pcs-mtk-lynxi.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/phy/air_en8811h.c+149−4

This diff is large: its 253 lines aren’t shown here.

drivers/net/phy/bcm-phy-lib.c+9−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/phy/bcm-phy-lib.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/phy/bcm7xxx.c+14−0

This diff is large: its 42 lines aren’t shown here.

drivers/net/phy/broadcom.c+5−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/phy/dp83869.c+12−1

This diff is large: its 32 lines aren’t shown here.

drivers/net/phy/dp83tc811.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/phy/micrel.c+8−7

This diff is large: its 29 lines aren’t shown here.

drivers/net/phy/phy-c45.c+8−0

This diff is large: its 15 lines aren’t shown here.

drivers/net/phy/phy_device.c+4−2

This diff is large: its 20 lines aren’t shown here.

drivers/net/pse-pd/pse_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/tap.c+3−1

This diff is large: its 29 lines aren’t shown here.

drivers/net/team/team_core.c+32−13

This diff is large: its 88 lines aren’t shown here.

drivers/net/tun.c+4−1

This diff is large: its 20 lines aren’t shown here.

drivers/net/usb/asix_devices.c+2−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/usb/cdc_ncm.c+8−0

This diff is large: its 15 lines aren’t shown here.

drivers/net/usb/r8152.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/usb/rtl8150.c+11−1

This diff is large: its 35 lines aren’t shown here.

drivers/net/veth.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/vrf.c+11−4

This diff is large: its 53 lines aren’t shown here.

drivers/net/vxlan/vxlan_core.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wan/fsl_ucc_hdlc.c+9−7

This diff is large: its 44 lines aren’t shown here.

drivers/net/wireguard/send.c+10−10

This diff is large: its 34 lines aren’t shown here.

drivers/net/wireless/ath/ath10k/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath10k/wmi.c+7−8

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/ath/ath11k/dp_rx.c+5−4

This diff is large: its 37 lines aren’t shown here.

drivers/net/wireless/ath/ath11k/hal.c+11−3

This diff is large: its 26 lines aren’t shown here.

drivers/net/wireless/ath/ath11k/hal_rx.c+1−4

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ath/ath11k/testmode.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath11k/wmi.c+112−19

This diff is large: its 325 lines aren’t shown here.

drivers/net/wireless/ath/ath12k/core.c+48−29

This diff is large: its 122 lines aren’t shown here.

drivers/net/wireless/ath/ath12k/dp_rx.c+4−1

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/ath/ath12k/mac.c+7−3

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/ath/ath12k/p2p.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath12k/wmi.c+89−16

This diff is large: its 265 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/base.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/broadcom/b43/xmit.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/broadcom/b43legacy/xmit.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c+4−2

This diff is large: its 22 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/mld/constants.h+2−2

This diff is large: its 14 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/mld/d3.c+3−3

This diff is large: its 16 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/mld/link.c+6−7

This diff is large: its 37 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/mld/tx.c+14−1

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c+18−9

This diff is large: its 65 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/mvm/utils.c+4−10

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c+3−3

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/marvell/libertas/if_usb.c+4−2

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/microchip/wilc1000/wlan.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rsi/rsi_common.h+2−3

This diff is large: its 15 lines aren’t shown here.

drivers/net/wireless/st/cw1200/pm.c+0−2

This diff is large: its 15 lines aren’t shown here.

drivers/net/wwan/iosm/iosm_ipc_imem.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_modem_ops.c+17−3

This diff is large: its 35 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port_ctrl_msg.c+16−2

This diff is large: its 51 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port_proxy.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/nfc/nxp-nci/i2c.c+20−1

This diff is large: its 44 lines aren’t shown here.

drivers/nfc/trf7970a.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/nvme/common/auth.c+74−20

This diff is large: its 127 lines aren’t shown here.

drivers/nvme/host/apple.c+2−5

This diff is large: its 21 lines aren’t shown here.

drivers/nvme/host/auth.c+9−7

This diff is large: its 46 lines aren’t shown here.

drivers/nvme/host/core.c+16−6

This diff is large: its 75 lines aren’t shown here.

drivers/nvme/host/fc.c+1−0

This diff is large: its 5 lines aren’t shown here.

drivers/nvme/host/ioctl.c+4−14

This diff is large: its 35 lines aren’t shown here.

drivers/nvme/host/multipath.c+0−4

This diff is large: its 17 lines aren’t shown here.

drivers/nvme/host/pci.c+37−6

This diff is large: its 112 lines aren’t shown here.

drivers/nvme/host/rdma.c+9−0

This diff is large: its 27 lines aren’t shown here.

drivers/nvme/host/sysfs.c+19−0

This diff is large: its 37 lines aren’t shown here.

drivers/nvme/host/tcp.c+23−8

This diff is large: its 63 lines aren’t shown here.

drivers/nvme/target/Kconfig+9−0

This diff is large: its 16 lines aren’t shown here.

drivers/nvme/target/admin-cmd.c+2−6

This diff is large: its 15 lines aren’t shown here.

drivers/nvme/target/auth.c+18−16

This diff is large: its 111 lines aren’t shown here.

drivers/nvme/target/configfs.c+27−0

This diff is large: its 48 lines aren’t shown here.

drivers/nvme/target/core.c+9−1

This diff is large: its 24 lines aren’t shown here.

drivers/nvme/target/fabrics-cmd-auth.c+5−4

This diff is large: its 24 lines aren’t shown here.

drivers/nvme/target/nvmet.h+13−0

This diff is large: its 34 lines aren’t shown here.

drivers/nvme/target/tcp.c+66−53

This diff is large: its 271 lines aren’t shown here.

drivers/nvme/target/zns.c+1−5

This diff is large: its 20 lines aren’t shown here.

drivers/parisc/lasi.c+8−4

This diff is large: its 33 lines aren’t shown here.

drivers/parisc/led.c+2−4

This diff is large: its 13 lines aren’t shown here.

drivers/parport/share.c+9−2

This diff is large: its 34 lines aren’t shown here.

drivers/pci/controller/pcie-brcmstb.c+3−1

This diff is large: its 12 lines aren’t shown here.

drivers/pci/pci-driver.c+8−1

This diff is large: its 27 lines aren’t shown here.

drivers/pci/pci.c+4−5

This diff is large: its 38 lines aren’t shown here.

drivers/pci/setup-res.c+2−0

This diff is large: its 16 lines aren’t shown here.

drivers/phy/apple/atc.c+22−5

This diff is large: its 64 lines aren’t shown here.

drivers/phy/eswin/phy-eic7700-sata.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/phy/marvell/phy-mvebu-a3700-utmi.c+2−3

This diff is large: its 12 lines aren’t shown here.

drivers/phy/qualcomm/phy-qcom-edp.c+181−43

This diff is large: its 415 lines aren’t shown here.

drivers/phy/qualcomm/phy-qcom-qmp-ufs.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/phy/qualcomm/phy-qcom-qmp-usbc.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/phy/samsung/phy-exynos5-usbdrd.c+4−3

This diff is large: its 18 lines aren’t shown here.

drivers/phy/spacemit/phy-k1-usb2.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/phy/tegra/xusb-tegra186.c+26−7

This diff is large: its 99 lines aren’t shown here.

drivers/phy/tegra/xusb.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/pinctrl/freescale/pinctrl-imx1-core.c+41−7

This diff is large: its 73 lines aren’t shown here.

drivers/pinctrl/mediatek/pinctrl-moore.c+18−0

This diff is large: its 32 lines aren’t shown here.

drivers/pinctrl/meson/pinctrl-amlogic-a4.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/pinctrl/pinctrl-amd.c+35−0

This diff is large: its 56 lines aren’t shown here.

drivers/pinctrl/qcom/pinctrl-eliza.c+4−4

This diff is large: its 31 lines aren’t shown here.

drivers/pinctrl/qcom/pinctrl-ipq4019.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/pinctrl/qcom/pinctrl-msm.h+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/pinctrl/qcom/pinctrl-qcs615.c+3−3

This diff is large: its 15 lines aren’t shown here.

drivers/pinctrl/qcom/pinctrl-sm8150.c+4−4

This diff is large: its 23 lines aren’t shown here.

drivers/pinctrl/renesas/pinctrl-rzg2l.c+15−8

This diff is large: its 58 lines aren’t shown here.

drivers/platform/chrome/cros_typec_altmode.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/platform/surface/surface_aggregator_registry.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/platform/surface/surfacepro3_button.c+7−3

This diff is large: its 28 lines aren’t shown here.

drivers/platform/wmi/core.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/platform/x86/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/platform/x86/acer-wireless.c+6−2

This diff is large: its 25 lines aren’t shown here.

drivers/platform/x86/adv_swbutton.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/asus-armoury.c+12−4

This diff is large: its 37 lines aren’t shown here.

drivers/platform/x86/asus-armoury.h+113−0

This diff is large: its 141 lines aren’t shown here.

drivers/platform/x86/asus-laptop.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/asus-nb-wmi.c+9−0

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/dell/dell-rbtn.c+5−1

This diff is large: its 17 lines aren’t shown here.

drivers/platform/x86/eeepc-laptop.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/fujitsu-laptop.c+10−2

This diff is large: its 32 lines aren’t shown here.

drivers/platform/x86/fujitsu-tablet.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/hp/hp-wmi.c+9−1

This diff is large: its 31 lines aren’t shown here.

drivers/platform/x86/hp/hp_accel.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/platform/x86/intel/hid.c+5−1

This diff is large: its 18 lines aren’t shown here.

drivers/platform/x86/intel/int1092/intel_sar.c+6−1

This diff is large: its 22 lines aren’t shown here.

drivers/platform/x86/intel/plr_tpmi.c+43−2

This diff is large: its 89 lines aren’t shown here.

drivers/platform/x86/intel/rst.c+5−1

This diff is large: its 15 lines aren’t shown here.

drivers/platform/x86/intel/smartconnect.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/intel/vbtn.c+5−1

This diff is large: its 18 lines aren’t shown here.

drivers/platform/x86/intel/vsec.c+30−24

This diff is large: its 86 lines aren’t shown here.

drivers/platform/x86/intel/vsec_tpmi.c+25−4

This diff is large: its 64 lines aren’t shown here.

drivers/platform/x86/lenovo/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-capdata.c+4−4

This diff is large: its 29 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-capdata.h+20−0

This diff is large: its 41 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-events.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-gamezone.c+2−5

This diff is large: its 36 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-gamezone.h+0−20

This diff is large: its 21 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-helpers.c+103−2

This diff is large: its 139 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-helpers.h+21−0

This diff is large: its 36 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-other.c+140−156

This diff is large: its 485 lines aren’t shown here.

drivers/platform/x86/lenovo/wmi-other.h+0−16

This diff is large: its 17 lines aren’t shown here.

drivers/platform/x86/lg-laptop.c+7−2

This diff is large: its 27 lines aren’t shown here.

drivers/platform/x86/panasonic-laptop.c+5−1

This diff is large: its 17 lines aren’t shown here.

drivers/platform/x86/samsung-galaxybook.c+48−21

This diff is large: its 116 lines aren’t shown here.

drivers/platform/x86/sony-laptop.c+10−2

This diff is large: its 34 lines aren’t shown here.

drivers/platform/x86/system76_acpi.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/toshiba_acpi.c+5−1

This diff is large: its 20 lines aren’t shown here.

drivers/platform/x86/toshiba_bluetooth.c+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/platform/x86/toshiba_haps.c+5−1

This diff is large: its 19 lines aren’t shown here.

drivers/platform/x86/uniwill/uniwill-acpi.c+42−5

This diff is large: its 97 lines aren’t shown here.

drivers/platform/x86/wireless-hotkey.c+7−2

This diff is large: its 26 lines aren’t shown here.

drivers/pmdomain/core.c+9−1

This diff is large: its 31 lines aren’t shown here.

drivers/pmdomain/mediatek/mtk-pm-domains.c+7−3

This diff is large: its 26 lines aren’t shown here.

drivers/regulator/Kconfig+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/regulator/qcom-rpmh-regulator.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/regulator/tps65219-regulator.c+95−40

This diff is large: its 179 lines aren’t shown here.

drivers/resctrl/mpam_devices.c+40−41

This diff is large: its 167 lines aren’t shown here.

drivers/resctrl/mpam_internal.h+0−2

This diff is large: its 15 lines aren’t shown here.

drivers/reset/reset-eyeq.c+2−22

This diff is large: its 38 lines aren’t shown here.

drivers/s390/char/Kconfig+0−8

This diff is large: its 15 lines aren’t shown here.

drivers/s390/char/sclp_config.c+0−6

This diff is large: its 35 lines aren’t shown here.

drivers/s390/cio/chsc.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/s390/cio/chsc_sch.c+10−10

This diff is large: its 90 lines aren’t shown here.

drivers/s390/cio/scm.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/device_handler/scsi_dh_alua.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/fcoe/fcoe_ctlr.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/isci/host.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/scsi/megaraid/megaraid_sas_fusion.c+9−0

This diff is large: its 16 lines aren’t shown here.

drivers/scsi/mpt3sas/mpt3sas_scsih.c+13−1

This diff is large: its 22 lines aren’t shown here.

drivers/scsi/pmcraid.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/scsi_debug.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/scsi_devinfo.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/scsi/scsi_lib.c+25−2

This diff is large: its 36 lines aren’t shown here.

drivers/scsi/scsi_transport_fc.c+41−36

This diff is large: its 122 lines aren’t shown here.

drivers/scsi/sd.c+1−2

This diff is large: its 10 lines aren’t shown here.

drivers/scsi/sg.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/smartpqi/smartpqi_init.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/scsi/sr.c+2−9

This diff is large: its 32 lines aren’t shown here.

drivers/scsi/sr.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/spi/spi-amd.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/spi/spi-amlogic-spisg.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/spi/spi-axiado.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/spi/spi-cadence-quadspi.c+18−18

This diff is large: its 86 lines aren’t shown here.

drivers/spi/spi-cadence.c+13−2

This diff is large: its 51 lines aren’t shown here.

drivers/spi/spi-ch341.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/spi/spi-ep93xx.c+2−0

This diff is large: its 15 lines aren’t shown here.

drivers/spi/spi-imx.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/spi/spi-mem.c+11−4

This diff is large: its 25 lines aren’t shown here.

drivers/spi/spi-microchip-core-qspi.c+79−20

This diff is large: its 192 lines aren’t shown here.

drivers/spi/spi-mtk-snfi.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/spi/spi-qup.c+3−0

This diff is large: its 12 lines aren’t shown here.

drivers/spi/spi-rockchip.c+2−4

This diff is large: its 27 lines aren’t shown here.

drivers/spi/spi-rzv2h-rspi.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/spi/spi-sprd.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/spi/spi-ti-qspi.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/staging/greybus/hid.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/staging/rtl8723bs/os_dep/osdep_service.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/staging/vme_user/vme_fake.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/target/iscsi/iscsi_target.c+22−5

This diff is large: its 59 lines aren’t shown here.

drivers/target/iscsi/iscsi_target_auth.c+18−1

This diff is large: its 39 lines aren’t shown here.

drivers/target/iscsi/iscsi_target_nego.c+6−1

This diff is large: its 24 lines aren’t shown here.

drivers/target/iscsi/iscsi_target_parameters.c+48−14

This diff is large: its 105 lines aren’t shown here.

drivers/target/iscsi/iscsi_target_parameters.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/target/loopback/tcm_loop.c+10−2

This diff is large: its 33 lines aren’t shown here.

drivers/target/target_core_configfs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/thunderbolt/property.c+23−9

This diff is large: its 114 lines aren’t shown here.

drivers/tty/serial/8250/8250_dw.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/tty/serial/8250/8250_port.c+5−2

This diff is large: its 21 lines aren’t shown here.

drivers/tty/serial/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/tty/serial/altera_jtaguart.c+6−1

This diff is large: its 21 lines aren’t shown here.

drivers/tty/serial/dz.c+88−83

This diff is large: its 313 lines aren’t shown here.

drivers/tty/serial/fsl_lpuart.c+12−3

This diff is large: its 43 lines aren’t shown here.

drivers/tty/serial/pch_uart.c+13−6

This diff is large: its 41 lines aren’t shown here.

drivers/tty/serial/qcom_geni_serial.c+14−2

This diff is large: its 31 lines aren’t shown here.

drivers/tty/serial/samsung_tty.c+0−8

This diff is large: its 37 lines aren’t shown here.

drivers/tty/serial/sh-sci.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/tty/serial/zs.c+83−143

This diff is large: its 358 lines aren’t shown here.

drivers/tty/serial/zs.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/ufs/core/ufshcd.c+28−2

This diff is large: its 47 lines aren’t shown here.

drivers/uio/uio_pci_generic_sva.c+1−6

This diff is large: its 29 lines aren’t shown here.

drivers/usb/cdns3/cdns3-gadget.c+11−1

This diff is large: its 21 lines aren’t shown here.

drivers/usb/cdns3/cdns3-plat.c+7−4

This diff is large: its 30 lines aren’t shown here.

drivers/usb/chipidea/core.c+6−10

This diff is large: its 44 lines aren’t shown here.

drivers/usb/class/cdc-acm.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/usb/class/cdc-acm.h+2−0

This diff is large: its 6 lines aren’t shown here.

drivers/usb/class/usblp.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/usb/class/usbtmc.c+14−0

This diff is large: its 28 lines aren’t shown here.

drivers/usb/common/ulpi.c+4−1

This diff is large: its 17 lines aren’t shown here.

drivers/usb/core/config.c+19−27

This diff is large: its 100 lines aren’t shown here.

drivers/usb/core/hcd.c+1−3

This diff is large: its 11 lines aren’t shown here.

drivers/usb/core/quirks.c+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/usb/dwc2/hcd.c+3−1

This diff is large: its 22 lines aren’t shown here.

drivers/usb/dwc3/core.c+6−6

This diff is large: its 26 lines aren’t shown here.

drivers/usb/dwc3/dwc3-xilinx.c+15−12

This diff is large: its 65 lines aren’t shown here.

drivers/usb/gadget/composite.c+4−1

This diff is large: its 12 lines aren’t shown here.

drivers/usb/gadget/function/f_fs.c+23−3

This diff is large: its 69 lines aren’t shown here.

drivers/usb/gadget/function/f_hid.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/usb/gadget/function/f_uvc.c+21−7

This diff is large: its 89 lines aren’t shown here.

drivers/usb/gadget/udc/dummy_hcd.c+4−0

This diff is large: its 18 lines aren’t shown here.

drivers/usb/gadget/udc/net2280.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/usb/gadget/udc/omap_udc.c+0−4

This diff is large: its 18 lines aren’t shown here.

drivers/usb/host/xhci-tegra.c+41−32

This diff is large: its 138 lines aren’t shown here.

drivers/usb/musb/omap2430.c+2−1

This diff is large: its 24 lines aren’t shown here.

drivers/usb/serial/belkin_sa.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/usb/serial/cypress_m8.c+19−1

This diff is large: its 58 lines aren’t shown here.

drivers/usb/serial/digi_acceleport.c+21−2

This diff is large: its 37 lines aren’t shown here.

drivers/usb/serial/keyspan.c+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/usb/serial/mct_u232.c+16−10

This diff is large: its 61 lines aren’t shown here.

drivers/usb/serial/mxuport.c+8−0

This diff is large: its 15 lines aren’t shown here.

drivers/usb/serial/omninet.c+5−4

This diff is large: its 30 lines aren’t shown here.

drivers/usb/serial/option.c+12−1

This diff is large: its 35 lines aren’t shown here.

drivers/usb/serial/safe_serial.c+11−0

This diff is large: its 25 lines aren’t shown here.

drivers/usb/storage/unusual_uas.h+7−0

This diff is large: its 14 lines aren’t shown here.

drivers/usb/typec/altmodes/displayport.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/usb/typec/tcpm/fusb302.c+10−10

This diff is large: its 45 lines aren’t shown here.

drivers/usb/typec/tcpm/tcpci_maxim_core.c+9−0

This diff is large: its 16 lines aren’t shown here.

drivers/usb/typec/tcpm/tcpm.c+90−54

This diff is large: its 265 lines aren’t shown here.

drivers/usb/typec/tcpm/wcove.c+8−5

This diff is large: its 31 lines aren’t shown here.

drivers/usb/typec/tipd/core.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/usb/typec/ucsi/displayport.c+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/usb/typec/ucsi/ucsi.c+20−4

This diff is large: its 59 lines aren’t shown here.

drivers/usb/typec/ucsi/ucsi_ccg.c+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/usb/usbip/vudc_dev.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/usb/usbip/vudc_transfer.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/vfio/pci/vfio_pci_core.c+36−1

This diff is large: its 58 lines aren’t shown here.

drivers/vfio/pci/vfio_pci_dmabuf.c+22−20

This diff is large: its 74 lines aren’t shown here.

drivers/vfio/pci/vfio_pci_rdwr.c+7−19

This diff is large: its 35 lines aren’t shown here.

drivers/video/fbdev/core/fb_defio.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/video/fbdev/udlfb.c+30−1

This diff is large: its 65 lines aren’t shown here.

drivers/virt/coco/sev-guest/sev-guest.c+11−9

This diff is large: its 47 lines aren’t shown here.

drivers/xen/privcmd.c+7−0

This diff is large: its 21 lines aren’t shown here.

drivers/xen/sys-hypervisor.c+6−2

This diff is large: its 22 lines aren’t shown here.

drivers/xen/xen-acpi-pad.c+5−1

This diff is large: its 15 lines aren’t shown here.

fs/9p/v9fs_vfs.h+0−13

This diff is large: its 18 lines aren’t shown here.

fs/9p/vfs_inode.c+4−2

This diff is large: its 16 lines aren’t shown here.

fs/9p/vfs_inode_dotl.c+8−4

This diff is large: its 33 lines aren’t shown here.

fs/afs/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

fs/afs/dir.c+44−35

This diff is large: its 179 lines aren’t shown here.

fs/afs/file.c+19−5

This diff is large: its 41 lines aren’t shown here.

fs/afs/fsclient.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/afs/inode.c+26−101

This diff is large: its 200 lines aren’t shown here.

fs/afs/internal.h+27−18

This diff is large: its 105 lines aren’t shown here.

fs/afs/symlink.c+278−0

This diff is large: its 279 lines aren’t shown here.

fs/afs/validation.c+10−4

This diff is large: its 22 lines aren’t shown here.

fs/afs/write.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/afs/yfsclient.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/btrfs/block-group.c+8−15

This diff is large: its 51 lines aren’t shown here.

fs/btrfs/compression.c+14−12

This diff is large: its 46 lines aren’t shown here.

fs/btrfs/disk-io.c+1−0

This diff is large: its 8 lines aren’t shown here.

fs/btrfs/extent_io.c+12−2

This diff is large: its 37 lines aren’t shown here.

fs/btrfs/extent_io.h+2−1

This diff is large: its 10 lines aren’t shown here.

fs/btrfs/extent_map.c+3−1

This diff is large: its 11 lines aren’t shown here.

fs/btrfs/file.c+8−3

This diff is large: its 32 lines aren’t shown here.

fs/btrfs/free-space-tree.c+15−3

This diff is large: its 39 lines aren’t shown here.

fs/btrfs/fs.h+1−0

This diff is large: its 8 lines aren’t shown here.

fs/btrfs/inode.c+34−2

This diff is large: its 68 lines aren’t shown here.

fs/btrfs/ioctl.c+3−4

This diff is large: its 33 lines aren’t shown here.

fs/btrfs/qgroup.c+68−33

This diff is large: its 186 lines aren’t shown here.

fs/btrfs/raid-stripe-tree.c+45−12

This diff is large: its 123 lines aren’t shown here.

fs/btrfs/relocation.c+24−6

This diff is large: its 76 lines aren’t shown here.

fs/btrfs/transaction.c+4−5

This diff is large: its 19 lines aren’t shown here.

fs/cachefiles/namei.c+2−0

This diff is large: its 9 lines aren’t shown here.

fs/ceph/addr.c+2−0

This diff is large: its 16 lines aren’t shown here.

fs/ceph/quota.c+27−10

This diff is large: its 60 lines aren’t shown here.

fs/ceph/xattr.c+17−0

This diff is large: its 31 lines aren’t shown here.

fs/efivarfs/super.c+1−4

This diff is large: its 15 lines aren’t shown here.

fs/erofs/xattr.c+1−3

This diff is large: its 28 lines aren’t shown here.

fs/erofs/zdata.c+8−7

This diff is large: its 32 lines aren’t shown here.

fs/fuse/file.c+4−1

This diff is large: its 12 lines aren’t shown here.

fs/hpfs/alloc.c+1−1

This diff is large: its 10 lines aren’t shown here.

fs/hugetlbfs/inode.c+13−33

This diff is large: its 102 lines aren’t shown here.

fs/inode.c+7−1

This diff is large: its 15 lines aren’t shown here.

fs/iomap/direct-io.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/isofs/export.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/isofs/namei.c+2−9

This diff is large: its 23 lines aren’t shown here.

fs/isofs/rock.c+9−0

This diff is large: its 16 lines aren’t shown here.

fs/jfs/namei.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/lockd/lockd.h+1−1

This diff is large: its 9 lines aren’t shown here.

fs/lockd/svc4proc.c+7−2

This diff is large: its 32 lines aren’t shown here.

fs/lockd/svclock.c+1−3

This diff is large: its 24 lines aren’t shown here.

fs/lockd/svcproc.c+12−3

This diff is large: its 35 lines aren’t shown here.

fs/lockd/svcsubs.c+21−10

This diff is large: its 71 lines aren’t shown here.

fs/mnt_idmapping.c+2−0

This diff is large: its 9 lines aren’t shown here.

fs/netfs/buffered_read.c+39−34

This diff is large: its 193 lines aren’t shown here.

fs/netfs/buffered_write.c+111−63

This diff is large: its 303 lines aren’t shown here.

fs/netfs/direct_read.c+13−29

This diff is large: its 91 lines aren’t shown here.

fs/netfs/direct_write.c+4−2

This diff is large: its 13 lines aren’t shown here.

fs/netfs/internal.h+3−0

This diff is large: its 17 lines aren’t shown here.

fs/netfs/iterator.c+28−13

This diff is large: its 78 lines aren’t shown here.

fs/netfs/misc.c+30−11

This diff is large: its 102 lines aren’t shown here.

fs/netfs/read_collect.c+16−3

This diff is large: its 40 lines aren’t shown here.

fs/netfs/read_retry.c+14−3

This diff is large: its 40 lines aren’t shown here.

fs/netfs/read_single.c+10−13

This diff is large: its 59 lines aren’t shown here.

fs/netfs/write_collect.c+10−5

This diff is large: its 36 lines aren’t shown here.

fs/netfs/write_issue.c+33−16

This diff is large: its 109 lines aren’t shown here.

fs/netfs/write_retry.c+5−1

This diff is large: its 22 lines aren’t shown here.

fs/nfsd/nfs4proc.c+13−5

This diff is large: its 54 lines aren’t shown here.

fs/nfsd/nfs4state.c+44−20

This diff is large: its 104 lines aren’t shown here.

fs/nfsd/nfsctl.c+14−4

This diff is large: its 39 lines aren’t shown here.

fs/nfsd/state.h+1−0

This diff is large: its 8 lines aren’t shown here.

fs/nfsd/trace.h+7−9

This diff is large: its 31 lines aren’t shown here.

fs/nfsd/xdr4.h+1−0

This diff is large: its 8 lines aren’t shown here.

fs/notify/fanotify/fanotify.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/notify/fsnotify.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/notify/mark.c+47−10

This diff is large: its 104 lines aren’t shown here.

fs/nsfs.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/ntfs/attrib.c+22−24

This diff is large: its 89 lines aren’t shown here.

fs/ntfs/attrlist.c+3−4

This diff is large: its 19 lines aren’t shown here.

fs/ntfs/bdev-io.c+5−2

This diff is large: its 22 lines aren’t shown here.

fs/ntfs/bitmap.c+11−8

This diff is large: its 58 lines aren’t shown here.

fs/ntfs/dir.c+10−3

This diff is large: its 27 lines aren’t shown here.

fs/ntfs/index.c+25−9

This diff is large: its 78 lines aren’t shown here.

fs/ntfs/inode.c+3−3

This diff is large: its 30 lines aren’t shown here.

fs/ntfs/iomap.c+3−3

This diff is large: its 20 lines aren’t shown here.

fs/ntfs/logfile.c+4−1

This diff is large: its 19 lines aren’t shown here.

fs/ntfs/mft.c+65−28

This diff is large: its 183 lines aren’t shown here.

fs/ntfs/namei.c+13−4

This diff is large: its 46 lines aren’t shown here.

fs/ntfs/reparse.c+3−2

This diff is large: its 26 lines aren’t shown here.

fs/ntfs/runlist.c+26−7

This diff is large: its 69 lines aren’t shown here.

fs/ntfs/super.c+28−7

This diff is large: its 99 lines aren’t shown here.

fs/orangefs/namei.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/overlayfs/util.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/select.c+11−0

This diff is large: its 18 lines aren’t shown here.

fs/smb/client/cached_dir.c+8−0

This diff is large: its 15 lines aren’t shown here.

fs/smb/client/cifs_spnego.c+16−0

This diff is large: its 36 lines aren’t shown here.

fs/smb/client/cifsacl.c+33−4

This diff is large: its 89 lines aren’t shown here.

fs/smb/client/cifsfs.c+28−14

This diff is large: its 108 lines aren’t shown here.

fs/smb/client/cifsproto.h+0−1

This diff is large: its 8 lines aren’t shown here.

fs/smb/client/cifssmb.c+2−1

This diff is large: its 17 lines aren’t shown here.

fs/smb/client/file.c+9−4

This diff is large: its 28 lines aren’t shown here.

fs/smb/client/fs_context.c+109−85

This diff is large: its 324 lines aren’t shown here.

fs/smb/client/inode.c+8−6

This diff is large: its 45 lines aren’t shown here.

fs/smb/client/ioctl.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/smb/client/netlink.c+5−1

This diff is large: its 19 lines aren’t shown here.

fs/smb/client/readdir.c+2−1

This diff is large: its 10 lines aren’t shown here.

fs/smb/client/smb2file.c+3−0

This diff is large: its 10 lines aren’t shown here.

fs/smb/client/smb2inode.c+9−5

This diff is large: its 41 lines aren’t shown here.

fs/smb/client/smb2misc.c+2−1

This diff is large: its 10 lines aren’t shown here.

fs/smb/client/smb2ops.c+57−22

This diff is large: its 201 lines aren’t shown here.

fs/smb/client/smb2pdu.c+21−7

This diff is large: its 62 lines aren’t shown here.

fs/smb/client/smb2transport.c+28−9

This diff is large: its 91 lines aren’t shown here.

fs/smb/client/smbdirect.c+2−1

This diff is large: its 14 lines aren’t shown here.

fs/smb/client/smbdirect.h+1−1

This diff is large: its 9 lines aren’t shown here.

fs/smb/client/transport.c+9−6

This diff is large: its 29 lines aren’t shown here.

fs/smb/common/fscc.h+2−2

This diff is large: its 15 lines aren’t shown here.

fs/smb/common/smb2pdu.h+4−0

This diff is large: its 11 lines aren’t shown here.

fs/smb/server/connection.c+128−23

This diff is large: its 200 lines aren’t shown here.

fs/smb/server/connection.h+7−0

This diff is large: its 35 lines aren’t shown here.

fs/smb/server/mgmt/share_config.c+8−4

This diff is large: its 26 lines aren’t shown here.

fs/smb/server/oplock.c+7−6

This diff is large: its 49 lines aren’t shown here.

fs/smb/server/server.c+12−0

This diff is large: its 28 lines aren’t shown here.

fs/smb/server/smb2pdu.c+35−5

This diff is large: its 71 lines aren’t shown here.

fs/smb/server/smbacl.c+115−37

This diff is large: its 250 lines aren’t shown here.

fs/smb/server/transport_rdma.c+2−1

This diff is large: its 14 lines aren’t shown here.

fs/smb/server/transport_rdma.h+1−1

This diff is large: its 8 lines aren’t shown here.

fs/smb/server/vfs_cache.c+300−65

This diff is large: its 613 lines aren’t shown here.

fs/smb/server/vfs_cache.h+2−2

This diff is large: its 11 lines aren’t shown here.

fs/smb/smbdirect/accept.c+1−1

This diff is large: its 6 lines aren’t shown here.

fs/smb/smbdirect/connect.c+2−2

This diff is large: its 15 lines aren’t shown here.

fs/smb/smbdirect/connection.c+9−9

This diff is large: its 81 lines aren’t shown here.

fs/smb/smbdirect/debug.c+2−2

This diff is large: its 15 lines aren’t shown here.

fs/smb/smbdirect/devices.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/smb/smbdirect/internal.h+2−2

This diff is large: its 14 lines aren’t shown here.

fs/smb/smbdirect/listen.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/smb/smbdirect/mr.c+15−12

This diff is large: its 64 lines aren’t shown here.

fs/smb/smbdirect/rw.c+1−1

This diff is large: its 6 lines aren’t shown here.

fs/smb/smbdirect/smbdirect.h+0−52

This diff is large: its 53 lines aren’t shown here.

fs/smb/smbdirect/socket.c+10−10

This diff is large: its 87 lines aren’t shown here.

fs/sysfs/group.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/udf/misc.c+6−2

This diff is large: its 15 lines aren’t shown here.

fs/xfs/libxfs/xfs_dir2_data.c+11−7

This diff is large: its 58 lines aren’t shown here.

fs/xfs/libxfs/xfs_refcount.c+1−2

This diff is large: its 10 lines aren’t shown here.

fs/xfs/scrub/common.c+11−0

This diff is large: its 18 lines aren’t shown here.

fs/xfs/scrub/common.h+2−0

This diff is large: its 9 lines aren’t shown here.

fs/xfs/scrub/dabtree.c+6−1

This diff is large: its 14 lines aren’t shown here.

fs/xfs/scrub/dir.c+6−1

This diff is large: its 14 lines aren’t shown here.

fs/xfs/xfs_buf.c+24−10

This diff is large: its 80 lines aren’t shown here.

fs/xfs/xfs_inode.c+0−6

This diff is large: its 13 lines aren’t shown here.

fs/xfs/xfs_notify_failure.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/xfs/xfs_trans.c+11−0

This diff is large: its 22 lines aren’t shown here.

fs/xfs/xfs_zone_alloc.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/xfs/xfs_zone_gc.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/zonefs/super.c+5−1

This diff is large: its 16 lines aren’t shown here.

include/acpi/acpi_bus.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/acpi/acpixf.h+5−0

This diff is large: its 12 lines aren’t shown here.

include/acpi/actbl1.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/asm-generic/kprobes.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/asm-generic/ring_buffer.h+13−0

This diff is large: its 14 lines aren’t shown here.

include/crypto/krb5.h+6−3

This diff is large: its 16 lines aren’t shown here.

include/drm/drm_device.h+7−0

This diff is large: its 14 lines aren’t shown here.

include/drm/drm_fb_helper.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/drm/drm_gem.h+9−11

This diff is large: its 47 lines aren’t shown here.

include/drm/ttm/ttm_resource.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/kunit/test.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/arm-smccc.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/linux/bio.h+2−1

This diff is large: its 10 lines aren’t shown here.

include/linux/bpf.h+8−1

This diff is large: its 23 lines aren’t shown here.

include/linux/bpf_verifier.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/linux/cdrom.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/cgroup-defs.h+2−2

This diff is large: its 11 lines aren’t shown here.

include/linux/cgroup.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/linux/compat.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/linux/compiler-clang.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/linux/compiler_attributes.h+11−0

This diff is large: its 18 lines aren’t shown here.

include/linux/compiler_types.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/linux/dma-buf.h+2−2

This diff is large: its 16 lines aren’t shown here.

include/linux/dpll.h+2−0

This diff is large: its 11 lines aren’t shown here.

include/linux/efi.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/filter.h+0−3

This diff is large: its 10 lines aren’t shown here.

include/linux/fprobe.h+5−0

This diff is large: its 19 lines aren’t shown here.

include/linux/fsnotify_backend.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/fwnode.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/gfp_types.h+5−5

This diff is large: its 17 lines aren’t shown here.

include/linux/hid.h+4−4

This diff is large: its 29 lines aren’t shown here.

include/linux/hid_bpf.h+9−5

This diff is large: its 35 lines aren’t shown here.

include/linux/highmem.h+4−3

This diff is large: its 15 lines aren’t shown here.

include/linux/hugetlb.h+1−7

This diff is large: its 29 lines aren’t shown here.

include/linux/hugetlb_inline.h+2−12

This diff is large: its 34 lines aren’t shown here.

include/linux/intel_tpmi.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/linux/irq-entry-common.h+0−8

This diff is large: its 15 lines aren’t shown here.

include/linux/irqchip/arm-gic-v5.h+0−3

This diff is large: its 10 lines aren’t shown here.

include/linux/kho/abi/kexec_handover.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/libata.h+4−3

This diff is large: its 28 lines aren’t shown here.

include/linux/list.h+37−0

This diff is large: its 51 lines aren’t shown here.

include/linux/mailbox_client.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/mailbox_controller.h+13−4

This diff is large: its 45 lines aren’t shown here.

include/linux/maple_tree.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/mm.h+25−4

This diff is large: its 50 lines aren’t shown here.

include/linux/mroute_base.h+3−0

This diff is large: its 24 lines aren’t shown here.

include/linux/mtd/spinand.h+7−0

This diff is large: its 21 lines aren’t shown here.

include/linux/netfilter/nf_conntrack_proto_gre.h+4−3

This diff is large: its 14 lines aren’t shown here.

include/linux/netfilter/x_tables.h+11−1

This diff is large: its 44 lines aren’t shown here.

include/linux/netfilter_arp/arp_tables.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/linux/netfilter_ipv4/ip_tables.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/linux/netfilter_ipv6/ip6_tables.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/linux/netfs.h+285−10

This diff is large: its 340 lines aren’t shown here.

include/linux/nvme-auth.h+3−3

This diff is large: its 13 lines aren’t shown here.

include/linux/page-flags.h+0−6

This diff is large: its 20 lines aren’t shown here.

include/linux/parport.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/rculist.h+29−0

This diff is large: its 36 lines aren’t shown here.

include/linux/rhashtable-types.h+5−0

This diff is large: its 40 lines aren’t shown here.

include/linux/rhashtable.h+5−3

This diff is large: its 35 lines aren’t shown here.

include/linux/rseq.h+26−11

This diff is large: its 89 lines aren’t shown here.

include/linux/rseq_entry.h+59−82

This diff is large: its 236 lines aren’t shown here.

include/linux/rseq_types.h+11−2

This diff is large: its 42 lines aren’t shown here.

include/linux/sched.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/linux/sched/deadline.h+9−0

This diff is large: its 16 lines aren’t shown here.

include/linux/sched/ext.h+10−6

This diff is large: its 32 lines aren’t shown here.

include/linux/sched/isolation.h+5−1

This diff is large: its 20 lines aren’t shown here.

include/linux/serial_core.h+12−0

This diff is large: its 19 lines aren’t shown here.

include/linux/skbuff.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/linux/slab.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/linux/smbdirect.hrenamed from fs/smb/smbdirect/public.h+45−7

This diff is large: its 69 lines aren’t shown here.

include/linux/soc/airoha/airoha_offload.h+3−3

This diff is large: its 13 lines aren’t shown here.

include/linux/syscalls.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/linux/tracepoint.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/tty_port.h+1−1

This diff is large: its 12 lines aren’t shown here.

include/linux/vfio_pci_core.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/workqueue.h+4−2

This diff is large: its 13 lines aren’t shown here.

include/net/bluetooth/bluetooth.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/bluetooth/hci_core.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/bond_3ad.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/dropreason-core.h+6−0

This diff is large: its 20 lines aren’t shown here.

include/net/genetlink.h+3−1

This diff is large: its 12 lines aren’t shown here.

include/net/ip_vs.h+28−6

This diff is large: its 94 lines aren’t shown here.

include/net/ipv6.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/net/macsec.h+5−2

This diff is large: its 42 lines aren’t shown here.

include/net/mana/shm_channel.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/net/neighbour.h+6−2

This diff is large: its 18 lines aren’t shown here.

include/net/net_shaper.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/netfilter/nf_conntrack_expect.h+4−1

This diff is large: its 14 lines aren’t shown here.

include/net/netfilter/nf_dup_netdev.h+13−0

This diff is large: its 24 lines aren’t shown here.

include/net/netfilter/nf_flow_table.h+3−1

This diff is large: its 20 lines aren’t shown here.

include/net/netfilter/nf_queue.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/netfilter/nf_tables.h+20−0

This diff is large: its 47 lines aren’t shown here.

include/net/netmem.h+11−11

This diff is large: its 47 lines aren’t shown here.

include/net/netns/ipv4.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/netns/ipv6.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/nsh.h+2−2

This diff is large: its 13 lines aren’t shown here.

include/net/tcp.h+4−3

This diff is large: its 24 lines aren’t shown here.

include/net/xfrm.h+2−1

This diff is large: its 17 lines aren’t shown here.

include/rdma/uverbs_ioctl.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/trace/events/btrfs.h+1−3

This diff is large: its 12 lines aren’t shown here.

include/trace/events/damon.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/trace/events/netfs.h+8−0

This diff is large: its 23 lines aren’t shown here.

include/trace/events/rxrpc.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/io_uring.h+2−1

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/rseq.h+4−1

This diff is large: its 19 lines aren’t shown here.

include/ufs/unipro.h+5−0

This diff is large: its 12 lines aren’t shown here.

include/video/imx-ipu-image-convert.h+11−5

This diff is large: its 58 lines aren’t shown here.

include/video/udlfb.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/xen/arm/interface.h+1−1

This diff is large: its 9 lines aren’t shown here.

io_uring/cancel.c+1−1

This diff is large: its 10 lines aren’t shown here.

io_uring/eventfd.c+1−0

This diff is large: its 8 lines aren’t shown here.

io_uring/fdinfo.c+2−1

This diff is large: its 11 lines aren’t shown here.

io_uring/io-wq.c+2−1

This diff is large: its 10 lines aren’t shown here.

io_uring/io_uring.c+27−11

This diff is large: its 93 lines aren’t shown here.

io_uring/kbuf.c+7−2

This diff is large: its 33 lines aren’t shown here.

io_uring/kbuf.h+7−1

This diff is large: its 20 lines aren’t shown here.

io_uring/napi.c+22−7

This diff is large: its 77 lines aren’t shown here.

io_uring/napi.h+5−3

This diff is large: its 27 lines aren’t shown here.

io_uring/net.c+25−1

This diff is large: its 52 lines aren’t shown here.

io_uring/nop.c+2−2

This diff is large: its 12 lines aren’t shown here.

io_uring/rw.c+2−2

This diff is large: its 18 lines aren’t shown here.

io_uring/tctx.c+8−4

This diff is large: its 35 lines aren’t shown here.

io_uring/timeout.c+39−16

This diff is large: its 114 lines aren’t shown here.

io_uring/tw.c+11−1

This diff is large: its 20 lines aren’t shown here.

io_uring/wait.c+5−1

This diff is large: its 20 lines aren’t shown here.

io_uring/waitid.c+1−0

This diff is large: its 8 lines aren’t shown here.

io_uring/zcrx.c+1−2

This diff is large: its 12 lines aren’t shown here.

ipc/util.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/audit.c+4−0

This diff is large: its 18 lines aren’t shown here.

kernel/auditsc.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/bpf/arena.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/bpf/arraymap.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/bpf/cfg.c+12−1

This diff is large: its 38 lines aren’t shown here.

kernel/bpf/core.c+19−8

This diff is large: its 51 lines aren’t shown here.

kernel/bpf/fixups.c+9−4

This diff is large: its 27 lines aren’t shown here.

kernel/bpf/helpers.c+5−0

This diff is large: its 14 lines aren’t shown here.

kernel/bpf/liveness.c+7−18

This diff is large: its 34 lines aren’t shown here.

kernel/bpf/syscall.c+26−0

This diff is large: its 40 lines aren’t shown here.

kernel/bpf/verifier.c+21−6

This diff is large: its 84 lines aren’t shown here.

kernel/cgroup/cgroup.c+141−145

This diff is large: its 465 lines aren’t shown here.

kernel/cgroup/cpuset-internal.h+6−0

This diff is large: its 14 lines aren’t shown here.

kernel/cgroup/cpuset.c+38−27

This diff is large: its 165 lines aren’t shown here.

kernel/cgroup/dmem.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/cgroup/rdma.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/cgroup/rstat.c+23−14

This diff is large: its 93 lines aren’t shown here.

kernel/dma/debug.c+8−1

This diff is large: its 16 lines aren’t shown here.

kernel/dma/direct.c+2−2

This diff is large: its 18 lines aren’t shown here.

kernel/dma/mapping.c+0−4

This diff is large: its 11 lines aren’t shown here.

kernel/events/core.c+55−15

This diff is large: its 116 lines aren’t shown here.

kernel/events/internal.h+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/events/ring_buffer.c+2−0

This diff is large: its 9 lines aren’t shown here.

kernel/exit.c+2−0

This diff is large: its 16 lines aren’t shown here.

kernel/fork.c+10−13

This diff is large: its 59 lines aren’t shown here.

kernel/futex/requeue.c+9−4

This diff is large: its 29 lines aren’t shown here.

kernel/irq/chip.c+7−2

This diff is large: its 30 lines aren’t shown here.

kernel/irq_work.c+7−0

This diff is large: its 21 lines aren’t shown here.

kernel/liveupdate/kexec_handover.c+46−33

This diff is large: its 119 lines aren’t shown here.

kernel/liveupdate/luo_session.c+10−5

This diff is large: its 53 lines aren’t shown here.

kernel/ptrace.c+16−6

This diff is large: its 40 lines aren’t shown here.

kernel/rcu/srcutree.c+6−6

This diff is large: its 26 lines aren’t shown here.

kernel/rseq.c+132−82

This diff is large: its 310 lines aren’t shown here.

kernel/sched/core.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/sched/deadline.c+10−3

This diff is large: its 38 lines aren’t shown here.

kernel/sched/ext.c+527−208

This diff is large: its 1465 lines aren’t shown here.

kernel/sched/ext_idle.c+24−8

This diff is large: its 73 lines aren’t shown here.

kernel/sched/ext_idle.h+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/sched/ext_internal.h+2−0

This diff is large: its 9 lines aren’t shown here.

kernel/sched/fair.c+59−23

This diff is large: its 172 lines aren’t shown here.

kernel/sched/membarrier.c+10−1

This diff is large: its 18 lines aren’t shown here.

kernel/time/timer_migration.c+29−11

This diff is large: its 49 lines aren’t shown here.

kernel/trace/Makefile+4−3

This diff is large: its 21 lines aren’t shown here.

kernel/trace/bpf_trace.c+2−1

This diff is large: its 10 lines aren’t shown here.

kernel/trace/fprobe.c+21−2

This diff is large: its 43 lines aren’t shown here.

kernel/trace/remote_test.c+2−2

This diff is large: its 12 lines aren’t shown here.

kernel/trace/ring_buffer.c+25−5

This diff is large: its 93 lines aren’t shown here.

kernel/trace/simple_ring_buffer.c+2−2

This diff is large: its 23 lines aren’t shown here.

kernel/trace/trace_branch.c+4−4

This diff is large: its 26 lines aren’t shown here.

kernel/trace/trace_events_hist.c+2−4

This diff is large: its 13 lines aren’t shown here.

kernel/trace/trace_probe.c+6−0

This diff is large: its 13 lines aren’t shown here.

kernel/trace/trace_probe.h+3−1

This diff is large: its 18 lines aren’t shown here.

kernel/trace/tracing_map.c+13−4

This diff is large: its 42 lines aren’t shown here.

kernel/workqueue.c+35−10

This diff is large: its 94 lines aren’t shown here.

lib/debugobjects.c+15−5

This diff is large: its 42 lines aren’t shown here.

lib/fonts/font_rotate.c+1−1

This diff is large: its 9 lines aren’t shown here.

lib/kunit/Kconfig+3−2

This diff is large: its 12 lines aren’t shown here.

lib/kunit/executor.c+16−3

This diff is large: its 33 lines aren’t shown here.

lib/kunit/test.c+1−0

This diff is large: its 8 lines aren’t shown here.

lib/maple_tree.c+1−1

This diff is large: its 9 lines aren’t shown here.

lib/rhashtable.c+57−12

This diff is large: its 167 lines aren’t shown here.

lib/test_maple_tree.c+2−2

This diff is large: its 17 lines aren’t shown here.

lib/tests/kunit_iov_iter.c+5−5

This diff is large: its 45 lines aren’t shown here.

lib/tests/test_kprobes.c+18−11

This diff is large: its 71 lines aren’t shown here.

lib/vdso/gettimeofday.c+2−3

This diff is large: its 14 lines aren’t shown here.

mm/damon/lru_sort.c+55−30

This diff is large: its 137 lines aren’t shown here.

mm/damon/reclaim.c+55−30

This diff is large: its 137 lines aren’t shown here.

mm/damon/stat.c+20−10

This diff is large: its 70 lines aren’t shown here.

mm/damon/sysfs-schemes.c+27−6

This diff is large: its 102 lines aren’t shown here.

mm/hugetlb.c+29−42

This diff is large: its 183 lines aren’t shown here.

mm/hugetlb_cma.c+1−0

This diff is large: its 8 lines aren’t shown here.

mm/memblock.c+4−2

This diff is large: its 18 lines aren’t shown here.

mm/memcontrol.c+28−13

This diff is large: its 128 lines aren’t shown here.

mm/memfd.c+6−6

This diff is large: its 26 lines aren’t shown here.

mm/memfd_luo.c+19−6

This diff is large: its 60 lines aren’t shown here.

mm/memory.c+20−4

This diff is large: its 52 lines aren’t shown here.

mm/memory_hotplug.c+2−0

This diff is large: its 9 lines aren’t shown here.

mm/migrate_device.c+4−2

This diff is large: its 27 lines aren’t shown here.

mm/page-writeback.c+6−10

This diff is large: its 30 lines aren’t shown here.

mm/page_alloc.c+13−13

This diff is large: its 74 lines aren’t shown here.

mm/rmap.c+2−0

This diff is large: its 9 lines aren’t shown here.

mm/slab_common.c+2−0

This diff is large: its 10 lines aren’t shown here.

mm/slub.c+21−0

This diff is large: its 42 lines aren’t shown here.

mm/userfaultfd.c+11−1

This diff is large: its 27 lines aren’t shown here.

mm/util.c+17−9

This diff is large: its 80 lines aren’t shown here.

mm/vma.c+2−1

This diff is large: its 10 lines aren’t shown here.

mm/vmalloc.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/appletalk/aarp.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/atm/signaling.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/batman-adv/bat_iv_ogm.c+125−42

This diff is large: its 330 lines aren’t shown here.

net/batman-adv/bat_v_ogm.c+35−24

This diff is large: its 159 lines aren’t shown here.

net/batman-adv/bridge_loop_avoidance.c+83−37

This diff is large: its 228 lines aren’t shown here.

net/batman-adv/distributed-arp-table.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/batman-adv/fragmentation.c+52−6

This diff is large: its 128 lines aren’t shown here.

net/batman-adv/gateway_client.c+4−0

This diff is large: its 15 lines aren’t shown here.

net/batman-adv/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/batman-adv/mesh-interface.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/batman-adv/originator.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/batman-adv/tp_meter.c+169−60

This diff is large: its 512 lines aren’t shown here.

net/batman-adv/tp_meter.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/batman-adv/translation-table.c+45−10

This diff is large: its 132 lines aren’t shown here.

net/batman-adv/tvlv.c+20−8

This diff is large: its 77 lines aren’t shown here.

net/batman-adv/tvlv.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/batman-adv/types.h+48−15

This diff is large: its 133 lines aren’t shown here.

net/bluetooth/6lowpan.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/af_bluetooth.c+75−22

This diff is large: its 181 lines aren’t shown here.

net/bluetooth/bnep/core.c+11−4

This diff is large: its 32 lines aren’t shown here.

net/bluetooth/hci_conn.c+107−21

This diff is large: its 187 lines aren’t shown here.

net/bluetooth/hci_core.c+3−40

This diff is large: its 50 lines aren’t shown here.

net/bluetooth/hci_event.c+26−3

This diff is large: its 52 lines aren’t shown here.

net/bluetooth/hci_sync.c+18−4

This diff is large: its 85 lines aren’t shown here.

net/bluetooth/hidp/core.c+42−8

This diff is large: its 94 lines aren’t shown here.

net/bluetooth/iso.c+52−30

This diff is large: its 229 lines aren’t shown here.

net/bluetooth/l2cap_core.c+37−20

This diff is large: its 121 lines aren’t shown here.

net/bluetooth/l2cap_sock.c+57−9

This diff is large: its 110 lines aren’t shown here.

net/bluetooth/mgmt.c+6−0

This diff is large: its 16 lines aren’t shown here.

net/bluetooth/rfcomm/core.c+5−2

This diff is large: its 15 lines aren’t shown here.

net/bluetooth/rfcomm/sock.c+8−1

This diff is large: its 24 lines aren’t shown here.

net/bluetooth/sco.c+47−22

This diff is large: its 136 lines aren’t shown here.

net/bridge/br_multicast.c+17−5

This diff is large: its 53 lines aren’t shown here.

net/bridge/br_netfilter_hooks.c+5−1

This diff is large: its 13 lines aren’t shown here.

net/bridge/br_netlink.c+17−10

This diff is large: its 93 lines aren’t shown here.

net/bridge/br_switchdev.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/bridge/br_sysfs_if.c+22−8

This diff is large: its 57 lines aren’t shown here.

net/bridge/netfilter/ebtable_broute.c+6−8

This diff is large: its 31 lines aren’t shown here.

net/bridge/netfilter/ebtable_filter.c+6−8

This diff is large: its 31 lines aren’t shown here.

net/bridge/netfilter/ebtable_nat.c+5−7

This diff is large: its 30 lines aren’t shown here.

net/bridge/netfilter/ebtables.c+73−28

This diff is large: its 198 lines aren’t shown here.

net/ceph/auth_x.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/ceph/crush/crush.c+1−5

This diff is large: its 46 lines aren’t shown here.

net/ceph/osdmap.c+12−5

This diff is large: its 48 lines aren’t shown here.

net/core/bpf_sk_storage.c+8−6

This diff is large: its 60 lines aren’t shown here.

net/core/dev.c+13−10

This diff is large: its 66 lines aren’t shown here.

net/core/devmem.c+12−2

This diff is large: its 35 lines aren’t shown here.

net/core/failover.c+5−1

This diff is large: its 21 lines aren’t shown here.

net/core/filter.c+49−8

This diff is large: its 126 lines aren’t shown here.

net/core/gro.c+7−0

This diff is large: its 32 lines aren’t shown here.

net/core/neighbour.c+5−5

This diff is large: its 34 lines aren’t shown here.

net/core/netmem_priv.h+13−10

This diff is large: its 32 lines aren’t shown here.

net/core/netpoll.c+33−11

This diff is large: its 124 lines aren’t shown here.

net/core/page_pool.c+7−27

This diff is large: its 63 lines aren’t shown here.

net/core/rtnetlink.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/core/skbuff.c+51−5

This diff is large: its 139 lines aren’t shown here.

net/core/skmsg.c+7−2

This diff is large: its 29 lines aren’t shown here.

net/core/sock_map.c+25−14

This diff is large: its 98 lines aren’t shown here.

net/ethtool/bitset.c+4−4

This diff is large: its 24 lines aren’t shown here.

net/ethtool/cmis.h+2−2

This diff is large: its 21 lines aren’t shown here.

net/ethtool/cmis_cdb.c+7−2

This diff is large: its 16 lines aren’t shown here.

net/ethtool/cmis_fw_update.c+30−14

This diff is large: its 72 lines aren’t shown here.

net/ethtool/coalesce.c+6−0

This diff is large: its 13 lines aren’t shown here.

net/ethtool/eeprom.c+6−4

This diff is large: its 34 lines aren’t shown here.

net/ethtool/linkstate.c+2−4

This diff is large: its 13 lines aren’t shown here.

net/ethtool/module.c+25−16

This diff is large: its 105 lines aren’t shown here.

net/ethtool/netlink.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/ethtool/netlink.h+2−2

This diff is large: its 15 lines aren’t shown here.

net/ethtool/phy.c+33−3

This diff is large: its 65 lines aren’t shown here.

net/ethtool/pse-pd.c+5−5

This diff is large: its 20 lines aren’t shown here.

net/ethtool/rss.c+23−14

This diff is large: its 103 lines aren’t shown here.

net/ethtool/strset.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ethtool/tsconfig.c+11−4

This diff is large: its 37 lines aren’t shown here.

net/ethtool/tsinfo.c+15−4

This diff is large: its 47 lines aren’t shown here.

net/handshake/genl.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/handshake/genl.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/handshake/handshake-test.c+37−1

This diff is large: its 208 lines aren’t shown here.

net/handshake/handshake.h+4−2

This diff is large: its 34 lines aren’t shown here.

net/handshake/netlink.c+13−16

This diff is large: its 67 lines aren’t shown here.

net/handshake/request.c+59−22

This diff is large: its 180 lines aren’t shown here.

net/handshake/tlshd.c+4−2

This diff is large: its 27 lines aren’t shown here.

net/hsr/hsr_forward.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/hsr/hsr_framereg.c+6−3

This diff is large: its 23 lines aren’t shown here.

net/ipv4/ah4.c+13−3

This diff is large: its 44 lines aren’t shown here.

net/ipv4/bpf_tcp_ca.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/esp4.c+4−3

This diff is large: its 21 lines aren’t shown here.

net/ipv4/icmp.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/ipv4/igmp.c+36−22

This diff is large: its 100 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/ipv4/inetpeer.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv4/ip_output.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/ipv4/ip_tunnel_core.c+14−8

This diff is large: its 79 lines aren’t shown here.

net/ipv4/ipmr.c+64−54

This diff is large: its 253 lines aren’t shown here.

net/ipv4/ipmr_base.c+16−0

This diff is large: its 30 lines aren’t shown here.

net/ipv4/netfilter/arp_tables.c+23−48

This diff is large: its 127 lines aren’t shown here.

net/ipv4/netfilter/arpt_mangle.c+8−0

This diff is large: its 22 lines aren’t shown here.

net/ipv4/netfilter/arptable_filter.c+14−13

This diff is large: its 55 lines aren’t shown here.

net/ipv4/netfilter/ip_tables.c+8−51

This diff is large: its 109 lines aren’t shown here.

net/ipv4/netfilter/iptable_filter.c+14−13

This diff is large: its 55 lines aren’t shown here.

net/ipv4/netfilter/iptable_mangle.c+15−14

This diff is large: its 56 lines aren’t shown here.

net/ipv4/netfilter/iptable_nat.c+5−1

This diff is large: its 21 lines aren’t shown here.

net/ipv4/netfilter/iptable_raw.c+13−13

This diff is large: its 54 lines aren’t shown here.

net/ipv4/netfilter/iptable_security.c+14−13

This diff is large: its 56 lines aren’t shown here.

net/ipv4/netfilter/nf_socket_ipv4.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/ipv4/raw.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/route.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/sysctl_net_ipv4.c+1−1

This diff is large: its 12 lines aren’t shown here.

net/ipv4/tcp.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/ipv4/tcp_ao.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv4/tcp_input.c+6−9

This diff is large: its 34 lines aren’t shown here.

net/ipv4/tcp_ipv4.c+8−9

This diff is large: its 70 lines aren’t shown here.

net/ipv4/tcp_minisocks.c+1−1

This diff is large: its 8 lines aren’t shown here.

net/ipv4/tcp_output.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/tcp_timer.c+3−2

This diff is large: its 19 lines aren’t shown here.

net/ipv4/udp_offload.c+8−14

This diff is large: its 54 lines aren’t shown here.

net/ipv6/Kconfig+2−2

This diff is large: its 18 lines aren’t shown here.

net/ipv6/addrconf.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/ah6.c+13−3

This diff is large: its 50 lines aren’t shown here.

net/ipv6/datagram.c+46−8

This diff is large: its 108 lines aren’t shown here.

net/ipv6/esp6.c+4−3

This diff is large: its 21 lines aren’t shown here.

net/ipv6/exthdrs.c+27−9

This diff is large: its 108 lines aren’t shown here.

net/ipv6/exthdrs_core.c+7−0

This diff is large: its 35 lines aren’t shown here.

net/ipv6/ip6_flowlabel.c+31−15

This diff is large: its 129 lines aren’t shown here.

net/ipv6/ip6_gre.c+3−2

This diff is large: its 14 lines aren’t shown here.

net/ipv6/ip6_input.c+5−0

This diff is large: its 19 lines aren’t shown here.

net/ipv6/ip6_output.c+5−0

This diff is large: its 26 lines aren’t shown here.

net/ipv6/ip6_tunnel.c+4−0

This diff is large: its 16 lines aren’t shown here.

net/ipv6/ip6_vti.c+16−7

This diff is large: its 57 lines aren’t shown here.

net/ipv6/netfilter/ip6_tables.c+8−48

This diff is large: its 106 lines aren’t shown here.

net/ipv6/netfilter/ip6t_hbh.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/ipv6/netfilter/ip6table_filter.c+13−13

This diff is large: its 54 lines aren’t shown here.

net/ipv6/netfilter/ip6table_mangle.c+14−13

This diff is large: its 55 lines aren’t shown here.

net/ipv6/netfilter/ip6table_nat.c+5−1

This diff is large: its 21 lines aren’t shown here.

net/ipv6/netfilter/ip6table_raw.c+12−12

This diff is large: its 52 lines aren’t shown here.

net/ipv6/netfilter/ip6table_security.c+14−13

This diff is large: its 55 lines aren’t shown here.

net/ipv6/netfilter/nf_socket_ipv6.c+3−2

This diff is large: its 19 lines aren’t shown here.

net/ipv6/netfilter/nft_fib_ipv6.c+17−1

This diff is large: its 35 lines aren’t shown here.

net/ipv6/route.c+15−1

This diff is large: its 58 lines aren’t shown here.

net/ipv6/rpl_iptunnel.c+9−0

This diff is large: its 17 lines aren’t shown here.

net/ipv6/seg6_iptunnel.c+9−0

This diff is large: its 17 lines aren’t shown here.

net/ipv6/tcp_ipv6.c+13−7

This diff is large: its 64 lines aren’t shown here.

net/ipv6/xfrm6_protocol.c+3−1

This diff is large: its 12 lines aren’t shown here.

net/iucv/af_iucv.c+14−6

This diff is large: its 49 lines aren’t shown here.

net/key/af_key.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/l2tp/l2tp_core.c+7−6

This diff is large: its 28 lines aren’t shown here.

net/mac80211/cfg.c+3−2

This diff is large: its 12 lines aren’t shown here.

net/mac80211/mlme.c+17−6

This diff is large: its 73 lines aren’t shown here.

net/mac80211/parse.c+63−42

This diff is large: its 176 lines aren’t shown here.

net/mac80211/rx.c+9−3

This diff is large: its 44 lines aren’t shown here.

net/mac80211/tests/chan-mode.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/mac80211/util.c+2−2

This diff is large: its 14 lines aren’t shown here.

net/mctp/test/route-test.c+1−1

This diff is large: its 11 lines aren’t shown here.

net/mctp/test/utils.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mptcp/bpf.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mptcp/fastopen.c+3−1

This diff is large: its 23 lines aren’t shown here.

net/mptcp/pm.c+88−30

This diff is large: its 226 lines aren’t shown here.

net/mptcp/pm_kernel.c+9−5

This diff is large: its 43 lines aren’t shown here.

net/mptcp/protocol.c+22−6

This diff is large: its 50 lines aren’t shown here.

net/mptcp/sockopt.c+18−8

This diff is large: its 70 lines aren’t shown here.

net/mptcp/subflow.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/netfilter/ipset/ip_set_core.c+3−2

This diff is large: its 24 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_gen.h+37−20

This diff is large: its 231 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipmark.c+5−1

This diff is large: its 20 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipport.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipportip.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipportnet.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_conn.c+42−34

This diff is large: its 158 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_ctl.c+237−106

This diff is large: its 784 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_est.c+48−35

This diff is large: its 197 lines aren’t shown here.

net/netfilter/nf_conntrack_broadcast.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_core.c+13−2

This diff is large: its 42 lines aren’t shown here.

net/netfilter/nf_conntrack_expect.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_h323_main.c+6−6

This diff is large: its 54 lines aren’t shown here.

net/netfilter/nf_conntrack_helper.c+13−5

This diff is large: its 44 lines aren’t shown here.

net/netfilter/nf_conntrack_netlink.c+19−2

This diff is large: its 69 lines aren’t shown here.

net/netfilter/nf_conntrack_pptp.c+2−6

This diff is large: its 16 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_gre.c+81−25

This diff is large: its 123 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_sctp.c+7−3

This diff is large: its 17 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_tcp.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nf_conntrack_sip.c+123−39

This diff is large: its 301 lines aren’t shown here.

net/netfilter/nf_dup_netdev.c+0−16

This diff is large: its 23 lines aren’t shown here.

net/netfilter/nf_flow_table_core.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_flow_table_ip.c+116−35

This diff is large: its 249 lines aren’t shown here.

net/netfilter/nf_flow_table_path.c+6−1

This diff is large: its 29 lines aren’t shown here.

net/netfilter/nf_nat_sip.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_queue.c+3−1

This diff is large: its 29 lines aren’t shown here.

net/netfilter/nf_synproxy_core.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nf_tables_api.c+245−102

This diff is large: its 686 lines aren’t shown here.

net/netfilter/nf_tables_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nfnetlink_queue.c+6−2

This diff is large: its 29 lines aren’t shown here.

net/netfilter/nft_bitwise.c+16−5

This diff is large: its 56 lines aren’t shown here.

net/netfilter/nft_byteorder.c+10−3

This diff is large: its 20 lines aren’t shown here.

net/netfilter/nft_compat.c+35−10

This diff is large: its 99 lines aren’t shown here.

net/netfilter/nft_ct.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_exthdr.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_fwd_netdev.c+25−4

This diff is large: its 68 lines aren’t shown here.

net/netfilter/nft_inner.c+1−2

This diff is large: its 18 lines aren’t shown here.

net/netfilter/nft_osf.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_payload.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_tproxy.c+4−4

This diff is large: its 22 lines aren’t shown here.

net/netfilter/x_tables.c+218−38

This diff is large: its 383 lines aren’t shown here.

net/netfilter/xt_CT.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/netfilter/xt_TCPMSS.c+17−16

This diff is large: its 74 lines aren’t shown here.

net/netfilter/xt_TPROXY.c+9−2

This diff is large: its 39 lines aren’t shown here.

net/netfilter/xt_addrtype.c+19−6

This diff is large: its 55 lines aren’t shown here.

net/netfilter/xt_cpu.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/xt_devgroup.c+13−5

This diff is large: its 38 lines aren’t shown here.

net/netfilter/xt_ecn.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/xt_hashlimit.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/netfilter/xt_osf.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/netfilter/xt_physdev.c+15−5

This diff is large: its 51 lines aren’t shown here.

net/netfilter/xt_policy.c+20−6

This diff is large: its 63 lines aren’t shown here.

net/netfilter/xt_set.c+25−14

This diff is large: its 67 lines aren’t shown here.

net/netfilter/xt_tcpmss.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netlink/af_netlink.c+8−3

This diff is large: its 18 lines aren’t shown here.

net/netlink/genetlink.c+6−2

This diff is large: its 24 lines aren’t shown here.

net/nfc/hci/core.c+10−0

This diff is large: its 24 lines aren’t shown here.

net/nfc/llcp_core.c+11−0

This diff is large: its 25 lines aren’t shown here.

net/nfc/llcp_sock.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/nfc/nci/hci.c+10−0

This diff is large: its 24 lines aren’t shown here.

net/openvswitch/vport-geneve.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/openvswitch/vport-gre.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/openvswitch/vport-netdev.c+46−22

This diff is large: its 118 lines aren’t shown here.

net/openvswitch/vport-netdev.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/openvswitch/vport-vxlan.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/phonet/pep.c+17−2

This diff is large: its 26 lines aren’t shown here.

net/phonet/socket.c+8−2

This diff is large: its 18 lines aren’t shown here.

net/psp/psp-nl-gen.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/psp/psp_main.c+31−11

This diff is large: its 75 lines aren’t shown here.

net/psp/psp_nl.c+7−3

This diff is large: its 24 lines aren’t shown here.

net/rds/message.c+16−5

This diff is large: its 48 lines aren’t shown here.

net/rds/tcp.c+6−3

This diff is large: its 24 lines aren’t shown here.

net/rxrpc/ar-internal.h+9−5

This diff is large: its 41 lines aren’t shown here.

net/rxrpc/call_event.c+1−19

This diff is large: its 27 lines aren’t shown here.

net/rxrpc/call_object.c+2−0

This diff is large: its 16 lines aren’t shown here.

net/rxrpc/conn_event.c+12−17

This diff is large: its 40 lines aren’t shown here.

net/rxrpc/insecure.c+3−5

This diff is large: its 23 lines aren’t shown here.

net/rxrpc/recvmsg.c+55−13

This diff is large: its 107 lines aren’t shown here.

net/rxrpc/rxgk.c+67−93

This diff is large: its 285 lines aren’t shown here.

net/rxrpc/rxgk_app.c+19−27

This diff is large: its 124 lines aren’t shown here.

net/rxrpc/rxgk_common.h+30−36

This diff is large: its 105 lines aren’t shown here.

net/rxrpc/rxkad.c+42−73

This diff is large: its 250 lines aren’t shown here.

net/sched/act_mirred.c+51−26

This diff is large: its 155 lines aren’t shown here.

net/sched/sch_cake.c+196−176

This diff is large: its 792 lines aren’t shown here.

net/sched/sch_cbs.c+15−1

This diff is large: its 30 lines aren’t shown here.

net/sched/sch_choke.c+16−10

This diff is large: its 67 lines aren’t shown here.

net/sched/sch_dualpi2.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/sched/sch_fq_codel.c+20−19

This diff is large: its 121 lines aren’t shown here.

net/sched/sch_fq_pie.c+10−9

This diff is large: its 29 lines aren’t shown here.

net/sched/sch_netem.c+67−56

This diff is large: its 213 lines aren’t shown here.

net/sched/sch_pie.c+6−8

This diff is large: its 55 lines aren’t shown here.

net/sched/sch_red.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_sfb.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_sfq.c+25−23

This diff is large: its 178 lines aren’t shown here.

net/sched/sch_taprio.c+8−5

This diff is large: its 46 lines aren’t shown here.

net/sctp/sm_statefuns.c+6−0

This diff is large: its 13 lines aren’t shown here.

net/sctp/socket.c+11−0

This diff is large: its 25 lines aren’t shown here.

net/shaper/shaper.c+157−67

This diff is large: its 374 lines aren’t shown here.

net/shaper/shaper_nl_gen.c+6−1

This diff is large: its 17 lines aren’t shown here.

net/shaper/shaper_nl_gen.h+2−0

This diff is large: its 9 lines aren’t shown here.

net/smc/af_smc.c+14−18

This diff is large: its 74 lines aren’t shown here.

net/smc/smc_tracepoint.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/sunrpc/cache.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/tls/tls.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/tls/tls_strp.c+6−0

This diff is large: its 13 lines aren’t shown here.

net/tls/tls_sw.c+39−17

This diff is large: its 133 lines aren’t shown here.

net/unix/af_unix.c+5−9

This diff is large: its 70 lines aren’t shown here.

net/unix/garbage.c+3−3

This diff is large: its 21 lines aren’t shown here.

net/vmw_vsock/af_vsock.c+32−17

This diff is large: its 96 lines aren’t shown here.

net/vmw_vsock/hyperv_transport.c+8−5

This diff is large: its 43 lines aren’t shown here.

net/vmw_vsock/virtio_transport_common.c+92−93

This diff is large: its 332 lines aren’t shown here.

net/vmw_vsock/vmci_transport.c+6−4

This diff is large: its 38 lines aren’t shown here.

net/wireless/nl80211.c+27−0

This diff is large: its 55 lines aren’t shown here.

net/wireless/pmsr.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/wireless/scan.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/wireless/wext-compat.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/xdp/xsk.c+74−41

This diff is large: its 200 lines aren’t shown here.

net/xdp/xsk_buff_pool.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/xdp/xskmap.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/xfrm/xfrm_input.c+12−4

This diff is large: its 38 lines aren’t shown here.

net/xfrm/xfrm_ipcomp.c+8−4

This diff is large: its 31 lines aren’t shown here.

net/xfrm/xfrm_iptfs.c+23−5

This diff is large: its 54 lines aren’t shown here.

net/xfrm/xfrm_output.c+14−6

This diff is large: its 48 lines aren’t shown here.

net/xfrm/xfrm_policy.c+9−8

This diff is large: its 46 lines aren’t shown here.

net/xfrm/xfrm_state.c+24−11

This diff is large: its 78 lines aren’t shown here.

net/xfrm/xfrm_user.c+3−3

This diff is large: its 29 lines aren’t shown here.

rust/Makefile+2−0

This diff is large: its 9 lines aren’t shown here.

rust/kernel/drm/device.rs+16−6

This diff is large: its 53 lines aren’t shown here.

rust/kernel/drm/gem/mod.rs+11−2

This diff is large: its 20 lines aren’t shown here.

rust/kernel/drm/gem/shmem.rs+2−4

This diff is large: its 13 lines aren’t shown here.

rust/pin-init/internal/src/init.rs+84−100

This diff is large: its 238 lines aren’t shown here.

rust/pin-init/src/__internal.rs+19−9

This diff is large: its 52 lines aren’t shown here.

scripts/gcc-plugins/gcc-common.h+3−1

This diff is large: its 11 lines aren’t shown here.

scripts/gdb/linux/mm.py+3−3

This diff is large: its 15 lines aren’t shown here.

scripts/gdb/linux/slab.py+2−2

This diff is large: its 18 lines aren’t shown here.

scripts/mod/file2alias.c+53−26

This diff is large: its 143 lines aren’t shown here.

scripts/package/PKGBUILD+1−1

This diff is large: its 9 lines aren’t shown here.

security/keys/keyring.c+1−0

This diff is large: its 8 lines aren’t shown here.

security/lsm_syscalls.c+8−1

This diff is large: its 16 lines aren’t shown here.

security/selinux/hooks.c+17−21

This diff is large: its 105 lines aren’t shown here.

security/selinux/include/objsec.h+1−3

This diff is large: its 11 lines aren’t shown here.

security/selinux/include/security.h+0−2

This diff is large: its 9 lines aren’t shown here.

security/selinux/selinuxfs.c+31−165

This diff is large: its 295 lines aren’t shown here.

security/selinux/ss/services.c+0−125

This diff is large: its 132 lines aren’t shown here.

sound/core/misc.c+6−2

This diff is large: its 25 lines aren’t shown here.

sound/core/oss/pcm_oss.c+34−13

This diff is large: its 93 lines aren’t shown here.

sound/core/pcm_drm_eld.c+2−2

This diff is large: its 18 lines aren’t shown here.

sound/core/pcm_lib.c+3−0

This diff is large: its 10 lines aren’t shown here.

sound/core/seq/seq_clientmgr.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/core/seq/seq_clientmgr.h+4−1

This diff is large: its 19 lines aren’t shown here.

sound/core/seq/seq_ports.c+5−2

This diff is large: its 24 lines aren’t shown here.

sound/core/seq/seq_ump_client.c+19−5

This diff is large: its 77 lines aren’t shown here.

sound/core/timer.c+14−5

This diff is large: its 50 lines aren’t shown here.

sound/drivers/aloop.c+30−13

This diff is large: its 86 lines aren’t shown here.

sound/drivers/pcmtest.c+3−3

This diff is large: its 13 lines aren’t shown here.

sound/firewire/motu/motu-register-dsp-message-parser.c+7−4

This diff is large: its 28 lines aren’t shown here.

sound/firewire/tascam/tascam-hwdep.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/hda/codecs/Makefile+0−2

This diff is large: its 16 lines aren’t shown here.

sound/hda/codecs/ca0132.c+31−13

This diff is large: its 72 lines aren’t shown here.

sound/hda/codecs/cirrus/cs420x.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/hda/codecs/conexant.c+7−1

This diff is large: its 22 lines aren’t shown here.

sound/hda/codecs/realtek/alc269.c+96−11

This diff is large: its 323 lines aren’t shown here.

sound/hda/codecs/side-codecs/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

sound/hda/codecs/side-codecs/cs35l41_hda.c+3−1

This diff is large: its 12 lines aren’t shown here.

sound/hda/codecs/side-codecs/cs35l56_hda.c+31−18

This diff is large: its 128 lines aren’t shown here.

sound/hda/codecs/side-codecs/cs35l56_hda.h+1−0

This diff is large: its 8 lines aren’t shown here.

sound/hda/codecs/side-codecs/tas2781_hda_spi.c+11−3

This diff is large: its 22 lines aren’t shown here.

sound/hda/common/auto_parser.c+2−2

This diff is large: its 18 lines aren’t shown here.

sound/hda/common/codec.c+3−0

This diff is large: its 10 lines aren’t shown here.

sound/hda/common/controller.c+7−21

This diff is large: its 59 lines aren’t shown here.

sound/hda/common/hda_controller.h+12−2

This diff is large: its 40 lines aren’t shown here.

sound/hda/controllers/intel.c+75−31

This diff is large: its 178 lines aren’t shown here.

sound/hda/controllers/intel.h+12−3

This diff is large: its 27 lines aren’t shown here.

sound/hda/core/hdmi_chmap.c+7−4

This diff is large: its 21 lines aren’t shown here.

sound/pci/asihpi/hpicmn.c+6−0

This diff is large: its 13 lines aren’t shown here.

sound/soc/amd/acp-config.c+7−0

This diff is large: its 14 lines aren’t shown here.

sound/soc/amd/acp/acp-legacy-mach.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/amd/acp/acp-mach-common.c+19−3

This diff is large: its 63 lines aren’t shown here.

sound/soc/amd/acp/acp-mach.h+4−0

This diff is large: its 11 lines aren’t shown here.

sound/soc/amd/acp/acp-sdw-legacy-mach.c+1−1

This diff is large: its 11 lines aren’t shown here.

sound/soc/amd/acp/acp-sof-mach.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/amd/yc/acp6x-mach.c+21−0

This diff is large: its 42 lines aren’t shown here.

sound/soc/codecs/Kconfig+0−3

This diff is large: its 24 lines aren’t shown here.

sound/soc/codecs/ab8500-codec.c+3−301

This diff is large: its 395 lines aren’t shown here.

sound/soc/codecs/aw88395/aw88395.c+4−5

This diff is large: its 23 lines aren’t shown here.

sound/soc/codecs/cs-amp-lib.c+12−5

This diff is large: its 40 lines aren’t shown here.

sound/soc/codecs/cs35l56-sdw.c+5−3

This diff is large: its 35 lines aren’t shown here.

sound/soc/codecs/cs35l56-shared.c+9−9

This diff is large: its 53 lines aren’t shown here.

sound/soc/codecs/cs35l56.c+16−8

This diff is large: its 69 lines aren’t shown here.

sound/soc/codecs/es8389.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/fs210x.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/pcm512x.c+3−3

This diff is large: its 27 lines aren’t shown here.

sound/soc/codecs/simple-mux.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/tas2764.c+28−8

This diff is large: its 76 lines aren’t shown here.

sound/soc/codecs/tas2770.c+24−3

This diff is large: its 65 lines aren’t shown here.

sound/soc/codecs/wcd937x.c+25−1

This diff is large: its 58 lines aren’t shown here.

sound/soc/codecs/wm_adsp_fw_find_test.c+47−10

This diff is large: its 113 lines aren’t shown here.

sound/soc/fsl/fsl_sai.c+36−7

This diff is large: its 71 lines aren’t shown here.

sound/soc/fsl/fsl_xcvr.c+13−4

This diff is large: its 35 lines aren’t shown here.

sound/soc/intel/boards/bytcht_es8316.c+27−2

This diff is large: its 75 lines aren’t shown here.

sound/soc/intel/boards/bytcr_wm5102.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/intel/boards/sof_sdw.c+8−0

This diff is large: its 15 lines aren’t shown here.

sound/soc/intel/common/soc-acpi-intel-arl-match.c+56−15

This diff is large: its 127 lines aren’t shown here.

sound/soc/intel/common/soc-acpi-intel-nvl-match.c+13−0

This diff is large: its 21 lines aren’t shown here.

sound/soc/intel/common/soc-acpi-intel-ptl-match.c+19−115

This diff is large: its 184 lines aren’t shown here.

sound/soc/intel/common/soc-acpi-intel-sdca-quirks.c+16−0

This diff is large: its 30 lines aren’t shown here.

sound/soc/intel/common/soc-acpi-intel-sdca-quirks.h+1−0

This diff is large: its 7 lines aren’t shown here.

sound/soc/qcom/qdsp6/q6apm-dai.c+6−1

This diff is large: its 14 lines aren’t shown here.

sound/soc/qcom/qdsp6/q6asm-dai.c+25−23

This diff is large: its 143 lines aren’t shown here.

sound/soc/sdw_utils/soc_sdw_utils.c+11−4

This diff is large: its 62 lines aren’t shown here.

sound/soc/soc-utils.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/sof/amd/acp.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/sof/intel/hda.c+2−1

This diff is large: its 10 lines aren’t shown here.

sound/soc/spacemit/k1_i2s.c+37−19

This diff is large: its 101 lines aren’t shown here.

sound/soc/tegra/Makefile+0−1

This diff is large: its 8 lines aren’t shown here.

sound/soc/ti/omap-dmic.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/sparc/dbri.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/usb/caiaq/device.c+3−3

This diff is large: its 29 lines aren’t shown here.

sound/usb/caiaq/input.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/usb/clock.c+11−4

This diff is large: its 23 lines aren’t shown here.

sound/usb/midi.c+7−5

This diff is large: its 23 lines aren’t shown here.

sound/usb/midi2.c+12−9

This diff is large: its 47 lines aren’t shown here.

sound/usb/misc/ua101.c+10−2

This diff is large: its 26 lines aren’t shown here.

sound/usb/mixer.c+10−0

This diff is large: its 17 lines aren’t shown here.

sound/usb/mixer_scarlett2.c+36−6

This diff is large: its 108 lines aren’t shown here.

sound/usb/qcom/qc_audio_offload.c+25−6

This diff is large: its 67 lines aren’t shown here.

sound/usb/quirks-table.h+3−1

This diff is large: its 18 lines aren’t shown here.

sound/usb/quirks.c+12−1

This diff is large: its 55 lines aren’t shown here.

sound/usb/stream.c+25−37

This diff is large: its 157 lines aren’t shown here.

sound/usb/stream.h+2−1

This diff is large: its 10 lines aren’t shown here.

tools/arch/x86/include/asm/msr-index.h+2−1

This diff is large: its 12 lines aren’t shown here.

tools/bootconfig/main.c+3−1

This diff is large: its 12 lines aren’t shown here.

tools/include/uapi/linux/stddef.h+25−1

This diff is large: its 44 lines aren’t shown here.

tools/lib/bpf/gen_loader.c+1−2

This diff is large: its 15 lines aren’t shown here.

tools/net/ynl/Makefile.deps+3−1

This diff is large: its 13 lines aren’t shown here.

tools/net/ynl/pyynl/lib/ynl.py+32−5

This diff is large: its 101 lines aren’t shown here.

tools/net/ynl/pyynl/ynl_gen_c.py+29−2

This diff is large: its 66 lines aren’t shown here.

tools/perf/Makefile+4−1

This diff is large: its 16 lines aren’t shown here.

tools/perf/Makefile.perf+8−1

This diff is large: its 37 lines aren’t shown here.

tools/perf/builtin-trace.c+3−6

This diff is large: its 23 lines aren’t shown here.

tools/perf/trace/beauty/beauty.h+3−0

This diff is large: its 10 lines aren’t shown here.

tools/perf/trace/beauty/clone.sh+4−0

This diff is large: its 9 lines aren’t shown here.

tools/perf/trace/beauty/fsmount.c+17−1

This diff is large: its 27 lines aren’t shown here.

tools/perf/trace/beauty/fsmount.sh+3−8

This diff is large: its 18 lines aren’t shown here.

tools/perf/trace/beauty/fsmount_attr.sh+22−0

This diff is large: its 23 lines aren’t shown here.

tools/perf/trace/beauty/include/linux/socket.h+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/trace/beauty/include/uapi/linux/fs.h+12−0

This diff is large: its 17 lines aren’t shown here.

tools/perf/trace/beauty/include/uapi/linux/mount.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/trace/beauty/include/uapi/linux/sched.h+15−2

This diff is large: its 36 lines aren’t shown here.

tools/sched_ext/scx_qmap.bpf.c+6−18

This diff is large: its 53 lines aren’t shown here.

tools/testing/cxl/test/cxl.c+43−62

This diff is large: its 219 lines aren’t shown here.

tools/testing/radix-tree/maple.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/arm64/gcs/gcs-util.h+0−6

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/arm64/gcs/libc-gcs.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c+4−0

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/percpu_array_inner_map.c+57−0

This diff is large: its 58 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c+103−0

This diff is large: its 117 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/sockopt_sk.c+16−1

This diff is large: its 31 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c+4−0

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/verifier.c+2−0

This diff is large: its 16 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bpf_cubic.c+14−0

This diff is large: its 41 lines aren’t shown here.

tools/testing/selftests/bpf/progs/exceptions_fail.c+22−0

This diff is large: its 29 lines aren’t shown here.

tools/testing/selftests/bpf/progs/sockopt_sk.c+16−0

This diff is large: its 30 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_misc_tcp_hdr_options.c+14−1

This diff is large: its 40 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_sockmap_ktls.c+21−0

This diff is large: its 32 lines aren’t shown here.

tools/testing/selftests/bpf/progs/verifier_call_large_imm.c+66−0

This diff is large: its 67 lines aren’t shown here.

tools/testing/selftests/cgroup/lib/cgroup_util.c+3−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/cgroup/test_cpuset_v1_base.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/cgroup/test_kmem.c+7−3

This diff is large: its 19 lines aren’t shown here.

tools/testing/selftests/drivers/net/README.rst+8−2

This diff is large: its 24 lines aren’t shown here.

tools/testing/selftests/drivers/net/hw/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/drivers/net/hw/config+5−0

This diff is large: its 16 lines aren’t shown here.

tools/testing/selftests/drivers/net/hw/ipsec_vxlan.py+204−0

This diff is large: its 205 lines aren’t shown here.

tools/testing/selftests/drivers/net/lib/py/load.py+4−1

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/drivers/net/shaper.py+22−2

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/kselftest.h+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kselftest_harness.h+6−6

This diff is large: its 54 lines aren’t shown here.

tools/testing/selftests/kvm/access_tracking_perf_test.c+23−23

This diff is large: its 121 lines aren’t shown here.

tools/testing/selftests/kvm/arch_timer.c+3−3

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/aarch32_id_regs.c+7−7

This diff is large: its 49 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/arch_timer.c+4−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c+80−81

This diff is large: its 450 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/debug-exceptions.c+35−37

This diff is large: its 210 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/hypercalls.c+12−12

This diff is large: its 71 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/idreg-idst.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/no-vgic.c+4−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/page_fault_test.c+41−41

This diff is large: its 277 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/psci_test.c+12−14

This diff is large: its 104 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/sea_to_user.c+19−22

This diff is large: its 114 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/set_id_regs.c+35−35

This diff is large: its 211 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/smccc_filter.c+5−5

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/vgic_init.c+28−28

This diff is large: its 204 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/vgic_irq.c+69−68

This diff is large: its 429 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c+10−10

This diff is large: its 57 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/vgic_v5.c+5−5

This diff is large: its 40 lines aren’t shown here.

tools/testing/selftests/kvm/arm64/vpmu_counter_access.c+28−28

This diff is large: its 189 lines aren’t shown here.

tools/testing/selftests/kvm/coalesced_io_test.c+19−19

This diff is large: its 123 lines aren’t shown here.

tools/testing/selftests/kvm/demand_paging_test.c+5−5

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/kvm/dirty_log_perf_test.c+7−7

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/kvm/dirty_log_test.c+41−41

This diff is large: its 241 lines aren’t shown here.

tools/testing/selftests/kvm/get-reg-list.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/guest_memfd_test.c+17−12

This diff is large: its 106 lines aren’t shown here.

tools/testing/selftests/kvm/guest_print_test.c+11−11

This diff is large: its 42 lines aren’t shown here.

tools/testing/selftests/kvm/hardware_disable_test.c+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/arch_timer.h+15−15

This diff is large: its 100 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/delay.h+2−2

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/gic.h+4−4

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/gic_v3_its.h+3−4

This diff is large: its 15 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/processor.h+11−11

This diff is large: its 57 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/ucall.h+2−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/kvm/include/arm64/vgic.h+11−11

This diff is large: its 39 lines aren’t shown here.

tools/testing/selftests/kvm/include/kvm_syscalls.h+10−0

This diff is large: its 19 lines aren’t shown here.

tools/testing/selftests/kvm/include/kvm_util.h+166−180

This diff is large: its 806 lines aren’t shown here.

tools/testing/selftests/kvm/include/kvm_util_types.h+5−3

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/kvm/include/loongarch/arch_timer.h+2−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/kvm/include/loongarch/ucall.h+2−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/kvm/include/memstress.h+15−15

This diff is large: its 73 lines aren’t shown here.

tools/testing/selftests/kvm/include/riscv/arch_timer.h+11−11

This diff is large: its 55 lines aren’t shown here.

tools/testing/selftests/kvm/include/riscv/processor.h+4−5

This diff is large: its 28 lines aren’t shown here.

tools/testing/selftests/kvm/include/riscv/ucall.h+2−2

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/kvm/include/s390/diag318_test_handler.h+1−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/kvm/include/s390/facility.h+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/include/s390/ucall.h+2−2

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/kvm/include/sparsebit.h+3−3

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/kvm/include/test_util.h+22−20

This diff is large: its 121 lines aren’t shown here.

tools/testing/selftests/kvm/include/timer_test.h+9−9

This diff is large: its 31 lines aren’t shown here.

tools/testing/selftests/kvm/include/ucall_common.h+11−11

This diff is large: its 46 lines aren’t shown here.

tools/testing/selftests/kvm/include/userfaultfd_util.h+3−3

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/apic.h+11−11

This diff is large: its 54 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/evmcs.h+11−11

This diff is large: its 73 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/hyperv.h+14−14

This diff is large: its 67 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/kvm_util_arch.h+18−18

This diff is large: its 59 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/pmu.h+5−4

This diff is large: its 29 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/processor.h+144−148

This diff is large: its 726 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/sev.h+10−10

This diff is large: its 53 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/smm.h+1−2

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/svm_util.h+6−6

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/ucall.h+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86/vmx.h+35−35

This diff is large: its 189 lines aren’t shown here.

tools/testing/selftests/kvm/kvm_page_table_test.c+27−27

This diff is large: its 156 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/gic.c+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/gic_private.h+13−13

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/gic_v3.c+45−45

This diff is large: its 258 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/gic_v3_its.c+5−6

This diff is large: its 39 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/processor.c+82−83

This diff is large: its 407 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/ucall.c+6−6

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/kvm/lib/arm64/vgic.c+20−20

This diff is large: its 105 lines aren’t shown here.

tools/testing/selftests/kvm/lib/assert.c+7−1

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/kvm/lib/elf.c+9−10

This diff is large: its 39 lines aren’t shown here.

tools/testing/selftests/kvm/lib/guest_modes.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/lib/guest_sprintf.c+9−9

This diff is large: its 58 lines aren’t shown here.

tools/testing/selftests/kvm/lib/kvm_util.c+145−216

This diff is large: its 874 lines aren’t shown here.

tools/testing/selftests/kvm/lib/loongarch/processor.c+55−55

This diff is large: its 267 lines aren’t shown here.

tools/testing/selftests/kvm/lib/loongarch/ucall.c+6−6

This diff is large: its 35 lines aren’t shown here.

tools/testing/selftests/kvm/lib/memstress.c+19−19

This diff is large: its 118 lines aren’t shown here.

tools/testing/selftests/kvm/lib/riscv/processor.c+45−46

This diff is large: its 246 lines aren’t shown here.

tools/testing/selftests/kvm/lib/s390/diag318_test_handler.c+6−6

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/kvm/lib/s390/facility.c+1−1

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/kvm/lib/s390/processor.c+31−34

This diff is large: its 171 lines aren’t shown here.

tools/testing/selftests/kvm/lib/sparsebit.c+9−9

This diff is large: its 49 lines aren’t shown here.

tools/testing/selftests/kvm/lib/test_util.c+15−15

This diff is large: its 94 lines aren’t shown here.

tools/testing/selftests/kvm/lib/ucall_common.c+17−17

This diff is large: its 108 lines aren’t shown here.

tools/testing/selftests/kvm/lib/userfaultfd_util.c+7−7

This diff is large: its 50 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/apic.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/hyperv.c+7−7

This diff is large: its 41 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/memstress.c+7−7

This diff is large: its 63 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/pmu.c+4−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/processor.c+142−150

This diff is large: its 726 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/sev.c+10−10

This diff is large: its 77 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/svm.c+8−8

This diff is large: its 52 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/ucall.c+2−2

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86/vmx.c+22−22

This diff is large: its 159 lines aren’t shown here.

tools/testing/selftests/kvm/loongarch/arch_timer.c+14−14

This diff is large: its 74 lines aren’t shown here.

tools/testing/selftests/kvm/loongarch/pmu_test.c+5−5

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/kvm/memslot_modification_stress_test.c+5−5

This diff is large: its 32 lines aren’t shown here.

tools/testing/selftests/kvm/memslot_perf_test.c+83−83

This diff is large: its 468 lines aren’t shown here.

tools/testing/selftests/kvm/mmu_stress_test.c+14−14

This diff is large: its 98 lines aren’t shown here.

tools/testing/selftests/kvm/pre_fault_memory_test.c+6−6

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/kvm/riscv/arch_timer.c+4−4

This diff is large: its 30 lines aren’t shown here.

tools/testing/selftests/kvm/riscv/ebreak_test.c+3−3

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/kvm/riscv/get-reg-list.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/riscv/sbi_pmu_test.c+4−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/kvm/s390/debug_test.c+4−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/kvm/s390/irq_routing.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/s390/memop.c+47−47

This diff is large: its 243 lines aren’t shown here.

tools/testing/selftests/kvm/s390/resets.c+3−3

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/kvm/s390/shared_zeropage_test.c+2−3

This diff is large: its 19 lines aren’t shown here.

tools/testing/selftests/kvm/s390/tprot.c+13−13

This diff is large: its 88 lines aren’t shown here.

tools/testing/selftests/kvm/s390/ucontrol_test.c+4−4

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/kvm/set_memory_region_test.c+21−21

This diff is large: its 137 lines aren’t shown here.

tools/testing/selftests/kvm/steal_time.c+44−37

This diff is large: its 260 lines aren’t shown here.

tools/testing/selftests/kvm/system_counter_offset_test.c+6−6

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/kvm/x86/amx_test.c+7−7

This diff is large: its 42 lines aren’t shown here.

tools/testing/selftests/kvm/x86/aperfmperf_test.c+8−8

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/kvm/x86/apic_bus_clock_test.c+16−12

This diff is large: its 75 lines aren’t shown here.

tools/testing/selftests/kvm/x86/cpuid_test.c+3−3

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/kvm/x86/debug_regs.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c+8−8

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c+3−3

This diff is large: its 25 lines aren’t shown here.

tools/testing/selftests/kvm/x86/fastops_test.c+26−26

This diff is large: its 135 lines aren’t shown here.

tools/testing/selftests/kvm/x86/feature_msrs_test.c+6−6

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/kvm/x86/fix_hypercall_test.c+10−10

This diff is large: its 47 lines aren’t shown here.

tools/testing/selftests/kvm/x86/flds_emulation.h+3−3

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hwcr_msr_test.c+5−5

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_clock.c+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_evmcs.c+5−5

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_extended_hypercalls.c+10−10

This diff is large: its 55 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_features.c+13−13

This diff is large: its 85 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_ipi.c+6−6

This diff is large: its 52 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_svm_test.c+5−5

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/kvm/x86/hyperv_tlb_flush.c+18−18

This diff is large: its 97 lines aren’t shown here.

tools/testing/selftests/kvm/x86/kvm_buslock_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/kvm_clock_test.c+7−7

This diff is large: its 49 lines aren’t shown here.

tools/testing/selftests/kvm/x86/kvm_pv_test.c+5−5

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/kvm/x86/monitor_mwait_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_close_kvm_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_dirty_log_test.c+5−5

This diff is large: its 32 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_emulation_test.c+10−10

This diff is large: its 50 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_exceptions_test.c+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_invalid_cr3_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_set_state_test.c+2−2

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_tsc_adjust_test.c+6−6

This diff is large: its 48 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c+13−13

This diff is large: its 62 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/nx_huge_pages_test.c+9−9

This diff is large: its 51 lines aren’t shown here.

tools/testing/selftests/kvm/x86/platform_info_test.c+3−3

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/kvm/x86/pmu_counters_test.c+54−55

This diff is large: its 296 lines aren’t shown here.

tools/testing/selftests/kvm/x86/pmu_event_filter_test.c+51−51

This diff is large: its 291 lines aren’t shown here.

tools/testing/selftests/kvm/x86/private_mem_conversions_test.c+39−39

This diff is large: its 220 lines aren’t shown here.

tools/testing/selftests/kvm/x86/private_mem_kvm_exits_test.c+7−7

This diff is large: its 49 lines aren’t shown here.

tools/testing/selftests/kvm/x86/set_boot_cpu_id.c+3−3

This diff is large: its 23 lines aren’t shown here.

tools/testing/selftests/kvm/x86/set_sregs_test.c+3−3

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/kvm/x86/sev_init2_tests.c+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/kvm/x86/sev_smoke_test.c+11−11

This diff is large: its 81 lines aren’t shown here.

tools/testing/selftests/kvm/x86/smaller_maxphyaddr_emulation_test.c+4−4

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/kvm/x86/smm_test.c+4−4

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/kvm/x86/state_test.c+7−7

This diff is large: its 42 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_int_ctl_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_lbr_nested_state.c+1−1

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_nested_clear_efer_svme.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_nested_shutdown_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_nested_soft_inject_test.c+5−5

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_nested_vmcb12_gpa.c+7−7

This diff is large: its 60 lines aren’t shown here.

tools/testing/selftests/kvm/x86/svm_vmcall_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/sync_regs_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/triple_fault_event_test.c+2−2

This diff is large: its 16 lines aren’t shown here.

tools/testing/selftests/kvm/x86/tsc_msrs_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/tsc_scaling_sync.c+2−2

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/kvm/x86/ucna_injection_test.c+23−22

This diff is large: its 120 lines aren’t shown here.

tools/testing/selftests/kvm/x86/userspace_io_test.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/x86/userspace_msr_exit_test.c+29−29

This diff is large: its 211 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_apic_access_test.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_apicv_updates_test.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_msrs_test.c+10−12

This diff is large: its 61 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_pmu_caps_test.c+6−6

This diff is large: its 47 lines aren’t shown here.

tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/x86/xapic_ipi_test.c+32−32

This diff is large: its 134 lines aren’t shown here.

tools/testing/selftests/kvm/x86/xapic_state_test.c+10−10

This diff is large: its 75 lines aren’t shown here.

tools/testing/selftests/kvm/x86/xapic_tpr_test.c+12−12

This diff is large: its 86 lines aren’t shown here.

tools/testing/selftests/kvm/x86/xcr0_cpuid_test.c+4−4

This diff is large: its 29 lines aren’t shown here.

tools/testing/selftests/kvm/x86/xen_shinfo_test.c+11−11

This diff is large: its 60 lines aren’t shown here.

tools/testing/selftests/kvm/x86/xss_msr_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/mm/config+1−0

This diff is large: its 5 lines aren’t shown here.

tools/testing/selftests/mm/hmm-tests.c+50−0

This diff is large: its 57 lines aren’t shown here.

tools/testing/selftests/mm/run_vmtests.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh+29−1

This diff is large: its 44 lines aren’t shown here.

tools/testing/selftests/net/ioam6.sh+1−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/net/lib/xdp_native.bpf.c+30−25

This diff is large: its 126 lines aren’t shown here.

tools/testing/selftests/net/link_netns.py+59−2

This diff is large: its 88 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_connect.sh+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_join.sh+31−0

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_lib.sh+15−11

This diff is large: its 70 lines aren’t shown here.

tools/testing/selftests/net/mptcp/pm_netlink.sh+13−7

This diff is large: its 56 lines aren’t shown here.

tools/testing/selftests/net/netfilter/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/net/netfilter/nft_fib_nexthop.sh+152−0

This diff is large: its 153 lines aren’t shown here.

tools/testing/selftests/net/openvswitch/openvswitch.sh+37−0

This diff is large: its 51 lines aren’t shown here.

tools/testing/selftests/net/openvswitch/ovs-dpctl.py+13−6

This diff is large: its 77 lines aren’t shown here.

tools/testing/selftests/net/ovpn/test-close-socket.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/ovpn/test-mark.sh+3−3

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/net/ovpn/test.sh+4−4

This diff is large: its 31 lines aren’t shown here.

tools/testing/selftests/net/rds/config+1−0

This diff is large: its 5 lines aren’t shown here.

tools/testing/selftests/net/rtnetlink.sh+63−0

This diff is large: its 84 lines aren’t shown here.

tools/testing/selftests/net/tcp_ecmp_failover.sh+216−0

This diff is large: its 217 lines aren’t shown here.

tools/testing/selftests/net/tls.c+43−0

This diff is large: its 50 lines aren’t shown here.

tools/testing/selftests/rdma/rxe_ipv6.sh+4−2

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/rdma/rxe_rping_between_netns.sh+7−0

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/rdma/rxe_socket_with_netns.sh+6−0

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/rdma/rxe_test_NETDEV_UNREGISTER.sh+4−2

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/rseq/Makefile+15−6

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/rseq/check_optimized.c+17−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/rseq/legacy_check.c+65−0

This diff is large: its 66 lines aren’t shown here.

tools/testing/selftests/rseq/param_test.c+16−9

This diff is large: its 112 lines aren’t shown here.

tools/testing/selftests/rseq/rseq-abi.h+6−1

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/rseq/rseq.c+18−21

This diff is large: its 89 lines aren’t shown here.

tools/testing/selftests/rseq/rseq.h+7−1

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/rseq/run_legacy_check.sh+4−0

This diff is large: its 5 lines aren’t shown here.

tools/testing/selftests/rseq/run_param_test.sh+39−0

This diff is large: its 53 lines aren’t shown here.

tools/testing/selftests/rseq/run_timeslice_test.sh+14−0

This diff is large: its 15 lines aren’t shown here.

tools/testing/selftests/rseq/slice_test.c+7−5

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/sched_ext/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/sched_ext/dequeue.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf.c+44−0

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/sched_ext/non_scx_kfunc_deny.c+47−0

This diff is large: its 48 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json+615−1

This diff is large: its 622 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json+192−2

This diff is large: its 214 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json+23−73

This diff is large: its 108 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json+26−0

This diff is large: its 32 lines aren’t shown here.

tools/testing/selftests/ublk/kublk.c+11−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/vma/include/dup.h+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/vma/include/stubs.h+2−1

This diff is large: its 10 lines aren’t shown here.

virt/kvm/dirty_ring.c+2−1

This diff is large: its 10 lines aren’t shown here.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t