History

Merge remote-tracking branch 'wireless/main' into wireless-next

Pull in wireless/main content since some new code would otherwise conflict with it.

Johannes Berg committed 4 years ago

Commit dfd2d872 parents a790cc3 10d5ea51238 files · +50310 −13759Browse files

Unified · Split

1238 files
  1. .gitignore +6 −0
  2. .rustfmt.toml +12 −0
  3. Documentation/ABI/testing/sysfs-bus-bcma +1 −1
  4. Documentation/ABI/testing/sysfs-bus-fcoe +1 −1
  5. Documentation/ABI/testing/sysfs-bus-iio-proximity +1 −1
  6. Documentation/ABI/testing/sysfs-devices-system-cpu +1 −1
  7. Documentation/ABI/testing/sysfs-platform-chipidea-usb2 +3 −3
  8. Documentation/ABI/testing/sysfs-power +1 −1
  9. Documentation/RCU/checklist.rst +13 −4
  10. Documentation/RCU/lockdep.rst +1 −1
  11. Documentation/RCU/rcu_dereference.rst +10 −4
  12. Documentation/RCU/whatisRCU.rst +30 −17
  13. Documentation/admin-guide/README.rst +7 −84
  14. Documentation/admin-guide/acpi/dsdt-override.rst +0 −13
  15. Documentation/admin-guide/hw-vuln/spectre.rst +1 −0
  16. Documentation/admin-guide/kdump/vmcoreinfo.rst +1 −1
  17. Documentation/admin-guide/kernel-parameters.txt +4 −0
  18. Documentation/admin-guide/mm/hugetlbpage.rst +1 −1
  19. Documentation/admin-guide/sysctl/net.rst +3 −0
  20. Documentation/admin-guide/tainted-kernels.rst +6 −0
  21. Documentation/bpf/clang-notes.rst +30 −0
  22. Documentation/bpf/index.rst +2 −0
  23. Documentation/bpf/instruction-set.rst +140 −178
  24. Documentation/bpf/kfuncs.rst +16 −8
  25. Documentation/bpf/linux-notes.rst +53 −0
  26. Documentation/bpf/map_cgroup_storage.rst +2 −2
  27. Documentation/conf.py +40 −2
  28. Documentation/core-api/asm-annotations.rst +4 −3
  29. Documentation/core-api/cpu_hotplug.rst +1 −1
  30. Documentation/core-api/index.rst +4 −0
  31. Documentation/core-api/irq/irq-domain.rst +1 −1
  32. Documentation/core-api/printk-formats.rst +10 −0
  33. Documentation/core-api/wrappers/atomic_bitops.rst +18 −0
  34. Documentation/core-api/wrappers/atomic_t.rst +19 −0
  35. Documentation/core-api/wrappers/memory-barriers.rst +18 −0
  36. Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml +7 −0
  37. Documentation/devicetree/bindings/net/ethernet-phy.yaml +6 −0
  38. Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml +3 −3
  39. Documentation/devicetree/bindings/net/pse-pd/podl-pse-regulator.yaml +40 −0
  40. Documentation/devicetree/bindings/net/pse-pd/pse-controller.yaml +33 −0
  41. Documentation/doc-guide/kernel-doc.rst +3 −0
  42. Documentation/doc-guide/sphinx.rst +53 −4
  43. Documentation/driver-api/driver-model/devres.rst +6 −1
  44. Documentation/driver-api/isa.rst +1 −1
  45. Documentation/fb/udlfb.rst +15 −8
  46. Documentation/filesystems/caching/backend-api.rst +1 −1
  47. Documentation/filesystems/ext4/super.rst +3 −3
  48. Documentation/filesystems/f2fs.rst +2 −3
  49. Documentation/filesystems/idmappings.rst +1 −1
  50. Documentation/filesystems/qnx6.rst +1 −1
  51. Documentation/filesystems/spufs/spufs.rst +1 −1
  52. Documentation/filesystems/xfs-delayed-logging-design.rst +9 −9
  53. Documentation/firmware-guide/acpi/enumeration.rst +8 −8
  54. Documentation/firmware-guide/acpi/osi.rst +11 −14
  55. Documentation/index.rst +51 −106
  56. Documentation/kbuild/gcc-plugins.rst +18 −1
  57. Documentation/kbuild/kbuild.rst +17 −0
  58. Documentation/kbuild/makefiles.rst +46 −4
  59. Documentation/locking/seqlock.rst +1 −1
  60. Documentation/memory-barriers.txt +95 −82
  61. Documentation/mm/unevictable-lru.rst +3 −3
  62. Documentation/networking/ethtool-netlink.rst +59 −0
  63. Documentation/process/5.Posting.rst +4 −2
  64. Documentation/process/changes.rst +41 −0
  65. Documentation/process/code-of-conduct-interpretation.rst +14 −12
  66. Documentation/process/coding-style.rst +62 −0
  67. Documentation/process/deprecated.rst +7 −4
  68. Documentation/process/index.rst +1 −0
  69. Documentation/process/maintainer-pgp-guide.rst +142 −144
  70. Documentation/process/stable-kernel-rules.rst +6 −0
  71. Documentation/process/submitting-patches.rst +2 −2
  72. Documentation/rust/arch-support.rst +19 −0
  73. Documentation/rust/coding-guidelines.rst +216 −0
  74. Documentation/rust/general-information.rst +79 −0
  75. Documentation/rust/index.rst +22 −0
  76. Documentation/rust/quick-start.rst +232 −0
  77. Documentation/scheduler/sched-design-CFS.rst +1 −1
  78. Documentation/security/landlock.rst +4 −4
  79. Documentation/staging/index.rst +0 −42
  80. Documentation/subsystem-apis.rst +58 −0
  81. Documentation/trace/histogram.rst +1 −1
  82. Documentation/trace/kprobes.rst +2 −2
  83. Documentation/trace/timerlat-tracer.rst +1 −1
  84. Documentation/translations/zh_CN/IRQ.txt +0 −39
  85. Documentation/translations/zh_CN/PCI/acpi-info.rst +139 −0
  86. Documentation/translations/zh_CN/PCI/index.rst +5 −8
  87. Documentation/translations/zh_CN/admin-guide/README.rst +22 −79
  88. Documentation/translations/zh_CN/admin-guide/bootconfig.rst +293 −0
  89. Documentation/translations/zh_CN/admin-guide/index.rst +1 −1
  90. Documentation/translations/zh_CN/core-api/circular-buffers.rst +210 −0
  91. Documentation/translations/zh_CN/core-api/generic-radix-tree.rst +23 −0
  92. Documentation/translations/zh_CN/core-api/idr.rst +80 −0
  93. Documentation/translations/zh_CN/core-api/index.rst +4 −4
  94. Documentation/translations/zh_CN/core-api/packing.rst +160 −0
  95. Documentation/translations/zh_CN/devicetree/changesets.rst +37 −0
  96. Documentation/translations/zh_CN/devicetree/dynamic-resolution-notes.rst +31 −0
  97. Documentation/translations/zh_CN/devicetree/index.rst +4 −9
  98. Documentation/translations/zh_CN/devicetree/kernel-api.rst +58 −0
  99. Documentation/translations/zh_CN/devicetree/overlay-notes.rst +140 −0
  100. Documentation/translations/zh_CN/driver-api/gpio/index.rst +69 −0
  101. Documentation/translations/zh_CN/driver-api/gpio/legacy.rst +114 −70
  102. Documentation/translations/zh_CN/driver-api/index.rst +132 −0
  103. Documentation/translations/zh_CN/driver-api/io_ordering.rst +60 −0
  104. Documentation/translations/zh_CN/index.rst +2 −2
  105. Documentation/translations/zh_CN/io_ordering.txt +0 −67
  106. Documentation/translations/zh_CN/oops-tracing.txt +0 −212
  107. Documentation/translations/zh_CN/process/coding-style.rst +202 −72
  108. Documentation/translations/zh_CN/process/email-clients.rst +172 −93
  109. Documentation/translations/zh_CN/process/submit-checklist.rst +45 −39
  110. Documentation/translations/zh_CN/process/submitting-patches.rst +357 −357
  111. Documentation/translations/zh_CN/scheduler/sched-design-CFS.rst +1 −1
  112. Documentation/translations/zh_TW/oops-tracing.txt +0 −212
  113. Documentation/userspace-api/landlock.rst +17 −16
  114. Documentation/virt/kvm/x86/mmu.rst +1 −1
  115. Documentation/w1/masters/ds2490.rst +1 −1
  116. Documentation/w1/w1-generic.rst +1 −1
  117. Documentation/x86/entry_64.rst +2 −2
  118. Documentation/x86/microcode.rst +107 −9
  119. MAINTAINERS +21 −5
  120. Makefile +167 −24
  121. arch/Kconfig +11 −13
  122. arch/alpha/include/asm/a.out.h +0 −16
  123. arch/alpha/kernel/Makefile +0 −4
  124. arch/alpha/kernel/binfmt_loader.c +0 −46
  125. arch/alpha/kernel/osf_sys.c +0 −30
  126. arch/arm/boot/compressed/misc.c +2 −0
  127. arch/arm/boot/compressed/vmlinux.lds.S +2 −0
  128. arch/arm/configs/badge4_defconfig +0 −1
  129. arch/arm/configs/corgi_defconfig +0 −1
  130. arch/arm/configs/ezx_defconfig +0 −1
  131. arch/arm/configs/footbridge_defconfig +0 −1
  132. arch/arm/configs/hackkit_defconfig +0 −1
  133. arch/arm/configs/iop32x_defconfig +0 −1
  134. arch/arm/configs/jornada720_defconfig +0 −1
  135. arch/arm/configs/lart_defconfig +0 −1
  136. arch/arm/configs/neponset_defconfig +0 −1
  137. arch/arm/configs/netwinder_defconfig +0 −1
  138. arch/arm/configs/rpc_defconfig +0 −1
  139. arch/arm/configs/spitz_defconfig +0 −1
  140. arch/arm/mm/dump.c +1 −1
  141. arch/arm/mm/mmu.c +4 −0
  142. arch/arm64/crypto/ghash-ce-core.S +3 −2
  143. arch/arm64/crypto/sm3-ce-core.S +2 −1
  144. arch/arm64/include/asm/brk-imm.h +6 −0
  145. arch/arm64/include/asm/ftrace.h +1 −1
  146. arch/arm64/include/asm/linkage.h +4 −0
  147. arch/arm64/include/asm/mmu_context.h +2 −2
  148. arch/arm64/kernel/acpi_parking_protocol.c +1 −1
  149. arch/arm64/kernel/alternative.c +1 −1
  150. arch/arm64/kernel/cpu-reset.S +3 −2
  151. arch/arm64/kernel/cpufeature.c +2 −2
  152. arch/arm64/kernel/ftrace.c +1 −1
  153. arch/arm64/kernel/machine_kexec.c +1 −1
  154. arch/arm64/kernel/psci.c +1 −1
  155. arch/arm64/kernel/smp_spin_table.c +1 −1
  156. arch/arm64/kernel/traps.c +44 −3
  157. arch/arm64/kernel/vdso/Makefile +2 −1
  158. arch/arm64/mm/proc.S +3 −2
  159. arch/arm64/net/bpf_jit_comp.c +7 −1
  160. arch/loongarch/Kconfig +0 −1
  161. arch/loongarch/kernel/dma.c +21 −31
  162. arch/loongarch/kernel/setup.c +1 −1
  163. arch/m68k/Kconfig +1 −1
  164. arch/m68k/configs/amiga_defconfig +2 −2
  165. arch/m68k/configs/apollo_defconfig +2 −2
  166. arch/m68k/configs/atari_defconfig +2 −2
  167. arch/m68k/configs/bvme6000_defconfig +2 −2
  168. arch/m68k/configs/hp300_defconfig +2 −2
  169. arch/m68k/configs/mac_defconfig +2 −2
  170. arch/m68k/configs/multi_defconfig +2 −2
  171. arch/m68k/configs/mvme147_defconfig +2 −2
  172. arch/m68k/configs/mvme16x_defconfig +2 −2
  173. arch/m68k/configs/q40_defconfig +2 −2
  174. arch/m68k/configs/sun3_defconfig +2 −2
  175. arch/m68k/configs/sun3x_defconfig +2 −2
  176. arch/m68k/include/uapi/asm/bootinfo-virt.h +2 −7
  177. arch/m68k/include/uapi/asm/bootinfo.h +7 −0
  178. arch/m68k/kernel/setup_mm.c +16 −3
  179. arch/m68k/virt/config.c +0 −11
  180. arch/mips/bcm47xx/prom.c +2 −2
  181. arch/mips/boot/dts/brcm/bcm63268.dtsi +12 −6
  182. arch/mips/boot/dts/lantiq/Makefile +1 −1
  183. arch/mips/boot/dts/lantiq/danube_easy50712.dts +0 −0
  184. arch/mips/cavium-octeon/oct_ilm.c +3 −14
  185. arch/mips/cavium-octeon/setup.c +1 −1
  186. arch/mips/configs/ar7_defconfig +0 −4
  187. arch/mips/configs/ath25_defconfig +0 −4
  188. arch/mips/configs/ath79_defconfig +0 −10
  189. arch/mips/configs/bcm63xx_defconfig +0 −3
  190. arch/mips/configs/bigsur_defconfig +0 −9
  191. arch/mips/configs/bmips_be_defconfig +0 −3
  192. arch/mips/configs/bmips_stb_defconfig +2 −21
  193. arch/mips/configs/cavium_octeon_defconfig +0 −1
  194. arch/mips/configs/db1xxx_defconfig +0 −1
  195. arch/mips/configs/decstation_64_defconfig +0 −10
  196. arch/mips/configs/decstation_defconfig +0 −10
  197. arch/mips/configs/decstation_r4k_defconfig +0 −10
  198. arch/mips/configs/fuloong2e_defconfig +0 −9
  199. arch/mips/configs/generic/board-ocelot.config +0 −1
  200. arch/mips/configs/gpr_defconfig +0 −8
  201. arch/mips/configs/ip22_defconfig +0 −10
  202. arch/mips/configs/ip27_defconfig +0 −19
  203. arch/mips/configs/ip28_defconfig +0 −3
  204. arch/mips/configs/ip32_defconfig +0 −2
  205. arch/mips/configs/jazz_defconfig +0 −1
  206. arch/mips/configs/lemote2f_defconfig +0 −9
  207. arch/mips/configs/loongson1b_defconfig +0 −4
  208. arch/mips/configs/loongson1c_defconfig +0 −4
  209. arch/mips/configs/loongson2k_defconfig +0 −3
  210. arch/mips/configs/loongson3_defconfig +0 −2
  211. arch/mips/configs/malta_defconfig +0 −5
  212. arch/mips/configs/malta_kvm_defconfig +0 −5
  213. arch/mips/configs/malta_qemu_32r6_defconfig +0 −3
  214. arch/mips/configs/maltaaprp_defconfig +0 −3
  215. arch/mips/configs/maltasmvp_defconfig +0 −3
  216. arch/mips/configs/maltasmvp_eva_defconfig +0 −3
  217. arch/mips/configs/maltaup_defconfig +0 −3
  218. arch/mips/configs/maltaup_xpa_defconfig +0 −5
  219. arch/mips/configs/mtx1_defconfig +0 −10
  220. arch/mips/configs/omega2p_defconfig +0 −3
  221. arch/mips/configs/pic32mzda_defconfig +0 −1
  222. arch/mips/configs/rb532_defconfig +0 −4
  223. arch/mips/configs/rbtx49xx_defconfig +0 −7
  224. arch/mips/configs/rm200_defconfig +0 −7
  225. arch/mips/configs/rt305x_defconfig +0 −4
  226. arch/mips/configs/sb1250_swarm_defconfig +0 −2
  227. arch/mips/configs/vocore2_defconfig +0 −3
  228. arch/mips/configs/xway_defconfig +0 −4
  229. arch/mips/include/asm/irq.h +0 −4
  230. arch/mips/include/asm/mach-ar7/ar7.h +0 −2
  231. arch/mips/include/asm/octeon/cvmx-fpa.h +0 −20
  232. arch/mips/include/asm/octeon/octeon.h +0 −1
  233. arch/mips/include/asm/octeon/pci-octeon.h +0 −2
  234. arch/mips/include/asm/sibyte/sb1250.h +0 −1
  235. arch/mips/include/asm/sni.h +0 −3
  236. arch/mips/kernel/prom.c +3 −3
  237. arch/mips/kernel/relocate.c +1 −1
  238. arch/mips/kernel/segment.c +2 −13
  239. arch/mips/kernel/setup.c +21 −0
  240. arch/mips/lantiq/prom.c +24 −2
  241. arch/mips/lantiq/xway/vmmc.c +15 −9
  242. arch/mips/lib/bswapdi.c +5 −9
  243. arch/mips/lib/bswapsi.c +5 −5
  244. arch/mips/loongson2ef/common/pci.c +0 −2
  245. arch/mips/math-emu/cp1emu.c +1 −1
  246. arch/mips/pci/pci-ar2315.c +1 −1
  247. arch/mips/pci/pci-lantiq.c +13 −15
  248. arch/mips/pic32/pic32mzda/init.c +1 −1
  249. arch/mips/ralink/bootrom.c +2 −13
  250. arch/mips/sgi-ip27/ip27-xtalk.c +50 −20
  251. arch/mips/sgi-ip30/ip30-xtalk.c +50 −20
  252. arch/mips/sibyte/sb1250/irq.c +0 −6
  253. arch/sh/include/asm/sections.h +1 −1
  254. arch/sh/kernel/machvec.c +5 −5
  255. arch/sparc/include/asm/smp_32.h +6 −9
  256. arch/sparc/kernel/leon_smp.c +7 −5
  257. arch/sparc/kernel/sun4d_smp.c +7 −5
  258. arch/sparc/kernel/sun4m_smp.c +6 −4
  259. arch/sparc/mm/srmmu.c +13 −16
  260. arch/um/Kconfig +1 −0
  261. arch/um/os-Linux/user_syms.c +1 −0
  262. arch/x86/Kconfig +11 −2
  263. arch/x86/Makefile +10 −0
  264. arch/x86/boot/bitops.h +2 −2
  265. arch/x86/crypto/blowfish-x86_64-asm_64.S +3 −2
  266. arch/x86/entry/vdso/Makefile +2 −1
  267. arch/x86/events/intel/core.c +39 −1
  268. arch/x86/events/intel/ds.c +7 −2
  269. arch/x86/events/perf_event.h +2 −0
  270. arch/x86/include/asm/acrn.h +14 −0
  271. arch/x86/include/asm/bitops.h +33 −21
  272. arch/x86/include/asm/cfi.h +22 −0
  273. arch/x86/include/asm/cpu.h +2 −0
  274. arch/x86/include/asm/linkage.h +12 −0
  275. arch/x86/include/asm/mc146818rtc.h +1 −1
  276. arch/x86/include/asm/mce.h +1 −0
  277. arch/x86/include/asm/microcode.h +1 −3
  278. arch/x86/include/asm/msr-index.h +13 −0
  279. arch/x86/include/asm/paravirt.h +1 −0
  280. arch/x86/include/asm/paravirt_types.h +19 −9
  281. arch/x86/include/asm/resctrl.h +9 −0
  282. arch/x86/include/asm/smp.h +15 −10
  283. arch/x86/include/asm/uaccess.h +8 −8
  284. arch/x86/include/asm/uaccess_64.h +45 −0
  285. arch/x86/kernel/Makefile +2 −0
  286. arch/x86/kernel/alternative.c +32 −22
  287. arch/x86/kernel/amd_gart_64.c +1 −1
  288. arch/x86/kernel/aperture_64.c +1 −1
  289. arch/x86/kernel/apic/apic.c +40 −4
  290. arch/x86/kernel/cfi.c +86 −0
  291. arch/x86/kernel/cpu/acrn.c +3 −0
  292. arch/x86/kernel/cpu/feat_ctl.c +1 −1
  293. arch/x86/kernel/cpu/mce/apei.c +12 −1
  294. arch/x86/kernel/cpu/microcode/amd.c +2 −8
  295. arch/x86/kernel/cpu/microcode/core.c +3 −2
  296. arch/x86/kernel/cpu/microcode/intel.c +0 −17
  297. arch/x86/kernel/cpu/resctrl/core.c +38 −79
  298. arch/x86/kernel/cpu/resctrl/ctrlmondata.c +52 −23
  299. arch/x86/kernel/cpu/resctrl/internal.h +24 −37
  300. arch/x86/kernel/cpu/resctrl/monitor.c +150 −82
  301. arch/x86/kernel/cpu/resctrl/pseudo_lock.c +10 −4
  302. arch/x86/kernel/cpu/resctrl/rdtgroup.c +180 −36
  303. arch/x86/kernel/cpu/sgx/encl.c +14 −7
  304. arch/x86/kernel/cpu/sgx/encl.h +0 −2
  305. arch/x86/kernel/dumpstack.c +1 −1
  306. arch/x86/kernel/early_printk.c +7 −7
  307. arch/x86/kernel/rtc.c +9 −54
  308. arch/x86/kernel/traps.c +3 −1
  309. arch/x86/kernel/x86_init.c +1 −1
  310. arch/x86/kvm/cpuid.c +0 −2
  311. arch/x86/kvm/vmx/nested.c +1 −1
  312. arch/x86/lib/clear_page_64.S +138 −0
  313. arch/x86/lib/memcpy_64.S +2 −1
  314. arch/x86/lib/usercopy_64.c +0 −40
  315. arch/x86/mm/fault.c +10 −0
  316. arch/x86/net/bpf_jit_comp.c +70 −32
  317. arch/x86/platform/efi/efi.c +1 −1
  318. arch/x86/purgatory/Makefile +4 −0
  319. arch/x86/tools/relocs.c +1 −0
  320. arch/x86/xen/enlighten_pv.c +2 −1
  321. block/bdev.c +23 −0
  322. drivers/acpi/Kconfig +0 −4
  323. drivers/acpi/ac.c +0 −5
  324. drivers/acpi/acpi_amba.c +4 −2
  325. drivers/acpi/acpi_apd.c +1 −8
  326. drivers/acpi/acpi_fpdt.c +22 −0
  327. drivers/acpi/acpi_lpss.c +29 −40
  328. drivers/acpi/acpi_pcc.c +25 −3
  329. drivers/acpi/acpi_platform.c +10 −12
  330. drivers/acpi/acpi_video.c +17 −1
  331. drivers/acpi/apei/apei-base.c +1 −4
  332. drivers/acpi/apei/bert.c +3 −0
  333. drivers/acpi/apei/erst.c +1 −5
  334. drivers/acpi/arm64/dma.c +17 −11
  335. drivers/acpi/bus.c +17 −20
  336. drivers/acpi/cppc_acpi.c +45 −0
  337. drivers/acpi/device_pm.c +22 −16
  338. drivers/acpi/dptf/Kconfig +0 −3
  339. drivers/acpi/ec.c +1 −5
  340. drivers/acpi/fan_core.c +27 −31
  341. drivers/acpi/internal.h +3 −3
  342. drivers/acpi/irq.c +2 −2
  343. drivers/acpi/numa/hmat.c +12 −13
  344. drivers/acpi/osi.c +0 −24
  345. drivers/acpi/pci_root.c +12 −63
  346. drivers/acpi/power.c +8 −3
  347. drivers/acpi/processor_idle.c +4 −4
  348. drivers/acpi/property.c +8 −5
  349. drivers/acpi/resource.c +46 −0
  350. drivers/acpi/sbs.c +1 −1
  351. drivers/acpi/sbshc.c +1 −1
  352. drivers/acpi/scan.c +96 −83
  353. drivers/acpi/utils.c +27 −3
  354. drivers/acpi/x86/apple.c +1 −0
  355. drivers/acpi/x86/s2idle.c +123 −24
  356. drivers/acpi/x86/utils.c +28 −5
  357. drivers/ata/ahci_imx.c +10 −5
  358. drivers/base/arch_topology.c +1 −1
  359. drivers/base/power/runtime.c +5 −2
  360. drivers/base/power/wakeup.c +2 −0
  361. drivers/block/virtio_blk.c +5 −6
  362. drivers/bluetooth/btintel.c +11 −9
  363. drivers/bluetooth/btusb.c +33 −5
  364. drivers/bluetooth/hci_ldisc.c +5 −2
  365. drivers/bluetooth/hci_serdev.c +7 −3
  366. drivers/clk/bcm/clk-iproc-pll.c +8 −4
  367. drivers/clk/clk-tps68470.c +9 −4
  368. drivers/clk/imx/clk-imx6sx.c +2 −2
  369. drivers/clk/imx/clk-imx93.c +1 −1
  370. drivers/clk/ingenic/tcu.c +5 −10
  371. drivers/clk/microchip/clk-mpfs.c +9 −2
  372. drivers/clk/sunxi-ng/ccu-sun50i-h6.c +6 −2
  373. drivers/cpufreq/amd-pstate.c +22 −19
  374. drivers/cpufreq/bmips-cpufreq.c +8 −2
  375. drivers/cpufreq/cppc_cpufreq.c +22 −5
  376. drivers/cpufreq/cpufreq-dt-platdev.c +1 −0
  377. drivers/cpufreq/highbank-cpufreq.c +1 −1
  378. drivers/cpufreq/intel_pstate.c +1 −0
  379. drivers/cpufreq/qcom-cpufreq-hw.c +19 −5
  380. drivers/cpufreq/sti-cpufreq.c +1 −1
  381. drivers/cpufreq/tegra194-cpufreq.c +16 −19
  382. drivers/cpufreq/ti-cpufreq.c +1 −1
  383. drivers/cpuidle/coupled.c +1 −1
  384. drivers/cpuidle/cpuidle-powernv.c +2 −2
  385. drivers/cpuidle/governor.c +5 −6
  386. drivers/crypto/virtio/virtio_crypto_akcipher_algs.c +4 −0
  387. drivers/devfreq/event/rockchip-dfi.c +3 −4
  388. drivers/devfreq/mtk-cci-devfreq.c +6 −2
  389. drivers/edac/edac_mc.c +0 −1
  390. drivers/edac/edac_module.h +0 −4
  391. drivers/edac/i10nm_base.c +263 −24
  392. drivers/edac/i7300_edac.c +1 −1
  393. drivers/edac/ie31200_edac.c +19 −9
  394. drivers/edac/ppc4xx_edac.c +9 −14
  395. drivers/edac/sb_edac.c +138 −10
  396. drivers/edac/skx_base.c +7 −2
  397. drivers/edac/skx_common.c +17 −9
  398. drivers/edac/skx_common.h +16 −0
  399. drivers/edac/wq.c +0 −1
  400. drivers/firmware/efi/dev-path-parser.c +6 −4
  401. drivers/firmware/efi/libstub/Makefile +2 −0
  402. drivers/firmware/psci/psci.c +6 −6
  403. drivers/gpio/gpio-mvebu.c +6 −9
  404. drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +4 −0
  405. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +26 −1
  406. drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 −1
  407. drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +4 −0
  408. drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +2 −0
  409. drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c +264 −0
  410. drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h +3 −1
  411. drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +4 −0
  412. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1 −1
  413. drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +8 −147
  414. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 −1
  415. drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +4 −0
  416. drivers/gpu/drm/amd/amdgpu/soc21.c +1 −0
  417. drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 −0
  418. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c +3 −3
  419. drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +4 −0
  420. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +7 −1
  421. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +10 −1
  422. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +14 −0
  423. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 −4
  424. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +47 −0
  425. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c +19 −6
  426. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +53 −0
  427. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c +7 −3
  428. drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +41 −2
  429. drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +2 −0
  430. drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +2 −0
  431. drivers/gpu/drm/amd/include/mes_v11_api_def.h +2 −1
  432. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +27 −62
  433. drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 −13
  434. drivers/gpu/drm/bridge/lontium-lt8912b.c +11 −2
  435. drivers/gpu/drm/i915/gt/intel_engine_types.h +15 −0
  436. drivers/gpu/drm/i915/gt/intel_execlists_submission.c +20 −1
  437. drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c +11 −4
  438. drivers/hv/vmbus_drv.c +2 −1
  439. drivers/hwmon/acpi_power_meter.c +1 −1
  440. drivers/hwmon/hwmon.c +7 −7
  441. drivers/hwmon/pmbus/pmbus_core.c +5 −5
  442. drivers/hwmon/scpi-hwmon.c +7 −7
  443. drivers/i2c/busses/i2c-amd-mp2-plat.c +9 −18
  444. drivers/i2c/busses/i2c-davinci.c +2 −1
  445. drivers/i2c/busses/i2c-mlxbf.c +6 −14
  446. drivers/idle/intel_idle.c +52 −1
  447. drivers/iio/adc/sun4i-gpadc-iio.c +6 −8
  448. drivers/input/touchscreen/sun4i-ts.c +5 −5
  449. drivers/isdn/mISDN/l1oip.h +1 −0
  450. drivers/isdn/mISDN/l1oip_core.c +7 −6
  451. drivers/md/dm-verity-loadpin.c +8 −0
  452. drivers/md/dm-verity-target.c +16 −0
  453. drivers/md/dm-verity.h +1 −0
  454. drivers/md/md-cluster.c +2 −2
  455. drivers/media/dvb-core/dvb_vb2.c +11 −0
  456. drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c +3 −6
  457. drivers/media/usb/uvc/uvc_driver.c +1 −1
  458. drivers/media/v4l2-core/v4l2-compat-ioctl32.c +2 −0
  459. drivers/media/v4l2-core/v4l2-ioctl.c +12 −14
  460. drivers/misc/lkdtm/cfi.c +9 −6
  461. drivers/misc/lkdtm/fortify.c +83 −13
  462. drivers/misc/lkdtm/usercopy.c +1 −1
  463. drivers/net/Kconfig +2 −0
  464. drivers/net/Makefile +1 −0
  465. drivers/net/ethernet/atheros/alx/main.c +5 −0
  466. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 −0
  467. drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +2 −2
  468. drivers/net/ethernet/freescale/Kconfig +1 −0
  469. drivers/net/ethernet/freescale/fec.h +19 −2
  470. drivers/net/ethernet/freescale/fec_main.c +99 −56
  471. drivers/net/ethernet/marvell/mvpp2/mvpp2.h +1 −0
  472. drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c +8 −2
  473. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +12 −1
  474. drivers/net/ethernet/marvell/octeontx2/af/Makefile +1 −1
  475. drivers/net/ethernet/marvell/octeontx2/af/mbox.h +468 −3
  476. drivers/net/ethernet/marvell/octeontx2/af/mcs.c +1601 −0
  477. drivers/net/ethernet/marvell/octeontx2/af/mcs.h +246 −0
  478. drivers/net/ethernet/marvell/octeontx2/af/mcs_cnf10kb.c +214 −0
  479. drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h +1102 −0
  480. drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +889 −0
  481. drivers/net/ethernet/marvell/octeontx2/af/rvu.c +17 −3
  482. drivers/net/ethernet/marvell/octeontx2/af/rvu.h +21 −0
  483. drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +346 −0
  484. drivers/net/ethernet/marvell/octeontx2/nic/Makefile +1 −0
  485. drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +1668 −0
  486. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 −0
  487. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +90 −0
  488. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +16 −0
  489. drivers/net/ethernet/marvell/prestera/prestera.h +12 −0
  490. drivers/net/ethernet/marvell/prestera/prestera_acl.c +6 −2
  491. drivers/net/ethernet/marvell/prestera/prestera_acl.h +2 −2
  492. drivers/net/ethernet/marvell/prestera/prestera_flower.c +5 −1
  493. drivers/net/ethernet/marvell/prestera/prestera_hw.c +130 −0
  494. drivers/net/ethernet/marvell/prestera/prestera_hw.h +11 −0
  495. drivers/net/ethernet/marvell/prestera/prestera_main.c +11 −0
  496. drivers/net/ethernet/marvell/prestera/prestera_router.c +1083 −36
  497. drivers/net/ethernet/marvell/prestera/prestera_router_hw.c +361 −5
  498. drivers/net/ethernet/marvell/prestera/prestera_router_hw.h +75 −1
  499. drivers/net/ethernet/mediatek/mtk_ppe.c +1 −1
  500. drivers/net/ethernet/mellanox/mlx5/core/en.h +13 −15
  501. drivers/net/ethernet/mellanox/mlx5/core/en/channels.c +17 −12
  502. drivers/net/ethernet/mellanox/mlx5/core/en/channels.h +2 −1
  503. drivers/net/ethernet/mellanox/mlx5/core/en/params.c +198 −49
  504. drivers/net/ethernet/mellanox/mlx5/core/en/params.h +17 −39
  505. drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +1 −22
  506. drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c +15 −103
  507. drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h +3 −6
  508. drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +7 −0
  509. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c +23 −12
  510. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c +212 −11
  511. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.h +3 −14
  512. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +2 −2
  513. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c +3 −9
  514. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.h +0 −12
  515. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +3 −1
  516. drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +2 −11
  517. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +134 −43
  518. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +0 −3
  519. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +83 −135
  520. drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +20 −1
  521. drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +4 −0
  522. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 −1
  523. drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +22 −11
  524. drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +5 −1
  525. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +9 −7
  526. drivers/net/ethernet/mellanox/mlx5/core/health.c +24 −5
  527. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +0 −1
  528. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +0 −1
  529. drivers/net/ethernet/mellanox/mlx5/core/main.c +10 −7
  530. drivers/net/ethernet/mellanox/mlx5/core/wq.h +1 −1
  531. drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +2 −75
  532. drivers/net/ethernet/microchip/lan743x_ptp.c +7 −0
  533. drivers/net/ethernet/microchip/lan966x/Makefile +2 −1
  534. drivers/net/ethernet/microchip/lan966x/lan966x_main.c +2 −1
  535. drivers/net/ethernet/microchip/lan966x/lan966x_main.h +44 −0
  536. drivers/net/ethernet/microchip/lan966x/lan966x_mirror.c +138 −0
  537. drivers/net/ethernet/microchip/lan966x/lan966x_police.c +235 −0
  538. drivers/net/ethernet/microchip/lan966x/lan966x_regs.h +96 −0
  539. drivers/net/ethernet/microchip/lan966x/lan966x_tc.c +50 −0
  540. drivers/net/ethernet/microchip/lan966x/lan966x_tc_matchall.c +95 −0
  541. drivers/net/ethernet/microchip/sparx5/sparx5_main.h +1 −1
  542. drivers/net/ethernet/microchip/sparx5/sparx5_packet.c +2 −2
  543. drivers/net/ethernet/netronome/nfp/nfp_main.c +73 −1
  544. drivers/net/ethernet/netronome/nfp/nfp_main.h +1 −2
  545. drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c +0 −8
  546. drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h +3 −7
  547. drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +56 −5
  548. drivers/net/ethernet/netronome/nfp/nfp_net_main.c +1 −48
  549. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h +3 −0
  550. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c +10 −1
  551. drivers/net/ethernet/realtek/r8169_main.c +10 −6
  552. drivers/net/ethernet/sunplus/spl2sw_driver.c +1 −1
  553. drivers/net/ipa/gsi.c +13 −13
  554. drivers/net/ipa/gsi.h +1 −1
  555. drivers/net/ipa/gsi_private.h +5 −5
  556. drivers/net/ipa/gsi_reg.h +1 −1
  557. drivers/net/ipa/gsi_trans.c +28 −30
  558. drivers/net/ipa/gsi_trans.h +2 −2
  559. drivers/net/ipa/ipa.h +1 −1
  560. drivers/net/ipa/ipa_cmd.c +2 −2
  561. drivers/net/ipa/ipa_cmd.h +1 −1
  562. drivers/net/ipa/ipa_data.h +2 −2
  563. drivers/net/ipa/ipa_endpoint.c +1 −3
  564. drivers/net/ipa/ipa_endpoint.h +1 −1
  565. drivers/net/ipa/ipa_interrupt.c +1 −1
  566. drivers/net/ipa/ipa_interrupt.h +1 −1
  567. drivers/net/ipa/ipa_main.c +1 −1
  568. drivers/net/ipa/ipa_mem.c +1 −1
  569. drivers/net/ipa/ipa_modem.c +1 −1
  570. drivers/net/ipa/ipa_modem.h +1 −1
  571. drivers/net/ipa/ipa_power.c +1 −1
  572. drivers/net/ipa/ipa_power.h +1 −1
  573. drivers/net/ipa/ipa_qmi.c +1 −1
  574. drivers/net/ipa/ipa_qmi.h +1 −1
  575. drivers/net/ipa/ipa_qmi_msg.c +1 −1
  576. drivers/net/ipa/ipa_qmi_msg.h +1 −1
  577. drivers/net/ipa/ipa_reg.c +1 −1
  578. drivers/net/ipa/ipa_reg.h +30 −45
  579. drivers/net/ipa/ipa_resource.c +1 −1
  580. drivers/net/ipa/ipa_smp2p.c +1 −1
  581. drivers/net/ipa/ipa_smp2p.h +1 −1
  582. drivers/net/ipa/ipa_sysfs.c +1 −1
  583. drivers/net/ipa/ipa_sysfs.h +1 −1
  584. drivers/net/ipa/ipa_table.c +1 −1
  585. drivers/net/ipa/ipa_table.h +1 −1
  586. drivers/net/ipa/ipa_uc.c +1 −1
  587. drivers/net/ipa/ipa_uc.h +1 −1
  588. drivers/net/ipa/ipa_version.h +1 −1
  589. drivers/net/mdio/fwnode_mdio.c +47 −11
  590. drivers/net/mdio/mdio-i2c.c +305 −5
  591. drivers/net/phy/at803x.c +2 −1
  592. drivers/net/phy/marvell-88x2222.c +2 −1
  593. drivers/net/phy/marvell.c +2 −1
  594. drivers/net/phy/marvell10g.c +123 −10
  595. drivers/net/phy/phy_device.c +2 −0
  596. drivers/net/phy/phylink.c +166 −44
  597. drivers/net/phy/sfp-bus.c +57 −18
  598. drivers/net/phy/sfp.c +122 −57
  599. drivers/net/phy/sfp.h +2 −1
  600. drivers/net/pse-pd/Kconfig +22 −0
  601. drivers/net/pse-pd/Makefile +6 −0
  602. drivers/net/pse-pd/pse_core.c +314 −0
  603. drivers/net/pse-pd/pse_regulator.c +147 −0
  604. drivers/net/usb/r8152.c +3 −1
  605. drivers/net/wireless/mediatek/mt76/tx.c +8 −2
  606. drivers/net/wwan/iosm/iosm_ipc_wwan.c +3 −2
  607. drivers/nvme/host/core.c +3 −3
  608. drivers/nvme/host/pci.c +4 −0
  609. drivers/perf/arm_dsu_pmu.c +2 −2
  610. drivers/perf/qcom_l2_pmu.c +5 −5
  611. drivers/perf/qcom_l3_pmu.c +2 −1
  612. drivers/platform/x86/intel/int3472/common.c +1 −1
  613. drivers/platform/x86/intel/int3472/tps68470.c +64 −12
  614. drivers/platform/x86/intel/int3472/tps68470.h +2 −1
  615. drivers/platform/x86/intel/int3472/tps68470_board_data.c +51 −3
  616. drivers/pnp/pnpbios/pnpbios.h +0 −1
  617. drivers/powercap/intel_rapl_common.c +4 −1
  618. drivers/ras/cec.c +8 −0
  619. drivers/regulator/max8973-regulator.c +5 −5
  620. drivers/spi/spi-pxa2xx.c +10 −27
  621. drivers/spi/spi.c +1 −1
  622. drivers/staging/media/rkvdec/rkvdec-h264.c +2 −2
  623. drivers/thermal/amlogic_thermal.c +8 −8
  624. drivers/thermal/armada_thermal.c +6 −6
  625. drivers/thermal/broadcom/bcm2711_thermal.c +7 −7
  626. drivers/thermal/broadcom/bcm2835_thermal.c +7 −7
  627. drivers/thermal/broadcom/brcmstb_thermal.c +10 −10
  628. drivers/thermal/broadcom/ns-thermal.c +21 −29
  629. drivers/thermal/broadcom/sr-thermal.c +8 −8
  630. drivers/thermal/cpufreq_cooling.c +6 −6
  631. drivers/thermal/da9062-thermal.c +2 −3
  632. drivers/thermal/db8500_thermal.c +4 −4
  633. drivers/thermal/gov_bang_bang.c +2 −8
  634. drivers/thermal/gov_fair_share.c +1 −2
  635. drivers/thermal/gov_power_allocator.c +6 −14
  636. drivers/thermal/gov_step_wise.c +2 −8
  637. drivers/thermal/gov_user_space.c +3 −2
  638. drivers/thermal/hisi_thermal.c +7 −7
  639. drivers/thermal/imx8mm_thermal.c +7 −7
  640. drivers/thermal/imx_sc_thermal.c +7 −7
  641. drivers/thermal/intel/int340x_thermal/int3400_thermal.c +2 −3
  642. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +1 −12
  643. drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c +1 −12
  644. drivers/thermal/intel/intel_powerclamp.c +7 −20
  645. drivers/thermal/k3_bandgap.c +6 −6
  646. drivers/thermal/k3_j72xx_bandgap.c +5 −7
  647. drivers/thermal/max77620_thermal.c +4 −4
  648. drivers/thermal/mtk_thermal.c +5 −5
  649. drivers/thermal/qcom/qcom-spmi-adc-tm5.c +10 −13
  650. drivers/thermal/qcom/qcom-spmi-temp-alarm.c +6 −6
  651. drivers/thermal/qcom/tsens.c +8 −8
  652. drivers/thermal/qoriq_thermal.c +6 −6
  653. drivers/thermal/rcar_gen3_thermal.c +8 −8
  654. drivers/thermal/rcar_thermal.c +3 −10
  655. drivers/thermal/rockchip_thermal.c +7 −7
  656. drivers/thermal/rzg2l_thermal.c +5 −5
  657. drivers/thermal/samsung/exynos_tmu.c +10 −14
  658. drivers/thermal/sprd_thermal.c +9 −9
  659. drivers/thermal/st/stm_thermal.c +8 −10
  660. drivers/thermal/sun8i_thermal.c +7 −7
  661. drivers/thermal/tegra/soctherm.c +10 −11
  662. drivers/thermal/tegra/tegra-bpmp-thermal.c +12 −7
  663. drivers/thermal/tegra/tegra30-tsensor.c +6 −6
  664. drivers/thermal/thermal-generic-adc.c +5 −5
  665. drivers/thermal/thermal_core.c +32 −48
  666. drivers/thermal/thermal_core.h +2 −2
  667. drivers/thermal/thermal_helpers.c +43 −30
  668. drivers/thermal/thermal_hwmon.c +1 −1
  669. drivers/thermal/thermal_mmio.c +9 −10
  670. drivers/thermal/thermal_of.c +386 −762
  671. drivers/thermal/thermal_sysfs.c +9 −2
  672. drivers/thermal/ti-soc-thermal/ti-thermal-common.c +8 −8
  673. drivers/thermal/uniphier_thermal.c +5 −5
  674. drivers/thunderbolt/acpi.c +1 −1
  675. drivers/thunderbolt/switch.c +1 −0
  676. drivers/usb/dwc3/dwc3-st.c +1 −1
  677. drivers/usb/storage/unusual_uas.h +21 −0
  678. drivers/usb/typec/mux/intel_pmc_mux.c +1 −10
  679. drivers/usb/typec/ucsi/ucsi.c +0 −2
  680. drivers/vdpa/ifcvf/ifcvf_base.c +2 −2
  681. drivers/vdpa/mlx5/net/mlx5_vnet.c +10 −7
  682. drivers/vdpa/vdpa_user/vduse_dev.c +7 −2
  683. drivers/vhost/vsock.c +1 −1
  684. fs/Kconfig.binfmt +0 −33
  685. fs/Makefile +0 −1
  686. fs/binfmt_aout.c +0 −342
  687. fs/coredump.c +34 −5
  688. fs/crypto/bio.c +10 −6
  689. fs/crypto/fscrypt_private.h +58 −24
  690. fs/crypto/hooks.c +3 −7
  691. fs/crypto/inline_crypt.c +95 −101
  692. fs/crypto/keyring.c +267 −228
  693. fs/crypto/keysetup.c +37 −52
  694. fs/crypto/keysetup_v1.c +3 −1
  695. fs/crypto/policy.c +2 −19
  696. fs/dlm/ast.c +9 −6
  697. fs/dlm/ast.h +0 −1
  698. fs/dlm/dlm_internal.h +1 −1
  699. fs/dlm/lock.c +109 −58
  700. fs/dlm/lock.h +1 −1
  701. fs/dlm/lockspace.c +26 −6
  702. fs/dlm/lockspace.h +13 −0
  703. fs/dlm/lowcomms.c +4 −0
  704. fs/dlm/user.c +11 −6
  705. fs/erofs/decompressor.c +28 −19
  706. fs/erofs/decompressor_lzma.c +3 −0
  707. fs/erofs/erofs_fs.h +34 −6
  708. fs/erofs/fscache.c +312 −165
  709. fs/erofs/inode.c +9 −17
  710. fs/erofs/internal.h +41 −16
  711. fs/erofs/namei.c +2 −11
  712. fs/erofs/super.c +77 −19
  713. fs/erofs/sysfs.c +21 −2
  714. fs/erofs/xattr.h +0 −2
  715. fs/erofs/zdata.c +50 −1
  716. fs/erofs/zmap.c +70 −34
  717. fs/exec.c +1 −2
  718. fs/ext4/ext4.h +1 −0
  719. fs/ext4/file.c +26 −11
  720. fs/ext4/inode.c +37 −0
  721. fs/ext4/readpage.c +6 −4
  722. fs/f2fs/data.c +10 −8
  723. fs/f2fs/f2fs.h +0 −40
  724. fs/f2fs/file.c +42 −1
  725. fs/f2fs/super.c +12 −12
  726. fs/fat/file.c +3 −2
  727. fs/gfs2/lock_dlm.c +1 −1
  728. fs/internal.h +3 −0
  729. fs/lockd/host.c +1 −1
  730. fs/lockd/svc4proc.c +24 −0
  731. fs/lockd/svcproc.c +24 −0
  732. fs/nfs/callback_xdr.c +1 −0
  733. fs/nfsd/cache.h +1 −1
  734. fs/nfsd/filecache.c +1 −6
  735. fs/nfsd/filecache.h +1 −1
  736. fs/nfsd/netns.h +4 −0
  737. fs/nfsd/nfs2acl.c +5 −0
  738. fs/nfsd/nfs3acl.c +3 −0
  739. fs/nfsd/nfs3proc.c +29 −14
  740. fs/nfsd/nfs3xdr.c +4 −14
  741. fs/nfsd/nfs4callback.c +12 −2
  742. fs/nfsd/nfs4idmap.c +4 −4
  743. fs/nfsd/nfs4layouts.c +1 −1
  744. fs/nfsd/nfs4proc.c +133 −93
  745. fs/nfsd/nfs4recover.c +8 −6
  746. fs/nfsd/nfs4state.c +173 −45
  747. fs/nfsd/nfs4xdr.c +67 −35
  748. fs/nfsd/nfscache.c +3 −10
  749. fs/nfsd/nfsctl.c +14 −40
  750. fs/nfsd/nfsd.h +11 −2
  751. fs/nfsd/nfsfh.c +1 −7
  752. fs/nfsd/nfsproc.c +24 −15
  753. fs/nfsd/nfssvc.c +1 −1
  754. fs/nfsd/nfsxdr.c +1 −3
  755. fs/nfsd/state.h +5 −6
  756. fs/nfsd/stats.c +2 −12
  757. fs/nfsd/trace.h +121 −10
  758. fs/nfsd/vfs.c +84 −44
  759. fs/nfsd/vfs.h +2 −2
  760. fs/nfsd/xdr4.h +5 −4
  761. fs/ntfs3/inode.c +0 −2
  762. fs/ntfs3/xattr.c +6 −96
  763. fs/ocfs2/stack_user.c +1 −1
  764. fs/overlayfs/overlayfs.h +1 −1
  765. fs/overlayfs/super.c +14 −1
  766. fs/posix_acl.c +221 −67
  767. fs/pstore/platform.c +12 −51
  768. fs/read_write.c +14 −8
  769. fs/stat.c +14 −0
  770. fs/super.c +1 −1
  771. fs/userfaultfd.c +2 −2
  772. fs/verity/read_metadata.c +3 −3
  773. fs/verity/verify.c +2 −12
  774. fs/xattr.c +4 −11
  775. fs/xfs/xfs_iops.c +10 −0
  776. include/acpi/acpi_bus.h +27 −7
  777. include/acpi/cppc_acpi.h +5 −0
  778. include/asm-generic/bug.h +0 −16
  779. include/asm-generic/vmlinux.lds.h +29 −18
  780. include/linux/a.out.h +0 −18
  781. include/linux/acpi.h +13 −5
  782. include/linux/binfmts.h +0 −3
  783. include/linux/blkdev.h +4 −0
  784. include/linux/bpf.h +137 −24
  785. include/linux/bpf_types.h +1 −0
  786. include/linux/bpf_verifier.h +29 −0
  787. include/linux/btf.h +19 −0
  788. include/linux/cfi.h +24 −35
  789. include/linux/cfi_types.h +45 −0
  790. include/linux/compiler-clang.h +3 −11
  791. include/linux/compiler.h +4 −12
  792. include/linux/compiler_types.h +5 −5
  793. include/linux/dlm.h +1 −4
  794. include/linux/edac.h +15 −15
  795. include/linux/filter.h +12 −1
  796. include/linux/fortify-string.h +178 −67
  797. include/linux/fs.h +1 −1
  798. include/linux/fscrypt.h +16 −23
  799. include/linux/init.h +3 −3
  800. include/linux/kallsyms.h +1 −1
  801. include/linux/key.h +6 −0
  802. include/linux/kprobes.h +1 −0
  803. include/linux/lsm_hook_defs.h +1 −0
  804. include/linux/lsm_hooks.h +4 −0
  805. include/linux/mdio/mdio-i2c.h +9 −1
  806. include/linux/mlx5/driver.h +5 −0
  807. include/linux/mlx5/mlx5_ifc.h +6 −2
  808. include/linux/module.h +5 −5
  809. include/linux/once.h +28 −0
  810. include/linux/overflow.h +41 −31
  811. include/linux/pci.h +2 −2
  812. include/linux/pci_ids.h +3 −0
  813. include/linux/phy.h +6 −0
  814. include/linux/platform_data/tps68470.h +6 −1
  815. include/linux/poison.h +3 −0
  816. include/linux/posix_acl_xattr.h +3 −9
  817. include/linux/pse-pd/pse.h +129 −0
  818. include/linux/rcupdate.h +37 −5
  819. include/linux/rcutiny.h +50 −0
  820. include/linux/rcutree.h +40 −0
  821. include/linux/resctrl.h +60 −4
  822. include/linux/security.h +6 −0
  823. include/linux/sfp.h +3 −2
  824. include/linux/srcutiny.h +6 −4
  825. include/linux/stat.h +2 −0
  826. include/linux/string.h +43 −0
  827. include/linux/sunrpc/svc.h +16 −4
  828. include/linux/sunrpc/xdr.h +2 −0
  829. include/linux/suspend.h +1 −1
  830. include/linux/tcp.h +7 −1
  831. include/linux/thermal.h +28 −59
  832. include/linux/verification.h +8 −0
  833. include/linux/wireless.h +9 −1
  834. include/linux/xattr.h +1 −1
  835. include/net/bluetooth/bluetooth.h +1 −0
  836. include/net/bluetooth/hci.h +4 −0
  837. include/net/bluetooth/hci_core.h +15 −2
  838. include/net/bluetooth/hci_sync.h +8 −1
  839. include/net/bluetooth/mgmt.h +52 −0
  840. include/net/devlink.h +6 −1
  841. include/net/dsa.h +0 −2
  842. include/net/dst_metadata.h +31 −0
  843. include/net/flow.h +0 −26
  844. include/net/ip_tunnels.h +6 −0
  845. include/net/ipcomp.h +1 −1
  846. include/net/netfilter/nf_conntrack_bpf.h +24 −1
  847. include/net/pkt_cls.h +12 −0
  848. include/net/tcp.h +4 −1
  849. include/net/xfrm.h +17 −7
  850. include/net/xsk_buff_pool.h +1 −1
  851. include/trace/events/dlm.h +14 −12
  852. include/trace/events/erofs.h +4 −7
  853. include/uapi/linux/bpf.h +60 −6
  854. include/uapi/linux/dlm.h +0 −1
  855. include/uapi/linux/ethtool.h +45 −0
  856. include/uapi/linux/ethtool_netlink.h +16 −0
  857. include/uapi/linux/if_link.h +1 −0
  858. include/uapi/linux/landlock.h +5 −5
  859. include/uapi/linux/lwtunnel.h +10 −0
  860. include/uapi/linux/stat.h +3 −1
  861. init/Kconfig +45 −1
  862. io_uring/io_uring.c +7 −0
  863. io_uring/poll.c +1 −1
  864. kernel/audit.c +3 −5
  865. kernel/audit.h +1 −3
  866. kernel/auditsc.c +5 −5
  867. kernel/bpf/arraymap.c +24 −9
  868. kernel/bpf/bpf_lsm.c +1 −0
  869. kernel/bpf/btf.c +223 −48
  870. kernel/bpf/cgroup.c +18 −10
  871. kernel/bpf/core.c +7 −2
  872. kernel/bpf/dispatcher.c +21 −6
  873. kernel/bpf/hashtab.c +16 −52
  874. kernel/bpf/helpers.c +22 −18
  875. kernel/bpf/memalloc.c +3 −2
  876. kernel/bpf/percpu_freelist.c +16 −32
  877. kernel/bpf/ringbuf.c +232 −11
  878. kernel/bpf/syscall.c +20 −11
  879. kernel/bpf/task_iter.c +202 −22
  880. kernel/bpf/trampoline.c +30 −30
  881. kernel/bpf/verifier.c +196 −143
  882. kernel/cfi.c +57 −295
  883. kernel/configs/rust.config +1 −0
  884. kernel/events/core.c +9 −0
  885. kernel/kallsyms.c +22 −21
  886. kernel/kprobes.c +5 −1
  887. kernel/kthread.c +1 −2
  888. kernel/livepatch/core.c +2 −2
  889. kernel/module/main.c +3 −47
  890. kernel/rcu/rcutorture.c +248 −42
  891. kernel/rcu/srcutiny.c +7 −7
  892. kernel/rcu/tasks.h +4 −1
  893. kernel/rcu/tiny.c +26 −1
  894. kernel/rcu/tree.c +252 −78
  895. kernel/rcu/tree_exp.h +54 −3
  896. kernel/rcu/tree_nocb.h +5 −5
  897. kernel/rcu/tree_plugin.h +15 −11
  898. kernel/rcu/tree_stall.h +2 −3
  899. kernel/sched/core.c +14 −0
  900. kernel/sched/cpufreq_schedutil.c +15 −15
  901. kernel/smp.c +1 −2
  902. kernel/trace/Kconfig +6 −0
  903. kernel/trace/bpf_trace.c +208 −3
  904. kernel/trace/ftrace.c +1 −2
  905. kernel/user_namespace.c +5 −0
  906. kernel/workqueue.c +1 −1
  907. lib/Kconfig.debug +55 −0
  908. lib/Makefile +2 −0
  909. lib/fortify_kunit.c +76 −0
  910. lib/is_signed_type_kunit.c +53 −0
  911. lib/memcpy_kunit.c +55 −4
  912. lib/once.c +30 −0
  913. lib/overflow_kunit.c +122 −55
  914. lib/vsprintf.c +13 −0
  915. mm/damon/sysfs.c +1 −1
  916. mm/util.c +4 −0
  917. net/bluetooth/hci_conn.c +151 −11
  918. net/bluetooth/hci_core.c +51 −17
  919. net/bluetooth/hci_debugfs.c +1 −1
  920. net/bluetooth/hci_event.c +102 −73
  921. net/bluetooth/hci_request.c +149 −1501
  922. net/bluetooth/hci_request.h +0 −53
  923. net/bluetooth/hci_sock.c +1 −3
  924. net/bluetooth/hci_sync.c +466 −25
  925. net/bluetooth/hci_sysfs.c +3 −0
  926. net/bluetooth/l2cap_core.c +13 −4
  927. net/bluetooth/mgmt.c +591 −19
  928. net/bluetooth/mgmt_util.c +74 −0
  929. net/bluetooth/mgmt_util.h +18 −0
  930. net/bluetooth/rfcomm/sock.c +3 −0
  931. net/bpf/test_run.c +37 −0
  932. net/core/devlink.c +64 −16
  933. net/core/filter.c +108 −16
  934. net/core/gro.c +14 −4
  935. net/core/lwtunnel.c +1 −0
  936. net/core/skmsg.c +8 −4
  937. net/core/stream.c +2 −1
  938. net/dsa/dsa2.c +77 −107
  939. net/dsa/dsa_priv.h +1 −0
  940. net/dsa/port.c +15 −7
  941. net/dsa/slave.c +3 −3
  942. net/ethtool/Makefile +2 −1
  943. net/ethtool/common.h +1 −0
  944. net/ethtool/netlink.c +17 −0
  945. net/ethtool/netlink.h +4 −0
  946. net/ethtool/pse-pd.c +185 −0
  947. net/ieee802154/socket.c +3 −0
  948. net/ipv4/ah4.c +14 −9
  949. net/ipv4/bpf_tcp_ca.c +1 −1
  950. net/ipv4/esp4.c +33 −22
  951. net/ipv4/esp4_offload.c +4 −1
  952. net/ipv4/inet_hashtables.c +2 −2
  953. net/ipv4/ip_tunnel_core.c +67 −0
  954. net/ipv4/ipcomp.c +7 −3
  955. net/ipv4/ipip.c +3 −59
  956. net/ipv4/ping.c +15 −0
  957. net/ipv4/tcp.c +2 −0
  958. net/ipv4/tcp_minisocks.c +1 −0
  959. net/ipv4/tcp_offload.c +15 −2
  960. net/ipv4/tcp_output.c +12 −7
  961. net/ipv4/xfrm4_tunnel.c +7 −3
  962. net/ipv6/ah6.c +15 −8
  963. net/ipv6/esp6.c +33 −22
  964. net/ipv6/esp6_offload.c +4 −1
  965. net/ipv6/ip6_tunnel.c +2 −35
  966. net/ipv6/ipcomp6.c +7 −3
  967. net/ipv6/mip6.c +6 −8
  968. net/ipv6/ping.c +16 −0
  969. net/ipv6/sit.c +3 −62
  970. net/ipv6/xfrm6_tunnel.c +7 −3
  971. net/mac80211/iface.c +4 −4
  972. net/mac80211/mlme.c +4 −3
  973. net/mac80211/rx.c +5 −4
  974. net/mac80211/tx.c +6 −4
  975. net/mac80211/util.c +1 −1
  976. net/mptcp/protocol.c +87 −37
  977. net/netfilter/Makefile +6 −0
  978. net/netfilter/nf_conntrack_bpf.c +67 −7
  979. net/netfilter/nf_conntrack_core.c +1 −0
  980. net/netfilter/nf_nat_bpf.c +79 −0
  981. net/netfilter/nf_nat_core.c +2 −2
  982. net/netlink/genetlink.c +31 −1
  983. net/rds/tcp.c +1 −1
  984. net/sched/cls_basic.c +1 −6
  985. net/sched/cls_bpf.c +1 −6
  986. net/sched/cls_flower.c +1 −6
  987. net/sched/cls_fw.c +1 −6
  988. net/sched/cls_matchall.c +1 −6
  989. net/sched/cls_route.c +1 −6
  990. net/sched/cls_rsvp.h +1 −6
  991. net/sched/cls_tcindex.c +1 −6
  992. net/sched/cls_u32.c +1 −6
  993. net/sched/sch_api.c +1 −1
  994. net/sctp/auth.c +14 −4
  995. net/sunrpc/svc.c +18 −16
  996. net/sunrpc/xdr.c +23 −1
  997. net/unix/af_unix.c +7 −6
  998. net/vmw_vsock/virtio_transport_common.c +1 −1
  999. net/wireless/nl80211.c +3 −1
  1000. net/wireless/util.c +21 −19
  1001. net/wireless/wext-core.c +10 −7
  1002. net/xdp/xsk.c +13 −13
  1003. net/xdp/xsk_buff_pool.c +3 −2
  1004. net/xdp/xsk_queue.h +10 −12
  1005. net/xfrm/xfrm_device.c +15 −5
  1006. net/xfrm/xfrm_input.c +18 −7
  1007. net/xfrm/xfrm_interface.c +186 −20
  1008. net/xfrm/xfrm_ipcomp.c +8 −3
  1009. net/xfrm/xfrm_policy.c +12 −13
  1010. net/xfrm/xfrm_replay.c +7 −3
  1011. net/xfrm/xfrm_state.c +21 −9
  1012. net/xfrm/xfrm_user.c +250 −120
  1013. rust/.gitignore +8 −0
  1014. rust/Makefile +381 −0
  1015. rust/alloc/README.md +33 −0
  1016. rust/alloc/alloc.rs +440 −0
  1017. rust/alloc/borrow.rs +498 −0
  1018. rust/alloc/boxed.rs +2028 −0
  1019. rust/alloc/collections/mod.rs +156 −0
  1020. rust/alloc/lib.rs +244 −0
  1021. rust/alloc/raw_vec.rs +527 −0
  1022. rust/alloc/slice.rs +1204 −0
  1023. rust/alloc/vec/drain.rs +186 −0
  1024. rust/alloc/vec/drain_filter.rs +145 −0
  1025. rust/alloc/vec/into_iter.rs +366 −0
  1026. rust/alloc/vec/is_zero.rs +120 −0
  1027. rust/alloc/vec/mod.rs +3140 −0
  1028. rust/alloc/vec/partial_eq.rs +49 −0
  1029. rust/bindgen_parameters +21 −0
  1030. rust/bindings/bindings_helper.h +13 −0
  1031. rust/bindings/lib.rs +53 −0
  1032. rust/compiler_builtins.rs +63 −0
  1033. rust/exports.c +21 −0
  1034. rust/helpers.c +51 −0
  1035. rust/kernel/allocator.rs +64 −0
  1036. rust/kernel/error.rs +59 −0
  1037. rust/kernel/lib.rs +78 −0
  1038. rust/kernel/prelude.rs +20 −0
  1039. rust/kernel/print.rs +198 −0
  1040. rust/kernel/str.rs +72 −0
  1041. rust/macros/helpers.rs +51 −0
  1042. rust/macros/lib.rs +72 −0
  1043. rust/macros/module.rs +282 −0
  1044. samples/Kconfig +2 −0
  1045. samples/Makefile +1 −0
  1046. samples/bpf/task_fd_query_kern.c +1 −1
  1047. samples/bpf/task_fd_query_user.c +1 −1
  1048. samples/bpf/tracex3_kern.c +1 −1
  1049. samples/bpf/xdp_router_ipv4_user.c +1 −1
  1050. samples/landlock/sandboxer.c +29 −8
  1051. samples/rust/Kconfig +30 −0
  1052. samples/rust/Makefile +5 −0
  1053. samples/rust/hostprogs/.gitignore +3 −0
  1054. samples/rust/hostprogs/Makefile +5 −0
  1055. samples/rust/hostprogs/a.rs +7 −0
  1056. samples/rust/hostprogs/b.rs +5 −0
  1057. samples/rust/hostprogs/single.rs +12 −0
  1058. samples/rust/rust_minimal.rs +38 −0
  1059. scripts/.gitignore +1 −0
  1060. scripts/Kconfig.include +3 −3
  1061. scripts/Makefile +3 −0
  1062. scripts/Makefile.build +60 −0
  1063. scripts/Makefile.debug +8 −0
  1064. scripts/Makefile.extrawarn +1 −0
  1065. scripts/Makefile.host +31 −3
  1066. scripts/Makefile.lib +12 −0
  1067. scripts/Makefile.modfinal +5 −3
  1068. scripts/cc-version.sh +6 −6
  1069. scripts/checkpatch.pl +12 −8
  1070. scripts/decode_stacktrace.sh +14 −0
  1071. scripts/generate_rust_analyzer.py +135 −0
  1072. scripts/generate_rust_target.rs +182 −0
  1073. scripts/is_rust_module.sh +16 −0
  1074. scripts/kallsyms.c +47 −7
  1075. scripts/kconfig/confdata.c +75 −0
  1076. scripts/min-tool-version.sh +6 −0
  1077. scripts/module.lds.S +4 −19
  1078. scripts/rust_is_available.sh +160 −0
  1079. scripts/rust_is_available_bindgen_libclang.h +2 −0
  1080. scripts/selinux/install_policy.sh +2 −3
  1081. security/Kconfig.hardening +10 −4
  1082. security/integrity/evm/evm_main.c +14 −3
  1083. security/integrity/ima/ima_appraise.c +8 −4
  1084. security/integrity/platform_certs/load_uefi.c +1 −1
  1085. security/keys/internal.h +0 −2
  1086. security/landlock/fs.c +1 −1
  1087. security/landlock/syscalls.c +20 −20
  1088. security/loadpin/Kconfig +6 −1
  1089. security/loadpin/loadpin.c +15 −1
  1090. security/lockdown/lockdown.c +1 −1
  1091. security/lsm_audit.c +1 −13
  1092. security/security.c +5 −0
  1093. security/selinux/hooks.c +18 −15
  1094. security/selinux/include/classmap.h +2 −0
  1095. security/selinux/selinuxfs.c +6 −9
  1096. security/selinux/ss/context.h +9 −8
  1097. security/selinux/ss/ebitmap.c +11 −10
  1098. security/selinux/ss/ebitmap.h +9 −9
  1099. security/selinux/ss/mls_types.h +2 −2
  1100. security/smack/smack.h +0 −9
  1101. security/smack/smack_lsm.c +17 −3
  1102. tools/bpf/bpftool/Documentation/bpftool-map.rst +1 −1
  1103. tools/bpf/bpftool/btf.c +5 −11
  1104. tools/bpf/bpftool/cgroup.c +49 −5
  1105. tools/bpf/bpftool/gen.c +2 −2
  1106. tools/bpf/bpftool/link.c +19 −0
  1107. tools/bpf/bpftool/map.c +1 −1
  1108. tools/bpf/bpftool/map_perf_ring.c +3 −11
  1109. tools/include/linux/kallsyms.h +1 −1
  1110. tools/include/nolibc/arch-riscv.h +1 −1
  1111. tools/include/nolibc/sys.h +2 −2
  1112. tools/include/uapi/linux/bpf.h +60 −6
  1113. tools/lib/bpf/bpf_helpers.h +6 −25
  1114. tools/lib/bpf/bpf_tracing.h +107 −0
  1115. tools/lib/bpf/btf.c +13 −19
  1116. tools/lib/bpf/btf.h +24 −1
  1117. tools/lib/bpf/btf_dump.c +1 −1
  1118. tools/lib/bpf/libbpf.c +50 −56
  1119. tools/lib/bpf/libbpf.h +110 −1
  1120. tools/lib/bpf/libbpf.map +10 −0
  1121. tools/lib/bpf/libbpf_probes.c +1 −0
  1122. tools/lib/bpf/libbpf_version.h +1 −1
  1123. tools/lib/bpf/nlattr.c +1 −1
  1124. tools/lib/bpf/ringbuf.c +271 −0
  1125. tools/lib/bpf/usdt.c +1 −1
  1126. tools/lib/perf/include/perf/event.h +1 −1
  1127. tools/lib/symbol/kallsyms.h +1 −1
  1128. tools/memory-model/Documentation/litmus-tests.txt +27 −10
  1129. tools/objtool/check.c +10 −1
  1130. tools/objtool/elf.c +6 −1
  1131. tools/perf/tests/mmap-basic.c +1 −2
  1132. tools/perf/tests/perf-record.c +1 −1
  1133. tools/perf/tests/shell/record.sh +1 −1
  1134. tools/perf/tests/shell/test_brstack.sh +2 −1
  1135. tools/perf/tests/vmlinux-kallsyms.c +3 −2
  1136. tools/perf/util/Build +1 −1
  1137. tools/perf/util/arm-spe.c +1 −1
  1138. tools/perf/util/bpf_skel/bperf_cgroup.bpf.c +10 −1
  1139. tools/perf/util/bpf_skel/off_cpu.bpf.c +14 −4
  1140. tools/perf/util/parse-events-hybrid.c +17 −4
  1141. tools/perf/util/parse-events.c +39 −0
  1142. tools/perf/util/parse-events.h +1 −0
  1143. tools/perf/util/print-events.c +0 −39
  1144. tools/perf/util/scripting-engines/Build +1 −1
  1145. tools/power/acpi/tools/pfrut/pfrut.c +1 −1
  1146. tools/testing/selftests/bpf/.gitignore +2 −0
  1147. tools/testing/selftests/bpf/DENYLIST.s390x +5 −0
  1148. tools/testing/selftests/bpf/Makefile +21 −6
  1149. tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c +48 −0
  1150. tools/testing/selftests/bpf/config +20 −13
  1151. tools/testing/selftests/bpf/config.x86_64 +1 −6
  1152. tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c +2 −0
  1153. tools/testing/selftests/bpf/map_tests/htab_map_batch_ops.c +2 −0
  1154. tools/testing/selftests/bpf/map_tests/lpm_trie_map_batch_ops.c +2 −0
  1155. tools/testing/selftests/bpf/map_tests/task_storage_map.c +6 −1
  1156. tools/testing/selftests/bpf/prog_tests/bpf_iter.c +261 −21
  1157. tools/testing/selftests/bpf/prog_tests/bpf_nf.c +10 −3
  1158. tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c +4 −0
  1159. tools/testing/selftests/bpf/prog_tests/btf_dump.c +1 −1
  1160. tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c +0 −20
  1161. tools/testing/selftests/bpf/prog_tests/cgroup_hierarchical_stats.c +76 −94
  1162. tools/testing/selftests/bpf/prog_tests/cgroup_link.c +4 −7
  1163. tools/testing/selftests/bpf/prog_tests/connect_ping.c +178 −0
  1164. tools/testing/selftests/bpf/prog_tests/deny_namespace.c +102 −0
  1165. tools/testing/selftests/bpf/prog_tests/dynptr.c +1 −1
  1166. tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c +48 −11
  1167. tools/testing/selftests/bpf/prog_tests/kfunc_call.c +206 −21
  1168. tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +164 −0
  1169. tools/testing/selftests/bpf/prog_tests/lookup_key.c +112 −0
  1170. tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +33 −54
  1171. tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c +10 −29
  1172. tools/testing/selftests/bpf/prog_tests/sockopt.c +2 −2
  1173. tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c +13 −17
  1174. tools/testing/selftests/bpf/prog_tests/sockopt_multi.c +5 −5
  1175. tools/testing/selftests/bpf/prog_tests/sockopt_sk.c +1 −1
  1176. tools/testing/selftests/bpf/prog_tests/tcp_estats.c +1 −3
  1177. tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c +28 −72
  1178. tools/testing/selftests/bpf/prog_tests/tcp_rtt.c +5 −8
  1179. tools/testing/selftests/bpf/prog_tests/tcpbpf_user.c +12 −20
  1180. tools/testing/selftests/bpf/prog_tests/tracing_struct.c +63 −0
  1181. tools/testing/selftests/bpf/prog_tests/udp_limit.c +7 −11
  1182. tools/testing/selftests/bpf/prog_tests/user_ringbuf.c +754 −0
  1183. tools/testing/selftests/bpf/prog_tests/verify_pkcs7_sig.c +399 −0
  1184. tools/testing/selftests/bpf/progs/bpf_dctcp.c +17 −8
  1185. tools/testing/selftests/bpf/progs/bpf_iter_task.c +9 −0
  1186. tools/testing/selftests/bpf/progs/bpf_iter_task_file.c +8 −1
  1187. tools/testing/selftests/bpf/progs/bpf_iter_task_vma.c +6 −1
  1188. tools/testing/selftests/bpf/progs/bpf_iter_vma_offset.c +37 −0
  1189. tools/testing/selftests/bpf/progs/cgroup_hierarchical_stats.c +55 −126
  1190. tools/testing/selftests/bpf/progs/connect_ping.c +53 −0
  1191. tools/testing/selftests/bpf/progs/get_func_ip_test.c +13 −12
  1192. tools/testing/selftests/bpf/progs/kfunc_call_fail.c +160 −0
  1193. tools/testing/selftests/bpf/progs/kfunc_call_test.c +71 −0
  1194. tools/testing/selftests/bpf/progs/kprobe_multi.c +1 −3
  1195. tools/testing/selftests/bpf/progs/test_bpf_nf.c +38 −5
  1196. tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c +14 −0
  1197. tools/testing/selftests/bpf/progs/test_deny_namespace.c +33 −0
  1198. tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c +94 −0
  1199. tools/testing/selftests/bpf/progs/test_lookup_key.c +46 −0
  1200. tools/testing/selftests/bpf/progs/test_user_ringbuf.h +35 −0
  1201. tools/testing/selftests/bpf/progs/test_verif_scale1.c +1 −1
  1202. tools/testing/selftests/bpf/progs/test_verif_scale3.c +1 −1
  1203. tools/testing/selftests/bpf/progs/test_verify_pkcs7_sig.c +90 −0
  1204. tools/testing/selftests/bpf/progs/timer.c +2 −2
  1205. tools/testing/selftests/bpf/progs/tracing_struct.c +120 −0
  1206. tools/testing/selftests/bpf/progs/user_ringbuf_fail.c +177 −0
  1207. tools/testing/selftests/bpf/progs/user_ringbuf_success.c +218 −0
  1208. tools/testing/selftests/bpf/test_kmod.sh +13 −7
  1209. tools/testing/selftests/bpf/test_maps.c +16 −10
  1210. tools/testing/selftests/bpf/test_maps.h +2 −0
  1211. tools/testing/selftests/bpf/test_progs.c +17 −0
  1212. tools/testing/selftests/bpf/test_progs.h +1 −0
  1213. tools/testing/selftests/bpf/test_sockmap.c +42 −0
  1214. tools/testing/selftests/bpf/test_verifier.c +2 −1
  1215. tools/testing/selftests/bpf/verifier/calls.c +1 −1
  1216. tools/testing/selftests/bpf/verifier/ref_tracking.c +139 −0
  1217. tools/testing/selftests/bpf/verifier/var_off.c +1 −1
  1218. tools/testing/selftests/bpf/verify_sig_setup.sh +104 −0
  1219. tools/testing/selftests/bpf/veristat.c +1322 −0
  1220. tools/testing/selftests/bpf/veristat.cfg +17 −0
  1221. tools/testing/selftests/bpf/xskxceiver.c +4 −3
  1222. tools/testing/selftests/kvm/Makefile +10 −1
  1223. tools/testing/selftests/kvm/access_tracking_perf_test.c +16 −9
  1224. tools/testing/selftests/kvm/include/x86_64/vmx.h +1 −0
  1225. tools/testing/selftests/kvm/lib/assert.c +13 −7
  1226. tools/testing/selftests/kvm/lib/string_override.c +39 −0
  1227. tools/testing/selftests/kvm/lib/x86_64/vmx.c +20 −0
  1228. tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c +16 −18
  1229. tools/testing/selftests/lkdtm/tests.txt +5 −3
  1230. tools/testing/selftests/net/ipsec.c +45 −59
  1231. tools/testing/selftests/net/mptcp/mptcp_connect.c +57 −8
  1232. tools/testing/selftests/net/mptcp/mptcp_join.sh +73 −17
  1233. tools/testing/selftests/nolibc/.gitignore +4 −0
  1234. tools/testing/selftests/nolibc/Makefile +135 −0
  1235. tools/testing/selftests/nolibc/nolibc-test.c +757 −0
  1236. tools/testing/selftests/tc-testing/config +24 −1
  1237. tools/virtio/linux/virtio.h +3 −0
  1238. tools/virtio/linux/virtio_config.h +5 −0
.gitignore+6−0
@@ -37,6 +37,8 @@ · 36 unmodified lines
3737 *.o
3838 *.o.*
3939 *.patch
40+*.rmeta
41+*.rsi
4042 *.s
4143 *.so
4244 *.so.dbg
@@ -97,6 +99,7 @@ modules.order · 54 unmodified lines
9799 !.gitattributes
98100 !.gitignore
99101 !.mailmap
102+!.rustfmt.toml
100103
101104 #
102105 # Generated include files
@@ -162,3 +165,6 @@ x509.genkey · 59 unmodified lines
162165
163166 # Documentation toolchain
164167 sphinx_*/
168+
169+# Rust analyzer configuration
170+/rust-project.json
.rustfmt.toml+12−0
@@ -0,0 +1,12 @@
1+edition = "2021"
2+newline_style = "Unix"
3+
4+# Unstable options that help catching some mistakes in formatting and that we may want to enable
5+# when they become stable.
6+#
7+# They are kept here since they are useful to run from time to time.
8+#format_code_in_doc_comments = true
9+#reorder_impl_items = true
10+#comment_width = 100
11+#wrap_comments = true
12+#normalize_comments = true
Documentation/ABI/testing/sysfs-bus-bcma+1−1
@@ -3,7 +3,7 @@ Date: May 2011 · 2 unmodified lines
33 KernelVersion: 3.0
44 Contact: Rafał Miłecki <zajec5@gmail.com>
55 Description:
6− Each BCMA core has it's manufacturer id. See
6+ Each BCMA core has its manufacturer id. See
77 include/linux/bcma/bcma.h for possible values.
88
99 What: /sys/bus/bcma/devices/.../id
Documentation/ABI/testing/sysfs-bus-fcoe+1−1
@@ -31,7 +31,7 @@ Description: 'FCoE Controller' instances on the fcoe bus. · 30 unmodified lines
3131 1) Write interface name to ctlr_create 2) Configure the FCoE
3232 Controller (ctlr_X) 3) Enable the FCoE Controller to begin
3333 discovery and login. The FCoE Controller is destroyed by
34− writing it's name, i.e. ctlr_X to the ctlr_delete file.
34+ writing its name, i.e. ctlr_X to the ctlr_delete file.
3535
3636 Attributes:
3737
Documentation/ABI/testing/sysfs-bus-iio-proximity+1−1
@@ -18,7 +18,7 @@ Description: · 17 unmodified lines
1818 on the signal from which time of flight measurements are
1919 taken.
2020 The appropriate values to take is dependent on both the
21− sensor and it's operating environment:
21+ sensor and its operating environment:
2222 * as3935 (0-31 range)
2323 18 = indoors (default)
2424 14 = outdoors
Documentation/ABI/testing/sysfs-devices-system-cpu+1−1
@@ -296,7 +296,7 @@ Description: Processor frequency boosting control · 295 unmodified lines
296296
297297 This switch controls the boost setting for the whole system.
298298 Boosting allows the CPU and the firmware to run at a frequency
299− beyond it's nominal limit.
299+ beyond its nominal limit.
300300
301301 More details can be found in
302302 Documentation/admin-guide/pm/cpufreq.rst
Documentation/ABI/testing/sysfs-platform-chipidea-usb2+3−3
@@ -2,8 +2,8 @@ What: /sys/bus/platform/devices/ci_hdrc.0/role · 1 unmodified line
22 Date: Mar 2017
33 Contact: Peter Chen <peter.chen@nxp.com>
44 Description:
5− It returns string "gadget" or "host" when read it, it indicates
6− current controller role.
5+ When read, it returns string "gadget" or "host", indicating
6+ the current controller role.
77
8− It will do role switch when write "gadget" or "host" to it.
8+ It will do role switch when "gadget" or "host" is written to it.
99 Only controller at dual-role configuration supports writing.
Documentation/ABI/testing/sysfs-power+1−1
@@ -152,7 +152,7 @@ Description: · 151 unmodified lines
152152 case further investigation is required to determine which
153153 device is causing the problem. Note that genuine RTC clock
154154 values (such as when pm_trace has not been used), can still
155− match a device and output it's name here.
155+ match a device and output its name here.
156156
157157 What: /sys/power/pm_async
158158 Date: January 2009
Documentation/RCU/checklist.rst+13−4
@@ -66,8 +66,13 @@ over a rather long period of time, but improvements are always welcome! · 65 unmodified lines
6666 As a rough rule of thumb, any dereference of an RCU-protected
6767 pointer must be covered by rcu_read_lock(), rcu_read_lock_bh(),
6868 rcu_read_lock_sched(), or by the appropriate update-side lock.
69− Disabling of preemption can serve as rcu_read_lock_sched(), but
70− is less readable and prevents lockdep from detecting locking issues.
69+ Explicit disabling of preemption (preempt_disable(), for example)
70+ can serve as rcu_read_lock_sched(), but is less readable and
71+ prevents lockdep from detecting locking issues.
72+
73+ Please not that you *cannot* rely on code known to be built
74+ only in non-preemptible kernels. Such code can and will break,
75+ especially in kernels built with CONFIG_PREEMPT_COUNT=y.
7176
7277 Letting RCU-protected pointers "leak" out of an RCU read-side
7378 critical section is every bit as bad as letting them leak out
@@ -185,6 +190,9 @@ over a rather long period of time, but improvements are always welcome! · 111 unmodified lines
185190
186191 5. If call_rcu() or call_srcu() is used, the callback function will
187192 be called from softirq context. In particular, it cannot block.
193+ If you need the callback to block, run that code in a workqueue
194+ handler scheduled from the callback. The queue_rcu_work()
195+ function does this for you in the case of call_rcu().
188196
189197 6. Since synchronize_rcu() can block, it cannot be called
190198 from any sort of irq context. The same rule applies
@@ -297,7 +305,8 @@ over a rather long period of time, but improvements are always welcome! · 106 unmodified lines
297305 the machine.
298306
299307 d. Periodically invoke synchronize_rcu(), permitting a limited
300− number of updates per grace period.
308+ number of updates per grace period. Better yet, periodically
309+ invoke rcu_barrier() to wait for all outstanding callbacks.
301310
302311 The same cautions apply to call_srcu() and kfree_rcu().
303312
@@ -477,6 +486,6 @@ over a rather long period of time, but improvements are always welcome! · 173 unmodified lines
477486 So if you need to wait for both an RCU grace period and for
478487 all pre-existing call_rcu() callbacks, you will need to execute
479488 both rcu_barrier() and synchronize_rcu(), if necessary, using
480− something like workqueues to to execute them concurrently.
489+ something like workqueues to execute them concurrently.
481490
482491 See rcubarrier.rst for more information.
Documentation/RCU/lockdep.rst+1−1
@@ -61,7 +61,7 @@ checking of rcu_dereference() primitives: · 60 unmodified lines
6161 rcu_access_pointer(p):
6262 Return the value of the pointer and omit all barriers,
6363 but retain the compiler constraints that prevent duplicating
64− or coalescsing. This is useful when when testing the
64+ or coalescsing. This is useful when testing the
6565 value of the pointer itself, for example, against NULL.
6666
6767 The rcu_dereference_check() check expression can be any boolean
Documentation/RCU/rcu_dereference.rst+10−4
@@ -128,10 +128,16 @@ Follow these rules to keep your RCU code working properly: · 127 unmodified lines
128128 This sort of comparison occurs frequently when scanning
129129 RCU-protected circular linked lists.
130130
131− Note that if checks for being within an RCU read-side
132− critical section are not required and the pointer is never
133− dereferenced, rcu_access_pointer() should be used in place
134− of rcu_dereference().
131+ Note that if the pointer comparison is done outside
132+ of an RCU read-side critical section, and the pointer
133+ is never dereferenced, rcu_access_pointer() should be
134+ used in place of rcu_dereference(). In most cases,
135+ it is best to avoid accidental dereferences by testing
136+ the rcu_access_pointer() return value directly, without
137+ assigning it to a variable.
138+
139+ Within an RCU read-side critical section, there is little
140+ reason to use rcu_access_pointer().
135141
136142 - The comparison is against a pointer that references memory
137143 that was initialized "a long time ago." The reason
Documentation/RCU/whatisRCU.rst+30−17
@@ -6,13 +6,15 @@ What is RCU? -- "Read, Copy, Update" · 5 unmodified lines
66 Please note that the "What is RCU?" LWN series is an excellent place
77 to start learning about RCU:
88
9−| 1. What is RCU, Fundamentally? http://lwn.net/Articles/262464/
10−| 2. What is RCU? Part 2: Usage http://lwn.net/Articles/263130/
11−| 3. RCU part 3: the RCU API http://lwn.net/Articles/264090/
12−| 4. The RCU API, 2010 Edition http://lwn.net/Articles/418853/
13−| 2010 Big API Table http://lwn.net/Articles/419086/
14−| 5. The RCU API, 2014 Edition http://lwn.net/Articles/609904/
15−| 2014 Big API Table http://lwn.net/Articles/609973/
9+| 1. What is RCU, Fundamentally? https://lwn.net/Articles/262464/
10+| 2. What is RCU? Part 2: Usage https://lwn.net/Articles/263130/
11+| 3. RCU part 3: the RCU API https://lwn.net/Articles/264090/
12+| 4. The RCU API, 2010 Edition https://lwn.net/Articles/418853/
13+| 2010 Big API Table https://lwn.net/Articles/419086/
14+| 5. The RCU API, 2014 Edition https://lwn.net/Articles/609904/
15+| 2014 Big API Table https://lwn.net/Articles/609973/
16+| 6. The RCU API, 2019 Edition https://lwn.net/Articles/777036/
17+| 2019 Big API Table https://lwn.net/Articles/777165/
1618
1719
1820 What is RCU?
@@ -915,13 +917,18 @@ which an RCU reference is held include: · 896 unmodified lines
915917 The understanding that RCU provides a reference that only prevents a
916918 change of type is particularly visible with objects allocated from a
917919 slab cache marked ``SLAB_TYPESAFE_BY_RCU``. RCU operations may yield a
918−reference to an object from such a cache that has been concurrently
919−freed and the memory reallocated to a completely different object,
920−though of the same type. In this case RCU doesn't even protect the
921−identity of the object from changing, only its type. So the object
922−found may not be the one expected, but it will be one where it is safe
923−to take a reference or spinlock and then confirm that the identity
924−matches the expectations.
920+reference to an object from such a cache that has been concurrently freed
921+and the memory reallocated to a completely different object, though of
922+the same type. In this case RCU doesn't even protect the identity of the
923+object from changing, only its type. So the object found may not be the
924+one expected, but it will be one where it is safe to take a reference
925+(and then potentially acquiring a spinlock), allowing subsequent code
926+to check whether the identity matches expectations. It is tempting
927+to simply acquire the spinlock without first taking the reference, but
928+unfortunately any spinlock in a ``SLAB_TYPESAFE_BY_RCU`` object must be
929+initialized after each and every call to kmem_cache_alloc(), which renders
930+reference-free spinlock acquisition completely unsafe. Therefore, when
931+using ``SLAB_TYPESAFE_BY_RCU``, make proper use of a reference counter.
925932
926933 With traditional reference counting -- such as that implemented by the
927934 kref library in Linux -- there is typically code that runs when the last
@@ -1057,14 +1064,20 @@ SRCU: Initialization/cleanup:: · 129 unmodified lines
10571064 init_srcu_struct
10581065 cleanup_srcu_struct
10591066
1060−All: lockdep-checked RCU-protected pointer access::
1067+All: lockdep-checked RCU utility APIs::
10611068
1062− rcu_access_pointer
1063− rcu_dereference_raw
10641069 RCU_LOCKDEP_WARN
10651070 rcu_sleep_check
10661071 RCU_NONIDLE
10671072
1073+All: Unchecked RCU-protected pointer access::
1074+
1075+ rcu_dereference_raw
1076+
1077+All: Unchecked RCU-protected pointer access with dereferencing prohibited::
1078+
1079+ rcu_access_pointer
1080+
10681081 See the comment headers in the source code (or the docbook generated
10691082 from them) for more information.
10701083
Documentation/admin-guide/README.rst+7−84
@@ -262,8 +262,6 @@ Compiling the kernel · 261 unmodified lines
262262 - Make sure you have at least gcc 5.1 available.
263263 For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
264264
265− Please note that you can still run a.out user programs with this kernel.
266−
267265 - Do a ``make`` to create a compressed kernel image. It is also
268266 possible to do ``make install`` if you have lilo installed to suit the
269267 kernel makefiles, but you may want to check your particular lilo setup first.
@@ -332,85 +330,10 @@ Compiling the kernel · 62 unmodified lines
332330 If something goes wrong
333331 -----------------------
334332
335− - If you have problems that seem to be due to kernel bugs, please check
336− the file MAINTAINERS to see if there is a particular person associated
337− with the part of the kernel that you are having trouble with. If there
338− isn't anyone listed there, then the second best thing is to mail
339− them to me (torvalds@linux-foundation.org), and possibly to any other
340− relevant mailing-list or to the newsgroup.
341−
342− - In all bug-reports, *please* tell what kernel you are talking about,
343− how to duplicate the problem, and what your setup is (use your common
344− sense). If the problem is new, tell me so, and if the problem is
345− old, please try to tell me when you first noticed it.
346−
347− - If the bug results in a message like::
348−
349− unable to handle kernel paging request at address C0000010
350− Oops: 0002
351− EIP: 0010:XXXXXXXX
352− eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx
353− esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx
354− ds: xxxx es: xxxx fs: xxxx gs: xxxx
355− Pid: xx, process nr: xx
356− xx xx xx xx xx xx xx xx xx xx
357−
358− or similar kernel debugging information on your screen or in your
359− system log, please duplicate it *exactly*. The dump may look
360− incomprehensible to you, but it does contain information that may
361− help debugging the problem. The text above the dump is also
362− important: it tells something about why the kernel dumped code (in
363− the above example, it's due to a bad kernel pointer). More information
364− on making sense of the dump is in Documentation/admin-guide/bug-hunting.rst
365−
366− - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump
367− as is, otherwise you will have to use the ``ksymoops`` program to make
368− sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred).
369− This utility can be downloaded from
370− https://www.kernel.org/pub/linux/utils/kernel/ksymoops/ .
371− Alternatively, you can do the dump lookup by hand:
372−
373− - In debugging dumps like the above, it helps enormously if you can
374− look up what the EIP value means. The hex value as such doesn't help
375− me or anybody else very much: it will depend on your particular
376− kernel setup. What you should do is take the hex value from the EIP
377− line (ignore the ``0010:``), and look it up in the kernel namelist to
378− see which kernel function contains the offending address.
379−
380− To find out the kernel function name, you'll need to find the system
381− binary associated with the kernel that exhibited the symptom. This is
382− the file 'linux/vmlinux'. To extract the namelist and match it against
383− the EIP from the kernel crash, do::
384−
385− nm vmlinux | sort | less
386−
387− This will give you a list of kernel addresses sorted in ascending
388− order, from which it is simple to find the function that contains the
389− offending address. Note that the address given by the kernel
390− debugging messages will not necessarily match exactly with the
391− function addresses (in fact, that is very unlikely), so you can't
392− just 'grep' the list: the list will, however, give you the starting
393− point of each kernel function, so by looking for the function that
394− has a starting address lower than the one you are searching for but
395− is followed by a function with a higher address you will find the one
396− you want. In fact, it may be a good idea to include a bit of
397− "context" in your problem report, giving a few lines around the
398− interesting one.
399−
400− If you for some reason cannot do the above (you have a pre-compiled
401− kernel image or similar), telling me as much about your setup as
402− possible will help. Please read
403− 'Documentation/admin-guide/reporting-issues.rst' for details.
404−
405− - Alternatively, you can use gdb on a running kernel. (read-only; i.e. you
406− cannot change values or set break points.) To do this, first compile the
407− kernel with -g; edit arch/x86/Makefile appropriately, then do a ``make
408− clean``. You'll also need to enable CONFIG_PROC_FS (via ``make config``).
409−
410− After you've rebooted with the new kernel, do ``gdb vmlinux /proc/kcore``.
411− You can now use all the usual gdb commands. The command to look up the
412− point where your system crashed is ``l *0xXXXXXXXX``. (Replace the XXXes
413− with the EIP value.)
414−
415− gdb'ing a non-running kernel currently fails because ``gdb`` (wrongly)
416− disregards the starting offset for which the kernel is compiled.
333+If you have problems that seem to be due to kernel bugs, please follow the
334+instructions at 'Documentation/admin-guide/reporting-issues.rst'.
335+
336+Hints on understanding kernel bug reports are in
337+'Documentation/admin-guide/bug-hunting.rst'. More on debugging the kernel
338+with gdb is in 'Documentation/dev-tools/gdb-kernel-debugging.rst' and
339+'Documentation/dev-tools/kgdb.rst'.
Documentation/admin-guide/acpi/dsdt-override.rst+0−13
@@ -1,13 +0,0 @@
1−.. SPDX-License-Identifier: GPL-2.0
2−
3−===============
4−Overriding DSDT
5−===============
6−
7−Linux supports a method of overriding the BIOS DSDT:
8−
9−CONFIG_ACPI_CUSTOM_DSDT - builds the image into the kernel.
10−
11−When to use this method is described in detail on the
12−Linux/ACPI home page:
13−https://01.org/linux-acpi/documentation/overriding-dsdt
Documentation/admin-guide/hw-vuln/spectre.rst+1−0
@@ -613,6 +613,7 @@ kernel command line. · 612 unmodified lines
613613 eibrs enhanced IBRS
614614 eibrs,retpoline enhanced IBRS + Retpolines
615615 eibrs,lfence enhanced IBRS + LFENCE
616+ ibrs use IBRS to protect kernel
616617
617618 Not specifying this option is equivalent to
618619 spectre_v2=auto.
Documentation/admin-guide/kdump/vmcoreinfo.rst+1−1
@@ -200,7 +200,7 @@ prb · 199 unmodified lines
200200
201201 A pointer to the printk ringbuffer (struct printk_ringbuffer). This
202202 may be pointing to the static boot ringbuffer or the dynamically
203−allocated ringbuffer, depending on when the the core dump occurred.
203+allocated ringbuffer, depending on when the core dump occurred.
204204 Used by user-space tools to read the active kernel log buffer.
205205
206206 printk_rb_static
Documentation/admin-guide/kernel-parameters.txt+4−0
@@ -3801,6 +3801,10 @@ · 3800 unmodified lines
38013801
38023802 nox2apic [X86-64,APIC] Do not enable x2APIC mode.
38033803
3804+ NOTE: this parameter will be ignored on systems with the
3805+ LEGACY_XAPIC_DISABLED bit set in the
3806+ IA32_XAPIC_DISABLE_STATUS MSR.
3807+
38043808 nps_mtm_hs_ctr= [KNL,ARC]
38053809 This parameter sets the maximum duration, in
38063810 cycles, each HW thread of the CTOP can run
Documentation/admin-guide/mm/hugetlbpage.rst+1−1
@@ -65,7 +65,7 @@ HugePages_Surp · 64 unmodified lines
6565 may be temporarily larger than the maximum number of surplus huge
6666 pages when the system is under memory pressure.
6767 Hugepagesize
68− is the default hugepage size (in Kb).
68+ is the default hugepage size (in kB).
6969 Hugetlb
7070 is the total amount of memory (in kB), consumed by huge
7171 pages of all sizes.
Documentation/admin-guide/sysctl/net.rst+3−0
@@ -102,6 +102,9 @@ Values: · 101 unmodified lines
102102 - 1 - enable JIT hardening for unprivileged users only
103103 - 2 - enable JIT hardening for all users
104104
105+where "privileged user" in this context means a process having
106+CAP_BPF or CAP_SYS_ADMIN in the root user name space.
107+
105108 bpf_jit_kallsyms
106109 ----------------
107110
Documentation/admin-guide/tainted-kernels.rst+6−0
@@ -134,6 +134,12 @@ More detailed explanation for tainting · 133 unmodified lines
134134 scsi/snic on something else than x86_64, scsi/ips on non
135135 x86/x86_64/itanium, have broken firmware settings for the
136136 irqchip/irq-gic on arm64 ...).
137+ - x86/x86_64: Microcode late loading is dangerous and will result in
138+ tainting the kernel. It requires that all CPUs rendezvous to make sure
139+ the update happens when the system is as quiescent as possible. However,
140+ a higher priority MCE/SMI/NMI can move control flow away from that
141+ rendezvous and interrupt the update, which can be detrimental to the
142+ machine.
137143
138144 3) ``R`` if a module was force unloaded by ``rmmod -f``, ``' '`` if all
139145 modules were unloaded normally.
Documentation/bpf/clang-notes.rst+30−0
@@ -0,0 +1,30 @@
1+.. contents::
2+.. sectnum::
3+
4+==========================
5+Clang implementation notes
6+==========================
7+
8+This document provides more details specific to the Clang/LLVM implementation of the eBPF instruction set.
9+
10+Versions
11+========
12+
13+Clang defined "CPU" versions, where a CPU version of 3 corresponds to the current eBPF ISA.
14+
15+Clang can select the eBPF ISA version using ``-mcpu=v3`` for example to select version 3.
16+
17+Arithmetic instructions
18+=======================
19+
20+For CPU versions prior to 3, Clang v7.0 and later can enable ``BPF_ALU`` support with
21+``-Xclang -target-feature -Xclang +alu32``. In CPU version 3, support is automatically included.
22+
23+Atomic operations
24+=================
25+
26+Clang can generate atomic instructions by default when ``-mcpu=v3`` is
27+enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction
28+Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable
29+the atomics features, while keeping a lower ``-mcpu`` version, you can use
30+``-Xclang -target-feature -Xclang +alu32``.
Documentation/bpf/index.rst+2−0
@@ -26,6 +26,8 @@ that goes into great technical depth about the BPF Architecture. · 25 unmodified lines
2626 classic_vs_extended.rst
2727 bpf_licensing
2828 test_debug
29+ clang-notes
30+ linux-notes
2931 other
3032
3133 .. only:: subproject and html
Documentation/bpf/instruction-set.rst+140−178
@@ -1,7 +1,12 @@
1+.. contents::
2+.. sectnum::
3+
4+========================================
5+eBPF Instruction Set Specification, v1.0
6+========================================
7+
8+This document specifies version 1.0 of the eBPF instruction set.
19
2−====================
3−eBPF Instruction Set
4−====================
510
611 Registers and calling convention
712 ================================
@@ -11,10 +16,10 @@ all of which are 64-bits wide. · 3 unmodified lines
1116
1217 The eBPF calling convention is defined as:
1318
14− * R0: return value from function calls, and exit value for eBPF programs
15− * R1 - R5: arguments for function calls
16− * R6 - R9: callee saved registers that function calls will preserve
17− * R10: read-only frame pointer to access stack
19+* R0: return value from function calls, and exit value for eBPF programs
20+* R1 - R5: arguments for function calls
21+* R6 - R9: callee saved registers that function calls will preserve
22+* R10: read-only frame pointer to access stack
1823
1924 R0 - R5 are scratch registers and eBPF programs needs to spill/fill them if
2025 necessary across calls.
@@ -24,17 +29,17 @@ Instruction encoding · 3 unmodified lines
2429
2530 eBPF has two instruction encodings:
2631
27− * the basic instruction encoding, which uses 64 bits to encode an instruction
28− * the wide instruction encoding, which appends a second 64-bit immediate value
29− (imm64) after the basic instruction for a total of 128 bits.
32+* the basic instruction encoding, which uses 64 bits to encode an instruction
33+* the wide instruction encoding, which appends a second 64-bit immediate value
34+ (imm64) after the basic instruction for a total of 128 bits.
3035
3136 The basic instruction encoding looks as follows:
3237
33− ============= ======= =============== ==================== ============
34− 32 bits (MSB) 16 bits 4 bits 4 bits 8 bits (LSB)
35− ============= ======= =============== ==================== ============
36− immediate offset source register destination register opcode
37− ============= ======= =============== ==================== ============
38+============= ======= =============== ==================== ============
39+32 bits (MSB) 16 bits 4 bits 4 bits 8 bits (LSB)
40+============= ======= =============== ==================== ============
41+immediate offset source register destination register opcode
42+============= ======= =============== ==================== ============
3843
3944 Note that most instructions do not use all of the fields.
4045 Unused fields shall be cleared to zero.
@@ -44,30 +49,30 @@ Instruction classes · 3 unmodified lines
4449
4550 The three LSB bits of the 'opcode' field store the instruction class:
4651
47− ========= ===== ===============================
48− class value description
49− ========= ===== ===============================
50− BPF_LD 0x00 non-standard load operations
51− BPF_LDX 0x01 load into register operations
52− BPF_ST 0x02 store from immediate operations
53− BPF_STX 0x03 store from register operations
54− BPF_ALU 0x04 32-bit arithmetic operations
55− BPF_JMP 0x05 64-bit jump operations
56− BPF_JMP32 0x06 32-bit jump operations
57− BPF_ALU64 0x07 64-bit arithmetic operations
58− ========= ===== ===============================
52+========= ===== =============================== ===================================
53+class value description reference
54+========= ===== =============================== ===================================
55+BPF_LD 0x00 non-standard load operations `Load and store instructions`_
56+BPF_LDX 0x01 load into register operations `Load and store instructions`_
57+BPF_ST 0x02 store from immediate operations `Load and store instructions`_
58+BPF_STX 0x03 store from register operations `Load and store instructions`_
59+BPF_ALU 0x04 32-bit arithmetic operations `Arithmetic and jump instructions`_
60+BPF_JMP 0x05 64-bit jump operations `Arithmetic and jump instructions`_
61+BPF_JMP32 0x06 32-bit jump operations `Arithmetic and jump instructions`_
62+BPF_ALU64 0x07 64-bit arithmetic operations `Arithmetic and jump instructions`_
63+========= ===== =============================== ===================================
5964
6065 Arithmetic and jump instructions
6166 ================================
6267
63−For arithmetic and jump instructions (BPF_ALU, BPF_ALU64, BPF_JMP and
64−BPF_JMP32), the 8-bit 'opcode' field is divided into three parts:
68+For arithmetic and jump instructions (``BPF_ALU``, ``BPF_ALU64``, ``BPF_JMP`` and
69+``BPF_JMP32``), the 8-bit 'opcode' field is divided into three parts:
6570
66− ============== ====== =================
67− 4 bits (MSB) 1 bit 3 bits (LSB)
68− ============== ====== =================
69− operation code source instruction class
70− ============== ====== =================
71+============== ====== =================
72+4 bits (MSB) 1 bit 3 bits (LSB)
73+============== ====== =================
74+operation code source instruction class
75+============== ====== =================
7176
7277 The 4th bit encodes the source operand:
7378
@@ -84,66 +89,66 @@ The four MSB bits store the operation code. · 10 unmodified lines
8489 Arithmetic instructions
8590 -----------------------
8691
87−BPF_ALU uses 32-bit wide operands while BPF_ALU64 uses 64-bit wide operands for
92+``BPF_ALU`` uses 32-bit wide operands while ``BPF_ALU64`` uses 64-bit wide operands for
8893 otherwise identical operations.
89−The code field encodes the operation as below:
90−
91− ======== ===== =================================================
92− code value description
93− ======== ===== =================================================
94− BPF_ADD 0x00 dst += src
95− BPF_SUB 0x10 dst -= src
96− BPF_MUL 0x20 dst \*= src
97− BPF_DIV 0x30 dst /= src
98− BPF_OR 0x40 dst \|= src
99− BPF_AND 0x50 dst &= src
100− BPF_LSH 0x60 dst <<= src
101− BPF_RSH 0x70 dst >>= src
102− BPF_NEG 0x80 dst = ~src
103− BPF_MOD 0x90 dst %= src
104− BPF_XOR 0xa0 dst ^= src
105− BPF_MOV 0xb0 dst = src
106− BPF_ARSH 0xc0 sign extending shift right
107− BPF_END 0xd0 byte swap operations (see separate section below)
108− ======== ===== =================================================
109−
110−BPF_ADD | BPF_X | BPF_ALU means::
94+The 'code' field encodes the operation as below:
95+
96+======== ===== ==========================================================
97+code value description
98+======== ===== ==========================================================
99+BPF_ADD 0x00 dst += src
100+BPF_SUB 0x10 dst -= src
101+BPF_MUL 0x20 dst \*= src
102+BPF_DIV 0x30 dst /= src
103+BPF_OR 0x40 dst \|= src
104+BPF_AND 0x50 dst &= src
105+BPF_LSH 0x60 dst <<= src
106+BPF_RSH 0x70 dst >>= src
107+BPF_NEG 0x80 dst = ~src
108+BPF_MOD 0x90 dst %= src
109+BPF_XOR 0xa0 dst ^= src
110+BPF_MOV 0xb0 dst = src
111+BPF_ARSH 0xc0 sign extending shift right
112+BPF_END 0xd0 byte swap operations (see `Byte swap instructions`_ below)
113+======== ===== ==========================================================
114+
115+``BPF_ADD | BPF_X | BPF_ALU`` means::
111116
112117 dst_reg = (u32) dst_reg + (u32) src_reg;
113118
114−BPF_ADD | BPF_X | BPF_ALU64 means::
119+``BPF_ADD | BPF_X | BPF_ALU64`` means::
115120
116121 dst_reg = dst_reg + src_reg
117122
118−BPF_XOR | BPF_K | BPF_ALU means::
123+``BPF_XOR | BPF_K | BPF_ALU`` means::
119124
120125 src_reg = (u32) src_reg ^ (u32) imm32
121126
122−BPF_XOR | BPF_K | BPF_ALU64 means::
127+``BPF_XOR | BPF_K | BPF_ALU64`` means::
123128
124129 src_reg = src_reg ^ imm32
125130
126131
127132 Byte swap instructions
128−----------------------
133+~~~~~~~~~~~~~~~~~~~~~~
129134
130135 The byte swap instructions use an instruction class of ``BPF_ALU`` and a 4-bit
131−code field of ``BPF_END``.
136+'code' field of ``BPF_END``.
132137
133138 The byte swap instructions operate on the destination register
134139 only and do not use a separate source register or immediate value.
135140
136−The 1-bit source operand field in the opcode is used to to select what byte
141+The 1-bit source operand field in the opcode is used to select what byte
137142 order the operation convert from or to:
138143
139− ========= ===== =================================================
140− source value description
141− ========= ===== =================================================
142− BPF_TO_LE 0x00 convert between host byte order and little endian
143− BPF_TO_BE 0x08 convert between host byte order and big endian
144− ========= ===== =================================================
144+========= ===== =================================================
145+source value description
146+========= ===== =================================================
147+BPF_TO_LE 0x00 convert between host byte order and little endian
148+BPF_TO_BE 0x08 convert between host byte order and big endian
149+========= ===== =================================================
145150
146−The imm field encodes the width of the swap operations. The following widths
151+The 'imm' field encodes the width of the swap operations. The following widths
147152 are supported: 16, 32 and 64.
148153
149154 Examples:
@@ -156,35 +161,31 @@ Examples: · 6 unmodified lines
156161
157162 dst_reg = htobe64(dst_reg)
158163
159−``BPF_FROM_LE`` and ``BPF_FROM_BE`` exist as aliases for ``BPF_TO_LE`` and
160−``BPF_TO_BE`` respectively.
161−
162−
163164 Jump instructions
164165 -----------------
165166
166−BPF_JMP32 uses 32-bit wide operands while BPF_JMP uses 64-bit wide operands for
167+``BPF_JMP32`` uses 32-bit wide operands while ``BPF_JMP`` uses 64-bit wide operands for
167168 otherwise identical operations.
168−The code field encodes the operation as below:
169−
170− ======== ===== ========================= ============
171− code value description notes
172− ======== ===== ========================= ============
173− BPF_JA 0x00 PC += off BPF_JMP only
174− BPF_JEQ 0x10 PC += off if dst == src
175− BPF_JGT 0x20 PC += off if dst > src unsigned
176− BPF_JGE 0x30 PC += off if dst >= src unsigned
177− BPF_JSET 0x40 PC += off if dst & src
178− BPF_JNE 0x50 PC += off if dst != src
179− BPF_JSGT 0x60 PC += off if dst > src signed
180− BPF_JSGE 0x70 PC += off if dst >= src signed
181− BPF_CALL 0x80 function call
182− BPF_EXIT 0x90 function / program return BPF_JMP only
183− BPF_JLT 0xa0 PC += off if dst < src unsigned
184− BPF_JLE 0xb0 PC += off if dst <= src unsigned
185− BPF_JSLT 0xc0 PC += off if dst < src signed
186− BPF_JSLE 0xd0 PC += off if dst <= src signed
187− ======== ===== ========================= ============
169+The 'code' field encodes the operation as below:
170+
171+======== ===== ========================= ============
172+code value description notes
173+======== ===== ========================= ============
174+BPF_JA 0x00 PC += off BPF_JMP only
175+BPF_JEQ 0x10 PC += off if dst == src
176+BPF_JGT 0x20 PC += off if dst > src unsigned
177+BPF_JGE 0x30 PC += off if dst >= src unsigned
178+BPF_JSET 0x40 PC += off if dst & src
179+BPF_JNE 0x50 PC += off if dst != src
180+BPF_JSGT 0x60 PC += off if dst > src signed
181+BPF_JSGE 0x70 PC += off if dst >= src signed
182+BPF_CALL 0x80 function call
183+BPF_EXIT 0x90 function / program return BPF_JMP only
184+BPF_JLT 0xa0 PC += off if dst < src unsigned
185+BPF_JLE 0xb0 PC += off if dst <= src unsigned
186+BPF_JSLT 0xc0 PC += off if dst < src signed
187+BPF_JSLE 0xd0 PC += off if dst <= src signed
188+======== ===== ========================= ============
188189
189190 The eBPF program needs to store the return value into register R0 before doing a
190191 BPF_EXIT.
@@ -193,14 +194,26 @@ BPF_EXIT. · 2 unmodified lines
193194 Load and store instructions
194195 ===========================
195196
196−For load and store instructions (BPF_LD, BPF_LDX, BPF_ST and BPF_STX), the
197+For load and store instructions (``BPF_LD``, ``BPF_LDX``, ``BPF_ST``, and ``BPF_STX``), the
197198 8-bit 'opcode' field is divided as:
198199
199− ============ ====== =================
200− 3 bits (MSB) 2 bits 3 bits (LSB)
201− ============ ====== =================
202− mode size instruction class
203− ============ ====== =================
200+============ ====== =================
201+3 bits (MSB) 2 bits 3 bits (LSB)
202+============ ====== =================
203+mode size instruction class
204+============ ====== =================
205+
206+The mode modifier is one of:
207+
208+ ============= ===== ==================================== =============
209+ mode modifier value description reference
210+ ============= ===== ==================================== =============
211+ BPF_IMM 0x00 64-bit immediate instructions `64-bit immediate instructions`_
212+ BPF_ABS 0x20 legacy BPF packet access (absolute) `Legacy BPF Packet access instructions`_
213+ BPF_IND 0x40 legacy BPF packet access (indirect) `Legacy BPF Packet access instructions`_
214+ BPF_MEM 0x60 regular load and store operations `Regular load and store operations`_
215+ BPF_ATOMIC 0xc0 atomic operations `Atomic operations`_
216+ ============= ===== ==================================== =============
204217
205218 The size modifier is one of:
206219
@@ -213,19 +226,6 @@ The size modifier is one of: · 6 unmodified lines
213226 BPF_DW 0x18 double word (8 bytes)
214227 ============= ===== =====================
215228
216−The mode modifier is one of:
217−
218− ============= ===== ====================================
219− mode modifier value description
220− ============= ===== ====================================
221− BPF_IMM 0x00 64-bit immediate instructions
222− BPF_ABS 0x20 legacy BPF packet access (absolute)
223− BPF_IND 0x40 legacy BPF packet access (indirect)
224− BPF_MEM 0x60 regular load and store operations
225− BPF_ATOMIC 0xc0 atomic operations
226− ============= ===== ====================================
227−
228−
229229 Regular load and store operations
230230 ---------------------------------
231231
@@ -256,44 +256,42 @@ by other eBPF programs or means outside of this specification. · 24 unmodified lines
256256 All atomic operations supported by eBPF are encoded as store operations
257257 that use the ``BPF_ATOMIC`` mode modifier as follows:
258258
259− * ``BPF_ATOMIC | BPF_W | BPF_STX`` for 32-bit operations
260− * ``BPF_ATOMIC | BPF_DW | BPF_STX`` for 64-bit operations
261− * 8-bit and 16-bit wide atomic operations are not supported.
259+* ``BPF_ATOMIC | BPF_W | BPF_STX`` for 32-bit operations
260+* ``BPF_ATOMIC | BPF_DW | BPF_STX`` for 64-bit operations
261+* 8-bit and 16-bit wide atomic operations are not supported.
262262
263−The imm field is used to encode the actual atomic operation.
263+The 'imm' field is used to encode the actual atomic operation.
264264 Simple atomic operation use a subset of the values defined to encode
265−arithmetic operations in the imm field to encode the atomic operation:
265+arithmetic operations in the 'imm' field to encode the atomic operation:
266266
267− ======== ===== ===========
268− imm value description
269− ======== ===== ===========
270− BPF_ADD 0x00 atomic add
271− BPF_OR 0x40 atomic or
272− BPF_AND 0x50 atomic and
273− BPF_XOR 0xa0 atomic xor
274− ======== ===== ===========
267+======== ===== ===========
268+imm value description
269+======== ===== ===========
270+BPF_ADD 0x00 atomic add
271+BPF_OR 0x40 atomic or
272+BPF_AND 0x50 atomic and
273+BPF_XOR 0xa0 atomic xor
274+======== ===== ===========
275275
276276
277−``BPF_ATOMIC | BPF_W | BPF_STX`` with imm = BPF_ADD means::
277+``BPF_ATOMIC | BPF_W | BPF_STX`` with 'imm' = BPF_ADD means::
278278
279279 *(u32 *)(dst_reg + off16) += src_reg
280280
281−``BPF_ATOMIC | BPF_DW | BPF_STX`` with imm = BPF ADD means::
281+``BPF_ATOMIC | BPF_DW | BPF_STX`` with 'imm' = BPF ADD means::
282282
283283 *(u64 *)(dst_reg + off16) += src_reg
284284
285−``BPF_XADD`` is a deprecated name for ``BPF_ATOMIC | BPF_ADD``.
286−
287285 In addition to the simple atomic operations, there also is a modifier and
288286 two complex atomic operations:
289287
290− =========== ================ ===========================
291− imm value description
292− =========== ================ ===========================
293− BPF_FETCH 0x01 modifier: return old value
294− BPF_XCHG 0xe0 | BPF_FETCH atomic exchange
295− BPF_CMPXCHG 0xf0 | BPF_FETCH atomic compare and exchange
296− =========== ================ ===========================
288+=========== ================ ===========================
289+imm value description
290+=========== ================ ===========================
291+BPF_FETCH 0x01 modifier: return old value
292+BPF_XCHG 0xe0 | BPF_FETCH atomic exchange
293+BPF_CMPXCHG 0xf0 | BPF_FETCH atomic compare and exchange
294+=========== ================ ===========================
297295
298296 The ``BPF_FETCH`` modifier is optional for simple atomic operations, and
299297 always set for the complex atomic operations. If the ``BPF_FETCH`` flag
@@ -309,16 +307,10 @@ The ``BPF_CMPXCHG`` operation atomically compares the value addressed by · 9 unmodified lines
309307 value that was at ``dst_reg + off`` before the operation is zero-extended
310308 and loaded back to ``R0``.
311309
312−Clang can generate atomic instructions by default when ``-mcpu=v3`` is
313−enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction
314−Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable
315−the atomics features, while keeping a lower ``-mcpu`` version, you can use
316−``-Xclang -target-feature -Xclang +alu32``.
317−
318310 64-bit immediate instructions
319311 -----------------------------
320312
321−Instructions with the ``BPF_IMM`` mode modifier use the wide instruction
313+Instructions with the ``BPF_IMM`` 'mode' modifier use the wide instruction
322314 encoding for an extra imm64 value.
323315
324316 There is currently only one such instruction.
@@ -331,36 +323,6 @@ There is currently only one such instruction. · 6 unmodified lines
331323 Legacy BPF Packet access instructions
332324 -------------------------------------
333325
334−eBPF has special instructions for access to packet data that have been
335−carried over from classic BPF to retain the performance of legacy socket
336−filters running in the eBPF interpreter.
337−
338−The instructions come in two forms: ``BPF_ABS | <size> | BPF_LD`` and
339−``BPF_IND | <size> | BPF_LD``.
340−
341−These instructions are used to access packet data and can only be used when
342−the program context is a pointer to networking packet. ``BPF_ABS``
343−accesses packet data at an absolute offset specified by the immediate data
344−and ``BPF_IND`` access packet data at an offset that includes the value of
345−a register in addition to the immediate data.
346−
347−These instructions have seven implicit operands:
348−
349− * Register R6 is an implicit input that must contain pointer to a
350− struct sk_buff.
351− * Register R0 is an implicit output which contains the data fetched from
352− the packet.
353− * Registers R1-R5 are scratch registers that are clobbered after a call to
354− ``BPF_ABS | BPF_LD`` or ``BPF_IND | BPF_LD`` instructions.
355−
356−These instructions have an implicit program exit condition as well. When an
357−eBPF program is trying to access the data beyond the packet boundary, the
358−program execution will be aborted.
359−
360−``BPF_ABS | BPF_W | BPF_LD`` means::
361−
362− R0 = ntohl(*(u32 *) (((struct sk_buff *) R6)->data + imm32))
363−
364−``BPF_IND | BPF_W | BPF_LD`` means::
365−
366− R0 = ntohl(*(u32 *) (((struct sk_buff *) R6)->data + src_reg + imm32))
326+eBPF previously introduced special instructions for access to packet data that were
327+carried over from classic BPF. However, these instructions are
328+deprecated and should no longer be used.
Documentation/bpf/kfuncs.rst+16−8
@@ -137,14 +137,22 @@ KF_ACQUIRE and KF_RET_NULL flags. · 136 unmodified lines
137137 --------------------------
138138
139139 The KF_TRUSTED_ARGS flag is used for kfuncs taking pointer arguments. It
140−indicates that the all pointer arguments will always be refcounted, and have
141−their offset set to 0. It can be used to enforce that a pointer to a refcounted
142−object acquired from a kfunc or BPF helper is passed as an argument to this
143−kfunc without any modifications (e.g. pointer arithmetic) such that it is
144−trusted and points to the original object. This flag is often used for kfuncs
145−that operate (change some property, perform some operation) on an object that
146−was obtained using an acquire kfunc. Such kfuncs need an unchanged pointer to
147−ensure the integrity of the operation being performed on the expected object.
140+indicates that the all pointer arguments will always have a guaranteed lifetime,
141+and pointers to kernel objects are always passed to helpers in their unmodified
142+form (as obtained from acquire kfuncs).
143+
144+It can be used to enforce that a pointer to a refcounted object acquired from a
145+kfunc or BPF helper is passed as an argument to this kfunc without any
146+modifications (e.g. pointer arithmetic) such that it is trusted and points to
147+the original object.
148+
149+Meanwhile, it is also allowed pass pointers to normal memory to such kfuncs,
150+but those can have a non-zero offset.
151+
152+This flag is often used for kfuncs that operate (change some property, perform
153+some operation) on an object that was obtained using an acquire kfunc. Such
154+kfuncs need an unchanged pointer to ensure the integrity of the operation being
155+performed on the expected object.
148156
149157 2.4.6 KF_SLEEPABLE flag
150158 -----------------------
Documentation/bpf/linux-notes.rst+53−0
@@ -0,0 +1,53 @@
1+.. contents::
2+.. sectnum::
3+
4+==========================
5+Linux implementation notes
6+==========================
7+
8+This document provides more details specific to the Linux kernel implementation of the eBPF instruction set.
9+
10+Byte swap instructions
11+======================
12+
13+``BPF_FROM_LE`` and ``BPF_FROM_BE`` exist as aliases for ``BPF_TO_LE`` and ``BPF_TO_BE`` respectively.
14+
15+Legacy BPF Packet access instructions
16+=====================================
17+
18+As mentioned in the `ISA standard documentation <instruction-set.rst#legacy-bpf-packet-access-instructions>`_,
19+Linux has special eBPF instructions for access to packet data that have been
20+carried over from classic BPF to retain the performance of legacy socket
21+filters running in the eBPF interpreter.
22+
23+The instructions come in two forms: ``BPF_ABS | <size> | BPF_LD`` and
24+``BPF_IND | <size> | BPF_LD``.
25+
26+These instructions are used to access packet data and can only be used when
27+the program context is a pointer to a networking packet. ``BPF_ABS``
28+accesses packet data at an absolute offset specified by the immediate data
29+and ``BPF_IND`` access packet data at an offset that includes the value of
30+a register in addition to the immediate data.
31+
32+These instructions have seven implicit operands:
33+
34+* Register R6 is an implicit input that must contain a pointer to a
35+ struct sk_buff.
36+* Register R0 is an implicit output which contains the data fetched from
37+ the packet.
38+* Registers R1-R5 are scratch registers that are clobbered by the
39+ instruction.
40+
41+These instructions have an implicit program exit condition as well. If an
42+eBPF program attempts access data beyond the packet boundary, the
43+program execution will be aborted.
44+
45+``BPF_ABS | BPF_W | BPF_LD`` (0x20) means::
46+
47+ R0 = ntohl(*(u32 *) ((struct sk_buff *) R6->data + imm))
48+
49+where ``ntohl()`` converts a 32-bit value from network byte order to host byte order.
50+
51+``BPF_IND | BPF_W | BPF_LD`` (0x40) means::
52+
53+ R0 = ntohl(*(u32 *) ((struct sk_buff *) R6->data + src + imm))
Documentation/bpf/map_cgroup_storage.rst+2−2
@@ -31,7 +31,7 @@ The map uses key of type of either ``__u64 cgroup_inode_id`` or · 30 unmodified lines
3131 };
3232
3333 ``cgroup_inode_id`` is the inode id of the cgroup directory.
34−``attach_type`` is the the program's attach type.
34+``attach_type`` is the program's attach type.
3535
3636 Linux 5.9 added support for type ``__u64 cgroup_inode_id`` as the key type.
3737 When this key type is used, then all attach types of the particular cgroup and
@@ -155,7 +155,7 @@ However, the BPF program can still only associate with one map of each type · 117 unmodified lines
155155 ``BPF_MAP_TYPE_CGROUP_STORAGE`` or more than one
156156 ``BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE``.
157157
158−In all versions, userspace may use the the attach parameters of cgroup and
158+In all versions, userspace may use the attach parameters of cgroup and
159159 attach type pair in ``struct bpf_cgroup_storage_key`` as the key to the BPF map
160160 APIs to read or update the storage for a given attachment. For Linux 5.9
161161 attach type shared storages, only the first value in the struct, cgroup inode
Documentation/conf.py+40−2
@@ -15,6 +15,18 @@ · 14 unmodified lines
1515 import sys
1616 import os
1717 import sphinx
18+import shutil
19+
20+# helper
21+# ------
22+
23+def have_command(cmd):
24+ """Search ``cmd`` in the ``PATH`` environment.
25+
26+ If found, return True.
27+ If not found, return False.
28+ """
29+ return shutil.which(cmd) is not None
1830
1931 # Get Sphinx version
2032 major, minor, patch = sphinx.version_info[:3]
@@ -107,7 +119,32 @@ else: · 86 unmodified lines
107119 autosectionlabel_prefix_document = True
108120 autosectionlabel_maxdepth = 2
109121
110−extensions.append("sphinx.ext.imgmath")
122+# Load math renderer:
123+# For html builder, load imgmath only when its dependencies are met.
124+# mathjax is the default math renderer since Sphinx 1.8.
125+have_latex = have_command('latex')
126+have_dvipng = have_command('dvipng')
127+load_imgmath = have_latex and have_dvipng
128+
129+# Respect SPHINX_IMGMATH (for html docs only)
130+if 'SPHINX_IMGMATH' in os.environ:
131+ env_sphinx_imgmath = os.environ['SPHINX_IMGMATH']
132+ if 'yes' in env_sphinx_imgmath:
133+ load_imgmath = True
134+ elif 'no' in env_sphinx_imgmath:
135+ load_imgmath = False
136+ else:
137+ sys.stderr.write("Unknown env SPHINX_IMGMATH=%s ignored.\n" % env_sphinx_imgmath)
138+
139+# Always load imgmath for Sphinx <1.8 or for epub docs
140+load_imgmath = (load_imgmath or (major == 1 and minor < 8)
141+ or 'epub' in sys.argv)
142+
143+if load_imgmath:
144+ extensions.append("sphinx.ext.imgmath")
145+ math_renderer = 'imgmath'
146+else:
147+ math_renderer = 'mathjax'
111148
112149 # Add any paths that contain templates here, relative to this directory.
113150 templates_path = ['_templates']
@@ -333,7 +370,8 @@ html_static_path = ['sphinx-static'] · 219 unmodified lines
333370 html_use_smartypants = False
334371
335372 # Custom sidebar templates, maps document names to template names.
336−#html_sidebars = {}
373+# Note that the RTD theme ignores this.
374+html_sidebars = { '**': ['searchbox.html', 'localtoc.html', 'sourcelink.html']}
337375
338376 # Additional templates that should be rendered to pages, maps page names to
339377 # template names.
Documentation/core-api/asm-annotations.rstrenamed from Documentation/asm-annotations.rst+4−3
@@ -43,10 +43,11 @@ annotated objects like this, tools can be run on them to generate more useful · 42 unmodified lines
4343 information. In particular, on properly annotated objects, ``objtool`` can be
4444 run to check and fix the object if needed. Currently, ``objtool`` can report
4545 missing frame pointer setup/destruction in functions. It can also
46−automatically generate annotations for :doc:`ORC unwinder <x86/orc-unwinder>`
46+automatically generate annotations for the ORC unwinder
47+(Documentation/x86/orc-unwinder.rst)
4748 for most code. Both of these are especially important to support reliable
48−stack traces which are in turn necessary for :doc:`Kernel live patching
49−<livepatch/livepatch>`.
49+stack traces which are in turn necessary for kernel live patching
50+(Documentation/livepatch/livepatch.rst).
5051
5152 Caveat and Discussion
5253 ---------------------
Documentation/core-api/cpu_hotplug.rst+1−1
@@ -560,7 +560,7 @@ available: · 559 unmodified lines
560560 * cpuhp_state_remove_instance(state, node)
561561 * cpuhp_state_remove_instance_nocalls(state, node)
562562
563−The arguments are the same as for the the cpuhp_state_add_instance*()
563+The arguments are the same as for the cpuhp_state_add_instance*()
564564 variants above.
565565
566566 The functions differ in the way how the installed callbacks are treated:
Documentation/core-api/index.rst+4−0
@@ -23,6 +23,7 @@ it. · 22 unmodified lines
2323 printk-formats
2424 printk-index
2525 symbol-namespaces
26+ asm-annotations
2627
2728 Data structures and low-level utilities
2829 =======================================
@@ -44,6 +45,8 @@ Library functionality that is used throughout the kernel. · 15 unmodified lines
4445 this_cpu_ops
4546 timekeeping
4647 errseq
48+ wrappers/atomic_t
49+ wrappers/atomic_bitops
4750
4851 Low level entry and exit
4952 ========================
@@ -67,6 +70,7 @@ Documentation/locking/index.rst for more related documentation. · 17 unmodified lines
6770 local_ops
6871 padata
6972 ../RCU/index
73+ wrappers/memory-barriers.rst
7074
7175 Low-level hardware management
7276 =============================
Documentation/core-api/irq/irq-domain.rst+1−1
@@ -71,7 +71,7 @@ variety of methods: · 70 unmodified lines
7171 Note that irq domain lookups must happen in contexts that are
7272 compatible with a RCU read-side critical section.
7373
74−The irq_create_mapping() function must be called *atleast once*
74+The irq_create_mapping() function must be called *at least once*
7575 before any call to irq_find_mapping(), lest the descriptor will not
7676 be allocated.
7777
Documentation/core-api/printk-formats.rst+10−0
@@ -625,6 +625,16 @@ Examples:: · 624 unmodified lines
625625 %p4cc Y10 little-endian (0x20303159)
626626 %p4cc NV12 big-endian (0xb231564e)
627627
628+Rust
629+----
630+
631+::
632+
633+ %pA
634+
635+Only intended to be used from Rust code to format ``core::fmt::Arguments``.
636+Do *not* use it from C.
637+
628638 Thanks
629639 ======
630640
Documentation/core-api/wrappers/atomic_bitops.rst+18−0
@@ -0,0 +1,18 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+ This is a simple wrapper to bring atomic_bitops.txt into the RST world
3+ until such a time as that file can be converted directly.
4+
5+=============
6+Atomic bitops
7+=============
8+
9+.. raw:: latex
10+
11+ \footnotesize
12+
13+.. include:: ../../atomic_bitops.txt
14+ :literal:
15+
16+.. raw:: latex
17+
18+ \normalsize
Documentation/core-api/wrappers/atomic_t.rst+19−0
@@ -0,0 +1,19 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+ This is a simple wrapper to bring atomic_t.txt into the RST world
3+ until such a time as that file can be converted directly.
4+
5+============
6+Atomic types
7+============
8+
9+.. raw:: latex
10+
11+ \footnotesize
12+
13+.. include:: ../../atomic_t.txt
14+ :literal:
15+
16+.. raw:: latex
17+
18+ \normalsize
19+
Documentation/core-api/wrappers/memory-barriers.rst+18−0
@@ -0,0 +1,18 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+ This is a simple wrapper to bring memory-barriers.txt into the RST world
3+ until such a time as that file can be converted directly.
4+
5+============================
6+Linux kernel memory barriers
7+============================
8+
9+.. raw:: latex
10+
11+ \footnotesize
12+
13+.. include:: ../../memory-barriers.txt
14+ :literal:
15+
16+.. raw:: latex
17+
18+ \normalsize
Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml+7−0
@@ -57,6 +57,11 @@ properties: · 56 unmodified lines
5757 - description: interrupt ID for I2C event
5858 - description: interrupt ID for I2C error
5959
60+ interrupt-names:
61+ items:
62+ - const: event
63+ - const: error
64+
6065 resets:
6166 maxItems: 1
6267
@@ -92,6 +97,8 @@ properties: · 29 unmodified lines
9297 - description: register offset within syscfg
9398 - description: register bitmask for FMP bit
9499
100+ wakeup-source: true
101+
95102 required:
96103 - compatible
97104 - reg
Documentation/devicetree/bindings/net/ethernet-phy.yaml+6−0
@@ -144,6 +144,12 @@ properties: · 143 unmodified lines
144144 Mark the corresponding energy efficient ethernet mode as
145145 broken and request the ethernet to stop advertising it.
146146
147+ pses:
148+ $ref: /schemas/types.yaml#/definitions/phandle-array
149+ maxItems: 1
150+ description:
151+ Specifies a reference to a node representing a Power Sourcing Equipment.
152+
147153 phy-is-integrated:
148154 $ref: /schemas/types.yaml#/definitions/flag
149155 description:
Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml+3−3
@@ -128,7 +128,7 @@ examples: · 127 unmodified lines
128128
129129 i2c-int-rising;
130130
131− reset-n-io = <&gpio3 19 GPIO_ACTIVE_HIGH>;
131+ reset-n-io = <&gpio3 19 GPIO_ACTIVE_LOW>;
132132 };
133133 };
134134
@@ -151,7 +151,7 @@ examples: · 16 unmodified lines
151151 interrupt-parent = <&gpio1>;
152152 interrupts = <17 IRQ_TYPE_EDGE_RISING>;
153153
154− reset-n-io = <&gpio3 19 GPIO_ACTIVE_HIGH>;
154+ reset-n-io = <&gpio3 19 GPIO_ACTIVE_LOW>;
155155 };
156156 };
157157
@@ -162,7 +162,7 @@ examples: · 4 unmodified lines
162162 nfc {
163163 compatible = "marvell,nfc-uart";
164164
165− reset-n-io = <&gpio3 16 GPIO_ACTIVE_HIGH>;
165+ reset-n-io = <&gpio3 16 GPIO_ACTIVE_LOW>;
166166
167167 hci-muxed;
168168 flow-control;
Documentation/devicetree/bindings/net/pse-pd/podl-pse-regulator.yaml+40−0
@@ -0,0 +1,40 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/pse-pd/podl-pse-regulator.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Regulator based Power Sourcing Equipment
8+
9+maintainers:
10+ - Oleksij Rempel <o.rempel@pengutronix.de>
11+
12+description: Regulator based PoDL PSE controller. The device must be referenced
13+ by the PHY node to control power injection to the Ethernet cable.
14+
15+allOf:
16+ - $ref: "pse-controller.yaml#"
17+
18+properties:
19+ compatible:
20+ const: podl-pse-regulator
21+
22+ '#pse-cells':
23+ const: 0
24+
25+ pse-supply:
26+ description: Power supply for the PSE controller
27+
28+additionalProperties: false
29+
30+required:
31+ - compatible
32+ - pse-supply
33+
34+examples:
35+ - |
36+ ethernet-pse {
37+ compatible = "podl-pse-regulator";
38+ pse-supply = <&reg_t1l1>;
39+ #pse-cells = <0>;
40+ };
Documentation/devicetree/bindings/net/pse-pd/pse-controller.yaml+33−0
@@ -0,0 +1,33 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/pse-pd/pse-controller.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Power Sourcing Equipment (PSE).
8+
9+description: Binding for the Power Sourcing Equipment (PSE) as defined in the
10+ IEEE 802.3 specification. It is designed for hardware which is delivering
11+ power over twisted pair/ethernet cable. The ethernet-pse nodes should be
12+ used to describe PSE controller and referenced by the ethernet-phy node.
13+
14+maintainers:
15+ - Oleksij Rempel <o.rempel@pengutronix.de>
16+
17+properties:
18+ $nodename:
19+ pattern: "^ethernet-pse(@.*)?$"
20+
21+ "#pse-cells":
22+ description:
23+ Used to uniquely identify a PSE instance within an IC. Will be
24+ 0 on PSE nodes with only a single output and at least 1 on nodes
25+ controlling several outputs.
26+ enum: [0, 1]
27+
28+required:
29+ - "#pse-cells"
30+
31+additionalProperties: true
32+
33+...
Documentation/doc-guide/kernel-doc.rst+3−0
@@ -14,6 +14,9 @@ when it is embedded in source files. · 13 unmodified lines
1414 reasons. The kernel source contains tens of thousands of kernel-doc
1515 comments. Please stick to the style described here.
1616
17+.. note:: kernel-doc does not cover Rust code: please see
18+ Documentation/rust/general-information.rst instead.
19+
1720 The kernel-doc structure is extracted from the comments, and proper
1821 `Sphinx C Domain`_ function and type descriptions with anchors are
1922 generated from them. The descriptions are filtered for special kernel-doc
Documentation/doc-guide/sphinx.rst+53−4
@@ -48,10 +48,6 @@ or ``virtualenv``, depending on how your distribution packaged Python 3. · 47 unmodified lines
4848 on the Sphinx version, it should be installed separately,
4949 with ``pip install sphinx_rtd_theme``.
5050
51− #) Some ReST pages contain math expressions. Due to the way Sphinx works,
52− those expressions are written using LaTeX notation. It needs texlive
53− installed with amsfonts and amsmath in order to evaluate them.
54−
5551 In summary, if you want to install Sphinx version 2.4.4, you should do::
5652
5753 $ virtualenv sphinx_2.4.4
@@ -86,6 +82,27 @@ Depending on the distribution, you may also need to install a series of · 28 unmodified lines
8682 ``texlive`` packages that provide the minimal set of functionalities
8783 required for ``XeLaTeX`` to work.
8884
85+Math Expressions in HTML
86+------------------------
87+
88+Some ReST pages contain math expressions. Due to the way Sphinx works,
89+those expressions are written using LaTeX notation.
90+There are two options for Sphinx to render math expressions in html output.
91+One is an extension called `imgmath`_ which converts math expressions into
92+images and embeds them in html pages.
93+The other is an extension called `mathjax`_ which delegates math rendering
94+to JavaScript capable web browsers.
95+The former was the only option for pre-6.1 kernel documentation and it
96+requires quite a few texlive packages including amsfonts and amsmath among
97+others.
98+
99+Since kernel release 6.1, html pages with math expressions can be built
100+without installing any texlive packages. See `Choice of Math Renderer`_ for
101+further info.
102+
103+.. _imgmath: https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.imgmath
104+.. _mathjax: https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjax
105+
89106 .. _sphinx-pre-install:
90107
91108 Checking for Sphinx dependencies
@@ -164,6 +181,38 @@ To remove the generated documentation, run ``make cleandocs``. · 72 unmodified lines
164181 as well would improve the quality of images embedded in PDF
165182 documents, especially for kernel releases 5.18 and later.
166183
184+Choice of Math Renderer
185+-----------------------
186+
187+Since kernel release 6.1, mathjax works as a fallback math renderer for
188+html output.\ [#sph1_8]_
189+
190+Math renderer is chosen depending on available commands as shown below:
191+
192+.. table:: Math Renderer Choices for HTML
193+
194+ ============= ================= ============
195+ Math renderer Required commands Image format
196+ ============= ================= ============
197+ imgmath latex, dvipng PNG (raster)
198+ mathjax
199+ ============= ================= ============
200+
201+The choice can be overridden by setting an environment variable
202+``SPHINX_IMGMATH`` as shown below:
203+
204+.. table:: Effect of Setting ``SPHINX_IMGMATH``
205+
206+ ====================== ========
207+ Setting Renderer
208+ ====================== ========
209+ ``SPHINX_IMGMATH=yes`` imgmath
210+ ``SPHINX_IMGMATH=no`` mathjax
211+ ====================== ========
212+
213+.. [#sph1_8] Fallback of math renderer requires Sphinx >=1.8.
214+
215+
167216 Writing Documentation
168217 =====================
169218
Documentation/driver-api/driver-model/devres.rst+6−1
@@ -301,6 +301,7 @@ IO region · 300 unmodified lines
301301 devm_release_region()
302302 devm_release_resource()
303303 devm_request_mem_region()
304+ devm_request_free_mem_region()
304305 devm_request_region()
305306 devm_request_resource()
306307
@@ -334,7 +335,7 @@ IRQ · 27 unmodified lines
334335 devm_irq_alloc_descs_from()
335336 devm_irq_alloc_generic_chip()
336337 devm_irq_setup_generic_chip()
337− devm_irq_sim_init()
338+ devm_irq_domain_create_sim()
338339
339340 LED
340341 devm_led_classdev_register()
@@ -392,7 +393,9 @@ PHY · 51 unmodified lines
392393 PINCTRL
393394 devm_pinctrl_get()
394395 devm_pinctrl_put()
396+ devm_pinctrl_get_select()
395397 devm_pinctrl_register()
398+ devm_pinctrl_register_and_init()
396399 devm_pinctrl_unregister()
397400
398401 POWER
@@ -427,6 +430,8 @@ SLAVE DMA ENGINE · 28 unmodified lines
427430 devm_acpi_dma_controller_register()
428431
429432 SPI
433+ devm_spi_alloc_master()
434+ devm_spi_alloc_slave()
430435 devm_spi_register_master()
431436
432437 WATCHDOG
Documentation/driver-api/isa.rst+1−1
@@ -100,7 +100,7 @@ I believe platform_data is available for this, but if rather not, moving · 99 unmodified lines
100100 the isa_driver pointer to the private struct isa_dev is ofcourse fine as
101101 well.
102102
103−Then, if the the driver did not provide a .match, it matches. If it did,
103+Then, if the driver did not provide a .match, it matches. If it did,
104104 the driver match() method is called to determine a match.
105105
106106 If it did **not** match, dev->platform_data is reset to indicate this to
Documentation/fb/udlfb.rst+15−8
@@ -86,17 +86,24 @@ Module Options · 85 unmodified lines
8686 Special configuration for udlfb is usually unnecessary. There are a few
8787 options, however.
8888
89−From the command line, pass options to modprobe
90−modprobe udlfb fb_defio=0 console=1 shadow=1
89+From the command line, pass options to modprobe::
9190
92−Or modify options on the fly at /sys/module/udlfb/parameters directory via
93−sudo nano fb_defio
94−change the parameter in place, and save the file.
91+ modprobe udlfb fb_defio=0 console=1 shadow=1
9592
96−Unplug/replug USB device to apply with new settings
93+Or change options on the fly by editing
94+/sys/module/udlfb/parameters/PARAMETER_NAME ::
9795
98−Or for permanent option, create file like /etc/modprobe.d/udlfb.conf with text
99−options udlfb fb_defio=0 console=1 shadow=1
96+ cd /sys/module/udlfb/parameters
97+ ls # to see a list of parameter names
98+ sudo nano PARAMETER_NAME
99+ # change the parameter in place, and save the file.
100+
101+Unplug/replug USB device to apply with new settings.
102+
103+Or to apply options permanently, create a modprobe configuration file
104+like /etc/modprobe.d/udlfb.conf with text::
105+
106+ options udlfb fb_defio=0 console=1 shadow=1
100107
101108 Accepted boolean options:
102109
Documentation/filesystems/caching/backend-api.rst+1−1
@@ -122,7 +122,7 @@ volumes, calling:: · 121 unmodified lines
122122 to tell fscache that a volume has been withdrawn. This waits for all
123123 outstanding accesses on the volume to complete before returning.
124124
125−When the the cache is completely withdrawn, fscache should be notified by
125+When the cache is completely withdrawn, fscache should be notified by
126126 calling::
127127
128128 void fscache_relinquish_cache(struct fscache_cache *cache);
Documentation/filesystems/ext4/super.rst+3−3
@@ -456,15 +456,15 @@ The ext4 superblock is laid out as follows in · 455 unmodified lines
456456 * - 0x277
457457 - __u8
458458 - s_lastcheck_hi
459− - Upper 8 bits of the s_lastcheck_hi field.
459+ - Upper 8 bits of the s_lastcheck field.
460460 * - 0x278
461461 - __u8
462462 - s_first_error_time_hi
463− - Upper 8 bits of the s_first_error_time_hi field.
463+ - Upper 8 bits of the s_first_error_time field.
464464 * - 0x279
465465 - __u8
466466 - s_last_error_time_hi
467− - Upper 8 bits of the s_last_error_time_hi field.
467+ - Upper 8 bits of the s_last_error_time field.
468468 * - 0x27A
469469 - __u8
470470 - s_pad[2]
Documentation/filesystems/f2fs.rst+2−3
@@ -286,9 +286,8 @@ compress_algorithm=%s:%d Control compress algorithm and its compress level, now, · 285 unmodified lines
286286 algorithm level range
287287 lz4 3 - 16
288288 zstd 1 - 22
289−compress_log_size=%u Support configuring compress cluster size, the size will
290− be 4KB * (1 << %u), 16KB is minimum size, also it's
291− default size.
289+compress_log_size=%u Support configuring compress cluster size. The size will
290+ be 4KB * (1 << %u). The default and minimum sizes are 16KB.
292291 compress_extension=%s Support adding specified extension, so that f2fs can enable
293292 compression on those corresponding files, e.g. if all files
294293 with '.ext' has high compression rate, we can set the '.ext'
Documentation/filesystems/idmappings.rst+1−1
@@ -661,7 +661,7 @@ idmappings:: · 660 unmodified lines
661661 mount idmapping: u0:k10000:r10000
662662
663663 Assume a file owned by ``u1000`` is read from disk. The filesystem maps this id
664−to ``k21000`` according to it's idmapping. This is what is stored in the
664+to ``k21000`` according to its idmapping. This is what is stored in the
665665 inode's ``i_uid`` and ``i_gid`` fields.
666666
667667 When the caller queries the ownership of this file via ``stat()`` the kernel
Documentation/filesystems/qnx6.rst+1−1
@@ -176,7 +176,7 @@ Then userspace. · 175 unmodified lines
176176 The requirement for a static, fixed preallocated system area comes from how
177177 qnx6fs deals with writes.
178178
179−Each superblock got it's own half of the system area. So superblock #1
179+Each superblock got its own half of the system area. So superblock #1
180180 always uses blocks from the lower half while superblock #2 just writes to
181181 blocks represented by the upper half bitmap system area bits.
182182
Documentation/filesystems/spufs/spufs.rst+1−1
@@ -227,7 +227,7 @@ Files · 226 unmodified lines
227227 from the data buffer, updating the value of the specified signal
228228 notification register. The signal notification register will
229229 either be replaced with the input data or will be updated to the
230− bitwise OR or the old value and the input data, depending on the
230+ bitwise OR of the old value and the input data, depending on the
231231 contents of the signal1_type, or signal2_type respectively,
232232 file.
233233
Documentation/filesystems/xfs-delayed-logging-design.rst+9−9
@@ -100,7 +100,7 @@ transactions together:: · 99 unmodified lines
100100
101101 ntp = xfs_trans_dup(tp);
102102 xfs_trans_commit(tp);
103− xfs_log_reserve(ntp);
103+ xfs_trans_reserve(ntp);
104104
105105 This results in a series of "rolling transactions" where the inode is locked
106106 across the entire chain of transactions. Hence while this series of rolling
@@ -191,7 +191,7 @@ transaction rolling mechanism to re-reserve space on every transaction roll. We · 84 unmodified lines
191191 know from the implementation of the permanent transactions how many transaction
192192 rolls are likely for the common modifications that need to be made.
193193
194−For example, and inode allocation is typically two transactions - one to
194+For example, an inode allocation is typically two transactions - one to
195195 physically allocate a free inode chunk on disk, and another to allocate an inode
196196 from an inode chunk that has free inodes in it. Hence for an inode allocation
197197 transaction, we might set the reservation log count to a value of 2 to indicate
@@ -200,7 +200,7 @@ chain. Each time a permanent transaction rolls, it consumes an entire unit · 2 unmodified lines
200200 reservation.
201201
202202 Hence when the permanent transaction is first allocated, the log space
203−reservation is increases from a single unit reservation to multiple unit
203+reservation is increased from a single unit reservation to multiple unit
204204 reservations. That multiple is defined by the reservation log count, and this
205205 means we can roll the transaction multiple times before we have to re-reserve
206206 log space when we roll the transaction. This ensures that the common
@@ -259,7 +259,7 @@ the next transaction in the sequeunce, but we have none remaining. We cannot · 52 unmodified lines
259259 sleep during the transaction commit process waiting for new log space to become
260260 available, as we may end up on the end of the FIFO queue and the items we have
261261 locked while we sleep could end up pinning the tail of the log before there is
262−enough free space in the log to fulfil all of the pending reservations and
262+enough free space in the log to fulfill all of the pending reservations and
263263 then wake up transaction commit in progress.
264264
265265 To take a new reservation without sleeping requires us to be able to take a
@@ -551,14 +551,14 @@ Essentially, this shows that an item that is in the AIL can still be modified · 285 unmodified lines
551551 and relogged, so any tracking must be separate to the AIL infrastructure. As
552552 such, we cannot reuse the AIL list pointers for tracking committed items, nor
553553 can we store state in any field that is protected by the AIL lock. Hence the
554−committed item tracking needs it's own locks, lists and state fields in the log
554+committed item tracking needs its own locks, lists and state fields in the log
555555 item.
556556
557557 Similar to the AIL, tracking of committed items is done through a new list
558558 called the Committed Item List (CIL). The list tracks log items that have been
559559 committed and have formatted memory buffers attached to them. It tracks objects
560560 in transaction commit order, so when an object is relogged it is removed from
561−it's place in the list and re-inserted at the tail. This is entirely arbitrary
561+its place in the list and re-inserted at the tail. This is entirely arbitrary
562562 and done to make it easy for debugging - the last items in the list are the
563563 ones that are most recently modified. Ordering of the CIL is not necessary for
564564 transactional integrity (as discussed in the next section) so the ordering is
@@ -615,7 +615,7 @@ those changes into the current checkpoint context. We then initialise a new · 50 unmodified lines
615615 context and attach that to the CIL for aggregation of new transactions.
616616
617617 This allows us to unlock the CIL immediately after transfer of all the
618−committed items and effectively allow new transactions to be issued while we
618+committed items and effectively allows new transactions to be issued while we
619619 are formatting the checkpoint into the log. It also allows concurrent
620620 checkpoints to be written into the log buffers in the case of log force heavy
621621 workloads, just like the existing transaction commit code does. This, however,
@@ -884,9 +884,9 @@ pin the object the first time it is inserted into the CIL - if it is already in · 262 unmodified lines
884884 the CIL during a transaction commit, then we do not pin it again. Because there
885885 can be multiple outstanding checkpoint contexts, we can still see elevated pin
886886 counts, but as each checkpoint completes the pin count will retain the correct
887−value according to it's context.
887+value according to its context.
888888
889−Just to make matters more slightly more complex, this checkpoint level context
889+Just to make matters slightly more complex, this checkpoint level context
890890 for the pin count means that the pinning of an item must take place under the
891891 CIL commit/flush lock. If we pin the object outside this lock, we cannot
892892 guarantee which context the pin count is associated with. This is because of
Documentation/firmware-guide/acpi/enumeration.rst+8−8
@@ -21,7 +21,7 @@ possible we decided to do following: · 20 unmodified lines
2121 - Devices behind real busses where there is a connector resource
2222 are represented as struct spi_device or struct i2c_device. Note
2323 that standard UARTs are not busses so there is no struct uart_device,
24− although some of them may be represented by sturct serdev_device.
24+ although some of them may be represented by struct serdev_device.
2525
2626 As both ACPI and Device Tree represent a tree of devices (and their
2727 resources) this implementation follows the Device Tree way as much as
@@ -205,7 +205,7 @@ Here is what the ACPI namespace for a SPI slave might look like:: · 177 unmodified lines
205205 }
206206 ...
207207
208−The SPI device drivers only need to add ACPI IDs in a similar way than with
208+The SPI device drivers only need to add ACPI IDs in a similar way to
209209 the platform device drivers. Below is an example where we add ACPI support
210210 to at25 SPI eeprom driver (this is meant for the above ACPI snippet)::
211211
@@ -362,7 +362,7 @@ These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" · 150 unmodified lines
362362 specifies the path to the controller. In order to use these GPIOs in Linux
363363 we need to translate them to the corresponding Linux GPIO descriptors.
364364
365−There is a standard GPIO API for that and is documented in
365+There is a standard GPIO API for that and it is documented in
366366 Documentation/admin-guide/gpio/.
367367
368368 In the above example we can get the corresponding two GPIO descriptors with
@@ -538,8 +538,8 @@ information. · 169 unmodified lines
538538 PCI hierarchy representation
539539 ============================
540540
541−Sometimes could be useful to enumerate a PCI device, knowing its position on the
542−PCI bus.
541+Sometimes it could be useful to enumerate a PCI device, knowing its position on
542+the PCI bus.
543543
544544 For example, some systems use PCI devices soldered directly on the mother board,
545545 in a fixed position (ethernet, Wi-Fi, serial ports, etc.). In this conditions it
@@ -550,7 +550,7 @@ To identify a PCI device, a complete hierarchical description is required, from · 4 unmodified lines
550550 the chipset root port to the final device, through all the intermediate
551551 bridges/switches of the board.
552552
553−For example, let us assume to have a system with a PCIe serial port, an
553+For example, let's assume we have a system with a PCIe serial port, an
554554 Exar XR17V3521, soldered on the main board. This UART chip also includes
555555 16 GPIOs and we want to add the property ``gpio-line-names`` [1] to these pins.
556556 In this case, the ``lspci`` output for this component is::
@@ -593,8 +593,8 @@ of the chipset bridge (also called "root port") with address:: · 36 unmodified lines
593593
594594 Bus: 0 - Device: 14 - Function: 1
595595
596−To find this information is necessary disassemble the BIOS ACPI tables, in
597−particular the DSDT (see also [2])::
596+To find this information, it is necessary to disassemble the BIOS ACPI tables,
597+in particular the DSDT (see also [2])::
598598
599599 mkdir ~/tables/
600600 cd ~/tables/
Documentation/firmware-guide/acpi/osi.rst+11−14
@@ -41,26 +41,23 @@ But it is likely that they will all eventually be added. · 40 unmodified lines
4141 What should an OEM do if they want to support Linux and Windows
4242 using the same BIOS image? Often they need to do something different
4343 for Linux to deal with how Linux is different from Windows.
44−Here the BIOS should ask exactly what it wants to know:
4544
45+In this case, the OEM should create custom ASL to be executed by the
46+Linux kernel and changes to Linux kernel drivers to execute this custom
47+ASL. The easiest way to accomplish this is to introduce a device specific
48+method (_DSM) that is called from the Linux kernel.
49+
50+In the past the kernel used to support something like:
4651 _OSI("Linux-OEM-my_interface_name")
4752 where 'OEM' is needed if this is an OEM-specific hook,
4853 and 'my_interface_name' describes the hook, which could be a
4954 quirk, a bug, or a bug-fix.
5055
51−In addition, the OEM should send a patch to upstream Linux
52−via the linux-acpi@vger.kernel.org mailing list. When that patch
53−is checked into Linux, the OS will answer "YES" when the BIOS
54−on the OEM's system uses _OSI to ask if the interface is supported
55−by the OS. Linux distributors can back-port that patch for Linux
56−pre-installs, and it will be included by all distributions that
57−re-base to upstream. If the distribution can not update the kernel binary,
58−they can also add an acpi_osi=Linux-OEM-my_interface_name
59−cmdline parameter to the boot loader, as needed.
60−
61−If the string refers to a feature where the upstream kernel
62−eventually grows support, a patch should be sent to remove
63−the string when that support is added to the kernel.
56+However this was discovered to be abused by other BIOS vendors to change
57+completely unrelated code on completely unrelated systems. This prompted
58+an evaluation of all of it's uses. This uncovered that they aren't needed
59+for any of the original reasons. As such, the kernel will not respond to
60+any custom Linux-* strings by default.
6461
6562 That was easy. Read on, to find out how to do it wrong.
6663
Documentation/index.rst+51−106
@@ -1,11 +1,5 @@
11 .. SPDX-License-Identifier: GPL-2.0
22
3−
4−.. The Linux Kernel documentation master file, created by
5− sphinx-quickstart on Fri Feb 12 13:51:46 2016.
6− You can adapt this file completely to your liking, but it should at least
7− contain the root `toctree` directive.
8−
93 .. _linux_doc:
104
115 The Linux Kernel documentation
@@ -18,133 +12,85 @@ documents into a coherent whole. Please note that improvements to the · 6 unmodified lines
1812 documentation are welcome; join the linux-doc list at vger.kernel.org if
1913 you want to help out.
2014
21−Licensing documentation
22−-----------------------
15+Working with the development community
16+--------------------------------------
2317
24−The following describes the license of the Linux kernel source code
25−(GPLv2), how to properly mark the license of individual files in the source
26−tree, as well as links to the full license text.
27−
28−* :ref:`kernel_licensing`
29−
30−User-oriented documentation
31−---------------------------
32−
33−The following manuals are written for *users* of the kernel — those who are
34−trying to get it to work optimally on a given system.
18+The essential guides for interacting with the kernel's development
19+community and getting your work upstream.
3520
3621 .. toctree::
37− :maxdepth: 2
38−
39− admin-guide/index
40− kbuild/index
41−
42−Firmware-related documentation
43−------------------------------
44−The following holds information on the kernel's expectations regarding the
45−platform firmwares.
22+ :maxdepth: 1
4623
47−.. toctree::
48− :maxdepth: 2
24+ process/development-process
25+ process/submitting-patches
26+ Code of conduct <process/code-of-conduct>
27+ maintainer/index
28+ All development-process docs <process/index>
4929
50− firmware-guide/index
51− devicetree/index
5230
53−Application-developer documentation
54−-----------------------------------
31+Internal API manuals
32+--------------------
5533
56−The user-space API manual gathers together documents describing aspects of
57−the kernel interface as seen by application developers.
34+Manuals for use by developers working to interface with the rest of the
35+kernel.
5836
5937 .. toctree::
60− :maxdepth: 2
61−
62− userspace-api/index
38+ :maxdepth: 1
6339
40+ core-api/index
41+ driver-api/index
42+ subsystem-apis
43+ Locking in the kernel <locking/index>
6444
65−Introduction to kernel development
66−----------------------------------
45+Development tools and processes
46+-------------------------------
6747
68−These manuals contain overall information about how to develop the kernel.
69−The kernel community is quite large, with thousands of developers
70−contributing over the course of a year. As with any large community,
71−knowing how things are done will make the process of getting your changes
72−merged much easier.
48+Various other manuals with useful information for all kernel developers.
7349
7450 .. toctree::
75− :maxdepth: 2
51+ :maxdepth: 1
7652
77− process/index
78− dev-tools/index
53+ process/license-rules
7954 doc-guide/index
55+ dev-tools/index
56+ dev-tools/testing-overview
8057 kernel-hacking/index
8158 trace/index
82− maintainer/index
8359 fault-injection/index
8460 livepatch/index
61+ rust/index
8562
8663
87−Kernel API documentation
88−------------------------
64+User-oriented documentation
65+---------------------------
8966
90−These books get into the details of how specific kernel subsystems work
91−from the point of view of a kernel developer. Much of the information here
92−is taken directly from the kernel source, with supplemental material added
93−as needed (or at least as we managed to add it — probably *not* all that is
94−needed).
67+The following manuals are written for *users* of the kernel — those who are
68+trying to get it to work optimally on a given system and application
69+developers seeking information on the kernel's user-space APIs.
9570
9671 .. toctree::
97− :maxdepth: 2
72+ :maxdepth: 1
9873
99− driver-api/index
100− core-api/index
101− locking/index
102− accounting/index
103− block/index
104− cdrom/index
105− cpu-freq/index
106− fb/index
107− fpga/index
108− hid/index
109− i2c/index
110− iio/index
111− isdn/index
112− infiniband/index
113− leds/index
114− netlabel/index
115− networking/index
116− pcmcia/index
117− power/index
118− target/index
119− timers/index
120− spi/index
121− w1/index
122− watchdog/index
123− virt/index
124− input/index
125− hwmon/index
126− gpu/index
127− security/index
128− sound/index
129− crypto/index
130− filesystems/index
131− mm/index
132− bpf/index
133− usb/index
134− PCI/index
135− scsi/index
136− misc-devices/index
137− scheduler/index
138− mhi/index
139− peci/index
140−
141−Architecture-agnostic documentation
142−-----------------------------------
74+ admin-guide/index
75+ The kernel build system <kbuild/index>
76+ admin-guide/reporting-issues.rst
77+ User-space tools <tools/index>
78+ userspace-api/index
79+
80+See also: the `Linux man pages <https://www.kernel.org/doc/man-pages/>`_,
81+which are kept separately from the kernel's own documentation.
82+
83+Firmware-related documentation
84+------------------------------
85+The following holds information on the kernel's expectations regarding the
86+platform firmwares.
14387
14488 .. toctree::
145− :maxdepth: 2
89+ :maxdepth: 1
90+
91+ firmware-guide/index
92+ devicetree/index
14693
147− asm-annotations
14894
14995 Architecture-specific documentation
15096 -----------------------------------
@@ -163,9 +109,8 @@ of the documentation body, or may require some adjustments and/or conversion · 12 unmodified lines
163109 to ReStructured Text format, or are simply too old.
164110
165111 .. toctree::
166− :maxdepth: 2
112+ :maxdepth: 1
167113
168− tools/index
169114 staging/index
170115
171116
Documentation/kbuild/gcc-plugins.rst+18−1
@@ -90,7 +90,11 @@ e.g., on Ubuntu for gcc-10:: · 89 unmodified lines
9090
9191 Or on Fedora::
9292
93− dnf install gcc-plugin-devel
93+ dnf install gcc-plugin-devel libmpc-devel
94+
95+Or on Fedora when using cross-compilers that include plugins::
96+
97+ dnf install libmpc-devel
9498
9599 Enable the GCC plugin infrastructure and some plugin(s) you want to use
96100 in the kernel config::
@@ -99,6 +103,19 @@ in the kernel config:: · 2 unmodified lines
99103 CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
100104 ...
101105
106+Run gcc (native or cross-compiler) to ensure plugin headers are detected::
107+
108+ gcc -print-file-name=plugin
109+ CROSS_COMPILE=arm-linux-gnu- ${CROSS_COMPILE}gcc -print-file-name=plugin
110+
111+The word "plugin" means they are not detected::
112+
113+ plugin
114+
115+A full path means they are detected::
116+
117+ /usr/lib/gcc/x86_64-redhat-linux/12/plugin
118+
102119 To compile the minimum tool set including the plugin(s)::
103120
104121 make scripts
Documentation/kbuild/kbuild.rst+17−0
@@ -48,6 +48,10 @@ KCFLAGS · 47 unmodified lines
4848 -------
4949 Additional options to the C compiler (for built-in and modules).
5050
51+KRUSTFLAGS
52+----------
53+Additional options to the Rust compiler (for built-in and modules).
54+
5155 CFLAGS_KERNEL
5256 -------------
5357 Additional options for $(CC) when used to compile
@@ -57,6 +61,15 @@ CFLAGS_MODULE · 3 unmodified lines
5761 -------------
5862 Additional module specific options to use for $(CC).
5963
64+RUSTFLAGS_KERNEL
65+----------------
66+Additional options for $(RUSTC) when used to compile
67+code that is compiled as built-in.
68+
69+RUSTFLAGS_MODULE
70+----------------
71+Additional module specific options to use for $(RUSTC).
72+
6073 LDFLAGS_MODULE
6174 --------------
6275 Additional options used for $(LD) when linking modules.
@@ -69,6 +82,10 @@ HOSTCXXFLAGS · 6 unmodified lines
6982 ------------
7083 Additional flags to be passed to $(HOSTCXX) when building host programs.
7184
85+HOSTRUSTFLAGS
86+-------------
87+Additional flags to be passed to $(HOSTRUSTC) when building host programs.
88+
7289 HOSTLDFLAGS
7390 -----------
7491 Additional flags to be passed when linking host programs.
Documentation/kbuild/makefiles.rst+46−4
@@ -29,8 +29,9 @@ This document describes the Linux kernel Makefiles. · 28 unmodified lines
2929 --- 4.1 Simple Host Program
3030 --- 4.2 Composite Host Programs
3131 --- 4.3 Using C++ for host programs
32− --- 4.4 Controlling compiler options for host programs
33− --- 4.5 When host programs are actually built
32+ --- 4.4 Using Rust for host programs
33+ --- 4.5 Controlling compiler options for host programs
34+ --- 4.6 When host programs are actually built
3435
3536 === 5 Userspace Program support
3637 --- 5.1 Simple Userspace Program
@@ -835,7 +836,24 @@ Both possibilities are described in the following. · 798 unmodified lines
835836 qconf-cxxobjs := qconf.o
836837 qconf-objs := check.o
837838
838−4.4 Controlling compiler options for host programs
839+4.4 Using Rust for host programs
840+--------------------------------
841+
842+ Kbuild offers support for host programs written in Rust. However,
843+ since a Rust toolchain is not mandatory for kernel compilation,
844+ it may only be used in scenarios where Rust is required to be
845+ available (e.g. when ``CONFIG_RUST`` is enabled).
846+
847+ Example::
848+
849+ hostprogs := target
850+ target-rust := y
851+
852+ Kbuild will compile ``target`` using ``target.rs`` as the crate root,
853+ located in the same directory as the ``Makefile``. The crate may
854+ consist of several source files (see ``samples/rust/hostprogs``).
855+
856+4.5 Controlling compiler options for host programs
839857 --------------------------------------------------
840858
841859 When compiling host programs, it is possible to set specific flags.
@@ -867,7 +885,7 @@ Both possibilities are described in the following. · 25 unmodified lines
867885 When linking qconf, it will be passed the extra option
868886 "-L$(QTDIR)/lib".
869887
870−4.5 When host programs are actually built
888+4.6 When host programs are actually built
871889 -----------------------------------------
872890
873891 Kbuild will only build host-programs when they are referenced
@@ -1181,6 +1199,17 @@ When kbuild executes, the following steps are followed (roughly): · 307 unmodified lines
11811199 The first example utilises the trick that a config option expands
11821200 to 'y' when selected.
11831201
1202+ KBUILD_RUSTFLAGS
1203+ $(RUSTC) compiler flags
1204+
1205+ Default value - see top level Makefile
1206+ Append or modify as required per architecture.
1207+
1208+ Often, the KBUILD_RUSTFLAGS variable depends on the configuration.
1209+
1210+ Note that target specification file generation (for ``--target``)
1211+ is handled in ``scripts/generate_rust_target.rs``.
1212+
11841213 KBUILD_AFLAGS_KERNEL
11851214 Assembler options specific for built-in
11861215
@@ -1208,6 +1237,19 @@ When kbuild executes, the following steps are followed (roughly): · 21 unmodified lines
12081237 are used for $(CC).
12091238 From commandline CFLAGS_MODULE shall be used (see kbuild.rst).
12101239
1240+ KBUILD_RUSTFLAGS_KERNEL
1241+ $(RUSTC) options specific for built-in
1242+
1243+ $(KBUILD_RUSTFLAGS_KERNEL) contains extra Rust compiler flags used to
1244+ compile resident kernel code.
1245+
1246+ KBUILD_RUSTFLAGS_MODULE
1247+ Options for $(RUSTC) when building modules
1248+
1249+ $(KBUILD_RUSTFLAGS_MODULE) is used to add arch-specific options that
1250+ are used for $(RUSTC).
1251+ From commandline RUSTFLAGS_MODULE shall be used (see kbuild.rst).
1252+
12111253 KBUILD_LDFLAGS_MODULE
12121254 Options for $(LD) when linking modules
12131255
Documentation/locking/seqlock.rst+1−1
@@ -39,7 +39,7 @@ as the writer can invalidate a pointer that the reader is following. · 38 unmodified lines
3939 Sequence counters (``seqcount_t``)
4040 ==================================
4141
42−This is the the raw counting mechanism, which does not protect against
42+This is the raw counting mechanism, which does not protect against
4343 multiple writers. Write side critical sections must thus be serialized
4444 by an external lock.
4545
Documentation/memory-barriers.txt+95−82
@@ -52,7 +52,7 @@ CONTENTS · 51 unmodified lines
5252
5353 - Varieties of memory barrier.
5454 - What may not be assumed about memory barriers?
55− - Data dependency barriers (historical).
55+ - Address-dependency barriers (historical).
5656 - Control dependencies.
5757 - SMP barrier pairing.
5858 - Examples of memory barrier sequences.
@@ -187,9 +187,9 @@ As a further example, consider this sequence of events: · 128 unmodified lines
187187 B = 4; Q = P;
188188 P = &B; D = *Q;
189189
190−There is an obvious data dependency here, as the value loaded into D depends on
191−the address retrieved from P by CPU 2. At the end of the sequence, any of the
192−following results are possible:
190+There is an obvious address dependency here, as the value loaded into D depends
191+on the address retrieved from P by CPU 2. At the end of the sequence, any of
192+the following results are possible:
193193
194194 (Q == &A) and (D == 1)
195195 (Q == &B) and (D == 2)
@@ -391,58 +391,62 @@ Memory barriers come in four basic varieties: · 195 unmodified lines
391391 memory system as time progresses. All stores _before_ a write barrier
392392 will occur _before_ all the stores after the write barrier.
393393
394− [!] Note that write barriers should normally be paired with read or data
395− dependency barriers; see the "SMP barrier pairing" subsection.
394+ [!] Note that write barriers should normally be paired with read or
395+ address-dependency barriers; see the "SMP barrier pairing" subsection.
396396
397397
398− (2) Data dependency barriers.
398+ (2) Address-dependency barriers (historical).
399399
400− A data dependency barrier is a weaker form of read barrier. In the case
401− where two loads are performed such that the second depends on the result
402− of the first (eg: the first load retrieves the address to which the second
403− load will be directed), a data dependency barrier would be required to
404− make sure that the target of the second load is updated after the address
405− obtained by the first load is accessed.
400+ An address-dependency barrier is a weaker form of read barrier. In the
401+ case where two loads are performed such that the second depends on the
402+ result of the first (eg: the first load retrieves the address to which
403+ the second load will be directed), an address-dependency barrier would
404+ be required to make sure that the target of the second load is updated
405+ after the address obtained by the first load is accessed.
406406
407− A data dependency barrier is a partial ordering on interdependent loads
408− only; it is not required to have any effect on stores, independent loads
409− or overlapping loads.
407+ An address-dependency barrier is a partial ordering on interdependent
408+ loads only; it is not required to have any effect on stores, independent
409+ loads or overlapping loads.
410410
411411 As mentioned in (1), the other CPUs in the system can be viewed as
412412 committing sequences of stores to the memory system that the CPU being
413− considered can then perceive. A data dependency barrier issued by the CPU
414− under consideration guarantees that for any load preceding it, if that
415− load touches one of a sequence of stores from another CPU, then by the
416− time the barrier completes, the effects of all the stores prior to that
417− touched by the load will be perceptible to any loads issued after the data
418− dependency barrier.
413+ considered can then perceive. An address-dependency barrier issued by
414+ the CPU under consideration guarantees that for any load preceding it,
415+ if that load touches one of a sequence of stores from another CPU, then
416+ by the time the barrier completes, the effects of all the stores prior to
417+ that touched by the load will be perceptible to any loads issued after
418+ the address-dependency barrier.
419419
420420 See the "Examples of memory barrier sequences" subsection for diagrams
421421 showing the ordering constraints.
422422
423− [!] Note that the first load really has to have a _data_ dependency and
423+ [!] Note that the first load really has to have an _address_ dependency and
424424 not a control dependency. If the address for the second load is dependent
425425 on the first load, but the dependency is through a conditional rather than
426426 actually loading the address itself, then it's a _control_ dependency and
427427 a full read barrier or better is required. See the "Control dependencies"
428428 subsection for more information.
429429
430− [!] Note that data dependency barriers should normally be paired with
430+ [!] Note that address-dependency barriers should normally be paired with
431431 write barriers; see the "SMP barrier pairing" subsection.
432432
433+ [!] Kernel release v5.9 removed kernel APIs for explicit address-
434+ dependency barriers. Nowadays, APIs for marking loads from shared
435+ variables such as READ_ONCE() and rcu_dereference() provide implicit
436+ address-dependency barriers.
433437
434438 (3) Read (or load) memory barriers.
435439
436− A read barrier is a data dependency barrier plus a guarantee that all the
437− LOAD operations specified before the barrier will appear to happen before
438− all the LOAD operations specified after the barrier with respect to the
439− other components of the system.
440+ A read barrier is an address-dependency barrier plus a guarantee that all
441+ the LOAD operations specified before the barrier will appear to happen
442+ before all the LOAD operations specified after the barrier with respect to
443+ the other components of the system.
440444
441445 A read barrier is a partial ordering on loads only; it is not required to
442446 have any effect on stores.
443447
444− Read memory barriers imply data dependency barriers, and so can substitute
445− for them.
448+ Read memory barriers imply address-dependency barriers, and so can
449+ substitute for them.
446450
447451 [!] Note that read barriers should normally be paired with write barriers;
448452 see the "SMP barrier pairing" subsection.
@@ -550,17 +554,21 @@ There are certain things that the Linux kernel memory barriers do not guarantee: · 101 unmodified lines
550554 Documentation/core-api/dma-api.rst
551555
552556
553−DATA DEPENDENCY BARRIERS (HISTORICAL)
554−-------------------------------------
557+ADDRESS-DEPENDENCY BARRIERS (HISTORICAL)
558+----------------------------------------
555559
556560 As of v4.15 of the Linux kernel, an smp_mb() was added to READ_ONCE() for
557561 DEC Alpha, which means that about the only people who need to pay attention
558562 to this section are those working on DEC Alpha architecture-specific code
559563 and those working on READ_ONCE() itself. For those who need it, and for
560564 those who are interested in the history, here is the story of
561−data-dependency barriers.
565+address-dependency barriers.
566+
567+[!] While address dependencies are observed in both load-to-load and
568+load-to-store relations, address-dependency barriers are not necessary
569+for load-to-store situations.
562570
563−The usage requirements of data dependency barriers are a little subtle, and
571+The requirement of address-dependency barriers is a little subtle, and
564572 it's not always obvious that they're needed. To illustrate, consider the
565573 following sequence of events:
566574
@@ -570,11 +578,14 @@ following sequence of events: · 3 unmodified lines
570578 B = 4;
571579 <write barrier>
572580 WRITE_ONCE(P, &B);
573− Q = READ_ONCE(P);
581+ Q = READ_ONCE_OLD(P);
574582 D = *Q;
575583
576−There's a clear data dependency here, and it would seem that by the end of the
577−sequence, Q must be either &A or &B, and that:
584+[!] READ_ONCE_OLD() corresponds to READ_ONCE() of pre-4.15 kernel, which
585+doesn't imply an address-dependency barrier.
586+
587+There's a clear address dependency here, and it would seem that by the end of
588+the sequence, Q must be either &A or &B, and that:
578589
579590 (Q == &A) implies (D == 1)
580591 (Q == &B) implies (D == 4)
@@ -588,8 +599,8 @@ While this may seem like a failure of coherency or causality maintenance, it · 7 unmodified lines
588599 isn't, and this behaviour can be observed on certain real CPUs (such as the DEC
589600 Alpha).
590601
591−To deal with this, a data dependency barrier or better must be inserted
592−between the address load and the data load:
602+To deal with this, READ_ONCE() provides an implicit address-dependency barrier
603+since kernel release v4.15:
593604
594605 CPU 1 CPU 2
595606 =============== ===============
@@ -598,7 +609,7 @@ between the address load and the data load: · 2 unmodified lines
598609 <write barrier>
599610 WRITE_ONCE(P, &B);
600611 Q = READ_ONCE(P);
601− <data dependency barrier>
612+ <implicit address-dependency barrier>
602613 D = *Q;
603614
604615 This enforces the occurrence of one of the two implications, and prevents the
@@ -615,13 +626,13 @@ odd-numbered bank is idle, one can see the new value of the pointer P (&B), · 10 unmodified lines
615626 but the old value of the variable B (2).
616627
617628
618−A data-dependency barrier is not required to order dependent writes
619−because the CPUs that the Linux kernel supports don't do writes
620−until they are certain (1) that the write will actually happen, (2)
621−of the location of the write, and (3) of the value to be written.
629+An address-dependency barrier is not required to order dependent writes
630+because the CPUs that the Linux kernel supports don't do writes until they
631+are certain (1) that the write will actually happen, (2) of the location of
632+the write, and (3) of the value to be written.
622633 But please carefully read the "CONTROL DEPENDENCIES" section and the
623−Documentation/RCU/rcu_dereference.rst file: The compiler can and does
624−break dependencies in a great many highly creative ways.
634+Documentation/RCU/rcu_dereference.rst file: The compiler can and does break
635+dependencies in a great many highly creative ways.
625636
626637 CPU 1 CPU 2
627638 =============== ===============
@@ -629,12 +640,12 @@ break dependencies in a great many highly creative ways. · 1 unmodified line
629640 B = 4;
630641 <write barrier>
631642 WRITE_ONCE(P, &B);
632− Q = READ_ONCE(P);
643+ Q = READ_ONCE_OLD(P);
633644 WRITE_ONCE(*Q, 5);
634645
635−Therefore, no data-dependency barrier is required to order the read into
646+Therefore, no address-dependency barrier is required to order the read into
636647 Q with the store into *Q. In other words, this outcome is prohibited,
637−even without a data-dependency barrier:
648+even without an implicit address-dependency barrier of modern READ_ONCE():
638649
639650 (Q == &B) && (B == 4)
640651
@@ -645,12 +656,12 @@ can be used to record rare error conditions and the like, and the CPUs' · 4 unmodified lines
645656 naturally occurring ordering prevents such records from being lost.
646657
647658
648−Note well that the ordering provided by a data dependency is local to
659+Note well that the ordering provided by an address dependency is local to
649660 the CPU containing it. See the section on "Multicopy atomicity" for
650661 more information.
651662
652663
653−The data dependency barrier is very important to the RCU system,
664+The address-dependency barrier is very important to the RCU system,
654665 for example. See rcu_assign_pointer() and rcu_dereference() in
655666 include/linux/rcupdate.h. This permits the current target of an RCU'd
656667 pointer to be replaced with a new modified target, without the replacement
@@ -667,20 +678,21 @@ not understand them. The purpose of this section is to help you prevent · 10 unmodified lines
667678 the compiler's ignorance from breaking your code.
668679
669680 A load-load control dependency requires a full read memory barrier, not
670−simply a data dependency barrier to make it work correctly. Consider the
671−following bit of code:
681+simply an (implicit) address-dependency barrier to make it work correctly.
682+Consider the following bit of code:
672683
673684 q = READ_ONCE(a);
685+ <implicit address-dependency barrier>
674686 if (q) {
675− <data dependency barrier> /* BUG: No data dependency!!! */
687+ /* BUG: No address dependency!!! */
676688 p = READ_ONCE(b);
677689 }
678690
679−This will not have the desired effect because there is no actual data
691+This will not have the desired effect because there is no actual address
680692 dependency, but rather a control dependency that the CPU may short-circuit
681693 by attempting to predict the outcome in advance, so that other CPUs see
682−the load from b as having happened before the load from a. In such a
683−case what's actually required is:
694+the load from b as having happened before the load from a. In such a case
695+what's actually required is:
684696
685697 q = READ_ONCE(a);
686698 if (q) {
@@ -927,9 +939,9 @@ General barriers pair with each other, though they also pair with most · 240 unmodified lines
927939 other types of barriers, albeit without multicopy atomicity. An acquire
928940 barrier pairs with a release barrier, but both may also pair with other
929941 barriers, including of course general barriers. A write barrier pairs
930−with a data dependency barrier, a control dependency, an acquire barrier,
942+with an address-dependency barrier, a control dependency, an acquire barrier,
931943 a release barrier, a read barrier, or a general barrier. Similarly a
932−read barrier, control dependency, or a data dependency barrier pairs
944+read barrier, control dependency, or an address-dependency barrier pairs
933945 with a write barrier, an acquire barrier, a release barrier, or a
934946 general barrier:
935947
@@ -948,7 +960,7 @@ Or: · 12 unmodified lines
948960 a = 1;
949961 <write barrier>
950962 WRITE_ONCE(b, &a); x = READ_ONCE(b);
951− <data dependency barrier>
963+ <implicit address-dependency barrier>
952964 y = *x;
953965
954966 Or even:
@@ -968,8 +980,8 @@ Basically, the read barrier always has to be there, even though it can be of · 13 unmodified lines
968980 the "weaker" type.
969981
970982 [!] Note that the stores before the write barrier would normally be expected to
971−match the loads after the read barrier or the data dependency barrier, and vice
972−versa:
983+match the loads after the read barrier or the address-dependency barrier, and
984+vice versa:
973985
974986 CPU 1 CPU 2
975987 =================== ===================
@@ -1021,8 +1033,8 @@ STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E · 45 unmodified lines
10211033 V
10221034
10231035
1024−Secondly, data dependency barriers act as partial orderings on data-dependent
1025−loads. Consider the following sequence of events:
1036+Secondly, address-dependency barriers act as partial orderings on address-
1037+dependent loads. Consider the following sequence of events:
10261038
10271039 CPU 1 CPU 2
10281040 ======================= =======================
@@ -1067,8 +1079,8 @@ effectively random order, despite the write barrier issued by CPU 1: · 38 unmodified lines
10671079 In the above example, CPU 2 perceives that B is 7, despite the load of *C
10681080 (which would be B) coming after the LOAD of C.
10691081
1070−If, however, a data dependency barrier were to be placed between the load of C
1071−and the load of *C (ie: B) on CPU 2:
1082+If, however, an address-dependency barrier were to be placed between the load
1083+of C and the load of *C (ie: B) on CPU 2:
10721084
10731085 CPU 1 CPU 2
10741086 ======================= =======================
@@ -1078,7 +1090,7 @@ and the load of *C (ie: B) on CPU 2: · 3 unmodified lines
10781090 <write barrier>
10791091 STORE C = &B LOAD X
10801092 STORE D = 4 LOAD C (gets &B)
1081− <data dependency barrier>
1093+ <address-dependency barrier>
10821094 LOAD *C (reads B)
10831095
10841096 then the following will occur:
@@ -1101,7 +1113,7 @@ then the following will occur: · 16 unmodified lines
11011113 | +-------+ | |
11021114 | | X->9 |------>| |
11031115 | +-------+ | |
1104− Makes sure all effects ---> \ ddddddddddddddddd | |
1116+ Makes sure all effects ---> \ aaaaaaaaaaaaaaaaa | |
11051117 prior to the store of C \ +-------+ | |
11061118 are perceptible to ----->| B->2 |------>| |
11071119 subsequent loads +-------+ | |
@@ -1292,7 +1304,7 @@ Which might appear as this: · 184 unmodified lines
12921304 LOAD with immediate effect : : +-------+
12931305
12941306
1295−Placing a read barrier or a data dependency barrier just before the second
1307+Placing a read barrier or an address-dependency barrier just before the second
12961308 load:
12971309
12981310 CPU 1 CPU 2
@@ -1816,20 +1828,20 @@ which may then reorder things however it wishes. · 517 unmodified lines
18161828 CPU MEMORY BARRIERS
18171829 -------------------
18181830
1819−The Linux kernel has eight basic CPU memory barriers:
1831+The Linux kernel has seven basic CPU memory barriers:
18201832
1821− TYPE MANDATORY SMP CONDITIONAL
1822− =============== ======================= ===========================
1823− GENERAL mb() smp_mb()
1824− WRITE wmb() smp_wmb()
1825− READ rmb() smp_rmb()
1826− DATA DEPENDENCY READ_ONCE()
1833+ TYPE MANDATORY SMP CONDITIONAL
1834+ ======================= =============== ===============
1835+ GENERAL mb() smp_mb()
1836+ WRITE wmb() smp_wmb()
1837+ READ rmb() smp_rmb()
1838+ ADDRESS DEPENDENCY READ_ONCE()
18271839
18281840
1829−All memory barriers except the data dependency barriers imply a compiler
1830−barrier. Data dependencies do not impose any additional compiler ordering.
1841+All memory barriers except the address-dependency barriers imply a compiler
1842+barrier. Address dependencies do not impose any additional compiler ordering.
18311843
1832−Aside: In the case of data dependencies, the compiler would be expected
1844+Aside: In the case of address dependencies, the compiler would be expected
18331845 to issue the loads in the correct order (eg. `a[b]` would have to load
18341846 the value of b before loading a[b]), however there is no guarantee in
18351847 the C specification that the compiler may not speculate the value of b
@@ -2749,7 +2761,8 @@ is discarded from the CPU's cache and reloaded. To deal with this, the · 913 unmodified lines
27492761 appropriate part of the kernel must invalidate the overlapping bits of the
27502762 cache on each CPU.
27512763
2752−See Documentation/core-api/cachetlb.rst for more information on cache management.
2764+See Documentation/core-api/cachetlb.rst for more information on cache
2765+management.
27532766
27542767
27552768 CACHE COHERENCY VS MMIO
@@ -2889,8 +2902,8 @@ AND THEN THERE'S THE ALPHA · 133 unmodified lines
28892902 The DEC Alpha CPU is one of the most relaxed CPUs there is. Not only that,
28902903 some versions of the Alpha CPU have a split data cache, permitting them to have
28912904 two semantically-related cache lines updated at separate times. This is where
2892−the data dependency barrier really becomes necessary as this synchronises both
2893−caches with the memory coherence system, thus making it seem like pointer
2905+the address-dependency barrier really becomes necessary as this synchronises
2906+both caches with the memory coherence system, thus making it seem like pointer
28942907 changes vs new data occur in the right order.
28952908
28962909 The Alpha defines the Linux kernel's memory model, although as of v4.15
Documentation/mm/unevictable-lru.rst+3−3
@@ -197,7 +197,7 @@ unevictable list for the memory cgroup and node being scanned. · 196 unmodified lines
197197 There may be situations where a page is mapped into a VM_LOCKED VMA, but the
198198 page is not marked as PG_mlocked. Such pages will make it all the way to
199199 shrink_active_list() or shrink_page_list() where they will be detected when
200−vmscan walks the reverse map in page_referenced() or try_to_unmap(). The page
200+vmscan walks the reverse map in folio_referenced() or try_to_unmap(). The page
201201 is culled to the unevictable list when it is released by the shrinker.
202202
203203 To "cull" an unevictable page, vmscan simply puts the page back on the LRU list
@@ -267,7 +267,7 @@ the LRU. Such pages can be "noticed" by memory management in several places: · 63 unmodified lines
267267 (4) in the fault path and when a VM_LOCKED stack segment is expanded; or
268268
269269 (5) as mentioned above, in vmscan:shrink_page_list() when attempting to
270− reclaim a page in a VM_LOCKED VMA by page_referenced() or try_to_unmap().
270+ reclaim a page in a VM_LOCKED VMA by folio_referenced() or try_to_unmap().
271271
272272 mlocked pages become unlocked and rescued from the unevictable list when:
273273
@@ -547,7 +547,7 @@ vmscan's shrink_inactive_list() and shrink_page_list() also divert obviously · 273 unmodified lines
547547 unevictable pages found on the inactive lists to the appropriate memory cgroup
548548 and node unevictable list.
549549
550−rmap's page_referenced_one(), called via vmscan's shrink_active_list() or
550+rmap's folio_referenced_one(), called via vmscan's shrink_active_list() or
551551 shrink_page_list(), and rmap's try_to_unmap_one() called via shrink_page_list(),
552552 check for (3) pages still mapped into VM_LOCKED VMAs, and call mlock_vma_page()
553553 to correct them. Such pages are culled to the unevictable list when released
Documentation/networking/ethtool-netlink.rst+59−0
@@ -220,6 +220,8 @@ Userspace to kernel: · 219 unmodified lines
220220 ``ETHTOOL_MSG_PHC_VCLOCKS_GET`` get PHC virtual clocks info
221221 ``ETHTOOL_MSG_MODULE_SET`` set transceiver module parameters
222222 ``ETHTOOL_MSG_MODULE_GET`` get transceiver module parameters
223+ ``ETHTOOL_MSG_PSE_SET`` set PSE parameters
224+ ``ETHTOOL_MSG_PSE_GET`` get PSE parameters
223225 ===================================== =================================
224226
225227 Kernel to userspace:
@@ -260,6 +262,7 @@ Kernel to userspace: · 34 unmodified lines
260262 ``ETHTOOL_MSG_STATS_GET_REPLY`` standard statistics
261263 ``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY`` PHC virtual clocks info
262264 ``ETHTOOL_MSG_MODULE_GET_REPLY`` transceiver module parameters
265+ ``ETHTOOL_MSG_PSE_GET_REPLY`` PSE parameters
263266 ======================================== =================================
264267
265268 ``GET`` requests are sent by userspace applications to retrieve device
@@ -1627,6 +1630,62 @@ For SFF-8636 modules, low power mode is forced by the host according to table · 1361 unmodified lines
16271630 For CMIS modules, low power mode is forced by the host according to table 6-12
16281631 in revision 5.0 of the specification.
16291632
1633+PSE_GET
1634+=======
1635+
1636+Gets PSE attributes.
1637+
1638+Request contents:
1639+
1640+ ===================================== ====== ==========================
1641+ ``ETHTOOL_A_PSE_HEADER`` nested request header
1642+ ===================================== ====== ==========================
1643+
1644+Kernel response contents:
1645+
1646+ ====================================== ====== =============================
1647+ ``ETHTOOL_A_PSE_HEADER`` nested reply header
1648+ ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` u32 Operational state of the PoDL
1649+ PSE functions
1650+ ``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` u32 power detection status of the
1651+ PoDL PSE.
1652+ ====================================== ====== =============================
1653+
1654+When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` attribute identifies
1655+the operational state of the PoDL PSE functions. The operational state of the
1656+PSE function can be changed using the ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL``
1657+action. This option is corresponding to ``IEEE 802.3-2018`` 30.15.1.1.2
1658+aPoDLPSEAdminState. Possible values are:
1659+
1660+.. kernel-doc:: include/uapi/linux/ethtool.h
1661+ :identifiers: ethtool_podl_pse_admin_state
1662+
1663+When set, the optional ``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` attribute identifies
1664+the power detection status of the PoDL PSE. The status depend on internal PSE
1665+state machine and automatic PD classification support. This option is
1666+corresponding to ``IEEE 802.3-2018`` 30.15.1.1.3 aPoDLPSEPowerDetectionStatus.
1667+Possible values are:
1668+
1669+.. kernel-doc:: include/uapi/linux/ethtool.h
1670+ :identifiers: ethtool_podl_pse_pw_d_status
1671+
1672+PSE_SET
1673+=======
1674+
1675+Sets PSE parameters.
1676+
1677+Request contents:
1678+
1679+ ====================================== ====== =============================
1680+ ``ETHTOOL_A_PSE_HEADER`` nested request header
1681+ ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` u32 Control PoDL PSE Admin state
1682+ ====================================== ====== =============================
1683+
1684+When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` attribute is used
1685+to control PoDL PSE Admin functions. This option is implementing
1686+``IEEE 802.3-2018`` 30.15.1.2.1 acPoDLPSEAdminControl. See
1687+``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` for supported values.
1688+
16301689 Request translation
16311690 ===================
16321691
Documentation/process/5.Posting.rst+4−2
@@ -256,8 +256,10 @@ The tags in common use are: · 255 unmodified lines
256256 - Cc: the named person received a copy of the patch and had the
257257 opportunity to comment on it.
258258
259−Be careful in the addition of tags to your patches: only Cc: is appropriate
260−for addition without the explicit permission of the person named.
259+Be careful in the addition of tags to your patches, as only Cc: is appropriate
260+for addition without the explicit permission of the person named; using
261+Reported-by: is fine most of the time as well, but ask for permission if
262+the bug was reported in private.
261263
262264
263265 Sending the patch
Documentation/process/changes.rst+41−0
@@ -31,6 +31,8 @@ you probably needn't concern yourself with pcmciautils. · 30 unmodified lines
3131 ====================== =============== ========================================
3232 GNU C 5.1 gcc --version
3333 Clang/LLVM (optional) 11.0.0 clang --version
34+Rust (optional) 1.62.0 rustc --version
35+bindgen (optional) 0.56.0 bindgen --version
3436 GNU make 3.81 make --version
3537 bash 4.2 bash --version
3638 binutils 2.23 ld -v
@@ -80,6 +82,29 @@ kernels. Older releases aren't guaranteed to work, and we may drop workarounds · 43 unmodified lines
8082 from the kernel that were used to support older versions. Please see additional
8183 docs on :ref:`Building Linux with Clang/LLVM <kbuild_llvm>`.
8284
85+Rust (optional)
86+---------------
87+
88+A particular version of the Rust toolchain is required. Newer versions may or
89+may not work because the kernel depends on some unstable Rust features, for
90+the moment.
91+
92+Each Rust toolchain comes with several "components", some of which are required
93+(like ``rustc``) and some that are optional. The ``rust-src`` component (which
94+is optional) needs to be installed to build the kernel. Other components are
95+useful for developing.
96+
97+Please see Documentation/rust/quick-start.rst for instructions on how to
98+satisfy the build requirements of Rust support. In particular, the ``Makefile``
99+target ``rustavailable`` is useful to check why the Rust toolchain may not
100+be detected.
101+
102+bindgen (optional)
103+------------------
104+
105+``bindgen`` is used to generate the Rust bindings to the C side of the kernel.
106+It depends on ``libclang``.
107+
83108 Make
84109 ----
85110
@@ -348,6 +373,12 @@ Sphinx · 262 unmodified lines
348373 Please see :ref:`sphinx_install` in :ref:`Documentation/doc-guide/sphinx.rst <sphinxdoc>`
349374 for details about Sphinx requirements.
350375
376+rustdoc
377+-------
378+
379+``rustdoc`` is used to generate the documentation for Rust code. Please see
380+Documentation/rust/general-information.rst for more information.
381+
351382 Getting updated software
352383 ========================
353384
@@ -364,6 +395,16 @@ Clang/LLVM · 10 unmodified lines
364395
365396 - :ref:`Getting LLVM <getting_llvm>`.
366397
398+Rust
399+----
400+
401+- Documentation/rust/quick-start.rst.
402+
403+bindgen
404+-------
405+
406+- Documentation/rust/quick-start.rst.
407+
367408 Make
368409 ----
369410
Documentation/process/code-of-conduct-interpretation.rst+14−12
@@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or other maintainers if you're · 50 unmodified lines
5151 uncertain how to handle situations that come up. It will not be
5252 considered a violation report unless you want it to be. If you are
5353 uncertain about approaching the TAB or any other maintainers, please
54−reach out to our conflict mediator, Mishi Choudhary <mishi@linux.com>.
54+reach out to our conflict mediator, Joanna Lee <joanna.lee@gesmer.com>.
5555
5656 In the end, "be kind to each other" is really what the end goal is for
5757 everybody. We know everyone is human and we all fail at times, but the
@@ -127,10 +127,12 @@ are listed at https://kernel.org/code-of-conduct.html. Members can not · 69 unmodified lines
127127 access reports made before they joined or after they have left the
128128 committee.
129129
130−The initial Code of Conduct Committee consists of volunteer members of
131−the TAB, as well as a professional mediator acting as a neutral third
132−party. The first task of the committee is to establish documented
133−processes, which will be made public.
130+The Code of Conduct Committee consists of volunteer community members
131+appointed by the TAB, as well as a professional mediator acting as a
132+neutral third party. The processes the Code of Conduct committee will
133+use to address reports is varied and will depend on the individual
134+circumstance, however, this file serves as documentation for the
135+general process used.
134136
135137 Any member of the committee, including the mediator, can be contacted
136138 directly if a reporter does not wish to include the full committee in a
@@ -141,16 +143,16 @@ processes (see above) and consults with the TAB as needed and · 4 unmodified lines
141143 appropriate, for instance to request and receive information about the
142144 kernel community.
143145
144−Any decisions by the committee will be brought to the TAB, for
145−implementation of enforcement with the relevant maintainers if needed.
146−A decision by the Code of Conduct Committee can be overturned by the TAB
147−by a two-thirds vote.
146+Any decisions regarding enforcement recommendations will be brought to
147+the TAB for implementation of enforcement with the relevant maintainers
148+if needed. A decision by the Code of Conduct Committee can be overturned
149+by the TAB by a two-thirds vote.
148150
149151 At quarterly intervals, the Code of Conduct Committee and TAB will
150152 provide a report summarizing the anonymised reports that the Code of
151153 Conduct committee has received and their status, as well details of any
152154 overridden decisions including complete and identifiable voting details.
153155
154−We expect to establish a different process for Code of Conduct Committee
155−staffing beyond the bootstrap period. This document will be updated
156−with that information when this occurs.
156+Because how we interpret and enforce the Code of Conduct will evolve over
157+time, this document will be updated when necessary to reflect any
158+changes.
Documentation/process/coding-style.rst+62−0
@@ -1186,6 +1186,68 @@ expression used. For instance: · 1185 unmodified lines
11861186 #endif /* CONFIG_SOMETHING */
11871187
11881188
1189+22) Do not crash the kernel
1190+---------------------------
1191+
1192+In general, the decision to crash the kernel belongs to the user, rather
1193+than to the kernel developer.
1194+
1195+Avoid panic()
1196+*************
1197+
1198+panic() should be used with care and primarily only during system boot.
1199+panic() is, for example, acceptable when running out of memory during boot and
1200+not being able to continue.
1201+
1202+Use WARN() rather than BUG()
1203+****************************
1204+
1205+Do not add new code that uses any of the BUG() variants, such as BUG(),
1206+BUG_ON(), or VM_BUG_ON(). Instead, use a WARN*() variant, preferably
1207+WARN_ON_ONCE(), and possibly with recovery code. Recovery code is not
1208+required if there is no reasonable way to at least partially recover.
1209+
1210+"I'm too lazy to do error handling" is not an excuse for using BUG(). Major
1211+internal corruptions with no way of continuing may still use BUG(), but need
1212+good justification.
1213+
1214+Use WARN_ON_ONCE() rather than WARN() or WARN_ON()
1215+**************************************************
1216+
1217+WARN_ON_ONCE() is generally preferred over WARN() or WARN_ON(), because it
1218+is common for a given warning condition, if it occurs at all, to occur
1219+multiple times. This can fill up and wrap the kernel log, and can even slow
1220+the system enough that the excessive logging turns into its own, additional
1221+problem.
1222+
1223+Do not WARN lightly
1224+*******************
1225+
1226+WARN*() is intended for unexpected, this-should-never-happen situations.
1227+WARN*() macros are not to be used for anything that is expected to happen
1228+during normal operation. These are not pre- or post-condition asserts, for
1229+example. Again: WARN*() must not be used for a condition that is expected
1230+to trigger easily, for example, by user space actions. pr_warn_once() is a
1231+possible alternative, if you need to notify the user of a problem.
1232+
1233+Do not worry about panic_on_warn users
1234+**************************************
1235+
1236+A few more words about panic_on_warn: Remember that ``panic_on_warn`` is an
1237+available kernel option, and that many users set this option. This is why
1238+there is a "Do not WARN lightly" writeup, above. However, the existence of
1239+panic_on_warn users is not a valid reason to avoid the judicious use
1240+WARN*(). That is because, whoever enables panic_on_warn has explicitly
1241+asked the kernel to crash if a WARN*() fires, and such users must be
1242+prepared to deal with the consequences of a system that is somewhat more
1243+likely to crash.
1244+
1245+Use BUILD_BUG_ON() for compile-time assertions
1246+**********************************************
1247+
1248+The use of BUILD_BUG_ON() is acceptable and encouraged, because it is a
1249+compile-time assertion that has no effect at runtime.
1250+
11891251 Appendix I) References
11901252 ----------------------
11911253
Documentation/process/deprecated.rst+7−4
@@ -138,17 +138,20 @@ be NUL terminated. This can lead to various linear read overflows and · 137 unmodified lines
138138 other misbehavior due to the missing termination. It also NUL-pads
139139 the destination buffer if the source contents are shorter than the
140140 destination buffer size, which may be a needless performance penalty
141−for callers using only NUL-terminated strings. The safe replacement is
141+for callers using only NUL-terminated strings.
142+
143+When the destination is required to be NUL-terminated, the replacement is
142144 strscpy(), though care must be given to any cases where the return value
143145 of strncpy() was used, since strscpy() does not return a pointer to the
144146 destination, but rather a count of non-NUL bytes copied (or negative
145147 errno when it truncates). Any cases still needing NUL-padding should
146148 instead use strscpy_pad().
147149
148−If a caller is using non-NUL-terminated strings, strncpy() can
149−still be used, but destinations should be marked with the `__nonstring
150+If a caller is using non-NUL-terminated strings, strtomem() should be
151+used, and the destinations should be marked with the `__nonstring
150152 <https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html>`_
151−attribute to avoid future compiler warnings.
153+attribute to avoid future compiler warnings. For cases still needing
154+NUL-padding, strtomem_pad() can be used.
152155
153156 strlcpy()
154157 ---------
Documentation/process/index.rst+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55
66 .. _process_index:
77
8+=============================================
89 Working with the kernel development community
910 =============================================
1011
Documentation/process/maintainer-pgp-guide.rst+142−144
@@ -121,57 +121,56 @@ edit your ``~/.gnupg/gpg-agent.conf`` file to set your own values:: · 120 unmodified lines
121121 to remove anything you had in place for older versions of GnuPG, as
122122 it may not be doing the right thing any more.
123123
124−Set up a refresh cronjob
125−~~~~~~~~~~~~~~~~~~~~~~~~
126−
127−You will need to regularly refresh your keyring in order to get the
128−latest changes on other people's public keys, which is best done with a
129−daily cronjob::
130−
131− @daily /usr/bin/gpg2 --refresh >/dev/null 2>&1
132−
133−Check the full path to your ``gpg`` or ``gpg2`` command and use the
134−``gpg2`` command if regular ``gpg`` for you is the legacy GnuPG v.1.
135−
136−.. _master_key:
124+.. _protect_your_key:
137125
138−Protect your master PGP key
139−===========================
126+Protect your PGP key
127+====================
140128
141129 This guide assumes that you already have a PGP key that you use for Linux
142130 kernel development purposes. If you do not yet have one, please see the
143131 "`Protecting Code Integrity`_" document mentioned earlier for guidance
144132 on how to create a new one.
145133
146−You should also make a new key if your current one is weaker than 2048 bits
147−(RSA).
148−
149−Master key vs. Subkeys
150−----------------------
151−
152−Subkeys are fully independent PGP keypairs that are tied to the "master"
153−key using certifying key signatures (certificates). It is important to
154−understand the following:
155−
156−1. There are no technical differences between the "master key" and "subkeys."
157−2. At creation time, we assign functional limitations to each key by
158− giving it specific capabilities.
159−3. A PGP key can have 4 capabilities:
160−
161− - **[S]** key can be used for signing
162− - **[E]** key can be used for encryption
163− - **[A]** key can be used for authentication
164− - **[C]** key can be used for certifying other keys
165−
166−4. A single key may have multiple capabilities.
167−5. A subkey is fully independent from the master key. A message
168− encrypted to a subkey cannot be decrypted with the master key. If you
169− lose your private subkey, it cannot be recreated from the master key
170− in any way.
171−
172−The key carrying the **[C]** (certify) capability is considered the
173−"master" key because it is the only key that can be used to indicate
174−relationship with other keys. Only the **[C]** key can be used to:
134+You should also make a new key if your current one is weaker than 2048
135+bits (RSA).
136+
137+Understanding PGP Subkeys
138+-------------------------
139+
140+A PGP key rarely consists of a single keypair -- usually it is a
141+collection of independent subkeys that can be used for different
142+purposes based on their capabilities, assigned at their creation time.
143+PGP defines four capabilities that a key can have:
144+
145+- **[S]** keys can be used for signing
146+- **[E]** keys can be used for encryption
147+- **[A]** keys can be used for authentication
148+- **[C]** keys can be used for certifying other keys
149+
150+The key with the **[C]** capability is often called the "master" key,
151+but this terminology is misleading because it implies that the Certify
152+key can be used in place of any of other subkey on the same chain (like
153+a physical "master key" can be used to open the locks made for other
154+keys). Since this is not the case, this guide will refer to it as "the
155+Certify key" to avoid any ambiguity.
156+
157+It is critical to fully understand the following:
158+
159+1. All subkeys are fully independent from each other. If you lose a
160+ private subkey, it cannot be restored or recreated from any other
161+ private key on your chain.
162+2. With the exception of the Certify key, there can be multiple subkeys
163+ with identical capabilities (e.g. you can have 2 valid encryption
164+ subkeys, 3 valid signing subkeys, but only one valid certification
165+ subkey). All subkeys are fully independent -- a message encrypted to
166+ one **[E]** subkey cannot be decrypted with any other **[E]** subkey
167+ you may also have.
168+3. A single subkey may have multiple capabilities (e.g. your **[C]** key
169+ can also be your **[S]** key).
170+
171+The key carrying the **[C]** (certify) capability is the only key that
172+can be used to indicate relationship with other keys. Only the **[C]**
173+key can be used to:
175174
176175 - add or revoke other keys (subkeys) with S/E/A capabilities
177176 - add, change or revoke identities (uids) associated with the key
@@ -180,7 +179,7 @@ relationship with other keys. Only the **[C]** key can be used to: · 2 unmodified lines
180179
181180 By default, GnuPG creates the following when generating new keys:
182181
183−- A master key carrying both Certify and Sign capabilities (**[SC]**)
182+- One subkey carrying both Certify and Sign capabilities (**[SC]**)
184183 - A separate subkey with the Encryption capability (**[E]**)
185184
186185 If you used the default parameters when generating your key, then that
@@ -192,9 +191,6 @@ for example:: · 5 unmodified lines
192191 uid [ultimate] Alice Dev <adev@kernel.org>
193192 ssb rsa2048 2018-01-23 [E] [expires: 2020-01-23]
194193
195−Any key carrying the **[C]** capability is your master key, regardless
196−of any other capabilities it may have assigned to it.
197−
198194 The long line under the ``sec`` entry is your key fingerprint --
199195 whenever you see ``[fpr]`` in the examples below, that 40-character
200196 string is what it refers to.
@@ -215,37 +211,30 @@ strong passphrase. To set it or change it, use:: · 14 unmodified lines
215211 Create a separate Signing subkey
216212 --------------------------------
217213
218−Our goal is to protect your master key by moving it to offline media, so
219−if you only have a combined **[SC]** key, then you should create a separate
220−signing subkey::
214+Our goal is to protect your Certify key by moving it to offline media,
215+so if you only have a combined **[SC]** key, then you should create a
216+separate signing subkey::
221217
222218 $ gpg --quick-addkey [fpr] ed25519 sign
223219
224−Remember to tell the keyservers about this change, so others can pull down
225−your new subkey::
226−
227− $ gpg --send-key [fpr]
228−
229220 .. note:: ECC support in GnuPG
230221
231222 GnuPG 2.1 and later has full support for Elliptic Curve
232223 Cryptography, with ability to combine ECC subkeys with traditional
233− RSA master keys. The main upside of ECC cryptography is that it is
234− much faster computationally and creates much smaller signatures when
224+ RSA keys. The main upside of ECC cryptography is that it is much
225+ faster computationally and creates much smaller signatures when
235226 compared byte for byte with 2048+ bit RSA keys. Unless you plan on
236227 using a smartcard device that does not support ECC operations, we
237228 recommend that you create an ECC signing subkey for your kernel
238229 work.
239230
240− If for some reason you prefer to stay with RSA subkeys, just replace
241− "ed25519" with "rsa2048" in the above command. Additionally, if you
242− plan to use a hardware device that does not support ED25519 ECC
243− keys, like Nitrokey Pro or a Yubikey, then you should use
244− "nistp256" instead or "ed25519."
231+ Note, that if you plan to use a hardware device that does not
232+ support ED25519 ECC keys, you should choose "nistp256" instead or
233+ "ed25519."
245234
246235
247−Back up your master key for disaster recovery
248−---------------------------------------------
236+Back up your Certify key for disaster recovery
237+----------------------------------------------
249238
250239 The more signatures you have on your PGP key from other developers, the
251240 more reasons you have to create a backup version that lives on something
@@ -277,9 +266,7 @@ home, such as your bank vault. · 25 unmodified lines
277266 Your printer is probably no longer a simple dumb device connected to
278267 your parallel port, but since the output is still encrypted with
279268 your passphrase, printing out even to "cloud-integrated" modern
280− printers should remain a relatively safe operation. One option is to
281− change the passphrase on your master key immediately after you are
282− done with paperkey.
269+ printers should remain a relatively safe operation.
283270
284271 Back up your whole GnuPG directory
285272 ----------------------------------
@@ -300,7 +287,7 @@ will use for backup purposes. You will need to encrypt them using LUKS · 14 unmodified lines
300287 -- refer to your distro's documentation on how to accomplish this.
301288
302289 For the encryption passphrase, you can use the same one as on your
303−master key.
290+PGP key.
304291
305292 Once the encryption process is over, re-insert the USB drive and make
306293 sure it gets properly mounted. Copy your entire ``.gnupg`` directory
@@ -319,7 +306,7 @@ far away, because you'll need to use it every now and again for things · 12 unmodified lines
319306 like editing identities, adding or revoking subkeys, or signing other
320307 people's keys.
321308
322−Remove the master key from your homedir
309+Remove the Certify key from your homedir
323310 ----------------------------------------
324311
325312 The files in our home directory are not as well protected as we like to
@@ -334,7 +321,7 @@ think. They can be leaked or stolen via many different means: · 8 unmodified lines
334321 Protecting your key with a good passphrase greatly helps reduce the risk
335322 of any of the above, but passphrases can be discovered via keyloggers,
336323 shoulder-surfing, or any number of other means. For this reason, the
337−recommended setup is to remove your master key from your home directory
324+recommended setup is to remove your Certify key from your home directory
338325 and store it on offline storage.
339326
340327 .. warning::
@@ -343,7 +330,7 @@ and store it on offline storage. · 2 unmodified lines
343330 your GnuPG directory in its entirety. What we are about to do will
344331 render your key useless if you do not have a usable backup!
345332
346−First, identify the keygrip of your master key::
333+First, identify the keygrip of your Certify key::
347334
348335 $ gpg --with-keygrip --list-key [fpr]
349336
@@ -359,7 +346,7 @@ The output will be something like this:: · 9 unmodified lines
359346 Keygrip = 3333000000000000000000000000000000000000
360347
361348 Find the keygrip entry that is beneath the ``pub`` line (right under the
362−master key fingerprint). This will correspond directly to a file in your
349+Certify key fingerprint). This will correspond directly to a file in your
363350 ``~/.gnupg`` directory::
364351
365352 $ cd ~/.gnupg/private-keys-v1.d
@@ -369,13 +356,13 @@ master key fingerprint). This will correspond directly to a file in your · 3 unmodified lines
369356 3333000000000000000000000000000000000000.key
370357
371358 All you have to do is simply remove the .key file that corresponds to
372−the master keygrip::
359+the Certify key keygrip::
373360
374361 $ cd ~/.gnupg/private-keys-v1.d
375362 $ rm 1111000000000000000000000000000000000000.key
376363
377364 Now, if you issue the ``--list-secret-keys`` command, it will show that
378−the master key is missing (the ``#`` indicates it is not available)::
365+the Certify key is missing (the ``#`` indicates it is not available)::
379366
380367 $ gpg --list-secret-keys
381368 sec# rsa2048 2018-01-24 [SC] [expires: 2020-01-24]
@@ -404,7 +391,7 @@ file, which still contains your private keys. · 22 unmodified lines
404391 Move the subkeys to a dedicated crypto device
405392 =============================================
406393
407−Even though the master key is now safe from being leaked or stolen, the
394+Even though the Certify key is now safe from being leaked or stolen, the
408395 subkeys are still in your home directory. Anyone who manages to get
409396 their hands on those will be able to decrypt your communication or fake
410397 your signatures (if they know the passphrase). Furthermore, each time a
@@ -447,7 +434,8 @@ functionality. There are several options available: · 36 unmodified lines
447434 - `Yubikey 5`_: proprietary hardware and software, but cheaper than
448435 Nitrokey Pro and comes available in the USB-C form that is more useful
449436 with newer laptops. Offers additional security features such as FIDO
450− U2F, among others, and now finally supports ECC keys (NISTP).
437+ U2F, among others, and now finally supports NISTP and ED25519 ECC
438+ keys.
451439
452440 `LWN has a good review`_ of some of the above models, as well as several
453441 others. Your choice will depend on cost, shipping availability in your
@@ -460,7 +448,7 @@ geographical region, and open/proprietary hardware considerations. · 6 unmodified lines
460448 Foundation.
461449
462450 .. _`Nitrokey Start`: https://shop.nitrokey.com/shop/product/nitrokey-start-6
463−.. _`Nitrokey Pro 2`: https://shop.nitrokey.com/shop/product/nitrokey-pro-2-3
451+.. _`Nitrokey Pro 2`: https://shop.nitrokey.com/shop/product/nkpr2-nitrokey-pro-2-3
464452 .. _`Yubikey 5`: https://www.yubico.com/products/yubikey-5-overview/
465453 .. _Gnuk: https://www.fsij.org/doc-gnuk/
466454 .. _`LWN has a good review`: https://lwn.net/Articles/736231/
@@ -627,10 +615,10 @@ Other common GnuPG operations · 160 unmodified lines
627615 Here is a quick reference for some common operations you'll need to do
628616 with your PGP key.
629617
630−Mounting your master key offline storage
631−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
618+Mounting your safe offline storage
619+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
632620
633−You will need your master key for any of the operations below, so you
621+You will need your Certify key for any of the operations below, so you
634622 will first need to mount your backup offline storage and tell GnuPG to
635623 use it::
636624
@@ -644,7 +632,7 @@ your regular home directory location). · 7 unmodified lines
644632 Extending key expiration date
645633 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
646634
647−The master key has the default expiration date of 2 years from the date
635+The Certify key has the default expiration date of 2 years from the date
648636 of creation. This is done both for security reasons and to make obsolete
649637 keys eventually disappear from keyservers.
650638
@@ -685,6 +673,7 @@ remote end. · 34 unmodified lines
685673
686674 .. _`Agent Forwarding over SSH`: https://wiki.gnupg.org/AgentForwarding
687675
676+.. _pgp_with_git:
688677
689678 Using PGP with Git
690679 ==================
@@ -828,6 +817,63 @@ You can tell git to always sign commits:: · 137 unmodified lines
828817
829818 .. _verify_identities:
830819
820+
821+How to work with signed patches
822+-------------------------------
823+
824+It is possible to use your PGP key to sign patches sent to kernel
825+developer mailing lists. Since existing email signature mechanisms
826+(PGP-Mime or PGP-inline) tend to cause problems with regular code
827+review tasks, you should use the tool kernel.org created for this
828+purpose that puts cryptographic attestation signatures into message
829+headers (a-la DKIM):
830+
831+- `Patatt Patch Attestation`_
832+
833+.. _`Patatt Patch Attestation`: https://pypi.org/project/patatt/
834+
835+Installing and configuring patatt
836+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
837+
838+Patatt is packaged for many distributions already, so please check there
839+first. You can also install it from pypi using "``pip install patatt``".
840+
841+If you already have your PGP key configured with git (via the
842+``user.signingKey`` configuration parameter), then patatt requires no
843+further configuration. You can start signing your patches by installing
844+the git-send-email hook in the repository you want::
845+
846+ patatt install-hook
847+
848+Now any patches you send with ``git send-email`` will be automatically
849+signed with your cryptographic signature.
850+
851+Checking patatt signatures
852+~~~~~~~~~~~~~~~~~~~~~~~~~~
853+
854+If you are using ``b4`` to retrieve and apply patches, then it will
855+automatically attempt to verify all DKIM and patatt signatures it
856+encounters, for example::
857+
858+ $ b4 am 20220720205013.890942-1-broonie@kernel.org
859+ [...]
860+ Checking attestation on all messages, may take a moment...
861+ ---
862+ ✓ [PATCH v1 1/3] kselftest/arm64: Correct buffer allocation for SVE Z registers
863+ ✓ [PATCH v1 2/3] arm64/sve: Document our actual ABI for clearing registers on syscall
864+ ✓ [PATCH v1 3/3] kselftest/arm64: Enforce actual ABI for SVE syscalls
865+ ---
866+ ✓ Signed: openpgp/broonie@kernel.org
867+ ✓ Signed: DKIM/kernel.org
868+
869+.. note::
870+
871+ Patatt and b4 are still in active development and you should check
872+ the latest documentation for these projects for any new or updated
873+ features.
874+
875+.. _kernel_identities:
876+
831877 How to verify kernel developer identities
832878 =========================================
833879
@@ -899,65 +945,17 @@ the new default in GnuPG v2). To set it, add (or modify) the · 65 unmodified lines
899945
900946 trust-model tofu+pgp
901947
902−How to use keyservers (more) safely
903−-----------------------------------
904−
905−If you get a "No public key" error when trying to validate someone's
906−tag, then you should attempt to lookup that key using a keyserver. It is
907−important to keep in mind that there is absolutely no guarantee that the
908−key you retrieve from PGP keyservers belongs to the actual person --
909−that much is by design. You are supposed to use the Web of Trust to
910−establish key validity.
911−
912−How to properly maintain the Web of Trust is beyond the scope of this
913−document, simply because doing it properly requires both effort and
914−dedication that tends to be beyond the caring threshold of most human
915−beings. Here are some shortcuts that will help you reduce the risk of
916−importing a malicious key.
917−
918−First, let's say you've tried to run ``git verify-tag`` but it returned
919−an error saying the key is not found::
920−
921− $ git verify-tag sunxi-fixes-for-4.15-2
922− gpg: Signature made Sun 07 Jan 2018 10:51:55 PM EST
923− gpg: using RSA key DA73759BF8619E484E5A3B47389A54219C0F2430
924− gpg: issuer "wens@...org"
925− gpg: Can't check signature: No public key
926−
927−Let's query the keyserver for more info about that key fingerprint (the
928−fingerprint probably belongs to a subkey, so we can't use it directly
929−without finding out the ID of the master key it is associated with)::
930−
931− $ gpg --search DA73759BF8619E484E5A3B47389A54219C0F2430
932− gpg: data source: hkp://keys.gnupg.net
933− (1) Chen-Yu Tsai <wens@...org>
934− 4096 bit RSA key C94035C21B4F2AEB, created: 2017-03-14, expires: 2019-03-15
935− Keys 1-1 of 1 for "DA73759BF8619E484E5A3B47389A54219C0F2430". Enter number(s), N)ext, or Q)uit > q
936−
937−Locate the ID of the master key in the output, in our example
938−``C94035C21B4F2AEB``. Now display the key of Linus Torvalds that you
939−have on your keyring::
940−
941− $ gpg --list-key torvalds@kernel.org
942− pub rsa2048 2011-09-20 [SC]
943− ABAF11C65A2970B130ABE3C479BE3E4300411886
944− uid [ unknown] Linus Torvalds <torvalds@kernel.org>
945− sub rsa2048 2011-09-20 [E]
946−
947−Next, find a trust path from Linus Torvalds to the key-id you found via ``gpg
948−--search`` of the unknown key. For this, you can use several tools including
949−https://github.com/mricon/wotmate,
950−https://git.kernel.org/pub/scm/docs/kernel/pgpkeys.git/tree/graphs, and
951−https://the.earth.li/~noodles/pathfind.html.
952−
953−If you get a few decent trust paths, then it's a pretty good indication
954−that it is a valid key. You can add it to your keyring from the
955−keyserver now::
956−
957− $ gpg --recv-key C94035C21B4F2AEB
958−
959−This process is not perfect, and you are obviously trusting the
960−administrators of the PGP Pathfinder service to not be malicious (in
961−fact, this goes against :ref:`devs_not_infra`). However, if you
962−do not carefully maintain your own web of trust, then it is a marked
963−improvement over blindly trusting keyservers.
948+Using the kernel.org web of trust repository
949+--------------------------------------------
950+
951+Kernel.org maintains a git repository with developers' public keys as a
952+replacement for replicating keyserver networks that have gone mostly
953+dark in the past few years. The full documentation for how to set up
954+that repository as your source of public keys can be found here:
955+
956+- `Kernel developer PGP Keyring`_
957+
958+If you are a kernel developer, please consider submitting your key for
959+inclusion into that keyring.
960+
961+.. _`Kernel developer PGP Keyring`: https://korg.docs.kernel.org/pgpkeys.html
Documentation/process/stable-kernel-rules.rst+6−0
@@ -97,6 +97,12 @@ text, like this: · 96 unmodified lines
9797
9898 commit <sha1> upstream.
9999
100+or alternatively:
101+
102+.. code-block:: none
103+
104+ [ Upstream commit <sha1> ]
105+
100106 Additionally, some patches submitted via :ref:`option_1` may have additional
101107 patch prerequisites which can be cherry-picked. This can be specified in the
102108 following format in the sign-off area:
Documentation/process/submitting-patches.rst+2−2
@@ -715,8 +715,8 @@ references. · 714 unmodified lines
715715
716716 .. _backtraces:
717717
718−Backtraces in commit mesages
719−^^^^^^^^^^^^^^^^^^^^^^^^^^^^
718+Backtraces in commit messages
719+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
720720
721721 Backtraces help document the call chain leading to a problem. However,
722722 not all backtraces are helpful. For example, early boot call chains are
Documentation/rust/arch-support.rst+19−0
@@ -0,0 +1,19 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+Arch Support
4+============
5+
6+Currently, the Rust compiler (``rustc``) uses LLVM for code generation,
7+which limits the supported architectures that can be targeted. In addition,
8+support for building the kernel with LLVM/Clang varies (please see
9+Documentation/kbuild/llvm.rst). This support is needed for ``bindgen``
10+which uses ``libclang``.
11+
12+Below is a general summary of architectures that currently work. Level of
13+support corresponds to ``S`` values in the ``MAINTAINERS`` file.
14+
15+============ ================ ==============================================
16+Architecture Level of support Constraints
17+============ ================ ==============================================
18+``x86`` Maintained ``x86_64`` only.
19+============ ================ ==============================================
Documentation/rust/coding-guidelines.rst+216−0
@@ -0,0 +1,216 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+Coding Guidelines
4+=================
5+
6+This document describes how to write Rust code in the kernel.
7+
8+
9+Style & formatting
10+------------------
11+
12+The code should be formatted using ``rustfmt``. In this way, a person
13+contributing from time to time to the kernel does not need to learn and
14+remember one more style guide. More importantly, reviewers and maintainers
15+do not need to spend time pointing out style issues anymore, and thus
16+less patch roundtrips may be needed to land a change.
17+
18+.. note:: Conventions on comments and documentation are not checked by
19+ ``rustfmt``. Thus those are still needed to be taken care of.
20+
21+The default settings of ``rustfmt`` are used. This means the idiomatic Rust
22+style is followed. For instance, 4 spaces are used for indentation rather
23+than tabs.
24+
25+It is convenient to instruct editors/IDEs to format while typing,
26+when saving or at commit time. However, if for some reason reformatting
27+the entire kernel Rust sources is needed at some point, the following can be
28+run::
29+
30+ make LLVM=1 rustfmt
31+
32+It is also possible to check if everything is formatted (printing a diff
33+otherwise), for instance for a CI, with::
34+
35+ make LLVM=1 rustfmtcheck
36+
37+Like ``clang-format`` for the rest of the kernel, ``rustfmt`` works on
38+individual files, and does not require a kernel configuration. Sometimes it may
39+even work with broken code.
40+
41+
42+Comments
43+--------
44+
45+"Normal" comments (i.e. ``//``, rather than code documentation which starts
46+with ``///`` or ``//!``) are written in Markdown the same way as documentation
47+comments are, even though they will not be rendered. This improves consistency,
48+simplifies the rules and allows to move content between the two kinds of
49+comments more easily. For instance:
50+
51+.. code-block:: rust
52+
53+ // `object` is ready to be handled now.
54+ f(object);
55+
56+Furthermore, just like documentation, comments are capitalized at the beginning
57+of a sentence and ended with a period (even if it is a single sentence). This
58+includes ``// SAFETY:``, ``// TODO:`` and other "tagged" comments, e.g.:
59+
60+.. code-block:: rust
61+
62+ // FIXME: The error should be handled properly.
63+
64+Comments should not be used for documentation purposes: comments are intended
65+for implementation details, not users. This distinction is useful even if the
66+reader of the source file is both an implementor and a user of an API. In fact,
67+sometimes it is useful to use both comments and documentation at the same time.
68+For instance, for a ``TODO`` list or to comment on the documentation itself.
69+For the latter case, comments can be inserted in the middle; that is, closer to
70+the line of documentation to be commented. For any other case, comments are
71+written after the documentation, e.g.:
72+
73+.. code-block:: rust
74+
75+ /// Returns a new [`Foo`].
76+ ///
77+ /// # Examples
78+ ///
79+ // TODO: Find a better example.
80+ /// ```
81+ /// let foo = f(42);
82+ /// ```
83+ // FIXME: Use fallible approach.
84+ pub fn f(x: i32) -> Foo {
85+ // ...
86+ }
87+
88+One special kind of comments are the ``// SAFETY:`` comments. These must appear
89+before every ``unsafe`` block, and they explain why the code inside the block is
90+correct/sound, i.e. why it cannot trigger undefined behavior in any case, e.g.:
91+
92+.. code-block:: rust
93+
94+ // SAFETY: `p` is valid by the safety requirements.
95+ unsafe { *p = 0; }
96+
97+``// SAFETY:`` comments are not to be confused with the ``# Safety`` sections
98+in code documentation. ``# Safety`` sections specify the contract that callers
99+(for functions) or implementors (for traits) need to abide by. ``// SAFETY:``
100+comments show why a call (for functions) or implementation (for traits) actually
101+respects the preconditions stated in a ``# Safety`` section or the language
102+reference.
103+
104+
105+Code documentation
106+------------------
107+
108+Rust kernel code is not documented like C kernel code (i.e. via kernel-doc).
109+Instead, the usual system for documenting Rust code is used: the ``rustdoc``
110+tool, which uses Markdown (a lightweight markup language).
111+
112+To learn Markdown, there are many guides available out there. For instance,
113+the one at:
114+
115+ https://commonmark.org/help/
116+
117+This is how a well-documented Rust function may look like:
118+
119+.. code-block:: rust
120+
121+ /// Returns the contained [`Some`] value, consuming the `self` value,
122+ /// without checking that the value is not [`None`].
123+ ///
124+ /// # Safety
125+ ///
126+ /// Calling this method on [`None`] is *[undefined behavior]*.
127+ ///
128+ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
129+ ///
130+ /// # Examples
131+ ///
132+ /// ```
133+ /// let x = Some("air");
134+ /// assert_eq!(unsafe { x.unwrap_unchecked() }, "air");
135+ /// ```
136+ pub unsafe fn unwrap_unchecked(self) -> T {
137+ match self {
138+ Some(val) => val,
139+
140+ // SAFETY: The safety contract must be upheld by the caller.
141+ None => unsafe { hint::unreachable_unchecked() },
142+ }
143+ }
144+
145+This example showcases a few ``rustdoc`` features and some conventions followed
146+in the kernel:
147+
148+ - The first paragraph must be a single sentence briefly describing what
149+ the documented item does. Further explanations must go in extra paragraphs.
150+
151+ - Unsafe functions must document their safety preconditions under
152+ a ``# Safety`` section.
153+
154+ - While not shown here, if a function may panic, the conditions under which
155+ that happens must be described under a ``# Panics`` section.
156+
157+ Please note that panicking should be very rare and used only with a good
158+ reason. In almost all cases, a fallible approach should be used, typically
159+ returning a ``Result``.
160+
161+ - If providing examples of usage would help readers, they must be written in
162+ a section called ``# Examples``.
163+
164+ - Rust items (functions, types, constants...) must be linked appropriately
165+ (``rustdoc`` will create a link automatically).
166+
167+ - Any ``unsafe`` block must be preceded by a ``// SAFETY:`` comment
168+ describing why the code inside is sound.
169+
170+ While sometimes the reason might look trivial and therefore unneeded,
171+ writing these comments is not just a good way of documenting what has been
172+ taken into account, but most importantly, it provides a way to know that
173+ there are no *extra* implicit constraints.
174+
175+To learn more about how to write documentation for Rust and extra features,
176+please take a look at the ``rustdoc`` book at:
177+
178+ https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html
179+
180+
181+Naming
182+------
183+
184+Rust kernel code follows the usual Rust naming conventions:
185+
186+ https://rust-lang.github.io/api-guidelines/naming.html
187+
188+When existing C concepts (e.g. macros, functions, objects...) are wrapped into
189+a Rust abstraction, a name as close as reasonably possible to the C side should
190+be used in order to avoid confusion and to improve readability when switching
191+back and forth between the C and Rust sides. For instance, macros such as
192+``pr_info`` from C are named the same in the Rust side.
193+
194+Having said that, casing should be adjusted to follow the Rust naming
195+conventions, and namespacing introduced by modules and types should not be
196+repeated in the item names. For instance, when wrapping constants like:
197+
198+.. code-block:: c
199+
200+ #define GPIO_LINE_DIRECTION_IN 0
201+ #define GPIO_LINE_DIRECTION_OUT 1
202+
203+The equivalent in Rust may look like (ignoring documentation):
204+
205+.. code-block:: rust
206+
207+ pub mod gpio {
208+ pub enum LineDirection {
209+ In = bindings::GPIO_LINE_DIRECTION_IN as _,
210+ Out = bindings::GPIO_LINE_DIRECTION_OUT as _,
211+ }
212+ }
213+
214+That is, the equivalent of ``GPIO_LINE_DIRECTION_IN`` would be referred to as
215+``gpio::LineDirection::In``. In particular, it should not be named
216+``gpio::gpio_line_direction::GPIO_LINE_DIRECTION_IN``.
Documentation/rust/general-information.rst+79−0
@@ -0,0 +1,79 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+General Information
4+===================
5+
6+This document contains useful information to know when working with
7+the Rust support in the kernel.
8+
9+
10+Code documentation
11+------------------
12+
13+Rust kernel code is documented using ``rustdoc``, its built-in documentation
14+generator.
15+
16+The generated HTML docs include integrated search, linked items (e.g. types,
17+functions, constants), source code, etc. They may be read at (TODO: link when
18+in mainline and generated alongside the rest of the documentation):
19+
20+ http://kernel.org/
21+
22+The docs can also be easily generated and read locally. This is quite fast
23+(same order as compiling the code itself) and no special tools or environment
24+are needed. This has the added advantage that they will be tailored to
25+the particular kernel configuration used. To generate them, use the ``rustdoc``
26+target with the same invocation used for compilation, e.g.::
27+
28+ make LLVM=1 rustdoc
29+
30+To read the docs locally in your web browser, run e.g.::
31+
32+ xdg-open rust/doc/kernel/index.html
33+
34+To learn about how to write the documentation, please see coding-guidelines.rst.
35+
36+
37+Extra lints
38+-----------
39+
40+While ``rustc`` is a very helpful compiler, some extra lints and analyses are
41+available via ``clippy``, a Rust linter. To enable it, pass ``CLIPPY=1`` to
42+the same invocation used for compilation, e.g.::
43+
44+ make LLVM=1 CLIPPY=1
45+
46+Please note that Clippy may change code generation, thus it should not be
47+enabled while building a production kernel.
48+
49+
50+Abstractions vs. bindings
51+-------------------------
52+
53+Abstractions are Rust code wrapping kernel functionality from the C side.
54+
55+In order to use functions and types from the C side, bindings are created.
56+Bindings are the declarations for Rust of those functions and types from
57+the C side.
58+
59+For instance, one may write a ``Mutex`` abstraction in Rust which wraps
60+a ``struct mutex`` from the C side and calls its functions through the bindings.
61+
62+Abstractions are not available for all the kernel internal APIs and concepts,
63+but it is intended that coverage is expanded as time goes on. "Leaf" modules
64+(e.g. drivers) should not use the C bindings directly. Instead, subsystems
65+should provide as-safe-as-possible abstractions as needed.
66+
67+
68+Conditional compilation
69+-----------------------
70+
71+Rust code has access to conditional compilation based on the kernel
72+configuration:
73+
74+.. code-block:: rust
75+
76+ #[cfg(CONFIG_X)] // Enabled (`y` or `m`)
77+ #[cfg(CONFIG_X="y")] // Enabled as a built-in (`y`)
78+ #[cfg(CONFIG_X="m")] // Enabled as a module (`m`)
79+ #[cfg(not(CONFIG_X))] // Disabled
Documentation/rust/index.rst+22−0
@@ -0,0 +1,22 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+Rust
4+====
5+
6+Documentation related to Rust within the kernel. To start using Rust
7+in the kernel, please read the quick-start.rst guide.
8+
9+.. toctree::
10+ :maxdepth: 1
11+
12+ quick-start
13+ general-information
14+ coding-guidelines
15+ arch-support
16+
17+.. only:: subproject and html
18+
19+ Indices
20+ =======
21+
22+ * :ref:`genindex`
Documentation/rust/quick-start.rst+232−0
@@ -0,0 +1,232 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+Quick Start
4+===========
5+
6+This document describes how to get started with kernel development in Rust.
7+
8+
9+Requirements: Building
10+----------------------
11+
12+This section explains how to fetch the tools needed for building.
13+
14+Some of these requirements might be available from Linux distributions
15+under names like ``rustc``, ``rust-src``, ``rust-bindgen``, etc. However,
16+at the time of writing, they are likely not to be recent enough unless
17+the distribution tracks the latest releases.
18+
19+To easily check whether the requirements are met, the following target
20+can be used::
21+
22+ make LLVM=1 rustavailable
23+
24+This triggers the same logic used by Kconfig to determine whether
25+``RUST_IS_AVAILABLE`` should be enabled; but it also explains why not
26+if that is the case.
27+
28+
29+rustc
30+*****
31+
32+A particular version of the Rust compiler is required. Newer versions may or
33+may not work because, for the moment, the kernel depends on some unstable
34+Rust features.
35+
36+If ``rustup`` is being used, enter the checked out source code directory
37+and run::
38+
39+ rustup override set $(scripts/min-tool-version.sh rustc)
40+
41+Otherwise, fetch a standalone installer or install ``rustup`` from:
42+
43+ https://www.rust-lang.org
44+
45+
46+Rust standard library source
47+****************************
48+
49+The Rust standard library source is required because the build system will
50+cross-compile ``core`` and ``alloc``.
51+
52+If ``rustup`` is being used, run::
53+
54+ rustup component add rust-src
55+
56+The components are installed per toolchain, thus upgrading the Rust compiler
57+version later on requires re-adding the component.
58+
59+Otherwise, if a standalone installer is used, the Rust repository may be cloned
60+into the installation folder of the toolchain::
61+
62+ git clone --recurse-submodules \
63+ --branch $(scripts/min-tool-version.sh rustc) \
64+ https://github.com/rust-lang/rust \
65+ $(rustc --print sysroot)/lib/rustlib/src/rust
66+
67+In this case, upgrading the Rust compiler version later on requires manually
68+updating this clone.
69+
70+
71+libclang
72+********
73+
74+``libclang`` (part of LLVM) is used by ``bindgen`` to understand the C code
75+in the kernel, which means LLVM needs to be installed; like when the kernel
76+is compiled with ``CC=clang`` or ``LLVM=1``.
77+
78+Linux distributions are likely to have a suitable one available, so it is
79+best to check that first.
80+
81+There are also some binaries for several systems and architectures uploaded at:
82+
83+ https://releases.llvm.org/download.html
84+
85+Otherwise, building LLVM takes quite a while, but it is not a complex process:
86+
87+ https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm
88+
89+Please see Documentation/kbuild/llvm.rst for more information and further ways
90+to fetch pre-built releases and distribution packages.
91+
92+
93+bindgen
94+*******
95+
96+The bindings to the C side of the kernel are generated at build time using
97+the ``bindgen`` tool. A particular version is required.
98+
99+Install it via (note that this will download and build the tool from source)::
100+
101+ cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen
102+
103+
104+Requirements: Developing
105+------------------------
106+
107+This section explains how to fetch the tools needed for developing. That is,
108+they are not needed when just building the kernel.
109+
110+
111+rustfmt
112+*******
113+
114+The ``rustfmt`` tool is used to automatically format all the Rust kernel code,
115+including the generated C bindings (for details, please see
116+coding-guidelines.rst).
117+
118+If ``rustup`` is being used, its ``default`` profile already installs the tool,
119+thus nothing needs to be done. If another profile is being used, the component
120+can be installed manually::
121+
122+ rustup component add rustfmt
123+
124+The standalone installers also come with ``rustfmt``.
125+
126+
127+clippy
128+******
129+
130+``clippy`` is a Rust linter. Running it provides extra warnings for Rust code.
131+It can be run by passing ``CLIPPY=1`` to ``make`` (for details, please see
132+general-information.rst).
133+
134+If ``rustup`` is being used, its ``default`` profile already installs the tool,
135+thus nothing needs to be done. If another profile is being used, the component
136+can be installed manually::
137+
138+ rustup component add clippy
139+
140+The standalone installers also come with ``clippy``.
141+
142+
143+cargo
144+*****
145+
146+``cargo`` is the Rust native build system. It is currently required to run
147+the tests since it is used to build a custom standard library that contains
148+the facilities provided by the custom ``alloc`` in the kernel. The tests can
149+be run using the ``rusttest`` Make target.
150+
151+If ``rustup`` is being used, all the profiles already install the tool,
152+thus nothing needs to be done.
153+
154+The standalone installers also come with ``cargo``.
155+
156+
157+rustdoc
158+*******
159+
160+``rustdoc`` is the documentation tool for Rust. It generates pretty HTML
161+documentation for Rust code (for details, please see
162+general-information.rst).
163+
164+``rustdoc`` is also used to test the examples provided in documented Rust code
165+(called doctests or documentation tests). The ``rusttest`` Make target uses
166+this feature.
167+
168+If ``rustup`` is being used, all the profiles already install the tool,
169+thus nothing needs to be done.
170+
171+The standalone installers also come with ``rustdoc``.
172+
173+
174+rust-analyzer
175+*************
176+
177+The `rust-analyzer <https://rust-analyzer.github.io/>`_ language server can
178+be used with many editors to enable syntax highlighting, completion, go to
179+definition, and other features.
180+
181+``rust-analyzer`` needs a configuration file, ``rust-project.json``, which
182+can be generated by the ``rust-analyzer`` Make target.
183+
184+
185+Configuration
186+-------------
187+
188+``Rust support`` (``CONFIG_RUST``) needs to be enabled in the ``General setup``
189+menu. The option is only shown if a suitable Rust toolchain is found (see
190+above), as long as the other requirements are met. In turn, this will make
191+visible the rest of options that depend on Rust.
192+
193+Afterwards, go to::
194+
195+ Kernel hacking
196+ -> Sample kernel code
197+ -> Rust samples
198+
199+And enable some sample modules either as built-in or as loadable.
200+
201+
202+Building
203+--------
204+
205+Building a kernel with a complete LLVM toolchain is the best supported setup
206+at the moment. That is::
207+
208+ make LLVM=1
209+
210+For architectures that do not support a full LLVM toolchain, use::
211+
212+ make CC=clang
213+
214+Using GCC also works for some configurations, but it is very experimental at
215+the moment.
216+
217+
218+Hacking
219+-------
220+
221+To dive deeper, take a look at the source code of the samples
222+at ``samples/rust/``, the Rust support code under ``rust/`` and
223+the ``Rust hacking`` menu under ``Kernel hacking``.
224+
225+If GDB/Binutils is used and Rust symbols are not getting demangled, the reason
226+is the toolchain does not support Rust's new v0 mangling scheme yet.
227+There are a few ways out:
228+
229+ - Install a newer release (GDB >= 10.2, Binutils >= 2.36).
230+
231+ - Some versions of GDB (e.g. vanilla GDB 10.1) are able to use
232+ the pre-demangled names embedded in the debug info (``CONFIG_DEBUG_INFO``).
Documentation/scheduler/sched-design-CFS.rst+1−1
@@ -94,7 +94,7 @@ other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the · 93 unmodified lines
9494 way the previous scheduler had, and has no heuristics whatsoever. There is
9595 only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):
9696
97− /proc/sys/kernel/sched_min_granularity_ns
97+ /sys/kernel/debug/sched/min_granularity_ns
9898
9999 which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
100100 "server" (i.e., good batching) workloads. It defaults to a setting suitable
Documentation/security/landlock.rst+4−4
@@ -7,7 +7,7 @@ Landlock LSM: kernel documentation · 6 unmodified lines
77 ==================================
88
99 :Author: Mickaël Salaün
10−:Date: May 2022
10+:Date: September 2022
1111
1212 Landlock's goal is to create scoped access-control (i.e. sandboxing). To
1313 harden a whole system, this feature should be available to any process,
@@ -49,13 +49,13 @@ Filesystem access rights · 35 unmodified lines
4949 ------------------------
5050
5151 All access rights are tied to an inode and what can be accessed through it.
52−Reading the content of a directory doesn't imply to be allowed to read the
52+Reading the content of a directory does not imply to be allowed to read the
5353 content of a listed inode. Indeed, a file name is local to its parent
5454 directory, and an inode can be referenced by multiple file names thanks to
5555 (hard) links. Being able to unlink a file only has a direct impact on the
5656 directory, not the unlinked inode. This is the reason why
57−`LANDLOCK_ACCESS_FS_REMOVE_FILE` or `LANDLOCK_ACCESS_FS_REFER` are not allowed
58−to be tied to files but only to directories.
57+``LANDLOCK_ACCESS_FS_REMOVE_FILE`` or ``LANDLOCK_ACCESS_FS_REFER`` are not
58+allowed to be tied to files but only to directories.
5959
6060 Tests
6161 =====
Documentation/staging/index.rst+0−42
@@ -14,45 +14,3 @@ Unsorted Documentation · 13 unmodified lines
1414 static-keys
1515 tee
1616 xz
17−
18−Atomic Types
19−============
20−
21−.. raw:: latex
22−
23− \footnotesize
24−
25−.. include:: ../atomic_t.txt
26− :literal:
27−
28−.. raw:: latex
29−
30− \normalsize
31−
32−Atomic bitops
33−=============
34−
35−.. raw:: latex
36−
37− \footnotesize
38−
39−.. include:: ../atomic_bitops.txt
40− :literal:
41−
42−.. raw:: latex
43−
44− \normalsize
45−
46−Memory Barriers
47−===============
48−
49−.. raw:: latex
50−
51− \footnotesize
52−
53−.. include:: ../memory-barriers.txt
54− :literal:
55−
56−.. raw:: latex
57−
58− \normalsize
Documentation/subsystem-apis.rst+58−0
@@ -0,0 +1,58 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==============================
4+Kernel subsystem documentation
5+==============================
6+
7+These books get into the details of how specific kernel subsystems work
8+from the point of view of a kernel developer. Much of the information here
9+is taken directly from the kernel source, with supplemental material added
10+as needed (or at least as we managed to add it — probably *not* all that is
11+needed).
12+
13+**Fixme**: much more organizational work is needed here.
14+
15+.. toctree::
16+ :maxdepth: 1
17+
18+ driver-api/index
19+ core-api/index
20+ locking/index
21+ accounting/index
22+ block/index
23+ cdrom/index
24+ cpu-freq/index
25+ fb/index
26+ fpga/index
27+ hid/index
28+ i2c/index
29+ iio/index
30+ isdn/index
31+ infiniband/index
32+ leds/index
33+ netlabel/index
34+ networking/index
35+ pcmcia/index
36+ power/index
37+ target/index
38+ timers/index
39+ spi/index
40+ w1/index
41+ watchdog/index
42+ virt/index
43+ input/index
44+ hwmon/index
45+ gpu/index
46+ security/index
47+ sound/index
48+ crypto/index
49+ filesystems/index
50+ mm/index
51+ bpf/index
52+ usb/index
53+ PCI/index
54+ scsi/index
55+ misc-devices/index
56+ scheduler/index
57+ mhi/index
58+ peci/index
Documentation/trace/histogram.rst+1−1
@@ -412,7 +412,7 @@ Extended error information · 411 unmodified lines
412412 Because the default sort key above is 'hitcount', the above shows a
413413 the list of call_sites by increasing hitcount, so that at the bottom
414414 we see the functions that made the most kmalloc calls during the
415− run. If instead we we wanted to see the top kmalloc callers in
415+ run. If instead we wanted to see the top kmalloc callers in
416416 terms of the number of bytes requested rather than the number of
417417 calls, and we wanted the top caller to appear at the top, we can use
418418 the 'sort' parameter, along with the 'descending' modifier::
Documentation/trace/kprobes.rst+2−2
@@ -328,8 +328,8 @@ Configuring Kprobes · 327 unmodified lines
328328 ===================
329329
330330 When configuring the kernel using make menuconfig/xconfig/oldconfig,
331−ensure that CONFIG_KPROBES is set to "y". Under "General setup", look
332−for "Kprobes".
331+ensure that CONFIG_KPROBES is set to "y", look for "Kprobes" under
332+"General architecture-dependent options".
333333
334334 So that you can load and unload Kprobes-based instrumentation modules,
335335 make sure "Loadable module support" (CONFIG_MODULES) and "Module
Documentation/trace/timerlat-tracer.rst+1−1
@@ -20,7 +20,7 @@ For example:: · 19 unmodified lines
2020 [root@f32 ~]# cd /sys/kernel/tracing/
2121 [root@f32 tracing]# echo timerlat > current_tracer
2222
23−It is possible to follow the trace by reading the trace trace file::
23+It is possible to follow the trace by reading the trace file::
2424
2525 [root@f32 tracing]# cat trace
2626 # tracer: timerlat
Documentation/translations/zh_CN/IRQ.txt+0−39
@@ -1,39 +0,0 @@
1−Chinese translated version of Documentation/core-api/irq/index.rst
2−
3−If you have any comment or update to the content, please contact the
4−original document maintainer directly. However, if you have a problem
5−communicating in English you can also ask the Chinese maintainer for
6−help. Contact the Chinese maintainer if this translation is outdated
7−or if there is a problem with the translation.
8−
9−Maintainer: Eric W. Biederman <ebiederman@xmission.com>
10−Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11−---------------------------------------------------------------------
12−Documentation/core-api/irq/index.rst 的中文翻译
13−
14−如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
15−交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
16−译存在问题,请联系中文版维护者。
17−英文版维护者: Eric W. Biederman <ebiederman@xmission.com>
18−中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
19−中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
20−中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21−
22−
23−以下为正文
24−---------------------------------------------------------------------
25−何为 IRQ?
26−
27−一个 IRQ 是来自某个设备的一个中断请求。目前,它们可以来自一个硬件引脚,
28−或来自一个数据包。多个设备可能连接到同个硬件引脚,从而共享一个 IRQ。
29−
30−一个 IRQ 编号是用于告知硬件中断源的内核标识。通常情况下,这是一个
31−全局 irq_desc 数组的索引,但是除了在 linux/interrupt.h 中的实现,
32−具体的细节是体系结构特定的。
33−
34−一个 IRQ 编号是设备上某个可能的中断源的枚举。通常情况下,枚举的编号是
35−该引脚在系统内中断控制器的所有输入引脚中的编号。对于 ISA 总线中的情况,
36−枚举的是在两个 i8259 中断控制器中 16 个输入引脚。
37−
38−架构可以对 IRQ 编号指定额外的含义,在硬件涉及任何手工配置的情况下,
39−是被提倡的。ISA 的 IRQ 是一个分配这类额外含义的典型例子。
Documentation/translations/zh_CN/PCI/acpi-info.rst+139−0
@@ -0,0 +1,139 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+.. include:: ../disclaimer-zh_CN.rst
3+
4+:Original: Documentation/PCI/acpi-info.rst
5+
6+:翻译:
7+
8+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
9+
10+:校译:
11+
12+
13+=====================
14+PCI主桥的ACPI注意事项
15+=====================
16+
17+一般的规则是,ACPI命名空间应该描述操作系统可能使用的所有东西,除非有其他方法让操作系
18+统找到它[1, 2]。
19+
20+例如,没有标准的硬件机制来枚举PCI主桥,所以ACPI命名空间必须描述每个主桥、访问它
21+下面的PCI配置空间的方法、主桥转发到PCI的地址空间窗口(使用_CRS)以及传统的INTx
22+中断的路由(使用_PRT)。
23+
24+在主桥下面的PCI设备,通常不需要通过ACPI描述。操作系统可以通过标准的PCI枚举机制来
25+发现它们,使用配置访问来发现和识别设备,并读取和测量它们的BAR。然而,如果ACPI为它们
26+提供电源管理或热插拔功能,或者如果设备有由平台中断控制器连接的INTx中断,需要一个_PRT
27+来描述这些连接,这种情况下ACPI可以描述PCI设备。
28+
29+ACPI资源描述是通过ACPI命名空间中设备的_CRS对象完成的[2]。_CRS就像一个通用的PCI BAR:
30+操作系统可以读取_CRS并找出正在消耗的资源,即使它没有该设备的驱动程序[3]。这一点很重要,
31+因为它意味着一个旧的操作系统可以正确地工作,即使是在操作系统不知道的新设备的系统上。新设
32+备可能什么都不做,但操作系统至少可以确保没有资源与它们冲突。
33+
34+像MCFG、HPET、ECDT等静态表,不是保留地址空间的机制。静态表是在操作系统在启动初期且在它
35+能够解析ACPI命名空间之前需要知道的东西。如果定义了一个新的表,即使旧的操作系统忽略了这
36+个表,它也需要正常运行。_CRS允许这样做,因为它是通用的,可以被旧的操作系统解析;而静态表
37+则不允许。
38+
39+如果操作系统要管理一个通过ACPI描述的不可发现的设备,该设备将有一个特定的_HID/_CID,以
40+告诉操作系统与之绑定的驱动程序,并且_CRS告诉操作系统和驱动程序该设备的寄存器在哪里。
41+
42+PCI主桥是PNP0A03或PNP0A08设备。它们的_CRS应该描述它们所消耗的所有地址空间。这包括它
43+们转发到PCI总线上的所有窗口,以及不转发到PCI的主桥本身的寄存器。主桥的寄存器包括次要/下
44+级总线寄存器,决定了桥下面的总线范围,窗口寄存器描述了桥洞,等等。这些都是设备相关的,非
45+架构相关的东西,所以PNP0A03/PNP0A08驱动可以管理它们的唯一方法是通过_PRS/_CRS/_SRS,
46+它包含了特定于设备的细节。主桥寄存器也包括ECAM空间,因为它是由主桥消耗的。
47+
48+ACPI定义了一个Consumer/Producer位来区分桥寄存器(“Consumer”下文译作消费者)和
49+桥洞(“Producer”下文译作生产者)[4, 5],但是早期的BIOS没有正确使用这个位。其结果
50+是,目前的ACPI规范只为扩展地址空间描述符定义了消费者/生产者;在旧的QWord/Word/Word地
51+址空间描述符中,该位应该被忽略。因此,操作系统必须假定所有的QWord/Word/Word描述符都是
52+窗口。
53+
54+在增加扩展地址空间描述符之前,消费者/生产者的失败意味着没有办法描述PNP0A03/PNP0A08设
55+备本身的桥寄存器。解决办法是在PNP0C02捕捉器中描述桥寄存器(包括ECAM空间)[6]。
56+除了ECAM之外,桥寄存器空间反正是特定于设备的,所以通用的PNP0A03/PNP0A08驱动程
57+序(pci_root.c)没有必要了解它。
58+
59+新的架构应该能够在PNP0A03设备中使用“消费者”扩展地址空间描述符,用于桥寄存器,包括
60+ECAM,尽管对[6]的严格解释可能禁止这样做。旧的x86和ia64内核假定所有的地址空间描述
61+符,包括“消费者”扩展地址空间的描述符,都是窗口,所以在这些架构上以这种方式描述桥寄
62+存器是不安全的。
63+
64+PNP0C02“主板”设备基本上是万能的。除了“不要将这些资源用于其他用途”之外,没有其他的编
65+程模型。因此,PNP0C02 _CRS应该声明ACPI命名空间中(1)没有被_CRS声明的任何其他设备对
66+象的地址空间,(2)不应该被OS分配给其他东西。
67+
68+除非有一个标准的固件接口用于配置访问,例如ia64 SAL接口[7],否则PCIe规范要求使用增强
69+型配置访问方法(ECAM)。主桥消耗ECAM内存地址空间并将内存访问转换为PCI配置访问。该规范
70+定义了ECAM地址空间的布局和功能;只有地址空间的基础是特定于设备的。ACPI操作系统从静态
71+MCFG表或PNP0A03设备中的_CBA方法中了解基础地址。
72+
73+MCFG表必须描述非热插拔主桥的ECAM空间[8]。由于MCFG是一个静态表,不能通过热插拔更新,
74+PNP0A03设备中的_CBA方法描述了可热插拔主桥的ECAM空间[9]。请注意,对于MCFG和_CBA,
75+基址总是对应于总线0,即使桥器下面的总线范围(通过_CRS报告)不从0开始。
76+
77+
78+[1] ACPI 6.2, sec 6.1:
79+ 对于任何在非枚举类型的总线上的设备(例如,ISA总线),OSPM会枚举设备的标识符,ACPI
80+ 系统固件必须为每个设备提供一个_HID对象...以使OSPM能够做到这一点。
81+
82+[2] ACPI 6.2, sec 3.7:
83+ 操作系统枚举主板设备时,只需通过读取ACPI命名空间来寻找具有硬件ID的设备。
84+
85+ ACPI枚举的每个设备都包括ACPI命名空间中ACPI定义的对象,该对象报告设备可能占用的硬
86+ 件资源[_PRS],报告设备当前使用的资源[_CRS]的对象,以及配置这些资源的对象[_SRS]。
87+ 这些信息被即插即用操作系统(OSPM)用来配置设备。
88+
89+[3] ACPI 6.2, sec 6.2:
90+ OSPM使用设备配置对象来配置通过ACPI列举的设备的硬件资源。设备配置对象提供了关于当前
91+ 和可能的资源需求的信息,共享资源之间的关系,以及配置硬件资源的方法。
92+
93+ 当OSPM枚举一个设备时,它调用_PRS来确定该设备的资源需求。它也可以调用_CRS来找到该设
94+ 备的当前资源设置。利用这些信息,即插即用系统决定设备应该消耗什么资源,并通过调用设备
95+ 的_SRS控制方法来设置这些资源。
96+
97+ 在ACPI中,设备可以消耗资源(例如,传统的键盘),提供资源(例如,一个专有的PCI桥),
98+ 或者两者都做。除非另有规定,设备的资源被假定为来自设备层次结构中设备上方最近的匹配资
99+ 源。
100+
101+[4] ACPI 6.2, sec 6.4.3.5.1, 2, 3, 4:
102+ QWord/DWord/Word 地址空间描述符 (.1, .2, .3)
103+ 常规标志: Bit [0] 被忽略。
104+
105+ 扩展地址空间描述符 (.4)
106+ 常规标志: Bit [0] 消费者/生产者:
107+
108+ * 1 – 这个设备消费这个资源
109+ * 0 – 该设备生产和消费该资源
110+
111+[5] ACPI 6.2, sec 19.6.43:
112+ ResourceUsage指定内存范围是由这个设备(ResourceConsumer)消费还是传递给子设备
113+ (ResourceProducer)。如果没有指定,那么就假定是ResourceConsumer。
114+
115+[6] PCI Firmware 3.2, sec 4.1.2:
116+ 如果操作系统不能原生的懂得保留MMCFG区域,MMCFG区域必须由固件保留。在MCFG表中或通
117+ 过_CBA方法(见第4.1.3节)报告的地址范围必须通过声明主板资源来保留。对于大多数系统,
118+ 主板资源将出现在ACPI命名空间的根部(在_SB下),在一个节点的_HID为EISAID(PNP0C0
119+ 2),在这种情况下的资源不应该要求在根PCI总线的_CRS。这些资源可以选择在Int15 E820
120+ 或EFIGetMemoryMap中作为保留内存返回,但必须始终通过ACPI作为主板资源报告。
121+
122+[7] PCI Express 4.0, sec 7.2.2:
123+ 对于PC兼容的系统,或者没有实现允许访问配置空间的处理器架构特定固件接口标准的系统,需
124+ 要使用本节中定义的ECAM。
125+
126+[8] PCI Firmware 3.2, sec 4.1.2:
127+ MCFG表是一个ACPI表,用于沟通的基础地址对应的非热的可移动的PCI段组范围内的PCI段组在
128+ 启动时提供给操作系统。这对PC兼容系统来说是必需的。
129+
130+ MCFG表仅用于沟通在启动时系统可用的PCI段组对应的基址。
131+
132+[9] PCI Firmware 3.2, sec 4.1.3:
133+ _CBA (Memory mapped Configuration Base Address) 控制方法是一个可选的ACPI对
134+ 象,用于返回热插拔主桥的64位内存映射的配置基址。_CBA 返回的基址是与处理器相关的地址。
135+ _CBA 控制方法被评估为一个整数。
136+
137+ 这个控制方法出现在主桥对象下。当_CBA方法出现在一个活动的主桥对象下时,操作系统会评
138+ 估这个结构,以确定内存映射的配置基址,对应于_CRS方法中指定的总线编号范围的PCI段组。
139+ 一个包含_CBA方法的ACPI命名空间对象也必须包含一个相应的_SEG方法。
Documentation/translations/zh_CN/PCI/index.rst+5−8
@@ -10,9 +10,6 @@ · 9 unmodified lines
1010 :校译:
1111
1212
13−
14−.. _cn_PCI_index.rst:
15−
1613 ===================
1714 Linux PCI总线子系统
1815 ===================
@@ -26,12 +23,12 @@ Linux PCI总线子系统 · 7 unmodified lines
2623 pci-iov-howto
2724 msi-howto
2825 sysfs-pci
26+ acpi-info
2927
3028
3129 Todolist:
3230
33− acpi-info
34− pci-error-recovery
35− pcieaer-howto
36− endpoint/index
37− boot-interrupts
31+* pci-error-recovery
32+* pcieaer-howto
33+* endpoint/index
34+* boot-interrupts
Documentation/translations/zh_CN/admin-guide/README.rst+22−79
@@ -6,10 +6,10 @@ · 5 unmodified lines
66
77 吴想成 Wu XiangCheng <bobwxc@email.cn>
88
9−Linux内核5.x版本 <http://kernel.org/>
9+Linux内核6.x版本 <http://kernel.org/>
1010 =========================================
1111
12−以下是Linux版本5的发行注记。仔细阅读它们,
12+以下是Linux版本6的发行注记。仔细阅读它们,
1313 它们会告诉你这些都是什么,解释如何安装内核,以及遇到问题时该如何做。
1414
1515 什么是Linux?
@@ -61,27 +61,27 @@ Linux内核5.x版本 <http://kernel.org/> · 45 unmodified lines
6161 - 如果您要安装完整的源代码,请把内核tar档案包放在您有权限的目录中(例如您
6262 的主目录)并将其解包::
6363
64− xz -cd linux-5.x.tar.xz | tar xvf -
64+ xz -cd linux-6.x.tar.xz | tar xvf -
6565
6666 将“X”替换成最新内核的版本号。
6767
6868 【不要】使用 /usr/src/linux 目录!这里有一组库头文件使用的内核头文件
6969 (通常是不完整的)。它们应该与库匹配,而不是被内核的变化搞得一团糟。
7070
71− - 您还可以通过打补丁在5.x版本之间升级。补丁以xz格式分发。要通过打补丁进行
72− 安装,请获取所有较新的补丁文件,进入内核源代码(linux-5.x)的目录并
71+ - 您还可以通过打补丁在6.x版本之间升级。补丁以xz格式分发。要通过打补丁进行
72+ 安装,请获取所有较新的补丁文件,进入内核源代码(linux-6.x)的目录并
7373 执行::
7474
75− xz -cd ../patch-5.x.xz | patch -p1
75+ xz -cd ../patch-6.x.xz | patch -p1
7676
7777 请【按顺序】替换所有大于当前源代码树版本的“x”,这样就可以了。您可能想要
7878 删除备份文件(文件名类似xxx~ 或 xxx.orig),并确保没有失败的补丁(文件名
7979 类似xxx# 或 xxx.rej)。如果有,不是你就是我犯了错误。
8080
81− 与5.x内核的补丁不同,5.x.y内核(也称为稳定版内核)的补丁不是增量的,而是
82− 直接应用于基本的5.x内核。例如,如果您的基本内核是5.0,并且希望应用5.0.3
83− 补丁,则不应先应用5.0.1和5.0.2的补丁。类似地,如果您运行的是5.0.2内核,
84− 并且希望跳转到5.0.3,那么在应用5.0.3补丁之前,必须首先撤销5.0.2补丁
81+ 与6.x内核的补丁不同,6.x.y内核(也称为稳定版内核)的补丁不是增量的,而是
82+ 直接应用于基本的6.x内核。例如,如果您的基本内核是6.0,并且希望应用6.0.3
83+ 补丁,则不应先应用6.0.1和6.0.2的补丁。类似地,如果您运行的是6.0.2内核,
84+ 并且希望跳转到6.0.3,那么在应用6.0.3补丁之前,必须首先撤销6.0.2补丁
8585 (即patch -R)。更多关于这方面的内容,请阅读
8686 :ref:`Documentation/process/applying-patches.rst <applying_patches>` 。
8787
@@ -103,7 +103,7 @@ Linux内核5.x版本 <http://kernel.org/> · 15 unmodified lines
103103 软件要求
104104 ---------
105105
106− 编译和运行5.x内核需要各种软件包的最新版本。请参考
106+ 编译和运行6.x内核需要各种软件包的最新版本。请参考
107107 :ref:`Documentation/process/changes.rst <changes>`
108108 来了解最低版本要求以及如何升级软件包。请注意,使用过旧版本的这些包可能会
109109 导致很难追踪的间接错误,因此不要以为在生成或操作过程中出现明显问题时可以
@@ -116,12 +116,12 @@ Linux内核5.x版本 <http://kernel.org/> · 6 unmodified lines
116116 ``make O=output/dir`` 选项可以为输出文件(包括 .config)指定备用位置。
117117 例如::
118118
119− kernel source code: /usr/src/linux-5.x
119+ kernel source code: /usr/src/linux-6.x
120120 build directory: /home/name/build/kernel
121121
122122 要配置和构建内核,请使用::
123123
124− cd /usr/src/linux-5.x
124+ cd /usr/src/linux-6.x
125125 make O=/home/name/build/kernel menuconfig
126126 make O=/home/name/build/kernel
127127 sudo make O=/home/name/build/kernel modules_install install
@@ -227,8 +227,6 @@ Linux内核5.x版本 <http://kernel.org/> · 99 unmodified lines
227227 - 确保您至少有gcc 5.1可用。
228228 有关更多信息,请参阅 :ref:`Documentation/process/changes.rst <changes>` 。
229229
230− 请注意,您仍然可以使用此内核运行a.out用户程序。
231−
232230 - 执行 ``make`` 来创建压缩内核映像。如果您安装了lilo以适配内核makefile,
233231 那么也可以进行 ``make install`` ,但是您可能需要先检查特定的lilo设置。
234232
@@ -282,67 +280,12 @@ Linux内核5.x版本 <http://kernel.org/> · 47 unmodified lines
282280 若遇到问题
283281 -----------
284282
285− - 如果您发现了一些可能由于内核缺陷所导致的问题,请检查MAINTAINERS(维护者)
286− 文件看看是否有人与令您遇到麻烦的内核部分相关。如果无人在此列出,那么第二
287− 个最好的方案就是把它们发给我(torvalds@linux-foundation.org),也可能发送
288− 到任何其他相关的邮件列表或新闻组。
289−
290− - 在所有的缺陷报告中,【请】告诉我们您在说什么内核,如何复现问题,以及您的
291− 设置是什么的(使用您的常识)。如果问题是新的,请告诉我;如果问题是旧的,
292− 请尝试告诉我您什么时候首次注意到它。
293−
294− - 如果缺陷导致如下消息::
295−
296− unable to handle kernel paging request at address C0000010
297− Oops: 0002
298− EIP: 0010:XXXXXXXX
299− eax: xxxxxxxx ebx: xxxxxxxx ecx: xxxxxxxx edx: xxxxxxxx
300− esi: xxxxxxxx edi: xxxxxxxx ebp: xxxxxxxx
301− ds: xxxx es: xxxx fs: xxxx gs: xxxx
302− Pid: xx, process nr: xx
303− xx xx xx xx xx xx xx xx xx xx
304−
305− 或者类似的内核调试信息显示在屏幕上或在系统日志里,请【如实】复制它。
306− 可能对你来说转储(dump)看起来不可理解,但它确实包含可能有助于调试问题的
307− 信息。转储上方的文本也很重要:它说明了内核转储代码的原因(在上面的示例中,
308− 是由于内核指针错误)。更多关于如何理解转储的信息,请参见
309− Documentation/admin-guide/bug-hunting.rst。
310−
311− - 如果使用 CONFIG_KALLSYMS 编译内核,则可以按原样发送转储,否则必须使用
312− ``ksymoops`` 程序来理解转储(但通常首选使用CONFIG_KALLSYMS编译)。
313− 此实用程序可从
314− https://www.kernel.org/pub/linux/utils/kernel/ksymoops/ 下载。
315− 或者,您可以手动执行转储查找:
316−
317− - 在调试像上面这样的转储时,如果您可以查找EIP值的含义,这将非常有帮助。
318− 十六进制值本身对我或其他任何人都没有太大帮助:它会取决于特定的内核设置。
319− 您应该做的是从EIP行获取十六进制值(忽略 ``0010:`` ),然后在内核名字列表
320− 中查找它,以查看哪个内核函数包含有问题的地址。
321−
322− 要找到内核函数名,您需要找到与显示症状的内核相关联的系统二进制文件。就是
323− 文件“linux/vmlinux”。要提取名字列表并将其与内核崩溃中的EIP进行匹配,
324− 请执行::
325−
326− nm vmlinux | sort | less
327−
328− 这将为您提供一个按升序排序的内核地址列表,从中很容易找到包含有问题的地址
329− 的函数。请注意,内核调试消息提供的地址不一定与函数地址完全匹配(事实上,
330− 这是不可能的),因此您不能只“grep”列表:不过列表将为您提供每个内核函数
331− 的起点,因此通过查找起始地址低于你正在搜索的地址,但后一个函数的高于的
332− 函数,你会找到您想要的。实际上,在您的问题报告中加入一些“上下文”可能是
333− 一个好主意,给出相关的上下几行。
334−
335− 如果您由于某些原因无法完成上述操作(如您使用预编译的内核映像或类似的映像),
336− 请尽可能多地告诉我您的相关设置信息,这会有所帮助。有关详细信息请阅读
337− ‘Documentation/admin-guide/reporting-issues.rst’。
338−
339− - 或者,您可以在正在运行的内核上使用gdb(只读的;即不能更改值或设置断点)。
340− 为此,请首先使用-g编译内核;适当地编辑arch/x86/Makefile,然后执行 ``make
341− clean`` 。您还需要启用CONFIG_PROC_FS(通过 ``make config`` )。
342−
343− 使用新内核重新启动后,执行 ``gdb vmlinux /proc/kcore`` 。现在可以使用所有
344− 普通的gdb命令。查找系统崩溃点的命令是 ``l *0xXXXXXXXX`` (将xxx替换为EIP
345− 值)。
346−
347− 用gdb无法调试一个当前未运行的内核是由于gdb(错误地)忽略了编译内核的起始
348− 偏移量。
283+如果您发现了一些可能由于内核缺陷所导致的问题,请参阅:
284+Documentation/translations/zh_CN/admin-guide/reporting-issues.rst 。
285+
286+想要理解内核错误报告,请参阅:
287+Documentation/translations/zh_CN/admin-guide/bug-hunting.rst 。
288+
289+更多用GDB调试内核的信息,请参阅:
290+Documentation/translations/zh_CN/dev-tools/gdb-kernel-debugging.rst
291+和 Documentation/dev-tools/kgdb.rst 。
Documentation/translations/zh_CN/admin-guide/bootconfig.rst+293−0
@@ -0,0 +1,293 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/admin-guide/bootconfig.rst
6+
7+:译者: 吴想成 Wu XiangCheng <bobwxc@email.cn>
8+
9+========
10+引导配置
11+========
12+
13+:作者: Masami Hiramatsu <mhiramat@kernel.org>
14+
15+概述
16+====
17+
18+引导配置扩展了现有的内核命令行,以一种更有效率的方式在引导内核时进一步支持
19+键值数据。这允许管理员传递一份结构化关键字的配置文件。
20+
21+配置文件语法
22+============
23+
24+引导配置文件的语法采用非常简单的键值结构。每个关键字由点连接的单词组成,键
25+和值由 ``=`` 连接。值以分号( ``;`` )或换行符( ``\n`` )结尾。数组值中每
26+个元素由逗号( ``,`` )分隔。::
27+
28+ KEY[.WORD[...]] = VALUE[, VALUE2[...]][;]
29+
30+与内核命令行语法不同,逗号和 ``=`` 周围允许有空格。
31+
32+关键字只允许包含字母、数字、连字符( ``-`` )和下划线( ``_`` )。值可包含
33+可打印字符和空格,但分号( ``;`` )、换行符( ``\n`` )、逗号( ``,`` )、
34+井号( ``#`` )和右大括号( ``}`` )等分隔符除外。
35+
36+如果你需要在值中使用这些分隔符,可以用双引号( ``"VALUE"`` )或单引号
37+( ``'VALUE'`` )括起来。注意,引号无法转义。
38+
39+键的值可以为空或不存在。这些键用于检查该键是否存在(类似布尔值)。
40+
41+键值语法
42+--------
43+
44+引导配置文件语法允许用户通过大括号合并键名部分相同的关键字。例如::
45+
46+ foo.bar.baz = value1
47+ foo.bar.qux.quux = value2
48+
49+也可以写成::
50+
51+ foo.bar {
52+ baz = value1
53+ qux.quux = value2
54+ }
55+
56+或者更紧凑一些,写成::
57+
58+ foo.bar { baz = value1; qux.quux = value2 }
59+
60+在这两种样式中,引导解析时相同的关键字都会自动合并。因此可以追加类似的树或
61+键值。
62+
63+相同关键字的值
64+--------------
65+
66+禁止两个或多个值或数组共享同一个关键字。例如::
67+
68+ foo = bar, baz
69+ foo = qux # !错误! 我们不可以重定义相同的关键字
70+
71+如果你想要更新值,必须显式使用覆盖操作符 ``:=`` 。例如::
72+
73+ foo = bar, baz
74+ foo := qux
75+
76+这样 ``foo`` 关键字的值就变成了 ``qux`` 。这对于通过添加(部分)自定义引导
77+配置来覆盖默认值非常有用,免于解析默认引导配置。
78+
79+如果你想对现有关键字追加值作为数组成员,可以使用 ``+=`` 操作符。例如::
80+
81+ foo = bar, baz
82+ foo += qux
83+
84+这样, ``foo`` 关键字就同时拥有了 ``bar`` , ``baz`` 和 ``qux`` 。
85+
86+此外,父关键字下可同时存在值和子关键字。
87+例如,下列配置是可行的。::
88+
89+ foo = value1
90+ foo.bar = value2
91+ foo := value3 # 这会更新foo的值。
92+
93+注意,裸值不能直接放进结构化关键字中,必须在大括号外定义它。例如::
94+
95+ foo {
96+ bar = value1
97+ bar {
98+ baz = value2
99+ qux = value3
100+ }
101+ }
102+
103+同时,关键字下值节点的顺序是固定的。如果值和子关键字同时存在,值永远是该关
104+键字的第一个子节点。因此如果用户先指定子关键字,如::
105+
106+ foo.bar = value1
107+ foo = value2
108+
109+则在程序(和/proc/bootconfig)中,它会按如下显示::
110+
111+ foo = value2
112+ foo.bar = value1
113+
114+注释
115+----
116+
117+配置语法接受shell脚本风格的注释。注释以井号( ``#`` )开始,到换行符
118+( ``\n`` )结束。
119+
120+::
121+
122+ # comment line
123+ foo = value # value is set to foo.
124+ bar = 1, # 1st element
125+ 2, # 2nd element
126+ 3 # 3rd element
127+
128+会被解析为::
129+
130+ foo = value
131+ bar = 1, 2, 3
132+
133+注意你不能把注释放在值和分隔符( ``,`` 或 ``;`` )之间。如下配置语法是错误的::
134+
135+ key = 1 # comment
136+ ,2
137+
138+
139+/proc/bootconfig
140+================
141+
142+/proc/bootconfig是引导配置的用户空间接口。与/proc/cmdline不同,此文件内容以
143+键值列表样式显示。
144+每个键值对一行,样式如下::
145+
146+ KEY[.WORDS...] = "[VALUE]"[,"VALUE2"...]
147+
148+
149+用引导配置引导内核
150+==================
151+
152+用引导配置引导内核有两种方法:将引导配置附加到initrd镜像或直接嵌入内核中。
153+
154+*initrd: initial RAM disk,初始内存磁盘*
155+
156+将引导配置附加到initrd
157+----------------------
158+
159+由于默认情况下引导配置文件是用initrd加载的,因此它将被添加到initrd(initramfs)
160+镜像文件的末尾,其中包含填充、大小、校验值和12字节幻数,如下所示::
161+
162+ [initrd][bootconfig][padding][size(le32)][checksum(le32)][#BOOTCONFIG\n]
163+
164+大小和校验值为小端序存放的32位无符号值。
165+
166+当引导配置被加到initrd镜像时,整个文件大小会对齐到4字节。空字符( ``\0`` )
167+会填补对齐空隙。因此 ``size`` 就是引导配置文件的长度+填充的字节。
168+
169+Linux内核在内存中解码initrd镜像的最后部分以获取引导配置数据。由于这种“背负式”
170+的方法,只要引导加载器传递了正确的initrd文件大小,就无需更改或更新引导加载器
171+和内核镜像本身。如果引导加载器意外传递了更长的大小,内核将无法找到引导配置数
172+据。
173+
174+Linux内核在tools/bootconfig下提供了 ``bootconfig`` 命令来完成此操作,管理员
175+可以用它从initrd镜像中删除或追加配置文件。你可以用以下命令来构建它::
176+
177+ # make -C tools/bootconfig
178+
179+要向initrd镜像添加你的引导配置文件,请按如下命令操作(旧数据会自动移除)::
180+
181+ # tools/bootconfig/bootconfig -a your-config /boot/initrd.img-X.Y.Z
182+
183+要从镜像中移除配置,可以使用-d选项::
184+
185+ # tools/bootconfig/bootconfig -d /boot/initrd.img-X.Y.Z
186+
187+然后在内核命令行上添加 ``bootconfig`` 告诉内核去initrd文件末尾寻找内核配置。
188+
189+将引导配置嵌入内核
190+------------------
191+
192+如果你不能使用initrd,也可以通过Kconfig选项将引导配置文件嵌入内核中。在此情
193+况下,你需要用以下选项重新编译内核::
194+
195+ CONFIG_BOOT_CONFIG_EMBED=y
196+ CONFIG_BOOT_CONFIG_EMBED_FILE="/引导配置/文件/的/路径"
197+
198+``CONFIG_BOOT_CONFIG_EMBED_FILE`` 需要从源码树或对象树开始的引导配置文件的
199+绝对/相对路径。内核会将其嵌入作为默认引导配置。
200+
201+与将引导配置附加到initrd一样,你也需要在内核命令行上添加 ``bootconfig`` 告诉
202+内核去启用内嵌的引导配置。
203+
204+注意,即使你已经设置了此选项,仍可用附加到initrd的其他引导配置覆盖内嵌的引导
205+配置。
206+
207+通过引导配置传递内核参数
208+========================
209+
210+除了内核命令行,引导配置也可以用于传递内核参数。所有 ``kernel`` 关键字下的键
211+值对都将直接传递给内核命令行。此外, ``init`` 下的键值对将通过命令行传递给
212+init进程。参数按以下顺序与用户给定的内核命令行字符串相连,因此命令行参数可以
213+覆盖引导配置参数(这取决于子系统如何处理参数,但通常前面的参数将被后面的参数
214+覆盖)::
215+
216+ [bootconfig params][cmdline params] -- [bootconfig init params][cmdline init params]
217+
218+如果引导配置文件给出的kernel/init参数是::
219+
220+ kernel {
221+ root = 01234567-89ab-cdef-0123-456789abcd
222+ }
223+ init {
224+ splash
225+ }
226+
227+这将被复制到内核命令行字符串中,如下所示::
228+
229+ root="01234567-89ab-cdef-0123-456789abcd" -- splash
230+
231+如果用户给出的其他命令行是::
232+
233+ ro bootconfig -- quiet
234+
235+则最后的内核命令行如下::
236+
237+ root="01234567-89ab-cdef-0123-456789abcd" ro bootconfig -- splash quiet
238+
239+
240+配置文件的限制
241+==============
242+
243+当前最大的配置大小是32KB,关键字总数(不是键值条目)必须少于1024个节点。
244+注意:这不是条目数而是节点数,条目必须消耗超过2个节点(一个关键字和一个值)。
245+所以从理论上讲最多512个键值对。如果关键字平均包含3个单词,则可有256个键值对。
246+在大多数情况下,配置项的数量将少于100个条目,小于8KB,因此这应该足够了。如果
247+节点数超过1024,解析器将返回错误,即使文件大小小于32KB。(请注意,此最大尺寸
248+不包括填充的空字符。)
249+无论如何,因为 ``bootconfig`` 命令在附加启动配置到initrd映像时会验证它,用户
250+可以在引导之前注意到它。
251+
252+
253+引导配置API
254+===========
255+
256+用户可以查询或遍历键值对,也可以查找(前缀)根关键字节点,并在查找该节点下的
257+键值。
258+
259+如果您有一个关键字字符串,则可以直接使用 xbc_find_value() 查询该键的值。如果
260+你想知道引导配置里有哪些关键字,可以使用 xbc_for_each_key_value() 迭代键值对。
261+请注意,您需要使用 xbc_array_for_each_value() 访问数组的值,例如::
262+
263+ vnode = NULL;
264+ xbc_find_value("key.word", &vnode);
265+ if (vnode && xbc_node_is_array(vnode))
266+ xbc_array_for_each_value(vnode, value) {
267+ printk("%s ", value);
268+ }
269+
270+如果您想查找具有前缀字符串的键,可以使用 xbc_find_node() 通过前缀字符串查找
271+节点,然后用 xbc_node_for_each_key_value() 迭代前缀节点下的键。
272+
273+但最典型的用法是获取前缀下的命名值或前缀下的命名数组,例如::
274+
275+ root = xbc_find_node("key.prefix");
276+ value = xbc_node_find_value(root, "option", &vnode);
277+ ...
278+ xbc_node_for_each_array_value(root, "array-option", value, anode) {
279+ ...
280+ }
281+
282+这将访问值“key.prefix.option”的值和“key.prefix.array-option”的数组。
283+
284+锁是不需要的,因为在初始化之后配置只读。如果需要修改,必须复制所有数据和关键字。
285+
286+
287+函数与结构体
288+============
289+
290+相关定义的kernel-doc参见:
291+
292+ - include/linux/bootconfig.h
293+ - lib/bootconfig.c
Documentation/translations/zh_CN/admin-guide/index.rst+1−1
@@ -63,6 +63,7 @@ Todolist: · 62 unmodified lines
6363 .. toctree::
6464 :maxdepth: 1
6565
66+ bootconfig
6667 clearing-warn-once
6768 cpu-load
6869 cputopology
@@ -80,7 +81,6 @@ Todolist: · 11 unmodified lines
8081 * binderfs
8182 * binfmt-misc
8283 * blockdev/index
83−* bootconfig
8484 * braille-console
8585 * btmrvl
8686 * cgroup-v1/index
Documentation/translations/zh_CN/core-api/circular-buffers.rst+210−0
@@ -0,0 +1,210 @@
1+.. SPDX-License-Identifier: GPL-2.0+
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/core-api/circular-buffers.rst
6+
7+:翻译:
8+
9+ 周彬彬 Binbin Zhou <zhoubinbin@loongson.cn>
10+
11+:校译:
12+
13+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
14+ 吴想成 Wu Xiangcheng <bobwxc@email.cn>
15+ 时奎亮 Alex Shi <alexs@kernel.org>
16+
17+==========
18+环形缓冲区
19+==========
20+
21+:作者: David Howells <dhowells@redhat.com>
22+:作者: Paul E. McKenney <paulmck@linux.ibm.com>
23+
24+
25+Linux 提供了许多可用于实现循环缓冲的特性。有两组这样的特性:
26+
27+ (1) 用于确定2次方大小的缓冲区信息的便利函数。
28+
29+ (2) 可以代替缓冲区中对象的生产者和消费者共享锁的内存屏障。
30+
31+如下所述,要使用这些设施,只需要一个生产者和一个消费者。可以通过序列化来处理多个
32+生产者,并通过序列化来处理多个消费者。
33+
34+.. Contents:
35+
36+ (*) 什么是环形缓冲区?
37+
38+ (*) 测量2次幂缓冲区
39+
40+ (*) 内存屏障与环形缓冲区的结合使用
41+ - 生产者
42+ - 消费者
43+
44+ (*) 延伸阅读
45+
46+
47+
48+什么是环形缓冲区?
49+==================
50+
51+首先,什么是环形缓冲区?环形缓冲区是具有固定的有限大小的缓冲区,它有两个索引:
52+
53+ (1) 'head'索引 - 生产者将元素插入缓冲区的位置。
54+
55+ (2) 'tail'索引 - 消费者在缓冲区中找到下一个元素的位置。
56+
57+通常,当tail指针等于head指针时,表明缓冲区是空的;而当head指针比tail指针少一个时,
58+表明缓冲区是满的。
59+
60+添加元素时,递增head索引;删除元素时,递增tail索引。tail索引不应该跳过head索引,
61+两个索引在到达缓冲区末端时都应该被赋值为0,从而允许海量的数据流过缓冲区。
62+
63+通常情况下,元素都有相同的单元大小,但这并不是使用以下技术的严格要求。如果要在缓
64+冲区中包含多个元素或可变大小的元素,则索引可以增加超过1,前提是两个索引都没有超过
65+另一个。然而,实现者必须小心,因为超过一个单位大小的区域可能会覆盖缓冲区的末端并
66+且缓冲区会被分成两段。
67+
68+测量2次幂缓冲区
69+===============
70+
71+计算任意大小的环形缓冲区的占用或剩余容量通常是一个费时的操作,需要使用模(除法)
72+指令。但是如果缓冲区的大小为2次幂,则可以使用更快的按位与指令代替。
73+
74+Linux提供了一组用于处理2次幂环形缓冲区的宏。可以通过以下方式使用::
75+
76+ #include <linux/circ_buf.h>
77+
78+这些宏包括:
79+
80+ (#) 测量缓冲区的剩余容量::
81+
82+ CIRC_SPACE(head_index, tail_index, buffer_size);
83+
84+ 返回缓冲区[1]中可插入元素的剩余空间大小。
85+
86+
87+ (#) 测量缓冲区中的最大连续立即可用空间::
88+
89+ CIRC_SPACE_TO_END(head_index, tail_index, buffer_size);
90+
91+ 返回缓冲区[1]中剩余的连续空间的大小,元素可以立即插入其中,而不必绕回到缓冲
92+ 区的开头。
93+
94+
95+ (#) 测量缓冲区的使用数::
96+
97+ CIRC_CNT(head_index, tail_index, buffer_size);
98+
99+ 返回当前占用缓冲区[2]的元素数量。
100+
101+
102+ (#) 测量缓冲区的连续使用数::
103+
104+ CIRC_CNT_TO_END(head_index, tail_index, buffer_size);
105+
106+ 返回可以从缓冲区中提取的连续元素[2]的数量,而不必绕回到缓冲区的开头。
107+
108+这里的每一个宏名义上都会返回一个介于0和buffer_size-1之间的值,但是:
109+
110+ (1) CIRC_SPACE*()是为了在生产者中使用。对生产者来说,它们将返回一个下限,因为生
111+ 产者控制着head索引,但消费者可能仍然在另一个CPU上耗尽缓冲区并移动tail索引。
112+
113+ 对消费者来说,它将显示一个上限,因为生产者可能正忙于耗尽空间。
114+
115+ (2) CIRC_CNT*()是为了在消费者中使用。对消费者来说,它们将返回一个下限,因为消费
116+ 者控制着tail索引,但生产者可能仍然在另一个CPU上填充缓冲区并移动head索引。
117+
118+ 对于生产者,它将显示一个上限,因为消费者可能正忙于清空缓冲区。
119+
120+ (3) 对于第三方来说,生产者和消费者对索引的写入顺序是无法保证的,因为它们是独立的,
121+ 而且可能是在不同的CPU上进行的,所以在这种情况下的结果只是一种猜测,甚至可能
122+ 是错误的。
123+
124+内存屏障与环形缓冲区的结合使用
125+==============================
126+
127+通过将内存屏障与环形缓冲区结合使用,可以避免以下需求:
128+
129+ (1) 使用单个锁来控制对缓冲区两端的访问,从而允许同时填充和清空缓冲区;以及
130+
131+ (2) 使用原子计数器操作。
132+
133+这有两个方面:填充缓冲区的生产者和清空缓冲区的消费者。在任何时候,只应有一个生产
134+者在填充缓冲区,同样的也只应有一个消费者在清空缓冲区,但双方可以同时操作。
135+
136+
137+生产者
138+------
139+
140+生产者看起来像这样::
141+
142+ spin_lock(&producer_lock);
143+
144+ unsigned long head = buffer->head;
145+ /* spin_unlock()和下一个spin_lock()提供必要的排序。 */
146+ unsigned long tail = READ_ONCE(buffer->tail);
147+
148+ if (CIRC_SPACE(head, tail, buffer->size) >= 1) {
149+ /* 添加一个元素到缓冲区 */
150+ struct item *item = buffer[head];
151+
152+ produce_item(item);
153+
154+ smp_store_release(buffer->head,
155+ (head + 1) & (buffer->size - 1));
156+
157+ /* wake_up()将确保在唤醒任何人之前提交head */
158+ wake_up(consumer);
159+ }
160+
161+ spin_unlock(&producer_lock);
162+
163+这将表明CPU必须在head索引使其对消费者可用之前写入新项目的内容,同时CPU必须在唤醒
164+消费者之前写入修改后的head索引。
165+
166+请注意,wake_up()并不保证任何形式的屏障,除非确实唤醒了某些东西。因此我们不能依靠
167+它来进行排序。但是数组中始终有一个元素留空,因此生产者必须产生两个元素,然后才可
168+能破坏消费者当前正在读取的元素。同时,消费者连续调用之间成对的解锁-加锁提供了索引
169+读取(指示消费者已清空给定元素)和生产者对该相同元素的写入之间的必要顺序。
170+
171+
172+消费者
173+------
174+
175+消费者看起来像这样::
176+
177+ spin_lock(&consumer_lock);
178+
179+ /* 读取该索引处的内容之前,先读取索引 */
180+ unsigned long head = smp_load_acquire(buffer->head);
181+ unsigned long tail = buffer->tail;
182+
183+ if (CIRC_CNT(head, tail, buffer->size) >= 1) {
184+
185+ /* 从缓冲区中提取一个元素 */
186+ struct item *item = buffer[tail];
187+
188+ consume_item(item);
189+
190+ /* 在递增tail之前完成对描述符的读取。 */
191+ smp_store_release(buffer->tail,
192+ (tail + 1) & (buffer->size - 1));
193+ }
194+
195+ spin_unlock(&consumer_lock);
196+
197+这表明CPU在读取新元素之前确保索引是最新的,然后在写入新的尾指针之前应确保CPU已完
198+成读取该元素,这将擦除该元素。
199+
200+请注意,使用READ_ONCE()和smp_load_acquire()来读取反向(head)索引。这可以防止编译
201+器丢弃并重新加载其缓存值。如果您能确定反向(head)索引将仅使用一次,则这不是必须
202+的。smp_load_acquire()还可以强制CPU对后续的内存引用进行排序。类似地,两种算法都使
203+用smp_store_release()来写入线程的索引。这记录了我们正在写入可以并发读取的内容的事
204+实,以防止编译器破坏存储,并强制对以前的访问进行排序。
205+
206+
207+延伸阅读
208+========
209+
210+关于Linux的内存屏障设施的描述,请查看Documentation/memory-barriers.txt。
Documentation/translations/zh_CN/core-api/generic-radix-tree.rst+23−0
@@ -0,0 +1,23 @@
1+.. SPDX-License-Identifier: GPL-2.0+
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/core-api/generic-radix-tree.rst
6+
7+:翻译:
8+
9+ 周彬彬 Binbin Zhou <zhoubinbin@loongson.cn>
10+
11+===================
12+通用基数树/稀疏数组
13+===================
14+
15+通用基数树/稀疏数组的相关内容请见include/linux/generic-radix-tree.h文件中的
16+“DOC: Generic radix trees/sparse arrays”。
17+
18+通用基数树函数
19+--------------
20+
21+该API在以下内核代码中:
22+
23+include/linux/generic-radix-tree.h
Documentation/translations/zh_CN/core-api/idr.rst+80−0
@@ -0,0 +1,80 @@
1+.. SPDX-License-Identifier: GPL-2.0+
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/core-api/idr.rst
6+
7+:翻译:
8+
9+ 周彬彬 Binbin Zhou <zhoubinbin@loongson.cn>
10+
11+:校译:
12+
13+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
14+ 吴想成 Wu Xiangcheng <bobwxc@email.cn>
15+ 时奎亮 Alex Shi <alexs@kernel.org>
16+
17+======
18+ID分配
19+======
20+
21+:作者: Matthew Wilcox
22+
23+概述
24+====
25+
26+要解决的一个常见问题是分配标识符(IDs);它通常是标识事物的数字。比如包括文件描述
27+符、进程ID、网络协议中的数据包标识符、SCSI标记和设备实例编号。IDR和IDA为这个问题
28+提供了一个合理的解决方案,以避免每个人都自创。IDR提供将ID映射到指针的能力,而IDA
29+仅提供ID分配,因此内存效率更高。
30+
31+IDR接口已经被废弃,请使用 ``XArray`` 。
32+
33+IDR的用法
34+=========
35+
36+首先初始化一个IDR,对于静态分配的IDR使用DEFINE_IDR(),或者对于动态分配的IDR使用
37+idr_init()。
38+
39+您可以调用idr_alloc()来分配一个未使用的ID。通过调用idr_find()查询与该ID相关的指针,
40+并通过调用idr_remove()释放该ID。
41+
42+如果需要更改与一个ID相关联的指针,可以调用idr_replace()。这样做的一个常见原因是通
43+过将 ``NULL`` 指针传递给分配函数来保留ID;用保留的ID初始化对象,最后将初始化的对
44+象插入IDR。
45+
46+一些用户需要分配大于 ``INT_MAX`` 的ID。到目前为止,所有这些用户都满足 ``UINT_MAX``
47+的限制,他们使用idr_alloc_u32()。如果您需要超出u32的ID,我们将与您合作以满足您的
48+需求。
49+
50+如果需要按顺序分配ID,可以使用idr_alloc_cyclic()。处理较大数量的ID时,IDR的效率会
51+降低,所以使用这个函数会有一点代价。
52+
53+要对IDR使用的所有指针进行操作,您可以使用基于回调的idr_for_each()或迭代器样式的
54+idr_for_each_entry()。您可能需要使用idr_for_each_entry_continue()来继续迭代。如果
55+迭代器不符合您的需求,您也可以使用idr_get_next()。
56+
57+当使用完IDR后,您可以调用idr_destroy()来释放IDR占用的内存。这并不会释放IDR指向的
58+对象;如果您想这样做,请使用其中一个迭代器来执行此操作。
59+
60+您可以使用idr_is_empty()来查看当前是否分配了任何ID。
61+
62+如果在从IDR分配一个新ID时需要带锁,您可能需要传递一组限制性的GFP标志,但这可能导
63+致IDR无法分配内存。为了解决该问题,您可以在获取锁之前调用idr_preload(),然后在分
64+配之后调用idr_preload_end()。
65+
66+IDR同步的相关内容请见include/linux/idr.h文件中的“DOC: idr sync”。
67+
68+IDA的用法
69+=========
70+
71+IDA的用法的相关内容请见lib/idr.c文件中的“DOC: IDA description”。
72+
73+函数和数据结构
74+==============
75+
76+该API在以下内核代码中:
77+
78+include/linux/idr.h
79+
80+lib/idr.c
Documentation/translations/zh_CN/core-api/index.rst+4−4
@@ -44,15 +44,15 @@ · 43 unmodified lines
4444 assoc_array
4545 xarray
4646 rbtree
47+ idr
48+ circular-buffers
49+ generic-radix-tree
50+ packing
4751
4852 Todolist:
4953
5054
5155
52− idr
53− circular-buffers
54− generic-radix-tree
55− packing
5656 this_cpu_ops
5757 timekeeping
5858 errseq
Documentation/translations/zh_CN/core-api/packing.rst+160−0
@@ -0,0 +1,160 @@
1+.. SPDX-License-Identifier: GPL-2.0+
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/core-api/packing.rst
6+
7+:翻译:
8+
9+ 周彬彬 Binbin Zhou <zhoubinbin@loongson.cn>
10+
11+:校译:
12+
13+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
14+ 吴想成 Wu Xiangcheng <bobwxc@email.cn>
15+ 时奎亮 Alex Shi <alexs@kernel.org>
16+
17+========================
18+通用的位域打包和解包函数
19+========================
20+
21+问题陈述
22+--------
23+
24+使用硬件时,必须在几种与其交互的方法之间进行选择。
25+
26+可以将指针映射到在硬件设备的内存区上精心设计的结构体,并将其字段作为结构成员(可
27+能声明为位域)访问。但是由于CPU和硬件设备之间潜在的字节顺序不匹配,以这种方式编写
28+代码会降低其可移植性。
29+
30+此外,必须密切注意将硬件文档中的寄存器定义转换为结构的位域索引。此外,一些硬件
31+(通常是网络设备)倾向于以违反任何合理字边界(有时甚至是64位)的方式对其寄存器字
32+段进行分组。这就造成了不得不在结构中定义寄存器字段的“高”和“低”部分的不便。
33+
34+结构域定义的更可靠的替代方法是通过移动适当数量的位来提取所需的字段。但这仍然不能
35+防止字节顺序不匹配,除非所有内存访问都是逐字节执行的。此外,代码很容易变得杂乱无
36+章,同时可能会在所需的许多位移操作中丢失一些高层次的想法。
37+
38+许多驱动程序采用了位移的方法,然后试图用定制的宏来减少杂乱无章的东西,但更多的时
39+候,这些宏所采用的捷径依旧妨碍了代码真正的可移植性。
40+
41+解决方案
42+--------
43+
44+该API涉及2个基本操作:
45+
46+ - 将一个CPU可使用的数字打包到内存缓冲区中(具有硬件约束/特殊性)。
47+ - 将内存缓冲区(具有硬件约束/特殊性)解压缩为一个CPU可使用的数字。
48+
49+该API提供了对所述硬件约束和特殊性以及CPU字节序的抽象,因此这两者之间可能不匹配。
50+
51+这些API函数的基本单元是u64。从CPU的角度来看,位63总是意味着字节7的位偏移量7,尽管
52+只是逻辑上的。问题是:我们将这个比特放在内存的什么位置?
53+
54+以下示例介绍了打包u64字段的内存布局。打包缓冲区中的字节偏移量始终默认为0,1...7。
55+示例显示的是逻辑字节和位所在的位置。
56+
57+1. 通常情况下(无特殊性),我们会这样做:
58+
59+::
60+
61+ 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
62+ 7 6 5 4
63+ 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
64+ 3 2 1 0
65+
66+也就是说,CPU可使用的u64的MSByte(7)位于内存偏移量0处,而u64的LSByte(0)位于内存偏移量7处。
67+
68+这对应于大多数人认为的“大端”,其中位i对应于数字2^i。这在代码注释中也称为“逻辑”符号。
69+
70+
71+2. 如果设置了QUIRK_MSB_ON_THE_RIGHT,我们按如下方式操作:
72+
73+::
74+
75+ 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39
76+ 7 6 5 4
77+ 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
78+ 3 2 1 0
79+
80+也就是说,QUIRK_MSB_ON_THE_RIGHT不会影响字节定位,但会反转字节内的位偏移量。
81+
82+
83+3. 如果设置了QUIRK_LITTLE_ENDIAN,我们按如下方式操作:
84+
85+::
86+
87+ 39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56
88+ 4 5 6 7
89+ 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
90+ 0 1 2 3
91+
92+因此,QUIRK_LITTLE_ENDIAN意味着在内存区域内,每个4字节的字的每个字节都被放置在与
93+该字的边界相比的镜像位置。
94+
95+
96+4. 如果设置了QUIRK_MSB_ON_THE_RIGHT和QUIRK_LITTLE_ENDIAN,我们这样做:
97+
98+::
99+
100+ 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
101+ 4 5 6 7
102+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
103+ 0 1 2 3
104+
105+
106+5. 如果只设置了QUIRK_LSW32_IS_FIRST,我们这样做:
107+
108+::
109+
110+ 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
111+ 3 2 1 0
112+ 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
113+ 7 6 5 4
114+
115+在这种情况下,8字节内存区域解释如下:前4字节对应最不重要的4字节的字,后4字节对应
116+更重要的4字节的字。
117+
118+6. 如果设置了QUIRK_LSW32_IS_FIRST和QUIRK_MSB_ON_THE_RIGHT,我们这样做:
119+
120+::
121+
122+ 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
123+ 3 2 1 0
124+ 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39
125+ 7 6 5 4
126+
127+
128+7. 如果设置了QUIRK_LSW32_IS_FIRST和QUIRK_LITTLE_ENDIAN,则如下所示:
129+
130+::
131+
132+ 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
133+ 0 1 2 3
134+ 39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56
135+ 4 5 6 7
136+
137+
138+8. 如果设置了QUIRK_LSW32_IS_FIRST,QUIRK_LITTLE_ENDIAN和QUIRK_MSB_ON_THE_RIGHT,
139+ 则如下所示:
140+
141+::
142+
143+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
144+ 0 1 2 3
145+ 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
146+ 4 5 6 7
147+
148+
149+我们总是认为我们的偏移量好像没有特殊性,然后在访问内存区域之前翻译它们。
150+
151+预期用途
152+--------
153+
154+选择使用该API的驱动程序首先需要确定上述3种quirk组合(共8种)中的哪一种与硬件文档
155+中描述的相匹配。然后,他们应该封装packing()函数,创建一个新的xxx_packing(),使用
156+适当的QUIRK_* one-hot 位集合来调用它。
157+
158+packing()函数返回一个int类型的错误码,以防止程序员使用不正确的API。这些错误预计不
159+会在运行时发生,因此xxx_packing()返回void并简单地接受这些错误是合理的。它可以选择
160+转储栈或打印错误描述。
Documentation/translations/zh_CN/devicetree/changesets.rst+37−0
@@ -0,0 +1,37 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+.. include:: ../disclaimer-zh_CN.rst
3+
4+:Original: Documentation/Devicetree/changesets.rst
5+
6+:翻译:
7+
8+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
9+
10+:校译:
11+
12+
13+============
14+设备树变更集
15+============
16+
17+设备树变更集是一种方法,它允许人们以这样一种方式在实时树中使用变化,即要么使用全部的
18+变化,要么不使用。如果在使用变更集的过程中发生错误,那么树将被回滚到之前的状态。一个
19+变更集也可以在使用后被删除。
20+
21+当一个变更集被使用时,所有的改变在发出OF_RECONFIG通知器之前被一次性使用到树上。这是
22+为了让接收者在收到通知时看到一个完整的、一致的树的状态。
23+
24+一个变化集的顺序如下。
25+
26+1. of_changeset_init() - 初始化一个变更集。
27+
28+2. 一些DT树变化的调用,of_changeset_attach_node(), of_changeset_detach_node(),
29+ of_changeset_add_property(), of_changeset_remove_property,
30+ of_changeset_update_property()来准备一组变更。此时不会对活动树做任何变更。所有
31+ 的变更操作都记录在of_changeset的 `entries` 列表中。
32+
33+3. of_changeset_apply() - 将变更使用到树上。要么整个变更集被使用,要么如果有错误,
34+ 树会被恢复到之前的状态。核心通过锁确保正确的顺序。如果需要的话,可以使用一个解锁的
35+ __of_changeset_apply版本。
36+
37+如果一个成功使用的变更集需要被删除,可以用of_changeset_revert()来完成。
Documentation/translations/zh_CN/devicetree/dynamic-resolution-notes.rst+31−0
@@ -0,0 +1,31 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+.. include:: ../disclaimer-zh_CN.rst
3+
4+:Original: Documentation/Devicetree/dynamic-resolution-notes.rst
5+
6+:翻译:
7+
8+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
9+
10+:校译:
11+
12+========================
13+Devicetree动态解析器说明
14+========================
15+
16+本文描述了内核内DeviceTree解析器的实现,它位于drivers/of/resolver.c中。
17+
18+解析器如何工作?
19+----------------
20+
21+解析器被赋予一个任意的树作为输入,该树用适当的dtc选项编译,并有一个/plugin/标签。这就产
22+生了适当的__fixups__和__local_fixups__节点。
23+
24+解析器依次通过以下步骤工作:
25+
26+1. 从实时树中获取最大的设备树phandle值 + 1.
27+2. 调整树的所有本地 phandles,以解决这个量。
28+3. 使用 __local__fixups__ 节点信息以相同的量调整所有本地引用。
29+4. 对于__fixups__节点中的每个属性,找到它在实时树中引用的节点。这是用来标记该节点的标签。
30+5. 检索fixup的目标的phandle。
31+6. 对于属性中的每个fixup,找到节点:属性:偏移的位置,并用phandle值替换它。
Documentation/translations/zh_CN/devicetree/index.rst+4−9
@@ -24,21 +24,16 @@ Open Firmware 和 Devicetree · 23 unmodified lines
2424
2525 usage-model
2626 of_unittest
27−
28−Todolist:
29−
30−* kernel-api
27+ kernel-api
3128
3229 Devicetree Overlays
3330 ===================
3431 .. toctree::
3532 :maxdepth: 1
3633
37−Todolist:
38−
39−* changesets
40−* dynamic-resolution-notes
41−* overlay-notes
34+ changesets
35+ dynamic-resolution-notes
36+ overlay-notes
4237
4338 Devicetree Bindings
4439 ===================
Documentation/translations/zh_CN/devicetree/kernel-api.rst+58−0
@@ -0,0 +1,58 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+.. include:: ../disclaimer-zh_CN.rst
3+
4+:Original: Documentation/Devicetree/kernel-api.rst
5+
6+:翻译:
7+
8+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
9+
10+:校译:
11+
12+
13+=================
14+内核中的设备树API
15+=================
16+
17+核心函数
18+--------
19+
20+该API在以下内核代码中:
21+
22+drivers/of/base.c
23+
24+include/linux/of.h
25+
26+drivers/of/property.c
27+
28+include/linux/of_graph.h
29+
30+drivers/of/address.c
31+
32+drivers/of/irq.c
33+
34+drivers/of/fdt.c
35+
36+驱动模型函数
37+------------
38+
39+该API在以下内核代码中:
40+
41+include/linux/of_device.h
42+
43+drivers/of/device.c
44+
45+include/linux/of_platform.h
46+
47+drivers/of/platform.c
48+
49+覆盖和动态DT函数
50+----------------
51+
52+该API在以下内核代码中:
53+
54+drivers/of/resolver.c
55+
56+drivers/of/dynamic.c
57+
58+drivers/of/overlay.c
Documentation/translations/zh_CN/devicetree/overlay-notes.rst+140−0
@@ -0,0 +1,140 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+.. include:: ../disclaimer-zh_CN.rst
3+
4+:Original: Documentation/Devicetree/overlay-notes.rst
5+
6+:翻译:
7+
8+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
9+
10+:校译:
11+
12+==============
13+设备树覆盖说明
14+==============
15+
16+本文档描述了drivers/of/overlay.c中的内核内设备树覆盖功能的实现,是
17+Documentation/devicetree/dynamic-resolution-notes.rst[1]的配套文档。
18+
19+覆盖如何工作
20+------------
21+
22+设备树覆盖的目的是修改内核的实时树,并使修改以反映变化的方式影响内核的状态。
23+由于内核主要处理的是设备,任何新的设备节点如果导致一个活动的设备,就应该创建它,
24+而如果设备节点被禁用或被全部删除,受影响的设备应该被取消注册。
25+
26+让我们举个例子,我们有一个foo板,它的基本树形图如下::
27+
28+ ---- foo.dts ---------------------------------------------------------------
29+ /* FOO平台 */
30+ /dts-v1/;
31+ / {
32+ compatible = "corp,foo";
33+
34+ /* 共享的资源 */
35+ res: res {
36+ };
37+
38+ /* 芯片上的外围设备 */
39+ ocp: ocp {
40+ /* 总是被实例化的外围设备 */
41+ peripheral1 { ... };
42+ };
43+ };
44+ ---- foo.dts ---------------------------------------------------------------
45+
46+覆盖bar.dts,
47+::
48+
49+ ---- bar.dts - 按标签覆盖目标位置 ----------------------------
50+ /dts-v1/;
51+ /插件/;
52+ &ocp {
53+ /* bar外围 */
54+ bar {
55+ compatible = "corp,bar";
56+ ... /* 各种属性和子节点 */
57+ };
58+ };
59+ ---- bar.dts ---------------------------------------------------------------
60+
61+当加载(并按照[1]中描述的方式解决)时,应该产生foo+bar.dts::
62+
63+ ---- foo+bar.dts -----------------------------------------------------------
64+ /* FOO平台 + bar外围 */
65+ / {
66+ compatible = "corp,foo";
67+
68+ /* 共享资源 */
69+ res: res {
70+ };
71+
72+ /* 芯片上的外围设备 */
73+ ocp: ocp {
74+ /* 总是被实例化的外围设备 */
75+ peripheral1 { ... };
76+
77+ /* bar外围 */
78+ bar {
79+ compatible = "corp,bar";
80+ ... /* 各种属性和子节点 */
81+ };
82+ };
83+ };
84+ ---- foo+bar.dts -----------------------------------------------------------
85+
86+作为覆盖的结果,已经创建了一个新的设备节点(bar),因此将注册一个bar平台设备,
87+如果加载了匹配的设备驱动程序,将按预期创建设备。
88+
89+如果基础DT不是用-@选项编译的,那么“&ocp”标签将不能用于将覆盖节点解析到基础
90+DT中的适当位置。在这种情况下,可以提供目标路径。通过标签的目标位置的语法是比
91+较好的,因为不管标签在DT中出现在哪里,覆盖都可以被应用到任何包含标签的基础DT上。
92+
93+上面的bar.dts例子被修改为使用目标路径语法,即为::
94+
95+ ---- bar.dts - 通过明确的路径覆盖目标位置 --------------------
96+ /dts-v1/;
97+ /插件/;
98+ &{/ocp} {
99+ /* bar外围 */
100+ bar {
101+ compatible = "corp,bar";
102+ ... /* 各种外围设备和子节点 */
103+ }
104+ };
105+ ---- bar.dts ---------------------------------------------------------------
106+
107+
108+内核中关于覆盖的API
109+-------------------
110+
111+该API相当容易使用。
112+
113+1) 调用of_overlay_fdt_apply()来创建和应用一个覆盖的变更集。返回值是一个
114+ 错误或一个识别这个覆盖的cookie。
115+
116+2) 调用of_overlay_remove()来删除和清理先前通过调用of_overlay_fdt_apply()
117+ 而创建的覆盖变更集。不允许删除一个被另一个覆盖的覆盖变化集。
118+
119+最后,如果你需要一次性删除所有的覆盖,只需调用of_overlay_remove_all(),
120+它将以正确的顺序删除每一个覆盖。
121+
122+你可以选择注册在覆盖操作中被调用的通知器。详见
123+of_overlay_notifier_register/unregister和enum of_overlay_notify_action。
124+
125+OF_OVERLAY_PRE_APPLY、OF_OVERLAY_POST_APPLY或OF_OVERLAY_PRE_REMOVE
126+的通知器回调可以存储指向覆盖层中的设备树节点或其内容的指针,但这些指针不能持
127+续到OF_OVERLAY_POST_REMOVE的通知器回调。在OF_OVERLAY_POST_REMOVE通
128+知器被调用后,包含覆盖层的内存将被kfree()ed。请注意,即使OF_OVERLAY_POST_REMOVE
129+的通知器返回错误,内存也会被kfree()ed。
130+
131+drivers/of/dynamic.c中的变更集通知器是第二种类型的通知器,可以通过应用或移除
132+覆盖层来触发。这些通知器不允许在覆盖层或其内容中存储指向设备树节点的指针。当包含
133+覆盖层的内存因移除覆盖层而被释放时,覆盖层代码并不能防止这类指针仍然有效。
134+
135+任何其他保留指向覆盖层节点或数据的指针的代码都被认为是一个错误,因为在移除覆盖层
136+后,该指针将指向已释放的内存。
137+
138+覆盖层的用户必须特别注意系统上发生的整体操作,以确保其他内核代码不保留任何指向覆
139+盖层节点或数据的指针。任何无意中使用这种指针的例子是,如果一个驱动或子系统模块在
140+应用了覆盖后被加载,并且该驱动或子系统扫描了整个设备树或其大部分,包括覆盖节点。
Documentation/translations/zh_CN/driver-api/gpio/index.rst+69−0
@@ -0,0 +1,69 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+.. include:: ../../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/driver-api/gpio/index.rst
6+
7+:翻译:
8+
9+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
10+
11+:校译:
12+
13+=======================
14+通用型输入/输出(GPIO)
15+=======================
16+
17+目录:
18+
19+.. toctree::
20+ :maxdepth: 2
21+
22+ legacy
23+
24+Todolist:
25+
26+* intro
27+* using-gpio
28+* driver
29+* consumer
30+* board
31+* drivers-on-gpio
32+* bt8xxgpio
33+
34+核心
35+====
36+
37+该API在以下内核代码中:
38+
39+include/linux/gpio/driver.h
40+
41+drivers/gpio/gpiolib.c
42+
43+ACPI支持
44+========
45+
46+该API在以下内核代码中:
47+
48+drivers/gpio/gpiolib-acpi.c
49+
50+设备树支持
51+==========
52+
53+该API在以下内核代码中:
54+
55+drivers/gpio/gpiolib-of.c
56+
57+设备管理支持
58+============
59+
60+该API在以下内核代码中:
61+
62+drivers/gpio/gpiolib-devres.c
63+
64+sysfs帮助(函数)
65+=================
66+
67+该API在以下内核代码中:
68+
69+drivers/gpio/gpiolib-sysfs.c
Documentation/translations/zh_CN/driver-api/gpio/legacy.rstrenamed from Documentation/translations/zh_CN/gpio.txt+114−70
@@ -1,39 +1,28 @@
1−Chinese translated version of Documentation/admin-guide/gpio
1+.. SPDX-License-Identifier: GPL-2.0
22
3−If you have any comment or update to the content, please contact the
4−original document maintainer directly. However, if you have a problem
5−communicating in English you can also ask the Chinese maintainer for
6−help. Contact the Chinese maintainer if this translation is outdated
7−or if there is a problem with the translation.
3+.. include:: ../../disclaimer-zh_CN.rst
84
9−Maintainer: Grant Likely <grant.likely@secretlab.ca>
10− Linus Walleij <linus.walleij@linaro.org>
11−Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
12−---------------------------------------------------------------------
13−Documentation/admin-guide/gpio 的中文翻译
5+:Original: Documentation/driver-api/gpio/legacy.rst
146
15−如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
16−交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
17−译存在问题,请联系中文版维护者。
18−英文版维护者: Grant Likely <grant.likely@secretlab.ca>
19− Linus Walleij <linus.walleij@linaro.org>
20−中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21−中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
22−中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
7+:翻译:
238
9+ 傅炜 Fu Wei <tekkamanninja@gmail.com>
10+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
2411
25−以下为正文
26−---------------------------------------------------------------------
27−GPIO 接口
12+:校译:
2813
29−本文档提供了一个在Linux下访问GPIO的公约概述。
14+
15+传统GPIO接口
16+============
17+
18+本文档概述了Linux下的GPIO访问公约。
3019
3120 这些函数以 gpio_* 作为前缀。其他的函数不允许使用这样的前缀或相关的
3221 __gpio_* 前缀。
3322
3423
35−什么是GPIO?
36−==========
24+什么是GPIO?
25+============
3726 "通用输入/输出口"(GPIO)是一个灵活的由软件控制的数字信号。他们可
3827 由多种芯片提供,且对于从事嵌入式和定制硬件的 Linux 开发者来说是
3928 比较熟悉。每个GPIO 都代表一个连接到特定引脚或球栅阵列(BGA)封装中
@@ -99,6 +88,7 @@ GPIO 公约 · 59 unmodified lines
9988
10089 标识 GPIO
10190 ---------
91+
10292 GPIO 是通过无符号整型来标识的,范围是 0 到 MAX_INT。保留“负”数
10393 用于其他目的,例如标识信号“在这个板子上不可用”或指示错误。未接触底层
10494 硬件的代码会忽略这些整数。
@@ -115,7 +105,7 @@ FPGA 的特定板子上使用 80-95。编号不一定要连续,那些平台中 · 10 unmodified lines
115105
116106 如果你要初始化一个带有无效 GPIO 编号的结构体,可以使用一些负编码
117107 (如"-EINVAL"),那将使其永远不会是有效。来测试这样一个结构体中的编号
118−是否关联一个 GPIO,你可使用以下断言:
108+是否关联一个 GPIO,你可使用以下断言::
119109
120110 int gpio_is_valid(int number);
121111
@@ -128,11 +118,12 @@ FPGA 的特定板子上使用 80-95。编号不一定要连续,那些平台中 · 6 unmodified lines
128118
129119 使用 GPIO
130120 ---------
121+
131122 对于一个 GPIO,系统应该做的第一件事情就是通过 gpio_request()
132123 函数分配它,见下文。
133124
134125 接下来是设置I/O方向,这通常是在板级启动代码中为所使用的 GPIO 设置
135−platform_device 时完成。
126+platform_device 时完成::
136127
137128 /* 设置为输入或输出, 返回 0 或负的错误代码 */
138129 int gpio_direction_input(unsigned gpio);
@@ -157,12 +148,13 @@ get/set(获取/设置)函数调用没法返回错误,且有可能是配置错误 · 18 unmodified lines
157148
158149
159150 访问自旋锁安全的 GPIO
160−-------------------
151+---------------------
152+
161153 大多数 GPIO 控制器可以通过内存读/写指令来访问。这些指令不会休眠,可以
162154 安全地在硬(非线程)中断例程和类似的上下文中完成。
163155
164156 对于那些用 gpio_cansleep()测试总是返回失败的 GPIO(见下文),使用
165−以下的函数访问:
157+以下的函数访问::
166158
167159 /* GPIO 输入:返回零或非零 */
168160 int gpio_get_value(unsigned gpio);
@@ -188,17 +180,18 @@ GPIO值是布尔值,零表示低电平,非零表示高电平。当读取一 · 19 unmodified lines
188180
189181
190182 访问可能休眠的 GPIO
191−-----------------
183+-------------------
184+
192185 某些 GPIO 控制器必须通过基于总线(如 I2C 或 SPI)的消息访问。读或写这些
193186 GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其反馈。期间需要
194187 休眠,这不能在 IRQ 例程(中断上下文)中执行。
195188
196189 支持此类 GPIO 的平台通过以下函数返回非零值来区分出这种 GPIO。(此函数需要
197−一个之前通过 gpio_request 分配到的有效 GPIO 编号):
190+一个之前通过 gpio_request 分配到的有效 GPIO 编号)::
198191
199192 int gpio_cansleep(unsigned gpio);
200193
201−为了访问这种 GPIO,内核定义了一套不同的函数:
194+为了访问这种 GPIO,内核定义了一套不同的函数::
202195
203196 /* GPIO 输入:返回零或非零 ,可能会休眠 */
204197 int gpio_get_value_cansleep(unsigned gpio);
@@ -214,25 +207,26 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 · 9 unmodified lines
214207 事实,这些处理例程实际上和自旋锁安全的函数是一样的。
215208
216209 ** 除此之外 ** 调用设置和配置此类 GPIO 的函数也必须在允许休眠的上下文中,
217−因为它们可能也需要访问 GPIO 控制器芯片: (这些设置函数通常在板级启动代码或者
218−驱动探测/断开代码中,所以这是一个容易满足的约束条件。)
210+因为它们可能也需要访问 GPIO 控制器芯片 (这些设置函数通常在板级启动代码或者
211+驱动探测/断开代码中,所以这是一个容易满足的约束条件。) ::
219212
220− gpio_direction_input()
221− gpio_direction_output()
222− gpio_request()
213+ gpio_direction_input()
214+ gpio_direction_output()
215+ gpio_request()
223216
224−## gpio_request_one()
225−## gpio_request_array()
226−## gpio_free_array()
217+ ## gpio_request_one()
218+ ## gpio_request_array()
219+ ## gpio_free_array()
227220
228− gpio_free()
229− gpio_set_debounce()
221+ gpio_free()
222+ gpio_set_debounce()
230223
231224
232225
233226 声明和释放 GPIO
234−----------------------------
235−为了有助于捕获系统配置错误,定义了两个函数。
227+----------------
228+
229+为了有助于捕获系统配置错误,定义了两个函数::
236230
237231 /* 申请 GPIO, 返回 0 或负的错误代码.
238232 * 非空标签可能有助于诊断.
@@ -256,9 +250,9 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 · 17 unmodified lines
256250 某些平台可能也使用 GPIO 作为电源管理激活信号(例如通过关闭未使用芯片区和
257251 简单地关闭未使用时钟)。
258252
259−对于 GPIO 使用 pinctrl 子系统已知的引脚,子系统应该被告知其使用情况;
253+对于 GPIO 使用引脚控制子系统已知的引脚,子系统应该被告知其使用情况;
260254 一个 gpiolib 驱动的 .request()操作应调用 pinctrl_gpio_request(),
261−而 gpiolib 驱动的 .free()操作应调用 pinctrl_gpio_free()。pinctrl
255+而 gpiolib 驱动的 .free()操作应调用 pinctrl_gpio_free()。引脚控制
262256 子系统允许 pinctrl_gpio_request()在某个引脚或引脚组以复用形式“属于”
263257 一个设备时都成功返回。
264258
@@ -270,7 +264,7 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 · 5 unmodified lines
270264
271265 某些平台允许部分或所有 GPIO 信号使用不同的引脚。类似的,GPIO 或引脚的
272266 其他方面也需要配置,如上拉/下拉。平台软件应该在对这些 GPIO 调用
273−gpio_request()前将这类细节配置好,例如使用 pinctrl 子系统的映射表,
267+gpio_request()前将这类细节配置好,例如使用引脚控制子系统的映射表,
274268 使得 GPIO 的用户无须关注这些细节。
275269
276270 还有一个值得注意的是在释放 GPIO 前,你必须停止使用它。
@@ -278,7 +272,7 @@ gpio_request()前将这类细节配置好,例如使用 pinctrl 子系统的映 · 1 unmodified line
278272
279273 注意:申请一个 GPIO 并没有以任何方式配置它,只不过标识那个 GPIO 处于使用
280274 状态。必须有另外的代码来处理引脚配置(如控制 GPIO 使用的引脚、上拉/下拉)。
281−考虑到大多数情况下声明 GPIO 之后就会立即配置它们,所以定义了以下三个辅助函数:
275+考虑到大多数情况下声明 GPIO 之后就会立即配置它们,所以定义了以下三个辅助函数::
282276
283277 /* 申请一个 GPIO 信号, 同时通过特定的'flags'初始化配置,
284278 * 其他和 gpio_request()的参数和返回值相同
@@ -326,7 +320,7 @@ gpio_request()前将这类细节配置好,例如使用 pinctrl 子系统的映 · 41 unmodified lines
326320 将来这些标志可能扩展到支持更多的属性。
327321
328322 更进一步,为了更简单地声明/释放多个 GPIO,'struct gpio'被引进来封装所有
329−这三个领域:
323+这三个领域::
330324
331325 struct gpio {
332326 unsigned gpio;
@@ -334,7 +328,7 @@ gpio_request()前将这类细节配置好,例如使用 pinctrl 子系统的映 · 1 unmodified line
334328 const char *label;
335329 };
336330
337−一个典型的用例:
331+一个典型的用例::
338332
339333 static struct gpio leds_gpios[] = {
340334 { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* 默认开启 */
@@ -356,9 +350,10 @@ gpio_request()前将这类细节配置好,例如使用 pinctrl 子系统的映 · 15 unmodified lines
356350
357351
358352 GPIO 映射到 IRQ
359−--------------------
353+----------------
354+
360355 GPIO 编号是无符号整数;IRQ 编号也是。这些构成了两个逻辑上不同的命名空间
361−(GPIO 0 不一定使用 IRQ 0)。你可以通过以下函数在它们之间实现映射:
356+(GPIO 0 不一定使用 IRQ 0)。你可以通过以下函数在它们之间实现映射::
362357
363358 /* 映射 GPIO 编号到 IRQ 编号 */
364359 int gpio_to_irq(unsigned gpio);
@@ -384,7 +379,8 @@ irq_to_gpio()返回的非错误值大多数通常可以被 gpio_get_value()所 · 19 unmodified lines
384379
385380
386381 模拟开漏信号
387−----------------------------
382+------------
383+
388384 有时在只有低电平信号作为实际驱动结果(译者注:多个输出连接于一点,逻辑电平
389385 结果为所有输出的逻辑与)的时候,共享的信号线需要使用“开漏”信号。(该术语
390386 适用于 CMOS 管;而 TTL 用“集电极开路”。)一个上拉电阻使信号为高电平。这
@@ -408,9 +404,44 @@ irq_to_gpio()返回的非错误值大多数通常可以被 gpio_get_value()所 · 17 unmodified lines
408404 这不一定是错误的。一个常见的例子就是 I2C 时钟的延长:一个需要较慢时钟的
409405 从设备延迟 SCK 的上升沿,而 I2C 主设备相应地调整其信号传输速率。
410406
407+GPIO控制器和引脚控制子系统
408+--------------------------
409+
410+SOC上的GPIO控制器可能与引脚控制子系统紧密结合,即引脚可以与可选的gpio功
411+能一起被其他功能使用。我们已经涵盖了这样的情况,例如一个GPIO控制器需要保
412+留一个引脚或通过调用以下任何一个引脚来设置其方向::
413+
414+ pinctrl_gpio_request()
415+ pinctrl_gpio_free()
416+ pinctrl_gpio_direction_input()
417+ pinctrl_gpio_direction_output()
418+
419+但是,引脚控制子系统是如何将GPIO号码(这是一个全局事项)与某个引脚控制器
420+上的某个引脚交叉关联的?
421+
422+这是通过注册引脚的“范围”来实现的,这基本上是交叉参考表。这些描述是在
423+Documentation/driver-api/pin-control.rst
424+
425+虽然引脚分配完全由引脚控制子系统管理,但gpio(在gpiolib下)仍由gpio驱动
426+维护。可能发生的情况是,SoC中的不同引脚范围由不同的gpio驱动器管理。
427+
428+这使得在调用 "pinctrl_gpio_request" 之前,让gpio驱动向pin ctrl子系
429+统宣布它们的引脚范围是合理的,以便在使用任何gpio之前要求引脚控制子系统准
430+备相应的引脚。
431+
432+为此,gpio控制器可以用引脚控制子系统注册其引脚范围。目前有两种方法:有或
433+无DT。
434+
435+关于对DT的支持,请参考 Documentation/devicetree/bindings/gpio/gpio.txt.
436+
437+对于非DT支持,用户可以用适当的参数调用gpiochip_add_pin_range(),将一
438+系列的gpio引脚注册到引脚控制驱动上。为此,必须将引脚控制设备的名称字符串
439+作为参数之一传给这个程序。
440+
441+
442+这些公约忽略了什么?
443+====================
411444
412−这些公约忽略了什么?
413−================
414445 这些公约忽略的最大一件事就是引脚复用,因为这属于高度芯片特定的属性且
415446 没有可移植性。某个平台可能不需要明确的复用信息;有的对于任意给定的引脚
416447 可能只有两个功能选项;有的可能每个引脚有八个功能选项;有的可能可以将
@@ -433,8 +464,9 @@ Linux 的系统。) · 16 unmodified lines
433464 当前,动态定义 GPIO 并不是标准的,例如作为配置一个带有某些 GPIO 扩展器的
434465 附加电路板的副作用。
435466
436−GPIO 实现者的框架 (可选)
437−=====================
467+GPIO 实现者的框架(可选)
468+=========================
469+
438470 前面提到了,有一个可选的实现框架,让平台使用相同的编程接口,更加简单地支持
439471 不同种类的 GPIO 控制器。这个框架称为"gpiolib"。
440472
@@ -444,15 +476,16 @@ GPIO 实现者的框架 (可选) · 3 unmodified lines
444476
445477
446478 控制器驱动: gpio_chip
447−-------------------
479+---------------------
480+
448481 在框架中每个 GPIO 控制器都包装为一个 "struct gpio_chip",他包含了
449482 该类型的每个控制器的常用信息:
450483
451− - 设置 GPIO 方向的方法
452− - 用于访问 GPIO 值的方法
453− - 告知调用其方法是否可能休眠的标志
454− - 可选的 debugfs 信息导出方法 (显示类似上拉配置一样的额外状态)
455− - 诊断标签
484+ - 设置 GPIO 方向的方法
485+ - 用于访问 GPIO 值的方法
486+ - 告知调用其方法是否可能休眠的标志
487+ - 可选的 debugfs 信息导出方法 (显示类似上拉配置一样的额外状态)
488+ - 诊断标签
456489
457490 也包含了来自 device.platform_data 的每个实例的数据:它第一个 GPIO 的
458491 编号和它可用的 GPIO 的数量。
@@ -471,7 +504,8 @@ GPIO 实现者的框架 (可选) · 12 unmodified lines
471504
472505
473506 平台支持
474−-------
507+--------
508+
475509 为了支持这个框架,一个平台的 Kconfig 文件将会 "select"(选择)
476510 ARCH_REQUIRE_GPIOLIB 或 ARCH_WANT_OPTIONAL_GPIOLIB,并让它的
477511 <asm/gpio.h> 包含 <asm-generic/gpio.h>,同时定义三个方法:
@@ -489,7 +523,7 @@ ARCH_WANT_OPTIONAL_GPIOLIB 意味着 gpiolib 核心默认关闭,且用户可以 · 11 unmodified lines
489523 如果这些选项都没被选择,该平台就不通过 GPIO-lib 支持 GPIO,且代码不可以
490524 被用户使能。
491525
492−以下这些方法的实现可以直接使用框架代码,并总是通过 gpio_chip 调度:
526+以下这些方法的实现可以直接使用框架代码,并总是通过 gpio_chip 调度::
493527
494528 #define gpio_get_value __gpio_get_value
495529 #define gpio_set_value __gpio_set_value
@@ -508,7 +542,8 @@ arch_initcall()或者更早的地方集成进平台初始化代码,使这些 G · 12 unmodified lines
508542 且他们通常可以作为 IRQ 使用。
509543
510544 板级支持
511−-------
545+--------
546+
512547 对于外部 GPIO 控制器(例如 I2C 或 SPI 扩展器、专用芯片、多功能器件、FPGA
513548 或 CPLD),大多数常用板级特定代码都可以注册控制器设备,并保证他们的驱动知道
514549 gpiochip_add()所使用的 GPIO 编号。他们的起始编号通常跟在平台特定的 GPIO
@@ -526,8 +561,9 @@ GPIO 可以工作之后才可被注册。解决这类依赖的的一种方法是 · 11 unmodified lines
526561 设备变成无效时移除它们。
527562
528563
529−用户空间的 Sysfs 接口(可选)
530−========================
564+用户空间的 Sysfs 接口(可选)
565+=============================
566+
531567 使用“gpiolib”实现框架的平台可以选择配置一个 GPIO 的 sysfs 用户接口。
532568 这不同于 debugfs 接口,因为它提供的是对 GPIO方向和值的控制,而不只显示
533569 一个GPIO 的状态摘要。此外,它可以出现在没有调试支持的产品级系统中。
@@ -548,6 +584,7 @@ GPIO 可以工作之后才可被注册。解决这类依赖的的一种方法是 · 14 unmodified lines
548584
549585 Sysfs 中的路径
550586 --------------
587+
551588 在/sys/class/gpio 中有 3 类入口:
552589
553590 - 用于在用户空间控制 GPIO 的控制接口;
@@ -625,8 +662,9 @@ GPIO 控制器的路径类似 /sys/class/gpio/gpiochip42/ (对于从#42 GPIO · 71 unmodified lines
625662
626663
627664 从内核代码中导出
628−-------------
629−内核代码可以明确地管理那些已通过 gpio_request()申请的 GPIO 的导出:
665+----------------
666+
667+内核代码可以明确地管理那些已通过 gpio_request()申请的 GPIO 的导出::
630668
631669 /* 导出 GPIO 到用户空间 */
632670 int gpio_export(unsigned gpio, bool direction_may_change);
@@ -648,3 +686,9 @@ GPIO 控制器的路径类似 /sys/class/gpio/gpiochip42/ (对于从#42 GPIO · 15 unmodified lines
648686 在 GPIO 被导出之后,gpio_export_link()允许在 sysfs 文件系统的任何地方
649687 创建一个到这个 GPIO sysfs 节点的符号链接。这样驱动就可以通过一个描述性的
650688 名字,在 sysfs 中他们所拥有的设备下提供一个(到这个 GPIO sysfs 节点的)接口。
689+
690+
691+API参考
692+=======
693+
694+本节中列出的函数已被废弃。在新的代码中应该使用基于GPIO描述符的API。
Documentation/translations/zh_CN/driver-api/index.rst+132−0
@@ -0,0 +1,132 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/driver-api/index.rst
6+
7+:翻译:
8+
9+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
10+
11+:校译:
12+
13+========================
14+Linux驱动实现者的API指南
15+========================
16+
17+内核提供了各种各样的接口来支持设备驱动的开发。这份文档只是对其中一些接口进行了
18+一定程度的整理——希望随着时间的推移,它能变得更好!可用的小节可以在下面看到。
19+
20+.. class:: toc-title
21+
22+ 目录列表:
23+
24+.. toctree::
25+ :maxdepth: 2
26+
27+ gpio/index
28+ io_ordering
29+
30+Todolist:
31+
32+* driver-model/index
33+* basics
34+* infrastructure
35+* ioctl
36+* early-userspace/index
37+* pm/index
38+* clk
39+* device-io
40+* dma-buf
41+* device_link
42+* component
43+* message-based
44+* infiniband
45+* aperture
46+* frame-buffer
47+* regulator
48+* reset
49+* iio/index
50+* input
51+* usb/index
52+* firewire
53+* pci/index
54+* cxl/index
55+* spi
56+* i2c
57+* ipmb
58+* ipmi
59+* i3c/index
60+* interconnect
61+* devfreq
62+* hsi
63+* edac
64+* scsi
65+* libata
66+* target
67+* mailbox
68+* mtdnand
69+* miscellaneous
70+* mei/index
71+* mtd/index
72+* mmc/index
73+* nvdimm/index
74+* w1
75+* rapidio/index
76+* s390-drivers
77+* vme
78+* 80211/index
79+* uio-howto
80+* firmware/index
81+* pin-control
82+* md/index
83+* media/index
84+* misc_devices
85+* nfc/index
86+* dmaengine/index
87+* slimbus
88+* soundwire/index
89+* thermal/index
90+* fpga/index
91+* acpi/index
92+* auxiliary_bus
93+* backlight/lp855x-driver.rst
94+* connector
95+* console
96+* dcdbas
97+* eisa
98+* isa
99+* isapnp
100+* io-mapping
101+* generic-counter
102+* memory-devices/index
103+* men-chameleon-bus
104+* ntb
105+* nvmem
106+* parport-lowlevel
107+* pps
108+* ptp
109+* phy/index
110+* pwm
111+* pldmfw/index
112+* rfkill
113+* serial/index
114+* sm501
115+* surface_aggregator/index
116+* switchtec
117+* sync_file
118+* tty/index
119+* vfio-mediated-device
120+* vfio
121+* vfio-pci-device-specific-driver-acceptance
122+* xilinx/index
123+* xillybus
124+* zorro
125+* hte/index
126+
127+.. only:: subproject and html
128+
129+ Indices
130+ =======
131+
132+ * :ref:`genindex`
Documentation/translations/zh_CN/driver-api/io_ordering.rst+60−0
@@ -0,0 +1,60 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+.. include:: ../disclaimer-zh_CN.rst
4+
5+:Original: Documentation/driver-api/io_ordering.rst
6+
7+:翻译:
8+
9+ 林永听 Lin Yongting <linyongting@gmail.com>
10+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
11+
12+:校译:
13+
14+===========================
15+对内存映射地址的I/O写入排序
16+===========================
17+
18+在某些平台上,所谓的内存映射I/O是弱顺序。在这些平台上,驱动开发者有责任
19+保证I/O内存映射地址的写操作按程序图意的顺序达到设备。通常读取一个“安全”
20+设备寄存器或桥寄存器,触发IO芯片清刷未处理的写操作到达设备后才处理读操作,
21+而达到保证目的。驱动程序通常在spinlock保护的临界区退出之前使用这种技术。
22+这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存
23+屏障操作,mb(),不过仅适用于I/O)。
24+
25+假设一个设备驱动程的具体例子::
26+
27+ ...
28+ CPU A: spin_lock_irqsave(&dev_lock, flags)
29+ CPU A: val = readl(my_status);
30+ CPU A: ...
31+ CPU A: writel(newval, ring_ptr);
32+ CPU A: spin_unlock_irqrestore(&dev_lock, flags)
33+ ...
34+ CPU B: spin_lock_irqsave(&dev_lock, flags)
35+ CPU B: val = readl(my_status);
36+ CPU B: ...
37+ CPU B: writel(newval2, ring_ptr);
38+ CPU B: spin_unlock_irqrestore(&dev_lock, flags)
39+ ...
40+
41+上述例子中,设备可能会先接收到newval2的值,然后接收到newval的值,问题就
42+发生了。不过很容易通过下面方法来修复::
43+
44+ ...
45+ CPU A: spin_lock_irqsave(&dev_lock, flags)
46+ CPU A: val = readl(my_status);
47+ CPU A: ...
48+ CPU A: writel(newval, ring_ptr);
49+ CPU A: (void)readl(safe_register); /* 配置寄存器?*/
50+ CPU A: spin_unlock_irqrestore(&dev_lock, flags)
51+ ...
52+ CPU B: spin_lock_irqsave(&dev_lock, flags)
53+ CPU B: val = readl(my_status);
54+ CPU B: ...
55+ CPU B: writel(newval2, ring_ptr);
56+ CPU B: (void)readl(safe_register); /* 配置寄存器?*/
57+ CPU B: spin_unlock_irqrestore(&dev_lock, flags)
58+
59+在解决方案中,读取safe_register寄存器,触发IO芯片清刷未处理的写操作,
60+再处理后面的读操作,防止引发数据不一致问题。
Documentation/translations/zh_CN/index.rst+2−2
@@ -108,6 +108,7 @@ TODOList: · 107 unmodified lines
108108 :maxdepth: 2
109109
110110 core-api/index
111+ driver-api/index
111112 locking/index
112113 accounting/index
113114 cpu-freq/index
@@ -120,10 +121,10 @@ TODOList: · 6 unmodified lines
120121 scheduler/index
121122 mm/index
122123 peci/index
124+ PCI/index
123125
124126 TODOList:
125127
126−* driver-api/index
127128 * block/index
128129 * cdrom/index
129130 * ide/index
@@ -148,7 +149,6 @@ TODOList: · 18 unmodified lines
148149 * crypto/index
149150 * bpf/index
150151 * usb/index
151−* PCI/index
152152 * scsi/index
153153 * misc-devices/index
154154 * mhi/index
Documentation/translations/zh_CN/io_ordering.txt+0−67
@@ -1,67 +0,0 @@
1−Chinese translated version of Documentation/driver-api/io_ordering.rst
2−
3−If you have any comment or update to the content, please contact the
4−original document maintainer directly. However, if you have a problem
5−communicating in English you can also ask the Chinese maintainer for
6−help. Contact the Chinese maintainer if this translation is outdated
7−or if there is a problem with the translation.
8−
9−Chinese maintainer: Lin Yongting <linyongting@gmail.com>
10−---------------------------------------------------------------------
11−Documentation/driver-api/io_ordering.rst 的中文翻译
12−
13−如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
14−交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
15−译存在问题,请联系中文版维护者。
16−
17−中文版维护者: 林永听 Lin Yongting <linyongting@gmail.com>
18−中文版翻译者: 林永听 Lin Yongting <linyongting@gmail.com>
19−中文版校译者: 林永听 Lin Yongting <linyongting@gmail.com>
20−
21−
22−以下为正文
23−---------------------------------------------------------------------
24−
25−在某些平台上,所谓的内存映射I/O是弱顺序。在这些平台上,驱动开发者有责任
26−保证I/O内存映射地址的写操作按程序图意的顺序达到设备。通常读取一个“安全”
27−设备寄存器或桥寄存器,触发IO芯片清刷未处理的写操作到达设备后才处理读操作,
28−而达到保证目的。驱动程序通常在spinlock保护的临界区退出之前使用这种技术。
29−这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存
30−屏障操作,mb(),不过仅适用于I/O)。
31−
32−假设一个设备驱动程的具体例子:
33−
34− ...
35−CPU A: spin_lock_irqsave(&dev_lock, flags)
36−CPU A: val = readl(my_status);
37−CPU A: ...
38−CPU A: writel(newval, ring_ptr);
39−CPU A: spin_unlock_irqrestore(&dev_lock, flags)
40− ...
41−CPU B: spin_lock_irqsave(&dev_lock, flags)
42−CPU B: val = readl(my_status);
43−CPU B: ...
44−CPU B: writel(newval2, ring_ptr);
45−CPU B: spin_unlock_irqrestore(&dev_lock, flags)
46− ...
47−
48−上述例子中,设备可能会先接收到newval2的值,然后接收到newval的值,问题就
49−发生了。不过很容易通过下面方法来修复:
50−
51− ...
52−CPU A: spin_lock_irqsave(&dev_lock, flags)
53−CPU A: val = readl(my_status);
54−CPU A: ...
55−CPU A: writel(newval, ring_ptr);
56−CPU A: (void)readl(safe_register); /* 配置寄存器?*/
57−CPU A: spin_unlock_irqrestore(&dev_lock, flags)
58− ...
59−CPU B: spin_lock_irqsave(&dev_lock, flags)
60−CPU B: val = readl(my_status);
61−CPU B: ...
62−CPU B: writel(newval2, ring_ptr);
63−CPU B: (void)readl(safe_register); /* 配置寄存器?*/
64−CPU B: spin_unlock_irqrestore(&dev_lock, flags)
65−
66−在解决方案中,读取safe_register寄存器,触发IO芯片清刷未处理的写操作,
67−再处理后面的读操作,防止引发数据不一致问题。
Documentation/translations/zh_CN/oops-tracing.txt+0−212
@@ -1,212 +0,0 @@
1−Chinese translated version of Documentation/admin-guide/bug-hunting.rst
2−
3−If you have any comment or update to the content, please contact the
4−original document maintainer directly. However, if you have a problem
5−communicating in English you can also ask the Chinese maintainer for
6−help. Contact the Chinese maintainer if this translation is outdated
7−or if there is a problem with the translation.
8−
9−Chinese maintainer: Dave Young <hidave.darkstar@gmail.com>
10−---------------------------------------------------------------------
11−Documentation/admin-guide/bug-hunting.rst 的中文翻译
12−
13−如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
14−交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
15−译存在问题,请联系中文版维护者。
16−
17−中文版维护者: 杨瑞 Dave Young <hidave.darkstar@gmail.com>
18−中文版翻译者: 杨瑞 Dave Young <hidave.darkstar@gmail.com>
19−中文版校译者: 李阳 Li Yang <leoyang.li@nxp.com>
20− 王聪 Wang Cong <xiyou.wangcong@gmail.com>
21−
22−以下为正文
23−---------------------------------------------------------------------
24−
25−注意: ksymoops 在2.6中是没有用的。 请以原有格式使用Oops(来自dmesg,等等)。
26−忽略任何这样那样关于“解码Oops”或者“通过ksymoops运行”的文档。 如果你贴出运行过
27−ksymoops的来自2.6的Oops,人们只会让你重贴一次。
28−
29−快速总结
30−-------------
31−
32−发现Oops并发送给看似相关的内核领域的维护者。别太担心对不上号。如果你不确定就发给
33−和你所做的事情相关的代码的负责人。 如果可重现试着描述怎样重构。 那甚至比oops更有
34−价值。
35−
36−如果你对于发送给谁一无所知, 发给linux-kernel@vger.kernel.org。感谢你帮助Linux
37−尽可能地稳定。
38−
39−Oops在哪里?
40−----------------------
41−
42−通常Oops文本由klogd从内核缓冲区里读取并传给syslogd,由syslogd写到syslog文件中,
43−典型地是/var/log/messages(依赖于/etc/syslog.conf)。有时klogd崩溃了,这种情况下你
44−能够运行dmesg > file来从内核缓冲区中读取数据并保存下来。 否则你可以
45−cat /proc/kmsg > file, 然而你必须介入中止传输, kmsg是一个“永不结束的文件”。如
46−果机器崩溃坏到你不能输入命令或者磁盘不可用那么你有三种选择:-
47−
48−(1) 手抄屏幕上的文本待机器重启后再输入计算机。 麻烦但如果没有针对崩溃的准备,
49−这是仅有的选择。 另外,你可以用数码相机把屏幕拍下来-不太好,但比没有强。 如果信
50−息滚动到了终端的上面,你会发现以高分辩率启动(比如,vga=791)会让你读到更多的文
51−本。(注意:这需要vesafb,所以对‘早期’的oops没有帮助)
52−
53−(2)用串口终端启动(请参看Documentation/admin-guide/serial-console.rst),运行一个null
54−modem到另一台机器并用你喜欢的通讯工具获取输出。Minicom工作地很好。
55−
56−(3)使用Kdump(请参看Documentation/admin-guide/kdump/kdump.rst),
57−使用在Documentation/admin-guide/kdump/gdbmacros.txt中定义的dmesg gdb宏,从旧的内存中提取内核
58−环形缓冲区。
59−
60−完整信息
61−----------------
62−
63−注意:以下来自于Linus的邮件适用于2.4内核。 我因为历史原因保留了它,并且因为其中
64−一些信息仍然适用。 特别注意的是,请忽略任何ksymoops的引用。
65−
66−From: Linus Torvalds <torvalds@osdl.org>
67−
68−怎样跟踪Oops.. [原发到linux-kernel的一封邮件]
69−
70−主要的窍门是有五年和这些烦人的oops消息打交道的经验;-)
71−
72−实际上,你有办法使它更简单。我有两个不同的方法:
73−
74− gdb /usr/src/linux/vmlinux
75− gdb> disassemble <offending_function>
76−
77−那是发现问题的简单办法,至少如果bug报告做的好的情况下(象这个一样-运行ksymoops
78−得到oops发生的函数及函数内的偏移)。
79−
80−哦,如果报告发生的内核以相同的编译器和相似的配置编译它会有帮助的。
81−
82−另一件要做的事是反汇编bug报告的“Code”部分:ksymoops也会用正确的工具来做这件事,
83−但如果没有那些工具你可以写一个傻程序:
84−
85− char str[] = "\xXX\xXX\xXX...";
86− main(){}
87−
88−并用gcc -g编译它然后执行“disassemble str”(XX部分是由Oops报告的值-你可以仅剪切
89−粘贴并用“\x”替换空格-我就是这么做的,因为我懒得写程序自动做这一切)。
90−
91−另外,你可以用scripts/decodecode这个shell脚本。它的使用方法是:
92−decodecode < oops.txt
93−
94−“Code”之后的十六进制字节可能(在某些架构上)有一些当前指令之前的指令字节以及
95−当前和之后的指令字节
96−
97−Code: f9 0f 8d f9 00 00 00 8d 42 0c e8 dd 26 11 c7 a1 60 ea 2b f9 8b 50 08 a1
98−64 ea 2b f9 8d 34 82 8b 1e 85 db 74 6d 8b 15 60 ea 2b f9 <8b> 43 04 39 42 54
99−7e 04 40 89 42 54 8b 43 04 3b 05 00 f6 52 c0
100−
101−最后,如果你想知道代码来自哪里,你可以:
102−
103− cd /usr/src/linux
104− make fs/buffer.s # 或任何产生BUG的文件
105−
106−然后你会比gdb反汇编更清楚的知道发生了什么。
107−
108−现在,问题是把你所拥有的所有数据结合起来:C源码(关于它应该怎样的一般知识),
109−汇编代码及其反汇编得到的代码(另外还有从“oops”消息得到的寄存器状态-对了解毁坏的
110−指针有用,而且当你有了汇编代码你也能拿其它的寄存器和任何它们对应的C表达式做匹配
111−)。
112−
113−实际上,你仅需看看哪里不匹配(这个例子是“Code”反汇编和编译器生成的代码不匹配)。
114−然后你须要找出为什么不匹配。通常很简单-你看到代码使用了空指针然后你看代码想知道
115−空指针是怎么出现的,还有检查它是否合法..
116−
117−现在,如果明白这是一项耗时的工作而且需要一丁点儿的专心,没错。这就是我为什么大多
118−只是忽略那些没有符号表信息的崩溃报告的原因:简单的说太难查找了(我有一些
119−程序用于在内核代码段中搜索特定的模式,而且有时我也已经能找出那些崩溃的地方,但是
120−仅仅是找出正确的序列也确实需要相当扎实的内核知识)
121−
122−_有时_会发生这种情况,我仅看到崩溃中的反汇编代码序列, 然后我马上就明白问题出在
123−哪里。这时我才意识到自己干这个工作已经太长时间了;-)
124−
125− Linus
126−
127−
128−---------------------------------------------------------------------------
129−关于Oops跟踪的注解:
130−
131−为了帮助Linus和其它内核开发者,klogd纳入了大量的支持来处理保护错误。为了拥有对
132−地址解析的完整支持至少应该使用1.3-pl3的sysklogd包。
133−
134−当保护错误发生时,klogd守护进程自动把内核日志信息中的重要地址翻译成它们相应的符
135−号。
136−
137−klogd执行两种类型的地址解析。首先是静态翻译其次是动态翻译。静态翻译和ksymoops
138−一样使用System.map文件。为了做静态翻译klogd守护进程必须在初始化时能找到system
139−map文件。关于klogd怎样搜索map文件请参看klogd手册页。
140−
141−动态地址翻译在使用内核可装载模块时很重要。 因为内核模块的内存是从内核动态内存池
142−里分配的,所以不管是模块开始位置还是模块中函数和符号的位置都不是固定的。
143−
144−内核支持允许程序决定装载哪些模块和它们在内存中位置的系统调用。使用这些系统调用
145−klogd守护进程生成一张符号表用于调试发生在可装载模块中的保护错误。
146−
147−至少klogd会提供产生保护错误的模块名。还可有额外的符号信息供可装载模块开发者选择
148−以从模块中输出符号信息。
149−
150−因为内核模块环境可能是动态的,所以必须有一种机制当模块环境发生改变时来通知klogd
151−守护进程。 有一些可用的命令行选项允许klogd向当前执行中的守护进程发送信号,告知符
152−号信息应该被刷新了。 更多信息请参看klogd手册页。
153−
154−sysklogd发布时包含一个补丁修改了modules-2.0.0包,无论何时一个模块装载或者卸载都
155−会自动向klogd发送信号。打上这个补丁提供了必要的对调试发生于内核可装载模块的保护
156−错误的无缝支持。
157−
158−以下是被klogd处理过的发生在可装载模块中的一个保护错误例子:
159−---------------------------------------------------------------------------
160−Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc
161−Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000
162−Aug 29 09:51:01 blizard kernel: *pde = 00000000
163−Aug 29 09:51:01 blizard kernel: Oops: 0002
164−Aug 29 09:51:01 blizard kernel: CPU: 0
165−Aug 29 09:51:01 blizard kernel: EIP: 0010:[oops:_oops+16/3868]
166−Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212
167−Aug 29 09:51:01 blizard kernel: eax: 315e97cc ebx: 003a6f80 ecx: 001be77b edx: 00237c0c
168−Aug 29 09:51:01 blizard kernel: esi: 00000000 edi: bffffdb3 ebp: 00589f90 esp: 00589f8c
169−Aug 29 09:51:01 blizard kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
170−Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000)
171−Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001
172−Aug 29 09:51:01 blizard kernel: 00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00
173−Aug 29 09:51:01 blizard kernel: bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036
174−Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128]
175−Aug 29 09:51:01 blizard kernel: Code: c7 00 05 00 00 00 eb 08 90 90 90 90 90 90 90 90 89 ec 5d c3
176−---------------------------------------------------------------------------
177−
178−Dr. G.W. Wettstein Oncology Research Div. Computing Facility
179−Roger Maris Cancer Center INTERNET: greg@wind.rmcc.com
180−820 4th St. N.
181−Fargo, ND 58122
182−Phone: 701-234-7556
183−
184−
185−---------------------------------------------------------------------------
186−受污染的内核
187−
188−一些oops报告在程序记数器之后包含字符串'Tainted: '。这表明内核已经被一些东西给污
189−染了。 该字符串之后紧跟着一系列的位置敏感的字符,每个代表一个特定的污染值。
190−
191− 1:'G'如果所有装载的模块都有GPL或相容的许可证,'P'如果装载了任何的专有模块。
192−没有模块MODULE_LICENSE或者带有insmod认为是与GPL不相容的的MODULE_LICENSE的模块被
193−认定是专有的。
194−
195− 2:'F'如果有任何通过“insmod -f”被强制装载的模块,' '如果所有模块都被正常装载。
196−
197− 3:'S'如果oops发生在SMP内核中,运行于没有证明安全运行多处理器的硬件。 当前这种
198−情况仅限于几种不支持SMP的速龙处理器。
199−
200− 4:'R'如果模块通过“insmod -f”被强制装载,' '如果所有模块都被正常装载。
201−
202− 5:'M'如果任何处理器报告了机器检查异常,' '如果没有发生机器检查异常。
203−
204− 6:'B'如果页释放函数发现了一个错误的页引用或者一些非预期的页标志。
205−
206− 7:'U'如果用户或者用户应用程序特别请求设置污染标志,否则' '。
207−
208− 8:'D'如果内核刚刚死掉,比如有OOPS或者BUG。
209−
210−使用'Tainted: '字符串的主要原因是要告诉内核调试者,这是否是一个干净的内核亦或发
211−生了任何的不正常的事。污染是永久的:即使出错的模块已经被卸载了,污染值仍然存在,
212−以表明内核不再值得信任。
Documentation/translations/zh_CN/process/coding-style.rst+202−72
@@ -1,21 +1,23 @@
11 .. include:: ../disclaimer-zh_CN.rst
22
3−:Original: :ref:`Documentation/process/coding-style.rst <codingstyle>`
3+:Original: Documentation/process/coding-style.rst
44
55 .. _cn_codingstyle:
66
7−译者::
7+:译者:
8+ - 张乐 Zhang Le <r0bertz@gentoo.org>
9+ - Andy Deng <theandy.deng@gmail.com>
10+ - 吴想成 <bobwxc@email.cn>
811
9− 中文版维护者: 张乐 Zhang Le <r0bertz@gentoo.org>
10− 中文版翻译者: 张乐 Zhang Le <r0bertz@gentoo.org>
11− 中文版校译者: 王聪 Wang Cong <xiyou.wangcong@gmail.com>
12− wheelz <kernel.zeng@gmail.com>
13− 管旭东 Xudong Guan <xudong.guan@gmail.com>
14− Li Zefan <lizf@cn.fujitsu.com>
15− Wang Chen <wangchen@cn.fujitsu.com>
12+:校译:
13+ - 王聪 Wang Cong <xiyou.wangcong@gmail.com>
14+ - wheelz <kernel.zeng@gmail.com>
15+ - 管旭东 Xudong Guan <xudong.guan@gmail.com>
16+ - Li Zefan <lizf@cn.fujitsu.com>
17+ - Wang Chen <wangchen@cn.fujitsu.com>
1618
1719 Linux 内核代码风格
18−=========================
20+==================
1921
2022 这是一个简短的文档,描述了 linux 内核的首选代码风格。代码风格是因人而异的,
2123 而且我不愿意把自己的观点强加给任何人,但这就像我去做任何事情都必须遵循的原则
@@ -29,7 +31,7 @@ Linux 内核代码风格 · 7 unmodified lines
2931
3032
3133 1) 缩进
32−--------------
34+-------
3335
3436 制表符是 8 个字符,所以缩进也是 8 个字符。有些异端运动试图将缩进变为 4 (甚至
3537 2!) 字符深,这几乎相当于尝试将圆周率的值定义为 3。
@@ -73,6 +75,22 @@ Linux 内核代码风格 · 37 unmodified lines
7375 if (condition) do_this;
7476 do_something_everytime;
7577
78+不要使用逗号来避免使用大括号:
79+
80+.. code-block:: c
81+
82+ if (condition)
83+ do_this(), do_that();
84+
85+使用大括号包裹多语句:
86+
87+.. code-block:: c
88+
89+ if (condition) {
90+ do_this();
91+ do_that();
92+ }
93+
7694 也不要在一行里放多个赋值语句。内核代码风格超级简单。就是避免可能导致别人误读
7795 的表达式。
7896
@@ -83,20 +101,25 @@ Linux 内核代码风格 · 4 unmodified lines
83101
84102
85103 2) 把长的行和字符串打散
86−------------------------------
104+-----------------------
87105
88106 代码风格的意义就在于使用平常使用的工具来维持代码的可读性和可维护性。
89107
90108 每一行的长度的限制是 80 列,我们强烈建议您遵守这个惯例。
91109
92110 长于 80 列的语句要打散成有意义的片段。除非超过 80 列能显著增加可读性,并且不
93−会隐藏信息。子片段要明显短于母片段,并明显靠右。这同样适用于有着很长参数列表
94−的函数头。然而,绝对不要打散对用户可见的字符串,例如 printk 信息,因为这样就
111+会隐藏信息。
112+
113+子片段要明显短于母片段,并明显靠右。一种非常常用的样式是将子体与函数左括号对齐。
114+
115+这同样适用于有着很长参数列表的函数头。
116+
117+然而,绝对不要打散对用户可见的字符串,例如 printk 信息,因为这样就
95118 很难对它们 grep。
96119
97120
98121 3) 大括号和空格的放置
99−------------------------------
122+---------------------
100123
101124 C 语言风格中另外一个常见问题是大括号的放置。和缩进大小不同,选择或弃用某种放
102125 置策略并没有多少技术上的原因,不过首选的方式,就像 Kernighan 和 Ritchie 展示
@@ -132,12 +155,12 @@ C 语言风格中另外一个常见问题是大括号的放置。和缩进大小 · 29 unmodified lines
132155 body of function
133156 }
134157
135−全世界的异端可能会抱怨这个不一致性是... 呃... 不一致的,不过所有思维健全的人
158+全世界的异端可能会抱怨这个不一致性是……呃……不一致,不过所有思维健全的人
136159 都知道 (a) K&R 是 **正确的** 并且 (b) K&R 是正确的。此外,不管怎样函数都是特
137160 殊的 (C 函数是不能嵌套的)。
138161
139162 注意结束大括号独自占据一行,除非它后面跟着同一个语句的剩余部分,也就是 do 语
140−句中的 "while" 或者 if 语句中的 "else",像这样:
163+句中的 ``while`` 或者 if 语句中的 ``else`` ,像这样:
141164
142165 .. code-block:: c
143166
@@ -191,7 +214,7 @@ C 语言风格中另外一个常见问题是大括号的放置。和缩进大小 · 47 unmodified lines
191214 }
192215
193216 3.1) 空格
194−********************
217+*********
195218
196219 Linux 内核的空格使用方式 (主要) 取决于它是用于函数还是关键字。(大多数) 关键字
197220 后要加一个空格。值得注意的例外是 sizeof, typeof, alignof 和 __attribute__,这
@@ -254,7 +277,7 @@ Linux 内核的空格使用方式 (主要) 取决于它是用于函数还是关 · 56 unmodified lines
254277
255278
256279 4) 命名
257−------------------------------
280+-------
258281
259282 C 是一个简朴的语言,你的命名也应该这样。和 Modula-2 和 Pascal 程序员不同,
260283 C 程序员不使用类似 ThisVariableIsATemporaryCounter 这样华丽的名字。C 程序员会
@@ -275,11 +298,31 @@ C 程序员不使用类似 ThisVariableIsATemporaryCounter 这样华丽的名字 · 14 unmodified lines
275298 可能的话。类似的, ``tmp`` 可以用来称呼任意类型的临时变量。
276299
277300 如果你怕混淆了你的本地变量名,你就遇到另一个问题了,叫做函数增长荷尔蒙失衡综
278−合症。请看第六章 (函数)。
301+合征。请看第六章 (函数)。
279302
303+对于符号名称和文档,避免引入新的“master/slave”(或独立于“master”的“slave”)
304+和“blacklist/whitelist”。
305+
306+“master/slave”推荐替换为:
307+ '{primary,main} / {secondary,replica,subordinate}'
308+ '{initiator,requester} / {target,responder}'
309+ '{controller,host} / {device,worker,proxy}'
310+ 'leader/follower'
311+ 'director/performer'
312+
313+“blacklist/whitelist”推荐替换为:
314+ 'denylist/allowlist'
315+ 'blocklist/passlist'
316+
317+引入新用法的例外情况是:维护用户空间ABI/API,或更新现有(截至2020年)硬件或
318+协议规范的代码时要求这些术语。对于新规范,尽可能将术语的规范用法转换为内核
319+编码标准。
320+
321+.. warning::
322+ 以上主从、黑白名单规则不适用于中文文档,请勿更改中文术语!
280323
281324 5) Typedef
282−-----------
325+----------
283326
284327 不要使用类似 ``vps_t`` 之类的东西。
285328
@@ -308,7 +351,7 @@ C 程序员不使用类似 ThisVariableIsATemporaryCounter 这样华丽的名字 · 22 unmodified lines
308351
309352 .. note::
310353
311− 不透明性和 "访问函数" 本身是不好的。我们使用 pte_t 等类型的原因在于真
354+ 不透明性和“访问函数”本身是不好的。我们使用 pte_t 等类型的原因在于真
312355 的是完全没有任何共用的可访问信息。
313356
314357 (b) 清楚的整数类型,如此,这层抽象就可以 **帮助** 消除到底是 ``int`` 还是
@@ -353,7 +396,7 @@ C 程序员不使用类似 ThisVariableIsATemporaryCounter 这样华丽的名字 · 38 unmodified lines
353396
354397
355398 6) 函数
356−------------------------------
399+-------
357400
358401 函数应该简短而漂亮,并且只完成一件事情。函数应该可以一屏或者两屏显示完 (我们
359402 都知道 ISO/ANSI 屏幕大小是 80x24),只做一件事情,而且把它做好。
@@ -383,12 +426,46 @@ C 程序员不使用类似 ThisVariableIsATemporaryCounter 这样华丽的名字 · 23 unmodified lines
383426 }
384427 EXPORT_SYMBOL(system_is_up);
385428
386−在函数原型中,包含函数名和它们的数据类型。虽然 C 语言里没有这样的要求,在
429+6.1) 函数原型
430+*************
431+
432+在函数原型中包含参数名和它们的数据类型。虽然 C 语言里没有这样的要求,但在
387433 Linux 里这是提倡的做法,因为这样可以很简单的给读者提供更多的有价值的信息。
388434
435+不要在函数声明里使用 ``extern`` 关键字,因为这会导致代码行变长,并且不是严格
436+必需的。
437+
438+写函数原型时,请保持 `元素顺序规则 <https://lore.kernel.org/mm-commits/CAHk-=wiOCLRny5aifWNhr621kYrJwhfURsa0vFPeUEm8mF0ufg@mail.gmail.com/>`_ 。
439+例如下列函数声明::
440+
441+ __init void * __must_check action(enum magic value, size_t size, u8 count,
442+ char *fmt, ...) __printf(4, 5) __malloc;
443+
444+推荐的函数原型元素顺序是:
445+
446+- 储存类型(下方的 ``static __always_inline`` ,注意 ``__always_inline``
447+ 技术上来讲是个属性但被当做 ``inline`` )
448+- 储存类型属性(上方的 ``__init`` ——即节声明,但也像 ``__cold`` )
449+- 返回类型(上方的 ``void *`` )
450+- 返回类型属性(上方的 ``__must_check`` )
451+- 函数名(上方的 ``action`` )
452+- 函数参数(上方的 ``(enum magic value, size_t size, u8 count, char *fmt, ...)`` ,
453+ 注意必须写上参数名)
454+- 函数参数属性(上方的 ``__printf(4, 5)`` )
455+- 函数行为属性(上方的 ``__malloc`` )
456+
457+请注意,对于函数 **定义** (即实际函数体),编译器不允许在函数参数之后添加函
458+数参数属性。在这种情况下,它们应该跟随存储类型属性(例如,与上面的 **声明**
459+示例相比,请注意下面的 ``__printf(4, 5)`` 的位置发生了变化)::
460+
461+ static __always_inline __init __printf(4, 5) void * __must_check action(enum magic value,
462+ size_t size, u8 count, char *fmt, ...) __malloc
463+ {
464+ ...
465+ }
389466
390467 7) 集中的函数退出途径
391−------------------------------
468+---------------------
392469
393470 虽然被某些人声称已经过时,但是 goto 语句的等价物还是经常被编译器所使用,具体
394471 形式是无条件跳转指令。
@@ -432,7 +509,7 @@ Linux 里这是提倡的做法,因为这样可以很简单的给读者提供 · 37 unmodified lines
432509 return result;
433510 }
434511
435−一个需要注意的常见错误是 ``一个 err 错误`` ,就像这样:
512+一个需要注意的常见错误是 ``单 err 错误`` ,就像这样:
436513
437514 .. code-block:: c
438515
@@ -456,19 +533,19 @@ Linux 里这是提倡的做法,因为这样可以很简单的给读者提供 · 17 unmodified lines
456533
457534
458535 8) 注释
459−------------------------------
536+-------
460537
461538 注释是好的,不过有过度注释的危险。永远不要在注释里解释你的代码是如何运作的:
462539 更好的做法是让别人一看你的代码就可以明白,解释写的很差的代码是浪费时间。
463540
464−一般的,你想要你的注释告诉别人你的代码做了什么,而不是怎么做的。也请你不要把
541+一般来说你用注释告诉别人你的代码做了什么,而不是怎么做的。也请你不要把
465542 注释放在一个函数体内部:如果函数复杂到你需要独立的注释其中的一部分,你很可能
466543 需要回到第六章看一看。你可以做一些小注释来注明或警告某些很聪明 (或者槽糕) 的
467544 做法,但不要加太多。你应该做的,是把注释放在函数的头部,告诉人们它做了什么,
468545 也可以加上它做这些事情的原因。
469546
470−当注释内核 API 函数时,请使用 kernel-doc 格式。请看
471−Documentation/doc-guide/ 和 scripts/kernel-doc 以获得详细信息。
547+当注释内核 API 函数时,请使用 kernel-doc 格式。详见
548+Documentation/translations/zh_CN/doc-guide/index.rst 和 scripts/kernel-doc 。
472549
473550 长 (多行) 注释的首选风格是:
474551
@@ -500,17 +577,18 @@ Documentation/doc-guide/ 和 scripts/kernel-doc 以获得详细信息。 · 25 unmodified lines
500577
501578
502579 9) 你已经把事情弄糟了
503−------------------------------
580+---------------------
504581
505−这没什么,我们都是这样。可能你的使用了很长时间 Unix 的朋友已经告诉你
582+这没什么,我们都是这样。可能你长期使用 Unix 的朋友已经告诉你
506583 ``GNU emacs`` 能自动帮你格式化 C 源代码,而且你也注意到了,确实是这样,不过它
507584 所使用的默认值和我们想要的相去甚远 (实际上,甚至比随机打的还要差——无数个猴子
508−在 GNU emacs 里打字永远不会创造出一个好程序) (译注:Infinite Monkey Theorem)
585+在 GNU emacs 里打字永远不会创造出一个好程序)
586+*(译注:Infinite Monkey Theorem)*
509587
510588 所以你要么放弃 GNU emacs,要么改变它让它使用更合理的设定。要采用后一个方案,
511589 你可以把下面这段粘贴到你的 .emacs 文件里。
512590
513−.. code-block:: none
591+.. code-block:: elisp
514592
515593 (defun c-lineup-arglist-tabs-only (ignored)
516594 "Line up argument lists by tabs, not spaces"
@@ -529,7 +607,7 @@ Documentation/doc-guide/ 和 scripts/kernel-doc 以获得详细信息。 · 12 unmodified lines
529607 (c-offsets-alist . (
530608 (arglist-close . c-lineup-arglist-tabs-only)
531609 (arglist-cont-nonempty .
532− (c-lineup-gcc-asm-reg c-lineup-arglist-tabs-only))
610+ (c-lineup-gcc-asm-reg c-lineup-arglist-tabs-only))
533611 (arglist-intro . +)
534612 (brace-list-intro . +)
535613 (c . c-lineup-C-comments)
@@ -573,9 +651,14 @@ Documentation/doc-guide/ 和 scripts/kernel-doc 以获得详细信息。 · 37 unmodified lines
573651 ``indent`` 有很多选项,特别是重新格式化注释的时候,你可能需要看一下它的手册。
574652 不过记住: ``indent`` 不能修正坏的编程习惯。
575653
654+请注意,您还可以使用 ``clang-format`` 工具帮助您处理这些规则,快速自动重新格
655+式化部分代码,并审阅整个文件以发现代码风格错误、打字错误和可能的改进。它还可
656+以方便地排序 ``#include`` ,对齐变量/宏,重排文本和其他类似任务。
657+详见 Documentation/process/clang-format.rst 。
658+
576659
577660 10) Kconfig 配置文件
578−------------------------------
661+--------------------
579662
580663 对于遍布源码树的所有 Kconfig* 配置文件来说,它们缩进方式有所不同。紧挨着
581664 ``config`` 定义的行,用一个制表符缩进,然而 help 信息的缩进则额外增加 2 个空
@@ -598,11 +681,11 @@ Documentation/doc-guide/ 和 scripts/kernel-doc 以获得详细信息。 · 16 unmodified lines
598681 depends on ADFS_FS
599682 ...
600683
601−要查看配置文件的完整文档,请看 Documentation/kbuild/kconfig-language.rst。
684+要查看配置文件的完整文档,请看 Documentation/kbuild/kconfig-language.rst 。
602685
603686
604687 11) 数据结构
605−------------------------------
688+------------
606689
607690 如果一个数据结构,在创建和销毁它的单线执行环境之外可见,那么它必须要有一个引
608691 用计数器。内核里没有垃圾收集 (并且内核之外的垃圾收集慢且效率低下),这意味着你
@@ -626,7 +709,7 @@ mm_count),和文件系统 (``struct super_block``: s_count 和 s_active) 中 · 17 unmodified lines
626709
627710
628711 12) 宏,枚举和RTL
629−------------------------------
712+-----------------
630713
631714 用于定义常量的宏的名字及枚举里的标签需要大写。
632715
@@ -638,7 +721,7 @@ mm_count),和文件系统 (``struct super_block``: s_count 和 s_active) 中 · 5 unmodified lines
638721
639722 宏的名字请用大写字母,不过形如函数的宏的名字可以用小写字母。
640723
641−一般的,如果能写成内联函数就不要写成像函数的宏。
724+通常如果能写成内联函数就不要写成像函数的宏。
642725
643726 含有多个语句的宏应该被包含在一个 do-while 代码块里:
644727
@@ -696,18 +779,18 @@ mm_count),和文件系统 (``struct super_block``: s_count 和 s_active) 中 · 51 unmodified lines
696779 (ret); \
697780 })
698781
699−ret 是本地变量的通用名字 - __foo_ret 更不容易与一个已存在的变量冲突。
782+ret 是本地变量的通用名字—— __foo_ret 更不容易与一个已存在的变量冲突。
700783
701784 cpp 手册对宏的讲解很详细。gcc internals 手册也详细讲解了 RTL,内核里的汇编语
702785 言经常用到它。
703786
704787
705788 13) 打印内核消息
706−------------------------------
789+----------------
707790
708−内核开发者应该是受过良好教育的。请一定注意内核信息的拼写,以给人以好的印象。
791+内核开发者应该看起来有文化。请一定注意内核信息的拼写,以给人良好的印象。
709792 不要用不规范的单词比如 ``dont``,而要用 ``do not`` 或者 ``don't`` 。保证这些信
710−息简单明了,无歧义。
793+息简单明了、无歧义。
711794
712795 内核信息不必以英文句号结束。
713796
@@ -724,17 +807,18 @@ dev_info() 等等。对于那些不和某个特定设备相关连的信息,<li · 10 unmodified lines
724807 或设定了 CONFIG_DYNAMIC_DEBUG。实际这同样是为了 dev_dbg(),一个相关约定是在一
725808 个已经开启了 DEBUG 时,使用 VERBOSE_DEBUG 来添加 dev_vdbg()。
726809
727−许多子系统拥有 Kconfig 调试选项来开启 -DDEBUG 在对应的 Makefile 里面;在其他
810+许多子系统拥有 Kconfig 调试选项来开启对应 Makefile 里面的 -DDEBUG;在其他
728811 情况下,特殊文件使用 #define DEBUG。当一条调试信息需要被无条件打印时,例如,
729812 如果已经包含一个调试相关的 #ifdef 条件,printk(KERN_DEBUG ...) 就可被使用。
730813
731814
732815 14) 分配内存
733−------------------------------
816+------------
734817
735818 内核提供了下面的一般用途的内存分配函数:
736819 kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc() 和 vzalloc()。
737−请参考 API 文档以获取有关它们的详细信息。
820+请参考 API 文档以获取有关它们的详细信息:
821+Documentation/translations/zh_CN/core-api/memory-allocation.rst 。
738822
739823 传递结构体大小的首选形式是这样的:
740824
@@ -761,11 +845,13 @@ kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc() 和 vzalloc()。 · 20 unmodified lines
761845
762846 p = kcalloc(n, sizeof(...), ...);
763847
764−两种形式检查分配大小 n * sizeof(...) 的溢出,如果溢出返回 NULL。
848+两种形式都会检查分配 n * sizeof(...) 大小时内存的溢出,如果溢出返回 NULL。
765849
850+在没有 __GFP_NOWARN 的情况下使用时,这些通用分配函数都会在失败时发起堆栈转储,
851+因此当返回NULL时,没有必要发出额外的失败消息。
766852
767853 15) 内联弊病
768−------------------------------
854+------------
769855
770856 有一个常见的误解是 ``内联`` 是 gcc 提供的可以让代码运行更快的一个选项。虽然使
771857 用内联函数有时候是恰当的 (比如作为一种替代宏的方式,请看第十二章),不过很多情
@@ -786,7 +872,7 @@ inline gcc 也可以自动使其内联。而且其他用户可能会要求移除 · 14 unmodified lines
786872
787873
788874 16) 函数返回值及命名
789−------------------------------
875+--------------------
790876
791877 函数可以返回多种不同类型的值,最常见的一种是表明函数执行成功或者失败的值。这样
792878 的一个值可以表示为一个错误代码整数 (-Exxx=失败,0=成功) 或者一个 ``成功``
@@ -797,7 +883,7 @@ inline gcc 也可以自动使其内联。而且其他用户可能会要求移除 · 4 unmodified lines
797883 产生这种 bug,请遵循下面的惯例::
798884
799885 如果函数的名字是一个动作或者强制性的命令,那么这个函数应该返回错误代
800− 码整数。如果是一个判断,那么函数应该返回一个 "成功" 布尔值。
886+ 码整数。如果是一个判断,那么函数应该返回一个“成功”布尔值。
801887
802888 比如, ``add work`` 是一个命令,所以 add_work() 在成功时返回 0,在失败时返回
803889 -EBUSY。类似的,因为 ``PCI device present`` 是一个判断,所以 pci_dev_present()
@@ -806,13 +892,35 @@ inline gcc 也可以自动使其内联。而且其他用户可能会要求移除 · 2 unmodified lines
806892 所有 EXPORTed 函数都必须遵守这个惯例,所有的公共函数也都应该如此。私有
807893 (static) 函数不需要如此,但是我们也推荐这样做。
808894
809−返回值是实际计算结果而不是计算是否成功的标志的函数不受此惯例的限制。一般的,
895+返回值是实际计算结果而不是计算是否成功的标志的函数不受此惯例的限制。通常
810896 他们通过返回一些正常值范围之外的结果来表示出错。典型的例子是返回指针的函数,
811897 他们使用 NULL 或者 ERR_PTR 机制来报告错误。
812898
899+17) 使用布尔类型
900+----------------
901+
902+Linux内核布尔(bool)类型是C99 _Bool类型的别名。布尔值只能为0或1,而对布尔的
903+隐式或显式转换将自动将值转换为true或false。在使用布尔类型时 **不需要** 构造,
904+它会消除一类错误。
905+
906+使用布尔值时,应使用true和false定义,而不是1和0。
813907
814−17) 不要重新发明内核宏
815−------------------------------
908+布尔函数返回类型和堆栈变量总是可以在适当的时候使用。鼓励使用布尔来提高可读性,
909+并且布尔值在存储时通常比“int”更好。
910+
911+如果缓存行布局或值的大小很重要,请不要使用布尔,因为其大小和对齐方式根据编译
912+的体系结构而不同。针对对齐和大小进行优化的结构体不应使用布尔。
913+
914+如果一个结构体有多个true/false值,请考虑将它们合并为具有1比特成员的位域,或使
915+用适当的固定宽度类型,如u8。
916+
917+类似地,对于函数参数,多个true/false值可以合并为单个按位的“标志”参数,如果调
918+用点具有裸true/false常量,“标志”参数通常是更具可读性的替代方法。
919+
920+总之,在结构体和参数中有限地使用布尔可以提高可读性。
921+
922+18) 不要重新发明内核宏
923+----------------------
816924
817925 头文件 include/linux/kernel.h 包含了一些宏,你应该使用它们,而不要自己写一些
818926 它们的变种。比如,如果你需要计算一个数组的长度,使用这个宏
@@ -832,11 +940,11 @@ inline gcc 也可以自动使其内联。而且其他用户可能会要求移除 · 13 unmodified lines
832940 在你的代码里自己重新定义。
833941
834942
835−18) 编辑器模式行和其他需要罗嗦的事情
836−--------------------------------------------------
943+19) 编辑器模式行和其他需要罗嗦的事情
944+------------------------------------
837945
838946 有一些编辑器可以解释嵌入在源文件里的由一些特殊标记标明的配置信息。比如,emacs
839−能够解释被标记成这样的行:
947+能够解析被标记成这样的行:
840948
841949 .. code-block:: c
842950
@@ -852,7 +960,7 @@ inline gcc 也可以自动使其内联。而且其他用户可能会要求移除 · 9 unmodified lines
852960 End:
853961 */
854962
855−Vim 能够解释这样的标记:
963+Vim 能够解析这样的标记:
856964
857965 .. code-block:: c
858966
@@ -863,8 +971,8 @@ Vim 能够解释这样的标记: · 4 unmodified lines
863971 的模式,或者使用其他可以产生正确的缩进的巧妙方法。
864972
865973
866−19) 内联汇编
867−------------------------------
974+20) 内联汇编
975+------------
868976
869977 在特定架构的代码中,你可能需要内联汇编与 CPU 和平台相关功能连接。需要这么做时
870978 就不要犹豫。然而,当 C 可以完成工作时,不要平白无故地使用内联汇编。在可能的情
@@ -880,8 +988,8 @@ Vim 能够解释这样的标记: · 9 unmodified lines
880988 移除了。你不必总是这样做,尽管,这不必要的举动会限制优化。
881989
882990 在写一个包含多条指令的单个内联汇编语句时,把每条指令用引号分割而且各占一行,
883−除了最后一条指令外,在每个指令结尾加上 \n\t,让汇编输出时可以正确地缩进下一条
884−指令:
991+除了最后一条指令外,在每个指令结尾加上 ``\n\t`` ,让汇编输出时可以正确地缩进
992+下一条指令:
885993
886994 .. code-block:: c
887995
@@ -890,10 +998,10 @@ Vim 能够解释这样的标记: · 2 unmodified lines
890998 : /* outputs */ : /* inputs */ : /* clobbers */);
891999
8921000
893−20) 条件编译
894−------------------------------
1001+21) 条件编译
1002+------------
8951003
896−只要可能,就不要在 .c 文件里面使用预处理条件 (#if, #ifdef);这样做让代码更难
1004+只要可能,就不要在 .c 文件里面使用预处理条件 (#if, #ifdef);这样做会让代码更难
8971005 阅读并且更难去跟踪逻辑。替代方案是,在头文件中用预处理条件提供给那些 .c 文件
8981006 使用,再给 #else 提供一个空桩 (no-op stub) 版本,然后在 .c 文件内无条件地调用
8991007 那些 (定义在头文件内的) 函数。这样做,编译器会避免为桩函数 (stub) 的调用生成
@@ -904,8 +1012,8 @@ Vim 能够解释这样的标记: · 4 unmodified lines
9041012 条件到这个辅助函数内。
9051013
9061014 如果你有一个在特定配置中,可能变成未使用的函数或变量,编译器会警告它定义了但
907−未使用,把它标记为 __maybe_unused 而不是将它包含在一个预处理条件中。(然而,如
908−果一个函数或变量总是未使用,就直接删除它。)
1015+未使用,请把它标记为 __maybe_unused 而不是将它包含在一个预处理条件中。(然而,
1016+如果一个函数或变量总是未使用,就直接删除它。)
9091017
9101018 在代码中,尽可能地使用 IS_ENABLED 宏来转化某个 Kconfig 标记为 C 的布尔
9111019 表达式,并在一般的 C 条件中使用它:
@@ -931,23 +1039,45 @@ Vim 能够解释这样的标记: · 19 unmodified lines
9311039 #endif /* CONFIG_SOMETHING */
9321040
9331041
934−附录 I) 参考
935−-------------------
1042+附录 I) 参考资料
1043+----------------
9361044
937−The C Programming Language, 第二版
1045+The C Programming Language, 2nd Edition
9381046 作者:Brian W. Kernighan 和 Denni M. Ritchie.
9391047 Prentice Hall, Inc., 1988.
940−ISBN 0-13-110362-8 (软皮), 0-13-110370-9 (硬皮).
1048+ISBN 0-13-110362-8 (平装), 0-13-110370-9 (精装).
1049+
1050+.. note::
1051+
1052+ 《C程序设计语言(第2版)》
1053+ 作者:[美] Brian W. Kernighan / [美] Dennis M. Ritchie
1054+ 译者:徐宝文 / 李志 / 尤晋元(审校)
1055+ 出版社:机械工业出版社,2019
1056+ ISBN:9787111617945
9411057
9421058 The Practice of Programming
9431059 作者:Brian W. Kernighan 和 Rob Pike.
9441060 Addison-Wesley, Inc., 1999.
9451061 ISBN 0-201-61586-X.
9461062
1063+.. note::
1064+
1065+ 《程序设计实践》
1066+ 作者:[美] Brian W. Kernighan / [美] Rob Pike
1067+ 出版社:机械工业出版社,2005
1068+ ISBN:9787111091578
1069+
1070+ 《程序设计实践》
1071+ 作者:[美] Brian W. Kernighan / Rob Pike
1072+ 译者:裘宗燕
1073+ 出版社:机械工业出版社,2000
1074+ ISBN:9787111075738
1075+
9471076 GNU 手册 - 遵循 K&R 标准和此文本 - cpp, gcc, gcc internals and indent,
9481077 都可以从 https://www.gnu.org/manual/ 找到
9491078
9501079 WG14 是 C 语言的国际标准化工作组,URL: http://www.open-std.org/JTC1/SC22/WG14/
9511080
952−Kernel process/coding-style.rst,作者 greg@kroah.com 发表于 OLS 2002:
1081+内核文档 Documentation/process/coding-style.rst,
1082+作者 greg@kroah.com 发表于 OLS 2002:
9531083 http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/
Documentation/translations/zh_CN/process/email-clients.rst+172−93
@@ -1,17 +1,20 @@
1−.. _cn_email_clients:
1+.. SPDX-License-Identifier: GPL-2.0-or-later
22
33 .. include:: ../disclaimer-zh_CN.rst
44
5−:Original: :ref:`Documentation/process/email-clients.rst <email_clients>`
5+.. _cn_email_clients:
66
7−译者::
7+:Original: Documentation/process/email-clients.rst
88
9− 中文版维护者: 贾威威 Harry Wei <harryxiyou@gmail.com>
10− 中文版翻译者: 贾威威 Harry Wei <harryxiyou@gmail.com>
11− 时奎亮 Alex Shi <alex.shi@linux.alibaba.com>
12− 中文版校译者: Yinglin Luan <synmyth@gmail.com>
13− Xiaochen Wang <wangxiaochen0@gmail.com>
14− yaxinsn <yaxinsn@163.com>
9+:译者:
10+ - 贾威威 Harry Wei <harryxiyou@gmail.com>
11+ - 时奎亮 Alex Shi <alexs@kernel.org>
12+ - 吴想成 Wu XiangCheng <bobwxc@email.cn>
13+
14+:校译:
15+ - Yinglin Luan <synmyth@gmail.com>
16+ - Xiaochen Wang <wangxiaochen0@gmail.com>
17+ - yaxinsn <yaxinsn@163.com>
1518
1619 Linux邮件客户端配置信息
1720 =======================
@@ -27,12 +30,17 @@ Git · 9 unmodified lines
2730 改日志。如果工作正常,再将补丁发送到相应的邮件列表。
2831
2932
30−普通配置
33+通用配置
3134 --------
35+
3236 Linux内核补丁是通过邮件被提交的,最好把补丁作为邮件体的内嵌文本。有些维护者
3337 接收附件,但是附件的内容格式应该是"text/plain"。然而,附件一般是不赞成的,
3438 因为这会使补丁的引用部分在评论过程中变的很困难。
3539
40+同时也强烈建议在补丁或其他邮件的正文中使用纯文本格式。https://useplaintext.email
41+有助于了解如何配置你喜欢的邮件客户端,并在您还没有首选的情况下列出一些推荐的
42+客户端。
43+
3644 用来发送Linux内核补丁的邮件客户端在发送补丁时应该处于文本的原始状态。例如,
3745 他们不能改变或者删除制表符或者空格,甚至是在每一行的开头或者结尾。
3846
@@ -40,17 +48,17 @@ Linux内核补丁是通过邮件被提交的,最好把补丁作为邮件体的 · 1 unmodified line
4048
4149 不要让你的邮件客户端进行自动换行。这样也会破坏你的补丁。
4250
43−邮件客户端不能改变文本的字符集编码方式。要发送的补丁只能是ASCII或者UTF-8编码方式,
44−如果你使用UTF-8编码方式发送邮件,那么你将会避免一些可能发生的字符集问题。
51+邮件客户端不能改变文本的字符集编码方式。要发送的补丁只能是ASCII或者UTF-8编码
52+方式,如果你使用UTF-8编码方式发送邮件,那么你将会避免一些可能发生的字符集问题。
4553
46−邮件客户端应该形成并且保持 References: 或者 In-Reply-To: 标题,那么
47−邮件话题就不会中断。
54+邮件客户端应该生成并且保持“References:”或者“In-Reply-To:”邮件头,这样邮件会话
55+就不会中断。
4856
49−复制粘帖(或者剪贴粘帖)通常不能用于补丁,因为制表符会转换为空格。使用xclipboard, xclip
50−或者xcutsel也许可以,但是最好测试一下或者避免使用复制粘帖。
57+复制粘帖(或者剪贴粘帖)通常不能用于补丁,因为制表符会转换为空格。使用xclipboard,
58+xclip或者xcutsel也许可以,但是最好测试一下或者避免使用复制粘帖。
5159
52−不要在使用PGP/GPG署名的邮件中包含补丁。这样会使得很多脚本不能读取和适用于你的补丁。
53−(这个问题应该是可以修复的)
60+不要在使用PGP/GPG签名的邮件中包含补丁。这样会使得很多脚本不能读取和适用于你的
61+补丁。(这个问题应该是可以修复的)
5462
5563 在给内核邮件列表发送补丁之前,给自己发送一个补丁是个不错的主意,保存接收到的
5664 邮件,将补丁用'patch'命令打上,如果成功了,再给内核邮件列表发送。
@@ -58,98 +66,133 @@ Linux内核补丁是通过邮件被提交的,最好把补丁作为邮件体的 · 1 unmodified line
5866
5967 一些邮件客户端提示
6068 ------------------
69+
6170 这里给出一些详细的MUA配置提示,可以用于给Linux内核发送补丁。这些并不意味是
6271 所有的软件包配置总结。
6372
6473 说明:
65−TUI = 以文本为基础的用户接口
66−GUI = 图形界面用户接口
74+
75+- TUI = 以文本为基础的用户接口
76+- GUI = 图形界面用户接口
6777
6878 Alpine (TUI)
69−~~~~~~~~~~~~
79+************
7080
7181 配置选项:
72−在"Sending Preferences"部分:
7382
74−- "Do Not Send Flowed Text"必须开启
75−- "Strip Whitespace Before Sending"必须关闭
83+在 :menuselection:`Sending Preferences` 菜单:
84+
85+- :menuselection:`Do Not Send Flowed Text` 必须开启
86+- :menuselection:`Strip Whitespace Before Sending` 必须关闭
87+
88+当写邮件时,光标应该放在补丁会出现的地方,然后按下 :kbd:`CTRL-R` 组合键,使指
89+定的补丁文件嵌入到邮件中。
90+
91+Claws Mail (GUI)
92+****************
93+
94+可以用,有人用它成功地发过补丁。
7695
77−当写邮件时,光标应该放在补丁会出现的地方,然后按下CTRL-R组合键,使指定的
78−补丁文件嵌入到邮件中。
96+用 :menuselection:`Message-->Insert File` (:kbd:`CTRL-I`) 或外置编辑器插入补丁。
97+
98+若要在Claws编辑窗口重修改插入的补丁,需关闭
99+:menuselection:`Configuration-->Preferences-->Compose-->Wrapping`
100+的 `Auto wrapping` 。
79101
80102 Evolution (GUI)
81−~~~~~~~~~~~~~~~
103+***************
82104
83−一些开发者成功的使用它发送补丁
105+一些开发者成功的使用它发送补丁。
84106
85−当选择邮件选项:Preformat
86− 从Format->Heading->Preformatted (Ctrl-7)或者工具栏
107+撰写邮件时:
108+从 :menuselection:`格式-->段落样式-->预格式化` (:kbd:`CTRL-7`)
109+或工具栏选择 :menuselection:`预格式化` ;
87110
88111 然后使用:
89− Insert->Text File... (Alt-n x)插入补丁文件。
112+:menuselection:`插入-->文本文件...` (:kbd:`ALT-N x`) 插入补丁文件。
90113
91−你还可以"diff -Nru old.c new.c | xclip",选择Preformat,然后使用中间键进行粘帖。
114+你还可以 ``diff -Nru old.c new.c | xclip`` ,选择 :menuselection:`预格式化` ,
115+然后使用鼠标中键进行粘帖。
92116
93117 Kmail (GUI)
94−~~~~~~~~~~~
118+***********
95119
96120 一些开发者成功的使用它发送补丁。
97121
98−默认设置不为HTML格式是合适的;不要启用它。
122+默认撰写设置禁用HTML格式是合适的;不要启用它。
99123
100−当书写一封邮件的时候,在选项下面不要选择自动换行。唯一的缺点就是你在邮件中输入的任何文本
101−都不会被自动换行,因此你必须在发送补丁之前手动换行。最简单的方法就是启用自动换行来书写邮件,
102−然后把它保存为草稿。一旦你在草稿中再次打开它,它已经全部自动换行了,那么你的邮件虽然没有
103−选择自动换行,但是还不会失去已有的自动换行。
124+当书写一封邮件的时候,在选项下面不要选择自动换行。唯一的缺点就是你在邮件中输
125+入的任何文本都不会被自动换行,因此你必须在发送补丁之前手动换行。最简单的方法
126+就是启用自动换行来书写邮件,然后把它保存为草稿。一旦你在草稿中再次打开它,它
127+已经全部自动换行了,那么你的邮件虽然没有选择自动换行,但是还不会失去已有的自
128+动换行。
104129
105−在邮件的底部,插入补丁之前,放上常用的补丁定界符:三个连字号(---)。
130+在邮件的底部,插入补丁之前,放上常用的补丁定界符:三个连字符(``---``)。
106131
107−然后在"Message"菜单条目,选择插入文件,接着选取你的补丁文件。还有一个额外的选项,你可以
108−通过它配置你的邮件建立工具栏菜单,还可以带上"insert file"图标。
132+然后在 :menuselection:`信件` 菜单,选择 :menuselection:`插入文本文件` ,接
133+着选取你的补丁文件。还有一个额外的选项,你可以通过它配置你的创建新邮件工具栏,
134+加上 :menuselection:`插入文本文件` 图标。
109135
110−你可以安全地通过GPG标记附件,但是内嵌补丁最好不要使用GPG标记它们。作为内嵌文本的签发补丁,
111−当从GPG中提取7位编码时会使他们变的更加复杂。
136+将编辑器窗口拉到足够宽避免折行。对于KMail 1.13.5 (KDE 4.5.4),它会在发送邮件
137+时对编辑器窗口中显示折行的地方自动换行。在选项菜单中取消自动换行仍不能解决。
138+因此,如果你的补丁中有非常长的行,必须在发送之前把编辑器窗口拉得非常宽。
139+参见:https://bugs.kde.org/show_bug.cgi?id=174034
112140
113−如果你非要以附件的形式发送补丁,那么就右键点击附件,然后选中属性,突出"Suggest automatic
114−display",这样内嵌附件更容易让读者看到。
141+你可以安全地用GPG签名附件,但是内嵌补丁最好不要使用GPG签名它们。作为内嵌文本
142+插入的签名补丁将使其难以从7-bit编码中提取。
115143
116−当你要保存将要发送的内嵌文本补丁,你可以从消息列表窗格选择包含补丁的邮件,然后右击选择
117−"save as"。你可以使用一个没有更改的包含补丁的邮件,如果它是以正确的形式组成。当你正真在它
118−自己的窗口之下察看,那时没有选项可以保存邮件--已经有一个这样的bug被汇报到了kmail的bugzilla
119−并且希望这将会被处理。邮件是以只针对某个用户可读写的权限被保存的,所以如果你想把邮件复制到其他地方,
120−你不得不把他们的权限改为组或者整体可读。
144+如果你非要以附件的形式发送补丁,那么就右键点击附件,然后选择
145+:menuselection:`属性` ,打开 :menuselection:`建议自动显示` ,使附件内联更容
146+易让读者看到。
147+
148+当你要保存将要发送的内嵌文本补丁,你可以从消息列表窗格选择包含补丁的邮件,然
149+后右键选择 :menuselection:`另存为` 。如果整个电子邮件的组成正确,您可直接将
150+其作为补丁使用。电子邮件以当前用户可读写权限保存,因此您必须 ``chmod`` ,以
151+使其在复制到别处时用户组和其他人可读。
121152
122153 Lotus Notes (GUI)
123−~~~~~~~~~~~~~~~~~
154+*****************
124155
125156 不要使用它。
126157
158+IBM Verse (Web GUI)
159+*******************
160+
161+同上条。
162+
127163 Mutt (TUI)
128−~~~~~~~~~~
164+**********
165+
166+很多Linux开发人员使用mutt客户端,这证明它肯定工作得非常漂亮。
129167
130−很多Linux开发人员使用mutt客户端,所以证明它肯定工作的非常漂亮。
168+Mutt不自带编辑器,所以不管你使用什么编辑器,不自动断行就行。大多数编辑器都有
169+:menuselection:`插入文件` 选项,它可以在不改变文件内容的情况下插入文件。
131170
132−Mutt不自带编辑器,所以不管你使用什么编辑器都不应该带有自动断行。大多数编辑器都带有
133−一个"insert file"选项,它可以通过不改变文件内容的方式插入文件。
171+用 ``vim`` 作为mutt的编辑器::
134172
135−'vim'作为mutt的编辑器:
136173 set editor="vi"
137174
138− 如果使用xclip,敲入以下命令
175+如果使用xclip,敲入以下命令::
176+
139177 :set paste
140− 按中键之前或者shift-insert或者使用
178+
179+然后再按中键或者shift-insert或者使用::
180+
141181 :r filename
142182
143−如果想要把补丁作为内嵌文本。
144−(a)ttach工作的很好,不带有"set paste"。
183+把补丁插入为内嵌文本。
184+在未设置 ``set paste`` 时(a)ttach工作的很好。
145185
146186 你可以通过 ``git format-patch`` 生成补丁,然后用 Mutt发送它们::
147187
148− $ mutt -H 0001-some-bug-fix.patch
188+ $ mutt -H 0001-some-bug-fix.patch
149189
150190 配置选项:
191+
151192 它应该以默认设置的形式工作。
152−然而,把"send_charset"设置为"us-ascii::utf-8"也是一个不错的主意。
193+然而,把 ``send_charset`` 设置一下也是一个不错的主意::
194+
195+ set send_charset="us-ascii:utf-8"
153196
154197 Mutt 是高度可配置的。 这里是个使用mutt通过 Gmail 发送的补丁的最小配置::
155198
@@ -178,71 +221,107 @@ Mutt 是高度可配置的。 这里是个使用mutt通过 Gmail 发送的补丁 · 22 unmodified lines
178221 set from = "username@gmail.com"
179222 set use_from = yes
180223
181−Mutt文档含有更多信息:
224+Mutt文档含有更多信息:
182225
183− http://dev.mutt.org/trac/wiki/UseCases/Gmail
226+ https://gitlab.com/muttmua/mutt/-/wikis/UseCases/Gmail
184227
185− http://dev.mutt.org/doc/manual.html
228+ http://www.mutt.org/doc/manual/
186229
187230 Pine (TUI)
188−~~~~~~~~~~
231+**********
189232
190233 Pine过去有一些空格删减问题,但是这些现在应该都被修复了。
191234
192−如果可以,请使用alpine(pine的继承者)
235+如果可以,请使用alpine(pine的继承者)。
193236
194237 配置选项:
195−- 最近的版本需要消除流程文本
196−- "no-strip-whitespace-before-send"选项也是需要的。
238+
239+- 最近的版本需要 ``quell-flowed-text``
240+- ``no-strip-whitespace-before-send`` 选项也是需要的。
197241
198242
199243 Sylpheed (GUI)
200−~~~~~~~~~~~~~~
244+**************
201245
202246 - 内嵌文本可以很好的工作(或者使用附件)。
203247 - 允许使用外部的编辑器。
204−- 对于目录较多时非常慢。
248+- 收件箱较多时非常慢。
205249 - 如果通过non-SSL连接,无法使用TLS SMTP授权。
206−- 在组成窗口中有一个很有用的ruler bar。
207−- 给地址本中添加地址就不会正确的了解显示名。
250+- 撰写窗口的标尺很有用。
251+- 将地址添加到通讯簿时无法正确理解显示的名称。
208252
209253 Thunderbird (GUI)
210−~~~~~~~~~~~~~~~~~
254+*****************
255+
256+Thunderbird是Outlook的克隆版本,它很容易损坏文本,但也有一些方法强制修正。
257+
258+在完成修改后(包括安装扩展),您需要重新启动Thunderbird。
259+
260+- 允许使用外部编辑器:
261+
262+ 使用Thunderbird发补丁最简单的方法是使用扩展来打开您最喜欢的外部编辑器。
263+
264+ 下面是一些能够做到这一点的扩展样例。
265+
266+ - “External Editor Revived”
267+
268+ https://github.com/Frederick888/external-editor-revived
269+
270+ https://addons.thunderbird.net/en-GB/thunderbird/addon/external-editor-revived/
271+
272+ 它需要安装“本地消息主机(native messaging host)”。
273+ 参见以下文档:
274+ https://github.com/Frederick888/external-editor-revived/wiki
275+
276+ - “External Editor”
277+
278+ https://github.com/exteditor/exteditor
279+
280+ 下载并安装此扩展,然后打开 :menuselection:`新建消息` 窗口, 用
281+ :menuselection:`查看-->工具栏-->自定义...` 给它增加一个按钮,直接点击此
282+ 按钮即可使用外置编辑器。
283+
284+ 请注意,“External Editor”要求你的编辑器不能fork,换句话说,编辑器必须在
285+ 关闭前不返回。你可能需要传递额外的参数或修改编辑器设置。最值得注意的是,
286+ 如果您使用的是gvim,那么您必须将 :menuselection:`external editor` 设置的
287+ 编辑器字段设置为 ``/usr/bin/gvim --nofork"`` (假设可执行文件在
288+ ``/usr/bin`` ),以传递 ``-f`` 参数。如果您正在使用其他编辑器,请阅读其
289+ 手册了解如何处理。
211290
212−默认情况下,thunderbird很容易损坏文本,但是还有一些方法可以强制它变得更好。
291+若要修正内部编辑器,请执行以下操作:
213292
214−- 在用户帐号设置里,组成和寻址,不要选择"Compose messages in HTML format"。
293+- 修改你的Thunderbird设置,不要使用 ``format=flowed`` !
294+ 回到主窗口,按照
295+ :menuselection:`主菜单-->首选项-->常规-->配置编辑器...`
296+ 打开Thunderbird的配置编辑器。
215297
216−- 编辑你的Thunderbird配置设置来使它不要拆行使用:user_pref("mailnews.wraplength", 0);
298+ - 将 ``mailnews.send_plaintext_flowed`` 设为 ``false``
217299
218−- 编辑你的Thunderbird配置设置,使它不要使用"format=flowed"格式:user_pref("mailnews.
219− send_plaintext_flowed", false);
300+ - 将 ``mailnews.wraplength`` 从 ``72`` 改为 ``0``
220301
221−- 你需要使Thunderbird变为预先格式方式:
222− 如果默认情况下你书写的是HTML格式,那不是很难。仅仅从标题栏的下拉框中选择"Preformat"格式。
223− 如果默认情况下你书写的是文本格式,你不得把它改为HTML格式(仅仅作为一次性的)来书写新的消息,
224− 然后强制使它回到文本格式,否则它就会拆行。要实现它,在写信的图标上使用shift键来使它变为HTML
225− 格式,然后标题栏的下拉框中选择"Preformat"格式。
302+- 不要写HTML邮件!
303+ 回到主窗口,打开
304+ :menuselection:`主菜单-->账户设置-->你的@邮件.地址-->通讯录/编写&地址簿` ,
305+ 关掉 ``以HTML格式编写消息`` 。
226306
227−- 允许使用外部的编辑器:
228− 针对Thunderbird打补丁最简单的方法就是使用一个"external editor"扩展,然后使用你最喜欢的
229− $EDITOR来读取或者合并补丁到文本中。要实现它,可以下载并且安装这个扩展,然后添加一个使用它的
230− 按键View->Toolbars->Customize...最后当你书写信息的时候仅仅点击它就可以了。
307+- 只用纯文本格式查看邮件!
308+ 回到主窗口, :menuselection:`主菜单-->查看-->消息体为-->纯文本` !
231309
232310 TkRat (GUI)
233−~~~~~~~~~~~
311+***********
234312
235313 可以使用它。使用"Insert file..."或者外部的编辑器。
236314
237315 Gmail (Web GUI)
238−~~~~~~~~~~~~~~~
316+***************
239317
240318 不要使用它发送补丁。
241319
242320 Gmail网页客户端自动地把制表符转换为空格。
243321
244−虽然制表符转换为空格问题可以被外部编辑器解决,同时它还会使用回车换行把每行拆分为78个字符。
322+虽然制表符转换为空格问题可以被外部编辑器解决,但它同时还会使用回车换行把每行
323+拆分为78个字符。
245324
246−另一个问题是Gmail还会把任何不是ASCII的字符的信息改为base64编码。它把东西变的像欧洲人的名字。
325+另一个问题是Gmail还会把任何含有非ASCII的字符的消息改用base64编码,如欧洲人的
326+名字。
247327
248− ###
Documentation/translations/zh_CN/process/submit-checklist.rst+45−39
@@ -1,105 +1,111 @@
11 .. include:: ../disclaimer-zh_CN.rst
22
3−:Original: :ref:`Documentation/process/submit-checklist.rst <submitchecklist>`
4−:Translator: Alex Shi <alex.shi@linux.alibaba.com>
3+:Original: Documentation/process/submit-checklist.rst
4+:Translator:
5+ - Alex Shi <alexs@kernel.org>
6+ - Wu XiangCheng <bobwxc@email.cn>
57
68 .. _cn_submitchecklist:
79
8−Linux内核补丁提交清单
9−~~~~~~~~~~~~~~~~~~~~~
10+Linux内核补丁提交检查单
11+~~~~~~~~~~~~~~~~~~~~~~~
1012
1113 如果开发人员希望看到他们的内核补丁提交更快地被接受,那么他们应该做一些基本
1214 的事情。
1315
14−这些都是在
15−:ref:`Documentation/translations/zh_CN/process/submitting-patches.rst <cn_submittingpatches>`
16+这些都是在 Documentation/translations/zh_CN/process/submitting-patches.rst
1617 和其他有关提交Linux内核补丁的文档中提供的。
1718
18−1) 如果使用工具,则包括定义/声明该工具的文件。不要依赖于其他头文件拉入您使用
19+1) 如果使用工具,则包括定义/声明该工具的文件。不要依赖其他头文件来引入您使用
1920 的头文件。
2021
2122 2) 干净的编译:
2223
23− a) 使用适用或修改的 ``CONFIG`` 选项 ``=y``、``=m`` 和 ``=n`` 。没有GCC
24+ a) 使用合适的 ``CONFIG`` 选项 ``=y``、``=m`` 和 ``=n`` 。没有 ``gcc``
2425 警告/错误,没有链接器警告/错误。
2526
26− b) 通过allnoconfig、allmodconfig
27+ b) 通过 ``allnoconfig`` 、 ``allmodconfig``
2728
2829 c) 使用 ``O=builddir`` 时可以成功编译
2930
30−3) 通过使用本地交叉编译工具或其他一些构建场在多个CPU体系结构上构建。
31+ d) 任何 Doucmentation/ 下的变更都能成功构建且不引入新警告/错误。
32+ 用 ``make htmldocs`` 或 ``make pdfdocs`` 检验构建情况并修复问题。
33+
34+3) 通过使用本地交叉编译工具或其他一些构建设施在多个CPU体系结构上构建。
3135
3236 4) PPC64是一种很好的交叉编译检查体系结构,因为它倾向于对64位的数使用无符号
3337 长整型。
3438
35−5) 如下所述 :ref:`Documentation/translations/zh_CN/process/coding-style.rst <cn_codingstyle>`.
36− 检查您的补丁是否为常规样式。在提交( ``scripts/check patch.pl`` )之前,
37− 使用补丁样式检查器检查是否有轻微的冲突。您应该能够处理您的补丁中存在的所有
39+5) 按 Documentation/translations/zh_CN/process/coding-style.rst 所述检查您的
40+ 补丁是否为常规样式。在提交之前使用补丁样式检查器 ``scripts/checkpatch.pl``
41+ 检查是否有轻微的冲突。您应该能够处理您的补丁中存在的所有
3842 违规行为。
3943
40−6) 任何新的或修改过的 ``CONFIG`` 选项都不会弄脏配置菜单,并默认为关闭,除非
41− 它们符合 ``Documentation/kbuild/kconfig-language.rst`` 中记录的异常条件,
42− 菜单属性:默认值.
44+6) 任何新的或修改过的 ``CONFIG`` 选项都不应搞乱配置菜单,并默认为关闭,除非
45+ 它们符合 ``Documentation/kbuild/kconfig-language.rst`` 菜单属性:默认值中
46+ 记录的例外条件。
4347
4448 7) 所有新的 ``kconfig`` 选项都有帮助文本。
4549
4650 8) 已仔细审查了相关的 ``Kconfig`` 组合。这很难用测试来纠正——脑力在这里是有
4751 回报的。
4852
49−9) 用 sparse 检查干净。
53+9) 通过 sparse 清查。
54+ (参见 Documentation/translations/zh_CN/dev-tools/sparse.rst )
5055
5156 10) 使用 ``make checkstack`` 和 ``make namespacecheck`` 并修复他们发现的任何
5257 问题。
5358
5459 .. note::
5560
56− ``checkstack`` 并没有明确指出问题,但是任何一个在堆栈上使用超过512
61+ ``checkstack`` 并不会明确指出问题,但是任何一个在堆栈上使用超过512
5762 字节的函数都可以进行更改。
5863
59−11) 包括 :ref:`kernel-doc <kernel_doc>` 内核文档以记录全局内核API。(静态函数
60− 不需要,但也可以。)使用 ``make htmldocs`` 或 ``make pdfdocs`` 检查
61− :ref:`kernel-doc <kernel_doc>` 并修复任何问题。
64+11) 包括 :ref:`kernel-doc <kernel_doc_zh>` 内核文档以记录全局内核API。(静态
65+ 函数不需要,但也可以。)使用 ``make htmldocs`` 或 ``make pdfdocs`` 检查
66+ :ref:`kernel-doc <kernel_doc_zh>` 并修复任何问题。
6267
63−12) 通过以下选项同时启用的测试 ``CONFIG_PREEMPT``, ``CONFIG_DEBUG_PREEMPT``,
68+12) 通过以下选项同时启用的测试: ``CONFIG_PREEMPT``, ``CONFIG_DEBUG_PREEMPT``,
6469 ``CONFIG_DEBUG_SLAB``, ``CONFIG_DEBUG_PAGEALLOC``, ``CONFIG_DEBUG_MUTEXES``,
6570 ``CONFIG_DEBUG_SPINLOCK``, ``CONFIG_DEBUG_ATOMIC_SLEEP``,
66− ``CONFIG_PROVE_RCU`` and ``CONFIG_DEBUG_OBJECTS_RCU_HEAD``
67−
68−13) 已经过构建和运行时测试,包括有或没有 ``CONFIG_SMP``, ``CONFIG_PREEMPT``.
71+ ``CONFIG_PROVE_RCU`` 和 ``CONFIG_DEBUG_OBJECTS_RCU_HEAD`` 。
6972
70−14) 如果补丁程序影响IO/磁盘等:使用或不使用 ``CONFIG_LBDAF`` 进行测试。
73+13) 在 ``CONFIG_SMP``, ``CONFIG_PREEMPT`` 开启和关闭的情况下都进行构建和运行
74+ 时测试。
7175
72−15) 所有代码路径都已在启用所有lockdep功能的情况下运行。
76+14) 所有代码路径都已在启用所有死锁检测(lockdep)功能的情况下运行。
7377
74−16) 所有新的/proc条目都记录在 ``Documentation/``
78+15) 所有新的 ``/proc`` 条目都记录在 ``Documentation/``
7579
76−17) 所有新的内核引导参数都记录在
80+16) 所有新的内核引导参数都记录在
7781 Documentation/admin-guide/kernel-parameters.rst 中。
7882
79−18) 所有新的模块参数都记录在 ``MODULE_PARM_DESC()``
83+17) 所有新的模块参数都记录在 ``MODULE_PARM_DESC()``
8084
81−19) 所有新的用户空间接口都记录在 ``Documentation/ABI/`` 中。有关详细信息,
85+18) 所有新的用户空间接口都记录在 ``Documentation/ABI/`` 中。有关详细信息,
8286 请参阅 ``Documentation/ABI/README`` 。更改用户空间接口的补丁应该抄送
8387 linux-api@vger.kernel.org。
8488
85−20) 已通过至少注入slab和page分配失败进行检查。请参阅 ``Documentation/fault-injection/``
89+19) 已通过至少注入slab和page分配失败进行检查。请参阅 ``Documentation/fault-injection/`` 。
8690 如果新代码是实质性的,那么添加子系统特定的故障注入可能是合适的。
8791
88−21) 新添加的代码已经用 ``gcc -W`` 编译(使用 ``make EXTRA-CFLAGS=-W`` )。这
92+20) 新添加的代码已经用 ``gcc -W`` 编译(使用 ``make EXTRA-CFLAGS=-W`` )。这
8993 将产生大量噪声,但对于查找诸如“警告:有符号和无符号之间的比较”之类的错误
9094 很有用。
9195
92−22) 在它被合并到-mm补丁集中之后进行测试,以确保它仍然与所有其他排队的补丁以
96+21) 在它被合并到-mm补丁集中之后进行测试,以确保它仍然与所有其他排队的补丁以
9397 及VM、VFS和其他子系统中的各种更改一起工作。
9498
95−23) 所有内存屏障例如 ``barrier()``, ``rmb()``, ``wmb()`` 都需要源代码中的注
99+22) 所有内存屏障(例如 ``barrier()``, ``rmb()``, ``wmb()`` )都需要源代码注
96100 释来解释它们正在执行的操作及其原因的逻辑。
97101
98−24) 如果补丁添加了任何ioctl,那么也要更新 ``Documentation/userspace-api/ioctl/ioctl-number.rst``
102+23) 如果补丁添加了任何ioctl,那么也要更新
103+ ``Documentation/userspace-api/ioctl/ioctl-number.rst`` 。
99104
100−25) 如果修改后的源代码依赖或使用与以下 ``Kconfig`` 符号相关的任何内核API或
105+24) 如果修改后的源代码依赖或使用与以下 ``Kconfig`` 符号相关的任何内核API或
101106 功能,则在禁用相关 ``Kconfig`` 符号和/或 ``=m`` (如果该选项可用)的情况
102107 下测试以下多个构建[并非所有这些都同时存在,只是它们的各种/随机组合]:
103108
104− ``CONFIG_SMP``, ``CONFIG_SYSFS``, ``CONFIG_PROC_FS``, ``CONFIG_INPUT``, ``CONFIG_PCI``, ``CONFIG_BLOCK``, ``CONFIG_PM``, ``CONFIG_MAGIC_SYSRQ``,
105− ``CONFIG_NET``, ``CONFIG_INET=n`` (但是后者伴随 ``CONFIG_NET=y``).
109+ ``CONFIG_SMP``, ``CONFIG_SYSFS``, ``CONFIG_PROC_FS``, ``CONFIG_INPUT``,
110+ ``CONFIG_PCI``, ``CONFIG_BLOCK``, ``CONFIG_PM``, ``CONFIG_MAGIC_SYSRQ``,
111+ ``CONFIG_NET``, ``CONFIG_INET=n`` (但是最后一个需要 ``CONFIG_NET=y`` )。
Documentation/translations/zh_CN/process/submitting-patches.rst+357−357
@@ -1,142 +1,92 @@
1−.. _cn_submittingpatches:
1+.. SPDX-License-Identifier: GPL-2.0-or-later
22
33 .. include:: ../disclaimer-zh_CN.rst
44
5−:Original: :ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
5+.. _cn_submittingpatches:
6+
7+:Original: Documentation/process/submitting-patches.rst
68
7−译者::
9+:译者:
10+ - 钟宇 TripleX Chung <xxx.phy@gmail.com>
11+ - 时奎亮 Alex Shi <alexs@kernel.org>
12+ - 吴想成 Wu XiangCheng <bobwxc@email.cn>
813
9− 中文版维护者: 钟宇 TripleX Chung <xxx.phy@gmail.com>
10− 中文版翻译者: 钟宇 TripleX Chung <xxx.phy@gmail.com>
11− 时奎亮 Alex Shi <alex.shi@linux.alibaba.com>
12− 中文版校译者: 李阳 Li Yang <leoyang.li@nxp.com>
13− 王聪 Wang Cong <xiyou.wangcong@gmail.com>
14+:校译:
15+ - 李阳 Li Yang <leoyang.li@nxp.com>
16+ - 王聪 Wang Cong <xiyou.wangcong@gmail.com>
1417
1518
16−如何让你的改动进入内核
17−======================
19+提交补丁:如何让你的改动进入内核
20+================================
1821
1922 对于想要将改动提交到 Linux 内核的个人或者公司来说,如果不熟悉“规矩”,
20−提交的流程会让人畏惧。本文档收集了一系列建议,这些建议可以大大的提高你
23+提交的流程会让人畏惧。本文档包含了一系列建议,可以大大提高你
2124 的改动被接受的机会.
2225
23−以下文档含有大量简洁的建议, 具体请见:
24−:ref:`Documentation/process <development_process_main>`
25−同样,:ref:`Documentation/translations/zh_CN/process/submit-checklist.rst <cn_submitchecklist>`
26−给出在提交代码前需要检查的项目的列表。
26+本文档以较为简洁的行文给出了大量建议。关于内核开发流程如何进行的详细信息,
27+参见: Documentation/translations/zh_CN/process/development-process.rst 。
28+Documentation/translations/zh_CN/process/submit-checklist.rst 给出了一系列
29+提交补丁之前要检查的事项。设备树相关的补丁,请参阅
30+Documentation/devicetree/bindings/submitting-patches.rst 。
2731
28−其中许多步骤描述了Git版本控制系统的默认行为;如果您使用Git来准备补丁,
29−您将发现它为您完成的大部分机械工作,尽管您仍然需要准备和记录一组合理的
30−补丁。一般来说,使用git将使您作为内核开发人员的生活更轻松。
32+本文档假设您正在使用 ``git`` 准备你的补丁。如果您不熟悉 ``git`` ,最好学习
33+如何使用它,这将使您作为内核开发人员的生活变得更加轻松。
3134
35+部分子系统和维护人员的树有一些关于其工作流程和要求的额外信息,请参阅
36+Documentation/process/maintainer-handbooks.rst 。
3237
33−0) 获取当前源码树
34−-----------------
38+获取当前源码树
39+--------------
3540
36−如果您没有一个可以使用当前内核源代码的存储库,请使用git获取一个。您将要
37−从主线存储库开始,它可以通过以下方式获取::
41+如果您手头没有当前内核源代码的存储库,请使用 ``git`` 获取一份。您需要先获取
42+主线存储库,它可以通过以下命令拉取::
3843
39− git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
44+ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
4045
41−但是,请注意,您可能不希望直接针对主线树进行开发。大多数子系统维护人员运
46+但是,请注意,您可能不想直接针对主线树进行开发。大多数子系统维护人员运
4247 行自己的树,并希望看到针对这些树准备的补丁。请参见MAINTAINERS文件中子系
43−统的 **T:** 项以查找该树,或者简单地询问维护者该树是否未在其中列出。
44−
45−仍然可以通过tarballs下载内核版本(如下一节所述),但这是进行内核开发的
46−一种困难的方式。
47−
48−1) "diff -up"
49−-------------
50−
51−使用 "diff -up" 或者 "diff -uprN" 来创建补丁。
52−
53−所有内核的改动,都是以补丁的形式呈现的,补丁由 diff(1) 生成。创建补丁的
54−时候,要确认它是以 "unified diff" 格式创建的,这种格式由 diff(1) 的 '-u'
55−参数生成。而且,请使用 '-p' 参数,那样会显示每个改动所在的C函数,使得
56−产生的补丁容易读得多。补丁应该基于内核源代码树的根目录,而不是里边的任
57−何子目录。
58−
59−为一个单独的文件创建补丁,一般来说这样做就够了::
60−
61− SRCTREE=linux
62− MYFILE=drivers/net/mydriver.c
48+统的 **T:** 项以查找该树,或者直接询问维护者该树是否未在其中列出。
6349
64− cd $SRCTREE
65− cp $MYFILE $MYFILE.orig
66− vi $MYFILE # make your change
67− cd ..
68− diff -up $SRCTREE/$MYFILE{.orig,} > /tmp/patch
50+.. _zh_describe_changes:
6951
70−为多个文件创建补丁,你可以解开一个没有修改过的内核源代码树,然后和你自
71−己的代码树之间做 diff 。例如::
72−
73− MYSRC=/devel/linux
74−
75− tar xvfz linux-3.19.tar.gz
76− mv linux-3.19 linux-3.19-vanilla
77− diff -uprN -X linux-3.19-vanilla/Documentation/dontdiff \
78− linux-3.19-vanilla $MYSRC > /tmp/patch
79−
80−"dontdiff" 是内核在编译的时候产生的文件的列表,列表中的文件在 diff(1)
81−产生的补丁里会被跳过。
82−
83−确定你的补丁里没有包含任何不属于这次补丁提交的额外文件。记得在用diff(1)
84−生成补丁之后,审阅一次补丁,以确保准确。
85−
86−如果你的改动很散乱,你应该研究一下如何将补丁分割成独立的部分,将改动分
87−割成一系列合乎逻辑的步骤。这样更容易让其他内核开发者审核,如果你想你的
88−补丁被接受,这是很重要的。请参阅:
89−:ref:`cn_split_changes`
90−
91−如果你用 ``git`` , ``git rebase -i`` 可以帮助你这一点。如果你不用 ``git``,
92−``quilt`` <https://savannah.nongnu.org/projects/quilt> 另外一个流行的选择。
93−
94−.. _cn_describe_changes:
95−
96−2) 描述你的改动
97−---------------
52+描述你的改动
53+------------
9854
9955 描述你的问题。无论您的补丁是一行错误修复还是5000行新功能,都必须有一个潜在
100−的问题激励您完成这项工作。让审稿人相信有一个问题值得解决,让他们读完第一段
101−是有意义的。
56+的问题激励您完成这项工作。说服审阅者相信有一个问题值得解决,让他们读完第一段
57+后就能明白这一点。
10258
10359 描述用户可见的影响。直接崩溃和锁定是相当有说服力的,但并不是所有的错误都那么
104−明目张胆。即使在代码审查期间发现了这个问题,也要描述一下您认为它可能对用户产
60+明目张胆。即使在代码审阅期间发现了这个问题,也要描述一下您认为它可能对用户产
10561 生的影响。请记住,大多数Linux安装运行的内核来自二级稳定树或特定于供应商/产品
10662 的树,只从上游精选特定的补丁,因此请包含任何可以帮助您将更改定位到下游的内容:
10763 触发的场景、DMESG的摘录、崩溃描述、性能回归、延迟尖峰、锁定等。
10864
109−量化优化和权衡。如果您声称在性能、内存消耗、堆栈占用空间或二进制大小方面有所
110−改进,请包括支持它们的数字。但也要描述不明显的成本。优化通常不是免费的,而是
111−在CPU、内存和可读性之间进行权衡;或者,探索性的工作,在不同的工作负载之间进
65+质量优化和权衡。如果您声称在性能、内存消耗、堆栈占用空间或二进制大小方面有所
66+改进,请包括支持它们的数据。但也要描述不明显的成本。优化通常不是零成本的,而是
67+在CPU、内存和可读性之间进行权衡;或者,做探索性的工作,在不同的工作负载之间进
11268 行权衡。请描述优化的预期缺点,以便审阅者可以权衡成本和收益。
11369
114−一旦问题建立起来,就要详细地描述一下您实际在做什么。对于审阅者来说,用简单的
115−英语描述代码的变化是很重要的,以验证代码的行为是否符合您的意愿。
70+提出问题之后,就要详细地描述一下您实际在做的技术细节。对于审阅者来说,用简练的
71+英语描述代码的变化是很重要的,以验证代码的行为是否符合您的意图。
11672
117−如果您将补丁描述写在一个表单中,这个表单可以很容易地作为“提交日志”放入Linux
118−的源代码管理系统git中,那么维护人员将非常感谢您。见 :ref:`cn_explicit_in_reply_to`.
73+如果您将补丁描述写成“标准格式”,可以很容易地作为“提交日志”放入Linux的源代
74+码管理系统 ``git`` 中,那么维护人员将非常感谢您。
75+参见 :ref:`zh_the_canonical_patch_format` 。
11976
12077 每个补丁只解决一个问题。如果你的描述开始变长,这就表明你可能需要拆分你的补丁。
121−请见 :ref:`cn_split_changes`
78+请见 :ref:`zh_split_changes` 。
12279
123−提交或重新提交修补程序或修补程序系列时,请包括完整的修补程序说明和理由。不要
80+提交或重新提交补丁或补丁系列时,请包括完整的补丁说明和理由。不要
12481 只说这是补丁(系列)的第几版。不要期望子系统维护人员引用更早的补丁版本或引用
12582 URL来查找补丁描述并将其放入补丁中。也就是说,补丁(系列)及其描述应该是独立的。
126−这对维护人员和审查人员都有好处。一些评审者可能甚至没有收到补丁的早期版本。
83+这对维护人员和审阅者都有好处。一些审阅者可能甚至没有收到补丁的早期版本。
12784
128−描述你在命令语气中的变化,例如“make xyzzy do frotz”而不是“[This patch]make
85+用祈使句描述你的变更,例如“make xyzzy do frotz”而不是“[This patch]make
12986 xyzzy do frotz”或“[I]changed xyzzy to do frotz”,就好像你在命令代码库改变
13087 它的行为一样。
13188
132−如果修补程序修复了一个记录的bug条目,请按编号和URL引用该bug条目。如果补丁来
133−自邮件列表讨论,请给出邮件列表存档的URL;使用带有 ``Message-ID`` 的
134−https://lore.kernel.org/ 重定向,以确保链接不会过时。
135−
136−但是,在没有外部资源的情况下,尽量让你的解释可理解。除了提供邮件列表存档或
137−bug的URL之外,还要总结需要提交补丁的相关讨论要点。
138−
139−如果您想要引用一个特定的提交,不要只引用提交的 SHA-1 ID。还请包括提交的一行
89+如果您想要引用一个特定的提交,不要只引用提交的SHA-1 ID。还请包括提交的一行
14090 摘要,以便于审阅者了解它是关于什么的。例如::
14191
14292 Commit e21d2170f36602ae2708 ("video: remove unnecessary
@@ -144,82 +94,104 @@ bug的URL之外,还要总结需要提交补丁的相关讨论要点。 · 1 unmodified line
14494 platform_set_drvdata(), but left the variable "dev" unused,
14595 delete it.
14696
147−您还应该确保至少使用前12位 SHA-1 ID. 内核存储库包含*许多*对象,使与较短的ID
97+您还应该确保至少使用前12位SHA-1 ID。内核存储库包含 *许多* 对象,使较短的ID
14898 发生冲突的可能性很大。记住,即使现在不会与您的六个字符ID发生冲突,这种情况
149−可能五年后改变。
99+也可能在五年后改变。
100+
101+如果该变更的相关讨论或背景信息可以在网上查阅,请加上“Link:”标签指向它。例如
102+你的补丁修复了一个缺陷,需要添加一个带有URL的标签指向邮件列表存档或缺陷跟踪器
103+的相关报告;如果该补丁是由一些早先邮件列表讨论或网络上的记录引起的,请指向它。
104+
105+当链接到邮件列表存档时,请首选lore.kernel.org邮件存档服务。用邮件中的
106+``Message-ID`` 头(去掉尖括号)可以创建链接URL。例如::
107+
108+ Link: https://lore.kernel.org/r/30th.anniversary.repost@klaava.Helsinki.FI/
109+
110+请检查该链接以确保可用且指向正确的邮件。
150111
151−如果修补程序修复了特定提交中的错误,例如,使用 ``git bisct`` ,请使用带有前
152−12个字符SHA-1 ID 的"Fixes:"标记和单行摘要。为了简化不要将标记拆分为多个,
153−行、标记不受分析脚本“75列换行”规则的限制。例如::
112+不过,在没有外部资源的情况下,也要尽量让你的解释可理解。除了提供邮件列表存档或
113+缺陷的URL之外,还要需要总结该补丁的相关讨论要点。
154114
155− Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed")
115+如果补丁修复了特定提交中的错误,例如使用 ``git bisct`` 发现了一个问题,请使用
116+带有前12个字符SHA-1 ID的“Fixes:”标签和单行摘要。为了简化解析脚本,不要将该
117+标签拆分为多行,标签不受“75列换行”规则的限制。例如::
156118
157−下列 ``git config`` 设置可以添加让 ``git log``, ``git show`` 漂亮的显示格式::
119+ Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed")
120+
121+下列 ``git config`` 设置可以让 ``git log``, ``git show`` 增加上述风格的显示格式::
158122
159123 [core]
160124 abbrev = 12
161125 [pretty]
162126 fixes = Fixes: %h (\"%s\")
163127
164−.. _cn_split_changes:
128+使用示例::
129+
130+ $ git log -1 --pretty=fixes 54a4f0239f2e
131+ Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed")
165132
166−3) 拆分你的改动
167−---------------
133+.. _zh_split_changes:
168134
169−将每个逻辑更改分隔成一个单独的补丁。
135+拆分你的改动
136+------------
137+
138+将每个 **逻辑更改** 拆分成一个单独的补丁。
170139
171140 例如,如果你的改动里同时有bug修正和性能优化,那么把这些改动拆分到两个或
172−者更多的补丁文件中。如果你的改动包含对API的修改,并且修改了驱动程序来适
173−应这些新的API,那么把这些修改分成两个补丁。
141+者更多的补丁文件中。如果你的改动包含对API的修改,并且增加了一个使用该新API
142+的驱动,那么把这些修改分成两个补丁。
174143
175144 另一方面,如果你将一个单独的改动做成多个补丁文件,那么将它们合并成一个
176145 单独的补丁文件。这样一个逻辑上单独的改动只被包含在一个补丁文件里。
177146
178−如果有一个补丁依赖另外一个补丁来完成它的改动,那没问题。简单的在你的补
179−丁描述里指出“这个补丁依赖某补丁”就好了。
147+需要记住的一点是,每个补丁的更改都应易于理解,以便审阅者验证。每个补丁都应该
148+对其价值进行阐述。
149+
150+如果有一个补丁依赖另外一个补丁来完成它的改动,那没问题。直接在你的补
151+丁描述里指出 **“这个补丁依赖某补丁”** 就好了。
180152
181−在将您的更改划分为一系列补丁时,要特别注意确保内核在系列中的每个补丁之后
182−都能正常构建和运行。使用 ``git bisect`` 来追踪问题的开发者可能会在任何时
183−候分割你的补丁系列;如果你在中间引入错误,他们不会感谢你。
153+在将您的更改划分为一系列补丁时,要特别注意确保内核在应用系列中的每个补丁之后
154+都能正常构建和运行。使用 ``git bisect`` 来追踪问题的开发者可能会在任何地方分
155+割你的补丁系列;如果你在中间引入错误,他们不会感谢你。
184156
185−如果你不能将补丁浓缩成更少的文件,那么每次大约发送出15个,然后等待审查
157+如果你不能将补丁系列浓缩得更小,那么每次大约发送出15个补丁,然后等待审阅
186158 和集成。
187159
188−4) 检查你的更改风格
189−-------------------
160+检查你的更改风格
161+----------------
190162
191−检查您的补丁是否存在基本样式冲突,详细信息可在
192−:ref:`Documentation/translations/zh_CN/process/coding-style.rst <cn_codingstyle>`
193−中找到。如果不这样做,只会浪费审稿人的时间,并且会导致你的补丁被拒绝,甚至
163+检查您的补丁是否违反了基本样式规定,详细信息参见
164+Documentation/translations/zh_CN/process/coding-style.rst
165+中找到。如果不这样做,只会浪费审阅者的时间,并且会导致你的补丁被拒绝,甚至
194166 可能没有被阅读。
195167
196168 一个重要的例外是在将代码从一个文件移动到另一个文件时——在这种情况下,您不应
197169 该在移动代码的同一个补丁中修改移动的代码。这清楚地描述了移动代码和您的更改
198−的行为。这大大有助于审查实际差异,并允许工具更好地跟踪代码本身的历史。
170+的行为。这大大有助于审阅实际差异,并允许工具更好地跟踪代码本身的历史。
199171
200172 在提交之前,使用补丁样式检查程序检查补丁(scripts/check patch.pl)。不过,
201173 请注意,样式检查程序应该被视为一个指南,而不是作为人类判断的替代品。如果您
202−的代码看起来更好,但有违规行为,那么最好不要使用它。
174+的代码看起来更好,但有违规行为,那么最好别管它。
203175
204176 检查者报告三个级别:
205177
206178 - ERROR:很可能出错的事情
207− - WARNING:需要仔细审查的事项
179+ - WARNING:需要仔细审阅的事项
208180 - CHECK:需要思考的事情
209181
210182 您应该能够判断您的补丁中存在的所有违规行为。
211183
212−5) 选择补丁收件人
213−-----------------
184+选择补丁收件人
185+--------------
214186
215−您应该总是在任何补丁上复制相应的子系统维护人员,以获得他们维护的代码;查看
187+您应该总是知会任何补丁相应代码的子系统维护人员;查看
216188 维护人员文件和源代码修订历史记录,以了解这些维护人员是谁。脚本
217−scripts/get_Maintainer.pl在这个步骤中非常有用。如果您找不到正在工作的子系统
189+scripts/get_maintainer.pl在这个步骤中非常有用。如果您找不到正在工作的子系统
218190 的维护人员,那么Andrew Morton(akpm@linux-foundation.org)将充当最后的维护
219191 人员。
220192
221−您通常还应该选择至少一个邮件列表来接收补丁集的。linux-kernel@vger.kernel.org
222−作为最后一个解决办法的列表,但是这个列表上的体积已经引起了许多开发人员的拒绝。
193+您通常还应该选择至少一个邮件列表来接收补丁集的副本。linux-kernel@vger.kernel.org
194+是所有补丁的默认列表,但是这个列表的流量已经导致了许多开发人员不再看它。
223195 在MAINTAINERS文件中查找子系统特定的列表;您的补丁可能会在那里得到更多的关注。
224196 不过,请不要发送垃圾邮件到无关的列表。
225197
@@ -229,189 +201,170 @@ http://vger.kernel.org/vger-lists.html 上找到它们的列表。不过,也 · 3 unmodified lines
229201
230202 不要一次发送超过15个补丁到vger邮件列表!!!!
231203
232−Linus Torvalds 是决定改动能否进入 Linux 内核的最终裁决者。他的 e-mail
233−地址是 <torvalds@linux-foundation.org> 。他收到的 e-mail 很多,所以一般
234−的说,最好别给他发 e-mail。
235−
236−如果您有修复可利用安全漏洞的补丁,请将该补丁发送到 security@kernel.org。对于
237−严重的bug,可以考虑短期暂停以允许分销商向用户发布补丁;在这种情况下,显然不应
238−将补丁发送到任何公共列表。
204+Linus Torvalds是决定改动能否进入 Linux 内核的最终裁决者。他的邮件地址是
205+torvalds@linux-foundation.org 。他收到的邮件很多,所以一般来说最好 **别**
206+给他发邮件。
239207
240−修复已发布内核中严重错误的补丁程序应该指向稳定版维护人员,方法是放这样的一行::
208+如果您有修复可利用安全漏洞的补丁,请将该补丁发送到 security@kernel.org 。对于
209+严重的bug,可以考虑短期禁令以允许分销商(有时间)向用户发布补丁;在这种情况下,
210+显然不应将补丁发送到任何公共列表。
211+参见 Documentation/translations/zh_CN/admin-guide/security-bugs.rst 。
241212
242− Cc: stable@vger.kernel.org
213+修复已发布内核中严重错误的补丁程序应该抄送给稳定版维护人员,方法是把以下列行
214+放进补丁的签准区(注意,不是电子邮件收件人)::
243215
244−进入补丁的签准区(注意,不是电子邮件收件人)。除了这个文件之外,您还应该阅读
245−:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`
216+ Cc: stable@vger.kernel.org
246217
247−但是,请注意,一些子系统维护人员希望得出他们自己的结论,即哪些补丁应该被放到
248−稳定的树上。尤其是网络维护人员,不希望看到单个开发人员在补丁中添加像上面这样
249−的行。
218+除了本文件之外,您还应该阅读
219+Documentation/translations/zh_CN/process/stable-kernel-rules.rst 。
250220
251−如果更改影响到用户和内核接口,请向手册页维护人员(如维护人员文件中所列)发送
221+如果更改影响到用户侧内核接口,请向手册页维护人员(如维护人员文件中所列)发送
252222 手册页补丁,或至少发送更改通知,以便一些信息进入手册页。还应将用户空间API
253−更改复制到 linux-api@vger.kernel.org。
223+更改抄送到 linux-api@vger.kernel.org 。
254224
255225
256−6) 没有 MIME 编码,没有链接,没有压缩,没有附件,只有纯文本
257−-----------------------------------------------------------
226+不要MIME编码,不要链接,不要压缩,不要附件,只要纯文本
227+------------------------------------------------------
258228
259229 Linus 和其他的内核开发者需要阅读和评论你提交的改动。对于内核开发者来说
260−,可以“引用”你的改动很重要,使用一般的 e-mail 工具,他们就可以在你的
230+,可以“引用”你的改动很重要,使用一般的邮件工具,他们就可以在你的
261231 代码的任何位置添加评论。
262232
263−因为这个原因,所有的提交的补丁都是 e-mail 中“内嵌”的。
233+因为这个原因,所有的提交的补丁都是邮件中“内嵌”的。最简单(和推荐)的方法就
234+是使用 ``git send-email`` 。https://git-send-email.io 有 ``git send-email``
235+的交互式教程。
236+
237+如果你选择不用 ``git send-email`` :
264238
265239 .. warning::
266− 如果你使用剪切-粘贴你的补丁,小心你的编辑器的自动换行功能破坏你的补丁
267240
268−不要将补丁作为 MIME 编码的附件,不管是否压缩。很多流行的 e-mail 软件不
269−是任何时候都将 MIME 编码的附件当作纯文本发送的,这会使得别人无法在你的
270−代码中加评论。另外,MIME 编码的附件会让 Linus 多花一点时间来处理,这就
271−降低了你的改动被接受的可能性。
241+ 如果你使用剪切-粘贴你的补丁,小心你的编辑器的自动换行功能破坏你的补丁
272242
273−例外:如果你的邮递员弄坏了补丁,那么有人可能会要求你使用mime重新发送补丁
243+不要将补丁作为MIME编码的附件,不管是否压缩。很多流行的邮件软件不
244+是任何时候都将MIME编码的附件当作纯文本发送的,这会使得别人无法在你的
245+代码中加评论。另外,MIME编码的附件会让Linus多花一点时间来处理,这就
246+降低了你的改动被接受的可能性。
274247
275−请参阅 :ref:`Documentation/translations/zh_CN/process/email-clients.rst <cn_email_clients>`
276−以获取有关配置电子邮件客户端以使其不受影响地发送修补程序的提示。
248+例外:如果你的邮路损坏了补丁,那么有人可能会要求你使用MIME重新发送补丁。
277249
278−7) e-mail 的大小
279−----------------
250+请参阅 Documentation/translations/zh_CN/process/email-clients.rst
251+以获取有关配置电子邮件客户端以使其不受影响地发送补丁的提示。
280252
281−大的改动对邮件列表不合适,对某些维护者也不合适。如果你的补丁,在不压缩
282−的情况下,超过了300kB,那么你最好将补丁放在一个能通过 internet 访问的服
283−务器上,然后用指向你的补丁的 URL 替代。但是请注意,如果您的补丁超过了
284−300kb,那么它几乎肯定需要被破坏。
253+回复审阅意见
254+------------
285255
286−8)回复评审意见
287−---------------
256+你的补丁几乎肯定会得到审阅者对补丁改进方法的评论(以回复邮件的形式)。您必须
257+对这些评论作出回应;让补丁被忽略的一个好办法就是忽略审阅者的意见。直接回复邮
258+件来回应意见即可。不会导致代码更改的意见或问题几乎肯定会带来注释或变更日志的
259+改变,以便下一个审阅者更好地了解正在发生的事情。
288260
289−你的补丁几乎肯定会得到评审者对补丁改进方法的评论。您必须对这些评论作出
290−回应;让补丁被忽略的一个好办法就是忽略审阅者的意见。不会导致代码更改的
291−意见或问题几乎肯定会带来注释或变更日志的改变,以便下一个评审者更好地了解
292−正在发生的事情。
261+一定要告诉审阅者你在做什么改变,并感谢他们的时间。代码审阅是一个累人且耗时的
262+过程,审阅者有时会变得暴躁。即使在这种情况下,也要礼貌地回应并解决他们指出的
263+问题。当发送下一版时,在封面邮件或独立补丁里加上 ``patch changelog`` 说明与
264+前一版本的不同之处(参见 :ref:`zh_the_canonical_patch_format` )。
293265
294−一定要告诉审稿人你在做什么改变,并感谢他们的时间。代码审查是一个累人且
295−耗时的过程,审查人员有时会变得暴躁。即使在这种情况下,也要礼貌地回应并
296−解决他们指出的问题。
266+.. _zh_resend_reminders:
297267
298−9)不要泄气或不耐烦
299−-------------------
268+不要泄气或不耐烦
269+----------------
300270
301−提交更改后,请耐心等待。审阅者是忙碌的人,可能无法立即访问您的修补程序。
271+提交更改后,请耐心等待。审阅者是大忙人,可能无法立即审阅您的补丁。
302272
303−曾几何时,补丁曾在没有评论的情况下消失在空白中,但开发过程比现在更加顺利。
273+曾几何时,补丁曾在没收到评论的情况下消失在虚空中,但现在开发过程应该更加顺利了。
304274 您应该在一周左右的时间内收到评论;如果没有收到评论,请确保您已将补丁发送
305−到正确的位置。在重新提交或联系审阅者之前至少等待一周-在诸如合并窗口之类的
275+到正确的位置。在重新提交或联系审阅者之前至少等待一周——在诸如合并窗口之类的
306276 繁忙时间可能更长。
307277
308−10)主题中包含 PATCH
309−--------------------
278+在等了几个星期后,用带RESEND的主题重发补丁也是可以的::
310279
311−由于到linus和linux内核的电子邮件流量很高,通常会在主题行前面加上[PATCH]
312−前缀. 这使Linus和其他内核开发人员更容易将补丁与其他电子邮件讨论区分开。
280+ [PATCH Vx RESEND] sub/sys: Condensed patch summary
313281
314−11)签署你的作品-开发者原始认证
315−-------------------------------
282+当你发布补丁(系列)修改版的时候,不要加上“RESEND”——“RESEND”只适用于重
283+新提交之前未经修改的补丁(系列)。
316284
317−为了加强对谁做了何事的追踪,尤其是对那些透过好几层的维护者的补丁,我们
318−建议在发送出去的补丁上加一个 “sign-off” 的过程。
285+主题中包含 PATCH
286+----------------
319287
320−"sign-off" 是在补丁的注释的最后的简单的一行文字,认证你编写了它或者其他
288+由于到Linus和linux-kernel的电子邮件流量很高,通常会在主题行前面加上[PATCH]
289+前缀。这使Linus和其他内核开发人员更容易将补丁与其他电子邮件讨论区分开。
290+
291+``git send-email`` 会自动为你加上。
292+
293+签署你的作品——开发者来源认证
294+------------------------------
295+
296+为了加强对谁做了何事的追踪,尤其是对那些透过好几层维护者才最终到达的补丁,我
297+们在通过邮件发送的补丁上引入了“签署(sign-off)”流程。
298+
299+“签署”是在补丁注释最后的一行简单文字,认证你编写了它或者其他
321300 人有权力将它作为开放源代码的补丁传递。规则很简单:如果你能认证如下信息:
322301
323−开发者来源证书 1.1
302+开发者来源认证 1.1
324303 ^^^^^^^^^^^^^^^^^^
325304
326305 对于本项目的贡献,我认证如下信息:
327306
328− (a)这些贡献是完全或者部分的由我创建,我有权利以文件中指出
307+ (a) 这些贡献是完全或者部分的由我创建,我有权利以文件中指出
329308 的开放源代码许可证提交它;或者
330− (b)这些贡献基于以前的工作,据我所知,这些以前的工作受恰当的开放
331− 源代码许可证保护,而且,根据许可证,我有权提交修改后的贡献,
309+
310+ (b) 这些贡献基于以前的工作,据我所知,这些以前的工作受恰当的开放
311+ 源代码许可证保护,而且,根据文件中指出的许可证,我有权提交修改后的贡献,
332312 无论是完全还是部分由我创造,这些贡献都使用同一个开放源代码许可证
333− (除非我被允许用其它的许可证),正如文件中指出的;或者
334− (c)这些贡献由认证(a),(b)或者(c)的人直接提供给我,而
313+ (除非我被允许用其它的许可证);或者
314+
315+ (c) 这些贡献由认证(a),(b)或者(c)的人直接提供给我,而
335316 且我没有修改它。
336− (d)我理解并同意这个项目和贡献是公开的,贡献的记录(包括我
337− 一起提交的个人记录,包括 sign-off )被永久维护并且可以和这个项目
317+
318+ (d) 我理解并同意这个项目和贡献是公开的,贡献的记录(包括我
319+ 一起提交的个人记录,包括sign-off)被永久维护并且可以和这个项目
338320 或者开放源代码的许可证同步地再发行。
339321
340322 那么加入这样一行::
341323
342− Signed-off-by: Random J Developer <random@developer.example.org>
343−
344−使用你的真名(抱歉,不能使用假名或者匿名。)
345−
346−有人在最后加上标签。现在这些东西会被忽略,但是你可以这样做,来标记公司
347−内部的过程,或者只是指出关于 sign-off 的一些特殊细节。
348−
349−如果您是子系统或分支维护人员,有时需要稍微修改收到的补丁,以便合并它们,
350−因为树和提交者中的代码不完全相同。如果你严格遵守规则(c),你应该要求提交者
351−重新发布,但这完全是在浪费时间和精力。规则(b)允许您调整代码,但是更改一个
352−提交者的代码并让他认可您的错误是非常不礼貌的。要解决此问题,建议在最后一个
353−由签名行和您的行之间添加一行,指示更改的性质。虽然这并不是强制性的,但似乎
354−在描述前加上您的邮件和/或姓名(全部用方括号括起来),这足以让人注意到您对最
355−后一分钟的更改负有责任。例如::
356−
357− Signed-off-by: Random J Developer <random@developer.example.org>
358− [lucky@maintainer.example.org: struct foo moved from foo.c to foo.h]
359− Signed-off-by: Lucky K Maintainer <lucky@maintainer.example.org>
360−
361−如果您维护一个稳定的分支机构,同时希望对作者进行致谢、跟踪更改、合并修复并
362−保护提交者不受投诉,那么这种做法尤其有用。请注意,在任何情况下都不能更改作者
363−的ID(From 头),因为它是出现在更改日志中的标识。
364−
365−对回合(back-porters)的特别说明:在提交消息的顶部(主题行之后)插入一个补丁
366−的起源指示似乎是一种常见且有用的实践,以便于跟踪。例如,下面是我们在3.x稳定
367−版本中看到的内容::
368−
369− Date: Tue Oct 7 07:26:38 2014 -0400
370−
371− libata: Un-break ATA blacklist
372−
373− commit 1c40279960bcd7d52dbdf1d466b20d24b99176c8 upstream.
374−
375−还有, 这里是一个旧版内核中的一个回合补丁::
324+ Signed-off-by: Random J Developer <random@developer.example.org>
376325
377− Date: Tue May 13 22:12:27 2008 +0200
326+使用你的真名(抱歉,不能使用假名或者匿名。)如果使用 ``git commit -s`` 的话
327+将会自动完成。撤销也应当包含“Signed-off-by”, ``git revert -s`` 会帮你搞定。
378328
379− wireless, airo: waitbusy() won't delay
329+有些人会在最后加上额外的标签。现在这些东西会被忽略,但是你可以这样做,来标记
330+公司内部的过程,或者只是指出关于签署的一些特殊细节。
380331
381− [backport of 2.6 commit b7acbdfbd1f277c1eb23f344f899cfa4cd0bf36a]
332+作者签署之后的任何其他签署(Signed-off-by:'s)均来自处理和传递补丁的人员,但
333+未参与其开发。签署链应当反映补丁传播到维护者并最终传播到Linus所经过的 **真实**
334+路径,首个签署指明单个作者的主要作者身份。
382335
383−12)何时使用Acked-by:,CC:,和Co-Developed by:
384−----------------------------------------------
336+何时使用Acked-by:,CC:,和Co-Developed by:
337+------------------------------------------
385338
386−Singed-off-by: 标记表示签名者参与了补丁的开发,或者他/她在补丁的传递路径中。
339+Singed-off-by: 标签表示签名者参与了补丁的开发,或者他/她在补丁的传递路径中。
387340
388−如果一个人没有直接参与补丁的准备或处理,但希望表示并记录他们对补丁的批准,
389−那么他们可以要求在补丁的变更日志中添加一个 Acked-by:
341+如果一个人没有直接参与补丁的准备或处理,但希望表示并记录他们对补丁的批准/赞成,
342+那么他们可以要求在补丁的变更日志中添加一个Acked-by:。
390343
391−Acked-by:通常由受影响代码的维护者使用,当该维护者既没有贡献也没有转发补丁时。
344+Acked-by: 通常由受影响代码的维护者使用,当该维护者既没有贡献也没有转发补丁时。
392345
393−Acked-by: 不像签字人那样正式。这是一个记录,确认人至少审查了补丁,并表示接受。
394−因此,补丁合并有时会手动将Acker的“Yep,looks good to me”转换为 Acked-By:(但
346+Acked-by: 不像签署那样正式。这是一个记录,确认人至少审阅了补丁,并表示接受。
347+因此,补丁合并有时会手动将Acker的“Yep,looks good to me”转换为 Acked-By:(但
395348 请注意,通常最好要求一个明确的Ack)。
396349
397350 Acked-by:不一定表示对整个补丁的确认。例如,如果一个补丁影响多个子系统,并且
398−有一个:来自一个子系统维护者,那么这通常表示只确认影响维护者代码的部分。这里
399−应该仔细判断。如有疑问,应参考邮件列表档案中的原始讨论。
351+有一个来自某个子系统维护者的Acked-By:,那么这通常表示只确认影响维护者代码的部
352+分。这里应该仔细判断。如有疑问,应参考邮件列表存档中的原始讨论。
400353
401−如果某人有机会对补丁进行评论,但没有提供此类评论,您可以选择在补丁中添加 ``Cc:``
402−这是唯一一个标签,它可以在没有被它命名的人显式操作的情况下添加,但它应该表明
403−这个人是在补丁上抄送的。讨论中包含了潜在利益相关方。
354+如果某人本应有机会对补丁进行评论,但没有提供此类评论,您可以选择在补丁中添加
355+``Cc:`` 这是唯一可以在没有被该人明确同意的情况下添加的标签——但它应该表明
356+这个人是在补丁上抄送的。此标签记录了讨论中包含的潜在利益相关方。
404357
405358 Co-developed-by: 声明补丁是由多个开发人员共同创建的;当几个人在一个补丁上工
406−作时,它用于将属性赋予共同作者(除了 From: 所赋予的作者之外)。因为
407−Co-developed-by: 表示作者身份,所以每个共同开发人:必须紧跟在相关合作作者的
408−签名之后。标准的签核程序要求:标记的签核顺序应尽可能反映补丁的时间历史,而不
409−管作者是通过 From :还是由 Co-developed-by: 共同开发的。值得注意的是,最后一
410−个签字人:必须始终是提交补丁的开发人员。
359+作时,它用于给出共同作者(除了From:所给出的作者之外)。因为Co-developed-by:
360+表示作者身份,所以每个Co-developed-by:必须紧跟在相关合作作者的签署之后。标准
361+签署程序要求Singed-off-by:标签的顺序应尽可能反映补丁的时间历史,无论作者是通
362+过From:还是Co-developed-by:表明。值得注意的是,最后一个Singed-off-by:必须是
363+提交补丁的开发人员。
411364
412−注意,当作者也是电子邮件标题“发件人:”行中列出的人时,“From: ” 标记是可选的。
365+注意,如果From:作者也是电子邮件标题的From:行中列出的人,则From:标签是可选的。
413366
414−作者提交的补丁程序示例::
367+被From:作者提交的补丁示例::
415368
416369 <changelog>
417370
@@ -421,7 +374,7 @@ Co-developed-by: 表示作者身份,所以每个共同开发人:必须紧跟 · 3 unmodified lines
421374 Signed-off-by: Second Co-Author <second@coauthor.example.org>
422375 Signed-off-by: From Author <from@author.example.org>
423376
424−合作开发者提交的补丁示例::
377+被合作开发者提交的补丁示例::
425378
426379 From: From Author <from@author.example.org>
427380
@@ -434,76 +387,85 @@ Co-developed-by: 表示作者身份,所以每个共同开发人:必须紧跟 · 6 unmodified lines
434387 Signed-off-by: Submitting Co-Author <sub@coauthor.example.org>
435388
436389
437−13)使用报告人:、测试人:、审核人:、建议人:、修复人:
438−--------------------------------------------------------
390+使用Reported-by:、Tested-by:、Reviewed-by:、Suggested-by:和Fixes:
391+-----------------------------------------------------------------
439392
440393 Reported-by: 给那些发现错误并报告错误的人致谢,它希望激励他们在将来再次帮助
441−我们。请注意,如果bug是以私有方式报告的,那么在使用Reported-by标记之前,请
442−先请求权限。
394+我们。请注意,如果bug是以私有方式报告的,那么在使用Reported-by标签之前,请
395+先请求许可。此标签是为Bug设计的;请不要将其用于感谢功能请求。
443396
444−Tested-by: 标记表示补丁已由指定的人(在某些环境中)成功测试。这个标签通知
445−维护人员已经执行了一些测试,为将来的补丁提供了一种定位测试人员的方法,并确
446−保测试人员的信誉。
397+Tested-by: 标签表示补丁已由指定的人(在某些环境中)成功测试。这个标签通知
398+维护人员已经执行了一些测试,为将来的补丁提供了一种定位测试人员的方法,并彰显测试人员的功劳。
447399
448−Reviewed-by:相反,根据审查人的声明,表明该补丁已被审查并被认为是可接受的:
400+Reviewed-by:根据审阅者的监督声明,表明该补丁已被审阅并被认为是可接受的:
449401
450402
451−审查人的监督声明
403+审阅者的监督声明
452404 ^^^^^^^^^^^^^^^^
453405
454−通过提供我的 Reviewed-by,我声明:
406+通过提供我的Reviewed-by:标签,我声明:
455407
456− (a) 我已经对这个补丁进行了一次技术审查,以评估它是否适合被包含到
408+ (a) 我已经对这个补丁进行了一次技术审阅,以评估它是否适合被包含到
457409 主线内核中。
458410
459411 (b) 与补丁相关的任何问题、顾虑或问题都已反馈给提交者。我对提交者对
460412 我的评论的回应感到满意。
461413
462− (c) 虽然这一提交可能会改进一些东西,但我相信,此时,(1)对内核
414+ (c) 虽然这一提交可能仍可被改进,但我相信,此时,(1)对内核
463415 进行了有价值的修改,(2)没有包含争论中涉及的已知问题。
464416
465− (d) 虽然我已经审查了补丁并认为它是健全的,但我不会(除非另有明确
466− 说明)作出任何保证或保证它将在任何给定情况下实现其规定的目的
417+ (d) 虽然我已经审阅了补丁并认为它是健全的,但我不会(除非另有明确
418+ 说明)作出任何保证或担保它会在任何给定情况下实现其规定的目的
467419 或正常运行。
468420
469−Reviewed-by 是一种观点声明,即补丁是对内核的适当修改,没有任何遗留的严重技术
470−问题。任何感兴趣的审阅者(完成工作的人)都可以为一个补丁提供一个 Review-by
471−标签。此标签用于向审阅者提供致谢,并通知维护者已在修补程序上完成的审阅程度。
472−Reviewed-by: 当由已知了解主题区域并执行彻底检查的审阅者提供时,通常会增加
421+Reviewed-by是一种观点声明,即补丁是对内核的适当修改,没有任何遗留的严重技术
422+问题。任何感兴趣的审阅者(完成工作的人)都可以为一个补丁提供一个Reviewed-by
423+标签。此标签用于向审阅者提供致谢,并通知维护者补丁的审阅进度。
424+当Reviewed-by:标签由已知了解主题区域并执行彻底检查的审阅者提供时,通常会增加
473425 补丁进入内核的可能性。
474426
427+一旦从测试人员或审阅者的“Tested-by”和“Reviewed-by”标签出现在邮件列表中,
428+作者应在发送下一个版本时将其添加到适用的补丁中。但是,如果补丁在以下版本中发
429+生了实质性更改,这些标签可能不再适用,因此应该删除。通常,在补丁更改日志中
430+(在 ``---`` 分隔符之后)应该提到删除某人的测试者或审阅者标签。
431+
475432 Suggested-by: 表示补丁的想法是由指定的人提出的,并确保将此想法归功于指定的
476433 人。请注意,未经许可,不得添加此标签,特别是如果该想法未在公共论坛上发布。
477−这就是说,如果我们勤快地致谢我们的创意者,他们很有希望在未来得到鼓舞,再次
434+也就是说,如果我们勤快地致谢创意提供者,他们将受到鼓舞,很有希望在未来再次
478435 帮助我们。
479436
480−Fixes: 指示补丁在以前的提交中修复了一个问题。它可以很容易地确定错误的来源,
481−这有助于检查错误修复。这个标记还帮助稳定内核团队确定应该接收修复的稳定内核
482−版本。这是指示补丁修复的错误的首选方法。请参阅 :ref:`cn_describe_changes`
483−描述您的更改以了解更多详细信息。
437+Fixes: 指示补丁修复了之前提交的一个问题。它可以便于确定错误的来源,这有助于
438+检查错误修复。这个标签还帮助稳定内核团队确定应该接收修复的稳定内核版本。这是
439+指示补丁修复的错误的首选方法。请参阅 :ref:`zh_describe_changes` 了解更多信息。
484440
485−.. _cn_the_canonical_patch_format:
441+.. note::
486442
487−12)标准补丁格式
488−----------------
443+ 附加Fixes:标签不会改变稳定内核规则流程,也不改变所有稳定版补丁抄送
444+ stable@vger.kernel.org的要求。有关更多信息,请阅读
445+ Documentation/translations/zh_CN/process/stable-kernel-rules.rst 。
446+
447+.. _zh_the_canonical_patch_format:
448+
449+标准补丁格式
450+------------
489451
490452 本节描述如何格式化补丁本身。请注意,如果您的补丁存储在 ``Git`` 存储库中,则
491−可以使用 ``git format-patch`` 进行正确的补丁格式设置。但是,这些工具无法创建
453+可以使用 ``git format-patch`` 进行正确的补丁格式化。但是,这些工具无法创建
492454 必要的文本,因此请务必阅读下面的说明。
493455
494−标准的补丁,标题行是::
456+标准的补丁标题行是::
495457
496458 Subject: [PATCH 001/123] 子系统:一句话概述
497459
498−标准补丁的信体存在如下部分:
460+标准补丁的信体包含如下部分:
499461
500− - 一个 "from" 行指出补丁作者。后跟空行(仅当发送修补程序的人不是作者时才需要)。
462+ - 一个 ``from`` 行指出补丁作者。后跟空行(仅当发送补丁的人不是作者时才需要)。
501463
502− - 解释的正文,行以75列包装,这将被复制到永久变更日志来描述这个补丁。
464+ - 说明文字,每行最长75列,这将被复制到永久变更日志来描述这个补丁。
503465
504466 - 一个空行
505467
506− - 上面描述的“Signed-off-by” 行,也将出现在更改日志中。
468+ - 上述的 ``Signed-off-by:`` 行,也将出现在更改日志中。
507469
508470 - 只包含 ``---`` 的标记线。
509471
@@ -511,29 +473,29 @@ Fixes: 指示补丁在以前的提交中修复了一个问题。它可以很容 · 1 unmodified line
511473
512474 - 实际补丁( ``diff`` 输出)。
513475
514−标题行的格式,使得对标题行按字母序排序非常的容易 - 很多 e-mail 客户端都
515−可以支持 - 因为序列号是用零填充的,所以按数字排序和按字母排序是一样的。
476+标题行的格式,使得对标题行按字母序排序非常的容易——很多邮件客户端都
477+可以支持——因为序列号是用零填充的,所以按数字排序和按字母排序是一样的。
516478
517−e-mail 标题中的“子系统”标识哪个内核子系统将被打补丁。
479+邮件标题中的“子系统”标识哪个内核子系统将被打补丁。
518480
519−e-mail 标题中的“一句话概述”扼要的描述 e-mail 中的补丁。“一句话概述”
481+邮件标题中的“一句话概述”扼要的描述邮件中的补丁。“一句话概述”
520482 不应该是一个文件名。对于一个补丁系列(“补丁系列”指一系列的多个相关补
521483 丁),不要对每个补丁都使用同样的“一句话概述”。
522484
523−记住 e-mail 的“一句话概述”会成为该补丁的全局唯一标识。它会蔓延到 git
485+记住邮件的“一句话概述”会成为该补丁的全局唯一标识。它会进入 ``git``
524486 的改动记录里。然后“一句话概述”会被用在开发者的讨论里,用来指代这个补
525−丁。用户将希望通过 google 来搜索"一句话概述"来找到那些讨论这个补丁的文
487+丁。用户将希望通过搜索引擎搜索“一句话概述”来找到那些讨论这个补丁的文
526488 章。当人们在两三个月后使用诸如 ``gitk`` 或 ``git log --oneline`` 之类
527489 的工具查看数千个补丁时,也会很快看到它。
528490
529491 出于这些原因,概述必须不超过70-75个字符,并且必须描述补丁的更改以及为
530−什么需要补丁。既要简洁又要描述性很有挑战性,但写得好的概述应该这样做。
492+什么需要补丁。既要简洁又要描述性很有挑战性,但写得好的概述应该这样。
531493
532494 概述的前缀可以用方括号括起来:“Subject: [PATCH <tag>...] <概述>”。标记
533495 不被视为概述的一部分,而是描述应该如何处理补丁。如果补丁的多个版本已发
534−送出来以响应评审(即“v1,v2,v3”)或“rfc”,以指示评审请求,那么通用标记
535−可能包括版本描述符。如果一个补丁系列中有四个补丁,那么各个补丁可以这样
536−编号:1/4、2/4、3/4、4/4。这可以确保开发人员了解补丁应用的顺序,并且他们
496+送出来以响应评审(即“v1,v2,v3”)则必须包含版本号,或包含“RFC”以指示
497+评审请求。如果一个补丁系列中有四个补丁,那么各个补丁可以这样编号:1/4、2/4、
498+3/4、4/4。这可以确保开发人员了解补丁应用的顺序,且
537499 已经查看或应用了补丁系列中的所有补丁。
538500
539501 一些标题的例子::
@@ -541,95 +503,134 @@ e-mail 标题中的“一句话概述”扼要的描述 e-mail 中的补丁。 · 1 unmodified line
541503 Subject: [patch 2/5] ext2: improve scalability of bitmap searching
542504 Subject: [PATCHv2 001/207] x86: fix eflags tracking
543505
544−"From" 行是信体里的最上面一行,具有如下格式:
506+``From`` 行是信体里的最上面一行,具有如下格式::
507+
545508 From: Patch Author <author@example.com>
546509
547−"From" 行指明在永久改动日志里,谁会被确认为作者。如果没有 "From" 行,那
548−么邮件头里的 "From: " 行会被用来决定改动日志中的作者。
510+``From`` 行指明在永久改动日志里,谁会被确认为作者。如果没有 ``From`` 行,那
511+么邮件头里的 ``From:`` 行会被用来决定改动日志中的作者。
549512
550−说明的主题将会被提交到永久的源代码改动日志里,因此对那些早已经不记得和
551−这个补丁相关的讨论细节的有能力的读者来说,是有意义的。包括补丁程序定位
552−错误的(内核日志消息、OOPS消息等)症状,对于搜索提交日志以寻找适用补丁的人
553−尤其有用。如果一个补丁修复了一个编译失败,那么可能不需要包含所有编译失败;
513+说明文字将会被提交到永久的源代码改动日志里,因此应针对那些早已经不记得和这
514+个补丁相关的讨论细节的读者。包括补丁处理的故障症状(内核日志消息、oops消息
515+等),这对于可能正在搜索提交日志以查找适用补丁的人特别有用。文本应该写得如
516+此详细,以便在数周、数月甚至数年后阅读时,能够为读者提供所需的细节信息,以
517+掌握创建补丁的 **原因** 。
518+
519+如果一个补丁修复了一个编译失败,那么可能不需要包含 *所有* 编译失败;
554520 只要足够让搜索补丁的人能够找到它就行了。与概述一样,既要简洁又要描述性。
555521
556−"---" 标记行对于补丁处理工具要找到哪里是改动日志信息的结束,是不可缺少
522+``---`` 标记行对于补丁处理工具要找到哪里是改动日志信息的结束,是不可缺少
557523 的。
558524
559−对于 "---" 标记之后的额外注解,一个好的用途就是用来写 diffstat,用来显
560−示修改了什么文件和每个文件都增加和删除了多少行。diffstat 对于比较大的补
561−丁特别有用。其余那些只是和时刻或者开发者相关的注解,不合适放到永久的改
562−动日志里的,也应该放这里。
563−使用 diffstat的选项 "-p 1 -w 70" 这样文件名就会从内核源代码树的目录开始
525+对于 ``---`` 标记之后的额外注解,一个好的用途就是用来写 ``diffstat`` ,用来显
526+示修改了什么文件和每个文件都增加和删除了多少行。 ``diffstat`` 对于比较大的补
527+丁特别有用。
528+使用 ``diffstat`` 的选项 ``-p 1 -w 70`` 这样文件名就会从内核源代码树的目录开始
564529 ,不会占用太宽的空间(很容易适合80列的宽度,也许会有一些缩进。)
530+( ``git`` 默认会生成合适的diffstat。)
531+
532+其余那些只适用于当时或者与维护者相关的注解,不合适放到永久的改动日志里的,也
533+应该放这里。较好的例子就是 ``补丁更改记录`` ,记录了v1和v2版本补丁之间的差异。
534+
535+请将此信息放在将变更日志与补丁的其余部分分隔开的 ``---`` 行 **之后** 。版本
536+信息不是提交到git树的变更日志的一部分。只是供审阅人员使用的附加信息。如果将
537+其放置在提交标记上方,则需要手动交互才能将其删除。如果它位于分隔线以下,则在
538+应用补丁时会自动剥离::
539+
540+ <commit message>
541+ ...
542+ Signed-off-by: Author <author@mail>
543+ ---
544+ V2 -> V3: Removed redundant helper function
545+ V1 -> V2: Cleaned up coding style and addressed review comments
565546
566−在后面的参考资料中能看到适当的补丁格式的更多细节。
547+ path/to/file | 5+++--
548+ ...
567549
568−.. _cn_explicit_in_reply_to:
550+在后面的参考资料中能看到正确补丁格式的更多细节。
569551
570−15) 明确回复邮件头(In-Reply-To)
571−-------------------------------
552+.. _zh_backtraces:
572553
573−手动添加回复补丁的的标题头(In-Reply_To:) 是有帮助的(例如,使用 ``git send-email`` )
574−将补丁与以前的相关讨论关联起来,例如,将bug修复程序链接到电子邮件和bug报告。
554+提交消息中的回溯(Backtraces)
555+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
556+
557+回溯有助于记录导致问题的调用链。然而,并非所有回溯都有帮助。例如,早期引导调
558+用链是独特而明显的。而逐字复制完整的dmesg输出则会增加时间戳、模块列表、寄存
559+器和堆栈转储等分散注意力的信息。
560+
561+因此,最有用的回溯应该从转储中提取相关信息,以更容易集中在真实问题上。下面是
562+一个剪裁良好的回溯示例::
563+
564+ unchecked MSR access error: WRMSR to 0xd51 (tried to write 0x0000000000000064)
565+ at rIP: 0xffffffffae059994 (native_write_msr+0x4/0x20)
566+ Call Trace:
567+ mba_wrmsr
568+ update_domains
569+ rdtgroup_mkdir
570+
571+.. _zh_explicit_in_reply_to:
572+
573+明确回复邮件头(In-Reply-To)
574+-----------------------------
575+
576+手动添加回复补丁的的邮件头(In-Reply_To:)是有用的(例如,使用 ``git send-email`` ),
577+可以将补丁与以前的相关讨论关联起来,例如,将bug补丁链接到电子邮件和bug报告。
575578 但是,对于多补丁系列,最好避免在回复时使用链接到该系列的旧版本。这样,
576−补丁的多个版本就不会成为电子邮件客户端中无法管理的引用序列。如果链接有用,
579+补丁的多个版本就不会成为电子邮件客户端中无法管理的引用树。如果链接有用,
577580 可以使用 https://lore.kernel.org/ 重定向器(例如,在封面电子邮件文本中)
578581 链接到补丁系列的早期版本。
579582
580−16) 发送git pull请求
581−--------------------
582−
583−如果您有一系列补丁,那么让维护人员通过git pull操作将它们直接拉入子系统存储
584−库可能是最方便的。但是,请注意,从开发人员那里获取补丁比从邮件列表中获取补
585−丁需要更高的信任度。因此,许多子系统维护人员不愿意接受请求,特别是来自新的
586−未知开发人员的请求。如果有疑问,您可以在封面邮件中使用pull 请求作为补丁系列
587−正常发布的一个选项,让维护人员可以选择使用其中之一。
588−
589−pull 请求的主题行中应该有[Git Pull]。请求本身应该在一行中包含存储库名称和
590−感兴趣的分支;它应该看起来像::
583+给出基础树信息
584+--------------
591585
592− Please pull from
586+当其他开发人员收到您的补丁并开始审阅时,知道应该将您的工作放到代码树历史记录
587+中的什么位置通常很有用。这对于自动化持续集成流水(CI)特别有用,这些流水线试
588+图运行一系列测试,以便在维护人员开始审阅之前确定提交的质量。
593589
594− git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus
590+如果您使用 ``git format-patch`` 生成补丁,则可以通过 ``--base`` 标志在提交中
591+自动包含基础树信息。使用此选项最简单、最方便的方法是配合主题分支::
595592
596− to get these changes:
593+ $ git checkout -t -b my-topical-branch master
594+ Branch 'my-topical-branch' set up to track local branch 'master'.
595+ Switched to a new branch 'my-topical-branch'
597596
597+ [perform your edits and commits]
598598
599−pull 请求还应该包含一条整体消息,说明请求中将包含什么,一个补丁本身的 ``Git shortlog``
600−以及一个显示补丁系列整体效果的 ``diffstat`` 。当然,将所有这些信息收集在一起
601−的最简单方法是让 ``git`` 使用 ``git request-pull`` 命令为您完成这些工作。
599+ $ git format-patch --base=auto --cover-letter -o outgoing/ master
600+ outgoing/0000-cover-letter.patch
601+ outgoing/0001-First-Commit.patch
602+ outgoing/...
602603
603−一些维护人员(包括Linus)希望看到来自已签名提交的请求;这增加了他们对你的
604−请求信心。特别是,在没有签名标签的情况下,Linus 不会从像 Github 这样的公共
605−托管站点拉请求。
604+当你编辑 ``outgoing/0000-cover-letter.patch`` 时,您会注意到在它的最底部有一
605+行 ``base-commit:`` 尾注,它为审阅者和CI工具提供了足够的信息以正确执行
606+``git am`` 而不必担心冲突::
606607
607−创建此类签名的第一步是生成一个 GNRPG 密钥,并由一个或多个核心内核开发人员对
608−其进行签名。这一步对新开发人员来说可能很困难,但没有办法绕过它。参加会议是
609−找到可以签署您的密钥的开发人员的好方法。
608+ $ git checkout -b patch-review [base-commit-id]
609+ Switched to a new branch 'patch-review'
610+ $ git am patches.mbox
611+ Applying: First Commit
612+ Applying: ...
610613
611−一旦您在Git 中准备了一个您希望有人拉的补丁系列,就用 ``git tag -s`` 创建一
612−个签名标记。这将创建一个新标记,标识该系列中的最后一次提交,并包含用您的私
613−钥创建的签名。您还可以将changelog样式的消息添加到标记中;这是一个描述拉请求
614−整体效果的理想位置。
614+有关此选项的更多信息,请参阅 ``man git-format-patch`` 。
615615
616−如果维护人员将要从中提取的树不是您正在使用的存储库,请不要忘记将已签名的标记
617−显式推送到公共树。
616+.. note::
618617
619−生成拉请求时,请使用已签名的标记作为目标。这样的命令可以实现::
618+ ``--base`` 功能是在2.9.0版git中引入的。
620619
621− git request-pull master git://my.public.tree/linux.git my-signed-tag
620+如果您不使用git格式化补丁,仍然可以包含相同的 ``base-commit`` 尾注,以指示您
621+的工作所基于的树的提交哈希。你应该在封面邮件或系列的第一个补丁中添加它,它应
622+该放在 ``---`` 行的下面或所有其他内容之后,即只在你的电子邮件签名之前。
622623
623624 参考文献
624625 --------
625626
626−Andrew Morton, "The perfect patch" (tpp).
627+Andrew Morton,“完美的补丁”(tpp)
627628 <https://www.ozlabs.org/~akpm/stuff/tpp.txt>
628629
629−Jeff Garzik, "Linux kernel patch submission format".
630+Jeff Garzik,“Linux内核补丁提交格式”
630631 <https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html>
631632
632−Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer".
633+Greg Kroah-Hartman,“如何惹恼内核子系统维护人员”
633634 <http://www.kroah.com/log/linux/maintainer.html>
634635
635636 <http://www.kroah.com/log/linux/maintainer-02.html>
@@ -642,16 +643,15 @@ Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". · 6 unmodified lines
642643
643644 <http://www.kroah.com/log/linux/maintainer-06.html>
644645
645−NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
646+不!!!别再发巨型补丁炸弹给linux-kernel@vger.kernel.org的人们了!
646647 <https://lore.kernel.org/r/20050711.125305.08322243.davem@davemloft.net>
647648
648−Kernel Documentation/process/coding-style.rst:
649− :ref:`Documentation/translations/zh_CN/process/coding-style.rst <cn_codingstyle>`
649+内核 Documentation/translations/zh_CN/process/coding-style.rst
650650
651−Linus Torvalds's mail on the canonical patch format:
651+Linus Torvalds关于标准补丁格式的邮件
652652 <https://lore.kernel.org/r/Pine.LNX.4.58.0504071023190.28951@ppc970.osdl.org>
653653
654−Andi Kleen, "On submitting kernel patches"
655− Some strategies to get difficult or controversial changes in.
654+Andi Kleen,“提交补丁之路”
655+ 一些帮助合入困难或有争议的变更的策略。
656656
657657 http://halobates.de/on-submitting-patches.pdf
Documentation/translations/zh_CN/scheduler/sched-design-CFS.rst+1−1
@@ -80,7 +80,7 @@ p->se.vruntime。一旦p->se.vruntime变得足够大,其它的任务将成为 · 79 unmodified lines
8080 CFS使用纳秒粒度的计时,不依赖于任何jiffies或HZ的细节。因此CFS并不像之前的调度器那样
8181 有“时间片”的概念,也没有任何启发式的设计。唯一可调的参数(你需要打开CONFIG_SCHED_DEBUG)是:
8282
83− /proc/sys/kernel/sched_min_granularity_ns
83+ /sys/kernel/debug/sched/min_granularity_ns
8484
8585 它可以用来将调度器从“桌面”模式(也就是低时延)调节为“服务器”(也就是高批处理)模式。
8686 它的默认设置是适合桌面的工作负载。SCHED_BATCH也被CFS调度器模块处理。
Documentation/translations/zh_TW/oops-tracing.txt+0−212
@@ -1,212 +0,0 @@
1−Chinese translated version of Documentation/admin-guide/bug-hunting.rst
2−
3−If you have any comment or update to the content, please contact the
4−original document maintainer directly. However, if you have a problem
5−communicating in English you can also ask the Chinese maintainer for
6−help. Contact the Chinese maintainer if this translation is outdated
7−or if there is a problem with the translation.
8−
9−Traditional Chinese maintainer: Hu Haowen <src.res@email.cn>
10−---------------------------------------------------------------------
11−Documentation/admin-guide/bug-hunting.rst 的繁體中文版翻譯
12−
13−如果想評論或更新本文的內容,請直接聯繫原文檔的維護者。如果你使用英文
14−交流有困難的話,也可以向繁體中文版維護者求助。如果本翻譯更新不及時或
15−者翻譯存在問題,請聯繫繁體中文版維護者。
16−
17−繁體中文版維護者: 胡皓文 Hu Haowen <src.res@email.cn>
18−繁體中文版翻譯者: 胡皓文 Hu Haowen <src.res@email.cn>
19−繁體中文版校譯者: 胡皓文 Hu Haowen <src.res@email.cn>
20−
21−以下爲正文
22−---------------------------------------------------------------------
23−
24−注意: ksymoops 在2.6中是沒有用的。 請以原有格式使用Oops(來自dmesg,等等)。
25−忽略任何這樣那樣關於「解碼Oops」或者「通過ksymoops運行」的文檔。 如果你貼出運行過
26−ksymoops的來自2.6的Oops,人們只會讓你重貼一次。
27−
28−快速總結
29−-------------
30−
31−發現Oops並發送給看似相關的內核領域的維護者。別太擔心對不上號。如果你不確定就發給
32−和你所做的事情相關的代碼的負責人。 如果可重現試著描述怎樣重構。 那甚至比oops更有
33−價值。
34−
35−如果你對於發送給誰一無所知, 發給linux-kernel@vger.kernel.org。感謝你幫助Linux
36−儘可能地穩定。
37−
38−Oops在哪裡?
39−----------------------
40−
41−通常Oops文本由klogd從內核緩衝區里讀取並傳給syslogd,由syslogd寫到syslog文件中,
42−典型地是/var/log/messages(依賴於/etc/syslog.conf)。有時klogd崩潰了,這種情況下你
43−能夠運行dmesg > file來從內核緩衝區中讀取數據並保存下來。 否則你可以
44−cat /proc/kmsg > file, 然而你必須介入中止傳輸, kmsg是一個「永不結束的文件」。如
45−果機器崩潰壞到你不能輸入命令或者磁碟不可用那麼你有三種選擇:-
46−
47−(1) 手抄屏幕上的文本待機器重啓後再輸入計算機。 麻煩但如果沒有針對崩潰的準備,
48−這是僅有的選擇。 另外,你可以用數位相機把屏幕拍下來-不太好,但比沒有強。 如果信
49−息滾動到了終端的上面,你會發現以高分辯率啓動(比如,vga=791)會讓你讀到更多的文
50−本。(注意:這需要vesafb,所以對『早期』的oops沒有幫助)
51−
52−(2)用串口終端啓動(請參看Documentation/admin-guide/serial-console.rst),運行一個null
53−modem到另一台機器並用你喜歡的通訊工具獲取輸出。Minicom工作地很好。
54−
55−(3)使用Kdump(請參看Documentation/admin-guide/kdump/kdump.rst),
56−使用在Documentation/admin-guide/kdump/gdbmacros.txt中定義的dmesg gdb宏,從舊的內存中提取內核
57−環形緩衝區。
58−
59−完整信息
60−----------------
61−
62−注意:以下來自於Linus的郵件適用於2.4內核。 我因爲歷史原因保留了它,並且因爲其中
63−一些信息仍然適用。 特別注意的是,請忽略任何ksymoops的引用。
64−
65−From: Linus Torvalds <torvalds@osdl.org>
66−
67−怎樣跟蹤Oops.. [原發到linux-kernel的一封郵件]
68−
69−主要的竅門是有五年和這些煩人的oops消息打交道的經驗;-)
70−
71−實際上,你有辦法使它更簡單。我有兩個不同的方法:
72−
73− gdb /usr/src/linux/vmlinux
74− gdb> disassemble <offending_function>
75−
76−那是發現問題的簡單辦法,至少如果bug報告做的好的情況下(象這個一樣-運行ksymoops
77−得到oops發生的函數及函數內的偏移)。
78−
79−哦,如果報告發生的內核以相同的編譯器和相似的配置編譯它會有幫助的。
80−
81−另一件要做的事是反彙編bug報告的「Code」部分:ksymoops也會用正確的工具來做這件事,
82−但如果沒有那些工具你可以寫一個傻程序:
83−
84− char str[] = "\xXX\xXX\xXX...";
85− main(){}
86−
87−並用gcc -g編譯它然後執行「disassemble str」(XX部分是由Oops報告的值-你可以僅剪切
88−粘貼並用「\x」替換空格-我就是這麼做的,因爲我懶得寫程序自動做這一切)。
89−
90−另外,你可以用scripts/decodecode這個shell腳本。它的使用方法是:
91−decodecode < oops.txt
92−
93−「Code」之後的十六進位字節可能(在某些架構上)有一些當前指令之前的指令字節以及
94−當前和之後的指令字節
95−
96−Code: f9 0f 8d f9 00 00 00 8d 42 0c e8 dd 26 11 c7 a1 60 ea 2b f9 8b 50 08 a1
97−64 ea 2b f9 8d 34 82 8b 1e 85 db 74 6d 8b 15 60 ea 2b f9 <8b> 43 04 39 42 54
98−7e 04 40 89 42 54 8b 43 04 3b 05 00 f6 52 c0
99−
100−最後,如果你想知道代碼來自哪裡,你可以:
101−
102− cd /usr/src/linux
103− make fs/buffer.s # 或任何產生BUG的文件
104−
105−然後你會比gdb反彙編更清楚的知道發生了什麼。
106−
107−現在,問題是把你所擁有的所有數據結合起來:C源碼(關於它應該怎樣的一般知識),
108−彙編代碼及其反彙編得到的代碼(另外還有從「oops」消息得到的寄存器狀態-對了解毀壞的
109−指針有用,而且當你有了彙編代碼你也能拿其它的寄存器和任何它們對應的C表達式做匹配
110−)。
111−
112−實際上,你僅需看看哪裡不匹配(這個例子是「Code」反彙編和編譯器生成的代碼不匹配)。
113−然後你須要找出爲什麼不匹配。通常很簡單-你看到代碼使用了空指針然後你看代碼想知道
114−空指針是怎麼出現的,還有檢查它是否合法..
115−
116−現在,如果明白這是一項耗時的工作而且需要一丁點兒的專心,沒錯。這就是我爲什麼大多
117−只是忽略那些沒有符號表信息的崩潰報告的原因:簡單的說太難查找了(我有一些
118−程序用於在內核代碼段中搜索特定的模式,而且有時我也已經能找出那些崩潰的地方,但是
119−僅僅是找出正確的序列也確實需要相當紮實的內核知識)
120−
121−_有時_會發生這種情況,我僅看到崩潰中的反彙編代碼序列, 然後我馬上就明白問題出在
122−哪裡。這時我才意識到自己幹這個工作已經太長時間了;-)
123−
124− Linus
125−
126−
127−---------------------------------------------------------------------------
128−關於Oops跟蹤的註解:
129−
130−爲了幫助Linus和其它內核開發者,klogd納入了大量的支持來處理保護錯誤。爲了擁有對
131−地址解析的完整支持至少應該使用1.3-pl3的sysklogd包。
132−
133−當保護錯誤發生時,klogd守護進程自動把內核日誌信息中的重要地址翻譯成它們相應的符
134−號。
135−
136−klogd執行兩種類型的地址解析。首先是靜態翻譯其次是動態翻譯。靜態翻譯和ksymoops
137−一樣使用System.map文件。爲了做靜態翻譯klogd守護進程必須在初始化時能找到system
138−map文件。關於klogd怎樣搜索map文件請參看klogd手冊頁。
139−
140−動態地址翻譯在使用內核可裝載模塊時很重要。 因爲內核模塊的內存是從內核動態內存池
141−里分配的,所以不管是模塊開始位置還是模塊中函數和符號的位置都不是固定的。
142−
143−內核支持允許程序決定裝載哪些模塊和它們在內存中位置的系統調用。使用這些系統調用
144−klogd守護進程生成一張符號表用於調試發生在可裝載模塊中的保護錯誤。
145−
146−至少klogd會提供產生保護錯誤的模塊名。還可有額外的符號信息供可裝載模塊開發者選擇
147−以從模塊中輸出符號信息。
148−
149−因爲內核模塊環境可能是動態的,所以必須有一種機制當模塊環境發生改變時來通知klogd
150−守護進程。 有一些可用的命令行選項允許klogd向當前執行中的守護進程發送信號,告知符
151−號信息應該被刷新了。 更多信息請參看klogd手冊頁。
152−
153−sysklogd發布時包含一個補丁修改了modules-2.0.0包,無論何時一個模塊裝載或者卸載都
154−會自動向klogd發送信號。打上這個補丁提供了必要的對調試發生於內核可裝載模塊的保護
155−錯誤的無縫支持。
156−
157−以下是被klogd處理過的發生在可裝載模塊中的一個保護錯誤例子:
158−---------------------------------------------------------------------------
159−Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc
160−Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000
161−Aug 29 09:51:01 blizard kernel: *pde = 00000000
162−Aug 29 09:51:01 blizard kernel: Oops: 0002
163−Aug 29 09:51:01 blizard kernel: CPU: 0
164−Aug 29 09:51:01 blizard kernel: EIP: 0010:[oops:_oops+16/3868]
165−Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212
166−Aug 29 09:51:01 blizard kernel: eax: 315e97cc ebx: 003a6f80 ecx: 001be77b edx: 00237c0c
167−Aug 29 09:51:01 blizard kernel: esi: 00000000 edi: bffffdb3 ebp: 00589f90 esp: 00589f8c
168−Aug 29 09:51:01 blizard kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
169−Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000)
170−Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001
171−Aug 29 09:51:01 blizard kernel: 00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00
172−Aug 29 09:51:01 blizard kernel: bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036
173−Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128]
174−Aug 29 09:51:01 blizard kernel: Code: c7 00 05 00 00 00 eb 08 90 90 90 90 90 90 90 90 89 ec 5d c3
175−---------------------------------------------------------------------------
176−
177−Dr. G.W. Wettstein Oncology Research Div. Computing Facility
178−Roger Maris Cancer Center INTERNET: greg@wind.rmcc.com
179−820 4th St. N.
180−Fargo, ND 58122
181−Phone: 701-234-7556
182−
183−
184−---------------------------------------------------------------------------
185−受汙染的內核
186−
187−一些oops報告在程序記數器之後包含字符串'Tainted: '。這表明內核已經被一些東西給汙
188−染了。 該字符串之後緊跟著一系列的位置敏感的字符,每個代表一個特定的汙染值。
189−
190− 1:'G'如果所有裝載的模塊都有GPL或相容的許可證,'P'如果裝載了任何的專有模塊。
191−沒有模塊MODULE_LICENSE或者帶有insmod認爲是與GPL不相容的的MODULE_LICENSE的模塊被
192−認定是專有的。
193−
194− 2:'F'如果有任何通過「insmod -f」被強制裝載的模塊,' '如果所有模塊都被正常裝載。
195−
196− 3:'S'如果oops發生在SMP內核中,運行於沒有證明安全運行多處理器的硬體。 當前這種
197−情況僅限於幾種不支持SMP的速龍處理器。
198−
199− 4:'R'如果模塊通過「insmod -f」被強制裝載,' '如果所有模塊都被正常裝載。
200−
201− 5:'M'如果任何處理器報告了機器檢查異常,' '如果沒有發生機器檢查異常。
202−
203− 6:'B'如果頁釋放函數發現了一個錯誤的頁引用或者一些非預期的頁標誌。
204−
205− 7:'U'如果用戶或者用戶應用程式特別請求設置汙染標誌,否則' '。
206−
207− 8:'D'如果內核剛剛死掉,比如有OOPS或者BUG。
208−
209−使用'Tainted: '字符串的主要原因是要告訴內核調試者,這是否是一個乾淨的內核亦或發
210−生了任何的不正常的事。汙染是永久的:即使出錯的模塊已經被卸載了,汙染值仍然存在,
211−以表明內核不再值得信任。
212−
Documentation/userspace-api/landlock.rst+17−16
@@ -8,7 +8,7 @@ Landlock: unprivileged access control · 7 unmodified lines
88 =====================================
99
1010 :Author: Mickaël Salaün
11−:Date: May 2022
11+:Date: September 2022
1212
1313 The goal of Landlock is to enable to restrict ambient rights (e.g. global
1414 filesystem access) for a set of processes. Because Landlock is a stackable
@@ -69,7 +69,7 @@ should try to protect users as much as possible whatever the kernel they are · 54 unmodified lines
6969 using. To avoid binary enforcement (i.e. either all security features or
7070 none), we can leverage a dedicated Landlock command to get the current version
7171 of the Landlock ABI and adapt the handled accesses. Let's check if we should
72−remove the `LANDLOCK_ACCESS_FS_REFER` access right which is only supported
72+remove the ``LANDLOCK_ACCESS_FS_REFER`` access right which is only supported
7373 starting with the second version of the ABI.
7474
7575 .. code-block:: c
@@ -128,7 +128,7 @@ descriptor. · 52 unmodified lines
128128 It may also be required to create rules following the same logic as explained
129129 for the ruleset creation, by filtering access rights according to the Landlock
130130 ABI version. In this example, this is not required because
131−`LANDLOCK_ACCESS_FS_REFER` is not allowed by any rule.
131+``LANDLOCK_ACCESS_FS_REFER`` is not allowed by any rule.
132132
133133 We now have a ruleset with one rule allowing read access to ``/usr`` while
134134 denying all other handled accesses for the filesystem. The next step is to
@@ -154,8 +154,8 @@ The current thread is now ready to sandbox itself with the ruleset. · 19 unmodified lines
154154 }
155155 close(ruleset_fd);
156156
157−If the `landlock_restrict_self` system call succeeds, the current thread is now
158−restricted and this policy will be enforced on all its subsequently created
157+If the ``landlock_restrict_self`` system call succeeds, the current thread is
158+now restricted and this policy will be enforced on all its subsequently created
159159 children as well. Once a thread is landlocked, there is no way to remove its
160160 security policy; only adding more restrictions is allowed. These threads are
161161 now in a new Landlock domain, merge of their parent one (if any) with the new
@@ -170,12 +170,13 @@ It is recommended setting access rights to file hierarchy leaves as much as · 8 unmodified lines
170170 possible. For instance, it is better to be able to have ``~/doc/`` as a
171171 read-only hierarchy and ``~/tmp/`` as a read-write hierarchy, compared to
172172 ``~/`` as a read-only hierarchy and ``~/tmp/`` as a read-write hierarchy.
173−Following this good practice leads to self-sufficient hierarchies that don't
173+Following this good practice leads to self-sufficient hierarchies that do not
174174 depend on their location (i.e. parent directories). This is particularly
175175 relevant when we want to allow linking or renaming. Indeed, having consistent
176176 access rights per directory enables to change the location of such directory
177177 without relying on the destination directory access rights (except those that
178−are required for this operation, see `LANDLOCK_ACCESS_FS_REFER` documentation).
178+are required for this operation, see ``LANDLOCK_ACCESS_FS_REFER``
179+documentation).
179180 Having self-sufficient hierarchies also helps to tighten the required access
180181 rights to the minimal set of data. This also helps avoid sinkhole directories,
181182 i.e. directories where data can be linked to but not linked from. However,
@@ -259,7 +260,7 @@ Backward and forward compatibility · 77 unmodified lines
259260
260261 Landlock is designed to be compatible with past and future versions of the
261262 kernel. This is achieved thanks to the system call attributes and the
262−associated bitflags, particularly the ruleset's `handled_access_fs`. Making
263+associated bitflags, particularly the ruleset's ``handled_access_fs``. Making
263264 handled access right explicit enables the kernel and user space to have a clear
264265 contract with each other. This is required to make sure sandboxing will not
265266 get stricter with a system update, which could break applications.
@@ -380,8 +381,8 @@ by the Documentation/admin-guide/cgroup-v1/memory.rst. · 114 unmodified lines
380381 Previous limitations
381382 ====================
382383
383−File renaming and linking (ABI 1)
384−---------------------------------
384+File renaming and linking (ABI < 2)
385+-----------------------------------
385386
386387 Because Landlock targets unprivileged access controls, it needs to properly
387388 handle composition of rules. Such property also implies rules nesting.
@@ -394,7 +395,7 @@ according to the potentially lost constraints. To protect against privilege · 6 unmodified lines
394395 escalations through renaming or linking, and for the sake of simplicity,
395396 Landlock previously limited linking and renaming to the same directory.
396397 Starting with the Landlock ABI version 2, it is now possible to securely
397−control renaming and linking thanks to the new `LANDLOCK_ACCESS_FS_REFER`
398+control renaming and linking thanks to the new ``LANDLOCK_ACCESS_FS_REFER``
398399 access right.
399400
400401 .. _kernel_support:
@@ -403,14 +404,14 @@ Kernel support · 2 unmodified lines
403404 ==============
404405
405406 Landlock was first introduced in Linux 5.13 but it must be configured at build
406−time with `CONFIG_SECURITY_LANDLOCK=y`. Landlock must also be enabled at boot
407+time with ``CONFIG_SECURITY_LANDLOCK=y``. Landlock must also be enabled at boot
407408 time as the other security modules. The list of security modules enabled by
408−default is set with `CONFIG_LSM`. The kernel configuration should then
409−contains `CONFIG_LSM=landlock,[...]` with `[...]` as the list of other
409+default is set with ``CONFIG_LSM``. The kernel configuration should then
410+contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other
410411 potentially useful security modules for the running system (see the
411−`CONFIG_LSM` help).
412+``CONFIG_LSM`` help).
412413
413−If the running kernel doesn't have `landlock` in `CONFIG_LSM`, then we can
414+If the running kernel does not have ``landlock`` in ``CONFIG_LSM``, then we can
414415 still enable it by adding ``lsm=landlock,[...]`` to
415416 Documentation/admin-guide/kernel-parameters.rst thanks to the bootloader
416417 configuration.
Documentation/virt/kvm/x86/mmu.rst+1−1
@@ -377,7 +377,7 @@ Emulating cr0.wp · 376 unmodified lines
377377 ================
378378
379379 If tdp is not enabled, the host must keep cr0.wp=1 so page write protection
380−works for the guest kernel, not guest guest userspace. When the guest
380+works for the guest kernel, not guest userspace. When the guest
381381 cr0.wp=1, this does not present a problem. However when the guest cr0.wp=0,
382382 we cannot map the permissions for gpte.u=1, gpte.w=0 to any spte (the
383383 semantics require allowing any guest kernel access plus user read access).
Documentation/w1/masters/ds2490.rst+1−1
@@ -52,7 +52,7 @@ Notes and limitations. · 51 unmodified lines
5252 clear the entire bulk in buffer. It would be possible to read the
5353 maximum buffer size to not run into this error condition, only extra
5454 bytes in the buffer is a logic error in the driver. The code should
55− should match reads and writes as well as data sizes. Reads and
55+ match reads and writes as well as data sizes. Reads and
5656 writes are serialized and the status verifies that the chip is idle
5757 (and data is available) before the read is executed, so it should
5858 not happen.
Documentation/w1/w1-generic.rst+1−1
@@ -113,7 +113,7 @@ generally only make sense when searching is disabled, as a search will · 112 unmodified lines
113113 redetect manually removed devices that are present and timeout manually
114114 added devices that aren't on the bus.
115115
116−Bus searches occur at an interval, specified as a summ of timeout and
116+Bus searches occur at an interval, specified as a sum of timeout and
117117 timeout_us module parameters (either of which may be 0) for as long as
118118 w1_master_search remains greater than 0 or is -1. Each search attempt
119119 decrements w1_master_search by 1 (down to 0) and increments
Documentation/x86/entry_64.rst+2−2
@@ -33,8 +33,8 @@ Some of these entries are: · 32 unmodified lines
3333 - interrupt: An array of entries. Every IDT vector that doesn't
3434 explicitly point somewhere else gets set to the corresponding
3535 value in interrupts. These point to a whole array of
36− magically-generated functions that make their way to do_IRQ with
37− the interrupt number as a parameter.
36+ magically-generated functions that make their way to common_interrupt()
37+ with the interrupt number as a parameter.
3838
3939 - APIC interrupts: Various special-purpose interrupts for things
4040 like TLB shootdown.
Documentation/x86/microcode.rst+107−9
@@ -6,6 +6,7 @@ The Linux Microcode Loader · 5 unmodified lines
66
77 :Authors: - Fenghua Yu <fenghua.yu@intel.com>
88 - Borislav Petkov <bp@suse.de>
9+ - Ashok Raj <ashok.raj@intel.com>
910
1011 The kernel has a x86 microcode loading facility which is supposed to
1112 provide microcode loading methods in the OS. Potential use cases are
@@ -92,15 +93,8 @@ vendor's site. · 80 unmodified lines
9293 Late loading
9394 ============
9495
95−There are two legacy user space interfaces to load microcode, either through
96−/dev/cpu/microcode or through /sys/devices/system/cpu/microcode/reload file
97−in sysfs.
98−
99−The /dev/cpu/microcode method is deprecated because it needs a special
100−userspace tool for that.
101−
102−The easier method is simply installing the microcode packages your distro
103−supplies and running::
96+You simply install the microcode packages your distro supplies and
97+run::
10498
10599 # echo 1 > /sys/devices/system/cpu/microcode/reload
106100
@@ -110,6 +104,110 @@ The loading mechanism looks for microcode blobs in · 3 unmodified lines
110104 /lib/firmware/{intel-ucode,amd-ucode}. The default distro installation
111105 packages already put them there.
112106
107+Since kernel 5.19, late loading is not enabled by default.
108+
109+The /dev/cpu/microcode method has been removed in 5.19.
110+
111+Why is late loading dangerous?
112+==============================
113+
114+Synchronizing all CPUs
115+----------------------
116+
117+The microcode engine which receives the microcode update is shared
118+between the two logical threads in a SMT system. Therefore, when
119+the update is executed on one SMT thread of the core, the sibling
120+"automatically" gets the update.
121+
122+Since the microcode can "simulate" MSRs too, while the microcode update
123+is in progress, those simulated MSRs transiently cease to exist. This
124+can result in unpredictable results if the SMT sibling thread happens to
125+be in the middle of an access to such an MSR. The usual observation is
126+that such MSR accesses cause #GPs to be raised to signal that former are
127+not present.
128+
129+The disappearing MSRs are just one common issue which is being observed.
130+Any other instruction that's being patched and gets concurrently
131+executed by the other SMT sibling, can also result in similar,
132+unpredictable behavior.
133+
134+To eliminate this case, a stop_machine()-based CPU synchronization was
135+introduced as a way to guarantee that all logical CPUs will not execute
136+any code but just wait in a spin loop, polling an atomic variable.
137+
138+While this took care of device or external interrupts, IPIs including
139+LVT ones, such as CMCI etc, it cannot address other special interrupts
140+that can't be shut off. Those are Machine Check (#MC), System Management
141+(#SMI) and Non-Maskable interrupts (#NMI).
142+
143+Machine Checks
144+--------------
145+
146+Machine Checks (#MC) are non-maskable. There are two kinds of MCEs.
147+Fatal un-recoverable MCEs and recoverable MCEs. While un-recoverable
148+errors are fatal, recoverable errors can also happen in kernel context
149+are also treated as fatal by the kernel.
150+
151+On certain Intel machines, MCEs are also broadcast to all threads in a
152+system. If one thread is in the middle of executing WRMSR, a MCE will be
153+taken at the end of the flow. Either way, they will wait for the thread
154+performing the wrmsr(0x79) to rendezvous in the MCE handler and shutdown
155+eventually if any of the threads in the system fail to check in to the
156+MCE rendezvous.
157+
158+To be paranoid and get predictable behavior, the OS can choose to set
159+MCG_STATUS.MCIP. Since MCEs can be at most one in a system, if an
160+MCE was signaled, the above condition will promote to a system reset
161+automatically. OS can turn off MCIP at the end of the update for that
162+core.
163+
164+System Management Interrupt
165+---------------------------
166+
167+SMIs are also broadcast to all CPUs in the platform. Microcode update
168+requests exclusive access to the core before writing to MSR 0x79. So if
169+it does happen such that, one thread is in WRMSR flow, and the 2nd got
170+an SMI, that thread will be stopped in the first instruction in the SMI
171+handler.
172+
173+Since the secondary thread is stopped in the first instruction in SMI,
174+there is very little chance that it would be in the middle of executing
175+an instruction being patched. Plus OS has no way to stop SMIs from
176+happening.
177+
178+Non-Maskable Interrupts
179+-----------------------
180+
181+When thread0 of a core is doing the microcode update, if thread1 is
182+pulled into NMI, that can cause unpredictable behavior due to the
183+reasons above.
184+
185+OS can choose a variety of methods to avoid running into this situation.
186+
187+
188+Is the microcode suitable for late loading?
189+-------------------------------------------
190+
191+Late loading is done when the system is fully operational and running
192+real workloads. Late loading behavior depends on what the base patch on
193+the CPU is before upgrading to the new patch.
194+
195+This is true for Intel CPUs.
196+
197+Consider, for example, a CPU has patch level 1 and the update is to
198+patch level 3.
199+
200+Between patch1 and patch3, patch2 might have deprecated a software-visible
201+feature.
202+
203+This is unacceptable if software is even potentially using that feature.
204+For instance, say MSR_X is no longer available after an update,
205+accessing that MSR will cause a #GP fault.
206+
207+Basically there is no way to declare a new microcode update suitable
208+for late-loading. This is another one of the problems that caused late
209+loading to be not enabled by default.
210+
113211 Builtin microcode
114212 =================
115213
MAINTAINERS+21−5
@@ -348,7 +348,6 @@ M: "Rafael J. Wysocki" <rafael@kernel.org> · 347 unmodified lines
348348 R: Len Brown <lenb@kernel.org>
349349 L: linux-acpi@vger.kernel.org
350350 S: Supported
351−W: https://01.org/linux-acpi
352351 Q: https://patchwork.kernel.org/project/linux-acpi/list/
353352 B: https://bugzilla.kernel.org
354353 T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
@@ -427,7 +426,6 @@ M: Rafael J. Wysocki <rafael@kernel.org> · 72 unmodified lines
427426 R: Zhang Rui <rui.zhang@intel.com>
428427 L: linux-acpi@vger.kernel.org
429428 S: Supported
430−W: https://01.org/linux-acpi
431429 B: https://bugzilla.kernel.org
432430 F: drivers/acpi/*thermal*
433431
@@ -2678,7 +2676,6 @@ M: Russell King <linux@armlinux.org.uk> · 2244 unmodified lines
26782676 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
26792677 S: Maintained
26802678 W: http://www.armlinux.org.uk/
2681−F: arch/arm/include/asm/hardware/entry-macro-iomd.S
26822679 F: arch/arm/include/asm/hardware/ioc.h
26832680 F: arch/arm/include/asm/hardware/iomd.h
26842681 F: arch/arm/include/asm/hardware/memc.h
@@ -3833,6 +3830,7 @@ F: kernel/bpf/dispatcher.c · 1148 unmodified lines
38333830 F: kernel/bpf/trampoline.c
38343831 F: include/linux/bpf*
38353832 F: include/linux/filter.h
3833+F: include/linux/tnum.h
38363834
38373835 BPF [BTF]
38383836 M: Martin KaFai Lau <martin.lau@linux.dev>
@@ -7689,7 +7687,6 @@ R: Kees Cook <keescook@chromium.org> · 3850 unmodified lines
76897687 L: linux-mm@kvack.org
76907688 S: Supported
76917689 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
7692−F: arch/alpha/kernel/binfmt_loader.c
76937690 F: fs/*binfmt_*.c
76947691 F: fs/exec.c
76957692 F: include/linux/binfmts.h
@@ -8006,6 +8003,7 @@ L: linux-hardening@vger.kernel.org · 310 unmodified lines
80068003 S: Supported
80078004 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
80088005 F: include/linux/fortify-string.h
8006+F: lib/fortify_kunit.c
80098007 F: lib/test_fortify/*
80108008 F: scripts/test_fortify.sh
80118009 K: \b__NO_FORTIFY\b
@@ -10380,7 +10378,6 @@ INTEL MENLOW THERMAL DRIVER · 2368 unmodified lines
1038010378 M: Sujith Thomas <sujith.thomas@intel.com>
1038110379 L: linux-pm@vger.kernel.org
1038210380 S: Supported
10383−W: https://01.org/linux-acpi
1038410381 F: drivers/thermal/intel/intel_menlow.c
1038510382
1038610383 INTEL P-Unit IPC DRIVER
@@ -14451,6 +14448,7 @@ M: Willy Tarreau <w@1wt.eu> · 4064 unmodified lines
1445114448 S: Maintained
1445214449 T: git git://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git
1445314450 F: tools/include/nolibc/
14451+F: tools/testing/selftests/nolibc/
1445414452
1445514453 NSDEPS
1445614454 M: Matthias Maennich <maennich@google.com>
@@ -17766,6 +17764,24 @@ F: include/rv/ · 3309 unmodified lines
1776617764 F: kernel/trace/rv/
1776717765 F: tools/verification/
1776817766
17767+RUST
17768+M: Miguel Ojeda <ojeda@kernel.org>
17769+M: Alex Gaynor <alex.gaynor@gmail.com>
17770+M: Wedson Almeida Filho <wedsonaf@gmail.com>
17771+R: Boqun Feng <boqun.feng@gmail.com>
17772+R: Gary Guo <gary@garyguo.net>
17773+R: Björn Roy Baron <bjorn3_gh@protonmail.com>
17774+L: rust-for-linux@vger.kernel.org
17775+S: Supported
17776+W: https://github.com/Rust-for-Linux/linux
17777+B: https://github.com/Rust-for-Linux/linux/issues
17778+T: git https://github.com/Rust-for-Linux/linux.git rust-next
17779+F: Documentation/rust/
17780+F: rust/
17781+F: samples/rust/
17782+F: scripts/*rust*
17783+K: \b(?i:rust)\b
17784+
1776917785 RXRPC SOCKETS (AF_RXRPC)
1777017786 M: David Howells <dhowells@redhat.com>
1777117787 M: Marc Dionne <marc.dionne@auristor.com>
Makefile+167−24
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 0
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc7
5+EXTRAVERSION =
66 NAME = Hurr durr I'ma ninja sloth
77
88 # *DOCUMENTATION*
@@ -120,6 +120,15 @@ endif · 111 unmodified lines
120120
121121 export KBUILD_CHECKSRC
122122
123+# Enable "clippy" (a linter) as part of the Rust compilation.
124+#
125+# Use 'make CLIPPY=1' to enable it.
126+ifeq ("$(origin CLIPPY)", "command line")
127+ KBUILD_CLIPPY := $(CLIPPY)
128+endif
129+
130+export KBUILD_CLIPPY
131+
123132 # Use make M=dir or set the environment variable KBUILD_EXTMOD to specify the
124133 # directory of external module to build. Setting M= takes precedence.
125134 ifeq ("$(origin M)", "command line")
@@ -270,14 +279,14 @@ no-dot-config-targets := $(clean-targets) \ · 144 unmodified lines
270279 cscope gtags TAGS tags help% %docs check% coccicheck \
271280 $(version_h) headers headers_% archheaders archscripts \
272281 %asm-generic kernelversion %src-pkg dt_binding_check \
273− outputmakefile
282+ outputmakefile rustavailable rustfmt rustfmtcheck
274283 # Installation targets should not require compiler. Unfortunately, vdso_install
275284 # is an exception where build artifacts may be updated. This must be fixed.
276285 no-compiler-targets := $(no-dot-config-targets) install dtbs_install \
277286 headers_install modules_install kernelrelease image_name
278287 no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \
279288 image_name
280−single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
289+single-targets := %.a %.i %.rsi %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
281290
282291 config-build :=
283292 mixed-build :=
@@ -439,6 +448,7 @@ else · 155 unmodified lines
439448 HOSTCC = gcc
440449 HOSTCXX = g++
441450 endif
451+HOSTRUSTC = rustc
442452 HOSTPKG_CONFIG = pkg-config
443453
444454 KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
@@ -447,8 +457,26 @@ KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ · 2 unmodified lines
447457 KBUILD_USERCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(USERCFLAGS)
448458 KBUILD_USERLDFLAGS := $(USERLDFLAGS)
449459
460+# These flags apply to all Rust code in the tree, including the kernel and
461+# host programs.
462+export rust_common_flags := --edition=2021 \
463+ -Zbinary_dep_depinfo=y \
464+ -Dunsafe_op_in_unsafe_fn -Drust_2018_idioms \
465+ -Dunreachable_pub -Dnon_ascii_idents \
466+ -Wmissing_docs \
467+ -Drustdoc::missing_crate_level_docs \
468+ -Dclippy::correctness -Dclippy::style \
469+ -Dclippy::suspicious -Dclippy::complexity \
470+ -Dclippy::perf \
471+ -Dclippy::let_unit_value -Dclippy::mut_mut \
472+ -Dclippy::needless_bitwise_bool \
473+ -Dclippy::needless_continue \
474+ -Wclippy::dbg_macro
475+
450476 KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
451477 KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
478+KBUILD_HOSTRUSTFLAGS := $(rust_common_flags) -O -Cstrip=debuginfo \
479+ -Zallow-features= $(HOSTRUSTFLAGS)
452480 KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
453481 KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
454482
@@ -473,6 +501,12 @@ OBJDUMP = $(CROSS_COMPILE)objdump · 18 unmodified lines
473501 READELF = $(CROSS_COMPILE)readelf
474502 STRIP = $(CROSS_COMPILE)strip
475503 endif
504+RUSTC = rustc
505+RUSTDOC = rustdoc
506+RUSTFMT = rustfmt
507+CLIPPY_DRIVER = clippy-driver
508+BINDGEN = bindgen
509+CARGO = cargo
476510 PAHOLE = pahole
477511 RESOLVE_BTFIDS = $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
478512 LEX = flex
@@ -498,9 +532,11 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ · 19 unmodified lines
498532 -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
499533 NOSTDINC_FLAGS :=
500534 CFLAGS_MODULE =
535+RUSTFLAGS_MODULE =
501536 AFLAGS_MODULE =
502537 LDFLAGS_MODULE =
503538 CFLAGS_KERNEL =
539+RUSTFLAGS_KERNEL =
504540 AFLAGS_KERNEL =
505541 LDFLAGS_vmlinux =
506542
@@ -529,15 +565,43 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ · 22 unmodified lines
529565 -Werror=return-type -Wno-format-security \
530566 -std=gnu11
531567 KBUILD_CPPFLAGS := -D__KERNEL__
568+KBUILD_RUSTFLAGS := $(rust_common_flags) \
569+ --target=$(objtree)/rust/target.json \
570+ -Cpanic=abort -Cembed-bitcode=n -Clto=n \
571+ -Cforce-unwind-tables=n -Ccodegen-units=1 \
572+ -Csymbol-mangling-version=v0 \
573+ -Crelocation-model=static \
574+ -Zfunction-sections=n \
575+ -Dclippy::float_arithmetic
576+
532577 KBUILD_AFLAGS_KERNEL :=
533578 KBUILD_CFLAGS_KERNEL :=
579+KBUILD_RUSTFLAGS_KERNEL :=
534580 KBUILD_AFLAGS_MODULE := -DMODULE
535581 KBUILD_CFLAGS_MODULE := -DMODULE
582+KBUILD_RUSTFLAGS_MODULE := --cfg MODULE
536583 KBUILD_LDFLAGS_MODULE :=
537584 KBUILD_LDFLAGS :=
538585 CLANG_FLAGS :=
539586
587+ifeq ($(KBUILD_CLIPPY),1)
588+ RUSTC_OR_CLIPPY_QUIET := CLIPPY
589+ RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER)
590+else
591+ RUSTC_OR_CLIPPY_QUIET := RUSTC
592+ RUSTC_OR_CLIPPY = $(RUSTC)
593+endif
594+
595+ifdef RUST_LIB_SRC
596+ export RUST_LIB_SRC
597+endif
598+
599+# Allows the usage of unstable features in stable compilers.
600+export RUSTC_BOOTSTRAP := 1
601+
540602 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
603+export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN CARGO
604+export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
541605 export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
542606 export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
543607 export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
@@ -546,9 +610,10 @@ export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS · 2 unmodified lines
546610
547611 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
548612 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
613+export KBUILD_RUSTFLAGS RUSTFLAGS_KERNEL RUSTFLAGS_MODULE
549614 export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
550−export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
551−export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
615+export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_RUSTFLAGS_MODULE KBUILD_LDFLAGS_MODULE
616+export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL KBUILD_RUSTFLAGS_KERNEL
552617 export PAHOLE_FLAGS
553618
554619 # Files to ignore in find ... statements
@@ -729,7 +794,7 @@ $(KCONFIG_CONFIG): · 174 unmodified lines
729794 #
730795 # Do not use $(call cmd,...) here. That would suppress prompts from syncconfig,
731796 # so you cannot notice that Kconfig is waiting for the user input.
732−%/config/auto.conf %/config/auto.conf.cmd %/generated/autoconf.h: $(KCONFIG_CONFIG)
797+%/config/auto.conf %/config/auto.conf.cmd %/generated/autoconf.h %/generated/rustc_cfg: $(KCONFIG_CONFIG)
733798 $(Q)$(kecho) " SYNC $@"
734799 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
735800 else # !may-sync-config
@@ -758,10 +823,17 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) · 22 unmodified lines
758823
759824 ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
760825 KBUILD_CFLAGS += -O2
826+KBUILD_RUSTFLAGS += -Copt-level=2
761827 else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
762828 KBUILD_CFLAGS += -Os
829+KBUILD_RUSTFLAGS += -Copt-level=s
763830 endif
764831
832+# Always set `debug-assertions` and `overflow-checks` because their default
833+# depends on `opt-level` and `debug-assertions`, respectively.
834+KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n)
835+KBUILD_RUSTFLAGS += -Coverflow-checks=$(if $(CONFIG_RUST_OVERFLOW_CHECKS),y,n)
836+
765837 # Tell gcc to never replace conditional load with a non-conditional one
766838 ifdef CONFIG_CC_IS_GCC
767839 # gcc-10 renamed --param=allow-store-data-races=0 to
@@ -792,6 +864,9 @@ KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror · 24 unmodified lines
792864 KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
793865 KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
794866
867+KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings
868+KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y)
869+
795870 ifdef CONFIG_CC_IS_CLANG
796871 KBUILD_CPPFLAGS += -Qunused-arguments
797872 # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable.
@@ -812,12 +887,15 @@ KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer) · 14 unmodified lines
812887
813888 ifdef CONFIG_FRAME_POINTER
814889 KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
890+KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
815891 else
816892 # Some targets (ARM with Thumb2, for example), can't be built with frame
817893 # pointers. For those, we don't have FUNCTION_TRACER automatically
818894 # select FRAME_POINTER. However, FUNCTION_TRACER adds -pg, and this is
819895 # incompatible with -fomit-frame-pointer with current GCC, so we don't use
820896 # -fomit-frame-pointer with FUNCTION_TRACER.
897+# In the Rust target specification, "frame-pointer" is set explicitly
898+# to "may-omit".
821899 ifndef CONFIG_FUNCTION_TRACER
822900 KBUILD_CFLAGS += -fomit-frame-pointer
823901 endif
@@ -831,8 +909,8 @@ endif · 7 unmodified lines
831909 # Initialize all stack variables with a zero value.
832910 ifdef CONFIG_INIT_STACK_ALL_ZERO
833911 KBUILD_CFLAGS += -ftrivial-auto-var-init=zero
834−ifdef CONFIG_CC_IS_CLANG
835−# https://bugs.llvm.org/show_bug.cgi?id=45497
912+ifdef CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER
913+# https://github.com/llvm/llvm-project/issues/44842
836914 KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
837915 endif
838916 endif
@@ -882,8 +960,10 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH · 43 unmodified lines
882960 KBUILD_CFLAGS += -fno-inline-functions-called-once
883961 endif
884962
963+# `rustc`'s `-Zfunction-sections` applies to data too (as of 1.59.0).
885964 ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
886965 KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
966+KBUILD_RUSTFLAGS_KERNEL += -Zfunction-sections=y
887967 LDFLAGS_vmlinux += --gc-sections
888968 endif
889969
@@ -921,18 +1001,7 @@ export CC_FLAGS_LTO · 31 unmodified lines
9211001 endif
9221002
9231003 ifdef CONFIG_CFI_CLANG
924−CC_FLAGS_CFI := -fsanitize=cfi \
925− -fsanitize-cfi-cross-dso \
926− -fno-sanitize-cfi-canonical-jump-tables \
927− -fno-sanitize-trap=cfi \
928− -fno-sanitize-blacklist
929−
930−ifdef CONFIG_CFI_PERMISSIVE
931−CC_FLAGS_CFI += -fsanitize-recover=cfi
932−endif
933−
934−# If LTO flags are filtered out, we must also filter out CFI.
935−CC_FLAGS_LTO += $(CC_FLAGS_CFI)
1004+CC_FLAGS_CFI := -fsanitize=kcfi
9361005 KBUILD_CFLAGS += $(CC_FLAGS_CFI)
9371006 export CC_FLAGS_CFI
9381007 endif
@@ -1026,10 +1095,11 @@ include $(addprefix $(srctree)/, $(include-y)) · 87 unmodified lines
10261095 # Do not add $(call cc-option,...) below this line. When you build the kernel
10271096 # from the clean source tree, the GCC plugins do not exist at this point.
10281097
1029−# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
1098+# Add user supplied CPPFLAGS, AFLAGS, CFLAGS and RUSTFLAGS as the last assignments
10301099 KBUILD_CPPFLAGS += $(KCPPFLAGS)
10311100 KBUILD_AFLAGS += $(KAFLAGS)
10321101 KBUILD_CFLAGS += $(KCFLAGS)
1102+KBUILD_RUSTFLAGS += $(KRUSTFLAGS)
10331103
10341104 KBUILD_LDFLAGS_MODULE += --build-id=sha1
10351105 LDFLAGS_vmlinux += --build-id=sha1
@@ -1104,6 +1174,7 @@ ifeq ($(KBUILD_EXTMOD),) · 68 unmodified lines
11041174 core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/
11051175 core-$(CONFIG_BLOCK) += block/
11061176 core-$(CONFIG_IO_URING) += io_uring/
1177+core-$(CONFIG_RUST) += rust/
11071178
11081179 vmlinux-dirs := $(patsubst %/,%,$(filter %/, \
11091180 $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
@@ -1206,6 +1277,10 @@ prepare0: archprepare · 96 unmodified lines
12061277
12071278 # All the preparing..
12081279 prepare: prepare0
1280+ifdef CONFIG_RUST
1281+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/rust_is_available.sh -v
1282+ $(Q)$(MAKE) $(build)=rust
1283+endif
12091284
12101285 PHONY += remove-stale-files
12111286 remove-stale-files:
@@ -1499,7 +1574,7 @@ endif # CONFIG_MODULES · 287 unmodified lines
14991574 # Directories & files removed with 'make clean'
15001575 CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \
15011576 modules.builtin modules.builtin.modinfo modules.nsdeps \
1502− compile_commands.json .thinlto-cache
1577+ compile_commands.json .thinlto-cache rust/test rust/doc
15031578
15041579 # Directories & files removed with 'make mrproper'
15051580 MRPROPER_FILES += include/config include/generated \
@@ -1510,7 +1585,8 @@ MRPROPER_FILES += include/config include/generated \ · 4 unmodified lines
15101585 certs/signing_key.pem \
15111586 certs/x509.genkey \
15121587 vmlinux-gdb.py \
1513− *.spec
1588+ *.spec \
1589+ rust/target.json rust/libmacros.so
15141590
15151591 # clean - Delete most, but leave enough to build external modules
15161592 #
@@ -1535,6 +1611,9 @@ $(mrproper-dirs): · 18 unmodified lines
15351611
15361612 mrproper: clean $(mrproper-dirs)
15371613 $(call cmd,rmfiles)
1614+ @find . $(RCS_FIND_IGNORE) \
1615+ \( -name '*.rmeta' \) \
1616+ -type f -print | xargs rm -f
15381617
15391618 # distclean
15401619 #
@@ -1622,6 +1701,24 @@ help: · 81 unmodified lines
16221701 @echo ' kselftest-merge - Merge all the config dependencies of'
16231702 @echo ' kselftest to existing .config.'
16241703 @echo ''
1704+ @echo 'Rust targets:'
1705+ @echo ' rustavailable - Checks whether the Rust toolchain is'
1706+ @echo ' available and, if not, explains why.'
1707+ @echo ' rustfmt - Reformat all the Rust code in the kernel'
1708+ @echo ' rustfmtcheck - Checks if all the Rust code in the kernel'
1709+ @echo ' is formatted, printing a diff otherwise.'
1710+ @echo ' rustdoc - Generate Rust documentation'
1711+ @echo ' (requires kernel .config)'
1712+ @echo ' rusttest - Runs the Rust tests'
1713+ @echo ' (requires kernel .config; downloads external repos)'
1714+ @echo ' rust-analyzer - Generate rust-project.json rust-analyzer support file'
1715+ @echo ' (requires kernel .config)'
1716+ @echo ' dir/file.[os] - Build specified target only'
1717+ @echo ' dir/file.rsi - Build macro expanded source, similar to C preprocessing.'
1718+ @echo ' Run with RUSTFMT=n to skip reformatting if needed.'
1719+ @echo ' The output is not intended to be compilable.'
1720+ @echo ' dir/file.ll - Build the LLVM assembly file'
1721+ @echo ''
16251722 @$(if $(dtstree), \
16261723 echo 'Devicetree:'; \
16271724 echo '* dtbs - Build device tree blobs for enabled boards'; \
@@ -1694,6 +1791,52 @@ PHONY += $(DOC_TARGETS) · 66 unmodified lines
16941791 $(DOC_TARGETS):
16951792 $(Q)$(MAKE) $(build)=Documentation $@
16961793
1794+
1795+# Rust targets
1796+# ---------------------------------------------------------------------------
1797+
1798+# "Is Rust available?" target
1799+PHONY += rustavailable
1800+rustavailable:
1801+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/rust_is_available.sh -v && echo "Rust is available!"
1802+
1803+# Documentation target
1804+#
1805+# Using the singular to avoid running afoul of `no-dot-config-targets`.
1806+PHONY += rustdoc
1807+rustdoc: prepare
1808+ $(Q)$(MAKE) $(build)=rust $@
1809+
1810+# Testing target
1811+PHONY += rusttest
1812+rusttest: prepare
1813+ $(Q)$(MAKE) $(build)=rust $@
1814+
1815+# Formatting targets
1816+PHONY += rustfmt rustfmtcheck
1817+
1818+# We skip `rust/alloc` since we want to minimize the diff w.r.t. upstream.
1819+#
1820+# We match using absolute paths since `find` does not resolve them
1821+# when matching, which is a problem when e.g. `srctree` is `..`.
1822+# We `grep` afterwards in order to remove the directory entry itself.
1823+rustfmt:
1824+ $(Q)find $(abs_srctree) -type f -name '*.rs' \
1825+ -o -path $(abs_srctree)/rust/alloc -prune \
1826+ -o -path $(abs_objtree)/rust/test -prune \
1827+ | grep -Fv $(abs_srctree)/rust/alloc \
1828+ | grep -Fv $(abs_objtree)/rust/test \
1829+ | grep -Fv generated \
1830+ | xargs $(RUSTFMT) $(rustfmt_flags)
1831+
1832+rustfmtcheck: rustfmt_flags = --check
1833+rustfmtcheck: rustfmt
1834+
1835+# IDE support targets
1836+PHONY += rust-analyzer
1837+rust-analyzer:
1838+ $(Q)$(MAKE) $(build)=rust $@
1839+
16971840 # Misc
16981841 # ---------------------------------------------------------------------------
16991842
@@ -1861,7 +2004,7 @@ $(clean-dirs): · 161 unmodified lines
18612004 clean: $(clean-dirs)
18622005 $(call cmd,rmfiles)
18632006 @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
1864− \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
2007+ \( -name '*.[aios]' -o -name '*.rsi' -o -name '*.ko' -o -name '.*.cmd' \
18652008 -o -name '*.ko.*' \
18662009 -o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
18672010 -o -name '*.dwo' -o -name '*.lst' \
arch/Kconfig+11−13
@@ -355,6 +355,12 @@ config HAVE_RSEQ · 354 unmodified lines
355355 This symbol should be selected by an architecture if it
356356 supports an implementation of restartable sequences.
357357
358+config HAVE_RUST
359+ bool
360+ help
361+ This symbol should be selected by an architecture if it
362+ supports Rust.
363+
358364 config HAVE_FUNCTION_ARG_ACCESS_API
359365 bool
360366 help
@@ -738,11 +744,13 @@ config ARCH_SUPPORTS_CFI_CLANG · 377 unmodified lines
738744 An architecture should select this option if it can support Clang's
739745 Control-Flow Integrity (CFI) checking.
740746
747+config ARCH_USES_CFI_TRAPS
748+ bool
749+
741750 config CFI_CLANG
742751 bool "Use Clang's Control Flow Integrity (CFI)"
743− depends on LTO_CLANG && ARCH_SUPPORTS_CFI_CLANG
744− depends on CLANG_VERSION >= 140000
745− select KALLSYMS
752+ depends on ARCH_SUPPORTS_CFI_CLANG
753+ depends on $(cc-option,-fsanitize=kcfi)
746754 help
747755 This option enables Clang’s forward-edge Control Flow Integrity
748756 (CFI) checking, where the compiler injects a runtime check to each
@@ -754,16 +762,6 @@ config CFI_CLANG · 5 unmodified lines
754762
755763 https://clang.llvm.org/docs/ControlFlowIntegrity.html
756764
757−config CFI_CLANG_SHADOW
758− bool "Use CFI shadow to speed up cross-module checks"
759− default y
760− depends on CFI_CLANG && MODULES
761− help
762− If you select this option, the kernel builds a fast look-up table of
763− CFI check functions in loaded modules to reduce performance overhead.
764−
765− If unsure, say Y.
766−
767765 config CFI_PERMISSIVE
768766 bool "Use CFI in permissive mode"
769767 depends on CFI_CLANG
arch/alpha/include/asm/a.out.h+0−16
@@ -1,16 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef __ALPHA_A_OUT_H__
3−#define __ALPHA_A_OUT_H__
4−
5−#include <uapi/asm/a.out.h>
6−
7−
8−/* Assume that start addresses below 4G belong to a TASO application.
9− Unfortunately, there is no proper bit in the exec header to check.
10− Worse, we have to notice the start address before swapping to use
11− /sbin/loader, which of course is _not_ a TASO application. */
12−#define SET_AOUT_PERSONALITY(BFPM, EX) \
13− set_personality (((BFPM->taso || EX.ah.entry < 0x100000000L \
14− ? ADDR_LIMIT_32BIT : 0) | PER_OSF4))
15−
16−#endif /* __A_OUT_GNU_H__ */
arch/alpha/kernel/Makefile+0−4
@@ -47,10 +47,6 @@ else · 46 unmodified lines
4747 # Misc support
4848 obj-$(CONFIG_ALPHA_SRM) += srmcons.o
4949
50−ifdef CONFIG_BINFMT_AOUT
51−obj-y += binfmt_loader.o
52−endif
53−
5450 # Core logic support
5551 obj-$(CONFIG_ALPHA_APECS) += core_apecs.o
5652 obj-$(CONFIG_ALPHA_CIA) += core_cia.o
arch/alpha/kernel/binfmt_loader.c+0−46
@@ -1,46 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−#include <linux/init.h>
3−#include <linux/fs.h>
4−#include <linux/file.h>
5−#include <linux/mm_types.h>
6−#include <linux/binfmts.h>
7−#include <linux/a.out.h>
8−
9−static int load_binary(struct linux_binprm *bprm)
10−{
11− struct exec *eh = (struct exec *)bprm->buf;
12− unsigned long loader;
13− struct file *file;
14− int retval;
15−
16− if (eh->fh.f_magic != 0x183 || (eh->fh.f_flags & 0x3000) != 0x3000)
17− return -ENOEXEC;
18−
19− if (bprm->loader)
20− return -ENOEXEC;
21−
22− loader = bprm->vma->vm_end - sizeof(void *);
23−
24− file = open_exec("/sbin/loader");
25− retval = PTR_ERR(file);
26− if (IS_ERR(file))
27− return retval;
28−
29− /* Remember if the application is TASO. */
30− bprm->taso = eh->ah.entry < 0x100000000UL;
31−
32− bprm->interpreter = file;
33− bprm->loader = loader;
34− return 0;
35−}
36−
37−static struct linux_binfmt loader_format = {
38− .load_binary = load_binary,
39−};
40−
41−static int __init init_loader_binfmt(void)
42−{
43− insert_binfmt(&loader_format);
44− return 0;
45−}
46−arch_initcall(init_loader_binfmt);
arch/alpha/kernel/osf_sys.c+0−30
@@ -1278,45 +1278,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, · 1277 unmodified lines
12781278 return addr;
12791279 }
12801280
1281−#ifdef CONFIG_OSF4_COMPAT
1282−/* Clear top 32 bits of iov_len in the user's buffer for
1283− compatibility with old versions of OSF/1 where iov_len
1284− was defined as int. */
1285−static int
1286−osf_fix_iov_len(const struct iovec __user *iov, unsigned long count)
1287−{
1288− unsigned long i;
1289−
1290− for (i = 0 ; i < count ; i++) {
1291− int __user *iov_len_high = (int __user *)&iov[i].iov_len + 1;
1292−
1293− if (put_user(0, iov_len_high))
1294− return -EFAULT;
1295− }
1296− return 0;
1297−}
1298−#endif
1299−
13001281 SYSCALL_DEFINE3(osf_readv, unsigned long, fd,
13011282 const struct iovec __user *, vector, unsigned long, count)
13021283 {
1303−#ifdef CONFIG_OSF4_COMPAT
1304− if (unlikely(personality(current->personality) == PER_OSF4))
1305− if (osf_fix_iov_len(vector, count))
1306− return -EFAULT;
1307−#endif
1308−
13091284 return sys_readv(fd, vector, count);
13101285 }
13111286
13121287 SYSCALL_DEFINE3(osf_writev, unsigned long, fd,
13131288 const struct iovec __user *, vector, unsigned long, count)
13141289 {
1315−#ifdef CONFIG_OSF4_COMPAT
1316− if (unlikely(personality(current->personality) == PER_OSF4))
1317− if (osf_fix_iov_len(vector, count))
1318− return -EFAULT;
1319−#endif
13201290 return sys_writev(fd, vector, count);
13211291 }
13221292
arch/arm/boot/compressed/misc.c+2−0
@@ -23,7 +23,9 @@ unsigned int __machine_arch_type; · 22 unmodified lines
2323 #include <linux/types.h>
2424 #include <linux/linkage.h>
2525 #include "misc.h"
26+#ifdef CONFIG_ARCH_EP93XX
2627 #include "misc-ep93xx.h"
28+#endif
2729
2830 static void putstr(const char *ptr);
2931
arch/arm/boot/compressed/vmlinux.lds.S+2−0
@@ -23,6 +23,7 @@ SECTIONS · 22 unmodified lines
2323 *(.ARM.extab*)
2424 *(.note.*)
2525 *(.rel.*)
26+ *(.printk_index)
2627 /*
2728 * Discard any r/w data - this produces a link error if we have any,
2829 * which is required for PIC decompression. Local data generates
@@ -57,6 +58,7 @@ SECTIONS · 28 unmodified lines
5758 *(.rodata)
5859 *(.rodata.*)
5960 *(.data.rel.ro)
61+ *(.data.rel.ro.*)
6062 }
6163 .piggydata : {
6264 *(.piggydata)
arch/arm/configs/badge4_defconfig+0−1
@@ -6,7 +6,6 @@ CONFIG_UNUSED_BOARD_FILES=y · 5 unmodified lines
66 CONFIG_CMDLINE="init=/linuxrc root=/dev/mtdblock3"
77 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
88 CONFIG_FPE_NWFPE=y
9−CONFIG_BINFMT_AOUT=m
109 CONFIG_MODULES=y
1110 CONFIG_MODVERSIONS=y
1211 CONFIG_PARTITION_ADVANCED=y
arch/arm/configs/corgi_defconfig+0−1
@@ -16,7 +16,6 @@ CONFIG_MACH_HUSKY=y · 15 unmodified lines
1616 CONFIG_UNUSED_BOARD_FILES=y
1717 CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2 debug"
1818 CONFIG_FPE_NWFPE=y
19−CONFIG_BINFMT_AOUT=m
2019 CONFIG_MODULES=y
2120 CONFIG_MODULE_UNLOAD=y
2221 CONFIG_MODULE_FORCE_UNLOAD=y
arch/arm/configs/ezx_defconfig+0−1
@@ -25,7 +25,6 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=m · 24 unmodified lines
2525 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
2626 CONFIG_CPU_IDLE=y
2727 CONFIG_FPE_NWFPE=y
28−CONFIG_BINFMT_AOUT=m
2928 CONFIG_PM=y
3029 CONFIG_APM_EMULATION=y
3130 CONFIG_MODULES=y
arch/arm/configs/footbridge_defconfig+0−1
@@ -9,7 +9,6 @@ CONFIG_ARCH_EBSA285_HOST=y · 8 unmodified lines
99 CONFIG_ARCH_NETWINDER=y
1010 CONFIG_FPE_NWFPE=y
1111 CONFIG_FPE_NWFPE_XP=y
12−CONFIG_BINFMT_AOUT=y
1312 CONFIG_MODULES=y
1413 CONFIG_PARTITION_ADVANCED=y
1514 CONFIG_ACORN_PARTITION=y
arch/arm/configs/hackkit_defconfig+0−1
@@ -7,7 +7,6 @@ CONFIG_UNUSED_BOARD_FILES=y · 6 unmodified lines
77 CONFIG_CMDLINE="console=ttySA0,115200 root=/dev/ram0 initrd=0xc0400000,8M init=/rootshell"
88 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
99 CONFIG_FPE_NWFPE=y
10−CONFIG_BINFMT_AOUT=y
1110 CONFIG_MODULES=y
1211 CONFIG_NET=y
1312 CONFIG_PACKET=y
arch/arm/configs/iop32x_defconfig+0−1
@@ -12,7 +12,6 @@ CONFIG_MACH_N2100=y · 11 unmodified lines
1212 CONFIG_UNUSED_BOARD_FILES=y
1313 CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp cachepolicy=writealloc"
1414 CONFIG_FPE_NWFPE=y
15−CONFIG_BINFMT_AOUT=y
1615 CONFIG_MODULES=y
1716 CONFIG_MODULE_UNLOAD=y
1817 CONFIG_PARTITION_ADVANCED=y
arch/arm/configs/jornada720_defconfig+0−1
@@ -6,7 +6,6 @@ CONFIG_SA1100_JORNADA720=y · 5 unmodified lines
66 CONFIG_SA1100_JORNADA720_SSP=y
77 CONFIG_UNUSED_BOARD_FILES=y
88 CONFIG_FPE_NWFPE=y
9−CONFIG_BINFMT_AOUT=y
109 CONFIG_PM=y
1110 CONFIG_MODULES=y
1211 CONFIG_NET=y
arch/arm/configs/lart_defconfig+0−1
@@ -8,7 +8,6 @@ CONFIG_CMDLINE="console=ttySA0,9600 root=/dev/ram" · 7 unmodified lines
88 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
99 CONFIG_CPU_FREQ_GOV_USERSPACE=y
1010 CONFIG_FPE_NWFPE=y
11−CONFIG_BINFMT_AOUT=y
1211 CONFIG_PM=y
1312 CONFIG_MODULES=y
1413 CONFIG_NET=y
arch/arm/configs/neponset_defconfig+0−1
@@ -9,7 +9,6 @@ CONFIG_ZBOOT_ROM_BSS=0xc1000000 · 8 unmodified lines
99 CONFIG_ZBOOT_ROM=y
1010 CONFIG_CMDLINE="console=ttySA0,38400n8 cpufreq=221200 rw root=/dev/mtdblock2 mtdparts=sa1100:512K(boot),1M(kernel),2560K(initrd),4M(root) load_ramdisk=1 prompt_ramdisk=0 mem=32M noinitrd initrd=0xc0800000,3M"
1111 CONFIG_FPE_NWFPE=y
12−CONFIG_BINFMT_AOUT=y
1312 CONFIG_PM=y
1413 CONFIG_MODULES=y
1514 CONFIG_MODULE_UNLOAD=y
arch/arm/configs/netwinder_defconfig+0−1
@@ -5,7 +5,6 @@ CONFIG_ARCH_NETWINDER=y · 4 unmodified lines
55 CONFIG_DEPRECATED_PARAM_STRUCT=y
66 CONFIG_CMDLINE="root=0x801"
77 CONFIG_FPE_NWFPE=y
8−CONFIG_BINFMT_AOUT=y
98 CONFIG_PARTITION_ADVANCED=y
109 CONFIG_NET=y
1110 CONFIG_PACKET=y
arch/arm/configs/rpc_defconfig+0−1
@@ -7,7 +7,6 @@ CONFIG_MODULE_UNLOAD=y · 6 unmodified lines
77 CONFIG_ARCH_RPC=y
88 CONFIG_CPU_SA110=y
99 CONFIG_FPE_NWFPE=y
10−CONFIG_BINFMT_AOUT=y
1110 CONFIG_PARTITION_ADVANCED=y
1211 CONFIG_BSD_DISKLABEL=y
1312 CONFIG_SLAB=y
arch/arm/configs/spitz_defconfig+0−1
@@ -13,7 +13,6 @@ CONFIG_MACH_AKITA=y · 12 unmodified lines
1313 CONFIG_MACH_BORZOI=y
1414 CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2 debug"
1515 CONFIG_FPE_NWFPE=y
16−CONFIG_BINFMT_AOUT=m
1716 CONFIG_MODULES=y
1817 CONFIG_MODULE_UNLOAD=y
1918 CONFIG_MODULE_FORCE_UNLOAD=y
arch/arm/mm/dump.c+1−1
@@ -346,7 +346,7 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start) · 345 unmodified lines
346346 addr = start + i * PMD_SIZE;
347347 domain = get_domain_name(pmd);
348348 if (pmd_none(*pmd) || pmd_large(*pmd) || !pmd_present(*pmd))
349− note_page(st, addr, 3, pmd_val(*pmd), domain);
349+ note_page(st, addr, 4, pmd_val(*pmd), domain);
350350 else
351351 walk_pte(st, pmd, addr, domain);
352352
arch/arm/mm/mmu.c+4−0
@@ -300,7 +300,11 @@ static struct mem_type mem_types[] __ro_after_init = { · 299 unmodified lines
300300 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
301301 L_PTE_XN | L_PTE_RDONLY,
302302 .prot_l1 = PMD_TYPE_TABLE,
303+#ifdef CONFIG_ARM_LPAE
304+ .prot_sect = PMD_TYPE_SECT | L_PMD_SECT_RDONLY | PMD_SECT_AP2,
305+#else
303306 .prot_sect = PMD_TYPE_SECT,
307+#endif
304308 .domain = DOMAIN_KERNEL,
305309 },
306310 [MT_ROM] = {
arch/arm64/crypto/ghash-ce-core.S+3−2
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/linkage.h>
9+#include <linux/cfi_types.h>
910 #include <asm/assembler.h>
1011
1112 SHASH .req v0
@@ -350,11 +351,11 @@ CPU_LE( rev64 T1.16b, T1.16b ) · 338 unmodified lines
350351 * void pmull_ghash_update(int blocks, u64 dg[], const char *src,
351352 * struct ghash_key const *k, const char *head)
352353 */
353−SYM_FUNC_START(pmull_ghash_update_p64)
354+SYM_TYPED_FUNC_START(pmull_ghash_update_p64)
354355 __pmull_ghash p64
355356 SYM_FUNC_END(pmull_ghash_update_p64)
356357
357−SYM_FUNC_START(pmull_ghash_update_p8)
358+SYM_TYPED_FUNC_START(pmull_ghash_update_p8)
358359 __pmull_ghash p8
359360 SYM_FUNC_END(pmull_ghash_update_p8)
360361
arch/arm64/crypto/sm3-ce-core.S+2−1
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/linkage.h>
9+#include <linux/cfi_types.h>
910 #include <asm/assembler.h>
1011
1112 .irp b, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
@@ -73,7 +74,7 @@ · 61 unmodified lines
7374 * int blocks)
7475 */
7576 .text
76−SYM_FUNC_START(sm3_ce_transform)
77+SYM_TYPED_FUNC_START(sm3_ce_transform)
7778 /* load state */
7879 ld1 {v8.4s-v9.4s}, [x0]
7980 rev64 v8.4s, v8.4s
arch/arm64/include/asm/brk-imm.h+6−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 * 0x401: for compile time BRK instruction
1818 * 0x800: kernel-mode BUG() and WARN() traps
1919 * 0x9xx: tag-based KASAN trap (allowed values 0x900 - 0x9ff)
20+ * 0x8xxx: Control-Flow Integrity traps
2021 */
2122 #define KPROBES_BRK_IMM 0x004
2223 #define UPROBES_BRK_IMM 0x005
@@ -28,4 +29,9 @@ · 5 unmodified lines
2829 #define KASAN_BRK_IMM 0x900
2930 #define KASAN_BRK_MASK 0x0ff
3031
32+#define CFI_BRK_IMM_TARGET GENMASK(4, 0)
33+#define CFI_BRK_IMM_TYPE GENMASK(9, 5)
34+#define CFI_BRK_IMM_BASE 0x8000
35+#define CFI_BRK_IMM_MASK (CFI_BRK_IMM_TARGET | CFI_BRK_IMM_TYPE)
36+
3137 #endif
arch/arm64/include/asm/ftrace.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
2727 #define ARCH_SUPPORTS_FTRACE_OPS 1
2828 #else
29−#define MCOUNT_ADDR ((unsigned long)function_nocfi(_mcount))
29+#define MCOUNT_ADDR ((unsigned long)_mcount)
3030 #endif
3131
3232 /* The BL at the callsite's adjusted rec->ip */
arch/arm64/include/asm/linkage.h+4−0
@@ -39,4 +39,8 @@ · 38 unmodified lines
3939 SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
4040 bti c ;
4141
42+#define SYM_TYPED_FUNC_START(name) \
43+ SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
44+ bti c ;
45+
4246 #endif
arch/arm64/include/asm/mmu_context.h+2−2
@@ -147,7 +147,7 @@ static inline void cpu_install_ttbr0(phys_addr_t ttbr0, unsigned long t0sz) · 146 unmodified lines
147147 * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD,
148148 * avoiding the possibility of conflicting TLB entries being allocated.
149149 */
150−static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap)
150+static inline void cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap)
151151 {
152152 typedef void (ttbr_replace_func)(phys_addr_t);
153153 extern ttbr_replace_func idmap_cpu_replace_ttbr1;
@@ -168,7 +168,7 @@ static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap) · 14 unmodified lines
168168 ttbr1 |= TTBR_CNP_BIT;
169169 }
170170
171− replace_phys = (void *)__pa_symbol(function_nocfi(idmap_cpu_replace_ttbr1));
171+ replace_phys = (void *)__pa_symbol(idmap_cpu_replace_ttbr1);
172172
173173 __cpu_install_idmap(idmap);
174174 replace_phys(ttbr1);
arch/arm64/kernel/acpi_parking_protocol.c+1−1
@@ -99,7 +99,7 @@ static int acpi_parking_protocol_cpu_boot(unsigned int cpu) · 98 unmodified lines
9999 * that read this address need to convert this address to the
100100 * Boot-Loader's endianness before jumping.
101101 */
102− writeq_relaxed(__pa_symbol(function_nocfi(secondary_entry)),
102+ writeq_relaxed(__pa_symbol(secondary_entry),
103103 &mailbox->entry_point);
104104 writel_relaxed(cpu_entry->gic_cpu_id, &mailbox->cpu_id);
105105
arch/arm64/kernel/alternative.c+1−1
@@ -133,7 +133,7 @@ static void clean_dcache_range_nopatch(u64 start, u64 end) · 132 unmodified lines
133133 } while (cur += d_size, cur < end);
134134 }
135135
136−static void __nocfi __apply_alternatives(struct alt_region *region, bool is_module,
136+static void __apply_alternatives(struct alt_region *region, bool is_module,
137137 unsigned long *feature_mask)
138138 {
139139 struct alt_instr *alt;
arch/arm64/kernel/cpu-reset.S+3−2
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 */
99
1010 #include <linux/linkage.h>
11+#include <linux/cfi_types.h>
1112 #include <asm/assembler.h>
1213 #include <asm/sysreg.h>
1314 #include <asm/virt.h>
@@ -28,7 +29,7 @@ · 14 unmodified lines
2829 * branch to what would be the reset vector. It must be executed with the
2930 * flat identity mapping.
3031 */
31−SYM_CODE_START(cpu_soft_restart)
32+SYM_TYPED_FUNC_START(cpu_soft_restart)
3233 mov_q x12, INIT_SCTLR_EL1_MMU_OFF
3334 pre_disable_mmu_workaround
3435 /*
@@ -47,6 +48,6 @@ SYM_CODE_START(cpu_soft_restart) · 12 unmodified lines
4748 mov x1, x3 // arg1
4849 mov x2, x4 // arg2
4950 br x8
50−SYM_CODE_END(cpu_soft_restart)
51+SYM_FUNC_END(cpu_soft_restart)
5152
5253 .popsection
arch/arm64/kernel/cpufeature.c+2−2
@@ -1685,7 +1685,7 @@ static phys_addr_t kpti_ng_pgd_alloc(int shift) · 1684 unmodified lines
16851685 return kpti_ng_temp_alloc;
16861686 }
16871687
1688−static void __nocfi
1688+static void
16891689 kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
16901690 {
16911691 typedef void (kpti_remap_fn)(int, int, phys_addr_t, unsigned long);
@@ -1713,7 +1713,7 @@ kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused) · 21 unmodified lines
17131713 if (arm64_use_ng_mappings)
17141714 return;
17151715
1716− remap_fn = (void *)__pa_symbol(function_nocfi(idmap_kpti_install_ng_mappings));
1716+ remap_fn = (void *)__pa_symbol(idmap_kpti_install_ng_mappings);
17171717
17181718 if (!cpu) {
17191719 alloc = __get_free_pages(GFP_ATOMIC | __GFP_ZERO, order);
arch/arm64/kernel/ftrace.c+1−1
@@ -56,7 +56,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func) · 55 unmodified lines
5656 unsigned long pc;
5757 u32 new;
5858
59− pc = (unsigned long)function_nocfi(ftrace_call);
59+ pc = (unsigned long)ftrace_call;
6060 new = aarch64_insn_gen_branch_imm(pc, (unsigned long)func,
6161 AARCH64_INSN_BRANCH_LINK);
6262
arch/arm64/kernel/machine_kexec.c+1−1
@@ -204,7 +204,7 @@ void machine_kexec(struct kimage *kimage) · 203 unmodified lines
204204 typeof(cpu_soft_restart) *restart;
205205
206206 cpu_install_idmap();
207− restart = (void *)__pa_symbol(function_nocfi(cpu_soft_restart));
207+ restart = (void *)__pa_symbol(cpu_soft_restart);
208208 restart(is_hyp_nvhe(), kimage->start, kimage->arch.dtb_mem,
209209 0, 0);
210210 } else {
arch/arm64/kernel/psci.c+1−1
@@ -38,7 +38,7 @@ static int __init cpu_psci_cpu_prepare(unsigned int cpu) · 37 unmodified lines
3838
3939 static int cpu_psci_cpu_boot(unsigned int cpu)
4040 {
41− phys_addr_t pa_secondary_entry = __pa_symbol(function_nocfi(secondary_entry));
41+ phys_addr_t pa_secondary_entry = __pa_symbol(secondary_entry);
4242 int err = psci_ops.cpu_on(cpu_logical_map(cpu), pa_secondary_entry);
4343 if (err)
4444 pr_err("failed to boot CPU%d (%d)\n", cpu, err);
arch/arm64/kernel/smp_spin_table.c+1−1
@@ -66,7 +66,7 @@ static int smp_spin_table_cpu_init(unsigned int cpu) · 65 unmodified lines
6666 static int smp_spin_table_cpu_prepare(unsigned int cpu)
6767 {
6868 __le64 __iomem *release_addr;
69− phys_addr_t pa_holding_pen = __pa_symbol(function_nocfi(secondary_holding_pen));
69+ phys_addr_t pa_holding_pen = __pa_symbol(secondary_holding_pen);
7070
7171 if (!cpu_release_addr[cpu])
7272 return -ENODEV;
arch/arm64/kernel/traps.c+44−3
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/syscalls.h>
2727 #include <linux/mm_types.h>
2828 #include <linux/kasan.h>
29+#include <linux/cfi.h>
2930
3031 #include <asm/atomic.h>
3132 #include <asm/bug.h>
@@ -991,6 +992,38 @@ static struct break_hook bug_break_hook = { · 959 unmodified lines
991992 .imm = BUG_BRK_IMM,
992993 };
993994
995+#ifdef CONFIG_CFI_CLANG
996+static int cfi_handler(struct pt_regs *regs, unsigned long esr)
997+{
998+ unsigned long target;
999+ u32 type;
1000+
1001+ target = pt_regs_read_reg(regs, FIELD_GET(CFI_BRK_IMM_TARGET, esr));
1002+ type = (u32)pt_regs_read_reg(regs, FIELD_GET(CFI_BRK_IMM_TYPE, esr));
1003+
1004+ switch (report_cfi_failure(regs, regs->pc, &target, type)) {
1005+ case BUG_TRAP_TYPE_BUG:
1006+ die("Oops - CFI", regs, 0);
1007+ break;
1008+
1009+ case BUG_TRAP_TYPE_WARN:
1010+ break;
1011+
1012+ default:
1013+ return DBG_HOOK_ERROR;
1014+ }
1015+
1016+ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
1017+ return DBG_HOOK_HANDLED;
1018+}
1019+
1020+static struct break_hook cfi_break_hook = {
1021+ .fn = cfi_handler,
1022+ .imm = CFI_BRK_IMM_BASE,
1023+ .mask = CFI_BRK_IMM_MASK,
1024+};
1025+#endif /* CONFIG_CFI_CLANG */
1026+
9941027 static int reserved_fault_handler(struct pt_regs *regs, unsigned long esr)
9951028 {
9961029 pr_err("%s generated an invalid instruction at %pS!\n",
@@ -1052,6 +1085,9 @@ static struct break_hook kasan_break_hook = { · 55 unmodified lines
10521085 };
10531086 #endif
10541087
1088+
1089+#define esr_comment(esr) ((esr) & ESR_ELx_BRK64_ISS_COMMENT_MASK)
1090+
10551091 /*
10561092 * Initial handler for AArch64 BRK exceptions
10571093 * This handler only used until debug_traps_init().
@@ -1059,10 +1095,12 @@ static struct break_hook kasan_break_hook = { · 1 unmodified line
10591095 int __init early_brk64(unsigned long addr, unsigned long esr,
10601096 struct pt_regs *regs)
10611097 {
1098+#ifdef CONFIG_CFI_CLANG
1099+ if ((esr_comment(esr) & ~CFI_BRK_IMM_MASK) == CFI_BRK_IMM_BASE)
1100+ return cfi_handler(regs, esr) != DBG_HOOK_HANDLED;
1101+#endif
10621102 #ifdef CONFIG_KASAN_SW_TAGS
1063− unsigned long comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
1064−
1065− if ((comment & ~KASAN_BRK_MASK) == KASAN_BRK_IMM)
1103+ if ((esr_comment(esr) & ~KASAN_BRK_MASK) == KASAN_BRK_IMM)
10661104 return kasan_handler(regs, esr) != DBG_HOOK_HANDLED;
10671105 #endif
10681106 return bug_handler(regs, esr) != DBG_HOOK_HANDLED;
@@ -1071,6 +1109,9 @@ int __init early_brk64(unsigned long addr, unsigned long esr, · 2 unmodified lines
10711109 void __init trap_init(void)
10721110 {
10731111 register_kernel_break_hook(&bug_break_hook);
1112+#ifdef CONFIG_CFI_CLANG
1113+ register_kernel_break_hook(&cfi_break_hook);
1114+#endif
10741115 register_kernel_break_hook(&fault_break_hook);
10751116 #ifdef CONFIG_KASAN_SW_TAGS
10761117 register_kernel_break_hook(&kasan_break_hook);
arch/arm64/kernel/vdso/Makefile+2−1
@@ -40,7 +40,8 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO · 39 unmodified lines
4040 # kernel with CONFIG_WERROR enabled.
4141 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \
4242 $(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) \
43− $(CC_FLAGS_LTO) -Wmissing-prototypes -Wmissing-declarations
43+ $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \
44+ -Wmissing-prototypes -Wmissing-declarations
4445 KASAN_SANITIZE := n
4546 KCSAN_SANITIZE := n
4647 UBSAN_SANITIZE := n
arch/arm64/mm/proc.S+3−2
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/init.h>
1111 #include <linux/linkage.h>
1212 #include <linux/pgtable.h>
13+#include <linux/cfi_types.h>
1314 #include <asm/assembler.h>
1415 #include <asm/asm-offsets.h>
1516 #include <asm/asm_pointer_auth.h>
@@ -185,7 +186,7 @@ SYM_FUNC_END(cpu_do_resume) · 169 unmodified lines
185186 * This is the low-level counterpart to cpu_replace_ttbr1, and should not be
186187 * called by anything else. It can only be executed from a TTBR0 mapping.
187188 */
188−SYM_FUNC_START(idmap_cpu_replace_ttbr1)
189+SYM_TYPED_FUNC_START(idmap_cpu_replace_ttbr1)
189190 save_and_disable_daif flags=x2
190191
191192 __idmap_cpu_set_reserved_ttbr1 x1, x3
@@ -253,7 +254,7 @@ SYM_FUNC_END(idmap_cpu_replace_ttbr1) · 61 unmodified lines
253254 SYM_DATA(__idmap_kpti_flag, .long 1)
254255 .popsection
255256
256−SYM_FUNC_START(idmap_kpti_install_ng_mappings)
257+SYM_TYPED_FUNC_START(idmap_kpti_install_ng_mappings)
257258 cpu .req w0
258259 temp_pte .req x0
259260 num_cpus .req w1
arch/arm64/net/bpf_jit_comp.c+7−1
@@ -1970,7 +1970,7 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, · 1969 unmodified lines
19701970 u32 flags, struct bpf_tramp_links *tlinks,
19711971 void *orig_call)
19721972 {
1973− int ret;
1973+ int i, ret;
19741974 int nargs = m->nr_args;
19751975 int max_insns = ((long)image_end - (long)image) / AARCH64_INSN_SIZE;
19761976 struct jit_ctx ctx = {
@@ -1982,6 +1982,12 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, · 5 unmodified lines
19821982 if (nargs > 8)
19831983 return -ENOTSUPP;
19841984
1985+ /* don't support struct argument */
1986+ for (i = 0; i < MAX_BPF_FUNC_ARGS; i++) {
1987+ if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
1988+ return -ENOTSUPP;
1989+ }
1990+
19851991 ret = prepare_trampoline(&ctx, im, tlinks, orig_call, nargs, flags);
19861992 if (ret < 0)
19871993 return ret;
arch/loongarch/Kconfig+0−1
@@ -10,7 +10,6 @@ config LOONGARCH · 9 unmodified lines
1010 select ARCH_ENABLE_MEMORY_HOTPLUG
1111 select ARCH_ENABLE_MEMORY_HOTREMOVE
1212 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
13− select ARCH_HAS_PHYS_TO_DMA
1413 select ARCH_HAS_PTE_SPECIAL
1514 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
1615 select ARCH_INLINE_READ_LOCK if !PREEMPTION
arch/loongarch/kernel/dma.c+21−31
@@ -2,39 +2,29 @@ · 1 unmodified line
22 /*
33 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
44 */
5−#include <linux/init.h>
5+#include <linux/acpi.h>
66 #include <linux/dma-direct.h>
7−#include <linux/dma-mapping.h>
8−#include <linux/dma-map-ops.h>
9−#include <linux/swiotlb.h>
107
11−#include <asm/bootinfo.h>
12−#include <asm/dma.h>
13−#include <asm/loongson.h>
14−
15−/*
16− * We extract 4bit node id (bit 44~47) from Loongson-3's
17− * 48bit physical address space and embed it into 40bit.
18− */
19−
20−static int node_id_offset;
21−
22−dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
23−{
24− long nid = (paddr >> 44) & 0xf;
25−
26− return ((nid << 44) ^ paddr) | (nid << node_id_offset);
27−}
28−
29−phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
8+void acpi_arch_dma_setup(struct device *dev)
309 {
31− long nid = (daddr >> node_id_offset) & 0xf;
10+ int ret;
11+ u64 mask, end = 0;
12+ const struct bus_dma_region *map = NULL;
13+
14+ ret = acpi_dma_get_range(dev, &map);
15+ if (!ret && map) {
16+ const struct bus_dma_region *r = map;
17+
18+ for (end = 0; r->size; r++) {
19+ if (r->dma_start + r->size - 1 > end)
20+ end = r->dma_start + r->size - 1;
21+ }
22+
23+ mask = DMA_BIT_MASK(ilog2(end) + 1);
24+ dev->bus_dma_limit = end;
25+ dev->dma_range_map = map;
26+ dev->coherent_dma_mask = min(dev->coherent_dma_mask, mask);
27+ *dev->dma_mask = min(*dev->dma_mask, mask);
28+ }
3229
33− return ((nid << node_id_offset) ^ daddr) | (nid << 44);
34−}
35−
36−void __init plat_swiotlb_setup(void)
37−{
38− swiotlb_init(true, SWIOTLB_VERBOSE);
39− node_id_offset = ((readl(LS7A_DMA_CFG) & LS7A_DMA_NODE_MASK) >> LS7A_DMA_NODE_SHF) + 36;
4030 }
arch/loongarch/kernel/setup.c+1−1
@@ -247,7 +247,7 @@ static void __init arch_mem_init(char **cmdline_p) · 246 unmodified lines
247247 sparse_init();
248248 memblock_set_bottom_up(true);
249249
250− plat_swiotlb_setup();
250+ swiotlb_init(true, SWIOTLB_VERBOSE);
251251
252252 dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
253253
arch/m68k/Kconfig+1−1
@@ -87,7 +87,7 @@ config MMU_SUN3 · 86 unmodified lines
8787
8888 config KEXEC
8989 bool "kexec system call"
90− depends on M68KCLASSIC
90+ depends on M68KCLASSIC && MMU
9191 select KEXEC_CORE
9292 help
9393 kexec is a system call that implements the ability to shutdown your
arch/m68k/configs/amiga_defconfig+2−2
@@ -84,7 +84,6 @@ CONFIG_NETFILTER=y · 83 unmodified lines
8484 CONFIG_NETFILTER_NETLINK_HOOK=m
8585 CONFIG_NF_CONNTRACK=m
8686 CONFIG_NF_CONNTRACK_ZONES=y
87−# CONFIG_NF_CONNTRACK_PROCFS is not set
8887 # CONFIG_NF_CT_PROTO_DCCP is not set
8988 CONFIG_NF_CONNTRACK_AMANDA=m
9089 CONFIG_NF_CONNTRACK_FTP=m
@@ -573,9 +572,9 @@ CONFIG_CRYPTO_PCBC=m · 482 unmodified lines
573572 CONFIG_CRYPTO_XTS=m
574573 CONFIG_CRYPTO_KEYWRAP=m
575574 CONFIG_CRYPTO_ADIANTUM=m
575+CONFIG_CRYPTO_HCTR2=m
576576 CONFIG_CRYPTO_XCBC=m
577577 CONFIG_CRYPTO_VMAC=m
578−CONFIG_CRYPTO_BLAKE2S=m
579578 CONFIG_CRYPTO_MD4=m
580579 CONFIG_CRYPTO_MICHAEL_MIC=m
581580 CONFIG_CRYPTO_RMD160=m
@@ -594,6 +593,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
594593 CONFIG_CRYPTO_FCRYPT=m
595594 CONFIG_CRYPTO_KHAZAD=m
596595 CONFIG_CRYPTO_SEED=m
596+CONFIG_CRYPTO_ARIA=m
597597 CONFIG_CRYPTO_SERPENT=m
598598 CONFIG_CRYPTO_SM4_GENERIC=m
599599 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/apollo_defconfig+2−2
@@ -80,7 +80,6 @@ CONFIG_NETFILTER=y · 79 unmodified lines
8080 CONFIG_NETFILTER_NETLINK_HOOK=m
8181 CONFIG_NF_CONNTRACK=m
8282 CONFIG_NF_CONNTRACK_ZONES=y
83−# CONFIG_NF_CONNTRACK_PROCFS is not set
8483 # CONFIG_NF_CT_PROTO_DCCP is not set
8584 CONFIG_NF_CONNTRACK_AMANDA=m
8685 CONFIG_NF_CONNTRACK_FTP=m
@@ -530,9 +529,9 @@ CONFIG_CRYPTO_PCBC=m · 443 unmodified lines
530529 CONFIG_CRYPTO_XTS=m
531530 CONFIG_CRYPTO_KEYWRAP=m
532531 CONFIG_CRYPTO_ADIANTUM=m
532+CONFIG_CRYPTO_HCTR2=m
533533 CONFIG_CRYPTO_XCBC=m
534534 CONFIG_CRYPTO_VMAC=m
535−CONFIG_CRYPTO_BLAKE2S=m
536535 CONFIG_CRYPTO_MD4=m
537536 CONFIG_CRYPTO_MICHAEL_MIC=m
538537 CONFIG_CRYPTO_RMD160=m
@@ -551,6 +550,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
551550 CONFIG_CRYPTO_FCRYPT=m
552551 CONFIG_CRYPTO_KHAZAD=m
553552 CONFIG_CRYPTO_SEED=m
553+CONFIG_CRYPTO_ARIA=m
554554 CONFIG_CRYPTO_SERPENT=m
555555 CONFIG_CRYPTO_SM4_GENERIC=m
556556 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/atari_defconfig+2−2
@@ -87,7 +87,6 @@ CONFIG_NETFILTER=y · 86 unmodified lines
8787 CONFIG_NETFILTER_NETLINK_HOOK=m
8888 CONFIG_NF_CONNTRACK=m
8989 CONFIG_NF_CONNTRACK_ZONES=y
90−# CONFIG_NF_CONNTRACK_PROCFS is not set
9190 # CONFIG_NF_CT_PROTO_DCCP is not set
9291 CONFIG_NF_CONNTRACK_AMANDA=m
9392 CONFIG_NF_CONNTRACK_FTP=m
@@ -550,9 +549,9 @@ CONFIG_CRYPTO_PCBC=m · 456 unmodified lines
550549 CONFIG_CRYPTO_XTS=m
551550 CONFIG_CRYPTO_KEYWRAP=m
552551 CONFIG_CRYPTO_ADIANTUM=m
552+CONFIG_CRYPTO_HCTR2=m
553553 CONFIG_CRYPTO_XCBC=m
554554 CONFIG_CRYPTO_VMAC=m
555−CONFIG_CRYPTO_BLAKE2S=m
556555 CONFIG_CRYPTO_MD4=m
557556 CONFIG_CRYPTO_MICHAEL_MIC=m
558557 CONFIG_CRYPTO_RMD160=m
@@ -571,6 +570,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
571570 CONFIG_CRYPTO_FCRYPT=m
572571 CONFIG_CRYPTO_KHAZAD=m
573572 CONFIG_CRYPTO_SEED=m
573+CONFIG_CRYPTO_ARIA=m
574574 CONFIG_CRYPTO_SERPENT=m
575575 CONFIG_CRYPTO_SM4_GENERIC=m
576576 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/bvme6000_defconfig+2−2
@@ -77,7 +77,6 @@ CONFIG_NETFILTER=y · 76 unmodified lines
7777 CONFIG_NETFILTER_NETLINK_HOOK=m
7878 CONFIG_NF_CONNTRACK=m
7979 CONFIG_NF_CONNTRACK_ZONES=y
80−# CONFIG_NF_CONNTRACK_PROCFS is not set
8180 # CONFIG_NF_CT_PROTO_DCCP is not set
8281 CONFIG_NF_CONNTRACK_AMANDA=m
8382 CONFIG_NF_CONNTRACK_FTP=m
@@ -522,9 +521,9 @@ CONFIG_CRYPTO_PCBC=m · 438 unmodified lines
522521 CONFIG_CRYPTO_XTS=m
523522 CONFIG_CRYPTO_KEYWRAP=m
524523 CONFIG_CRYPTO_ADIANTUM=m
524+CONFIG_CRYPTO_HCTR2=m
525525 CONFIG_CRYPTO_XCBC=m
526526 CONFIG_CRYPTO_VMAC=m
527−CONFIG_CRYPTO_BLAKE2S=m
528527 CONFIG_CRYPTO_MD4=m
529528 CONFIG_CRYPTO_MICHAEL_MIC=m
530529 CONFIG_CRYPTO_RMD160=m
@@ -543,6 +542,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
543542 CONFIG_CRYPTO_FCRYPT=m
544543 CONFIG_CRYPTO_KHAZAD=m
545544 CONFIG_CRYPTO_SEED=m
545+CONFIG_CRYPTO_ARIA=m
546546 CONFIG_CRYPTO_SERPENT=m
547547 CONFIG_CRYPTO_SM4_GENERIC=m
548548 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/hp300_defconfig+2−2
@@ -79,7 +79,6 @@ CONFIG_NETFILTER=y · 78 unmodified lines
7979 CONFIG_NETFILTER_NETLINK_HOOK=m
8080 CONFIG_NF_CONNTRACK=m
8181 CONFIG_NF_CONNTRACK_ZONES=y
82−# CONFIG_NF_CONNTRACK_PROCFS is not set
8382 # CONFIG_NF_CT_PROTO_DCCP is not set
8483 CONFIG_NF_CONNTRACK_AMANDA=m
8584 CONFIG_NF_CONNTRACK_FTP=m
@@ -532,9 +531,9 @@ CONFIG_CRYPTO_PCBC=m · 446 unmodified lines
532531 CONFIG_CRYPTO_XTS=m
533532 CONFIG_CRYPTO_KEYWRAP=m
534533 CONFIG_CRYPTO_ADIANTUM=m
534+CONFIG_CRYPTO_HCTR2=m
535535 CONFIG_CRYPTO_XCBC=m
536536 CONFIG_CRYPTO_VMAC=m
537−CONFIG_CRYPTO_BLAKE2S=m
538537 CONFIG_CRYPTO_MD4=m
539538 CONFIG_CRYPTO_MICHAEL_MIC=m
540539 CONFIG_CRYPTO_RMD160=m
@@ -553,6 +552,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
553552 CONFIG_CRYPTO_FCRYPT=m
554553 CONFIG_CRYPTO_KHAZAD=m
555554 CONFIG_CRYPTO_SEED=m
555+CONFIG_CRYPTO_ARIA=m
556556 CONFIG_CRYPTO_SERPENT=m
557557 CONFIG_CRYPTO_SM4_GENERIC=m
558558 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/mac_defconfig+2−2
@@ -78,7 +78,6 @@ CONFIG_NETFILTER=y · 77 unmodified lines
7878 CONFIG_NETFILTER_NETLINK_HOOK=m
7979 CONFIG_NF_CONNTRACK=m
8080 CONFIG_NF_CONNTRACK_ZONES=y
81−# CONFIG_NF_CONNTRACK_PROCFS is not set
8281 # CONFIG_NF_CT_PROTO_DCCP is not set
8382 CONFIG_NF_CONNTRACK_AMANDA=m
8483 CONFIG_NF_CONNTRACK_FTP=m
@@ -552,9 +551,9 @@ CONFIG_CRYPTO_PCBC=m · 467 unmodified lines
552551 CONFIG_CRYPTO_XTS=m
553552 CONFIG_CRYPTO_KEYWRAP=m
554553 CONFIG_CRYPTO_ADIANTUM=m
554+CONFIG_CRYPTO_HCTR2=m
555555 CONFIG_CRYPTO_XCBC=m
556556 CONFIG_CRYPTO_VMAC=m
557−CONFIG_CRYPTO_BLAKE2S=m
558557 CONFIG_CRYPTO_MD4=m
559558 CONFIG_CRYPTO_MICHAEL_MIC=m
560559 CONFIG_CRYPTO_RMD160=m
@@ -573,6 +572,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
573572 CONFIG_CRYPTO_FCRYPT=m
574573 CONFIG_CRYPTO_KHAZAD=m
575574 CONFIG_CRYPTO_SEED=m
575+CONFIG_CRYPTO_ARIA=m
576576 CONFIG_CRYPTO_SERPENT=m
577577 CONFIG_CRYPTO_SM4_GENERIC=m
578578 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/multi_defconfig+2−2
@@ -98,7 +98,6 @@ CONFIG_NETFILTER=y · 97 unmodified lines
9898 CONFIG_NETFILTER_NETLINK_HOOK=m
9999 CONFIG_NF_CONNTRACK=m
100100 CONFIG_NF_CONNTRACK_ZONES=y
101−# CONFIG_NF_CONNTRACK_PROCFS is not set
102101 # CONFIG_NF_CT_PROTO_DCCP is not set
103102 CONFIG_NF_CONNTRACK_AMANDA=m
104103 CONFIG_NF_CONNTRACK_FTP=m
@@ -638,9 +637,9 @@ CONFIG_CRYPTO_PCBC=m · 533 unmodified lines
638637 CONFIG_CRYPTO_XTS=m
639638 CONFIG_CRYPTO_KEYWRAP=m
640639 CONFIG_CRYPTO_ADIANTUM=m
640+CONFIG_CRYPTO_HCTR2=m
641641 CONFIG_CRYPTO_XCBC=m
642642 CONFIG_CRYPTO_VMAC=m
643−CONFIG_CRYPTO_BLAKE2S=m
644643 CONFIG_CRYPTO_MD4=m
645644 CONFIG_CRYPTO_MICHAEL_MIC=m
646645 CONFIG_CRYPTO_RMD160=m
@@ -659,6 +658,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
659658 CONFIG_CRYPTO_FCRYPT=m
660659 CONFIG_CRYPTO_KHAZAD=m
661660 CONFIG_CRYPTO_SEED=m
661+CONFIG_CRYPTO_ARIA=m
662662 CONFIG_CRYPTO_SERPENT=m
663663 CONFIG_CRYPTO_SM4_GENERIC=m
664664 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/mvme147_defconfig+2−2
@@ -76,7 +76,6 @@ CONFIG_NETFILTER=y · 75 unmodified lines
7676 CONFIG_NETFILTER_NETLINK_HOOK=m
7777 CONFIG_NF_CONNTRACK=m
7878 CONFIG_NF_CONNTRACK_ZONES=y
79−# CONFIG_NF_CONNTRACK_PROCFS is not set
8079 # CONFIG_NF_CT_PROTO_DCCP is not set
8180 CONFIG_NF_CONNTRACK_AMANDA=m
8281 CONFIG_NF_CONNTRACK_FTP=m
@@ -521,9 +520,9 @@ CONFIG_CRYPTO_PCBC=m · 438 unmodified lines
521520 CONFIG_CRYPTO_XTS=m
522521 CONFIG_CRYPTO_KEYWRAP=m
523522 CONFIG_CRYPTO_ADIANTUM=m
523+CONFIG_CRYPTO_HCTR2=m
524524 CONFIG_CRYPTO_XCBC=m
525525 CONFIG_CRYPTO_VMAC=m
526−CONFIG_CRYPTO_BLAKE2S=m
527526 CONFIG_CRYPTO_MD4=m
528527 CONFIG_CRYPTO_MICHAEL_MIC=m
529528 CONFIG_CRYPTO_RMD160=m
@@ -542,6 +541,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
542541 CONFIG_CRYPTO_FCRYPT=m
543542 CONFIG_CRYPTO_KHAZAD=m
544543 CONFIG_CRYPTO_SEED=m
544+CONFIG_CRYPTO_ARIA=m
545545 CONFIG_CRYPTO_SERPENT=m
546546 CONFIG_CRYPTO_SM4_GENERIC=m
547547 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/mvme16x_defconfig+2−2
@@ -77,7 +77,6 @@ CONFIG_NETFILTER=y · 76 unmodified lines
7777 CONFIG_NETFILTER_NETLINK_HOOK=m
7878 CONFIG_NF_CONNTRACK=m
7979 CONFIG_NF_CONNTRACK_ZONES=y
80−# CONFIG_NF_CONNTRACK_PROCFS is not set
8180 # CONFIG_NF_CT_PROTO_DCCP is not set
8281 CONFIG_NF_CONNTRACK_AMANDA=m
8382 CONFIG_NF_CONNTRACK_FTP=m
@@ -522,9 +521,9 @@ CONFIG_CRYPTO_PCBC=m · 438 unmodified lines
522521 CONFIG_CRYPTO_XTS=m
523522 CONFIG_CRYPTO_KEYWRAP=m
524523 CONFIG_CRYPTO_ADIANTUM=m
524+CONFIG_CRYPTO_HCTR2=m
525525 CONFIG_CRYPTO_XCBC=m
526526 CONFIG_CRYPTO_VMAC=m
527−CONFIG_CRYPTO_BLAKE2S=m
528527 CONFIG_CRYPTO_MD4=m
529528 CONFIG_CRYPTO_MICHAEL_MIC=m
530529 CONFIG_CRYPTO_RMD160=m
@@ -543,6 +542,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
543542 CONFIG_CRYPTO_FCRYPT=m
544543 CONFIG_CRYPTO_KHAZAD=m
545544 CONFIG_CRYPTO_SEED=m
545+CONFIG_CRYPTO_ARIA=m
546546 CONFIG_CRYPTO_SERPENT=m
547547 CONFIG_CRYPTO_SM4_GENERIC=m
548548 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/q40_defconfig+2−2
@@ -78,7 +78,6 @@ CONFIG_NETFILTER=y · 77 unmodified lines
7878 CONFIG_NETFILTER_NETLINK_HOOK=m
7979 CONFIG_NF_CONNTRACK=m
8080 CONFIG_NF_CONNTRACK_ZONES=y
81−# CONFIG_NF_CONNTRACK_PROCFS is not set
8281 # CONFIG_NF_CT_PROTO_DCCP is not set
8382 CONFIG_NF_CONNTRACK_AMANDA=m
8483 CONFIG_NF_CONNTRACK_FTP=m
@@ -539,9 +538,9 @@ CONFIG_CRYPTO_PCBC=m · 454 unmodified lines
539538 CONFIG_CRYPTO_XTS=m
540539 CONFIG_CRYPTO_KEYWRAP=m
541540 CONFIG_CRYPTO_ADIANTUM=m
541+CONFIG_CRYPTO_HCTR2=m
542542 CONFIG_CRYPTO_XCBC=m
543543 CONFIG_CRYPTO_VMAC=m
544−CONFIG_CRYPTO_BLAKE2S=m
545544 CONFIG_CRYPTO_MD4=m
546545 CONFIG_CRYPTO_MICHAEL_MIC=m
547546 CONFIG_CRYPTO_RMD160=m
@@ -560,6 +559,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
560559 CONFIG_CRYPTO_FCRYPT=m
561560 CONFIG_CRYPTO_KHAZAD=m
562561 CONFIG_CRYPTO_SEED=m
562+CONFIG_CRYPTO_ARIA=m
563563 CONFIG_CRYPTO_SERPENT=m
564564 CONFIG_CRYPTO_SM4_GENERIC=m
565565 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/sun3_defconfig+2−2
@@ -74,7 +74,6 @@ CONFIG_NETFILTER=y · 73 unmodified lines
7474 CONFIG_NETFILTER_NETLINK_HOOK=m
7575 CONFIG_NF_CONNTRACK=m
7676 CONFIG_NF_CONNTRACK_ZONES=y
77−# CONFIG_NF_CONNTRACK_PROCFS is not set
7877 # CONFIG_NF_CT_PROTO_DCCP is not set
7978 CONFIG_NF_CONNTRACK_AMANDA=m
8079 CONFIG_NF_CONNTRACK_FTP=m
@@ -521,9 +520,9 @@ CONFIG_CRYPTO_PCBC=m · 440 unmodified lines
521520 CONFIG_CRYPTO_XTS=m
522521 CONFIG_CRYPTO_KEYWRAP=m
523522 CONFIG_CRYPTO_ADIANTUM=m
523+CONFIG_CRYPTO_HCTR2=m
524524 CONFIG_CRYPTO_XCBC=m
525525 CONFIG_CRYPTO_VMAC=m
526−CONFIG_CRYPTO_BLAKE2S=m
527526 CONFIG_CRYPTO_MD4=m
528527 CONFIG_CRYPTO_MICHAEL_MIC=m
529528 CONFIG_CRYPTO_RMD160=m
@@ -542,6 +541,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
542541 CONFIG_CRYPTO_FCRYPT=m
543542 CONFIG_CRYPTO_KHAZAD=m
544543 CONFIG_CRYPTO_SEED=m
544+CONFIG_CRYPTO_ARIA=m
545545 CONFIG_CRYPTO_SERPENT=m
546546 CONFIG_CRYPTO_SM4_GENERIC=m
547547 CONFIG_CRYPTO_TEA=m
arch/m68k/configs/sun3x_defconfig+2−2
@@ -74,7 +74,6 @@ CONFIG_NETFILTER=y · 73 unmodified lines
7474 CONFIG_NETFILTER_NETLINK_HOOK=m
7575 CONFIG_NF_CONNTRACK=m
7676 CONFIG_NF_CONNTRACK_ZONES=y
77−# CONFIG_NF_CONNTRACK_PROCFS is not set
7877 # CONFIG_NF_CT_PROTO_DCCP is not set
7978 CONFIG_NF_CONNTRACK_AMANDA=m
8079 CONFIG_NF_CONNTRACK_FTP=m
@@ -520,9 +519,9 @@ CONFIG_CRYPTO_PCBC=m · 439 unmodified lines
520519 CONFIG_CRYPTO_XTS=m
521520 CONFIG_CRYPTO_KEYWRAP=m
522521 CONFIG_CRYPTO_ADIANTUM=m
522+CONFIG_CRYPTO_HCTR2=m
523523 CONFIG_CRYPTO_XCBC=m
524524 CONFIG_CRYPTO_VMAC=m
525−CONFIG_CRYPTO_BLAKE2S=m
526525 CONFIG_CRYPTO_MD4=m
527526 CONFIG_CRYPTO_MICHAEL_MIC=m
528527 CONFIG_CRYPTO_RMD160=m
@@ -541,6 +540,7 @@ CONFIG_CRYPTO_DES=m · 12 unmodified lines
541540 CONFIG_CRYPTO_FCRYPT=m
542541 CONFIG_CRYPTO_KHAZAD=m
543542 CONFIG_CRYPTO_SEED=m
543+CONFIG_CRYPTO_ARIA=m
544544 CONFIG_CRYPTO_SERPENT=m
545545 CONFIG_CRYPTO_SM4_GENERIC=m
546546 CONFIG_CRYPTO_TEA=m
arch/m68k/include/uapi/asm/bootinfo-virt.h+2−7
@@ -13,13 +13,8 @@ · 12 unmodified lines
1313 #define BI_VIRT_VIRTIO_BASE 0x8004
1414 #define BI_VIRT_CTRL_BASE 0x8005
1515
16−/*
17− * A random seed used to initialize the RNG. Record format:
18− *
19− * - length [ 2 bytes, 16-bit big endian ]
20− * - seed data [ `length` bytes, padded to preserve 2-byte alignment ]
21− */
22−#define BI_VIRT_RNG_SEED 0x8006
16+/* No longer used -- replaced with BI_RNG_SEED -- but don't reuse this index:
17+ * #define BI_VIRT_RNG_SEED 0x8006 */
2318
2419 #define VIRT_BOOTI_VERSION MK_BI_VERSION(2, 0)
2520
arch/m68k/include/uapi/asm/bootinfo.h+7−0
@@ -64,6 +64,13 @@ struct mem_info { · 63 unmodified lines
6464 /* (struct mem_info) */
6565 #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
6666 /* (string) */
67+/*
68+ * A random seed used to initialize the RNG. Record format:
69+ *
70+ * - length [ 2 bytes, 16-bit big endian ]
71+ * - seed data [ `length` bytes, padded to preserve 4-byte struct alignment ]
72+ */
73+#define BI_RNG_SEED 0x0008
6774
6875
6976 /*
arch/m68k/kernel/setup_mm.c+16−3
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/module.h>
2626 #include <linux/nvram.h>
2727 #include <linux/initrd.h>
28+#include <linux/random.h>
2829
2930 #include <asm/bootinfo.h>
3031 #include <asm/byteorder.h>
@@ -109,10 +110,9 @@ extern void paging_init(void); · 78 unmodified lines
109110
110111 static void __init m68k_parse_bootinfo(const struct bi_record *record)
111112 {
113+ const struct bi_record *first_record = record;
112114 uint16_t tag;
113115
114− save_bootinfo(record);
115−
116116 while ((tag = be16_to_cpu(record->tag)) != BI_LAST) {
117117 int unknown = 0;
118118 const void *data = record->data;
@@ -148,10 +148,21 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) · 29 unmodified lines
148148 break;
149149
150150 case BI_COMMAND_LINE:
151− strlcpy(m68k_command_line, data,
151+ strscpy(m68k_command_line, data,
152152 sizeof(m68k_command_line));
153153 break;
154154
155+ case BI_RNG_SEED: {
156+ u16 len = be16_to_cpup(data);
157+ add_bootloader_randomness(data + 2, len);
158+ /*
159+ * Zero the data to preserve forward secrecy, and zero the
160+ * length to prevent kexec from using it.
161+ */
162+ memzero_explicit((void *)data, len + 2);
163+ break;
164+ }
165+
155166 default:
156167 if (MACH_IS_AMIGA)
157168 unknown = amiga_parse_bootinfo(record);
@@ -182,6 +193,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) · 24 unmodified lines
182193 record = (struct bi_record *)((unsigned long)record + size);
183194 }
184195
196+ save_bootinfo(first_record);
197+
185198 m68k_realnum_memory = m68k_num_memory;
186199 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
187200 if (m68k_num_memory > 1) {
arch/m68k/virt/config.c+0−11
@@ -2,7 +2,6 @@ · 1 unmodified line
22
33 #include <linux/reboot.h>
44 #include <linux/serial_core.h>
5−#include <linux/random.h>
65 #include <clocksource/timer-goldfish.h>
76
87 #include <asm/bootinfo.h>
@@ -93,16 +92,6 @@ int __init virt_parse_bootinfo(const struct bi_record *record) · 84 unmodified lines
9392 data += 4;
9493 virt_bi_data.virtio.irq = be32_to_cpup(data);
9594 break;
96− case BI_VIRT_RNG_SEED: {
97− u16 len = be16_to_cpup(data);
98− add_bootloader_randomness(data + 2, len);
99− /*
100− * Zero the data to preserve forward secrecy, and zero the
101− * length to prevent kexec from using it.
102− */
103− memzero_explicit((void *)data, len + 2);
104− break;
105− }
10695 default:
10796 unknown = 1;
10897 break;
arch/mips/bcm47xx/prom.c+2−2
@@ -86,7 +86,7 @@ static __init void prom_init_mem(void) · 85 unmodified lines
8686 pr_debug("Assume 128MB RAM\n");
8787 break;
8888 }
89− if (!memcmp(prom_init, prom_init + mem, 32))
89+ if (!memcmp((void *)prom_init, (void *)prom_init + mem, 32))
9090 break;
9191 }
9292 lowmem = mem;
@@ -159,7 +159,7 @@ void __init bcm47xx_prom_highmem_init(void) · 66 unmodified lines
159159
160160 off = EXTVBASE + __pa(off);
161161 for (extmem = 128 << 20; extmem < 512 << 20; extmem <<= 1) {
162− if (!memcmp(prom_init, (void *)(off + extmem), 16))
162+ if (!memcmp((void *)prom_init, (void *)(off + extmem), 16))
163163 break;
164164 }
165165 extmem -= lowmem;
arch/mips/boot/dts/brcm/bcm63268.dtsi+12−6
@@ -105,14 +105,20 @@ · 104 unmodified lines
105105 interrupts = <2>, <3>;
106106 };
107107
108− wdt: watchdog@1000009c {
109− compatible = "brcm,bcm7038-wdt";
110− reg = <0x1000009c 0xc>;
108+ timer-mfd@10000080 {
109+ compatible = "brcm,bcm7038-twd", "simple-mfd", "syscon";
110+ reg = <0x10000080 0x30>;
111+ ranges = <0x0 0x10000080 0x30>;
111112
112− clocks = <&periph_osc>;
113− clock-names = "refclk";
113+ wdt: watchdog@1c {
114+ compatible = "brcm,bcm7038-wdt";
115+ reg = <0x1c 0xc>;
114116
115− timeout-sec = <30>;
117+ clocks = <&periph_osc>;
118+ clock-names = "refclk";
119+
120+ timeout-sec = <30>;
121+ };
116122 };
117123
118124 uart0: serial@10000180 {
arch/mips/boot/dts/lantiq/Makefile+1−1
@@ -1,4 +1,4 @@
11 # SPDX-License-Identifier: GPL-2.0
2−dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb
2+dtb-$(CONFIG_DT_EASY50712) += danube_easy50712.dtb
33
44 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
arch/mips/boot/dts/lantiq/danube_easy50712.dtsrenamed from arch/mips/boot/dts/lantiq/easy50712.dts+0−0

File renamed without changes.

arch/mips/cavium-octeon/oct_ilm.c+3−14
@@ -28,7 +28,7 @@ struct latency_info { · 27 unmodified lines
2828 static struct latency_info li;
2929 static struct dentry *dir;
3030
31−static int show_latency(struct seq_file *m, void *v)
31+static int oct_ilm_show(struct seq_file *m, void *v)
3232 {
3333 u64 cpuclk, avg, max, min;
3434 struct latency_info curr_li = li;
@@ -43,18 +43,7 @@ static int show_latency(struct seq_file *m, void *v) · 8 unmodified lines
4343 curr_li.interrupt_cnt, avg, max, min);
4444 return 0;
4545 }
46−
47−static int oct_ilm_open(struct inode *inode, struct file *file)
48−{
49− return single_open(file, show_latency, NULL);
50−}
51−
52−static const struct file_operations oct_ilm_ops = {
53− .open = oct_ilm_open,
54− .read = seq_read,
55− .llseek = seq_lseek,
56− .release = single_release,
57−};
46+DEFINE_SHOW_ATTRIBUTE(oct_ilm);
5847
5948 static int reset_statistics(void *data, u64 value)
6049 {
@@ -67,7 +56,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(reset_statistics_ops, NULL, reset_statistics, "%llu\n") · 6 unmodified lines
6756 static void init_debugfs(void)
6857 {
6958 dir = debugfs_create_dir("oct_ilm", 0);
70− debugfs_create_file("statistics", 0222, dir, NULL, &oct_ilm_ops);
59+ debugfs_create_file("statistics", 0222, dir, NULL, &oct_ilm_fops);
7160 debugfs_create_file("reset", 0222, dir, NULL, &reset_statistics_ops);
7261 }
7362
arch/mips/cavium-octeon/setup.c+1−1
@@ -530,7 +530,7 @@ void octeon_user_io_init(void) · 529 unmodified lines
530530 /* Get the current settings for CP0_CVMMEMCTL_REG */
531531 cvmmemctl.u64 = read_c0_cvmmemctl();
532532 /* R/W If set, marked write-buffer entries time out the same
533− * as as other entries; if clear, marked write-buffer entries
533+ * as other entries; if clear, marked write-buffer entries
534534 * use the maximum timeout. */
535535 cvmmemctl.s.dismarkwblongto = 1;
536536 /* R/W If set, a merged store does not clear the write-buffer
arch/mips/configs/ar7_defconfig+0−4
@@ -32,9 +32,6 @@ CONFIG_IP_ROUTE_MULTIPATH=y · 31 unmodified lines
3232 CONFIG_IP_ROUTE_VERBOSE=y
3333 CONFIG_IP_MROUTE=y
3434 CONFIG_SYN_COOKIES=y
35−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
36−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
37−# CONFIG_INET_XFRM_MODE_BEET is not set
3835 # CONFIG_INET_DIAG is not set
3936 CONFIG_TCP_CONG_ADVANCED=y
4037 # CONFIG_TCP_CONG_BIC is not set
@@ -117,7 +114,6 @@ CONFIG_JFFS2_SUMMARY=y · 76 unmodified lines
117114 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
118115 CONFIG_SQUASHFS=y
119116 # CONFIG_CRYPTO_HW is not set
120−# CONFIG_ENABLE_MUST_CHECK is not set
121117 CONFIG_STRIP_ASM_SYMS=y
122118 CONFIG_DEBUG_FS=y
123119 CONFIG_CMDLINE_BOOL=y
arch/mips/configs/ath25_defconfig+0−4
@@ -29,9 +29,6 @@ CONFIG_UNIX=y · 28 unmodified lines
2929 CONFIG_INET=y
3030 CONFIG_IP_MULTICAST=y
3131 CONFIG_IP_ADVANCED_ROUTER=y
32−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34−# CONFIG_INET_XFRM_MODE_BEET is not set
3532 # CONFIG_IPV6 is not set
3633 CONFIG_CFG80211=m
3734 CONFIG_MAC80211=m
@@ -108,7 +105,6 @@ CONFIG_SQUASHFS_XZ=y · 70 unmodified lines
108105 # CONFIG_XZ_DEC_ARMTHUMB is not set
109106 # CONFIG_XZ_DEC_SPARC is not set
110107 CONFIG_PRINTK_TIME=y
111−# CONFIG_ENABLE_MUST_CHECK is not set
112108 CONFIG_STRIP_ASM_SYMS=y
113109 CONFIG_DEBUG_FS=y
114110 # CONFIG_SCHED_DEBUG is not set
arch/mips/configs/ath79_defconfig+0−10
@@ -10,12 +10,6 @@ CONFIG_EMBEDDED=y · 9 unmodified lines
1010 # CONFIG_SLUB_DEBUG is not set
1111 # CONFIG_COMPAT_BRK is not set
1212 CONFIG_ATH79=y
13−CONFIG_ATH79_MACH_AP121=y
14−CONFIG_ATH79_MACH_AP136=y
15−CONFIG_ATH79_MACH_AP81=y
16−CONFIG_ATH79_MACH_DB120=y
17−CONFIG_ATH79_MACH_PB44=y
18−CONFIG_ATH79_MACH_UBNT_XM=y
1913 CONFIG_HZ_100=y
2014 # CONFIG_SECCOMP is not set
2115 CONFIG_PCI=y
@@ -29,9 +23,6 @@ CONFIG_UNIX=y · 7 unmodified lines
2923 CONFIG_INET=y
3024 CONFIG_IP_MULTICAST=y
3125 CONFIG_IP_ADVANCED_ROUTER=y
32−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34−# CONFIG_INET_XFRM_MODE_BEET is not set
3526 # CONFIG_IPV6 is not set
3627 CONFIG_CFG80211=m
3728 CONFIG_MAC80211=m
@@ -92,7 +83,6 @@ CONFIG_LEDS_GPIO=y · 54 unmodified lines
9283 # CONFIG_DNOTIFY is not set
9384 # CONFIG_PROC_PAGE_MONITOR is not set
9485 CONFIG_CRC_ITU_T=m
95−# CONFIG_ENABLE_MUST_CHECK is not set
9686 CONFIG_STRIP_ASM_SYMS=y
9787 CONFIG_DEBUG_FS=y
9888 # CONFIG_SCHED_DEBUG is not set
arch/mips/configs/bcm63xx_defconfig+0−3
@@ -24,9 +24,6 @@ CONFIG_PCMCIA_BCM63XX=y · 23 unmodified lines
2424 CONFIG_NET=y
2525 CONFIG_UNIX=y
2626 CONFIG_INET=y
27−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
28−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
29−# CONFIG_INET_XFRM_MODE_BEET is not set
3027 # CONFIG_INET_DIAG is not set
3128 # CONFIG_IPV6 is not set
3229 CONFIG_CFG80211=y
arch/mips/configs/bigsur_defconfig+0−9
@@ -49,8 +49,6 @@ CONFIG_IP_PIMSM_V2=y · 48 unmodified lines
4949 CONFIG_INET_AH=m
5050 CONFIG_INET_ESP=m
5151 CONFIG_INET_IPCOMP=m
52−CONFIG_INET_XFRM_MODE_TRANSPORT=m
53−CONFIG_INET_XFRM_MODE_TUNNEL=m
5452 CONFIG_TCP_MD5SIG=y
5553 CONFIG_IPV6_ROUTER_PREF=y
5654 CONFIG_IPV6_ROUTE_INFO=y
@@ -59,7 +57,6 @@ CONFIG_INET6_AH=m · 2 unmodified lines
5957 CONFIG_INET6_ESP=m
6058 CONFIG_INET6_IPCOMP=m
6159 CONFIG_IPV6_MIP6=m
62−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
6360 CONFIG_IPV6_SIT_6RD=y
6461 CONFIG_IPV6_TUNNEL=m
6562 CONFIG_IPV6_MULTIPLE_TABLES=y
@@ -101,7 +98,6 @@ CONFIG_BAYCOM_SER_HDX=m · 35 unmodified lines
10198 CONFIG_YAM=m
10299 CONFIG_FW_LOADER=m
103100 CONFIG_BLK_DEV_LOOP=m
104−CONFIG_BLK_DEV_CRYPTOLOOP=m
105101 CONFIG_BLK_DEV_NBD=m
106102 CONFIG_EEPROM_LEGACY=y
107103 CONFIG_EEPROM_MAX6875=y
@@ -230,12 +226,8 @@ CONFIG_CRYPTO_XCBC=m · 122 unmodified lines
230226 CONFIG_CRYPTO_VMAC=m
231227 CONFIG_CRYPTO_MD4=m
232228 CONFIG_CRYPTO_MICHAEL_MIC=m
233−CONFIG_CRYPTO_RMD128=m
234229 CONFIG_CRYPTO_RMD160=m
235−CONFIG_CRYPTO_RMD256=m
236−CONFIG_CRYPTO_RMD320=m
237230 CONFIG_CRYPTO_SHA512=m
238−CONFIG_CRYPTO_TGR192=m
239231 CONFIG_CRYPTO_WP512=m
240232 CONFIG_CRYPTO_ANUBIS=m
241233 CONFIG_CRYPTO_BLOWFISH=m
@@ -243,7 +235,6 @@ CONFIG_CRYPTO_CAMELLIA=m · 1 unmodified line
243235 CONFIG_CRYPTO_CAST6=m
244236 CONFIG_CRYPTO_FCRYPT=m
245237 CONFIG_CRYPTO_KHAZAD=m
246−CONFIG_CRYPTO_SALSA20=m
247238 CONFIG_CRYPTO_SEED=m
248239 CONFIG_CRYPTO_SERPENT=m
249240 CONFIG_CRYPTO_TEA=m
arch/mips/configs/bmips_be_defconfig+0−3
@@ -17,9 +17,6 @@ CONFIG_PACKET=y · 16 unmodified lines
1717 CONFIG_PACKET_DIAG=y
1818 CONFIG_UNIX=y
1919 CONFIG_INET=y
20−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
21−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
22−# CONFIG_INET_XFRM_MODE_BEET is not set
2320 # CONFIG_INET_DIAG is not set
2421 CONFIG_CFG80211=y
2522 CONFIG_NL80211_TESTMODE=y
arch/mips/configs/bmips_stb_defconfig+2−21
@@ -12,7 +12,6 @@ CONFIG_HIGHMEM=y · 11 unmodified lines
1212 CONFIG_HIGH_RES_TIMERS=y
1313 CONFIG_SMP=y
1414 CONFIG_NR_CPUS=4
15−CONFIG_CC_STACKPROTECTOR_STRONG=y
1615 # CONFIG_SECCOMP is not set
1716 CONFIG_MIPS_O32_FP64_SUPPORT=y
1817 # CONFIG_RD_GZIP is not set
@@ -21,8 +20,6 @@ CONFIG_MIPS_O32_FP64_SUPPORT=y · 2 unmodified lines
2120 CONFIG_RD_XZ=y
2221 # CONFIG_RD_LZO is not set
2322 # CONFIG_RD_LZ4 is not set
24−# CONFIG_IOSCHED_DEADLINE is not set
25−# CONFIG_IOSCHED_CFQ is not set
2623 CONFIG_PCI=y
2724 CONFIG_PCI_MSI=y
2825 CONFIG_PCIEASPM_POWERSAVE=y
@@ -30,7 +27,6 @@ CONFIG_PCIEPORTBUS=y · 1 unmodified line
3027 CONFIG_PCIE_BRCMSTB=y
3128 CONFIG_CPU_FREQ=y
3229 CONFIG_CPU_FREQ_STAT=y
33−CONFIG_CPU_FREQ_STAT_DETAILS=y
3430 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
3531 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
3632 CONFIG_CPU_FREQ_GOV_POWERSAVE=y
@@ -44,15 +40,11 @@ CONFIG_PACKET=y · 7 unmodified lines
4440 CONFIG_PACKET_DIAG=y
4541 CONFIG_UNIX=y
4642 CONFIG_INET=y
47−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
48−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
49−# CONFIG_INET_XFRM_MODE_BEET is not set
5043 # CONFIG_INET_DIAG is not set
5144 CONFIG_CFG80211=y
5245 CONFIG_NL80211_TESTMODE=y
5346 CONFIG_WIRELESS=y
5447 CONFIG_MAC80211=y
55−CONFIG_NL80211=y
5648 CONFIG_DEVTMPFS=y
5749 CONFIG_DEVTMPFS_MOUNT=y
5850 # CONFIG_STANDALONE is not set
@@ -70,10 +62,6 @@ CONFIG_IP_PNP_RARP=y · 11 unmodified lines
7062 CONFIG_IP_MROUTE=y
7163 CONFIG_IP_PIMSM_V1=y
7264 CONFIG_IP_PIMSM_V2=y
73−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
74−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
75−# CONFIG_INET_XFRM_MODE_BEET is not set
76−# CONFIG_INET_LRO is not set
7765 CONFIG_INET_UDP_DIAG=y
7866 CONFIG_TCP_CONG_ADVANCED=y
7967 CONFIG_TCP_CONG_BIC=y
@@ -93,7 +81,6 @@ CONFIG_NET_SWITCHDEV=y · 13 unmodified lines
9381 CONFIG_DMA_CMA=y
9482 CONFIG_CMA_ALIGNMENT=12
9583 CONFIG_SPI=y
96−CONFIG_SPI_BRCMSTB=y
9784 CONFIG_MTD=y
9885 CONFIG_MTD_CMDLINE_PARTS=y
9986 CONFIG_MTD_BLOCK=y
@@ -105,14 +92,11 @@ CONFIG_MTD_CFI_STAA=y · 5 unmodified lines
10592 CONFIG_MTD_ROM=y
10693 CONFIG_MTD_ABSENT=y
10794 CONFIG_MTD_PHYSMAP_OF=y
108−CONFIG_MTD_M25P80=y
109−CONFIG_MTD_NAND=y
11095 CONFIG_MTD_NAND_BRCMNAND=y
11196 CONFIG_MTD_SPI_NOR=y
11297 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
11398 CONFIG_MTD_UBI=y
11499 CONFIG_MTD_UBI_GLUEBI=y
115−CONFIG_PROC_DEVICETREE=y
116100 CONFIG_BLK_DEV_LOOP=y
117101 CONFIG_BLK_DEV_RAM=y
118102 CONFIG_BLK_DEV_RAM_SIZE=8192
@@ -120,7 +104,6 @@ CONFIG_BLK_DEV_RAM_SIZE=8192 · 1 unmodified line
120104 CONFIG_SCSI=y
121105 CONFIG_BLK_DEV_SD=y
122106 CONFIG_CHR_DEV_SG=y
123−CONFIG_SCSI_MULTI_LUN=y
124107 # CONFIG_SCSI_LOWLEVEL is not set
125108 CONFIG_NETDEVICES=y
126109 CONFIG_VLAN_8021Q=y
@@ -135,7 +118,6 @@ CONFIG_INPUT_UINPUT=y · 8 unmodified lines
135118 # CONFIG_SERIO is not set
136119 CONFIG_VT=y
137120 CONFIG_VT_HW_CONSOLE_BINDING=y
138−# CONFIG_DEVKMEM is not set
139121 CONFIG_SERIAL_8250=y
140122 # CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
141123 CONFIG_SERIAL_8250_CONSOLE=y
@@ -203,17 +185,14 @@ CONFIG_CMDLINE="earlycon" · 61 unmodified lines
203185 CONFIG_MIPS_CMDLINE_DTB_EXTEND=y
204186 # CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set
205187 # CONFIG_CRYPTO_HW is not set
206−CONFIG_DT_BCM974XX=y
207188 CONFIG_FW_CFE=y
208189 CONFIG_ATA=y
209190 CONFIG_SATA_AHCI_PLATFORM=y
210−CONFIG_AHCI_BRCMSTB=y
211191 CONFIG_GENERIC_PHY=y
212192 CONFIG_GPIOLIB=y
213193 CONFIG_GPIO_SYSFS=y
214194 CONFIG_PHY_BRCM_USB=y
215195 CONFIG_PHY_BRCM_SATA=y
216−CONFIG_PM_RUNTIME=y
217196 CONFIG_PM_DEBUG=y
218197 CONFIG_SYSVIPC=y
219198 CONFIG_FUNCTION_GRAPH_TRACER=y
@@ -227,3 +206,5 @@ CONFIG_FTRACE_SYSCALLS=y · 7 unmodified lines
227206 CONFIG_TRACER_SNAPSHOT=y
228207 CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y
229208 CONFIG_STACK_TRACER=y
209+CONFIG_AHCI_BRCM=y
210+CONFIG_MTD_RAW_NAND=y
arch/mips/configs/cavium_octeon_defconfig+0−1
@@ -71,7 +71,6 @@ CONFIG_NETDEVICES=y · 70 unmodified lines
7171 # CONFIG_NET_VENDOR_DEC is not set
7272 # CONFIG_NET_VENDOR_DLINK is not set
7373 # CONFIG_NET_VENDOR_EMULEX is not set
74−# CONFIG_NET_VENDOR_HP is not set
7574 # CONFIG_NET_VENDOR_INTEL is not set
7675 # CONFIG_NET_VENDOR_MARVELL is not set
7776 # CONFIG_NET_VENDOR_MELLANOX is not set
arch/mips/configs/db1xxx_defconfig+0−1
@@ -61,7 +61,6 @@ CONFIG_INET6_AH=y · 60 unmodified lines
6161 CONFIG_INET6_ESP=y
6262 CONFIG_INET6_IPCOMP=y
6363 CONFIG_IPV6_MIP6=y
64−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
6564 CONFIG_IPV6_VTI=y
6665 CONFIG_IPV6_SIT_6RD=y
6766 CONFIG_IPV6_GRE=y
arch/mips/configs/decstation_64_defconfig+0−10
@@ -37,9 +37,6 @@ CONFIG_SYN_COOKIES=y · 36 unmodified lines
3737 CONFIG_INET_AH=m
3838 CONFIG_INET_ESP=m
3939 CONFIG_INET_IPCOMP=m
40−CONFIG_INET_XFRM_MODE_TRANSPORT=m
41−CONFIG_INET_XFRM_MODE_TUNNEL=m
42−CONFIG_INET_XFRM_MODE_BEET=m
4340 CONFIG_TCP_MD5SIG=y
4441 CONFIG_IPV6_ROUTER_PREF=y
4542 CONFIG_IPV6_ROUTE_INFO=y
@@ -47,7 +44,6 @@ CONFIG_INET6_AH=m · 1 unmodified line
4744 CONFIG_INET6_ESP=m
4845 CONFIG_INET6_IPCOMP=m
4946 CONFIG_IPV6_MIP6=m
50−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
5147 CONFIG_IPV6_MULTIPLE_TABLES=y
5248 CONFIG_IPV6_SUBTREES=y
5349 CONFIG_NETWORK_SECMARK=y
@@ -77,7 +73,6 @@ CONFIG_NETDEVICES=y · 23 unmodified lines
7773 CONFIG_DECLANCE=y
7874 # CONFIG_NET_VENDOR_AQUANTIA is not set
7975 # CONFIG_NET_VENDOR_ARC is not set
80−# CONFIG_NET_VENDOR_AURORA is not set
8176 # CONFIG_NET_VENDOR_BROADCOM is not set
8277 # CONFIG_NET_VENDOR_CADENCE is not set
8378 # CONFIG_NET_VENDOR_CAVIUM is not set
@@ -191,12 +186,8 @@ CONFIG_CRYPTO_CRC32=m · 107 unmodified lines
191186 CONFIG_CRYPTO_CRCT10DIF=m
192187 CONFIG_CRYPTO_MD4=m
193188 CONFIG_CRYPTO_MICHAEL_MIC=m
194−CONFIG_CRYPTO_RMD128=m
195189 CONFIG_CRYPTO_RMD160=m
196−CONFIG_CRYPTO_RMD256=m
197−CONFIG_CRYPTO_RMD320=m
198190 CONFIG_CRYPTO_SHA512=m
199−CONFIG_CRYPTO_TGR192=m
200191 CONFIG_CRYPTO_WP512=m
201192 CONFIG_CRYPTO_ANUBIS=m
202193 CONFIG_CRYPTO_ARC4=m
@@ -206,7 +197,6 @@ CONFIG_CRYPTO_CAST5=m · 3 unmodified lines
206197 CONFIG_CRYPTO_CAST6=m
207198 CONFIG_CRYPTO_FCRYPT=m
208199 CONFIG_CRYPTO_KHAZAD=m
209−CONFIG_CRYPTO_SALSA20=m
210200 CONFIG_CRYPTO_SEED=m
211201 CONFIG_CRYPTO_SERPENT=m
212202 CONFIG_CRYPTO_TEA=m
arch/mips/configs/decstation_defconfig+0−10
@@ -33,9 +33,6 @@ CONFIG_SYN_COOKIES=y · 32 unmodified lines
3333 CONFIG_INET_AH=m
3434 CONFIG_INET_ESP=m
3535 CONFIG_INET_IPCOMP=m
36−CONFIG_INET_XFRM_MODE_TRANSPORT=m
37−CONFIG_INET_XFRM_MODE_TUNNEL=m
38−CONFIG_INET_XFRM_MODE_BEET=m
3936 CONFIG_TCP_MD5SIG=y
4037 CONFIG_IPV6_ROUTER_PREF=y
4138 CONFIG_IPV6_ROUTE_INFO=y
@@ -43,7 +40,6 @@ CONFIG_INET6_AH=m · 1 unmodified line
4340 CONFIG_INET6_ESP=m
4441 CONFIG_INET6_IPCOMP=m
4542 CONFIG_IPV6_MIP6=m
46−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
4743 CONFIG_IPV6_MULTIPLE_TABLES=y
4844 CONFIG_IPV6_SUBTREES=y
4945 CONFIG_NETWORK_SECMARK=y
@@ -73,7 +69,6 @@ CONFIG_NETDEVICES=y · 23 unmodified lines
7369 CONFIG_DECLANCE=y
7470 # CONFIG_NET_VENDOR_AQUANTIA is not set
7571 # CONFIG_NET_VENDOR_ARC is not set
76−# CONFIG_NET_VENDOR_AURORA is not set
7772 # CONFIG_NET_VENDOR_BROADCOM is not set
7873 # CONFIG_NET_VENDOR_CADENCE is not set
7974 # CONFIG_NET_VENDOR_CAVIUM is not set
@@ -186,12 +181,8 @@ CONFIG_CRYPTO_CRC32=m · 106 unmodified lines
186181 CONFIG_CRYPTO_CRCT10DIF=m
187182 CONFIG_CRYPTO_MD4=m
188183 CONFIG_CRYPTO_MICHAEL_MIC=m
189−CONFIG_CRYPTO_RMD128=m
190184 CONFIG_CRYPTO_RMD160=m
191−CONFIG_CRYPTO_RMD256=m
192−CONFIG_CRYPTO_RMD320=m
193185 CONFIG_CRYPTO_SHA512=m
194−CONFIG_CRYPTO_TGR192=m
195186 CONFIG_CRYPTO_WP512=m
196187 CONFIG_CRYPTO_ANUBIS=m
197188 CONFIG_CRYPTO_ARC4=m
@@ -201,7 +192,6 @@ CONFIG_CRYPTO_CAST5=m · 3 unmodified lines
201192 CONFIG_CRYPTO_CAST6=m
202193 CONFIG_CRYPTO_FCRYPT=m
203194 CONFIG_CRYPTO_KHAZAD=m
204−CONFIG_CRYPTO_SALSA20=m
205195 CONFIG_CRYPTO_SEED=m
206196 CONFIG_CRYPTO_SERPENT=m
207197 CONFIG_CRYPTO_TEA=m
arch/mips/configs/decstation_r4k_defconfig+0−10
@@ -32,9 +32,6 @@ CONFIG_SYN_COOKIES=y · 31 unmodified lines
3232 CONFIG_INET_AH=m
3333 CONFIG_INET_ESP=m
3434 CONFIG_INET_IPCOMP=m
35−CONFIG_INET_XFRM_MODE_TRANSPORT=m
36−CONFIG_INET_XFRM_MODE_TUNNEL=m
37−CONFIG_INET_XFRM_MODE_BEET=m
3835 CONFIG_TCP_MD5SIG=y
3936 CONFIG_IPV6_ROUTER_PREF=y
4037 CONFIG_IPV6_ROUTE_INFO=y
@@ -42,7 +39,6 @@ CONFIG_INET6_AH=m · 1 unmodified line
4239 CONFIG_INET6_ESP=m
4340 CONFIG_INET6_IPCOMP=m
4441 CONFIG_IPV6_MIP6=m
45−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
4642 CONFIG_IPV6_MULTIPLE_TABLES=y
4743 CONFIG_IPV6_SUBTREES=y
4844 CONFIG_NETWORK_SECMARK=y
@@ -72,7 +68,6 @@ CONFIG_NETDEVICES=y · 23 unmodified lines
7268 CONFIG_DECLANCE=y
7369 # CONFIG_NET_VENDOR_AQUANTIA is not set
7470 # CONFIG_NET_VENDOR_ARC is not set
75−# CONFIG_NET_VENDOR_AURORA is not set
7671 # CONFIG_NET_VENDOR_BROADCOM is not set
7772 # CONFIG_NET_VENDOR_CADENCE is not set
7873 # CONFIG_NET_VENDOR_CAVIUM is not set
@@ -186,12 +181,8 @@ CONFIG_CRYPTO_CRC32=m · 107 unmodified lines
186181 CONFIG_CRYPTO_CRCT10DIF=m
187182 CONFIG_CRYPTO_MD4=m
188183 CONFIG_CRYPTO_MICHAEL_MIC=m
189−CONFIG_CRYPTO_RMD128=m
190184 CONFIG_CRYPTO_RMD160=m
191−CONFIG_CRYPTO_RMD256=m
192−CONFIG_CRYPTO_RMD320=m
193185 CONFIG_CRYPTO_SHA512=m
194−CONFIG_CRYPTO_TGR192=m
195186 CONFIG_CRYPTO_WP512=m
196187 CONFIG_CRYPTO_ANUBIS=m
197188 CONFIG_CRYPTO_ARC4=m
@@ -201,7 +192,6 @@ CONFIG_CRYPTO_CAST5=m · 3 unmodified lines
201192 CONFIG_CRYPTO_CAST6=m
202193 CONFIG_CRYPTO_FCRYPT=m
203194 CONFIG_CRYPTO_KHAZAD=m
204−CONFIG_CRYPTO_SALSA20=m
205195 CONFIG_CRYPTO_SEED=m
206196 CONFIG_CRYPTO_SERPENT=m
207197 CONFIG_CRYPTO_TEA=m
arch/mips/configs/fuloong2e_defconfig+0−9
@@ -35,8 +35,6 @@ CONFIG_IP_MULTICAST=y · 34 unmodified lines
3535 CONFIG_IP_PNP=y
3636 CONFIG_IP_PNP_BOOTP=y
3737 CONFIG_NET_IPIP=m
38−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
39−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
4038 # CONFIG_INET_DIAG is not set
4139 # CONFIG_IPV6 is not set
4240 CONFIG_NETFILTER=y
@@ -92,7 +90,6 @@ CONFIG_MTD_CFI_AMDSTD=m · 49 unmodified lines
9290 CONFIG_MTD_CFI_STAA=m
9391 CONFIG_MTD_PHYSMAP=m
9492 CONFIG_BLK_DEV_LOOP=y
95−CONFIG_BLK_DEV_CRYPTOLOOP=m
9693 CONFIG_BLK_DEV_RAM=m
9794 CONFIG_CDROM_PKTCDVD=m
9895 CONFIG_ATA_OVER_ETH=m
@@ -159,7 +156,6 @@ CONFIG_USB_MOUSE=y · 60 unmodified lines
159156 CONFIG_USB=y
160157 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
161158 CONFIG_USB_OTG_PRODUCTLIST=y
162−CONFIG_USB_WUSB_CBAF=m
163159 CONFIG_USB_C67X00_HCD=m
164160 CONFIG_USB_EHCI_HCD=y
165161 CONFIG_USB_EHCI_ROOT_HUB_TT=y
@@ -219,15 +215,10 @@ CONFIG_CRYPTO_CTS=m · 53 unmodified lines
219215 CONFIG_CRYPTO_PCBC=m
220216 CONFIG_CRYPTO_XTS=m
221217 CONFIG_CRYPTO_HMAC=y
222−CONFIG_CRYPTO_RMD128=m
223218 CONFIG_CRYPTO_RMD160=m
224−CONFIG_CRYPTO_RMD256=m
225−CONFIG_CRYPTO_RMD320=m
226−CONFIG_CRYPTO_SALSA20=m
227219 CONFIG_CRYPTO_SEED=m
228220 CONFIG_CRYPTO_DEFLATE=m
229221 CONFIG_CRYPTO_LZO=m
230222 # CONFIG_CRYPTO_HW is not set
231223 CONFIG_CRC_CCITT=y
232224 CONFIG_CRC7=m
233−# CONFIG_ENABLE_MUST_CHECK is not set
arch/mips/configs/generic/board-ocelot.config+0−1
@@ -25,7 +25,6 @@ CONFIG_NETDEVICES=y · 24 unmodified lines
2525 CONFIG_NET_SWITCHDEV=y
2626 CONFIG_NET_DSA=y
2727 CONFIG_MSCC_OCELOT_SWITCH=y
28−CONFIG_MSCC_OCELOT_SWITCH_OCELOT=y
2928 CONFIG_MDIO_MSCC_MIIM=y
3029 CONFIG_MICROSEMI_PHY=y
3130
arch/mips/configs/gpr_defconfig+0−8
@@ -29,9 +29,6 @@ CONFIG_IP_ROUTE_VERBOSE=y · 28 unmodified lines
2929 CONFIG_IP_PNP=y
3030 CONFIG_IP_PNP_BOOTP=y
3131 CONFIG_SYN_COOKIES=y
32−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34−# CONFIG_INET_XFRM_MODE_BEET is not set
3532 # CONFIG_IPV6 is not set
3633 CONFIG_NETWORK_SECMARK=y
3734 CONFIG_NETFILTER=y
@@ -218,9 +215,6 @@ CONFIG_HDLC_X25=m · 180 unmodified lines
218215 CONFIG_PCI200SYN=m
219216 CONFIG_WANXL=m
220217 CONFIG_FARSYNC=m
221−CONFIG_DSCC4=m
222−CONFIG_DSCC4_PCISYNC=y
223−CONFIG_DSCC4_PCI_RST=y
224218 CONFIG_LAPBETHER=m
225219 # CONFIG_INPUT_KEYBOARD is not set
226220 # CONFIG_INPUT_MOUSE is not set
@@ -286,7 +280,6 @@ CONFIG_CRYPTO_PCBC=m · 59 unmodified lines
286280 CONFIG_CRYPTO_MD4=m
287281 CONFIG_CRYPTO_MICHAEL_MIC=m
288282 CONFIG_CRYPTO_SHA512=m
289−CONFIG_CRYPTO_TGR192=m
290283 CONFIG_CRYPTO_WP512=m
291284 CONFIG_CRYPTO_ANUBIS=m
292285 CONFIG_CRYPTO_BLOWFISH=m
@@ -297,7 +290,6 @@ CONFIG_CRYPTO_SERPENT=m · 4 unmodified lines
297290 CONFIG_CRYPTO_TEA=m
298291 CONFIG_CRYPTO_TWOFISH=m
299292 CONFIG_CRYPTO_DEFLATE=m
300−# CONFIG_ENABLE_MUST_CHECK is not set
301293 CONFIG_MAGIC_SYSRQ=y
302294 CONFIG_CMDLINE_BOOL=y
303295 CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw ip=auto"
arch/mips/configs/ip22_defconfig+0−10
@@ -36,9 +36,6 @@ CONFIG_IP_PNP_BOOTP=y · 35 unmodified lines
3636 CONFIG_INET_AH=m
3737 CONFIG_INET_ESP=m
3838 CONFIG_INET_IPCOMP=m
39−CONFIG_INET_XFRM_MODE_TRANSPORT=m
40−CONFIG_INET_XFRM_MODE_TUNNEL=m
41−CONFIG_INET_XFRM_MODE_BEET=m
4239 CONFIG_TCP_MD5SIG=y
4340 CONFIG_IPV6_ROUTER_PREF=y
4441 CONFIG_IPV6_ROUTE_INFO=y
@@ -47,7 +44,6 @@ CONFIG_INET6_AH=m · 2 unmodified lines
4744 CONFIG_INET6_ESP=m
4845 CONFIG_INET6_IPCOMP=m
4946 CONFIG_IPV6_MIP6=m
50−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
5147 CONFIG_IPV6_TUNNEL=m
5248 CONFIG_IPV6_MULTIPLE_TABLES=y
5349 CONFIG_IPV6_SUBTREES=y
@@ -226,7 +222,6 @@ CONFIG_SERIO_RAW=m · 172 unmodified lines
226222 CONFIG_VT_HW_CONSOLE_BINDING=y
227223 CONFIG_SERIAL_IP22_ZILOG=m
228224 # CONFIG_HW_RANDOM is not set
229−CONFIG_RAW_DRIVER=m
230225 # CONFIG_HWMON is not set
231226 CONFIG_THERMAL=y
232227 CONFIG_WATCHDOG=y
@@ -320,11 +315,7 @@ CONFIG_CRYPTO_PCBC=m · 87 unmodified lines
320315 CONFIG_CRYPTO_XTS=m
321316 CONFIG_CRYPTO_HMAC=y
322317 CONFIG_CRYPTO_XCBC=m
323−CONFIG_CRYPTO_RMD128=m
324318 CONFIG_CRYPTO_RMD160=m
325−CONFIG_CRYPTO_RMD256=m
326−CONFIG_CRYPTO_RMD320=m
327−CONFIG_CRYPTO_TGR192=m
328319 CONFIG_CRYPTO_WP512=m
329320 CONFIG_CRYPTO_ANUBIS=m
330321 CONFIG_CRYPTO_BLOWFISH=m
@@ -333,7 +324,6 @@ CONFIG_CRYPTO_CAST5=m · 2 unmodified lines
333324 CONFIG_CRYPTO_CAST6=m
334325 CONFIG_CRYPTO_FCRYPT=m
335326 CONFIG_CRYPTO_KHAZAD=m
336−CONFIG_CRYPTO_SALSA20=m
337327 CONFIG_CRYPTO_SEED=m
338328 CONFIG_CRYPTO_SERPENT=m
339329 CONFIG_CRYPTO_TEA=m
arch/mips/configs/ip27_defconfig+0−19
@@ -33,9 +33,6 @@ CONFIG_NET_KEY_MIGRATE=y · 32 unmodified lines
3333 CONFIG_INET=y
3434 CONFIG_IP_MULTICAST=y
3535 CONFIG_IP_PNP=y
36−CONFIG_INET_XFRM_MODE_TRANSPORT=m
37−CONFIG_INET_XFRM_MODE_TUNNEL=m
38−CONFIG_INET_XFRM_MODE_BEET=m
3936 CONFIG_TCP_MD5SIG=y
4037 CONFIG_IPV6_ROUTER_PREF=y
4138 CONFIG_IPV6_ROUTE_INFO=y
@@ -44,10 +41,6 @@ CONFIG_INET6_AH=m · 2 unmodified lines
4441 CONFIG_INET6_ESP=m
4542 CONFIG_INET6_IPCOMP=m
4643 CONFIG_IPV6_MIP6=m
47−CONFIG_INET6_XFRM_MODE_TRANSPORT=m
48−CONFIG_INET6_XFRM_MODE_TUNNEL=m
49−CONFIG_INET6_XFRM_MODE_BEET=m
50−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
5144 CONFIG_IPV6_SIT=m
5245 CONFIG_IPV6_SIT_6RD=y
5346 CONFIG_IPV6_TUNNEL=m
@@ -92,7 +85,6 @@ CONFIG_CFG80211=m · 38 unmodified lines
9285 CONFIG_MAC80211=m
9386 CONFIG_RFKILL=m
9487 CONFIG_BLK_DEV_LOOP=y
95−CONFIG_BLK_DEV_CRYPTOLOOP=m
9688 CONFIG_CDROM_PKTCDVD=m
9789 CONFIG_ATA_OVER_ETH=m
9890 CONFIG_SCSI=y
@@ -115,7 +107,6 @@ CONFIG_SCSI_AIC94XX=m · 16 unmodified lines
115107 # CONFIG_AIC94XX_DEBUG is not set
116108 CONFIG_SCSI_MVSAS=m
117109 # CONFIG_SCSI_MVSAS_DEBUG is not set
118−CONFIG_SCSI_DPT_I2O=m
119110 CONFIG_SCSI_MPT2SAS=m
120111 CONFIG_LIBFC=m
121112 CONFIG_SCSI_QLOGIC_1280=y
@@ -126,8 +117,6 @@ CONFIG_SCSI_DH_RDAC=m · 4 unmodified lines
126117 CONFIG_SCSI_DH_HP_SW=m
127118 CONFIG_SCSI_DH_EMC=m
128119 CONFIG_SCSI_DH_ALUA=m
129−CONFIG_SCSI_OSD_INITIATOR=m
130−CONFIG_SCSI_OSD_ULD=m
131120 CONFIG_MD=y
132121 CONFIG_BLK_DEV_MD=y
133122 CONFIG_MD_LINEAR=m
@@ -166,7 +155,6 @@ CONFIG_JME=m · 32 unmodified lines
166155 CONFIG_MLX4_EN=m
167156 # CONFIG_MLX4_DEBUG is not set
168157 CONFIG_KS8851_MLL=m
169−CONFIG_VXGE=m
170158 CONFIG_AX88796=m
171159 CONFIG_AX88796_93CX6=y
172160 CONFIG_ETHOC=m
@@ -264,7 +252,6 @@ CONFIG_I2C_VIAPRO=m · 91 unmodified lines
264252 CONFIG_I2C_OCORES=m
265253 CONFIG_I2C_PCA_PLATFORM=m
266254 CONFIG_I2C_SIMTEC=m
267−CONFIG_I2C_PARPORT_LIGHT=m
268255 CONFIG_I2C_TAOS_EVM=m
269256 CONFIG_I2C_STUB=m
270257 # CONFIG_HWMON is not set
@@ -309,7 +296,6 @@ CONFIG_TMPFS=y · 38 unmodified lines
309296 CONFIG_TMPFS_POSIX_ACL=y
310297 CONFIG_SQUASHFS=m
311298 CONFIG_OMFS_FS=m
312−CONFIG_EXOFS_FS=m
313299 CONFIG_NFS_FS=y
314300 CONFIG_SECURITYFS=y
315301 CONFIG_CRYPTO_CRYPTD=m
@@ -321,12 +307,8 @@ CONFIG_CRYPTO_HMAC=y · 5 unmodified lines
321307 CONFIG_CRYPTO_XCBC=m
322308 CONFIG_CRYPTO_VMAC=m
323309 CONFIG_CRYPTO_MD4=m
324−CONFIG_CRYPTO_RMD128=m
325310 CONFIG_CRYPTO_RMD160=m
326−CONFIG_CRYPTO_RMD256=m
327−CONFIG_CRYPTO_RMD320=m
328311 CONFIG_CRYPTO_SHA512=m
329−CONFIG_CRYPTO_TGR192=m
330312 CONFIG_CRYPTO_WP512=m
331313 CONFIG_CRYPTO_ANUBIS=m
332314 CONFIG_CRYPTO_BLOWFISH=m
@@ -335,7 +317,6 @@ CONFIG_CRYPTO_CAST5=m · 2 unmodified lines
335317 CONFIG_CRYPTO_CAST6=m
336318 CONFIG_CRYPTO_FCRYPT=m
337319 CONFIG_CRYPTO_KHAZAD=m
338−CONFIG_CRYPTO_SALSA20=m
339320 CONFIG_CRYPTO_SEED=m
340321 CONFIG_CRYPTO_SERPENT=m
341322 CONFIG_CRYPTO_TEA=m
arch/mips/configs/ip28_defconfig+0−3
@@ -29,9 +29,6 @@ CONFIG_IP_MULTICAST=y · 28 unmodified lines
2929 CONFIG_IP_PNP=y
3030 CONFIG_IP_PNP_DHCP=y
3131 CONFIG_IP_PNP_BOOTP=y
32−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34−# CONFIG_INET_XFRM_MODE_BEET is not set
3532 CONFIG_TCP_MD5SIG=y
3633 # CONFIG_IPV6 is not set
3734 CONFIG_SCSI=y
arch/mips/configs/ip32_defconfig+0−2
@@ -43,7 +43,6 @@ CONFIG_IPV6_TUNNEL=m · 42 unmodified lines
4343 CONFIG_NETWORK_SECMARK=y
4444 CONFIG_CONNECTOR=y
4545 CONFIG_BLK_DEV_LOOP=m
46−CONFIG_BLK_DEV_CRYPTOLOOP=m
4746 CONFIG_BLK_DEV_NBD=m
4847 CONFIG_RAID_ATTRS=y
4948 CONFIG_SCSI=y
@@ -165,7 +164,6 @@ CONFIG_CRYPTO_MICHAEL_MIC=y · 115 unmodified lines
165164 CONFIG_CRYPTO_SHA1=y
166165 CONFIG_CRYPTO_SHA256=y
167166 CONFIG_CRYPTO_SHA512=y
168−CONFIG_CRYPTO_TGR192=y
169167 CONFIG_CRYPTO_WP512=y
170168 CONFIG_CRYPTO_ANUBIS=y
171169 CONFIG_CRYPTO_ARC4=y
arch/mips/configs/jazz_defconfig+0−1
@@ -32,7 +32,6 @@ CONFIG_PARPORT_1284=y · 31 unmodified lines
3232 CONFIG_DEVTMPFS=y
3333 CONFIG_BLK_DEV_FD=m
3434 CONFIG_BLK_DEV_LOOP=m
35−CONFIG_BLK_DEV_CRYPTOLOOP=m
3635 CONFIG_BLK_DEV_NBD=m
3736 CONFIG_BLK_DEV_RAM=m
3837 CONFIG_CDROM_PKTCDVD=m
arch/mips/configs/lemote2f_defconfig+0−9
@@ -43,9 +43,6 @@ CONFIG_IP_MROUTE=y · 42 unmodified lines
4343 CONFIG_IP_PIMSM_V1=y
4444 CONFIG_IP_PIMSM_V2=y
4545 CONFIG_SYN_COOKIES=y
46−CONFIG_INET_XFRM_MODE_TRANSPORT=m
47−CONFIG_INET_XFRM_MODE_TUNNEL=m
48−CONFIG_INET_XFRM_MODE_BEET=m
4946 CONFIG_TCP_CONG_ADVANCED=y
5047 CONFIG_TCP_CONG_BIC=y
5148 CONFIG_DEFAULT_BIC=y
@@ -77,7 +74,6 @@ CONFIG_MAC80211_LEDS=y · 25 unmodified lines
7774 CONFIG_RFKILL=m
7875 CONFIG_RFKILL_INPUT=y
7976 CONFIG_BLK_DEV_LOOP=y
80−CONFIG_BLK_DEV_CRYPTOLOOP=m
8177 CONFIG_BLK_DEV_RAM=y
8278 CONFIG_BLK_DEV_RAM_SIZE=8192
8379 CONFIG_BLK_DEV_SD=y
@@ -312,12 +308,8 @@ CONFIG_CRYPTO_PCBC=m · 228 unmodified lines
312308 CONFIG_CRYPTO_XTS=m
313309 CONFIG_CRYPTO_XCBC=m
314310 CONFIG_CRYPTO_MICHAEL_MIC=m
315−CONFIG_CRYPTO_RMD128=m
316311 CONFIG_CRYPTO_RMD160=m
317−CONFIG_CRYPTO_RMD256=m
318−CONFIG_CRYPTO_RMD320=m
319312 CONFIG_CRYPTO_SHA1=m
320−CONFIG_CRYPTO_TGR192=m
321313 CONFIG_CRYPTO_WP512=m
322314 CONFIG_CRYPTO_ANUBIS=m
323315 CONFIG_CRYPTO_BLOWFISH=m
@@ -326,7 +318,6 @@ CONFIG_CRYPTO_CAST5=m · 2 unmodified lines
326318 CONFIG_CRYPTO_CAST6=m
327319 CONFIG_CRYPTO_FCRYPT=m
328320 CONFIG_CRYPTO_KHAZAD=m
329−CONFIG_CRYPTO_SALSA20=m
330321 CONFIG_CRYPTO_SEED=m
331322 CONFIG_CRYPTO_SERPENT=m
332323 CONFIG_CRYPTO_TEA=m
arch/mips/configs/loongson1b_defconfig+0−4
@@ -28,9 +28,6 @@ CONFIG_INET=y · 27 unmodified lines
2828 CONFIG_IP_PNP=y
2929 CONFIG_IP_PNP_DHCP=y
3030 CONFIG_SYN_COOKIES=y
31−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33−# CONFIG_INET_XFRM_MODE_BEET is not set
3431 # CONFIG_INET_DIAG is not set
3532 # CONFIG_IPV6 is not set
3633 # CONFIG_WIRELESS is not set
@@ -115,7 +112,6 @@ CONFIG_NLS_ISO8859_1=m · 78 unmodified lines
115112 # CONFIG_CRYPTO_ECHAINIV is not set
116113 # CONFIG_CRYPTO_HW is not set
117114 CONFIG_DYNAMIC_DEBUG=y
118−# CONFIG_ENABLE_MUST_CHECK is not set
119115 CONFIG_DEBUG_FS=y
120116 CONFIG_MAGIC_SYSRQ=y
121117 # CONFIG_SCHED_DEBUG is not set
arch/mips/configs/loongson1c_defconfig+0−4
@@ -29,9 +29,6 @@ CONFIG_INET=y · 28 unmodified lines
2929 CONFIG_IP_PNP=y
3030 CONFIG_IP_PNP_DHCP=y
3131 CONFIG_SYN_COOKIES=y
32−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34−# CONFIG_INET_XFRM_MODE_BEET is not set
3532 # CONFIG_INET_DIAG is not set
3633 # CONFIG_IPV6 is not set
3734 # CONFIG_WIRELESS is not set
@@ -116,7 +113,6 @@ CONFIG_NLS_ISO8859_1=m · 78 unmodified lines
116113 # CONFIG_CRYPTO_ECHAINIV is not set
117114 # CONFIG_CRYPTO_HW is not set
118115 CONFIG_DYNAMIC_DEBUG=y
119−# CONFIG_ENABLE_MUST_CHECK is not set
120116 CONFIG_DEBUG_FS=y
121117 CONFIG_MAGIC_SYSRQ=y
122118 # CONFIG_SCHED_DEBUG is not set
arch/mips/configs/loongson2k_defconfig+0−3
@@ -95,7 +95,6 @@ CONFIG_DEVTMPFS=y · 94 unmodified lines
9595 CONFIG_DEVTMPFS_MOUNT=y
9696 CONFIG_MTD=m
9797 CONFIG_BLK_DEV_LOOP=y
98−CONFIG_BLK_DEV_CRYPTOLOOP=y
9998 CONFIG_BLK_DEV_RAM=y
10099 CONFIG_BLK_DEV_RAM_SIZE=8192
101100 CONFIG_RAID_ATTRS=m
@@ -229,7 +228,6 @@ CONFIG_SERIAL_8250_RSA=y · 127 unmodified lines
229228 CONFIG_SERIAL_OF_PLATFORM=y
230229 CONFIG_SERIAL_NONSTANDARD=y
231230 CONFIG_HW_RANDOM=y
232−CONFIG_RAW_DRIVER=m
233231 CONFIG_I2C_CHARDEV=y
234232 CONFIG_I2C_PIIX4=y
235233 CONFIG_GPIO_LOONGSON=y
@@ -336,7 +334,6 @@ CONFIG_DEFAULT_SECURITY_DAC=y · 100 unmodified lines
336334 CONFIG_CRYPTO_SEQIV=m
337335 CONFIG_CRYPTO_HMAC=y
338336 CONFIG_CRYPTO_MD5=y
339−CONFIG_CRYPTO_TGR192=m
340337 CONFIG_CRYPTO_WP512=m
341338 CONFIG_CRYPTO_BLOWFISH=m
342339 CONFIG_CRYPTO_CAST5=m
arch/mips/configs/loongson3_defconfig+0−2
@@ -143,7 +143,6 @@ CONFIG_DEVTMPFS=y · 142 unmodified lines
143143 CONFIG_DEVTMPFS_MOUNT=y
144144 CONFIG_MTD=m
145145 CONFIG_BLK_DEV_LOOP=y
146−CONFIG_BLK_DEV_CRYPTOLOOP=y
147146 CONFIG_BLK_DEV_RAM=y
148147 CONFIG_BLK_DEV_RAM_SIZE=8192
149148 CONFIG_VIRTIO_BLK=y
@@ -268,7 +267,6 @@ CONFIG_SERIAL_OF_PLATFORM=y · 118 unmodified lines
268267 CONFIG_SERIAL_NONSTANDARD=y
269268 CONFIG_VIRTIO_CONSOLE=y
270269 CONFIG_HW_RANDOM=y
271−CONFIG_RAW_DRIVER=m
272270 CONFIG_I2C_CHARDEV=y
273271 CONFIG_I2C_PIIX4=y
274272 CONFIG_GPIO_LOONGSON=y
arch/mips/configs/malta_defconfig+0−5
@@ -42,8 +42,6 @@ CONFIG_SYN_COOKIES=y · 41 unmodified lines
4242 CONFIG_INET_AH=m
4343 CONFIG_INET_ESP=m
4444 CONFIG_INET_IPCOMP=m
45−CONFIG_INET_XFRM_MODE_TRANSPORT=m
46−CONFIG_INET_XFRM_MODE_TUNNEL=m
4745 CONFIG_TCP_MD5SIG=y
4846 CONFIG_IPV6_ROUTER_PREF=y
4947 CONFIG_IPV6_ROUTE_INFO=y
@@ -229,7 +227,6 @@ CONFIG_MTD_UBI=m · 179 unmodified lines
229227 CONFIG_MTD_UBI_GLUEBI=m
230228 CONFIG_BLK_DEV_FD=m
231229 CONFIG_BLK_DEV_LOOP=m
232−CONFIG_BLK_DEV_CRYPTOLOOP=m
233230 CONFIG_BLK_DEV_NBD=m
234231 CONFIG_BLK_DEV_RAM=y
235232 CONFIG_CDROM_PKTCDVD=m
@@ -237,7 +234,6 @@ CONFIG_ATA_OVER_ETH=m · 1 unmodified line
237234 CONFIG_RAID_ATTRS=m
238235 CONFIG_BLK_DEV_SD=y
239236 CONFIG_CHR_DEV_ST=m
240−CONFIG_CHR_DEV_OSST=m
241237 CONFIG_BLK_DEV_SR=y
242238 CONFIG_CHR_DEV_SG=m
243239 CONFIG_SCSI_CONSTANTS=y
@@ -408,7 +404,6 @@ CONFIG_CRYPTO_HMAC=y · 164 unmodified lines
408404 CONFIG_CRYPTO_XCBC=m
409405 CONFIG_CRYPTO_MD4=m
410406 CONFIG_CRYPTO_SHA512=m
411−CONFIG_CRYPTO_TGR192=m
412407 CONFIG_CRYPTO_WP512=m
413408 CONFIG_CRYPTO_ANUBIS=m
414409 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/malta_kvm_defconfig+0−5
@@ -46,8 +46,6 @@ CONFIG_SYN_COOKIES=y · 45 unmodified lines
4646 CONFIG_INET_AH=m
4747 CONFIG_INET_ESP=m
4848 CONFIG_INET_IPCOMP=m
49−CONFIG_INET_XFRM_MODE_TRANSPORT=m
50−CONFIG_INET_XFRM_MODE_TUNNEL=m
5149 CONFIG_TCP_MD5SIG=y
5250 CONFIG_IPV6_ROUTER_PREF=y
5351 CONFIG_IPV6_ROUTE_INFO=y
@@ -233,7 +231,6 @@ CONFIG_MTD_UBI=m · 179 unmodified lines
233231 CONFIG_MTD_UBI_GLUEBI=m
234232 CONFIG_BLK_DEV_FD=m
235233 CONFIG_BLK_DEV_LOOP=m
236−CONFIG_BLK_DEV_CRYPTOLOOP=m
237234 CONFIG_BLK_DEV_NBD=m
238235 CONFIG_BLK_DEV_RAM=y
239236 CONFIG_CDROM_PKTCDVD=m
@@ -241,7 +238,6 @@ CONFIG_ATA_OVER_ETH=m · 1 unmodified line
241238 CONFIG_RAID_ATTRS=m
242239 CONFIG_BLK_DEV_SD=y
243240 CONFIG_CHR_DEV_ST=m
244−CONFIG_CHR_DEV_OSST=m
245241 CONFIG_BLK_DEV_SR=y
246242 CONFIG_CHR_DEV_SG=m
247243 CONFIG_SCSI_CONSTANTS=y
@@ -415,7 +411,6 @@ CONFIG_CRYPTO_HMAC=y · 167 unmodified lines
415411 CONFIG_CRYPTO_XCBC=m
416412 CONFIG_CRYPTO_MD4=m
417413 CONFIG_CRYPTO_SHA512=m
418−CONFIG_CRYPTO_TGR192=m
419414 CONFIG_CRYPTO_WP512=m
420415 CONFIG_CRYPTO_ANUBIS=m
421416 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/malta_qemu_32r6_defconfig+0−3
@@ -76,7 +76,6 @@ CONFIG_NET_ACT_POLICE=y · 75 unmodified lines
7676 # CONFIG_WIRELESS is not set
7777 CONFIG_DEVTMPFS=y
7878 CONFIG_BLK_DEV_LOOP=y
79−CONFIG_BLK_DEV_CRYPTOLOOP=m
8079 CONFIG_BLK_DEV_SD=y
8180 CONFIG_CHR_DEV_SG=y
8281 # CONFIG_SCSI_LOWLEVEL is not set
@@ -98,7 +97,6 @@ CONFIG_PCNET32=y · 15 unmodified lines
9897 # CONFIG_NET_VENDOR_DEC is not set
9998 # CONFIG_NET_VENDOR_DLINK is not set
10099 # CONFIG_NET_VENDOR_EMULEX is not set
101−# CONFIG_NET_VENDOR_HP is not set
102100 # CONFIG_NET_VENDOR_INTEL is not set
103101 # CONFIG_NET_VENDOR_MARVELL is not set
104102 # CONFIG_NET_VENDOR_MELLANOX is not set
@@ -172,7 +170,6 @@ CONFIG_NLS_ISO8859_1=m · 67 unmodified lines
172170 CONFIG_CRYPTO_PCBC=m
173171 CONFIG_CRYPTO_HMAC=y
174172 CONFIG_CRYPTO_MICHAEL_MIC=m
175−CONFIG_CRYPTO_TGR192=m
176173 CONFIG_CRYPTO_WP512=m
177174 CONFIG_CRYPTO_ANUBIS=m
178175 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/maltaaprp_defconfig+0−3
@@ -78,7 +78,6 @@ CONFIG_NET_ACT_POLICE=y · 77 unmodified lines
7878 # CONFIG_WIRELESS is not set
7979 CONFIG_DEVTMPFS=y
8080 CONFIG_BLK_DEV_LOOP=y
81−CONFIG_BLK_DEV_CRYPTOLOOP=m
8281 CONFIG_BLK_DEV_SD=y
8382 CONFIG_CHR_DEV_SG=y
8483 # CONFIG_SCSI_LOWLEVEL is not set
@@ -100,7 +99,6 @@ CONFIG_PCNET32=y · 15 unmodified lines
10099 # CONFIG_NET_VENDOR_DEC is not set
101100 # CONFIG_NET_VENDOR_DLINK is not set
102101 # CONFIG_NET_VENDOR_EMULEX is not set
103−# CONFIG_NET_VENDOR_HP is not set
104102 # CONFIG_NET_VENDOR_INTEL is not set
105103 # CONFIG_NET_VENDOR_MARVELL is not set
106104 # CONFIG_NET_VENDOR_MELLANOX is not set
@@ -173,7 +171,6 @@ CONFIG_NLS_ISO8859_1=m · 66 unmodified lines
173171 CONFIG_CRYPTO_PCBC=m
174172 CONFIG_CRYPTO_HMAC=y
175173 CONFIG_CRYPTO_MICHAEL_MIC=m
176−CONFIG_CRYPTO_TGR192=m
177174 CONFIG_CRYPTO_WP512=m
178175 CONFIG_CRYPTO_ANUBIS=m
179176 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/maltasmvp_defconfig+0−3
@@ -79,7 +79,6 @@ CONFIG_NET_ACT_POLICE=y · 78 unmodified lines
7979 # CONFIG_WIRELESS is not set
8080 CONFIG_DEVTMPFS=y
8181 CONFIG_BLK_DEV_LOOP=y
82−CONFIG_BLK_DEV_CRYPTOLOOP=m
8382 CONFIG_BLK_DEV_SD=y
8483 CONFIG_CHR_DEV_SG=y
8584 # CONFIG_SCSI_LOWLEVEL is not set
@@ -99,7 +98,6 @@ CONFIG_PCNET32=y · 13 unmodified lines
9998 # CONFIG_NET_VENDOR_DEC is not set
10099 # CONFIG_NET_VENDOR_DLINK is not set
101100 # CONFIG_NET_VENDOR_EMULEX is not set
102−# CONFIG_NET_VENDOR_HP is not set
103101 # CONFIG_NET_VENDOR_INTEL is not set
104102 # CONFIG_NET_VENDOR_MARVELL is not set
105103 # CONFIG_NET_VENDOR_MELLANOX is not set
@@ -174,7 +172,6 @@ CONFIG_NLS_ISO8859_1=m · 68 unmodified lines
174172 CONFIG_CRYPTO_PCBC=m
175173 CONFIG_CRYPTO_HMAC=y
176174 CONFIG_CRYPTO_MICHAEL_MIC=m
177−CONFIG_CRYPTO_TGR192=m
178175 CONFIG_CRYPTO_WP512=m
179176 CONFIG_CRYPTO_ANUBIS=m
180177 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/maltasmvp_eva_defconfig+0−3
@@ -80,7 +80,6 @@ CONFIG_NET_ACT_POLICE=y · 79 unmodified lines
8080 # CONFIG_WIRELESS is not set
8181 CONFIG_DEVTMPFS=y
8282 CONFIG_BLK_DEV_LOOP=y
83−CONFIG_BLK_DEV_CRYPTOLOOP=m
8483 CONFIG_BLK_DEV_SD=y
8584 CONFIG_CHR_DEV_SG=y
8685 # CONFIG_SCSI_LOWLEVEL is not set
@@ -102,7 +101,6 @@ CONFIG_PCNET32=y · 15 unmodified lines
102101 # CONFIG_NET_VENDOR_DEC is not set
103102 # CONFIG_NET_VENDOR_DLINK is not set
104103 # CONFIG_NET_VENDOR_EMULEX is not set
105−# CONFIG_NET_VENDOR_HP is not set
106104 # CONFIG_NET_VENDOR_INTEL is not set
107105 # CONFIG_NET_VENDOR_MARVELL is not set
108106 # CONFIG_NET_VENDOR_MELLANOX is not set
@@ -176,7 +174,6 @@ CONFIG_NLS_ISO8859_1=m · 67 unmodified lines
176174 CONFIG_CRYPTO_PCBC=m
177175 CONFIG_CRYPTO_HMAC=y
178176 CONFIG_CRYPTO_MICHAEL_MIC=m
179−CONFIG_CRYPTO_TGR192=m
180177 CONFIG_CRYPTO_WP512=m
181178 CONFIG_CRYPTO_ANUBIS=m
182179 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/maltaup_defconfig+0−3
@@ -77,7 +77,6 @@ CONFIG_NET_ACT_POLICE=y · 76 unmodified lines
7777 # CONFIG_WIRELESS is not set
7878 CONFIG_DEVTMPFS=y
7979 CONFIG_BLK_DEV_LOOP=y
80−CONFIG_BLK_DEV_CRYPTOLOOP=m
8180 CONFIG_BLK_DEV_SD=y
8281 CONFIG_CHR_DEV_SG=y
8382 # CONFIG_SCSI_LOWLEVEL is not set
@@ -99,7 +98,6 @@ CONFIG_PCNET32=y · 15 unmodified lines
9998 # CONFIG_NET_VENDOR_DEC is not set
10099 # CONFIG_NET_VENDOR_DLINK is not set
101100 # CONFIG_NET_VENDOR_EMULEX is not set
102−# CONFIG_NET_VENDOR_HP is not set
103101 # CONFIG_NET_VENDOR_INTEL is not set
104102 # CONFIG_NET_VENDOR_MARVELL is not set
105103 # CONFIG_NET_VENDOR_MELLANOX is not set
@@ -172,7 +170,6 @@ CONFIG_NLS_ISO8859_1=m · 66 unmodified lines
172170 CONFIG_CRYPTO_PCBC=m
173171 CONFIG_CRYPTO_HMAC=y
174172 CONFIG_CRYPTO_MICHAEL_MIC=m
175−CONFIG_CRYPTO_TGR192=m
176173 CONFIG_CRYPTO_WP512=m
177174 CONFIG_CRYPTO_ANUBIS=m
178175 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/maltaup_xpa_defconfig+0−5
@@ -45,8 +45,6 @@ CONFIG_SYN_COOKIES=y · 44 unmodified lines
4545 CONFIG_INET_AH=m
4646 CONFIG_INET_ESP=m
4747 CONFIG_INET_IPCOMP=m
48−CONFIG_INET_XFRM_MODE_TRANSPORT=m
49−CONFIG_INET_XFRM_MODE_TUNNEL=m
5048 CONFIG_TCP_MD5SIG=y
5149 CONFIG_IPV6_ROUTER_PREF=y
5250 CONFIG_IPV6_ROUTE_INFO=y
@@ -231,7 +229,6 @@ CONFIG_MTD_UBI=m · 178 unmodified lines
231229 CONFIG_MTD_UBI_GLUEBI=m
232230 CONFIG_BLK_DEV_FD=m
233231 CONFIG_BLK_DEV_LOOP=m
234−CONFIG_BLK_DEV_CRYPTOLOOP=m
235232 CONFIG_BLK_DEV_NBD=m
236233 CONFIG_BLK_DEV_RAM=y
237234 CONFIG_CDROM_PKTCDVD=m
@@ -239,7 +236,6 @@ CONFIG_ATA_OVER_ETH=m · 1 unmodified line
239236 CONFIG_RAID_ATTRS=m
240237 CONFIG_BLK_DEV_SD=y
241238 CONFIG_CHR_DEV_ST=m
242−CONFIG_CHR_DEV_OSST=m
243239 CONFIG_BLK_DEV_SR=y
244240 CONFIG_CHR_DEV_SG=m
245241 CONFIG_SCSI_CONSTANTS=y
@@ -414,7 +410,6 @@ CONFIG_CRYPTO_HMAC=y · 168 unmodified lines
414410 CONFIG_CRYPTO_XCBC=m
415411 CONFIG_CRYPTO_MD4=m
416412 CONFIG_CRYPTO_SHA512=m
417−CONFIG_CRYPTO_TGR192=m
418413 CONFIG_CRYPTO_WP512=m
419414 CONFIG_CRYPTO_ANUBIS=m
420415 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/mtx1_defconfig+0−10
@@ -58,13 +58,9 @@ CONFIG_SYN_COOKIES=y · 57 unmodified lines
5858 CONFIG_INET_AH=m
5959 CONFIG_INET_ESP=m
6060 CONFIG_INET_IPCOMP=m
61−CONFIG_INET_XFRM_MODE_TRANSPORT=m
62−CONFIG_INET_XFRM_MODE_TUNNEL=m
63−CONFIG_INET_XFRM_MODE_BEET=m
6461 CONFIG_INET6_AH=m
6562 CONFIG_INET6_ESP=m
6663 CONFIG_INET6_IPCOMP=m
67−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
6864 CONFIG_IPV6_TUNNEL=m
6965 CONFIG_NETWORK_SECMARK=y
7066 CONFIG_NETFILTER=y
@@ -282,7 +278,6 @@ CONFIG_PCMCIA_XIRCOM=m · 211 unmodified lines
282278 CONFIG_DL2K=m
283279 CONFIG_SUNDANCE=m
284280 CONFIG_PCMCIA_FMVJ18X=m
285−CONFIG_HP100=m
286281 CONFIG_E100=m
287282 CONFIG_E1000=m
288283 CONFIG_IXGB=m
@@ -366,9 +361,6 @@ CONFIG_HDLC_X25=m · 77 unmodified lines
366361 CONFIG_PCI200SYN=m
367362 CONFIG_WANXL=m
368363 CONFIG_FARSYNC=m
369−CONFIG_DSCC4=m
370−CONFIG_DSCC4_PCISYNC=y
371−CONFIG_DSCC4_PCI_RST=y
372364 CONFIG_LAPBETHER=m
373365 # CONFIG_KEYBOARD_ATKBD is not set
374366 CONFIG_KEYBOARD_GPIO=y
@@ -681,7 +673,6 @@ CONFIG_CRYPTO_PCBC=m · 306 unmodified lines
681673 CONFIG_CRYPTO_HMAC=y
682674 CONFIG_CRYPTO_MD5=y
683675 CONFIG_CRYPTO_MICHAEL_MIC=m
684−CONFIG_CRYPTO_TGR192=m
685676 CONFIG_CRYPTO_WP512=m
686677 CONFIG_CRYPTO_ANUBIS=m
687678 CONFIG_CRYPTO_BLOWFISH=m
@@ -690,5 +681,4 @@ CONFIG_CRYPTO_KHAZAD=m · 2 unmodified lines
690681 CONFIG_CRYPTO_SERPENT=m
691682 CONFIG_CRYPTO_TEA=m
692683 CONFIG_CRYPTO_TWOFISH=m
693−# CONFIG_ENABLE_MUST_CHECK is not set
694684 CONFIG_MAGIC_SYSRQ=y
arch/mips/configs/omega2p_defconfig+0−3
@@ -35,9 +35,6 @@ CONFIG_NET=y · 34 unmodified lines
3535 CONFIG_PACKET=y
3636 CONFIG_UNIX=y
3737 CONFIG_INET=y
38−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
39−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
40−# CONFIG_INET_XFRM_MODE_BEET is not set
4138 # CONFIG_INET_DIAG is not set
4239 # CONFIG_IPV6 is not set
4340 # CONFIG_WIRELESS is not set
arch/mips/configs/pic32mzda_defconfig+0−1
@@ -45,7 +45,6 @@ CONFIG_KEYBOARD_GPIO_POLLED=m · 44 unmodified lines
4545 CONFIG_SERIAL_PIC32=y
4646 CONFIG_SERIAL_PIC32_CONSOLE=y
4747 CONFIG_HW_RANDOM=y
48−CONFIG_RAW_DRIVER=m
4948 CONFIG_GPIO_SYSFS=y
5049 # CONFIG_HWMON is not set
5150 CONFIG_HIDRAW=y
arch/mips/configs/rb532_defconfig+0−4
@@ -33,9 +33,6 @@ CONFIG_IP_MULTIPLE_TABLES=y · 32 unmodified lines
3333 CONFIG_IP_ROUTE_MULTIPATH=y
3434 CONFIG_IP_ROUTE_VERBOSE=y
3535 CONFIG_SYN_COOKIES=y
36−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
37−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
38−# CONFIG_INET_XFRM_MODE_BEET is not set
3936 CONFIG_INET_DIAG=m
4037 CONFIG_TCP_CONG_ADVANCED=y
4138 CONFIG_TCP_CONG_CUBIC=m
@@ -162,5 +159,4 @@ CONFIG_SQUASHFS=y · 120 unmodified lines
162159 CONFIG_CRYPTO_TEST=m
163160 # CONFIG_CRYPTO_HW is not set
164161 CONFIG_CRC16=m
165−# CONFIG_ENABLE_MUST_CHECK is not set
166162 CONFIG_STRIP_ASM_SYMS=y
arch/mips/configs/rbtx49xx_defconfig+0−7
@@ -21,9 +21,6 @@ CONFIG_UNIX=y · 20 unmodified lines
2121 CONFIG_INET=y
2222 CONFIG_IP_MULTICAST=y
2323 CONFIG_IP_PNP=y
24−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
26−# CONFIG_INET_XFRM_MODE_BEET is not set
2724 # CONFIG_IPV6 is not set
2825 # CONFIG_WIRELESS is not set
2926 CONFIG_MTD=y
@@ -51,7 +48,6 @@ CONFIG_TC35815=y · 21 unmodified lines
5148 CONFIG_SERIAL_TXX9_CONSOLE=y
5249 CONFIG_SERIAL_TXX9_STDSERIAL=y
5350 CONFIG_SPI=y
54−CONFIG_SPI_TXX9=y
5551 # CONFIG_HWMON is not set
5652 CONFIG_WATCHDOG=y
5753 CONFIG_TXX9_WDT=m
@@ -65,8 +61,6 @@ CONFIG_SND=m · 7 unmodified lines
6561 # CONFIG_SND_SPI is not set
6662 # CONFIG_SND_MIPS is not set
6763 CONFIG_SND_SOC=m
68−CONFIG_SND_SOC_TXX9ACLC=m
69−CONFIG_SND_SOC_TXX9ACLC_GENERIC=m
7064 # CONFIG_USB_SUPPORT is not set
7165 CONFIG_NEW_LEDS=y
7266 CONFIG_LEDS_CLASS=y
@@ -78,7 +72,6 @@ CONFIG_RTC_CLASS=y · 5 unmodified lines
7872 CONFIG_RTC_INTF_DEV_UIE_EMUL=y
7973 CONFIG_RTC_DRV_RS5C348=y
8074 CONFIG_RTC_DRV_DS1742=y
81−CONFIG_RTC_DRV_TX4939=y
8275 CONFIG_DMADEVICES=y
8376 CONFIG_TXX9_DMAC=m
8477 # CONFIG_DNOTIFY is not set
arch/mips/configs/rm200_defconfig+0−7
@@ -29,9 +29,6 @@ CONFIG_NET_IPIP=m · 28 unmodified lines
2929 CONFIG_IP_MROUTE=y
3030 CONFIG_IP_PIMSM_V1=y
3131 CONFIG_IP_PIMSM_V2=y
32−CONFIG_INET_XFRM_MODE_TRANSPORT=m
33−CONFIG_INET_XFRM_MODE_TUNNEL=m
34−CONFIG_INET_XFRM_MODE_BEET=m
3532 CONFIG_TCP_MD5SIG=y
3633 CONFIG_IPV6_ROUTER_PREF=y
3734 CONFIG_IPV6_ROUTE_INFO=y
@@ -39,7 +36,6 @@ CONFIG_INET6_AH=m · 1 unmodified line
3936 CONFIG_INET6_ESP=m
4037 CONFIG_INET6_IPCOMP=m
4138 CONFIG_IPV6_MIP6=m
42−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
4339 CONFIG_IPV6_TUNNEL=m
4440 CONFIG_IPV6_MULTIPLE_TABLES=y
4541 CONFIG_IPV6_SUBTREES=y
@@ -190,9 +186,7 @@ CONFIG_PARIDE_KTTI=m · 144 unmodified lines
190186 CONFIG_PARIDE_ON20=m
191187 CONFIG_PARIDE_ON26=m
192188 CONFIG_BLK_DEV_LOOP=m
193−CONFIG_BLK_DEV_CRYPTOLOOP=m
194189 CONFIG_BLK_DEV_NBD=m
195−CONFIG_BLK_DEV_SX8=m
196190 CONFIG_BLK_DEV_RAM=m
197191 CONFIG_CDROM_PKTCDVD=m
198192 CONFIG_ATA_OVER_ETH=m
@@ -398,7 +392,6 @@ CONFIG_CRYPTO_PCBC=m · 199 unmodified lines
398392 CONFIG_CRYPTO_HMAC=y
399393 CONFIG_CRYPTO_XCBC=m
400394 CONFIG_CRYPTO_MICHAEL_MIC=m
401−CONFIG_CRYPTO_TGR192=m
402395 CONFIG_CRYPTO_WP512=m
403396 CONFIG_CRYPTO_ANUBIS=m
404397 CONFIG_CRYPTO_BLOWFISH=m
arch/mips/configs/rt305x_defconfig+0−4
@@ -35,9 +35,6 @@ CONFIG_IP_ROUTE_VERBOSE=y · 34 unmodified lines
3535 CONFIG_IP_MROUTE=y
3636 CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
3737 CONFIG_SYN_COOKIES=y
38−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
39−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
40−# CONFIG_INET_XFRM_MODE_BEET is not set
4138 # CONFIG_INET_DIAG is not set
4239 CONFIG_TCP_CONG_ADVANCED=y
4340 # CONFIG_TCP_CONG_BIC is not set
@@ -140,7 +137,6 @@ CONFIG_CRC32_SARWATE=y · 96 unmodified lines
140137 # CONFIG_XZ_DEC_ARMTHUMB is not set
141138 # CONFIG_XZ_DEC_SPARC is not set
142139 CONFIG_PRINTK_TIME=y
143−# CONFIG_ENABLE_MUST_CHECK is not set
144140 CONFIG_STRIP_ASM_SYMS=y
145141 CONFIG_DEBUG_FS=y
146142 CONFIG_MAGIC_SYSRQ=y
arch/mips/configs/sb1250_swarm_defconfig+0−2
@@ -88,7 +88,6 @@ CONFIG_CRYPTO_XCBC=m · 87 unmodified lines
8888 CONFIG_CRYPTO_MD4=m
8989 CONFIG_CRYPTO_MICHAEL_MIC=m
9090 CONFIG_CRYPTO_SHA512=m
91−CONFIG_CRYPTO_TGR192=m
9291 CONFIG_CRYPTO_WP512=m
9392 CONFIG_CRYPTO_BLOWFISH=m
9493 CONFIG_CRYPTO_CAMELLIA=m
@@ -96,7 +95,6 @@ CONFIG_CRYPTO_CAST5=m · 1 unmodified line
9695 CONFIG_CRYPTO_CAST6=m
9796 CONFIG_CRYPTO_DES=m
9897 CONFIG_CRYPTO_FCRYPT=m
99−CONFIG_CRYPTO_SALSA20=m
10098 CONFIG_CRYPTO_SERPENT=m
10199 CONFIG_CRYPTO_TWOFISH=m
102100 CONFIG_CRYPTO_DEFLATE=m
arch/mips/configs/vocore2_defconfig+0−3
@@ -35,9 +35,6 @@ CONFIG_NET=y · 34 unmodified lines
3535 CONFIG_PACKET=y
3636 CONFIG_UNIX=y
3737 CONFIG_INET=y
38−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
39−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
40−# CONFIG_INET_XFRM_MODE_BEET is not set
4138 # CONFIG_INET_DIAG is not set
4239 # CONFIG_IPV6 is not set
4340 # CONFIG_WIRELESS is not set
arch/mips/configs/xway_defconfig+0−4
@@ -37,9 +37,6 @@ CONFIG_IP_ROUTE_VERBOSE=y · 36 unmodified lines
3737 CONFIG_IP_MROUTE=y
3838 CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
3939 CONFIG_SYN_COOKIES=y
40−# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
41−# CONFIG_INET_XFRM_MODE_TUNNEL is not set
42−# CONFIG_INET_XFRM_MODE_BEET is not set
4340 # CONFIG_INET_DIAG is not set
4441 CONFIG_TCP_CONG_ADVANCED=y
4542 # CONFIG_TCP_CONG_BIC is not set
@@ -146,7 +143,6 @@ CONFIG_CRYPTO_ARC4=m · 100 unmodified lines
146143 CONFIG_CRC_ITU_T=m
147144 CONFIG_CRC32_SARWATE=y
148145 CONFIG_PRINTK_TIME=y
149−# CONFIG_ENABLE_MUST_CHECK is not set
150146 CONFIG_STRIP_ASM_SYMS=y
151147 CONFIG_DEBUG_FS=y
152148 CONFIG_MAGIC_SYSRQ=y
arch/mips/include/asm/irq.h+0−4
@@ -63,10 +63,6 @@ extern void do_domain_IRQ(struct irq_domain *domain, unsigned int irq); · 62 unmodified lines
6363 extern void arch_init_irq(void);
6464 extern void spurious_interrupt(void);
6565
66−extern int allocate_irqno(void);
67−extern void alloc_legacy_irqno(void);
68−extern void free_irqno(unsigned int irq);
69−
7066 /*
7167 * Before R2 the timer and performance counter interrupts were both fixed to
7268 * IE7. Since R2 their number has to be read from the c0_intctl register.
arch/mips/include/asm/mach-ar7/ar7.h+0−2
@@ -104,8 +104,6 @@ struct plat_dsl_data { · 103 unmodified lines
104104 int reset_bit_sar;
105105 };
106106
107−extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock;
108−
109107 static inline int ar7_is_titan(void)
110108 {
111109 return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x24)) & 0xffff) ==
arch/mips/include/asm/octeon/cvmx-fpa.h+0−20
@@ -263,26 +263,6 @@ static inline void cvmx_fpa_free(void *ptr, uint64_t pool, · 262 unmodified lines
263263 cvmx_write_io(newptr.u64, num_cache_lines);
264264 }
265265
266−/**
267− * Setup a FPA pool to control a new block of memory.
268− * This can only be called once per pool. Make sure proper
269− * locking enforces this.
270− *
271− * @pool: Pool to initialize
272− * 0 <= pool < 8
273− * @name: Constant character string to name this pool.
274− * String is not copied.
275− * @buffer: Pointer to the block of memory to use. This must be
276− * accessible by all processors and external hardware.
277− * @block_size: Size for each block controlled by the FPA
278− * @num_blocks: Number of blocks
279− *
280− * Returns 0 on Success,
281− * -1 on failure
282− */
283−extern int cvmx_fpa_setup_pool(uint64_t pool, const char *name, void *buffer,
284− uint64_t block_size, uint64_t num_blocks);
285−
286266 /**
287267 * Shutdown a Memory pool and validate that it had all of
288268 * the buffers originally placed in it. This should only be
arch/mips/include/asm/octeon/octeon.h+0−1
@@ -43,7 +43,6 @@ extern int octeon_get_southbridge_interrupt(void); · 42 unmodified lines
4343 extern int octeon_get_boot_coremask(void);
4444 extern int octeon_get_boot_num_arguments(void);
4545 extern const char *octeon_get_boot_argument(int arg);
46−extern void octeon_hal_setup_reserved32(void);
4746 extern void octeon_user_io_init(void);
4847
4948 extern void octeon_init_cvmcount(void);
arch/mips/include/asm/octeon/pci-octeon.h+0−2
@@ -64,6 +64,4 @@ enum octeon_dma_bar_type { · 63 unmodified lines
6464 extern enum octeon_dma_bar_type octeon_dma_bar_type;
6565
6666 void octeon_pci_dma_init(void);
67−extern char *octeon_swiotlb;
68−
6967 #endif
arch/mips/include/asm/sibyte/sb1250.h+0−1
@@ -32,7 +32,6 @@ extern unsigned int soc_type; · 31 unmodified lines
3232 extern unsigned int periph_rev;
3333 extern unsigned int zbbus_mhz;
3434
35−extern void sb1250_time_init(void);
3635 extern void sb1250_mask_irq(int cpu, int irq);
3736 extern void sb1250_unmask_irq(int cpu, int irq);
3837
arch/mips/include/asm/sni.h+0−3
@@ -226,9 +226,6 @@ extern void sni_pcit_cplus_irq_init(void); · 225 unmodified lines
226226 extern void sni_rm200_irq_init(void);
227227 extern void sni_pcimt_irq_init(void);
228228
229−/* timer inits */
230−extern void sni_cpu_time_init(void);
231−
232229 /* eisa init for RM200/400 */
233230 #ifdef CONFIG_EISA
234231 extern int sni_eisa_root_init(void);
arch/mips/kernel/prom.c+3−3
@@ -26,7 +26,7 @@ __init void mips_set_machine_name(const char *name) · 25 unmodified lines
2626 if (name == NULL)
2727 return;
2828
29− strlcpy(mips_machine_name, name, sizeof(mips_machine_name));
29+ strscpy(mips_machine_name, name, sizeof(mips_machine_name));
3030 pr_info("MIPS: machine is %s\n", mips_get_machine_name());
3131 }
3232
@@ -52,9 +52,9 @@ int __init __dt_register_buses(const char *bus0, const char *bus1) · 19 unmodified lines
5252 if (!of_have_populated_dt())
5353 panic("device tree not present");
5454
55− strlcpy(of_ids[0].compatible, bus0, sizeof(of_ids[0].compatible));
55+ strscpy(of_ids[0].compatible, bus0, sizeof(of_ids[0].compatible));
5656 if (bus1) {
57− strlcpy(of_ids[1].compatible, bus1,
57+ strscpy(of_ids[1].compatible, bus1,
5858 sizeof(of_ids[1].compatible));
5959 }
6060
arch/mips/kernel/relocate.c+1−1
@@ -340,7 +340,7 @@ void *__init relocate_kernel(void) · 339 unmodified lines
340340 early_init_dt_scan(fdt);
341341 if (boot_command_line[0]) {
342342 /* Boot command line was passed in device tree */
343− strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
343+ strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
344344 }
345345 #endif /* CONFIG_USE_OF */
346346
arch/mips/kernel/segment.c+2−13
@@ -46,7 +46,7 @@ static void build_segment_config(char *str, unsigned int cfg) · 45 unmodified lines
4646 ((cfg & MIPS_SEGCFG_EU) >> MIPS_SEGCFG_EU_SHIFT));
4747 }
4848
49−static int show_segments(struct seq_file *m, void *v)
49+static int segments_show(struct seq_file *m, void *v)
5050 {
5151 unsigned int segcfg;
5252 char str[42];
@@ -80,18 +80,7 @@ static int show_segments(struct seq_file *m, void *v) · 27 unmodified lines
8080
8181 return 0;
8282 }
83−
84−static int segments_open(struct inode *inode, struct file *file)
85−{
86− return single_open(file, show_segments, NULL);
87−}
88−
89−static const struct file_operations segments_fops = {
90− .open = segments_open,
91− .read = seq_read,
92− .llseek = seq_lseek,
93− .release = single_release,
94−};
83+DEFINE_SHOW_ATTRIBUTE(segments);
9584
9685 static int __init segments_info(void)
9786 {
arch/mips/kernel/setup.c+21−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <asm/setup.h>
4343 #include <asm/smp-ops.h>
4444 #include <asm/prom.h>
45+#include <asm/fw/fw.h>
4546
4647 #ifdef CONFIG_MIPS_ELF_APPENDED_DTB
4748 char __section(".appended_dtb") __appended_dtb[0x100000];
@@ -756,6 +757,24 @@ static void __init prefill_possible_map(void) · 708 unmodified lines
756757 static inline void prefill_possible_map(void) {}
757758 #endif
758759
760+static void __init setup_rng_seed(void)
761+{
762+ char *rng_seed_hex = fw_getenv("rngseed");
763+ u8 rng_seed[512];
764+ size_t len;
765+
766+ if (!rng_seed_hex)
767+ return;
768+
769+ len = min(sizeof(rng_seed), strlen(rng_seed_hex) / 2);
770+ if (hex2bin(rng_seed, rng_seed_hex, len))
771+ return;
772+
773+ add_bootloader_randomness(rng_seed, len);
774+ memzero_explicit(rng_seed, len);
775+ memzero_explicit(rng_seed_hex, len * 2);
776+}
777+
759778 void __init setup_arch(char **cmdline_p)
760779 {
761780 cpu_probe();
@@ -786,6 +805,8 @@ void __init setup_arch(char **cmdline_p) · 24 unmodified lines
786805 paging_init();
787806
788807 memblock_dump_all();
808+
809+ setup_rng_seed();
789810 }
790811
791812 unsigned long kernelsp[NR_CPUS];
arch/mips/lantiq/prom.c+24−2
@@ -34,6 +34,14 @@ unsigned long physical_memsize = 0L; · 33 unmodified lines
3434 */
3535 static struct ltq_soc_info soc_info;
3636
37+/*
38+ * These structs are used to override vsmp_init_secondary()
39+ */
40+#if defined(CONFIG_MIPS_MT_SMP)
41+extern const struct plat_smp_ops vsmp_smp_ops;
42+static struct plat_smp_ops lantiq_smp_ops;
43+#endif
44+
3745 const char *get_system_type(void)
3846 {
3947 return soc_info.sys_type;
@@ -84,6 +92,17 @@ void __init plat_mem_setup(void) · 44 unmodified lines
8492 __dt_setup_arch(dtb);
8593 }
8694
95+#if defined(CONFIG_MIPS_MT_SMP)
96+static void lantiq_init_secondary(void)
97+{
98+ /*
99+ * MIPS CPU startup function vsmp_init_secondary() will only
100+ * enable some of the interrupts for the second CPU/VPE.
101+ */
102+ set_c0_status(ST0_IM);
103+}
104+#endif
105+
87106 void __init prom_init(void)
88107 {
89108 /* call the soc specific detetcion code and get it to fill soc_info */
@@ -95,7 +114,10 @@ void __init prom_init(void) · 5 unmodified lines
95114 prom_init_cmdline();
96115
97116 #if defined(CONFIG_MIPS_MT_SMP)
98− if (register_vsmp_smp_ops())
99− panic("failed to register_vsmp_smp_ops()");
117+ if (cpu_has_mipsmt) {
118+ lantiq_smp_ops = vsmp_smp_ops;
119+ lantiq_smp_ops.init_secondary = lantiq_init_secondary;
120+ register_smp_ops(&lantiq_smp_ops);
121+ }
100122 #endif
101123 }
arch/mips/lantiq/xway/vmmc.c+15−9
@@ -4,9 +4,10 @@ · 3 unmodified lines
44 * Copyright (C) 2012 John Crispin <john@phrozen.org>
55 */
66
7+#include <linux/err.h>
78 #include <linux/export.h>
9+#include <linux/gpio/consumer.h>
810 #include <linux/of_platform.h>
9−#include <linux/of_gpio.h>
1011 #include <linux/dma-mapping.h>
1112
1213 #include <lantiq_soc.h>
@@ -25,23 +26,28 @@ EXPORT_SYMBOL(ltq_get_cp1_base); · 12 unmodified lines
2526 static int vmmc_probe(struct platform_device *pdev)
2627 {
2728 #define CP1_SIZE (1 << 20)
29+ struct gpio_desc *gpio;
2830 int gpio_count;
2931 dma_addr_t dma;
32+ int error;
3033
3134 cp1_base =
3235 (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
3336 &dma, GFP_KERNEL));
3437
35− gpio_count = of_gpio_count(pdev->dev.of_node);
38+ gpio_count = gpiod_count(&pdev->dev, NULL);
3639 while (gpio_count > 0) {
37− enum of_gpio_flags flags;
38− int gpio = of_get_gpio_flags(pdev->dev.of_node,
39− --gpio_count, &flags);
40− if (gpio_request(gpio, "vmmc-relay"))
40+ gpio = devm_gpiod_get_index(&pdev->dev,
41+ NULL, --gpio_count, GPIOD_OUT_HIGH);
42+ error = PTR_ERR_OR_ZERO(gpio);
43+ if (error) {
44+ dev_err(&pdev->dev,
45+ "failed to request GPIO idx %d: %d\n",
46+ gpio_count, error);
4147 continue;
42− dev_info(&pdev->dev, "requested GPIO %d\n", gpio);
43− gpio_direction_output(gpio,
44− (flags & OF_GPIO_ACTIVE_LOW) ? (0) : (1));
48+ }
49+
50+ gpiod_set_consumer_name(gpio, "vmmc-relay");
4551 }
4652
4753 dev_info(&pdev->dev, "reserved %dMB at 0x%p", CP1_SIZE >> 20, cp1_base);
arch/mips/lib/bswapdi.c+5−9
@@ -1,17 +1,13 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/export.h>
33 #include <linux/compiler.h>
4+#include <uapi/linux/swab.h>
5+
6+/* To silence -Wmissing-prototypes. */
7+unsigned long long __bswapdi2(unsigned long long u);
48
59 unsigned long long notrace __bswapdi2(unsigned long long u)
610 {
7− return (((u) & 0xff00000000000000ull) >> 56) |
8− (((u) & 0x00ff000000000000ull) >> 40) |
9− (((u) & 0x0000ff0000000000ull) >> 24) |
10− (((u) & 0x000000ff00000000ull) >> 8) |
11− (((u) & 0x00000000ff000000ull) << 8) |
12− (((u) & 0x0000000000ff0000ull) << 24) |
13− (((u) & 0x000000000000ff00ull) << 40) |
14− (((u) & 0x00000000000000ffull) << 56);
11+ return ___constant_swab64(u);
1512 }
16−
1713 EXPORT_SYMBOL(__bswapdi2);
arch/mips/lib/bswapsi.c+5−5
@@ -1,13 +1,13 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/export.h>
33 #include <linux/compiler.h>
4+#include <uapi/linux/swab.h>
5+
6+/* To silence -Wmissing-prototypes. */
7+unsigned int __bswapsi2(unsigned int u);
48
59 unsigned int notrace __bswapsi2(unsigned int u)
610 {
7− return (((u) & 0xff000000) >> 24) |
8− (((u) & 0x00ff0000) >> 8) |
9− (((u) & 0x0000ff00) << 8) |
10− (((u) & 0x000000ff) << 24);
11+ return ___constant_swab32(u);
1112 }
12−
1313 EXPORT_SYMBOL(__bswapsi2);
arch/mips/loongson2ef/common/pci.c+0−2
@@ -73,8 +73,6 @@ static void __init setup_pcimap(void) · 72 unmodified lines
7373 #endif
7474 }
7575
76−extern int sbx00_acpi_init(void);
77−
7876 static int __init pcibios_init(void)
7977 {
8078 setup_pcimap();
arch/mips/math-emu/cp1emu.c+1−1
@@ -1032,7 +1032,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx, · 1031 unmodified lines
10321032 */
10331033 if (dec_insn.micro_mips_mode) {
10341034 /*
1035− * If next instruction is a 16-bit instruction, then it
1035+ * If next instruction is a 16-bit instruction, then
10361036 * it cannot be a FPU instruction. This could happen
10371037 * since we can be called for non-FPU instructions.
10381038 */
arch/mips/pci/pci-ar2315.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 */
44
5−/**
5+/*
66 * Both AR2315 and AR2316 chips have PCI interface unit, which supports DMA
77 * and interrupt. PCI interface supports MMIO access method, but does not
88 * seem to support I/O ports.
arch/mips/pci/pci-lantiq.c+13−15
@@ -9,11 +9,11 @@ · 8 unmodified lines
99 #include <linux/kernel.h>
1010 #include <linux/init.h>
1111 #include <linux/delay.h>
12+#include <linux/gpio/consumer.h>
1213 #include <linux/mm.h>
1314 #include <linux/vmalloc.h>
1415 #include <linux/clk.h>
1516 #include <linux/of_platform.h>
16−#include <linux/of_gpio.h>
1717 #include <linux/of_irq.h>
1818 #include <linux/of_pci.h>
1919
@@ -62,7 +62,7 @@ · 42 unmodified lines
6262 __iomem void *ltq_pci_mapped_cfg;
6363 static __iomem void *ltq_pci_membase;
6464
65−static int reset_gpio;
65+static struct gpio_desc *reset_gpio;
6666 static struct clk *clk_pci, *clk_external;
6767 static struct resource pci_io_resource;
6868 static struct resource pci_mem_resource;
@@ -95,6 +95,7 @@ static int ltq_pci_startup(struct platform_device *pdev) · 26 unmodified lines
9595 struct device_node *node = pdev->dev.of_node;
9696 const __be32 *req_mask, *bus_clk;
9797 u32 temp_buffer;
98+ int error;
9899
99100 /* get our clocks */
100101 clk_pci = clk_get(&pdev->dev, NULL);
@@ -123,17 +124,14 @@ static int ltq_pci_startup(struct platform_device *pdev) · 22 unmodified lines
123124 clk_disable(clk_external);
124125
125126 /* setup reset gpio used by pci */
126− reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
127− if (gpio_is_valid(reset_gpio)) {
128− int ret = devm_gpio_request(&pdev->dev,
129− reset_gpio, "pci-reset");
130− if (ret) {
131− dev_err(&pdev->dev,
132− "failed to request gpio %d\n", reset_gpio);
133− return ret;
134− }
135− gpio_direction_output(reset_gpio, 1);
127+ reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
128+ GPIOD_OUT_LOW);
129+ error = PTR_ERR_OR_ZERO(reset_gpio);
130+ if (error) {
131+ dev_err(&pdev->dev, "failed to request gpio: %d\n", error);
132+ return error;
136133 }
134+ gpiod_set_consumer_name(reset_gpio, "pci_reset");
137135
138136 /* enable auto-switching between PCI and EBU */
139137 ltq_pci_w32(0xa, PCI_CR_CLK_CTRL);
@@ -195,11 +193,11 @@ static int ltq_pci_startup(struct platform_device *pdev) · 55 unmodified lines
195193 ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN);
196194
197195 /* toggle reset pin */
198− if (gpio_is_valid(reset_gpio)) {
199− __gpio_set_value(reset_gpio, 0);
196+ if (reset_gpio) {
197+ gpiod_set_value_cansleep(reset_gpio, 1);
200198 wmb();
201199 mdelay(1);
202− __gpio_set_value(reset_gpio, 1);
200+ gpiod_set_value_cansleep(reset_gpio, 0);
203201 }
204202 return 0;
205203 }
arch/mips/pic32/pic32mzda/init.c+1−1
@@ -44,7 +44,7 @@ void __init plat_mem_setup(void) · 43 unmodified lines
4444 pr_info(" builtin_cmdline : %s\n", CONFIG_CMDLINE);
4545 #endif
4646 if (dtb != __dtb_start)
47− strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
47+ strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
4848
4949 #ifdef CONFIG_EARLY_PRINTK
5050 fw_init_early_console(-1);
arch/mips/ralink/bootrom.c+2−13
@@ -18,22 +18,11 @@ static int bootrom_show(struct seq_file *s, void *unused) · 17 unmodified lines
1818
1919 return 0;
2020 }
21−
22−static int bootrom_open(struct inode *inode, struct file *file)
23−{
24− return single_open(file, bootrom_show, NULL);
25−}
26−
27−static const struct file_operations bootrom_file_ops = {
28− .open = bootrom_open,
29− .read = seq_read,
30− .llseek = seq_lseek,
31− .release = single_release,
32−};
21+DEFINE_SHOW_ATTRIBUTE(bootrom);
3322
3423 static int __init bootrom_setup(void)
3524 {
36− debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_file_ops);
25+ debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_fops);
3726 return 0;
3827 }
3928
arch/mips/sgi-ip27/ip27-xtalk.c+50−20
@@ -27,15 +27,18 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid) · 26 unmodified lines
2727 {
2828 struct xtalk_bridge_platform_data *bd;
2929 struct sgi_w1_platform_data *wd;
30− struct platform_device *pdev;
30+ struct platform_device *pdev_wd;
31+ struct platform_device *pdev_bd;
3132 struct resource w1_res;
3233 unsigned long offset;
3334
3435 offset = NODE_OFFSET(nasid);
3536
3637 wd = kzalloc(sizeof(*wd), GFP_KERNEL);
37− if (!wd)
38− goto no_mem;
38+ if (!wd) {
39+ pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
40+ return;
41+ }
3942
4043 snprintf(wd->dev_id, sizeof(wd->dev_id), "bridge-%012lx",
4144 offset + (widget << SWIN_SIZE_BITS));
@@ -46,24 +49,35 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid) · 4 unmodified lines
4649 w1_res.end = w1_res.start + 3;
4750 w1_res.flags = IORESOURCE_MEM;
4851
49− pdev = platform_device_alloc("sgi_w1", PLATFORM_DEVID_AUTO);
50− if (!pdev) {
51− kfree(wd);
52− goto no_mem;
52+ pdev_wd = platform_device_alloc("sgi_w1", PLATFORM_DEVID_AUTO);
53+ if (!pdev_wd) {
54+ pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
55+ goto err_kfree_wd;
56+ }
57+ if (platform_device_add_resources(pdev_wd, &w1_res, 1)) {
58+ pr_warn("xtalk:n%d/%x bridge failed to add platform resources.\n", nasid, widget);
59+ goto err_put_pdev_wd;
60+ }
61+ if (platform_device_add_data(pdev_wd, wd, sizeof(*wd))) {
62+ pr_warn("xtalk:n%d/%x bridge failed to add platform data.\n", nasid, widget);
63+ goto err_put_pdev_wd;
64+ }
65+ if (platform_device_add(pdev_wd)) {
66+ pr_warn("xtalk:n%d/%x bridge failed to add platform device.\n", nasid, widget);
67+ goto err_put_pdev_wd;
5368 }
54− platform_device_add_resources(pdev, &w1_res, 1);
55− platform_device_add_data(pdev, wd, sizeof(*wd));
5669 /* platform_device_add_data() duplicates the data */
5770 kfree(wd);
58− platform_device_add(pdev);
5971
6072 bd = kzalloc(sizeof(*bd), GFP_KERNEL);
61− if (!bd)
62− goto no_mem;
63− pdev = platform_device_alloc("xtalk-bridge", PLATFORM_DEVID_AUTO);
64− if (!pdev) {
65− kfree(bd);
66− goto no_mem;
73+ if (!bd) {
74+ pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
75+ goto err_unregister_pdev_wd;
76+ }
77+ pdev_bd = platform_device_alloc("xtalk-bridge", PLATFORM_DEVID_AUTO);
78+ if (!pdev_bd) {
79+ pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
80+ goto err_kfree_bd;
6781 }
6882
6983
@@ -84,15 +98,31 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid) · 14 unmodified lines
8498 bd->io.flags = IORESOURCE_IO;
8599 bd->io_offset = offset;
86100
87− platform_device_add_data(pdev, bd, sizeof(*bd));
101+ if (platform_device_add_data(pdev_bd, bd, sizeof(*bd))) {
102+ pr_warn("xtalk:n%d/%x bridge failed to add platform data.\n", nasid, widget);
103+ goto err_put_pdev_bd;
104+ }
105+ if (platform_device_add(pdev_bd)) {
106+ pr_warn("xtalk:n%d/%x bridge failed to add platform device.\n", nasid, widget);
107+ goto err_put_pdev_bd;
108+ }
88109 /* platform_device_add_data() duplicates the data */
89110 kfree(bd);
90− platform_device_add(pdev);
91111 pr_info("xtalk:n%d/%x bridge widget\n", nasid, widget);
92112 return;
93113
94−no_mem:
95− pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
114+err_put_pdev_bd:
115+ platform_device_put(pdev_bd);
116+err_kfree_bd:
117+ kfree(bd);
118+err_unregister_pdev_wd:
119+ platform_device_unregister(pdev_wd);
120+ return;
121+err_put_pdev_wd:
122+ platform_device_put(pdev_wd);
123+err_kfree_wd:
124+ kfree(wd);
125+ return;
96126 }
97127
98128 static int probe_one_port(nasid_t nasid, int widget, int masterwid)
arch/mips/sgi-ip30/ip30-xtalk.c+50−20
@@ -40,12 +40,15 @@ static void bridge_platform_create(int widget, int masterwid) · 39 unmodified lines
4040 {
4141 struct xtalk_bridge_platform_data *bd;
4242 struct sgi_w1_platform_data *wd;
43− struct platform_device *pdev;
43+ struct platform_device *pdev_wd;
44+ struct platform_device *pdev_bd;
4445 struct resource w1_res;
4546
4647 wd = kzalloc(sizeof(*wd), GFP_KERNEL);
47− if (!wd)
48− goto no_mem;
48+ if (!wd) {
49+ pr_warn("xtalk:%x bridge create out of memory\n", widget);
50+ return;
51+ }
4952
5053 snprintf(wd->dev_id, sizeof(wd->dev_id), "bridge-%012lx",
5154 IP30_SWIN_BASE(widget));
@@ -56,24 +59,35 @@ static void bridge_platform_create(int widget, int masterwid) · 4 unmodified lines
5659 w1_res.end = w1_res.start + 3;
5760 w1_res.flags = IORESOURCE_MEM;
5861
59− pdev = platform_device_alloc("sgi_w1", PLATFORM_DEVID_AUTO);
60− if (!pdev) {
61− kfree(wd);
62− goto no_mem;
62+ pdev_wd = platform_device_alloc("sgi_w1", PLATFORM_DEVID_AUTO);
63+ if (!pdev_wd) {
64+ pr_warn("xtalk:%x bridge create out of memory\n", widget);
65+ goto err_kfree_wd;
66+ }
67+ if (platform_device_add_resources(pdev_wd, &w1_res, 1)) {
68+ pr_warn("xtalk:%x bridge failed to add platform resources.\n", widget);
69+ goto err_put_pdev_wd;
70+ }
71+ if (platform_device_add_data(pdev_wd, wd, sizeof(*wd))) {
72+ pr_warn("xtalk:%x bridge failed to add platform data.\n", widget);
73+ goto err_put_pdev_wd;
74+ }
75+ if (platform_device_add(pdev_wd)) {
76+ pr_warn("xtalk:%x bridge failed to add platform device.\n", widget);
77+ goto err_put_pdev_wd;
6378 }
64− platform_device_add_resources(pdev, &w1_res, 1);
65− platform_device_add_data(pdev, wd, sizeof(*wd));
6679 /* platform_device_add_data() duplicates the data */
6780 kfree(wd);
68− platform_device_add(pdev);
6981
7082 bd = kzalloc(sizeof(*bd), GFP_KERNEL);
71− if (!bd)
72− goto no_mem;
73− pdev = platform_device_alloc("xtalk-bridge", PLATFORM_DEVID_AUTO);
74− if (!pdev) {
75− kfree(bd);
76− goto no_mem;
83+ if (!bd) {
84+ pr_warn("xtalk:%x bridge create out of memory\n", widget);
85+ goto err_unregister_pdev_wd;
86+ }
87+ pdev_bd = platform_device_alloc("xtalk-bridge", PLATFORM_DEVID_AUTO);
88+ if (!pdev_bd) {
89+ pr_warn("xtalk:%x bridge create out of memory\n", widget);
90+ goto err_kfree_bd;
7791 }
7892
7993 bd->bridge_addr = IP30_RAW_SWIN_BASE(widget);
@@ -93,15 +107,31 @@ static void bridge_platform_create(int widget, int masterwid) · 13 unmodified lines
93107 bd->io.flags = IORESOURCE_IO;
94108 bd->io_offset = IP30_SWIN_BASE(widget);
95109
96− platform_device_add_data(pdev, bd, sizeof(*bd));
110+ if (platform_device_add_data(pdev_bd, bd, sizeof(*bd))) {
111+ pr_warn("xtalk:%x bridge failed to add platform data.\n", widget);
112+ goto err_put_pdev_bd;
113+ }
114+ if (platform_device_add(pdev_bd)) {
115+ pr_warn("xtalk:%x bridge failed to add platform device.\n", widget);
116+ goto err_put_pdev_bd;
117+ }
97118 /* platform_device_add_data() duplicates the data */
98119 kfree(bd);
99− platform_device_add(pdev);
100120 pr_info("xtalk:%x bridge widget\n", widget);
101121 return;
102122
103−no_mem:
104− pr_warn("xtalk:%x bridge create out of memory\n", widget);
123+err_put_pdev_bd:
124+ platform_device_put(pdev_bd);
125+err_kfree_bd:
126+ kfree(bd);
127+err_unregister_pdev_wd:
128+ platform_device_unregister(pdev_wd);
129+ return;
130+err_put_pdev_wd:
131+ platform_device_put(pdev_wd);
132+err_kfree_wd:
133+ kfree(wd);
134+ return;
105135 }
106136
107137 static unsigned int __init xbow_widget_active(s8 wid)
arch/mips/sibyte/sb1250/irq.c+0−6
@@ -262,12 +262,6 @@ void __init arch_init_irq(void) · 261 unmodified lines
262262 __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK)));
263263 __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK)));
264264
265− /*
266− * Note that the timer interrupts are also mapped, but this is
267− * done in sb1250_time_init(). Also, the profiling driver
268− * does its own management of IP7.
269− */
270−
271265 /* Enable necessary IPs, disable the rest */
272266 change_c0_status(ST0_IM, imask);
273267 }
arch/sh/include/asm/sections.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 #include <asm-generic/sections.h>
66
7−extern long __machvec_start, __machvec_end;
7+extern char __machvec_start[], __machvec_end[];
88 extern char __uncached_start, __uncached_end;
99 extern char __start_eh_frame[], __stop_eh_frame[];
1010
arch/sh/kernel/machvec.c+5−5
@@ -20,8 +20,8 @@ · 19 unmodified lines
2020 #define MV_NAME_SIZE 32
2121
2222 #define for_each_mv(mv) \
23− for ((mv) = (struct sh_machine_vector *)&__machvec_start; \
24− (mv) && (unsigned long)(mv) < (unsigned long)&__machvec_end; \
23+ for ((mv) = (struct sh_machine_vector *)__machvec_start; \
24+ (mv) && (unsigned long)(mv) < (unsigned long)__machvec_end; \
2525 (mv)++)
2626
2727 static struct sh_machine_vector * __init get_mv_byname(const char *name)
@@ -87,8 +87,8 @@ void __init sh_mv_setup(void) · 59 unmodified lines
8787 if (!machvec_selected) {
8888 unsigned long machvec_size;
8989
90− machvec_size = ((unsigned long)&__machvec_end -
91− (unsigned long)&__machvec_start);
90+ machvec_size = ((unsigned long)__machvec_end -
91+ (unsigned long)__machvec_start);
9292
9393 /*
9494 * Sanity check for machvec section alignment. Ensure
@@ -102,7 +102,7 @@ void __init sh_mv_setup(void) · 7 unmodified lines
102102 * vector (usually the only one) from .machvec.init.
103103 */
104104 if (machvec_size >= sizeof(struct sh_machine_vector))
105− sh_mv = *(struct sh_machine_vector *)&__machvec_start;
105+ sh_mv = *(struct sh_machine_vector *)__machvec_start;
106106 }
107107
108108 pr_notice("Booting machvec: %s\n", get_system_type());
arch/sparc/include/asm/smp_32.h+6−9
@@ -33,9 +33,6 @@ extern volatile unsigned long cpu_callin_map[NR_CPUS]; · 32 unmodified lines
3333 extern cpumask_t smp_commenced_mask;
3434 extern struct linux_prom_registers smp_penguin_ctable;
3535
36−typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long,
37− unsigned long, unsigned long);
38−
3936 void cpu_panic(void);
4037
4138 /*
@@ -57,7 +54,7 @@ void smp_bogo(struct seq_file *); · 15 unmodified lines
5754 void smp_info(struct seq_file *);
5855
5956 struct sparc32_ipi_ops {
60− void (*cross_call)(smpfunc_t func, cpumask_t mask, unsigned long arg1,
57+ void (*cross_call)(void *func, cpumask_t mask, unsigned long arg1,
6158 unsigned long arg2, unsigned long arg3,
6259 unsigned long arg4);
6360 void (*resched)(int cpu);
@@ -66,28 +63,28 @@ struct sparc32_ipi_ops { · 2 unmodified lines
6663 };
6764 extern const struct sparc32_ipi_ops *sparc32_ipi_ops;
6865
69−static inline void xc0(smpfunc_t func)
66+static inline void xc0(void *func)
7067 {
7168 sparc32_ipi_ops->cross_call(func, *cpu_online_mask, 0, 0, 0, 0);
7269 }
7370
74−static inline void xc1(smpfunc_t func, unsigned long arg1)
71+static inline void xc1(void *func, unsigned long arg1)
7572 {
7673 sparc32_ipi_ops->cross_call(func, *cpu_online_mask, arg1, 0, 0, 0);
7774 }
78−static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2)
75+static inline void xc2(void *func, unsigned long arg1, unsigned long arg2)
7976 {
8077 sparc32_ipi_ops->cross_call(func, *cpu_online_mask, arg1, arg2, 0, 0);
8178 }
8279
83−static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2,
80+static inline void xc3(void *func, unsigned long arg1, unsigned long arg2,
8481 unsigned long arg3)
8582 {
8683 sparc32_ipi_ops->cross_call(func, *cpu_online_mask,
8784 arg1, arg2, arg3, 0);
8885 }
8986
90−static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
87+static inline void xc4(void *func, unsigned long arg1, unsigned long arg2,
9188 unsigned long arg3, unsigned long arg4)
9289 {
9390 sparc32_ipi_ops->cross_call(func, *cpu_online_mask,
arch/sparc/kernel/leon_smp.c+7−5
@@ -359,7 +359,7 @@ void leonsmp_ipi_interrupt(void) · 358 unmodified lines
359359 }
360360
361361 static struct smp_funcall {
362− smpfunc_t func;
362+ void *func;
363363 unsigned long arg1;
364364 unsigned long arg2;
365365 unsigned long arg3;
@@ -372,7 +372,7 @@ static struct smp_funcall { · 6 unmodified lines
372372 static DEFINE_SPINLOCK(cross_call_lock);
373373
374374 /* Cross calls must be serialized, at least currently. */
375−static void leon_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
375+static void leon_cross_call(void *func, cpumask_t mask, unsigned long arg1,
376376 unsigned long arg2, unsigned long arg3,
377377 unsigned long arg4)
378378 {
@@ -384,7 +384,7 @@ static void leon_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, · 5 unmodified lines
384384
385385 {
386386 /* If you make changes here, make sure gcc generates proper code... */
387− register smpfunc_t f asm("i0") = func;
387+ register void *f asm("i0") = func;
388388 register unsigned long a1 asm("i1") = arg1;
389389 register unsigned long a2 asm("i2") = arg2;
390390 register unsigned long a3 asm("i3") = arg3;
@@ -444,11 +444,13 @@ static void leon_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, · 53 unmodified lines
444444 /* Running cross calls. */
445445 void leon_cross_call_irq(void)
446446 {
447+ void (*func)(unsigned long, unsigned long, unsigned long, unsigned long,
448+ unsigned long) = ccall_info.func;
447449 int i = smp_processor_id();
448450
449451 ccall_info.processors_in[i] = 1;
450− ccall_info.func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3,
451− ccall_info.arg4, ccall_info.arg5);
452+ func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4,
453+ ccall_info.arg5);
452454 ccall_info.processors_out[i] = 1;
453455 }
454456
arch/sparc/kernel/sun4d_smp.c+7−5
@@ -268,7 +268,7 @@ static void sun4d_ipi_resched(int cpu) · 267 unmodified lines
268268 }
269269
270270 static struct smp_funcall {
271− smpfunc_t func;
271+ void *func;
272272 unsigned long arg1;
273273 unsigned long arg2;
274274 unsigned long arg3;
@@ -281,7 +281,7 @@ static struct smp_funcall { · 6 unmodified lines
281281 static DEFINE_SPINLOCK(cross_call_lock);
282282
283283 /* Cross calls must be serialized, at least currently. */
284−static void sun4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
284+static void sun4d_cross_call(void *func, cpumask_t mask, unsigned long arg1,
285285 unsigned long arg2, unsigned long arg3,
286286 unsigned long arg4)
287287 {
@@ -296,7 +296,7 @@ static void sun4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, · 8 unmodified lines
296296 * If you make changes here, make sure
297297 * gcc generates proper code...
298298 */
299− register smpfunc_t f asm("i0") = func;
299+ register void *f asm("i0") = func;
300300 register unsigned long a1 asm("i1") = arg1;
301301 register unsigned long a2 asm("i2") = arg2;
302302 register unsigned long a3 asm("i3") = arg3;
@@ -353,11 +353,13 @@ static void sun4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, · 50 unmodified lines
353353 /* Running cross calls. */
354354 void smp4d_cross_call_irq(void)
355355 {
356+ void (*func)(unsigned long, unsigned long, unsigned long, unsigned long,
357+ unsigned long) = ccall_info.func;
356358 int i = hard_smp_processor_id();
357359
358360 ccall_info.processors_in[i] = 1;
359− ccall_info.func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3,
360− ccall_info.arg4, ccall_info.arg5);
361+ func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4,
362+ ccall_info.arg5);
361363 ccall_info.processors_out[i] = 1;
362364 }
363365
arch/sparc/kernel/sun4m_smp.c+6−4
@@ -157,7 +157,7 @@ static void sun4m_ipi_mask_one(int cpu) · 156 unmodified lines
157157 }
158158
159159 static struct smp_funcall {
160− smpfunc_t func;
160+ void *func;
161161 unsigned long arg1;
162162 unsigned long arg2;
163163 unsigned long arg3;
@@ -170,7 +170,7 @@ static struct smp_funcall { · 6 unmodified lines
170170 static DEFINE_SPINLOCK(cross_call_lock);
171171
172172 /* Cross calls must be serialized, at least currently. */
173−static void sun4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
173+static void sun4m_cross_call(void *func, cpumask_t mask, unsigned long arg1,
174174 unsigned long arg2, unsigned long arg3,
175175 unsigned long arg4)
176176 {
@@ -230,11 +230,13 @@ static void sun4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, · 53 unmodified lines
230230 /* Running cross calls. */
231231 void smp4m_cross_call_irq(void)
232232 {
233+ void (*func)(unsigned long, unsigned long, unsigned long, unsigned long,
234+ unsigned long) = ccall_info.func;
233235 int i = smp_processor_id();
234236
235237 ccall_info.processors_in[i] = 1;
236− ccall_info.func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3,
237− ccall_info.arg4, ccall_info.arg5);
238+ func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4,
239+ ccall_info.arg5);
238240 ccall_info.processors_out[i] = 1;
239241 }
240242
arch/sparc/mm/srmmu.c+13−16
@@ -1636,19 +1636,19 @@ static void __init get_srmmu_type(void) · 1635 unmodified lines
16361636 /* Local cross-calls. */
16371637 static void smp_flush_page_for_dma(unsigned long page)
16381638 {
1639− xc1((smpfunc_t) local_ops->page_for_dma, page);
1639+ xc1(local_ops->page_for_dma, page);
16401640 local_ops->page_for_dma(page);
16411641 }
16421642
16431643 static void smp_flush_cache_all(void)
16441644 {
1645− xc0((smpfunc_t) local_ops->cache_all);
1645+ xc0(local_ops->cache_all);
16461646 local_ops->cache_all();
16471647 }
16481648
16491649 static void smp_flush_tlb_all(void)
16501650 {
1651− xc0((smpfunc_t) local_ops->tlb_all);
1651+ xc0(local_ops->tlb_all);
16521652 local_ops->tlb_all();
16531653 }
16541654
@@ -1659,7 +1659,7 @@ static void smp_flush_cache_mm(struct mm_struct *mm) · 4 unmodified lines
16591659 cpumask_copy(&cpu_mask, mm_cpumask(mm));
16601660 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
16611661 if (!cpumask_empty(&cpu_mask))
1662− xc1((smpfunc_t) local_ops->cache_mm, (unsigned long) mm);
1662+ xc1(local_ops->cache_mm, (unsigned long)mm);
16631663 local_ops->cache_mm(mm);
16641664 }
16651665 }
@@ -1671,7 +1671,7 @@ static void smp_flush_tlb_mm(struct mm_struct *mm) · 5 unmodified lines
16711671 cpumask_copy(&cpu_mask, mm_cpumask(mm));
16721672 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
16731673 if (!cpumask_empty(&cpu_mask)) {
1674− xc1((smpfunc_t) local_ops->tlb_mm, (unsigned long) mm);
1674+ xc1(local_ops->tlb_mm, (unsigned long)mm);
16751675 if (atomic_read(&mm->mm_users) == 1 && current->active_mm == mm)
16761676 cpumask_copy(mm_cpumask(mm),
16771677 cpumask_of(smp_processor_id()));
@@ -1691,8 +1691,8 @@ static void smp_flush_cache_range(struct vm_area_struct *vma, · 13 unmodified lines
16911691 cpumask_copy(&cpu_mask, mm_cpumask(mm));
16921692 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
16931693 if (!cpumask_empty(&cpu_mask))
1694− xc3((smpfunc_t) local_ops->cache_range,
1695− (unsigned long) vma, start, end);
1694+ xc3(local_ops->cache_range, (unsigned long)vma, start,
1695+ end);
16961696 local_ops->cache_range(vma, start, end);
16971697 }
16981698 }
@@ -1708,8 +1708,8 @@ static void smp_flush_tlb_range(struct vm_area_struct *vma, · 9 unmodified lines
17081708 cpumask_copy(&cpu_mask, mm_cpumask(mm));
17091709 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
17101710 if (!cpumask_empty(&cpu_mask))
1711− xc3((smpfunc_t) local_ops->tlb_range,
1712− (unsigned long) vma, start, end);
1711+ xc3(local_ops->tlb_range, (unsigned long)vma, start,
1712+ end);
17131713 local_ops->tlb_range(vma, start, end);
17141714 }
17151715 }
@@ -1723,8 +1723,7 @@ static void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page) · 7 unmodified lines
17231723 cpumask_copy(&cpu_mask, mm_cpumask(mm));
17241724 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
17251725 if (!cpumask_empty(&cpu_mask))
1726− xc2((smpfunc_t) local_ops->cache_page,
1727− (unsigned long) vma, page);
1726+ xc2(local_ops->cache_page, (unsigned long)vma, page);
17281727 local_ops->cache_page(vma, page);
17291728 }
17301729 }
@@ -1738,8 +1737,7 @@ static void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) · 7 unmodified lines
17381737 cpumask_copy(&cpu_mask, mm_cpumask(mm));
17391738 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
17401739 if (!cpumask_empty(&cpu_mask))
1741− xc2((smpfunc_t) local_ops->tlb_page,
1742− (unsigned long) vma, page);
1740+ xc2(local_ops->tlb_page, (unsigned long)vma, page);
17431741 local_ops->tlb_page(vma, page);
17441742 }
17451743 }
@@ -1753,7 +1751,7 @@ static void smp_flush_page_to_ram(unsigned long page) · 7 unmodified lines
17531751 * XXX This experiment failed, research further... -DaveM
17541752 */
17551753 #if 1
1756− xc1((smpfunc_t) local_ops->page_to_ram, page);
1754+ xc1(local_ops->page_to_ram, page);
17571755 #endif
17581756 local_ops->page_to_ram(page);
17591757 }
@@ -1764,8 +1762,7 @@ static void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) · 4 unmodified lines
17641762 cpumask_copy(&cpu_mask, mm_cpumask(mm));
17651763 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
17661764 if (!cpumask_empty(&cpu_mask))
1767− xc2((smpfunc_t) local_ops->sig_insns,
1768− (unsigned long) mm, insn_addr);
1765+ xc2(local_ops->sig_insns, (unsigned long)mm, insn_addr);
17691766 local_ops->sig_insns(mm, insn_addr);
17701767 }
17711768
arch/um/Kconfig+1−0
@@ -6,6 +6,7 @@ config UML · 5 unmodified lines
66 bool
77 default y
88 select ARCH_EPHEMERAL_INODES
9+ select ARCH_HAS_FORTIFY_SOURCE
910 select ARCH_HAS_GCOV_PROFILE_ALL
1011 select ARCH_HAS_KCOV
1112 select ARCH_HAS_STRNCPY_FROM_USER
arch/um/os-Linux/user_syms.c+1−0
@@ -1,4 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2+#define __NO_FORTIFY
23 #include <linux/types.h>
34 #include <linux/module.h>
45
arch/x86/Kconfig+11−2
@@ -107,6 +107,8 @@ config X86 · 106 unmodified lines
107107 select ARCH_SUPPORTS_PAGE_TABLE_CHECK if X86_64
108108 select ARCH_SUPPORTS_NUMA_BALANCING if X86_64
109109 select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP if NR_CPUS <= 4096
110+ select ARCH_SUPPORTS_CFI_CLANG if X86_64
111+ select ARCH_USES_CFI_TRAPS if X86_64 && CFI_CLANG
110112 select ARCH_SUPPORTS_LTO_CLANG
111113 select ARCH_SUPPORTS_LTO_CLANG_THIN
112114 select ARCH_USE_BUILTIN_BSWAP
@@ -257,6 +259,7 @@ config X86 · 144 unmodified lines
257259 select HAVE_STATIC_CALL_INLINE if HAVE_OBJTOOL
258260 select HAVE_PREEMPT_DYNAMIC_CALL
259261 select HAVE_RSEQ
262+ select HAVE_RUST if X86_64
260263 select HAVE_SYSCALL_TRACEPOINTS
261264 select HAVE_UACCESS_VALIDATION if HAVE_OBJTOOL
262265 select HAVE_UNSTABLE_SCHED_CLOCK
@@ -284,6 +287,7 @@ config X86 · 21 unmodified lines
284287 select PROC_PID_ARCH_STATUS if PROC_FS
285288 select HAVE_ARCH_NODE_DEV_GROUP if X86_SGX
286289 imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI
290+ select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
287291
288292 config INSTRUCTION_DECODER
289293 def_bool y
@@ -448,6 +452,11 @@ config X86_X2APIC · 158 unmodified lines
448452 This allows 32-bit apic IDs (so it can support very large systems),
449453 and accesses the local apic via MSRs not via mmio.
450454
455+ Some Intel systems circa 2022 and later are locked into x2APIC mode
456+ and can not fall back to the legacy APIC modes if SGX or TDX are
457+ enabled in the BIOS. They will be unable to boot without enabling
458+ this option.
459+
451460 If you don't know what to do here, say N.
452461
453462 config X86_MPPARSE
@@ -1919,7 +1928,7 @@ endchoice · 1465 unmodified lines
19191928
19201929 config X86_SGX
19211930 bool "Software Guard eXtensions (SGX)"
1922− depends on X86_64 && CPU_SUP_INTEL
1931+ depends on X86_64 && CPU_SUP_INTEL && X86_X2APIC
19231932 depends on CRYPTO=y
19241933 depends on CRYPTO_SHA256=y
19251934 select SRCU
@@ -2569,7 +2578,7 @@ menuconfig APM · 643 unmodified lines
25692578
25702579 1) make sure that you have enough swap space and that it is
25712580 enabled.
2572− 2) pass the "no-hlt" option to the kernel
2581+ 2) pass the "idle=poll" option to the kernel
25732582 3) switch on floating point emulation in the kernel and pass
25742583 the "no387" option to the kernel
25752584 4) pass the "floppy=nodma" option to the kernel
arch/x86/Makefile+10−0
@@ -68,6 +68,7 @@ export BITS · 67 unmodified lines
6868 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
6969 #
7070 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
71+KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
7172
7273 ifeq ($(CONFIG_X86_KERNEL_IBT),y)
7374 #
@@ -155,8 +156,17 @@ else · 81 unmodified lines
155156 cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
156157 KBUILD_CFLAGS += $(cflags-y)
157158
159+ rustflags-$(CONFIG_MK8) += -Ctarget-cpu=k8
160+ rustflags-$(CONFIG_MPSC) += -Ctarget-cpu=nocona
161+ rustflags-$(CONFIG_MCORE2) += -Ctarget-cpu=core2
162+ rustflags-$(CONFIG_MATOM) += -Ctarget-cpu=atom
163+ rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic
164+ KBUILD_RUSTFLAGS += $(rustflags-y)
165+
158166 KBUILD_CFLAGS += -mno-red-zone
159167 KBUILD_CFLAGS += -mcmodel=kernel
168+ KBUILD_RUSTFLAGS += -Cno-redzone=y
169+ KBUILD_RUSTFLAGS += -Ccode-model=kernel
160170 endif
161171
162172 #
arch/x86/boot/bitops.h+2−2
@@ -19,13 +19,13 @@ · 18 unmodified lines
1919
2020 static inline bool constant_test_bit(int nr, const void *addr)
2121 {
22− const u32 *p = (const u32 *)addr;
22+ const u32 *p = addr;
2323 return ((1UL << (nr & 31)) & (p[nr >> 5])) != 0;
2424 }
2525 static inline bool variable_test_bit(int nr, const void *addr)
2626 {
2727 bool v;
28− const u32 *p = (const u32 *)addr;
28+ const u32 *p = addr;
2929
3030 asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
3131 return v;
arch/x86/crypto/blowfish-x86_64-asm_64.S+3−2
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/linkage.h>
9+#include <linux/cfi_types.h>
910
1011 .file "blowfish-x86_64-asm.S"
1112 .text
@@ -141,7 +142,7 @@ SYM_FUNC_START(__blowfish_enc_blk) · 129 unmodified lines
141142 RET;
142143 SYM_FUNC_END(__blowfish_enc_blk)
143144
144−SYM_FUNC_START(blowfish_dec_blk)
145+SYM_TYPED_FUNC_START(blowfish_dec_blk)
145146 /* input:
146147 * %rdi: ctx
147148 * %rsi: dst
@@ -332,7 +333,7 @@ SYM_FUNC_START(__blowfish_enc_blk_4way) · 184 unmodified lines
332333 RET;
333334 SYM_FUNC_END(__blowfish_enc_blk_4way)
334335
335−SYM_FUNC_START(blowfish_dec_blk_4way)
336+SYM_TYPED_FUNC_START(blowfish_dec_blk_4way)
336337 /* input:
337338 * %rdi: ctx
338339 * %rsi: dst
arch/x86/entry/vdso/Makefile+2−1
@@ -91,7 +91,7 @@ ifneq ($(RETPOLINE_VDSO_CFLAGS),) · 90 unmodified lines
9191 endif
9292 endif
9393
94−$(vobjs): KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO) $(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
94+$(vobjs): KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) $(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)
9595 $(vobjs): KBUILD_AFLAGS += -DBUILD_VDSO
9696
9797 #
@@ -153,6 +153,7 @@ KBUILD_CFLAGS_32 := $(filter-out $(RANDSTRUCT_CFLAGS),$(KBUILD_CFLAGS_32)) · 55 unmodified lines
153153 KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32))
154154 KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS_32))
155155 KBUILD_CFLAGS_32 := $(filter-out $(CC_FLAGS_LTO),$(KBUILD_CFLAGS_32))
156+KBUILD_CFLAGS_32 := $(filter-out $(CC_FLAGS_CFI),$(KBUILD_CFLAGS_32))
156157 KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
157158 KBUILD_CFLAGS_32 += -fno-stack-protector
158159 KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
arch/x86/events/intel/core.c+39−1
@@ -2102,6 +2102,15 @@ static struct extra_reg intel_tnt_extra_regs[] __read_mostly = { · 2101 unmodified lines
21022102 EVENT_EXTRA_END
21032103 };
21042104
2105+EVENT_ATTR_STR(mem-loads, mem_ld_grt, "event=0xd0,umask=0x5,ldlat=3");
2106+EVENT_ATTR_STR(mem-stores, mem_st_grt, "event=0xd0,umask=0x6");
2107+
2108+static struct attribute *grt_mem_attrs[] = {
2109+ EVENT_PTR(mem_ld_grt),
2110+ EVENT_PTR(mem_st_grt),
2111+ NULL
2112+};
2113+
21052114 static struct extra_reg intel_grt_extra_regs[] __read_mostly = {
21062115 /* must define OFFCORE_RSP_X first, see intel_fixup_er() */
21072116 INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffffffffull, RSP_0),
@@ -5975,6 +5984,36 @@ __init int intel_pmu_init(void) · 3867 unmodified lines
59755984 name = "Tremont";
59765985 break;
59775986
5987+ case INTEL_FAM6_ALDERLAKE_N:
5988+ x86_pmu.mid_ack = true;
5989+ memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
5990+ sizeof(hw_cache_event_ids));
5991+ memcpy(hw_cache_extra_regs, tnt_hw_cache_extra_regs,
5992+ sizeof(hw_cache_extra_regs));
5993+ hw_cache_event_ids[C(ITLB)][C(OP_READ)][C(RESULT_ACCESS)] = -1;
5994+
5995+ x86_pmu.event_constraints = intel_slm_event_constraints;
5996+ x86_pmu.pebs_constraints = intel_grt_pebs_event_constraints;
5997+ x86_pmu.extra_regs = intel_grt_extra_regs;
5998+
5999+ x86_pmu.pebs_aliases = NULL;
6000+ x86_pmu.pebs_prec_dist = true;
6001+ x86_pmu.pebs_block = true;
6002+ x86_pmu.lbr_pt_coexist = true;
6003+ x86_pmu.flags |= PMU_FL_HAS_RSP_1;
6004+ x86_pmu.flags |= PMU_FL_INSTR_LATENCY;
6005+
6006+ intel_pmu_pebs_data_source_grt();
6007+ x86_pmu.pebs_latency_data = adl_latency_data_small;
6008+ x86_pmu.get_event_constraints = tnt_get_event_constraints;
6009+ x86_pmu.limit_period = spr_limit_period;
6010+ td_attr = tnt_events_attrs;
6011+ mem_attr = grt_mem_attrs;
6012+ extra_attr = nhm_format_attr;
6013+ pr_cont("Gracemont events, ");
6014+ name = "gracemont";
6015+ break;
6016+
59786017 case INTEL_FAM6_WESTMERE:
59796018 case INTEL_FAM6_WESTMERE_EP:
59806019 case INTEL_FAM6_WESTMERE_EX:
@@ -6317,7 +6356,6 @@ __init int intel_pmu_init(void) · 336 unmodified lines
63176356
63186357 case INTEL_FAM6_ALDERLAKE:
63196358 case INTEL_FAM6_ALDERLAKE_L:
6320− case INTEL_FAM6_ALDERLAKE_N:
63216359 case INTEL_FAM6_RAPTORLAKE:
63226360 case INTEL_FAM6_RAPTORLAKE_P:
63236361 /*
arch/x86/events/intel/ds.c+7−2
@@ -110,13 +110,18 @@ void __init intel_pmu_pebs_data_source_skl(bool pmem) · 109 unmodified lines
110110 __intel_pmu_pebs_data_source_skl(pmem, pebs_data_source);
111111 }
112112
113−static void __init intel_pmu_pebs_data_source_grt(u64 *data_source)
113+static void __init __intel_pmu_pebs_data_source_grt(u64 *data_source)
114114 {
115115 data_source[0x05] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HIT);
116116 data_source[0x06] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HITM);
117117 data_source[0x08] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOPX, FWD);
118118 }
119119
120+void __init intel_pmu_pebs_data_source_grt(void)
121+{
122+ __intel_pmu_pebs_data_source_grt(pebs_data_source);
123+}
124+
120125 void __init intel_pmu_pebs_data_source_adl(void)
121126 {
122127 u64 *data_source;
@@ -127,7 +132,7 @@ void __init intel_pmu_pebs_data_source_adl(void) · 4 unmodified lines
127132
128133 data_source = x86_pmu.hybrid_pmu[X86_HYBRID_PMU_ATOM_IDX].pebs_data_source;
129134 memcpy(data_source, pebs_data_source, sizeof(pebs_data_source));
130− intel_pmu_pebs_data_source_grt(data_source);
135+ __intel_pmu_pebs_data_source_grt(data_source);
131136 }
132137
133138 static u64 precise_store_data(u64 status)
arch/x86/events/perf_event.h+2−0
@@ -1516,6 +1516,8 @@ void intel_pmu_pebs_data_source_skl(bool pmem); · 1515 unmodified lines
15161516
15171517 void intel_pmu_pebs_data_source_adl(void);
15181518
1519+void intel_pmu_pebs_data_source_grt(void);
1520+
15191521 int intel_pmu_setup_lbr_filter(struct perf_event *event);
15201522
15211523 void intel_pt_interrupt(void);
arch/x86/include/asm/acrn.h+14−0
@@ -10,6 +10,15 @@ · 9 unmodified lines
1010 /* Bit 0 indicates whether guest VM is privileged */
1111 #define ACRN_FEATURE_PRIVILEGED_VM BIT(0)
1212
13+/*
14+ * Timing Information.
15+ * This leaf returns the current TSC frequency in kHz.
16+ *
17+ * EAX: (Virtual) TSC frequency in kHz.
18+ * EBX, ECX, EDX: RESERVED (reserved fields are set to zero).
19+ */
20+#define ACRN_CPUID_TIMING_INFO 0x40000010
21+
1322 void acrn_setup_intr_handler(void (*handler)(void));
1423 void acrn_remove_intr_handler(void);
1524
@@ -21,6 +30,11 @@ static inline u32 acrn_cpuid_base(void) · 5 unmodified lines
2130 return 0;
2231 }
2332
33+static inline unsigned long acrn_get_tsc_khz(void)
34+{
35+ return cpuid_eax(ACRN_CPUID_TIMING_INFO);
36+}
37+
2438 /*
2539 * Hypercalls for ACRN
2640 *
arch/x86/include/asm/bitops.h+33−21
@@ -247,17 +247,30 @@ arch_test_bit_acquire(unsigned long nr, const volatile unsigned long *addr) · 246 unmodified lines
247247 variable_test_bit(nr, addr);
248248 }
249249
250+static __always_inline unsigned long variable__ffs(unsigned long word)
251+{
252+ asm("rep; bsf %1,%0"
253+ : "=r" (word)
254+ : "rm" (word));
255+ return word;
256+}
257+
250258 /**
251259 * __ffs - find first set bit in word
252260 * @word: The word to search
253261 *
254262 * Undefined if no bit exists, so code should check against 0 first.
255263 */
256−static __always_inline unsigned long __ffs(unsigned long word)
264+#define __ffs(word) \
265+ (__builtin_constant_p(word) ? \
266+ (unsigned long)__builtin_ctzl(word) : \
267+ variable__ffs(word))
268+
269+static __always_inline unsigned long variable_ffz(unsigned long word)
257270 {
258271 asm("rep; bsf %1,%0"
259272 : "=r" (word)
260− : "rm" (word));
273+ : "r" (~word));
261274 return word;
262275 }
263276
@@ -267,13 +280,10 @@ static __always_inline unsigned long __ffs(unsigned long word) · 3 unmodified lines
267280 *
268281 * Undefined if no zero exists, so code should check against ~0UL first.
269282 */
270−static __always_inline unsigned long ffz(unsigned long word)
271−{
272− asm("rep; bsf %1,%0"
273− : "=r" (word)
274− : "r" (~word));
275− return word;
276−}
283+#define ffz(word) \
284+ (__builtin_constant_p(word) ? \
285+ (unsigned long)__builtin_ctzl(~word) : \
286+ variable_ffz(word))
277287
278288 /*
279289 * __fls: find last set bit in word
@@ -292,18 +302,7 @@ static __always_inline unsigned long __fls(unsigned long word) · 12 unmodified lines
292302 #undef ADDR
293303
294304 #ifdef __KERNEL__
295−/**
296− * ffs - find first set bit in word
297− * @x: the word to search
298− *
299− * This is defined the same way as the libc and compiler builtin ffs
300− * routines, therefore differs in spirit from the other bitops.
301− *
302− * ffs(value) returns 0 if value is 0 or the position of the first
303− * set bit if value is nonzero. The first (least significant) bit
304− * is at position 1.
305− */
306−static __always_inline int ffs(int x)
305+static __always_inline int variable_ffs(int x)
307306 {
308307 int r;
309308
@@ -333,6 +332,19 @@ static __always_inline int ffs(int x) · 23 unmodified lines
333332 return r + 1;
334333 }
335334
335+/**
336+ * ffs - find first set bit in word
337+ * @x: the word to search
338+ *
339+ * This is defined the same way as the libc and compiler builtin ffs
340+ * routines, therefore differs in spirit from the other bitops.
341+ *
342+ * ffs(value) returns 0 if value is 0 or the position of the first
343+ * set bit if value is nonzero. The first (least significant) bit
344+ * is at position 1.
345+ */
346+#define ffs(x) (__builtin_constant_p(x) ? __builtin_ffs(x) : variable_ffs(x))
347+
336348 /**
337349 * fls - find last set bit in word
338350 * @x: the word to search
arch/x86/include/asm/cfi.h+22−0
@@ -0,0 +1,22 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_X86_CFI_H
3+#define _ASM_X86_CFI_H
4+
5+/*
6+ * Clang Control Flow Integrity (CFI) support.
7+ *
8+ * Copyright (C) 2022 Google LLC
9+ */
10+
11+#include <linux/cfi.h>
12+
13+#ifdef CONFIG_CFI_CLANG
14+enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
15+#else
16+static inline enum bug_trap_type handle_cfi_failure(struct pt_regs *regs)
17+{
18+ return BUG_TRAP_TYPE_NONE;
19+}
20+#endif /* CONFIG_CFI_CLANG */
21+
22+#endif /* _ASM_X86_CFI_H */
arch/x86/include/asm/cpu.h+2−0
@@ -94,4 +94,6 @@ static inline bool intel_cpu_signatures_match(unsigned int s1, unsigned int p1, · 93 unmodified lines
9494 return p1 & p2;
9595 }
9696
97+extern u64 x86_read_arch_cap_msr(void);
98+
9799 #endif /* _ASM_X86_CPU_H */
arch/x86/include/asm/linkage.h+12−0
@@ -43,6 +43,18 @@ · 42 unmodified lines
4343
4444 #endif /* __ASSEMBLY__ */
4545
46+#define __CFI_TYPE(name) \
47+ SYM_START(__cfi_##name, SYM_L_LOCAL, SYM_A_NONE) \
48+ .fill 11, 1, 0x90 ASM_NL \
49+ .byte 0xb8 ASM_NL \
50+ .long __kcfi_typeid_##name ASM_NL \
51+ SYM_FUNC_END(__cfi_##name)
52+
53+/* SYM_TYPED_FUNC_START -- use for indirectly called globals, w/ CFI type */
54+#define SYM_TYPED_FUNC_START(name) \
55+ SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
56+ ENDBR
57+
4658 /* SYM_FUNC_START -- use for global functions */
4759 #define SYM_FUNC_START(name) \
4860 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
arch/x86/include/asm/mc146818rtc.h+1−1
@@ -95,7 +95,7 @@ static inline unsigned char current_lock_cmos_reg(void) · 94 unmodified lines
9595 unsigned char rtc_cmos_read(unsigned char addr);
9696 void rtc_cmos_write(unsigned char val, unsigned char addr);
9797
98−extern int mach_set_rtc_mmss(const struct timespec64 *now);
98+extern int mach_set_cmos_time(const struct timespec64 *now);
9999 extern void mach_get_cmos_time(struct timespec64 *now);
100100
101101 #define RTC_IRQ 8
arch/x86/include/asm/mce.h+1−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #define MCI_STATUS_CEC_SHIFT 38 /* Corrected Error Count */
4343 #define MCI_STATUS_CEC_MASK GENMASK_ULL(52,38)
4444 #define MCI_STATUS_CEC(c) (((c) & MCI_STATUS_CEC_MASK) >> MCI_STATUS_CEC_SHIFT)
45+#define MCI_STATUS_MSCOD(m) (((m) >> 16) & 0xffff)
4546
4647 /* AMD-specific bits */
4748 #define MCI_STATUS_TCC BIT_ULL(55) /* Task context corrupt */
arch/x86/include/asm/microcode.h+1−3
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 struct ucode_patch {
1010 struct list_head plist;
1111 void *data; /* Intel uses only this one */
12+ unsigned int size;
1213 u32 patch_id;
1314 u16 equiv_cpu;
1415 };
@@ -32,9 +33,6 @@ enum ucode_state { · 17 unmodified lines
3233 };
3334
3435 struct microcode_ops {
35− enum ucode_state (*request_microcode_user) (int cpu,
36− const void __user *buf, size_t size);
37−
3836 enum ucode_state (*request_microcode_fw) (int cpu, struct device *,
3937 bool refresh_fw);
4038
arch/x86/include/asm/msr-index.h+13−0
@@ -155,6 +155,11 @@ · 154 unmodified lines
155155 * Return Stack Buffer Predictions.
156156 */
157157
158+#define ARCH_CAP_XAPIC_DISABLE BIT(21) /*
159+ * IA32_XAPIC_DISABLE_STATUS MSR
160+ * supported
161+ */
162+
158163 #define MSR_IA32_FLUSH_CMD 0x0000010b
159164 #define L1D_FLUSH BIT(0) /*
160165 * Writeback and invalidate the
@@ -1054,4 +1059,12 @@ · 893 unmodified lines
10541059 #define MSR_IA32_HW_FEEDBACK_PTR 0x17d0
10551060 #define MSR_IA32_HW_FEEDBACK_CONFIG 0x17d1
10561061
1062+/* x2APIC locked status */
1063+#define MSR_IA32_XAPIC_DISABLE_STATUS 0xBD
1064+#define LEGACY_XAPIC_DISABLED BIT(0) /*
1065+ * x2APIC mode is locked and
1066+ * disabling x2APIC will cause
1067+ * a #GP
1068+ */
1069+
10571070 #endif /* _ASM_X86_MSR_INDEX_H */
arch/x86/include/asm/paravirt.h+1−0
@@ -743,6 +743,7 @@ extern void default_banner(void); · 742 unmodified lines
743743 word 771b; \
744744 .byte ptype; \
745745 .byte 772b-771b; \
746+ _ASM_ALIGN; \
746747 .popsection
747748
748749
arch/x86/include/asm/paravirt_types.h+19−9
@@ -294,6 +294,7 @@ extern struct paravirt_patch_template pv_ops; · 293 unmodified lines
294294 " .byte " type "\n" \
295295 " .byte 772b-771b\n" \
296296 " .short " clobber "\n" \
297+ _ASM_ALIGN "\n" \
297298 ".popsection\n"
298299
299300 /* Generate patchable code, with the default asm parameters. */
@@ -328,7 +329,7 @@ int paravirt_disable_iospace(void); · 28 unmodified lines
328329 * Unfortunately, this is a relatively slow operation for modern CPUs,
329330 * because it cannot necessarily determine what the destination
330331 * address is. In this case, the address is a runtime constant, so at
331− * the very least we can patch the call to e a simple direct call, or
332+ * the very least we can patch the call to a simple direct call, or,
332333 * ideally, patch an inline implementation into the callsite. (Direct
333334 * calls are essentially free, because the call and return addresses
334335 * are completely predictable.)
@@ -339,10 +340,10 @@ int paravirt_disable_iospace(void); · 4 unmodified lines
339340 * on the stack. All caller-save registers (eax,edx,ecx) are expected
340341 * to be modified (either clobbered or used for return values).
341342 * X86_64, on the other hand, already specifies a register-based calling
342− * conventions, returning at %rax, with parameters going on %rdi, %rsi,
343+ * conventions, returning at %rax, with parameters going in %rdi, %rsi,
343344 * %rdx, and %rcx. Note that for this reason, x86_64 does not need any
344345 * special handling for dealing with 4 arguments, unlike i386.
345− * However, x86_64 also have to clobber all caller saved registers, which
346+ * However, x86_64 also has to clobber all caller saved registers, which
346347 * unfortunately, are quite a bit (r8 - r11)
347348 *
348349 * The call instruction itself is marked by placing its start address
@@ -360,22 +361,22 @@ int paravirt_disable_iospace(void); · 11 unmodified lines
360361 * There are 5 sets of PVOP_* macros for dealing with 0-4 arguments.
361362 * It could be extended to more arguments, but there would be little
362363 * to be gained from that. For each number of arguments, there are
363− * the two VCALL and CALL variants for void and non-void functions.
364+ * two VCALL and CALL variants for void and non-void functions.
364365 *
365366 * When there is a return value, the invoker of the macro must specify
366367 * the return type. The macro then uses sizeof() on that type to
367− * determine whether its a 32 or 64 bit value, and places the return
368+ * determine whether it's a 32 or 64 bit value and places the return
368369 * in the right register(s) (just %eax for 32-bit, and %edx:%eax for
369− * 64-bit). For x86_64 machines, it just returns at %rax regardless of
370+ * 64-bit). For x86_64 machines, it just returns in %rax regardless of
370371 * the return value size.
371372 *
372− * 64-bit arguments are passed as a pair of adjacent 32-bit arguments
373+ * 64-bit arguments are passed as a pair of adjacent 32-bit arguments;
373374 * i386 also passes 64-bit arguments as a pair of adjacent 32-bit arguments
374375 * in low,high order
375376 *
376377 * Small structures are passed and returned in registers. The macro
377378 * calling convention can't directly deal with this, so the wrapper
378− * functions must do this.
379+ * functions must do it.
379380 *
380381 * These PVOP_* macros are only defined within this header. This
381382 * means that all uses must be wrapped in inline functions. This also
@@ -414,8 +415,17 @@ int paravirt_disable_iospace(void); · 32 unmodified lines
414415 "=c" (__ecx)
415416 #define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax)
416417
417−/* void functions are still allowed [re]ax for scratch */
418+/*
419+ * void functions are still allowed [re]ax for scratch.
420+ *
421+ * The ZERO_CALL_USED REGS feature may end up zeroing out callee-saved
422+ * registers. Make sure we model this with the appropriate clobbers.
423+ */
424+#ifdef CONFIG_ZERO_CALL_USED_REGS
425+#define PVOP_VCALLEE_CLOBBERS "=a" (__eax), PVOP_VCALL_CLOBBERS
426+#else
418427 #define PVOP_VCALLEE_CLOBBERS "=a" (__eax)
428+#endif
419429 #define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS
420430
421431 #define EXTRA_CLOBBERS , "r8", "r9", "r10", "r11"
arch/x86/include/asm/resctrl.h+9−0
@@ -81,6 +81,15 @@ static void __resctrl_sched_in(void) · 80 unmodified lines
8181 }
8282 }
8383
84+static inline unsigned int resctrl_arch_round_mon_val(unsigned int val)
85+{
86+ unsigned int scale = boot_cpu_data.x86_cache_occ_scale;
87+
88+ /* h/w works in units of "boot_cpu_data.x86_cache_occ_scale" */
89+ val /= scale;
90+ return val * scale;
91+}
92+
8493 static inline void resctrl_sched_in(void)
8594 {
8695 if (static_branch_likely(&rdt_enable_key))
arch/x86/include/asm/smp.h+15−10
@@ -21,16 +21,6 @@ DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_llc_id); · 20 unmodified lines
2121 DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_l2c_id);
2222 DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
2323
24−static inline struct cpumask *cpu_llc_shared_mask(int cpu)
25−{
26− return per_cpu(cpu_llc_shared_map, cpu);
27−}
28−
29−static inline struct cpumask *cpu_l2c_shared_mask(int cpu)
30−{
31− return per_cpu(cpu_l2c_shared_map, cpu);
32−}
33−
3424 DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_cpu_to_apicid);
3525 DECLARE_EARLY_PER_CPU_READ_MOSTLY(u32, x86_cpu_to_acpiid);
3626 DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid);
@@ -172,6 +162,16 @@ extern int safe_smp_processor_id(void); · 135 unmodified lines
172162 # define safe_smp_processor_id() smp_processor_id()
173163 #endif
174164
165+static inline struct cpumask *cpu_llc_shared_mask(int cpu)
166+{
167+ return per_cpu(cpu_llc_shared_map, cpu);
168+}
169+
170+static inline struct cpumask *cpu_l2c_shared_mask(int cpu)
171+{
172+ return per_cpu(cpu_l2c_shared_map, cpu);
173+}
174+
175175 #else /* !CONFIG_SMP */
176176 #define wbinvd_on_cpu(cpu) wbinvd()
177177 static inline int wbinvd_on_all_cpus(void)
@@ -179,6 +179,11 @@ static inline int wbinvd_on_all_cpus(void) · 1 unmodified line
179179 wbinvd();
180180 return 0;
181181 }
182+
183+static inline struct cpumask *cpu_llc_shared_mask(int cpu)
184+{
185+ return (struct cpumask *)cpumask_of(0);
186+}
182187 #endif /* CONFIG_SMP */
183188
184189 extern unsigned disabled_cpus;
arch/x86/include/asm/uaccess.h+8−8
@@ -448,7 +448,7 @@ do { \ · 447 unmodified lines
448448
449449 #ifdef CONFIG_X86_32
450450 /*
451− * Unlike the normal CMPXCHG, hardcode ECX for both success/fail and error.
451+ * Unlike the normal CMPXCHG, use output GPR for both success/fail and error.
452452 * There are only six GPRs available and four (EAX, EBX, ECX, and EDX) are
453453 * hardcoded by CMPXCHG8B, leaving only ESI and EDI. If the compiler uses
454454 * both ESI and EDI for the memory operand, compilation will fail if the error
@@ -461,11 +461,12 @@ do { \ · 6 unmodified lines
461461 __typeof__(*(_ptr)) __new = (_new); \
462462 asm volatile("\n" \
463463 "1: " LOCK_PREFIX "cmpxchg8b %[ptr]\n" \
464− "mov $0, %%ecx\n\t" \
465− "setz %%cl\n" \
464+ "mov $0, %[result]\n\t" \
465+ "setz %b[result]\n" \
466466 "2:\n" \
467− _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %%ecx) \
468− : [result]"=c" (__result), \
467+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, \
468+ %[result]) \
469+ : [result] "=q" (__result), \
469470 "+A" (__old), \
470471 [ptr] "+m" (*_ptr) \
471472 : "b" ((u32)__new), \
@@ -502,9 +503,6 @@ strncpy_from_user(char *dst, const char __user *src, long count); · 30 unmodified lines
502503
503504 extern __must_check long strnlen_user(const char __user *str, long n);
504505
505−unsigned long __must_check clear_user(void __user *mem, unsigned long len);
506−unsigned long __must_check __clear_user(void __user *mem, unsigned long len);
507−
508506 #ifdef CONFIG_ARCH_HAS_COPY_MC
509507 unsigned long __must_check
510508 copy_mc_to_kernel(void *to, const void *from, unsigned len);
@@ -526,6 +524,8 @@ extern struct movsl_mask { · 15 unmodified lines
526524 #define ARCH_HAS_NOCACHE_UACCESS 1
527525
528526 #ifdef CONFIG_X86_32
527+unsigned long __must_check clear_user(void __user *mem, unsigned long len);
528+unsigned long __must_check __clear_user(void __user *mem, unsigned long len);
529529 # include <asm/uaccess_32.h>
530530 #else
531531 # include <asm/uaccess_64.h>
arch/x86/include/asm/uaccess_64.h+45−0
@@ -79,4 +79,49 @@ __copy_from_user_flushcache(void *dst, const void __user *src, unsigned size) · 78 unmodified lines
7979 kasan_check_write(dst, size);
8080 return __copy_user_flushcache(dst, src, size);
8181 }
82+
83+/*
84+ * Zero Userspace.
85+ */
86+
87+__must_check unsigned long
88+clear_user_original(void __user *addr, unsigned long len);
89+__must_check unsigned long
90+clear_user_rep_good(void __user *addr, unsigned long len);
91+__must_check unsigned long
92+clear_user_erms(void __user *addr, unsigned long len);
93+
94+static __always_inline __must_check unsigned long __clear_user(void __user *addr, unsigned long size)
95+{
96+ might_fault();
97+ stac();
98+
99+ /*
100+ * No memory constraint because it doesn't change any memory gcc
101+ * knows about.
102+ */
103+ asm volatile(
104+ "1:\n\t"
105+ ALTERNATIVE_3("rep stosb",
106+ "call clear_user_erms", ALT_NOT(X86_FEATURE_FSRM),
107+ "call clear_user_rep_good", ALT_NOT(X86_FEATURE_ERMS),
108+ "call clear_user_original", ALT_NOT(X86_FEATURE_REP_GOOD))
109+ "2:\n"
110+ _ASM_EXTABLE_UA(1b, 2b)
111+ : "+c" (size), "+D" (addr), ASM_CALL_CONSTRAINT
112+ : "a" (0)
113+ /* rep_good clobbers %rdx */
114+ : "rdx");
115+
116+ clac();
117+
118+ return size;
119+}
120+
121+static __always_inline unsigned long clear_user(void __user *to, unsigned long n)
122+{
123+ if (access_ok(to, n))
124+ return __clear_user(to, n);
125+ return n;
126+}
82127 #endif /* _ASM_X86_UACCESS_64_H */
arch/x86/kernel/Makefile+2−0
@@ -139,6 +139,8 @@ obj-$(CONFIG_UNWINDER_GUESS) += unwind_guess.o · 138 unmodified lines
139139
140140 obj-$(CONFIG_AMD_MEM_ENCRYPT) += sev.o
141141
142+obj-$(CONFIG_CFI_CLANG) += cfi.o
143+
142144 ###
143145 # 64 bit specific files
144146 ifeq ($(CONFIG_X86_64),y)
arch/x86/kernel/alternative.c+32−22
@@ -453,6 +453,15 @@ static int patch_retpoline(void *addr, struct insn *insn, u8 *bytes) · 452 unmodified lines
453453 return ret;
454454 i += ret;
455455
456+ /*
457+ * The compiler is supposed to EMIT an INT3 after every unconditional
458+ * JMP instruction due to AMD BTC. However, if the compiler is too old
459+ * or SLS isn't enabled, we still need an INT3 after indirect JMPs
460+ * even on Intel.
461+ */
462+ if (op == JMP32_INSN_OPCODE && i < insn->length)
463+ bytes[i++] = INT3_INSN_OPCODE;
464+
456465 for (; i < insn->length;)
457466 bytes[i++] = BYTES_NOP1;
458467
@@ -1319,22 +1328,23 @@ struct bp_patching_desc { · 860 unmodified lines
13191328 atomic_t refs;
13201329 };
13211330
1322−static struct bp_patching_desc *bp_desc;
1331+static struct bp_patching_desc bp_desc;
13231332
13241333 static __always_inline
1325−struct bp_patching_desc *try_get_desc(struct bp_patching_desc **descp)
1334+struct bp_patching_desc *try_get_desc(void)
13261335 {
1327− /* rcu_dereference */
1328− struct bp_patching_desc *desc = __READ_ONCE(*descp);
1336+ struct bp_patching_desc *desc = &bp_desc;
13291337
1330− if (!desc || !arch_atomic_inc_not_zero(&desc->refs))
1338+ if (!arch_atomic_inc_not_zero(&desc->refs))
13311339 return NULL;
13321340
13331341 return desc;
13341342 }
13351343
1336−static __always_inline void put_desc(struct bp_patching_desc *desc)
1344+static __always_inline void put_desc(void)
13371345 {
1346+ struct bp_patching_desc *desc = &bp_desc;
1347+
13381348 smp_mb__before_atomic();
13391349 arch_atomic_dec(&desc->refs);
13401350 }
@@ -1367,15 +1377,15 @@ noinstr int poke_int3_handler(struct pt_regs *regs) · 26 unmodified lines
13671377
13681378 /*
13691379 * Having observed our INT3 instruction, we now must observe
1370− * bp_desc:
1380+ * bp_desc with non-zero refcount:
13711381 *
1372− * bp_desc = desc INT3
1382+ * bp_desc.refs = 1 INT3
13731383 * WMB RMB
1374− * write INT3 if (desc)
1384+ * write INT3 if (bp_desc.refs != 0)
13751385 */
13761386 smp_rmb();
13771387
1378− desc = try_get_desc(&bp_desc);
1388+ desc = try_get_desc();
13791389 if (!desc)
13801390 return 0;
13811391
@@ -1429,7 +1439,7 @@ noinstr int poke_int3_handler(struct pt_regs *regs) · 47 unmodified lines
14291439 ret = 1;
14301440
14311441 out_put:
1432− put_desc(desc);
1442+ put_desc();
14331443 return ret;
14341444 }
14351445
@@ -1460,18 +1470,20 @@ static int tp_vec_nr; · 24 unmodified lines
14601470 */
14611471 static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries)
14621472 {
1463− struct bp_patching_desc desc = {
1464− .vec = tp,
1465− .nr_entries = nr_entries,
1466− .refs = ATOMIC_INIT(1),
1467− };
14681473 unsigned char int3 = INT3_INSN_OPCODE;
14691474 unsigned int i;
14701475 int do_sync;
14711476
14721477 lockdep_assert_held(&text_mutex);
14731478
1474− smp_store_release(&bp_desc, &desc); /* rcu_assign_pointer */
1479+ bp_desc.vec = tp;
1480+ bp_desc.nr_entries = nr_entries;
1481+
1482+ /*
1483+ * Corresponds to the implicit memory barrier in try_get_desc() to
1484+ * ensure reading a non-zero refcount provides up to date bp_desc data.
1485+ */
1486+ atomic_set_release(&bp_desc.refs, 1);
14751487
14761488 /*
14771489 * Corresponding read barrier in int3 notifier for making sure the
@@ -1559,12 +1571,10 @@ static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries · 81 unmodified lines
15591571 text_poke_sync();
15601572
15611573 /*
1562− * Remove and synchronize_rcu(), except we have a very primitive
1563− * refcount based completion.
1574+ * Remove and wait for refs to be zero.
15641575 */
1565− WRITE_ONCE(bp_desc, NULL); /* RCU_INIT_POINTER */
1566− if (!atomic_dec_and_test(&desc.refs))
1567− atomic_cond_read_acquire(&desc.refs, !VAL);
1576+ if (!atomic_dec_and_test(&bp_desc.refs))
1577+ atomic_cond_read_acquire(&bp_desc.refs, !VAL);
15681578 }
15691579
15701580 static void text_poke_loc_init(struct text_poke_loc *tp, void *addr,
arch/x86/kernel/amd_gart_64.c+1−1
@@ -53,7 +53,7 @@ static u32 *iommu_gatt_base; /* Remapping table */ · 52 unmodified lines
5353 * of only flushing when an mapping is reused. With it true the GART is
5454 * flushed for every mapping. Problem is that doing the lazy flush seems
5555 * to trigger bugs with some popular PCI cards, in particular 3ware (but
56− * has been also also seen with Qlogic at least).
56+ * has been also seen with Qlogic at least).
5757 */
5858 static int iommu_fullflush = 1;
5959
arch/x86/kernel/aperture_64.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 /*
3737 * Using 512M as goal, in case kexec will load kernel_big
3838 * that will do the on-position decompress, and could overlap with
39− * with the gart aperture that is used.
39+ * the gart aperture that is used.
4040 * Sequence:
4141 * kernel_small
4242 * ==> kexec (with kdump trigger path or gart still enabled)
arch/x86/kernel/apic/apic.c+40−4
@@ -61,6 +61,7 @@ · 60 unmodified lines
6161 #include <asm/cpu_device_id.h>
6262 #include <asm/intel-family.h>
6363 #include <asm/irq_regs.h>
64+#include <asm/cpu.h>
6465
6566 unsigned int num_processors;
6667
@@ -1751,11 +1752,26 @@ EXPORT_SYMBOL_GPL(x2apic_mode); · 1684 unmodified lines
17511752
17521753 enum {
17531754 X2APIC_OFF,
1754− X2APIC_ON,
17551755 X2APIC_DISABLED,
1756+ /* All states below here have X2APIC enabled */
1757+ X2APIC_ON,
1758+ X2APIC_ON_LOCKED
17561759 };
17571760 static int x2apic_state;
17581761
1762+static bool x2apic_hw_locked(void)
1763+{
1764+ u64 ia32_cap;
1765+ u64 msr;
1766+
1767+ ia32_cap = x86_read_arch_cap_msr();
1768+ if (ia32_cap & ARCH_CAP_XAPIC_DISABLE) {
1769+ rdmsrl(MSR_IA32_XAPIC_DISABLE_STATUS, msr);
1770+ return (msr & LEGACY_XAPIC_DISABLED);
1771+ }
1772+ return false;
1773+}
1774+
17591775 static void __x2apic_disable(void)
17601776 {
17611777 u64 msr;
@@ -1793,6 +1809,10 @@ static int __init setup_nox2apic(char *str) · 31 unmodified lines
17931809 apicid);
17941810 return 0;
17951811 }
1812+ if (x2apic_hw_locked()) {
1813+ pr_warn("APIC locked in x2apic mode, can't disable\n");
1814+ return 0;
1815+ }
17961816 pr_warn("x2apic already enabled.\n");
17971817 __x2apic_disable();
17981818 }
@@ -1807,10 +1827,18 @@ early_param("nox2apic", setup_nox2apic); · 8 unmodified lines
18071827 void x2apic_setup(void)
18081828 {
18091829 /*
1810− * If x2apic is not in ON state, disable it if already enabled
1830+ * Try to make the AP's APIC state match that of the BSP, but if the
1831+ * BSP is unlocked and the AP is locked then there is a state mismatch.
1832+ * Warn about the mismatch in case a GP fault occurs due to a locked AP
1833+ * trying to be turned off.
1834+ */
1835+ if (x2apic_state != X2APIC_ON_LOCKED && x2apic_hw_locked())
1836+ pr_warn("x2apic lock mismatch between BSP and AP.\n");
1837+ /*
1838+ * If x2apic is not in ON or LOCKED state, disable it if already enabled
18111839 * from BIOS.
18121840 */
1813− if (x2apic_state != X2APIC_ON) {
1841+ if (x2apic_state < X2APIC_ON) {
18141842 __x2apic_disable();
18151843 return;
18161844 }
@@ -1831,6 +1859,11 @@ static __init void x2apic_disable(void) · 14 unmodified lines
18311859 if (x2apic_id >= 255)
18321860 panic("Cannot disable x2apic, id: %08x\n", x2apic_id);
18331861
1862+ if (x2apic_hw_locked()) {
1863+ pr_warn("Cannot disable locked x2apic, id: %08x\n", x2apic_id);
1864+ return;
1865+ }
1866+
18341867 __x2apic_disable();
18351868 register_lapic_address(mp_lapic_addr);
18361869 }
@@ -1889,7 +1922,10 @@ void __init check_x2apic(void) · 52 unmodified lines
18891922 if (x2apic_enabled()) {
18901923 pr_info("x2apic: enabled by BIOS, switching to x2apic ops\n");
18911924 x2apic_mode = 1;
1892− x2apic_state = X2APIC_ON;
1925+ if (x2apic_hw_locked())
1926+ x2apic_state = X2APIC_ON_LOCKED;
1927+ else
1928+ x2apic_state = X2APIC_ON;
18931929 } else if (!boot_cpu_has(X86_FEATURE_X2APIC)) {
18941930 x2apic_state = X2APIC_DISABLED;
18951931 }
arch/x86/kernel/cfi.c+86−0
@@ -0,0 +1,86 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Clang Control Flow Integrity (CFI) support.
4+ *
5+ * Copyright (C) 2022 Google LLC
6+ */
7+#include <asm/cfi.h>
8+#include <asm/insn.h>
9+#include <asm/insn-eval.h>
10+#include <linux/string.h>
11+
12+/*
13+ * Returns the target address and the expected type when regs->ip points
14+ * to a compiler-generated CFI trap.
15+ */
16+static bool decode_cfi_insn(struct pt_regs *regs, unsigned long *target,
17+ u32 *type)
18+{
19+ char buffer[MAX_INSN_SIZE];
20+ struct insn insn;
21+ int offset = 0;
22+
23+ *target = *type = 0;
24+
25+ /*
26+ * The compiler generates the following instruction sequence
27+ * for indirect call checks:
28+ *
29+ *   movl -<id>, %r10d ; 6 bytes
30+ * addl -4(%reg), %r10d ; 4 bytes
31+ * je .Ltmp1 ; 2 bytes
32+ * ud2 ; <- regs->ip
33+ * .Ltmp1:
34+ *
35+ * We can decode the expected type and the target address from the
36+ * movl/addl instructions.
37+ */
38+ if (copy_from_kernel_nofault(buffer, (void *)regs->ip - 12, MAX_INSN_SIZE))
39+ return false;
40+ if (insn_decode_kernel(&insn, &buffer[offset]))
41+ return false;
42+ if (insn.opcode.value != 0xBA)
43+ return false;
44+
45+ *type = -(u32)insn.immediate.value;
46+
47+ if (copy_from_kernel_nofault(buffer, (void *)regs->ip - 6, MAX_INSN_SIZE))
48+ return false;
49+ if (insn_decode_kernel(&insn, &buffer[offset]))
50+ return false;
51+ if (insn.opcode.value != 0x3)
52+ return false;
53+
54+ /* Read the target address from the register. */
55+ offset = insn_get_modrm_rm_off(&insn, regs);
56+ if (offset < 0)
57+ return false;
58+
59+ *target = *(unsigned long *)((void *)regs + offset);
60+
61+ return true;
62+}
63+
64+/*
65+ * Checks if a ud2 trap is because of a CFI failure, and handles the trap
66+ * if needed. Returns a bug_trap_type value similarly to report_bug.
67+ */
68+enum bug_trap_type handle_cfi_failure(struct pt_regs *regs)
69+{
70+ unsigned long target;
71+ u32 type;
72+
73+ if (!is_cfi_trap(regs->ip))
74+ return BUG_TRAP_TYPE_NONE;
75+
76+ if (!decode_cfi_insn(regs, &target, &type))
77+ return report_cfi_failure_noaddr(regs, regs->ip);
78+
79+ return report_cfi_failure(regs, regs->ip, &target, type);
80+}
81+
82+/*
83+ * Ensure that __kcfi_typeid_ symbols are emitted for functions that may
84+ * not be indirectly called with all configurations.
85+ */
86+__ADDRESSABLE(__memcpy)
arch/x86/kernel/cpu/acrn.c+3−0
@@ -28,6 +28,9 @@ static void __init acrn_init_platform(void) · 27 unmodified lines
2828 {
2929 /* Setup the IDT for ACRN hypervisor callback */
3030 alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_acrn_hv_callback);
31+
32+ x86_platform.calibrate_tsc = acrn_get_tsc_khz;
33+ x86_platform.calibrate_cpu = acrn_get_tsc_khz;
3134 }
3235
3336 static bool acrn_x2apic_available(void)
arch/x86/kernel/cpu/feat_ctl.c+1−1
@@ -1,11 +1,11 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/tboot.h>
33
4+#include <asm/cpu.h>
45 #include <asm/cpufeature.h>
56 #include <asm/msr-index.h>
67 #include <asm/processor.h>
78 #include <asm/vmx.h>
8−#include "cpu.h"
99
1010 #undef pr_fmt
1111 #define pr_fmt(fmt) "x86/cpu: " fmt
arch/x86/kernel/cpu/mce/apei.c+12−1
@@ -29,15 +29,26 @@ · 28 unmodified lines
2929 void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err)
3030 {
3131 struct mce m;
32+ int lsb;
3233
3334 if (!(mem_err->validation_bits & CPER_MEM_VALID_PA))
3435 return;
3536
37+ /*
38+ * Even if the ->validation_bits are set for address mask,
39+ * to be extra safe, check and reject an error radius '0',
40+ * and fall back to the default page size.
41+ */
42+ if (mem_err->validation_bits & CPER_MEM_VALID_PA_MASK)
43+ lsb = find_first_bit((void *)&mem_err->physical_addr_mask, PAGE_SHIFT);
44+ else
45+ lsb = PAGE_SHIFT;
46+
3647 mce_setup(&m);
3748 m.bank = -1;
3849 /* Fake a memory read error with unknown channel */
3950 m.status = MCI_STATUS_VAL | MCI_STATUS_EN | MCI_STATUS_ADDRV | MCI_STATUS_MISCV | 0x9f;
40− m.misc = (MCI_MISC_ADDR_PHYS << 6) | PAGE_SHIFT;
51+ m.misc = (MCI_MISC_ADDR_PHYS << 6) | lsb;
4152
4253 if (severity >= GHES_SEV_RECOVERABLE)
4354 m.status |= MCI_STATUS_UC;
arch/x86/kernel/cpu/microcode/amd.c+2−8
@@ -788,6 +788,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover, · 787 unmodified lines
788788 kfree(patch);
789789 return -EINVAL;
790790 }
791+ patch->size = *patch_size;
791792
792793 mc_hdr = (struct microcode_header_amd *)(fw + SECTION_HDR_SIZE);
793794 proc_id = mc_hdr->processor_rev_id;
@@ -869,7 +870,7 @@ load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) · 75 unmodified lines
869870 return ret;
870871
871872 memset(amd_ucode_patch, 0, PATCH_MAX_SIZE);
872− memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data), PATCH_MAX_SIZE));
873+ memcpy(amd_ucode_patch, p->data, min_t(u32, p->size, PATCH_MAX_SIZE));
873874
874875 return ret;
875876 }
@@ -924,12 +925,6 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, · 48 unmodified lines
924925 return ret;
925926 }
926927
927−static enum ucode_state
928−request_microcode_user(int cpu, const void __user *buf, size_t size)
929−{
930− return UCODE_ERROR;
931−}
932−
933928 static void microcode_fini_cpu_amd(int cpu)
934929 {
935930 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
@@ -938,7 +933,6 @@ static void microcode_fini_cpu_amd(int cpu) · 2 unmodified lines
938933 }
939934
940935 static struct microcode_ops microcode_amd_ops = {
941− .request_microcode_user = request_microcode_user,
942936 .request_microcode_fw = request_microcode_amd,
943937 .collect_cpu_info = collect_cpu_info_amd,
944938 .apply_microcode = apply_microcode_amd,
arch/x86/kernel/cpu/microcode/core.c+3−2
@@ -491,7 +491,7 @@ wait_for_siblings: · 490 unmodified lines
491491 */
492492 static int microcode_reload_late(void)
493493 {
494− int ret;
494+ int old = boot_cpu_data.microcode, ret;
495495
496496 pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
497497 pr_err("You should switch to early loading, if possible.\n");
@@ -503,7 +503,8 @@ static int microcode_reload_late(void) · 5 unmodified lines
503503 if (ret == 0)
504504 microcode_check();
505505
506− pr_info("Reload completed, microcode revision: 0x%x\n", boot_cpu_data.microcode);
506+ pr_info("Reload completed, microcode revision: 0x%x -> 0x%x\n",
507+ old, boot_cpu_data.microcode);
507508
508509 return ret;
509510 }
arch/x86/kernel/cpu/microcode/intel.c+0−17
@@ -916,24 +916,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device, · 915 unmodified lines
916916 return ret;
917917 }
918918
919−static enum ucode_state
920−request_microcode_user(int cpu, const void __user *buf, size_t size)
921−{
922− struct iov_iter iter;
923− struct iovec iov;
924−
925− if (is_blacklisted(cpu))
926− return UCODE_NFOUND;
927−
928− iov.iov_base = (void __user *)buf;
929− iov.iov_len = size;
930− iov_iter_init(&iter, WRITE, &iov, 1, size);
931−
932− return generic_load_microcode(cpu, &iter);
933−}
934−
935919 static struct microcode_ops microcode_intel_ops = {
936− .request_microcode_user = request_microcode_user,
937920 .request_microcode_fw = request_microcode_fw,
938921 .collect_cpu_info = collect_cpu_info,
939922 .apply_microcode = apply_microcode_intel,
arch/x86/kernel/cpu/resctrl/core.c+38−79
@@ -147,7 +147,6 @@ static inline void cache_alloc_hsw_probe(void) · 146 unmodified lines
147147 r->cache.shareable_bits = 0xc0000;
148148 r->cache.min_cbm_bits = 2;
149149 r->alloc_capable = true;
150− r->alloc_enabled = true;
151150
152151 rdt_alloc_capable = true;
153152 }
@@ -211,7 +210,6 @@ static bool __get_mem_config_intel(struct rdt_resource *r) · 57 unmodified lines
211210 thread_throttle_mode_init();
212211
213212 r->alloc_capable = true;
214− r->alloc_enabled = true;
215213
216214 return true;
217215 }
@@ -242,7 +240,6 @@ static bool __rdt_get_mem_config_amd(struct rdt_resource *r) · 24 unmodified lines
242240 r->data_width = 4;
243241
244242 r->alloc_capable = true;
245− r->alloc_enabled = true;
246243
247244 return true;
248245 }
@@ -261,7 +258,6 @@ static void rdt_get_cache_alloc_cfg(int idx, struct rdt_resource *r) · 12 unmodified lines
261258 r->cache.shareable_bits = ebx & r->default_ctrl;
262259 r->data_width = (r->cache.cbm_len + 3) / 4;
263260 r->alloc_capable = true;
264− r->alloc_enabled = true;
265261 }
266262
267263 static void rdt_get_cdp_config(int level)
@@ -300,7 +296,7 @@ mba_wrmsr_amd(struct rdt_domain *d, struct msr_param *m, struct rdt_resource *r) · 32 unmodified lines
300296 * that can be written to QOS_MSRs.
301297 * There are currently no SKUs which support non linear delay values.
302298 */
303−u32 delay_bw_map(unsigned long bw, struct rdt_resource *r)
299+static u32 delay_bw_map(unsigned long bw, struct rdt_resource *r)
304300 {
305301 if (r->membw.delay_linear)
306302 return MAX_MBA_BW - bw;
@@ -401,7 +397,7 @@ struct rdt_domain *rdt_find_domain(struct rdt_resource *r, int id, · 94 unmodified lines
401397 return NULL;
402398 }
403399
404−void setup_default_ctrlval(struct rdt_resource *r, u32 *dc, u32 *dm)
400+static void setup_default_ctrlval(struct rdt_resource *r, u32 *dc)
405401 {
406402 struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
407403 int i;
@@ -410,12 +406,17 @@ void setup_default_ctrlval(struct rdt_resource *r, u32 *dc, u32 *dm) · 2 unmodified lines
410406 * Initialize the Control MSRs to having no control.
411407 * For Cache Allocation: Set all bits in cbm
412408 * For Memory Allocation: Set b/w requested to 100%
413− * and the bandwidth in MBps to U32_MAX
414409 */
415− for (i = 0; i < hw_res->num_closid; i++, dc++, dm++) {
410+ for (i = 0; i < hw_res->num_closid; i++, dc++)
416411 *dc = r->default_ctrl;
417− *dm = MBA_MAX_MBPS;
418− }
412+}
413+
414+static void domain_free(struct rdt_hw_domain *hw_dom)
415+{
416+ kfree(hw_dom->arch_mbm_total);
417+ kfree(hw_dom->arch_mbm_local);
418+ kfree(hw_dom->ctrl_val);
419+ kfree(hw_dom);
419420 }
420421
421422 static int domain_setup_ctrlval(struct rdt_resource *r, struct rdt_domain *d)
@@ -423,23 +424,15 @@ static int domain_setup_ctrlval(struct rdt_resource *r, struct rdt_domain *d) · 1 unmodified line
423424 struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
424425 struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
425426 struct msr_param m;
426− u32 *dc, *dm;
427+ u32 *dc;
427428
428429 dc = kmalloc_array(hw_res->num_closid, sizeof(*hw_dom->ctrl_val),
429430 GFP_KERNEL);
430431 if (!dc)
431432 return -ENOMEM;
432433
433− dm = kmalloc_array(hw_res->num_closid, sizeof(*hw_dom->mbps_val),
434− GFP_KERNEL);
435− if (!dm) {
436− kfree(dc);
437− return -ENOMEM;
438− }
439−
440434 hw_dom->ctrl_val = dc;
441− hw_dom->mbps_val = dm;
442− setup_default_ctrlval(r, dc, dm);
435+ setup_default_ctrlval(r, dc);
443436
444437 m.low = 0;
445438 m.high = hw_res->num_closid;
@@ -447,39 +440,31 @@ static int domain_setup_ctrlval(struct rdt_resource *r, struct rdt_domain *d) · 1 unmodified line
447440 return 0;
448441 }
449442
450−static int domain_setup_mon_state(struct rdt_resource *r, struct rdt_domain *d)
443+/**
444+ * arch_domain_mbm_alloc() - Allocate arch private storage for the MBM counters
445+ * @num_rmid: The size of the MBM counter array
446+ * @hw_dom: The domain that owns the allocated arrays
447+ */
448+static int arch_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_domain *hw_dom)
451449 {
452450 size_t tsize;
453451
454− if (is_llc_occupancy_enabled()) {
455− d->rmid_busy_llc = bitmap_zalloc(r->num_rmid, GFP_KERNEL);
456− if (!d->rmid_busy_llc)
457− return -ENOMEM;
458− INIT_DELAYED_WORK(&d->cqm_limbo, cqm_handle_limbo);
459− }
460452 if (is_mbm_total_enabled()) {
461− tsize = sizeof(*d->mbm_total);
462− d->mbm_total = kcalloc(r->num_rmid, tsize, GFP_KERNEL);
463− if (!d->mbm_total) {
464− bitmap_free(d->rmid_busy_llc);
453+ tsize = sizeof(*hw_dom->arch_mbm_total);
454+ hw_dom->arch_mbm_total = kcalloc(num_rmid, tsize, GFP_KERNEL);
455+ if (!hw_dom->arch_mbm_total)
465456 return -ENOMEM;
466− }
467457 }
468458 if (is_mbm_local_enabled()) {
469− tsize = sizeof(*d->mbm_local);
470− d->mbm_local = kcalloc(r->num_rmid, tsize, GFP_KERNEL);
471− if (!d->mbm_local) {
472− bitmap_free(d->rmid_busy_llc);
473− kfree(d->mbm_total);
459+ tsize = sizeof(*hw_dom->arch_mbm_local);
460+ hw_dom->arch_mbm_local = kcalloc(num_rmid, tsize, GFP_KERNEL);
461+ if (!hw_dom->arch_mbm_local) {
462+ kfree(hw_dom->arch_mbm_total);
463+ hw_dom->arch_mbm_total = NULL;
474464 return -ENOMEM;
475465 }
476466 }
477467
478− if (is_mbm_enabled()) {
479− INIT_DELAYED_WORK(&d->mbm_over, mbm_handle_overflow);
480− mbm_setup_overflow_handler(d, MBM_OVERFLOW_INTERVAL);
481− }
482−
483468 return 0;
484469 }
485470
@@ -502,6 +487,7 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r) · 16 unmodified lines
502487 struct list_head *add_pos = NULL;
503488 struct rdt_hw_domain *hw_dom;
504489 struct rdt_domain *d;
490+ int err;
505491
506492 d = rdt_find_domain(r, id, &add_pos);
507493 if (IS_ERR(d)) {
@@ -527,25 +513,22 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r) · 19 unmodified lines
527513 rdt_domain_reconfigure_cdp(r);
528514
529515 if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
530− kfree(hw_dom);
516+ domain_free(hw_dom);
531517 return;
532518 }
533519
534− if (r->mon_capable && domain_setup_mon_state(r, d)) {
535− kfree(hw_dom->ctrl_val);
536− kfree(hw_dom->mbps_val);
537− kfree(hw_dom);
520+ if (r->mon_capable && arch_domain_mbm_alloc(r->num_rmid, hw_dom)) {
521+ domain_free(hw_dom);
538522 return;
539523 }
540524
541525 list_add_tail(&d->list, add_pos);
542526
543− /*
544− * If resctrl is mounted, add
545− * per domain monitor data directories.
546− */
547− if (static_branch_unlikely(&rdt_mon_enable_key))
548− mkdir_mondata_subdir_allrdtgrp(r, d);
527+ err = resctrl_online_domain(r, d);
528+ if (err) {
529+ list_del(&d->list);
530+ domain_free(hw_dom);
531+ }
549532 }
550533
551534 static void domain_remove_cpu(int cpu, struct rdt_resource *r)
@@ -563,27 +546,8 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r) · 11 unmodified lines
563546
564547 cpumask_clear_cpu(cpu, &d->cpu_mask);
565548 if (cpumask_empty(&d->cpu_mask)) {
566− /*
567− * If resctrl is mounted, remove all the
568− * per domain monitor data directories.
569− */
570− if (static_branch_unlikely(&rdt_mon_enable_key))
571− rmdir_mondata_subdir_allrdtgrp(r, d->id);
549+ resctrl_offline_domain(r, d);
572550 list_del(&d->list);
573− if (r->mon_capable && is_mbm_enabled())
574− cancel_delayed_work(&d->mbm_over);
575− if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
576− /*
577− * When a package is going down, forcefully
578− * decrement rmid->ebusy. There is no way to know
579− * that the L3 was flushed and hence may lead to
580− * incorrect counts in rare scenarios, but leaving
581− * the RMID as busy creates RMID leaks if the
582− * package never comes back.
583− */
584− __check_limbo(d, true);
585− cancel_delayed_work(&d->cqm_limbo);
586− }
587551
588552 /*
589553 * rdt_domain "d" is going to be freed below, so clear
@@ -591,13 +555,8 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r) · 1 unmodified line
591555 */
592556 if (d->plr)
593557 d->plr->d = NULL;
558+ domain_free(hw_dom);
594559
595− kfree(hw_dom->ctrl_val);
596− kfree(hw_dom->mbps_val);
597− bitmap_free(d->rmid_busy_llc);
598− kfree(d->mbm_total);
599− kfree(d->mbm_local);
600− kfree(hw_dom);
601560 return;
602561 }
603562
arch/x86/kernel/cpu/resctrl/ctrlmondata.c+52−23
@@ -61,6 +61,7 @@ int parse_bw(struct rdt_parse_data *data, struct resctrl_schema *s, · 60 unmodified lines
6161 struct rdt_domain *d)
6262 {
6363 struct resctrl_staged_config *cfg;
64+ u32 closid = data->rdtgrp->closid;
6465 struct rdt_resource *r = s->res;
6566 unsigned long bw_val;
6667
@@ -72,6 +73,12 @@ int parse_bw(struct rdt_parse_data *data, struct resctrl_schema *s, · 5 unmodified lines
7273
7374 if (!bw_validate(data->buf, &bw_val, r))
7475 return -EINVAL;
76+
77+ if (is_mba_sc(r)) {
78+ d->mbps_val[closid] = bw_val;
79+ return 0;
80+ }
81+
7582 cfg->new_ctrl = bw_val;
7683 cfg->have_new_ctrl = true;
7784
@@ -261,14 +268,13 @@ static u32 get_config_index(u32 closid, enum resctrl_conf_type type) · 183 unmodified lines
261268
262269 static bool apply_config(struct rdt_hw_domain *hw_dom,
263270 struct resctrl_staged_config *cfg, u32 idx,
264− cpumask_var_t cpu_mask, bool mba_sc)
271+ cpumask_var_t cpu_mask)
265272 {
266273 struct rdt_domain *dom = &hw_dom->d_resctrl;
267− u32 *dc = !mba_sc ? hw_dom->ctrl_val : hw_dom->mbps_val;
268274
269− if (cfg->new_ctrl != dc[idx]) {
275+ if (cfg->new_ctrl != hw_dom->ctrl_val[idx]) {
270276 cpumask_set_cpu(cpumask_any(&dom->cpu_mask), cpu_mask);
271− dc[idx] = cfg->new_ctrl;
277+ hw_dom->ctrl_val[idx] = cfg->new_ctrl;
272278
273279 return true;
274280 }
@@ -276,6 +282,27 @@ static bool apply_config(struct rdt_hw_domain *hw_dom, · 1 unmodified line
276282 return false;
277283 }
278284
285+int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
286+ u32 closid, enum resctrl_conf_type t, u32 cfg_val)
287+{
288+ struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
289+ struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
290+ u32 idx = get_config_index(closid, t);
291+ struct msr_param msr_param;
292+
293+ if (!cpumask_test_cpu(smp_processor_id(), &d->cpu_mask))
294+ return -EINVAL;
295+
296+ hw_dom->ctrl_val[idx] = cfg_val;
297+
298+ msr_param.res = r;
299+ msr_param.low = idx;
300+ msr_param.high = idx + 1;
301+ hw_res->msr_update(d, &msr_param, r);
302+
303+ return 0;
304+}
305+
279306 int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
280307 {
281308 struct resctrl_staged_config *cfg;
@@ -284,14 +311,12 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) · 2 unmodified lines
284311 enum resctrl_conf_type t;
285312 cpumask_var_t cpu_mask;
286313 struct rdt_domain *d;
287− bool mba_sc;
288314 int cpu;
289315 u32 idx;
290316
291317 if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
292318 return -ENOMEM;
293319
294− mba_sc = is_mba_sc(r);
295320 msr_param.res = NULL;
296321 list_for_each_entry(d, &r->domains, list) {
297322 hw_dom = resctrl_to_arch_dom(d);
@@ -301,7 +326,7 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) · 3 unmodified lines
301326 continue;
302327
303328 idx = get_config_index(closid, t);
304− if (!apply_config(hw_dom, cfg, idx, cpu_mask, mba_sc))
329+ if (!apply_config(hw_dom, cfg, idx, cpu_mask))
305330 continue;
306331
307332 if (!msr_param.res) {
@@ -315,11 +340,7 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid) · 7 unmodified lines
315340 }
316341 }
317342
318− /*
319− * Avoid writing the control msr with control values when
320− * MBA software controller is enabled
321− */
322− if (cpumask_empty(cpu_mask) || mba_sc)
343+ if (cpumask_empty(cpu_mask))
323344 goto done;
324345 cpu = get_cpu();
325346 /* Update resource control msr on this CPU if it's in cpu_mask. */
@@ -406,6 +427,14 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, · 80 unmodified lines
406427
407428 list_for_each_entry(s, &resctrl_schema_all, list) {
408429 r = s->res;
430+
431+ /*
432+ * Writes to mba_sc resources update the software controller,
433+ * not the control MSR.
434+ */
435+ if (is_mba_sc(r))
436+ continue;
437+
409438 ret = resctrl_arch_update_domains(r, rdtgrp->closid);
410439 if (ret)
411440 goto out;
@@ -433,9 +462,7 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d, · 21 unmodified lines
433462 struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
434463 u32 idx = get_config_index(closid, type);
435464
436− if (!is_mba_sc(r))
437− return hw_dom->ctrl_val[idx];
438− return hw_dom->mbps_val[idx];
465+ return hw_dom->ctrl_val[idx];
439466 }
440467
441468 static void show_doms(struct seq_file *s, struct resctrl_schema *schema, int closid)
@@ -450,8 +477,12 @@ static void show_doms(struct seq_file *s, struct resctrl_schema *schema, int clo · 8 unmodified lines
450477 if (sep)
451478 seq_puts(s, ";");
452479
453− ctrl_val = resctrl_arch_get_config(r, dom, closid,
454− schema->conf_type);
480+ if (is_mba_sc(r))
481+ ctrl_val = dom->mbps_val[closid];
482+ else
483+ ctrl_val = resctrl_arch_get_config(r, dom, closid,
484+ schema->conf_type);
485+
455486 seq_printf(s, r->format_str, dom->id, max_data_width,
456487 ctrl_val);
457488 sep = true;
@@ -518,7 +549,6 @@ void mon_event_read(struct rmid_read *rr, struct rdt_resource *r, · 60 unmodified lines
518549 int rdtgroup_mondata_show(struct seq_file *m, void *arg)
519550 {
520551 struct kernfs_open_file *of = m->private;
521− struct rdt_hw_resource *hw_res;
522552 u32 resid, evtid, domid;
523553 struct rdtgroup *rdtgrp;
524554 struct rdt_resource *r;
@@ -538,8 +568,7 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg) · 13 unmodified lines
538568 domid = md.u.domid;
539569 evtid = md.u.evtid;
540570
541− hw_res = &rdt_resources_all[resid];
542− r = &hw_res->r_resctrl;
571+ r = &rdt_resources_all[resid].r_resctrl;
543572 d = rdt_find_domain(r, domid, NULL);
544573 if (IS_ERR_OR_NULL(d)) {
545574 ret = -ENOENT;
@@ -548,12 +577,12 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg) · 2 unmodified lines
548577
549578 mon_event_read(&rr, r, d, rdtgrp, evtid, false);
550579
551− if (rr.val & RMID_VAL_ERROR)
580+ if (rr.err == -EIO)
552581 seq_puts(m, "Error\n");
553− else if (rr.val & RMID_VAL_UNAVAIL)
582+ else if (rr.err == -EINVAL)
554583 seq_puts(m, "Unavailable\n");
555584 else
556− seq_printf(m, "%llu\n", rr.val * hw_res->mon_scale);
585+ seq_printf(m, "%llu\n", rr.val);
557586
558587 out:
559588 rdtgroup_kn_unlock(of->kn);
arch/x86/kernel/cpu/resctrl/internal.h+24−37
@@ -22,21 +22,12 @@ · 21 unmodified lines
2222
2323 #define L2_QOS_CDP_ENABLE 0x01ULL
2424
25−/*
26− * Event IDs are used to program IA32_QM_EVTSEL before reading event
27− * counter from IA32_QM_CTR
28− */
29−#define QOS_L3_OCCUP_EVENT_ID 0x01
30−#define QOS_L3_MBM_TOTAL_EVENT_ID 0x02
31−#define QOS_L3_MBM_LOCAL_EVENT_ID 0x03
32−
3325 #define CQM_LIMBOCHECK_INTERVAL 1000
3426
3527 #define MBM_CNTR_WIDTH_BASE 24
3628 #define MBM_OVERFLOW_INTERVAL 1000
3729 #define MAX_MBA_BW 100u
3830 #define MBA_IS_LINEAR 0x4
39−#define MBA_MAX_MBPS U32_MAX
4031 #define MAX_MBA_BW_AMD 0x800
4132 #define MBM_CNTR_WIDTH_OFFSET_AMD 20
4233
@@ -74,7 +65,7 @@ DECLARE_STATIC_KEY_FALSE(rdt_mon_enable_key); · 31 unmodified lines
7465 * @list: entry in &rdt_resource->evt_list
7566 */
7667 struct mon_evt {
77− u32 evtid;
68+ enum resctrl_event_id evtid;
7869 char *name;
7970 struct list_head list;
8071 };
@@ -91,9 +82,9 @@ struct mon_evt { · 10 unmodified lines
9182 union mon_data_bits {
9283 void *priv;
9384 struct {
94− unsigned int rid : 10;
95− unsigned int evtid : 8;
96− unsigned int domid : 14;
85+ unsigned int rid : 10;
86+ enum resctrl_event_id evtid : 8;
87+ unsigned int domid : 14;
9788 } u;
9889 };
9990
@@ -101,12 +92,12 @@ struct rmid_read { · 1 unmodified line
10192 struct rdtgroup *rgrp;
10293 struct rdt_resource *r;
10394 struct rdt_domain *d;
104− int evtid;
95+ enum resctrl_event_id evtid;
10596 bool first;
97+ int err;
10698 u64 val;
10799 };
108100
109−extern unsigned int resctrl_cqm_threshold;
110101 extern bool rdt_alloc_capable;
111102 extern bool rdt_mon_capable;
112103 extern unsigned int rdt_mon_features;
@@ -288,35 +279,45 @@ struct rftype { · 175 unmodified lines
288279
289280 /**
290281 * struct mbm_state - status for each MBM counter in each domain
291− * @chunks: Total data moved (multiply by rdt_group.mon_scale to get bytes)
292− * @prev_msr: Value of IA32_QM_CTR for this RMID last time we read it
293− * @prev_bw_msr:Value of previous IA32_QM_CTR for bandwidth counting
282+ * @prev_bw_bytes: Previous bytes value read for bandwidth calculation
294283 * @prev_bw: The most recent bandwidth in MBps
295284 * @delta_bw: Difference between the current and previous bandwidth
296285 * @delta_comp: Indicates whether to compute the delta_bw
297286 */
298287 struct mbm_state {
299− u64 chunks;
300− u64 prev_msr;
301− u64 prev_bw_msr;
288+ u64 prev_bw_bytes;
302289 u32 prev_bw;
303290 u32 delta_bw;
304291 bool delta_comp;
305292 };
306293
294+/**
295+ * struct arch_mbm_state - values used to compute resctrl_arch_rmid_read()s
296+ * return value.
297+ * @chunks: Total data moved (multiply by rdt_group.mon_scale to get bytes)
298+ * @prev_msr: Value of IA32_QM_CTR last time it was read for the RMID used to
299+ * find this struct.
300+ */
301+struct arch_mbm_state {
302+ u64 chunks;
303+ u64 prev_msr;
304+};
305+
307306 /**
308307 * struct rdt_hw_domain - Arch private attributes of a set of CPUs that share
309308 * a resource
310309 * @d_resctrl: Properties exposed to the resctrl file system
311310 * @ctrl_val: array of cache or mem ctrl values (indexed by CLOSID)
312− * @mbps_val: When mba_sc is enabled, this holds the bandwidth in MBps
311+ * @arch_mbm_total: arch private state for MBM total bandwidth
312+ * @arch_mbm_local: arch private state for MBM local bandwidth
313313 *
314314 * Members of this structure are accessed via helpers that provide abstraction.
315315 */
316316 struct rdt_hw_domain {
317317 struct rdt_domain d_resctrl;
318318 u32 *ctrl_val;
319− u32 *mbps_val;
319+ struct arch_mbm_state *arch_mbm_total;
320+ struct arch_mbm_state *arch_mbm_local;
320321 };
321322
322323 static inline struct rdt_hw_domain *resctrl_to_arch_dom(struct rdt_domain *r)
@@ -459,14 +460,6 @@ int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable); · 136 unmodified lines
459460 for_each_rdt_resource(r) \
460461 if (r->mon_capable)
461462
462−#define for_each_alloc_enabled_rdt_resource(r) \
463− for_each_rdt_resource(r) \
464− if (r->alloc_enabled)
465−
466−#define for_each_mon_enabled_rdt_resource(r) \
467− for_each_rdt_resource(r) \
468− if (r->mon_enabled)
469−
470463 /* CPUID.(EAX=10H, ECX=ResID=1).EAX */
471464 union cpuid_0x10_1_eax {
472465 struct {
@@ -530,10 +523,6 @@ void free_rmid(u32 rmid); · 57 unmodified lines
530523 int rdt_get_mon_l3_config(struct rdt_resource *r);
531524 void mon_event_count(void *info);
532525 int rdtgroup_mondata_show(struct seq_file *m, void *arg);
533−void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
534− unsigned int dom_id);
535−void mkdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
536− struct rdt_domain *d);
537526 void mon_event_read(struct rmid_read *rr, struct rdt_resource *r,
538527 struct rdt_domain *d, struct rdtgroup *rdtgrp,
539528 int evtid, int first);
@@ -542,8 +531,6 @@ void mbm_setup_overflow_handler(struct rdt_domain *dom, · 2 unmodified lines
542531 void mbm_handle_overflow(struct work_struct *work);
543532 void __init intel_rdt_mbm_apply_quirk(void);
544533 bool is_mba_sc(struct rdt_resource *r);
545−void setup_default_ctrlval(struct rdt_resource *r, u32 *dc, u32 *dm);
546−u32 delay_bw_map(unsigned long bw, struct rdt_resource *r);
547534 void cqm_setup_limbo_handler(struct rdt_domain *dom, unsigned long delay_ms);
548535 void cqm_handle_limbo(struct work_struct *work);
549536 bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
arch/x86/kernel/cpu/resctrl/monitor.c+150−82
@@ -16,8 +16,12 @@ · 15 unmodified lines
1616 */
1717
1818 #include <linux/module.h>
19+#include <linux/sizes.h>
1920 #include <linux/slab.h>
21+
2022 #include <asm/cpu_device_id.h>
23+#include <asm/resctrl.h>
24+
2125 #include "internal.h"
2226
2327 struct rmid_entry {
@@ -37,8 +41,8 @@ static LIST_HEAD(rmid_free_lru); · 13 unmodified lines
3741 * @rmid_limbo_count count of currently unused but (potentially)
3842 * dirty RMIDs.
3943 * This counts RMIDs that no one is currently using but that
40− * may have a occupancy value > intel_cqm_threshold. User can change
41− * the threshold occupancy value.
44+ * may have a occupancy value > resctrl_rmid_realloc_threshold. User can
45+ * change the threshold occupancy value.
4246 */
4347 static unsigned int rmid_limbo_count;
4448
@@ -59,10 +63,15 @@ bool rdt_mon_capable; · 14 unmodified lines
5963 unsigned int rdt_mon_features;
6064
6165 /*
62− * This is the threshold cache occupancy at which we will consider an
66+ * This is the threshold cache occupancy in bytes at which we will consider an
6367 * RMID available for re-allocation.
6468 */
65−unsigned int resctrl_cqm_threshold;
69+unsigned int resctrl_rmid_realloc_threshold;
70+
71+/*
72+ * This is the maximum value for the reallocation threshold, in bytes.
73+ */
74+unsigned int resctrl_rmid_realloc_limit;
6675
6776 #define CF(cf) ((unsigned long)(1048576 * (cf) + 0.5))
6877
@@ -137,9 +146,54 @@ static inline struct rmid_entry *__rmid_entry(u32 rmid) · 68 unmodified lines
137146 return entry;
138147 }
139148
140−static u64 __rmid_read(u32 rmid, u32 eventid)
149+static struct arch_mbm_state *get_arch_mbm_state(struct rdt_hw_domain *hw_dom,
150+ u32 rmid,
151+ enum resctrl_event_id eventid)
141152 {
142− u64 val;
153+ switch (eventid) {
154+ case QOS_L3_OCCUP_EVENT_ID:
155+ return NULL;
156+ case QOS_L3_MBM_TOTAL_EVENT_ID:
157+ return &hw_dom->arch_mbm_total[rmid];
158+ case QOS_L3_MBM_LOCAL_EVENT_ID:
159+ return &hw_dom->arch_mbm_local[rmid];
160+ }
161+
162+ /* Never expect to get here */
163+ WARN_ON_ONCE(1);
164+
165+ return NULL;
166+}
167+
168+void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_domain *d,
169+ u32 rmid, enum resctrl_event_id eventid)
170+{
171+ struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
172+ struct arch_mbm_state *am;
173+
174+ am = get_arch_mbm_state(hw_dom, rmid, eventid);
175+ if (am)
176+ memset(am, 0, sizeof(*am));
177+}
178+
179+static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr, unsigned int width)
180+{
181+ u64 shift = 64 - width, chunks;
182+
183+ chunks = (cur_msr << shift) - (prev_msr << shift);
184+ return chunks >> shift;
185+}
186+
187+int resctrl_arch_rmid_read(struct rdt_resource *r, struct rdt_domain *d,
188+ u32 rmid, enum resctrl_event_id eventid, u64 *val)
189+{
190+ struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
191+ struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
192+ struct arch_mbm_state *am;
193+ u64 msr_val, chunks;
194+
195+ if (!cpumask_test_cpu(smp_processor_id(), &d->cpu_mask))
196+ return -EINVAL;
143197
144198 /*
145199 * As per the SDM, when IA32_QM_EVTSEL.EvtID (bits 7:0) is configured
@@ -150,16 +204,26 @@ static u64 __rmid_read(u32 rmid, u32 eventid) · 4 unmodified lines
150204 * are error bits.
151205 */
152206 wrmsr(MSR_IA32_QM_EVTSEL, eventid, rmid);
153− rdmsrl(MSR_IA32_QM_CTR, val);
154−
155− return val;
156−}
207+ rdmsrl(MSR_IA32_QM_CTR, msr_val);
208+
209+ if (msr_val & RMID_VAL_ERROR)
210+ return -EIO;
211+ if (msr_val & RMID_VAL_UNAVAIL)
212+ return -EINVAL;
213+
214+ am = get_arch_mbm_state(hw_dom, rmid, eventid);
215+ if (am) {
216+ am->chunks += mbm_overflow_count(am->prev_msr, msr_val,
217+ hw_res->mbm_width);
218+ chunks = get_corrected_mbm_count(rmid, am->chunks);
219+ am->prev_msr = msr_val;
220+ } else {
221+ chunks = msr_val;
222+ }
157223
158−static bool rmid_dirty(struct rmid_entry *entry)
159−{
160− u64 val = __rmid_read(entry->rmid, QOS_L3_OCCUP_EVENT_ID);
224+ *val = chunks * hw_res->mon_scale;
161225
162− return val >= resctrl_cqm_threshold;
226+ return 0;
163227 }
164228
165229 /*
@@ -170,11 +234,11 @@ static bool rmid_dirty(struct rmid_entry *entry) · 4 unmodified lines
170234 */
171235 void __check_limbo(struct rdt_domain *d, bool force_free)
172236 {
237+ struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
173238 struct rmid_entry *entry;
174− struct rdt_resource *r;
175239 u32 crmid = 1, nrmid;
176−
177− r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
240+ bool rmid_dirty;
241+ u64 val = 0;
178242
179243 /*
180244 * Skip RMID 0 and start from RMID 1 and check all the RMIDs that
@@ -188,7 +252,15 @@ void __check_limbo(struct rdt_domain *d, bool force_free) · 7 unmodified lines
188252 break;
189253
190254 entry = __rmid_entry(nrmid);
191− if (force_free || !rmid_dirty(entry)) {
255+
256+ if (resctrl_arch_rmid_read(r, d, entry->rmid,
257+ QOS_L3_OCCUP_EVENT_ID, &val)) {
258+ rmid_dirty = true;
259+ } else {
260+ rmid_dirty = (val >= resctrl_rmid_realloc_threshold);
261+ }
262+
263+ if (force_free || !rmid_dirty) {
192264 clear_bit(entry->rmid, d->rmid_busy_llc);
193265 if (!--entry->busy) {
194266 rmid_limbo_count--;
@@ -227,19 +299,19 @@ int alloc_rmid(void) · 32 unmodified lines
227299
228300 static void add_rmid_to_limbo(struct rmid_entry *entry)
229301 {
230− struct rdt_resource *r;
302+ struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
231303 struct rdt_domain *d;
232− int cpu;
233− u64 val;
234−
235− r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
304+ int cpu, err;
305+ u64 val = 0;
236306
237307 entry->busy = 0;
238308 cpu = get_cpu();
239309 list_for_each_entry(d, &r->domains, list) {
240310 if (cpumask_test_cpu(cpu, &d->cpu_mask)) {
241− val = __rmid_read(entry->rmid, QOS_L3_OCCUP_EVENT_ID);
242− if (val <= resctrl_cqm_threshold)
311+ err = resctrl_arch_rmid_read(r, d, entry->rmid,
312+ QOS_L3_OCCUP_EVENT_ID,
313+ &val);
314+ if (err || val <= resctrl_rmid_realloc_threshold)
243315 continue;
244316 }
245317
@@ -277,24 +349,18 @@ void free_rmid(u32 rmid) · 31 unmodified lines
277349 list_add_tail(&entry->list, &rmid_free_lru);
278350 }
279351
280−static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr, unsigned int width)
352+static int __mon_event_count(u32 rmid, struct rmid_read *rr)
281353 {
282− u64 shift = 64 - width, chunks;
354+ struct mbm_state *m;
355+ u64 tval = 0;
283356
284− chunks = (cur_msr << shift) - (prev_msr << shift);
285− return chunks >> shift;
286−}
357+ if (rr->first)
358+ resctrl_arch_reset_rmid(rr->r, rr->d, rmid, rr->evtid);
287359
288−static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)
289−{
290− struct rdt_hw_resource *hw_res = resctrl_to_arch_res(rr->r);
291− struct mbm_state *m;
292− u64 chunks, tval;
360+ rr->err = resctrl_arch_rmid_read(rr->r, rr->d, rmid, rr->evtid, &tval);
361+ if (rr->err)
362+ return rr->err;
293363
294− tval = __rmid_read(rmid, rr->evtid);
295− if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {
296− return tval;
297− }
298364 switch (rr->evtid) {
299365 case QOS_L3_OCCUP_EVENT_ID:
300366 rr->val += tval;
@@ -308,48 +374,47 @@ static u64 __mon_event_count(u32 rmid, struct rmid_read *rr) · 7 unmodified lines
308374 default:
309375 /*
310376 * Code would never reach here because an invalid
311− * event id would fail the __rmid_read.
377+ * event id would fail in resctrl_arch_rmid_read().
312378 */
313− return RMID_VAL_ERROR;
379+ return -EINVAL;
314380 }
315381
316382 if (rr->first) {
317383 memset(m, 0, sizeof(struct mbm_state));
318− m->prev_bw_msr = m->prev_msr = tval;
319384 return 0;
320385 }
321386
322− chunks = mbm_overflow_count(m->prev_msr, tval, hw_res->mbm_width);
323− m->chunks += chunks;
324− m->prev_msr = tval;
325−
326− rr->val += get_corrected_mbm_count(rmid, m->chunks);
387+ rr->val += tval;
327388
328389 return 0;
329390 }
330391
331392 /*
393+ * mbm_bw_count() - Update bw count from values previously read by
394+ * __mon_event_count().
395+ * @rmid: The rmid used to identify the cached mbm_state.
396+ * @rr: The struct rmid_read populated by __mon_event_count().
397+ *
332398 * Supporting function to calculate the memory bandwidth
333− * and delta bandwidth in MBps.
399+ * and delta bandwidth in MBps. The chunks value previously read by
400+ * __mon_event_count() is compared with the chunks value from the previous
401+ * invocation. This must be called once per second to maintain values in MBps.
334402 */
335403 static void mbm_bw_count(u32 rmid, struct rmid_read *rr)
336404 {
337− struct rdt_hw_resource *hw_res = resctrl_to_arch_res(rr->r);
338405 struct mbm_state *m = &rr->d->mbm_local[rmid];
339− u64 tval, cur_bw, chunks;
406+ u64 cur_bw, bytes, cur_bytes;
340407
341− tval = __rmid_read(rmid, rr->evtid);
342− if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL))
343− return;
408+ cur_bytes = rr->val;
409+ bytes = cur_bytes - m->prev_bw_bytes;
410+ m->prev_bw_bytes = cur_bytes;
344411
345− chunks = mbm_overflow_count(m->prev_bw_msr, tval, hw_res->mbm_width);
346− cur_bw = (get_corrected_mbm_count(rmid, chunks) * hw_res->mon_scale) >> 20;
412+ cur_bw = bytes / SZ_1M;
347413
348414 if (m->delta_comp)
349415 m->delta_bw = abs(cur_bw - m->prev_bw);
350416 m->delta_comp = false;
351417 m->prev_bw = cur_bw;
352− m->prev_bw_msr = tval;
353418 }
354419
355420 /*
@@ -361,11 +426,11 @@ void mon_event_count(void *info) · 5 unmodified lines
361426 struct rdtgroup *rdtgrp, *entry;
362427 struct rmid_read *rr = info;
363428 struct list_head *head;
364− u64 ret_val;
429+ int ret;
365430
366431 rdtgrp = rr->rgrp;
367432
368− ret_val = __mon_event_count(rdtgrp->mon.rmid, rr);
433+ ret = __mon_event_count(rdtgrp->mon.rmid, rr);
369434
370435 /*
371436 * For Ctrl groups read data from child monitor groups and
@@ -377,13 +442,17 @@ void mon_event_count(void *info) · 5 unmodified lines
377442 if (rdtgrp->type == RDTCTRL_GROUP) {
378443 list_for_each_entry(entry, head, mon.crdtgrp_list) {
379444 if (__mon_event_count(entry->mon.rmid, rr) == 0)
380− ret_val = 0;
445+ ret = 0;
381446 }
382447 }
383448
384− /* Report error if none of rmid_reads are successful */
385− if (ret_val)
386− rr->val = ret_val;
449+ /*
450+ * __mon_event_count() calls for newly created monitor groups may
451+ * report -EINVAL/Unavailable if the monitor hasn't seen any traffic.
452+ * Discard error if any of the monitor event reads succeeded.
453+ */
454+ if (ret == 0)
455+ rr->err = 0;
387456 }
388457
389458 /*
@@ -420,10 +489,8 @@ void mon_event_count(void *info) · 30 unmodified lines
420489 */
421490 static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm)
422491 {
423− u32 closid, rmid, cur_msr, cur_msr_val, new_msr_val;
492+ u32 closid, rmid, cur_msr_val, new_msr_val;
424493 struct mbm_state *pmbm_data, *cmbm_data;
425− struct rdt_hw_resource *hw_r_mba;
426− struct rdt_hw_domain *hw_dom_mba;
427494 u32 cur_bw, delta_bw, user_bw;
428495 struct rdt_resource *r_mba;
429496 struct rdt_domain *dom_mba;
@@ -433,8 +500,8 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) · 3 unmodified lines
433500 if (!is_mbm_local_enabled())
434501 return;
435502
436− hw_r_mba = &rdt_resources_all[RDT_RESOURCE_MBA];
437− r_mba = &hw_r_mba->r_resctrl;
503+ r_mba = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
504+
438505 closid = rgrp->closid;
439506 rmid = rgrp->mon.rmid;
440507 pmbm_data = &dom_mbm->mbm_local[rmid];
@@ -444,16 +511,13 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) · 3 unmodified lines
444511 pr_warn_once("Failure to get domain for MBA update\n");
445512 return;
446513 }
447− hw_dom_mba = resctrl_to_arch_dom(dom_mba);
448514
449515 cur_bw = pmbm_data->prev_bw;
450− user_bw = resctrl_arch_get_config(r_mba, dom_mba, closid, CDP_NONE);
516+ user_bw = dom_mba->mbps_val[closid];
451517 delta_bw = pmbm_data->delta_bw;
452− /*
453− * resctrl_arch_get_config() chooses the mbps/ctrl value to return
454− * based on is_mba_sc(). For now, reach into the hw_dom.
455− */
456− cur_msr_val = hw_dom_mba->ctrl_val[closid];
518+
519+ /* MBA resource doesn't support CDP */
520+ cur_msr_val = resctrl_arch_get_config(r_mba, dom_mba, closid, CDP_NONE);
457521
458522 /*
459523 * For Ctrl groups read data from child monitor groups.
@@ -488,9 +552,7 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) · 28 unmodified lines
488552 return;
489553 }
490554
491− cur_msr = hw_r_mba->msr_base + closid;
492− wrmsrl(cur_msr, delay_bw_map(new_msr_val, r_mba));
493− hw_dom_mba->ctrl_val[closid] = new_msr_val;
555+ resctrl_arch_update_one(r_mba, dom_mba, closid, CDP_NONE, new_msr_val);
494556
495557 /*
496558 * Delta values are updated dynamically package wise for each
@@ -523,10 +585,12 @@ static void mbm_update(struct rdt_resource *r, struct rdt_domain *d, int rmid) · 26 unmodified lines
523585 */
524586 if (is_mbm_total_enabled()) {
525587 rr.evtid = QOS_L3_MBM_TOTAL_EVENT_ID;
588+ rr.val = 0;
526589 __mon_event_count(rmid, &rr);
527590 }
528591 if (is_mbm_local_enabled()) {
529592 rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID;
593+ rr.val = 0;
530594 __mon_event_count(rmid, &rr);
531595
532596 /*
@@ -686,9 +750,10 @@ int rdt_get_mon_l3_config(struct rdt_resource *r) · 153 unmodified lines
686750 {
687751 unsigned int mbm_offset = boot_cpu_data.x86_cache_mbm_width_offset;
688752 struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
689− unsigned int cl_size = boot_cpu_data.x86_cache_size;
753+ unsigned int threshold;
690754 int ret;
691755
756+ resctrl_rmid_realloc_limit = boot_cpu_data.x86_cache_size * 1024;
692757 hw_res->mon_scale = boot_cpu_data.x86_cache_occ_scale;
693758 r->num_rmid = boot_cpu_data.x86_cache_max_rmid + 1;
694759 hw_res->mbm_width = MBM_CNTR_WIDTH_BASE;
@@ -705,10 +770,14 @@ int rdt_get_mon_l3_config(struct rdt_resource *r) · 10 unmodified lines
705770 *
706771 * For a 35MB LLC and 56 RMIDs, this is ~1.8% of the LLC.
707772 */
708− resctrl_cqm_threshold = cl_size * 1024 / r->num_rmid;
773+ threshold = resctrl_rmid_realloc_limit / r->num_rmid;
709774
710− /* h/w works in units of "boot_cpu_data.x86_cache_occ_scale" */
711− resctrl_cqm_threshold /= hw_res->mon_scale;
775+ /*
776+ * Because num_rmid may not be a power of two, round the value
777+ * to the nearest multiple of hw_res->mon_scale so it matches a
778+ * value the hardware will measure. mon_scale may not be a power of 2.
779+ */
780+ resctrl_rmid_realloc_threshold = resctrl_arch_round_mon_val(threshold);
712781
713782 ret = dom_data_init(r);
714783 if (ret)
@@ -717,7 +786,6 @@ int rdt_get_mon_l3_config(struct rdt_resource *r) · 2 unmodified lines
717786 l3_mon_evt_init(r);
718787
719788 r->mon_capable = true;
720− r->mon_enabled = true;
721789
722790 return 0;
723791 }
arch/x86/kernel/cpu/resctrl/pseudo_lock.c+10−4
@@ -420,6 +420,7 @@ static int pseudo_lock_fn(void *_rdtgrp) · 419 unmodified lines
420420 struct pseudo_lock_region *plr = rdtgrp->plr;
421421 u32 rmid_p, closid_p;
422422 unsigned long i;
423+ u64 saved_msr;
423424 #ifdef CONFIG_KASAN
424425 /*
425426 * The registers used for local register variables are also used
@@ -463,6 +464,7 @@ static int pseudo_lock_fn(void *_rdtgrp) · 37 unmodified lines
463464 * the buffer and evict pseudo-locked memory read earlier from the
464465 * cache.
465466 */
467+ saved_msr = __rdmsr(MSR_MISC_FEATURE_CONTROL);
466468 __wrmsr(MSR_MISC_FEATURE_CONTROL, prefetch_disable_bits, 0x0);
467469 closid_p = this_cpu_read(pqr_state.cur_closid);
468470 rmid_p = this_cpu_read(pqr_state.cur_rmid);
@@ -514,7 +516,7 @@ static int pseudo_lock_fn(void *_rdtgrp) · 45 unmodified lines
514516 __wrmsr(IA32_PQR_ASSOC, rmid_p, closid_p);
515517
516518 /* Re-enable the hardware prefetcher(s) */
517− wrmsr(MSR_MISC_FEATURE_CONTROL, 0x0, 0x0);
519+ wrmsrl(MSR_MISC_FEATURE_CONTROL, saved_msr);
518520 local_irq_enable();
519521
520522 plr->thread_done = 1;
@@ -835,7 +837,7 @@ bool rdtgroup_pseudo_locked_in_hierarchy(struct rdt_domain *d) · 314 unmodified lines
835837 * First determine which cpus have pseudo-locked regions
836838 * associated with them.
837839 */
838− for_each_alloc_enabled_rdt_resource(r) {
840+ for_each_alloc_capable_rdt_resource(r) {
839841 list_for_each_entry(d_i, &r->domains, list) {
840842 if (d_i->plr)
841843 cpumask_or(cpu_with_psl, cpu_with_psl,
@@ -871,6 +873,7 @@ bool rdtgroup_pseudo_locked_in_hierarchy(struct rdt_domain *d) · 29 unmodified lines
871873 static int measure_cycles_lat_fn(void *_plr)
872874 {
873875 struct pseudo_lock_region *plr = _plr;
876+ u32 saved_low, saved_high;
874877 unsigned long i;
875878 u64 start, end;
876879 void *mem_r;
@@ -879,6 +882,7 @@ static int measure_cycles_lat_fn(void *_plr) · 2 unmodified lines
879882 /*
880883 * Disable hardware prefetchers.
881884 */
885+ rdmsr(MSR_MISC_FEATURE_CONTROL, saved_low, saved_high);
882886 wrmsr(MSR_MISC_FEATURE_CONTROL, prefetch_disable_bits, 0x0);
883887 mem_r = READ_ONCE(plr->kmem);
884888 /*
@@ -895,7 +899,7 @@ static int measure_cycles_lat_fn(void *_plr) · 10 unmodified lines
895899 end = rdtsc_ordered();
896900 trace_pseudo_lock_mem_latency((u32)(end - start));
897901 }
898− wrmsr(MSR_MISC_FEATURE_CONTROL, 0x0, 0x0);
902+ wrmsr(MSR_MISC_FEATURE_CONTROL, saved_low, saved_high);
899903 local_irq_enable();
900904 plr->thread_done = 1;
901905 wake_up_interruptible(&plr->lock_thread_wq);
@@ -940,6 +944,7 @@ static int measure_residency_fn(struct perf_event_attr *miss_attr, · 38 unmodified lines
940944 u64 hits_before = 0, hits_after = 0, miss_before = 0, miss_after = 0;
941945 struct perf_event *miss_event, *hit_event;
942946 int hit_pmcnum, miss_pmcnum;
947+ u32 saved_low, saved_high;
943948 unsigned int line_size;
944949 unsigned int size;
945950 unsigned long i;
@@ -973,6 +978,7 @@ static int measure_residency_fn(struct perf_event_attr *miss_attr, · 27 unmodified lines
973978 /*
974979 * Disable hardware prefetchers.
975980 */
981+ rdmsr(MSR_MISC_FEATURE_CONTROL, saved_low, saved_high);
976982 wrmsr(MSR_MISC_FEATURE_CONTROL, prefetch_disable_bits, 0x0);
977983
978984 /* Initialize rest of local variables */
@@ -1031,7 +1037,7 @@ static int measure_residency_fn(struct perf_event_attr *miss_attr, · 52 unmodified lines
10311037 */
10321038 rmb();
10331039 /* Re-enable hardware prefetchers */
1034− wrmsr(MSR_MISC_FEATURE_CONTROL, 0x0, 0x0);
1040+ wrmsr(MSR_MISC_FEATURE_CONTROL, saved_low, saved_high);
10351041 local_irq_enable();
10361042 out_hit:
10371043 perf_event_release_kernel(hit_event);
arch/x86/kernel/cpu/resctrl/rdtgroup.c+180−36
@@ -1030,10 +1030,7 @@ static int rdt_delay_linear_show(struct kernfs_open_file *of, · 1029 unmodified lines
10301030 static int max_threshold_occ_show(struct kernfs_open_file *of,
10311031 struct seq_file *seq, void *v)
10321032 {
1033− struct rdt_resource *r = of->kn->parent->priv;
1034− struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
1035−
1036− seq_printf(seq, "%u\n", resctrl_cqm_threshold * hw_res->mon_scale);
1033+ seq_printf(seq, "%u\n", resctrl_rmid_realloc_threshold);
10371034
10381035 return 0;
10391036 }
@@ -1055,7 +1052,6 @@ static int rdt_thread_throttle_mode_show(struct kernfs_open_file *of, · 15 unmodified lines
10551052 static ssize_t max_threshold_occ_write(struct kernfs_open_file *of,
10561053 char *buf, size_t nbytes, loff_t off)
10571054 {
1058− struct rdt_hw_resource *hw_res;
10591055 unsigned int bytes;
10601056 int ret;
10611057
@@ -1063,11 +1059,10 @@ static ssize_t max_threshold_occ_write(struct kernfs_open_file *of, · 1 unmodified line
10631059 if (ret)
10641060 return ret;
10651061
1066− if (bytes > (boot_cpu_data.x86_cache_size * 1024))
1062+ if (bytes > resctrl_rmid_realloc_limit)
10671063 return -EINVAL;
10681064
1069− hw_res = resctrl_to_arch_res(of->kn->parent->priv);
1070− resctrl_cqm_threshold = bytes / hw_res->mon_scale;
1065+ resctrl_rmid_realloc_threshold = resctrl_arch_round_mon_val(bytes);
10711066
10721067 return nbytes;
10731068 }
@@ -1356,11 +1351,13 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, · 282 unmodified lines
13561351 struct seq_file *s, void *v)
13571352 {
13581353 struct resctrl_schema *schema;
1354+ enum resctrl_conf_type type;
13591355 struct rdtgroup *rdtgrp;
13601356 struct rdt_resource *r;
13611357 struct rdt_domain *d;
13621358 unsigned int size;
13631359 int ret = 0;
1360+ u32 closid;
13641361 bool sep;
13651362 u32 ctrl;
13661363
@@ -1386,8 +1383,11 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, · 19 unmodified lines
13861383 goto out;
13871384 }
13881385
1386+ closid = rdtgrp->closid;
1387+
13891388 list_for_each_entry(schema, &resctrl_schema_all, list) {
13901389 r = schema->res;
1390+ type = schema->conf_type;
13911391 sep = false;
13921392 seq_printf(s, "%*s:", max_name_width, schema->name);
13931393 list_for_each_entry(d, &r->domains, list) {
@@ -1396,9 +1396,12 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, · 2 unmodified lines
13961396 if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP) {
13971397 size = 0;
13981398 } else {
1399− ctrl = resctrl_arch_get_config(r, d,
1400− rdtgrp->closid,
1401− schema->conf_type);
1399+ if (is_mba_sc(r))
1400+ ctrl = d->mbps_val[closid];
1401+ else
1402+ ctrl = resctrl_arch_get_config(r, d,
1403+ closid,
1404+ type);
14021405 if (r->rid == RDT_RESOURCE_MBA)
14031406 size = ctrl;
14041407 else
@@ -1756,7 +1759,7 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) · 351 unmodified lines
17561759 if (ret)
17571760 goto out_destroy;
17581761
1759− /* loop over enabled controls, these are all alloc_enabled */
1762+ /* loop over enabled controls, these are all alloc_capable */
17601763 list_for_each_entry(s, &resctrl_schema_all, list) {
17611764 r = s->res;
17621765 fflags = r->fflags | RF_CTRL_INFO;
@@ -1765,7 +1768,7 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) · 2 unmodified lines
17651768 goto out_destroy;
17661769 }
17671770
1768− for_each_mon_enabled_rdt_resource(r) {
1771+ for_each_mon_capable_rdt_resource(r) {
17691772 fflags = r->fflags | RF_MON_INFO;
17701773 sprintf(name, "%s_MON", r->name);
17711774 ret = rdtgroup_mkdir_info_resdir(r, name, fflags);
@@ -1889,26 +1892,61 @@ void rdt_domain_reconfigure_cdp(struct rdt_resource *r) · 117 unmodified lines
18891892 l3_qos_cfg_update(&hw_res->cdp_enabled);
18901893 }
18911894
1895+static int mba_sc_domain_allocate(struct rdt_resource *r, struct rdt_domain *d)
1896+{
1897+ u32 num_closid = resctrl_arch_get_num_closid(r);
1898+ int cpu = cpumask_any(&d->cpu_mask);
1899+ int i;
1900+
1901+ d->mbps_val = kcalloc_node(num_closid, sizeof(*d->mbps_val),
1902+ GFP_KERNEL, cpu_to_node(cpu));
1903+ if (!d->mbps_val)
1904+ return -ENOMEM;
1905+
1906+ for (i = 0; i < num_closid; i++)
1907+ d->mbps_val[i] = MBA_MAX_MBPS;
1908+
1909+ return 0;
1910+}
1911+
1912+static void mba_sc_domain_destroy(struct rdt_resource *r,
1913+ struct rdt_domain *d)
1914+{
1915+ kfree(d->mbps_val);
1916+ d->mbps_val = NULL;
1917+}
1918+
18921919 /*
1893− * Enable or disable the MBA software controller
1894− * which helps user specify bandwidth in MBps.
18951920 * MBA software controller is supported only if
18961921 * MBM is supported and MBA is in linear scale.
18971922 */
1923+static bool supports_mba_mbps(void)
1924+{
1925+ struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
1926+
1927+ return (is_mbm_local_enabled() &&
1928+ r->alloc_capable && is_mba_linear());
1929+}
1930+
1931+/*
1932+ * Enable or disable the MBA software controller
1933+ * which helps user specify bandwidth in MBps.
1934+ */
18981935 static int set_mba_sc(bool mba_sc)
18991936 {
19001937 struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
1901− struct rdt_hw_domain *hw_dom;
1938+ u32 num_closid = resctrl_arch_get_num_closid(r);
19021939 struct rdt_domain *d;
1940+ int i;
19031941
1904− if (!is_mbm_enabled() || !is_mba_linear() ||
1905− mba_sc == is_mba_sc(r))
1942+ if (!supports_mba_mbps() || mba_sc == is_mba_sc(r))
19061943 return -EINVAL;
19071944
19081945 r->membw.mba_sc = mba_sc;
1946+
19091947 list_for_each_entry(d, &r->domains, list) {
1910− hw_dom = resctrl_to_arch_dom(d);
1911− setup_default_ctrlval(r, hw_dom->ctrl_val, hw_dom->mbps_val);
1948+ for (i = 0; i < num_closid; i++)
1949+ d->mbps_val[i] = MBA_MAX_MBPS;
19121950 }
19131951
19141952 return 0;
@@ -2106,7 +2144,7 @@ static int schemata_list_create(void) · 191 unmodified lines
21062144 struct rdt_resource *r;
21072145 int ret = 0;
21082146
2109− for_each_alloc_enabled_rdt_resource(r) {
2147+ for_each_alloc_capable_rdt_resource(r) {
21102148 if (resctrl_arch_get_cdp_enabled(r->rid)) {
21112149 ret = schemata_list_add(r, CDP_CODE);
21122150 if (ret)
@@ -2261,7 +2299,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) · 148 unmodified lines
22612299 ctx->enable_cdpl2 = true;
22622300 return 0;
22632301 case Opt_mba_mbps:
2264− if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
2302+ if (!supports_mba_mbps())
22652303 return -EINVAL;
22662304 ctx->enable_mba_mbps = true;
22672305 return 0;
@@ -2452,7 +2490,7 @@ static void rdt_kill_sb(struct super_block *sb) · 184 unmodified lines
24522490 set_mba_sc(false);
24532491
24542492 /*Put everything back to default values. */
2455− for_each_alloc_enabled_rdt_resource(r)
2493+ for_each_alloc_capable_rdt_resource(r)
24562494 reset_all_ctrls(r);
24572495 cdp_disable_all();
24582496 rmdir_all_sub();
@@ -2499,14 +2537,12 @@ static int mon_addfile(struct kernfs_node *parent_kn, const char *name, · 40 unmodified lines
24992537 * Remove all subdirectories of mon_data of ctrl_mon groups
25002538 * and monitor groups with given domain id.
25012539 */
2502−void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r, unsigned int dom_id)
2540+static void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
2541+ unsigned int dom_id)
25032542 {
25042543 struct rdtgroup *prgrp, *crgrp;
25052544 char name[32];
25062545
2507− if (!r->mon_enabled)
2508− return;
2509−
25102546 list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) {
25112547 sprintf(name, "mon_%s_%02d", r->name, dom_id);
25122548 kernfs_remove_by_name(prgrp->mon.mon_data_kn, name);
@@ -2565,16 +2601,13 @@ out_destroy: · 52 unmodified lines
25652601 * Add all subdirectories of mon_data for "ctrl_mon" groups
25662602 * and "monitor" groups with given domain id.
25672603 */
2568−void mkdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
2569− struct rdt_domain *d)
2604+static void mkdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
2605+ struct rdt_domain *d)
25702606 {
25712607 struct kernfs_node *parent_kn;
25722608 struct rdtgroup *prgrp, *crgrp;
25732609 struct list_head *head;
25742610
2575− if (!r->mon_enabled)
2576− return;
2577−
25782611 list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) {
25792612 parent_kn = prgrp->mon.mon_data_kn;
25802613 mkdir_mondata_subdir(parent_kn, d, r, prgrp);
@@ -2642,7 +2675,7 @@ static int mkdir_mondata_all(struct kernfs_node *parent_kn, · 61 unmodified lines
26422675 * Create the subdirectories for each domain. Note that all events
26432676 * in a domain like L3 are grouped into a resource whose domain is L3
26442677 */
2645− for_each_mon_enabled_rdt_resource(r) {
2678+ for_each_mon_capable_rdt_resource(r) {
26462679 ret = mkdir_mondata_subdir_alldom(kn, r, prgrp);
26472680 if (ret)
26482681 goto out_destroy;
@@ -2786,14 +2819,19 @@ static int rdtgroup_init_cat(struct resctrl_schema *s, u32 closid) · 137 unmodified lines
27862819 }
27872820
27882821 /* Initialize MBA resource with default values. */
2789−static void rdtgroup_init_mba(struct rdt_resource *r)
2822+static void rdtgroup_init_mba(struct rdt_resource *r, u32 closid)
27902823 {
27912824 struct resctrl_staged_config *cfg;
27922825 struct rdt_domain *d;
27932826
27942827 list_for_each_entry(d, &r->domains, list) {
2828+ if (is_mba_sc(r)) {
2829+ d->mbps_val[closid] = MBA_MAX_MBPS;
2830+ continue;
2831+ }
2832+
27952833 cfg = &d->staged_config[CDP_NONE];
2796− cfg->new_ctrl = is_mba_sc(r) ? MBA_MAX_MBPS : r->default_ctrl;
2834+ cfg->new_ctrl = r->default_ctrl;
27972835 cfg->have_new_ctrl = true;
27982836 }
27992837 }
@@ -2808,7 +2846,9 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp) · 8 unmodified lines
28082846 list_for_each_entry(s, &resctrl_schema_all, list) {
28092847 r = s->res;
28102848 if (r->rid == RDT_RESOURCE_MBA) {
2811− rdtgroup_init_mba(r);
2849+ rdtgroup_init_mba(r, rdtgrp->closid);
2850+ if (is_mba_sc(r))
2851+ continue;
28122852 } else {
28132853 ret = rdtgroup_init_cat(s, rdtgrp->closid);
28142854 if (ret < 0)
@@ -3236,6 +3276,110 @@ out: · 421 unmodified lines
32363276 return ret;
32373277 }
32383278
3279+static void domain_destroy_mon_state(struct rdt_domain *d)
3280+{
3281+ bitmap_free(d->rmid_busy_llc);
3282+ kfree(d->mbm_total);
3283+ kfree(d->mbm_local);
3284+}
3285+
3286+void resctrl_offline_domain(struct rdt_resource *r, struct rdt_domain *d)
3287+{
3288+ lockdep_assert_held(&rdtgroup_mutex);
3289+
3290+ if (supports_mba_mbps() && r->rid == RDT_RESOURCE_MBA)
3291+ mba_sc_domain_destroy(r, d);
3292+
3293+ if (!r->mon_capable)
3294+ return;
3295+
3296+ /*
3297+ * If resctrl is mounted, remove all the
3298+ * per domain monitor data directories.
3299+ */
3300+ if (static_branch_unlikely(&rdt_mon_enable_key))
3301+ rmdir_mondata_subdir_allrdtgrp(r, d->id);
3302+
3303+ if (is_mbm_enabled())
3304+ cancel_delayed_work(&d->mbm_over);
3305+ if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
3306+ /*
3307+ * When a package is going down, forcefully
3308+ * decrement rmid->ebusy. There is no way to know
3309+ * that the L3 was flushed and hence may lead to
3310+ * incorrect counts in rare scenarios, but leaving
3311+ * the RMID as busy creates RMID leaks if the
3312+ * package never comes back.
3313+ */
3314+ __check_limbo(d, true);
3315+ cancel_delayed_work(&d->cqm_limbo);
3316+ }
3317+
3318+ domain_destroy_mon_state(d);
3319+}
3320+
3321+static int domain_setup_mon_state(struct rdt_resource *r, struct rdt_domain *d)
3322+{
3323+ size_t tsize;
3324+
3325+ if (is_llc_occupancy_enabled()) {
3326+ d->rmid_busy_llc = bitmap_zalloc(r->num_rmid, GFP_KERNEL);
3327+ if (!d->rmid_busy_llc)
3328+ return -ENOMEM;
3329+ }
3330+ if (is_mbm_total_enabled()) {
3331+ tsize = sizeof(*d->mbm_total);
3332+ d->mbm_total = kcalloc(r->num_rmid, tsize, GFP_KERNEL);
3333+ if (!d->mbm_total) {
3334+ bitmap_free(d->rmid_busy_llc);
3335+ return -ENOMEM;
3336+ }
3337+ }
3338+ if (is_mbm_local_enabled()) {
3339+ tsize = sizeof(*d->mbm_local);
3340+ d->mbm_local = kcalloc(r->num_rmid, tsize, GFP_KERNEL);
3341+ if (!d->mbm_local) {
3342+ bitmap_free(d->rmid_busy_llc);
3343+ kfree(d->mbm_total);
3344+ return -ENOMEM;
3345+ }
3346+ }
3347+
3348+ return 0;
3349+}
3350+
3351+int resctrl_online_domain(struct rdt_resource *r, struct rdt_domain *d)
3352+{
3353+ int err;
3354+
3355+ lockdep_assert_held(&rdtgroup_mutex);
3356+
3357+ if (supports_mba_mbps() && r->rid == RDT_RESOURCE_MBA)
3358+ /* RDT_RESOURCE_MBA is never mon_capable */
3359+ return mba_sc_domain_allocate(r, d);
3360+
3361+ if (!r->mon_capable)
3362+ return 0;
3363+
3364+ err = domain_setup_mon_state(r, d);
3365+ if (err)
3366+ return err;
3367+
3368+ if (is_mbm_enabled()) {
3369+ INIT_DELAYED_WORK(&d->mbm_over, mbm_handle_overflow);
3370+ mbm_setup_overflow_handler(d, MBM_OVERFLOW_INTERVAL);
3371+ }
3372+
3373+ if (is_llc_occupancy_enabled())
3374+ INIT_DELAYED_WORK(&d->cqm_limbo, cqm_handle_limbo);
3375+
3376+ /* If resctrl is mounted, add per domain monitor data directories. */
3377+ if (static_branch_unlikely(&rdt_mon_enable_key))
3378+ mkdir_mondata_subdir_allrdtgrp(r, d);
3379+
3380+ return 0;
3381+}
3382+
32393383 /*
32403384 * rdtgroup_init - rdtgroup initialization
32413385 *
arch/x86/kernel/cpu/sgx/encl.c+14−7
@@ -12,6 +12,9 @@ · 11 unmodified lines
1212 #include "encls.h"
1313 #include "sgx.h"
1414
15+static int sgx_encl_lookup_backing(struct sgx_encl *encl, unsigned long page_index,
16+ struct sgx_backing *backing);
17+
1518 #define PCMDS_PER_PAGE (PAGE_SIZE / sizeof(struct sgx_pcmd))
1619 /*
1720 * 32 PCMD entries share a PCMD page. PCMD_FIRST_MASK is used to
@@ -917,7 +920,7 @@ static struct page *sgx_encl_get_backing_page(struct sgx_encl *encl, · 899 unmodified lines
917920 }
918921
919922 /**
920− * sgx_encl_get_backing() - Pin the backing storage
923+ * __sgx_encl_get_backing() - Pin the backing storage
921924 * @encl: an enclave pointer
922925 * @page_index: enclave page index
923926 * @backing: data for accessing backing storage for the page
@@ -929,7 +932,7 @@ static struct page *sgx_encl_get_backing_page(struct sgx_encl *encl, · 5 unmodified lines
929932 * 0 on success,
930933 * -errno otherwise.
931934 */
932−static int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,
935+static int __sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,
933936 struct sgx_backing *backing)
934937 {
935938 pgoff_t page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index);
@@ -1004,7 +1007,7 @@ static struct mem_cgroup *sgx_encl_get_mem_cgroup(struct sgx_encl *encl) · 68 unmodified lines
10041007 }
10051008
10061009 /**
1007− * sgx_encl_alloc_backing() - allocate a new backing storage page
1010+ * sgx_encl_alloc_backing() - create a new backing storage page
10081011 * @encl: an enclave pointer
10091012 * @page_index: enclave page index
10101013 * @backing: data for accessing backing storage for the page
@@ -1012,7 +1015,9 @@ static struct mem_cgroup *sgx_encl_get_mem_cgroup(struct sgx_encl *encl) · 1 unmodified line
10121015 * When called from ksgxd, sets the active memcg from one of the
10131016 * mms in the enclave's mm_list prior to any backing page allocation,
10141017 * in order to ensure that shmem page allocations are charged to the
1015− * enclave.
1018+ * enclave. Create a backing page for loading data back into an EPC page with
1019+ * ELDU. This function takes a reference on a new backing page which
1020+ * must be dropped with a corresponding call to sgx_encl_put_backing().
10161021 *
10171022 * Return:
10181023 * 0 on success,
@@ -1025,7 +1030,7 @@ int sgx_encl_alloc_backing(struct sgx_encl *encl, unsigned long page_index, · 6 unmodified lines
10251030 struct mem_cgroup *memcg = set_active_memcg(encl_memcg);
10261031 int ret;
10271032
1028− ret = sgx_encl_get_backing(encl, page_index, backing);
1033+ ret = __sgx_encl_get_backing(encl, page_index, backing);
10291034
10301035 set_active_memcg(memcg);
10311036 mem_cgroup_put(encl_memcg);
@@ -1043,15 +1048,17 @@ int sgx_encl_alloc_backing(struct sgx_encl *encl, unsigned long page_index, · 11 unmodified lines
10431048 * It is the caller's responsibility to ensure that it is appropriate to use
10441049 * sgx_encl_lookup_backing() rather than sgx_encl_alloc_backing(). If lookup is
10451050 * not used correctly, this will cause an allocation which is not accounted for.
1051+ * This function takes a reference on an existing backing page which must be
1052+ * dropped with a corresponding call to sgx_encl_put_backing().
10461053 *
10471054 * Return:
10481055 * 0 on success,
10491056 * -errno otherwise.
10501057 */
1051−int sgx_encl_lookup_backing(struct sgx_encl *encl, unsigned long page_index,
1058+static int sgx_encl_lookup_backing(struct sgx_encl *encl, unsigned long page_index,
10521059 struct sgx_backing *backing)
10531060 {
1054− return sgx_encl_get_backing(encl, page_index, backing);
1061+ return __sgx_encl_get_backing(encl, page_index, backing);
10551062 }
10561063
10571064 /**
arch/x86/kernel/cpu/sgx/encl.h+0−2
@@ -107,8 +107,6 @@ bool current_is_ksgxd(void); · 106 unmodified lines
107107 void sgx_encl_release(struct kref *ref);
108108 int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm);
109109 const cpumask_t *sgx_encl_cpumask(struct sgx_encl *encl);
110−int sgx_encl_lookup_backing(struct sgx_encl *encl, unsigned long page_index,
111− struct sgx_backing *backing);
112110 int sgx_encl_alloc_backing(struct sgx_encl *encl, unsigned long page_index,
113111 struct sgx_backing *backing);
114112 void sgx_encl_put_backing(struct sgx_backing *backing);
arch/x86/kernel/dumpstack.c+1−1
@@ -128,7 +128,7 @@ void show_opcodes(struct pt_regs *regs, const char *loglvl) · 127 unmodified lines
128128 /* No access to the user space stack of other tasks. Ignore. */
129129 break;
130130 default:
131− printk("%sCode: Unable to access opcode bytes at RIP 0x%lx.\n",
131+ printk("%sCode: Unable to access opcode bytes at 0x%lx.\n",
132132 loglvl, prologue);
133133 break;
134134 }
arch/x86/kernel/early_printk.c+7−7
@@ -264,11 +264,11 @@ static __init void early_pci_serial_init(char *s) · 263 unmodified lines
264264 bar0 = read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_0);
265265
266266 /*
267− * Verify it is a UART type device
267+ * Verify it is a 16550-UART type device
268268 */
269269 if (((classcode >> 16 != PCI_CLASS_COMMUNICATION_MODEM) &&
270270 (classcode >> 16 != PCI_CLASS_COMMUNICATION_SERIAL)) ||
271− (((classcode >> 8) & 0xff) != 0x02)) /* 16550 I/F at BAR0 */ {
271+ (((classcode >> 8) & 0xff) != PCI_SERIAL_16550_COMPATIBLE)) {
272272 if (!force)
273273 return;
274274 }
@@ -276,22 +276,22 @@ static __init void early_pci_serial_init(char *s) · 1 unmodified line
276276 /*
277277 * Determine if it is IO or memory mapped
278278 */
279− if (bar0 & 0x01) {
279+ if ((bar0 & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) {
280280 /* it is IO mapped */
281281 serial_in = io_serial_in;
282282 serial_out = io_serial_out;
283− early_serial_base = bar0&0xfffffffc;
283+ early_serial_base = bar0 & PCI_BASE_ADDRESS_IO_MASK;
284284 write_pci_config(bus, slot, func, PCI_COMMAND,
285− cmdreg|PCI_COMMAND_IO);
285+ cmdreg|PCI_COMMAND_IO);
286286 } else {
287287 /* It is memory mapped - assume 32-bit alignment */
288288 serial_in = mem32_serial_in;
289289 serial_out = mem32_serial_out;
290290 /* WARNING! assuming the address is always in the first 4G */
291291 early_serial_base =
292− (unsigned long)early_ioremap(bar0 & 0xfffffff0, 0x10);
292+ (unsigned long)early_ioremap(bar0 & PCI_BASE_ADDRESS_MEM_MASK, 0x10);
293293 write_pci_config(bus, slot, func, PCI_COMMAND,
294− cmdreg|PCI_COMMAND_MEMORY);
294+ cmdreg|PCI_COMMAND_MEMORY);
295295 }
296296
297297 /*
arch/x86/kernel/rtc.c+9−54
@@ -4,11 +4,8 @@ · 3 unmodified lines
44 */
55 #include <linux/platform_device.h>
66 #include <linux/mc146818rtc.h>
7−#include <linux/acpi.h>
8−#include <linux/bcd.h>
97 #include <linux/export.h>
108 #include <linux/pnp.h>
11−#include <linux/of.h>
129
1310 #include <asm/vsyscall.h>
1411 #include <asm/x86_init.h>
@@ -20,26 +17,23 @@ · 5 unmodified lines
2017 /*
2118 * This is a special lock that is owned by the CPU and holds the index
2219 * register we are working with. It is required for NMI access to the
23− * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details.
20+ * CMOS/RTC registers. See arch/x86/include/asm/mc146818rtc.h for details.
2421 */
2522 volatile unsigned long cmos_lock;
2623 EXPORT_SYMBOL(cmos_lock);
2724 #endif /* CONFIG_X86_32 */
2825
29−/* For two digit years assume time is always after that */
30−#define CMOS_YEARS_OFFS 2000
31−
3226 DEFINE_SPINLOCK(rtc_lock);
3327 EXPORT_SYMBOL(rtc_lock);
3428
3529 /*
36− * In order to set the CMOS clock precisely, set_rtc_mmss has to be
30+ * In order to set the CMOS clock precisely, mach_set_cmos_time has to be
3731 * called 500 ms after the second nowtime has started, because when
3832 * nowtime is written into the registers of the CMOS clock, it will
3933 * jump to the next second precisely 500 ms later. Check the Motorola
4034 * MC146818A or Dallas DS12887 data sheet for details.
4135 */
42−int mach_set_rtc_mmss(const struct timespec64 *now)
36+int mach_set_cmos_time(const struct timespec64 *now)
4337 {
4438 unsigned long long nowtime = now->tv_sec;
4539 struct rtc_time tm;
@@ -62,8 +56,7 @@ int mach_set_rtc_mmss(const struct timespec64 *now) · 16 unmodified lines
6256
6357 void mach_get_cmos_time(struct timespec64 *now)
6458 {
65− unsigned int status, year, mon, day, hour, min, sec, century = 0;
66− unsigned long flags;
59+ struct rtc_time tm;
6760
6861 /*
6962 * If pm_trace abused the RTC as storage, set the timespec to 0,
@@ -74,51 +67,13 @@ void mach_get_cmos_time(struct timespec64 *now) · 4 unmodified lines
7467 return;
7568 }
7669
77− spin_lock_irqsave(&rtc_lock, flags);
78−
79− /*
80− * If UIP is clear, then we have >= 244 microseconds before
81− * RTC registers will be updated. Spec sheet says that this
82− * is the reliable way to read RTC - registers. If UIP is set
83− * then the register access might be invalid.
84− */
85− while ((CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
86− cpu_relax();
87−
88− sec = CMOS_READ(RTC_SECONDS);
89− min = CMOS_READ(RTC_MINUTES);
90− hour = CMOS_READ(RTC_HOURS);
91− day = CMOS_READ(RTC_DAY_OF_MONTH);
92− mon = CMOS_READ(RTC_MONTH);
93− year = CMOS_READ(RTC_YEAR);
94−
95−#ifdef CONFIG_ACPI
96− if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
97− acpi_gbl_FADT.century)
98− century = CMOS_READ(acpi_gbl_FADT.century);
99−#endif
100−
101− status = CMOS_READ(RTC_CONTROL);
102− WARN_ON_ONCE(RTC_ALWAYS_BCD && (status & RTC_DM_BINARY));
103−
104− spin_unlock_irqrestore(&rtc_lock, flags);
105−
106− if (RTC_ALWAYS_BCD || !(status & RTC_DM_BINARY)) {
107− sec = bcd2bin(sec);
108− min = bcd2bin(min);
109− hour = bcd2bin(hour);
110− day = bcd2bin(day);
111− mon = bcd2bin(mon);
112− year = bcd2bin(year);
70+ if (mc146818_get_time(&tm)) {
71+ pr_err("Unable to read current time from RTC\n");
72+ now->tv_sec = now->tv_nsec = 0;
73+ return;
11374 }
11475
115− if (century) {
116− century = bcd2bin(century);
117− year += century * 100;
118− } else
119− year += CMOS_YEARS_OFFS;
120−
121− now->tv_sec = mktime64(year, mon, day, hour, min, sec);
76+ now->tv_sec = rtc_tm_to_time64(&tm);
12277 now->tv_nsec = 0;
12378 }
12479
arch/x86/kernel/traps.c+3−1
@@ -63,6 +63,7 @@ · 62 unmodified lines
6363 #include <asm/insn-eval.h>
6464 #include <asm/vdso.h>
6565 #include <asm/tdx.h>
66+#include <asm/cfi.h>
6667
6768 #ifdef CONFIG_X86_64
6869 #include <asm/x86_init.h>
@@ -313,7 +314,8 @@ static noinstr bool handle_bug(struct pt_regs *regs) · 244 unmodified lines
313314 */
314315 if (regs->flags & X86_EFLAGS_IF)
315316 raw_local_irq_enable();
316− if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
317+ if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN ||
318+ handle_cfi_failure(regs) == BUG_TRAP_TYPE_WARN) {
317319 regs->ip += LEN_UD2;
318320 handled = true;
319321 }
arch/x86/kernel/x86_init.c+1−1
@@ -138,7 +138,7 @@ struct x86_platform_ops x86_platform __ro_after_init = { · 137 unmodified lines
138138 .calibrate_cpu = native_calibrate_cpu_early,
139139 .calibrate_tsc = native_calibrate_tsc,
140140 .get_wallclock = mach_get_cmos_time,
141− .set_wallclock = mach_set_rtc_mmss,
141+ .set_wallclock = mach_set_cmos_time,
142142 .iommu_shutdown = iommu_shutdown_noop,
143143 .is_untracked_pat_range = is_ISA_range,
144144 .nmi_init = default_nmi_init,
arch/x86/kvm/cpuid.c+0−2
@@ -902,8 +902,6 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 901 unmodified lines
902902 entry->edx = 0;
903903 }
904904 break;
905− case 9:
906− break;
907905 case 0xa: { /* Architectural Performance Monitoring */
908906 union cpuid10_eax eax;
909907 union cpuid10_edx edx;
arch/x86/kvm/vmx/nested.c+1−1
@@ -2570,7 +2570,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, · 2569 unmodified lines
25702570 * bits which we consider mandatory enabled.
25712571 * The CR0_READ_SHADOW is what L2 should have expected to read given
25722572 * the specifications by L1; It's not enough to take
2573− * vmcs12->cr0_read_shadow because on our cr0_guest_host_mask we we
2573+ * vmcs12->cr0_read_shadow because on our cr0_guest_host_mask we
25742574 * have more bits than L1 expected.
25752575 */
25762576 vmx_set_cr0(vcpu, vmcs12->guest_cr0);
arch/x86/lib/clear_page_64.S+138−0
@@ -1,5 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0-only */
22 #include <linux/linkage.h>
3+#include <asm/asm.h>
34 #include <asm/export.h>
45
56 /*
@@ -50,3 +51,140 @@ SYM_FUNC_START(clear_page_erms) · 44 unmodified lines
5051 RET
5152 SYM_FUNC_END(clear_page_erms)
5253 EXPORT_SYMBOL_GPL(clear_page_erms)
54+
55+/*
56+ * Default clear user-space.
57+ * Input:
58+ * rdi destination
59+ * rcx count
60+ *
61+ * Output:
62+ * rcx: uncleared bytes or 0 if successful.
63+ */
64+SYM_FUNC_START(clear_user_original)
65+ /*
66+ * Copy only the lower 32 bits of size as that is enough to handle the rest bytes,
67+ * i.e., no need for a 'q' suffix and thus a REX prefix.
68+ */
69+ mov %ecx,%eax
70+ shr $3,%rcx
71+ jz .Lrest_bytes
72+
73+ # do the qwords first
74+ .p2align 4
75+.Lqwords:
76+ movq $0,(%rdi)
77+ lea 8(%rdi),%rdi
78+ dec %rcx
79+ jnz .Lqwords
80+
81+.Lrest_bytes:
82+ and $7, %eax
83+ jz .Lexit
84+
85+ # now do the rest bytes
86+.Lbytes:
87+ movb $0,(%rdi)
88+ inc %rdi
89+ dec %eax
90+ jnz .Lbytes
91+
92+.Lexit:
93+ /*
94+ * %rax still needs to be cleared in the exception case because this function is called
95+ * from inline asm and the compiler expects %rax to be zero when exiting the inline asm,
96+ * in case it might reuse it somewhere.
97+ */
98+ xor %eax,%eax
99+ RET
100+
101+.Lqwords_exception:
102+ # convert remaining qwords back into bytes to return to caller
103+ shl $3, %rcx
104+ and $7, %eax
105+ add %rax,%rcx
106+ jmp .Lexit
107+
108+.Lbytes_exception:
109+ mov %eax,%ecx
110+ jmp .Lexit
111+
112+ _ASM_EXTABLE_UA(.Lqwords, .Lqwords_exception)
113+ _ASM_EXTABLE_UA(.Lbytes, .Lbytes_exception)
114+SYM_FUNC_END(clear_user_original)
115+EXPORT_SYMBOL(clear_user_original)
116+
117+/*
118+ * Alternative clear user-space when CPU feature X86_FEATURE_REP_GOOD is
119+ * present.
120+ * Input:
121+ * rdi destination
122+ * rcx count
123+ *
124+ * Output:
125+ * rcx: uncleared bytes or 0 if successful.
126+ */
127+SYM_FUNC_START(clear_user_rep_good)
128+ # call the original thing for less than a cacheline
129+ cmp $64, %rcx
130+ jb clear_user_original
131+
132+.Lprep:
133+ # copy lower 32-bits for rest bytes
134+ mov %ecx, %edx
135+ shr $3, %rcx
136+ jz .Lrep_good_rest_bytes
137+
138+.Lrep_good_qwords:
139+ rep stosq
140+
141+.Lrep_good_rest_bytes:
142+ and $7, %edx
143+ jz .Lrep_good_exit
144+
145+.Lrep_good_bytes:
146+ mov %edx, %ecx
147+ rep stosb
148+
149+.Lrep_good_exit:
150+ # see .Lexit comment above
151+ xor %eax, %eax
152+ RET
153+
154+.Lrep_good_qwords_exception:
155+ # convert remaining qwords back into bytes to return to caller
156+ shl $3, %rcx
157+ and $7, %edx
158+ add %rdx, %rcx
159+ jmp .Lrep_good_exit
160+
161+ _ASM_EXTABLE_UA(.Lrep_good_qwords, .Lrep_good_qwords_exception)
162+ _ASM_EXTABLE_UA(.Lrep_good_bytes, .Lrep_good_exit)
163+SYM_FUNC_END(clear_user_rep_good)
164+EXPORT_SYMBOL(clear_user_rep_good)
165+
166+/*
167+ * Alternative clear user-space when CPU feature X86_FEATURE_ERMS is present.
168+ * Input:
169+ * rdi destination
170+ * rcx count
171+ *
172+ * Output:
173+ * rcx: uncleared bytes or 0 if successful.
174+ *
175+ */
176+SYM_FUNC_START(clear_user_erms)
177+ # call the original thing for less than a cacheline
178+ cmp $64, %rcx
179+ jb clear_user_original
180+
181+.Lerms_bytes:
182+ rep stosb
183+
184+.Lerms_exit:
185+ xorl %eax,%eax
186+ RET
187+
188+ _ASM_EXTABLE_UA(.Lerms_bytes, .Lerms_exit)
189+SYM_FUNC_END(clear_user_erms)
190+EXPORT_SYMBOL(clear_user_erms)
arch/x86/lib/memcpy_64.S+2−1
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright 2002 Andi Kleen */
33
44 #include <linux/linkage.h>
5+#include <linux/cfi_types.h>
56 #include <asm/errno.h>
67 #include <asm/cpufeatures.h>
78 #include <asm/alternative.h>
@@ -27,7 +28,7 @@ · 19 unmodified lines
2728 * Output:
2829 * rax original destination
2930 */
30−SYM_FUNC_START(__memcpy)
31+SYM_TYPED_FUNC_START(__memcpy)
3132 ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
3233 "jmp memcpy_erms", X86_FEATURE_ERMS
3334
arch/x86/lib/usercopy_64.c+0−40
@@ -14,46 +14,6 @@ · 13 unmodified lines
1414 * Zero Userspace
1515 */
1616
17−unsigned long __clear_user(void __user *addr, unsigned long size)
18−{
19− long __d0;
20− might_fault();
21− /* no memory constraint because it doesn't change any memory gcc knows
22− about */
23− stac();
24− asm volatile(
25− " testq %[size8],%[size8]\n"
26− " jz 4f\n"
27− " .align 16\n"
28− "0: movq $0,(%[dst])\n"
29− " addq $8,%[dst]\n"
30− " decl %%ecx ; jnz 0b\n"
31− "4: movq %[size1],%%rcx\n"
32− " testl %%ecx,%%ecx\n"
33− " jz 2f\n"
34− "1: movb $0,(%[dst])\n"
35− " incq %[dst]\n"
36− " decl %%ecx ; jnz 1b\n"
37− "2:\n"
38−
39− _ASM_EXTABLE_TYPE_REG(0b, 2b, EX_TYPE_UCOPY_LEN8, %[size1])
40− _ASM_EXTABLE_UA(1b, 2b)
41−
42− : [size8] "=&c"(size), [dst] "=&D" (__d0)
43− : [size1] "r"(size & 7), "[size8]" (size / 8), "[dst]"(addr));
44− clac();
45− return size;
46−}
47−EXPORT_SYMBOL(__clear_user);
48−
49−unsigned long clear_user(void __user *to, unsigned long n)
50−{
51− if (access_ok(to, n))
52− return __clear_user(to, n);
53− return n;
54−}
55−EXPORT_SYMBOL(clear_user);
56−
5717 #ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
5818 /**
5919 * clean_cache_range - write back a cache range with CLWB
arch/x86/mm/fault.c+10−0
@@ -769,6 +769,8 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code, · 768 unmodified lines
769769 unsigned long address, struct task_struct *tsk)
770770 {
771771 const char *loglvl = task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG;
772+ /* This is a racy snapshot, but it's better than nothing. */
773+ int cpu = raw_smp_processor_id();
772774
773775 if (!unhandled_signal(tsk, SIGSEGV))
774776 return;
@@ -782,6 +784,14 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code, · 7 unmodified lines
782784
783785 print_vma_addr(KERN_CONT " in ", regs->ip);
784786
787+ /*
788+ * Dump the likely CPU where the fatal segfault happened.
789+ * This can help identify faulty hardware.
790+ */
791+ printk(KERN_CONT " likely on CPU %d (core %d, socket %d)", cpu,
792+ topology_core_id(cpu), topology_physical_package_id(cpu));
793+
794+
785795 printk(KERN_CONT "\n");
786796
787797 show_opcodes(regs, loglvl);
arch/x86/net/bpf_jit_comp.c+70−32
@@ -419,7 +419,9 @@ static void emit_indirect_jump(u8 **pprog, int reg, u8 *ip) · 418 unmodified lines
419419 OPTIMIZER_HIDE_VAR(reg);
420420 emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip);
421421 } else {
422− EMIT2(0xFF, 0xE0 + reg);
422+ EMIT2(0xFF, 0xE0 + reg); /* jmp *%\reg */
423+ if (IS_ENABLED(CONFIG_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
424+ EMIT1(0xCC); /* int3 */
423425 }
424426
425427 *pprog = prog;
@@ -662,7 +664,7 @@ static void emit_mov_imm64(u8 **pprog, u32 dst_reg, · 236 unmodified lines
662664 */
663665 emit_mov_imm32(&prog, false, dst_reg, imm32_lo);
664666 } else {
665− /* movabsq %rax, imm64 */
667+ /* movabsq rax, imm64 */
666668 EMIT2(add_1mod(0x48, dst_reg), add_1reg(0xB8, dst_reg));
667669 EMIT(imm32_lo, 4);
668670 EMIT(imm32_hi, 4);
@@ -1751,34 +1753,60 @@ emit_jmp: · 1082 unmodified lines
17511753 static void save_regs(const struct btf_func_model *m, u8 **prog, int nr_args,
17521754 int stack_size)
17531755 {
1754− int i;
1756+ int i, j, arg_size, nr_regs;
17551757 /* Store function arguments to stack.
17561758 * For a function that accepts two pointers the sequence will be:
17571759 * mov QWORD PTR [rbp-0x10],rdi
17581760 * mov QWORD PTR [rbp-0x8],rsi
17591761 */
1760− for (i = 0; i < min(nr_args, 6); i++)
1761− emit_stx(prog, bytes_to_bpf_size(m->arg_size[i]),
1762− BPF_REG_FP,
1763− i == 5 ? X86_REG_R9 : BPF_REG_1 + i,
1764− -(stack_size - i * 8));
1762+ for (i = 0, j = 0; i < min(nr_args, 6); i++) {
1763+ if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG) {
1764+ nr_regs = (m->arg_size[i] + 7) / 8;
1765+ arg_size = 8;
1766+ } else {
1767+ nr_regs = 1;
1768+ arg_size = m->arg_size[i];
1769+ }
1770+
1771+ while (nr_regs) {
1772+ emit_stx(prog, bytes_to_bpf_size(arg_size),
1773+ BPF_REG_FP,
1774+ j == 5 ? X86_REG_R9 : BPF_REG_1 + j,
1775+ -(stack_size - j * 8));
1776+ nr_regs--;
1777+ j++;
1778+ }
1779+ }
17651780 }
17661781
17671782 static void restore_regs(const struct btf_func_model *m, u8 **prog, int nr_args,
17681783 int stack_size)
17691784 {
1770− int i;
1785+ int i, j, arg_size, nr_regs;
17711786
17721787 /* Restore function arguments from stack.
17731788 * For a function that accepts two pointers the sequence will be:
17741789 * EMIT4(0x48, 0x8B, 0x7D, 0xF0); mov rdi,QWORD PTR [rbp-0x10]
17751790 * EMIT4(0x48, 0x8B, 0x75, 0xF8); mov rsi,QWORD PTR [rbp-0x8]
17761791 */
1777− for (i = 0; i < min(nr_args, 6); i++)
1778− emit_ldx(prog, bytes_to_bpf_size(m->arg_size[i]),
1779− i == 5 ? X86_REG_R9 : BPF_REG_1 + i,
1780− BPF_REG_FP,
1781− -(stack_size - i * 8));
1792+ for (i = 0, j = 0; i < min(nr_args, 6); i++) {
1793+ if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG) {
1794+ nr_regs = (m->arg_size[i] + 7) / 8;
1795+ arg_size = 8;
1796+ } else {
1797+ nr_regs = 1;
1798+ arg_size = m->arg_size[i];
1799+ }
1800+
1801+ while (nr_regs) {
1802+ emit_ldx(prog, bytes_to_bpf_size(arg_size),
1803+ j == 5 ? X86_REG_R9 : BPF_REG_1 + j,
1804+ BPF_REG_FP,
1805+ -(stack_size - j * 8));
1806+ nr_regs--;
1807+ j++;
1808+ }
1809+ }
17821810 }
17831811
17841812 static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog,
@@ -1810,6 +1838,9 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog, · 25 unmodified lines
18101838 if (p->aux->sleepable) {
18111839 enter = __bpf_prog_enter_sleepable;
18121840 exit = __bpf_prog_exit_sleepable;
1841+ } else if (p->type == BPF_PROG_TYPE_STRUCT_OPS) {
1842+ enter = __bpf_prog_enter_struct_ops;
1843+ exit = __bpf_prog_exit_struct_ops;
18131844 } else if (p->expected_attach_type == BPF_LSM_CGROUP) {
18141845 enter = __bpf_prog_enter_lsm_cgroup;
18151846 exit = __bpf_prog_exit_lsm_cgroup;
@@ -2013,13 +2044,14 @@ static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog, · 197 unmodified lines
20132044 int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,
20142045 const struct btf_func_model *m, u32 flags,
20152046 struct bpf_tramp_links *tlinks,
2016− void *orig_call)
2047+ void *func_addr)
20172048 {
2018− int ret, i, nr_args = m->nr_args;
2049+ int ret, i, nr_args = m->nr_args, extra_nregs = 0;
20192050 int regs_off, ip_off, args_off, stack_size = nr_args * 8, run_ctx_off;
20202051 struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
20212052 struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
20222053 struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
2054+ void *orig_call = func_addr;
20232055 u8 **branches = NULL;
20242056 u8 *prog;
20252057 bool save_ret;
@@ -2028,6 +2060,14 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i · 2 unmodified lines
20282060 if (nr_args > 6)
20292061 return -ENOTSUPP;
20302062
2063+ for (i = 0; i < MAX_BPF_FUNC_ARGS; i++) {
2064+ if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
2065+ extra_nregs += (m->arg_size[i] + 7) / 8 - 1;
2066+ }
2067+ if (nr_args + extra_nregs > 6)
2068+ return -ENOTSUPP;
2069+ stack_size += extra_nregs * 8;
2070+
20312071 /* Generated trampoline stack layout:
20322072 *
20332073 * RBP + 8 [ return address ]
@@ -2040,7 +2080,7 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i · 6 unmodified lines
20402080 * [ ... ]
20412081 * RBP - regs_off [ reg_arg1 ] program's ctx pointer
20422082 *
2043− * RBP - args_off [ args count ] always
2083+ * RBP - args_off [ arg regs count ] always
20442084 *
20452085 * RBP - ip_off [ traced function ] BPF_TRAMP_F_IP_ARG flag
20462086 *
@@ -2083,21 +2123,19 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i · 36 unmodified lines
20832123 EMIT4(0x48, 0x83, 0xEC, stack_size); /* sub rsp, stack_size */
20842124 EMIT1(0x53); /* push rbx */
20852125
2086− /* Store number of arguments of the traced function:
2087− * mov rax, nr_args
2126+ /* Store number of argument registers of the traced function:
2127+ * mov rax, nr_args + extra_nregs
20882128 * mov QWORD PTR [rbp - args_off], rax
20892129 */
2090− emit_mov_imm64(&prog, BPF_REG_0, 0, (u32) nr_args);
2130+ emit_mov_imm64(&prog, BPF_REG_0, 0, (u32) nr_args + extra_nregs);
20912131 emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -args_off);
20922132
20932133 if (flags & BPF_TRAMP_F_IP_ARG) {
20942134 /* Store IP address of the traced function:
2095− * mov rax, QWORD PTR [rbp + 8]
2096− * sub rax, X86_PATCH_SIZE
2135+ * movabsq rax, func_addr
20972136 * mov QWORD PTR [rbp - ip_off], rax
20982137 */
2099− emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, 8);
2100− EMIT4(0x48, 0x83, 0xe8, X86_PATCH_SIZE);
2138+ emit_mov_imm64(&prog, BPF_REG_0, (long) func_addr >> 32, (u32) (long) func_addr);
21012139 emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -ip_off);
21022140 }
21032141
@@ -2209,7 +2247,7 @@ cleanup: · 105 unmodified lines
22092247 return ret;
22102248 }
22112249
2212−static int emit_bpf_dispatcher(u8 **pprog, int a, int b, s64 *progs)
2250+static int emit_bpf_dispatcher(u8 **pprog, int a, int b, s64 *progs, u8 *image, u8 *buf)
22132251 {
22142252 u8 *jg_reloc, *prog = *pprog;
22152253 int pivot, err, jg_bytes = 1;
@@ -2225,12 +2263,12 @@ static int emit_bpf_dispatcher(u8 **pprog, int a, int b, s64 *progs) · 9 unmodified lines
22252263 EMIT2_off32(0x81, add_1reg(0xF8, BPF_REG_3),
22262264 progs[a]);
22272265 err = emit_cond_near_jump(&prog, /* je func */
2228− (void *)progs[a], prog,
2266+ (void *)progs[a], image + (prog - buf),
22292267 X86_JE);
22302268 if (err)
22312269 return err;
22322270
2233− emit_indirect_jump(&prog, 2 /* rdx */, prog);
2271+ emit_indirect_jump(&prog, 2 /* rdx */, image + (prog - buf));
22342272
22352273 *pprog = prog;
22362274 return 0;
@@ -2255,7 +2293,7 @@ static int emit_bpf_dispatcher(u8 **pprog, int a, int b, s64 *progs) · 18 unmodified lines
22552293 jg_reloc = prog;
22562294
22572295 err = emit_bpf_dispatcher(&prog, a, a + pivot, /* emit lower_part */
2258− progs);
2296+ progs, image, buf);
22592297 if (err)
22602298 return err;
22612299
@@ -2269,7 +2307,7 @@ static int emit_bpf_dispatcher(u8 **pprog, int a, int b, s64 *progs) · 7 unmodified lines
22692307 emit_code(jg_reloc - jg_bytes, jg_offset, jg_bytes);
22702308
22712309 err = emit_bpf_dispatcher(&prog, a + pivot + 1, /* emit upper_part */
2272− b, progs);
2310+ b, progs, image, buf);
22732311 if (err)
22742312 return err;
22752313
@@ -2289,12 +2327,12 @@ static int cmp_ips(const void *a, const void *b) · 13 unmodified lines
22892327 return 0;
22902328 }
22912329
2292−int arch_prepare_bpf_dispatcher(void *image, s64 *funcs, int num_funcs)
2330+int arch_prepare_bpf_dispatcher(void *image, void *buf, s64 *funcs, int num_funcs)
22932331 {
2294− u8 *prog = image;
2332+ u8 *prog = buf;
22952333
22962334 sort(funcs, num_funcs, sizeof(funcs[0]), cmp_ips, NULL);
2297− return emit_bpf_dispatcher(&prog, 0, num_funcs - 1, funcs);
2335+ return emit_bpf_dispatcher(&prog, 0, num_funcs - 1, funcs, image, buf);
22982336 }
22992337
23002338 struct x64_jit_data {
arch/x86/platform/efi/efi.c+1−1
@@ -169,7 +169,7 @@ static void __init do_add_efi_memmap(void) · 168 unmodified lines
169169 }
170170
171171 /*
172− * Given add_efi_memmap defaults to 0 and there there is no alternative
172+ * Given add_efi_memmap defaults to 0 and there is no alternative
173173 * e820 mechanism for soft-reserved memory, import the full EFI memory
174174 * map if soft reservations are present and enabled. Otherwise, the
175175 * mechanism to disable the kernel's consideration of EFI_MEMORY_SP is
arch/x86/purgatory/Makefile+4−0
@@ -55,6 +55,10 @@ ifdef CONFIG_RETPOLINE · 54 unmodified lines
5555 PURGATORY_CFLAGS_REMOVE += $(RETPOLINE_CFLAGS)
5656 endif
5757
58+ifdef CONFIG_CFI_CLANG
59+PURGATORY_CFLAGS_REMOVE += $(CC_FLAGS_CFI)
60+endif
61+
5862 CFLAGS_REMOVE_purgatory.o += $(PURGATORY_CFLAGS_REMOVE)
5963 CFLAGS_purgatory.o += $(PURGATORY_CFLAGS)
6064
arch/x86/tools/relocs.c+1−0
@@ -56,6 +56,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { · 55 unmodified lines
5656 "^(xen_irq_disable_direct_reloc$|"
5757 "xen_save_fl_direct_reloc$|"
5858 "VDSO|"
59+ "__kcfi_typeid_|"
5960 "__crc_)",
6061
6162 /*
arch/x86/xen/enlighten_pv.c+2−1
@@ -765,6 +765,7 @@ static void xen_load_idt(const struct desc_ptr *desc) · 764 unmodified lines
765765 {
766766 static DEFINE_SPINLOCK(lock);
767767 static struct trap_info traps[257];
768+ static const struct trap_info zero = { };
768769 unsigned out;
769770
770771 trace_xen_cpu_load_idt(desc);
@@ -774,7 +775,7 @@ static void xen_load_idt(const struct desc_ptr *desc) · 3 unmodified lines
774775 memcpy(this_cpu_ptr(&idt_desc), desc, sizeof(idt_desc));
775776
776777 out = xen_convert_trap_info(desc, traps, false);
777− memset(&traps[out], 0, sizeof(traps[0]));
778+ traps[out] = zero;
778779
779780 xen_mc_flush();
780781 if (HYPERVISOR_set_trap_table(traps))
block/bdev.c+23−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/namei.h>
2727 #include <linux/part_stat.h>
2828 #include <linux/uaccess.h>
29+#include <linux/stat.h>
2930 #include "../fs/internal.h"
3031 #include "blk.h"
3132
@@ -1069,3 +1070,25 @@ void sync_bdevs(bool wait) · 1037 unmodified lines
10691070 spin_unlock(&blockdev_superblock->s_inode_list_lock);
10701071 iput(old_inode);
10711072 }
1073+
1074+/*
1075+ * Handle STATX_DIOALIGN for block devices.
1076+ *
1077+ * Note that the inode passed to this is the inode of a block device node file,
1078+ * not the block device's internal inode. Therefore it is *not* valid to use
1079+ * I_BDEV() here; the block device has to be looked up by i_rdev instead.
1080+ */
1081+void bdev_statx_dioalign(struct inode *inode, struct kstat *stat)
1082+{
1083+ struct block_device *bdev;
1084+
1085+ bdev = blkdev_get_no_open(inode->i_rdev);
1086+ if (!bdev)
1087+ return;
1088+
1089+ stat->dio_mem_align = bdev_dma_alignment(bdev) + 1;
1090+ stat->dio_offset_align = bdev_logical_block_size(bdev);
1091+ stat->result_mask |= STATX_DIOALIGN;
1092+
1093+ blkdev_put_no_open(bdev);
1094+}
drivers/acpi/Kconfig+0−4
@@ -27,9 +27,6 @@ menuconfig ACPI · 26 unmodified lines
2727 Management (APM) specification. If both ACPI and APM support
2828 are configured, ACPI is used.
2929
30− The project home page for the Linux ACPI subsystem is here:
31− <https://01.org/linux-acpi>
32−
3330 Linux support for ACPI is based on Intel Corporation's ACPI
3431 Component Architecture (ACPI CA). For more information on the
3532 ACPI CA, see:
@@ -347,7 +344,6 @@ config ACPI_CUSTOM_DSDT_FILE · 311 unmodified lines
347344 depends on !STANDALONE
348345 help
349346 This option supports a custom DSDT by linking it into the kernel.
350− See Documentation/admin-guide/acpi/dsdt-override.rst
351347
352348 Enter the full path name to the file which includes the AmlCode
353349 or dsdt_aml_code declaration.
drivers/acpi/ac.c+0−5
@@ -36,11 +36,6 @@ static int acpi_ac_add(struct acpi_device *device); · 35 unmodified lines
3636 static int acpi_ac_remove(struct acpi_device *device);
3737 static void acpi_ac_notify(struct acpi_device *device, u32 event);
3838
39−struct acpi_ac_bl {
40− const char *hid;
41− int hrv;
42−};
43−
4439 static const struct acpi_device_id ac_device_ids[] = {
4540 {"ACPI0003", 0},
4641 {"", 0},
drivers/acpi/acpi_amba.c+4−2
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 static const struct acpi_device_id amba_id_list[] = {
2323 {"ARMH0061", 0}, /* PL061 GPIO Device */
24+ {"ARMH0330", 0}, /* ARM DMA Controller DMA-330 */
2425 {"ARMHC500", 0}, /* ARM CoreSight ETM4x */
2526 {"ARMHC501", 0}, /* ARM CoreSight ETR */
2627 {"ARMHC502", 0}, /* ARM CoreSight STM */
@@ -48,6 +49,7 @@ static void amba_register_dummy_clk(void) · 21 unmodified lines
4849 static int amba_handler_attach(struct acpi_device *adev,
4950 const struct acpi_device_id *id)
5051 {
52+ struct acpi_device *parent = acpi_dev_parent(adev);
5153 struct amba_device *dev;
5254 struct resource_entry *rentry;
5355 struct list_head resource_list;
@@ -97,8 +99,8 @@ static int amba_handler_attach(struct acpi_device *adev, · 43 unmodified lines
9799 * attached to it, that physical device should be the parent of
98100 * the amba device we are about to create.
99101 */
100− if (adev->parent)
101− dev->dev.parent = acpi_get_first_physical_node(adev->parent);
102+ if (parent)
103+ dev->dev.parent = acpi_get_first_physical_node(parent);
102104
103105 ACPI_COMPANION_SET(&dev->dev, adev);
104106
drivers/acpi/acpi_apd.c+1−8
@@ -60,12 +60,6 @@ static int acpi_apd_setup(struct apd_private_data *pdata) · 59 unmodified lines
6060 }
6161
6262 #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
63−static int misc_check_res(struct acpi_resource *ares, void *data)
64−{
65− struct resource res;
66−
67− return !acpi_dev_resource_memory(ares, &res);
68−}
6963
7064 static int fch_misc_setup(struct apd_private_data *pdata)
7165 {
@@ -82,8 +76,7 @@ static int fch_misc_setup(struct apd_private_data *pdata) · 10 unmodified lines
8276 return -ENOMEM;
8377
8478 INIT_LIST_HEAD(&resource_list);
85− ret = acpi_dev_get_resources(adev, &resource_list, misc_check_res,
86− NULL);
79+ ret = acpi_dev_get_memory_resources(adev, &resource_list);
8780 if (ret < 0)
8881 return -ENOENT;
8982
drivers/acpi/acpi_fpdt.c+22−0
@@ -143,6 +143,23 @@ static const struct attribute_group boot_attr_group = { · 142 unmodified lines
143143
144144 static struct kobject *fpdt_kobj;
145145
146+#if defined CONFIG_X86 && defined CONFIG_PHYS_ADDR_T_64BIT
147+#include <linux/processor.h>
148+static bool fpdt_address_valid(u64 address)
149+{
150+ /*
151+ * On some systems the table contains invalid addresses
152+ * with unsuppored high address bits set, check for this.
153+ */
154+ return !(address >> boot_cpu_data.x86_phys_bits);
155+}
156+#else
157+static bool fpdt_address_valid(u64 address)
158+{
159+ return true;
160+}
161+#endif
162+
146163 static int fpdt_process_subtable(u64 address, u32 subtable_type)
147164 {
148165 struct fpdt_subtable_header *subtable_header;
@@ -151,6 +168,11 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type) · 2 unmodified lines
151168 u32 length, offset;
152169 int result;
153170
171+ if (!fpdt_address_valid(address)) {
172+ pr_info(FW_BUG "invalid physical address: 0x%llx!\n", address);
173+ return -EINVAL;
174+ }
175+
154176 subtable_header = acpi_os_map_memory(address, sizeof(*subtable_header));
155177 if (!subtable_header)
156178 return -ENOMEM;
drivers/acpi/acpi_lpss.c+29−40
@@ -167,10 +167,10 @@ static struct pwm_lookup byt_pwm_lookup[] = { · 166 unmodified lines
167167
168168 static void byt_pwm_setup(struct lpss_private_data *pdata)
169169 {
170− struct acpi_device *adev = pdata->adev;
170+ u64 uid;
171171
172172 /* Only call pwm_add_table for the first PWM controller */
173− if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
173+ if (acpi_dev_uid_to_integer(pdata->adev, &uid) || uid != 1)
174174 return;
175175
176176 pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup));
@@ -180,14 +180,13 @@ static void byt_pwm_setup(struct lpss_private_data *pdata) · 3 unmodified lines
180180
181181 static void byt_i2c_setup(struct lpss_private_data *pdata)
182182 {
183− const char *uid_str = acpi_device_uid(pdata->adev);
184183 acpi_handle handle = pdata->adev->handle;
185184 unsigned long long shared_host = 0;
186185 acpi_status status;
187− long uid = 0;
186+ u64 uid;
188187
189− /* Expected to always be true, but better safe then sorry */
190− if (uid_str && !kstrtol(uid_str, 10, &uid) && uid) {
188+ /* Expected to always be successfull, but better safe then sorry */
189+ if (!acpi_dev_uid_to_integer(pdata->adev, &uid) && uid) {
191190 /* Detect I2C bus shared with PUNIT and ignore its d3 status */
192191 status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host);
193192 if (ACPI_SUCCESS(status) && shared_host)
@@ -211,10 +210,10 @@ static struct pwm_lookup bsw_pwm_lookup[] = { · 17 unmodified lines
211210
212211 static void bsw_pwm_setup(struct lpss_private_data *pdata)
213212 {
214− struct acpi_device *adev = pdata->adev;
213+ u64 uid;
215214
216215 /* Only call pwm_add_table for the first PWM controller */
217− if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
216+ if (acpi_dev_uid_to_integer(pdata->adev, &uid) || uid != 1)
218217 return;
219218
220219 pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup));
@@ -392,13 +391,6 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = { · 171 unmodified lines
392391
393392 #ifdef CONFIG_X86_INTEL_LPSS
394393
395−static int is_memory(struct acpi_resource *res, void *not_used)
396−{
397− struct resource r;
398−
399− return !acpi_dev_resource_memory(res, &r);
400−}
401−
402394 /* LPSS main clock device. */
403395 static struct platform_device *lpss_clk_dev;
404396
@@ -659,29 +651,25 @@ static int acpi_lpss_create_device(struct acpi_device *adev, · 254 unmodified lines
659651 return -ENOMEM;
660652
661653 INIT_LIST_HEAD(&resource_list);
662− ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL);
654+ ret = acpi_dev_get_memory_resources(adev, &resource_list);
663655 if (ret < 0)
664656 goto err_out;
665657
666− list_for_each_entry(rentry, &resource_list, node)
667− if (resource_type(rentry->res) == IORESOURCE_MEM) {
668− if (dev_desc->prv_size_override)
669− pdata->mmio_size = dev_desc->prv_size_override;
670− else
671− pdata->mmio_size = resource_size(rentry->res);
672− pdata->mmio_base = ioremap(rentry->res->start,
673− pdata->mmio_size);
674− break;
675− }
658+ rentry = list_first_entry_or_null(&resource_list, struct resource_entry, node);
659+ if (rentry) {
660+ if (dev_desc->prv_size_override)
661+ pdata->mmio_size = dev_desc->prv_size_override;
662+ else
663+ pdata->mmio_size = resource_size(rentry->res);
664+ pdata->mmio_base = ioremap(rentry->res->start, pdata->mmio_size);
665+ }
676666
677667 acpi_dev_free_resource_list(&resource_list);
678668
679669 if (!pdata->mmio_base) {
680670 /* Avoid acpi_bus_attach() instantiating a pdev for this dev. */
681671 adev->pnp.type.platform_id = 0;
682− /* Skip the device, but continue the namespace scan. */
683− ret = 0;
684− goto err_out;
672+ goto out_free;
685673 }
686674
687675 pdata->adev = adev;
@@ -692,11 +680,8 @@ static int acpi_lpss_create_device(struct acpi_device *adev, · 4 unmodified lines
692680
693681 if (dev_desc->flags & LPSS_CLK) {
694682 ret = register_device_clock(adev, pdata);
695− if (ret) {
696− /* Skip the device, but continue the namespace scan. */
697− ret = 0;
698− goto err_out;
699− }
683+ if (ret)
684+ goto out_free;
700685 }
701686
702687 /*
@@ -708,15 +693,19 @@ static int acpi_lpss_create_device(struct acpi_device *adev, · 5 unmodified lines
708693
709694 adev->driver_data = pdata;
710695 pdev = acpi_create_platform_device(adev, dev_desc->properties);
711− if (!IS_ERR_OR_NULL(pdev)) {
712− acpi_lpss_create_device_links(adev, pdev);
713− return 1;
696+ if (IS_ERR_OR_NULL(pdev)) {
697+ adev->driver_data = NULL;
698+ ret = PTR_ERR(pdev);
699+ goto err_out;
714700 }
715701
716− ret = PTR_ERR(pdev);
717− adev->driver_data = NULL;
702+ acpi_lpss_create_device_links(adev, pdev);
703+ return 1;
718704
719− err_out:
705+out_free:
706+ /* Skip the device, but continue the namespace scan */
707+ ret = 0;
708+err_out:
720709 kfree(pdata);
721710 return ret;
722711 }
drivers/acpi/acpi_pcc.c+25−3
@@ -23,6 +23,12 @@ · 22 unmodified lines
2323
2424 #include <acpi/pcc.h>
2525
26+/*
27+ * Arbitrary retries in case the remote processor is slow to respond
28+ * to PCC commands
29+ */
30+#define PCC_CMD_WAIT_RETRIES_NUM 500
31+
2632 struct pcc_data {
2733 struct pcc_mbox_chan *pcc_chan;
2834 void __iomem *pcc_comm_addr;
@@ -63,6 +69,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, · 34 unmodified lines
6369 if (IS_ERR(data->pcc_chan)) {
6470 pr_err("Failed to find PCC channel for subspace %d\n",
6571 ctx->subspace_id);
72+ kfree(data);
6673 return AE_NOT_FOUND;
6774 }
6875
@@ -72,6 +79,8 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, · 3 unmodified lines
7279 if (!data->pcc_comm_addr) {
7380 pr_err("Failed to ioremap PCC comm region mem for %d\n",
7481 ctx->subspace_id);
82+ pcc_mbox_free_channel(data->pcc_chan);
83+ kfree(data);
7584 return AE_NO_MEMORY;
7685 }
7786
@@ -86,6 +95,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr, · 8 unmodified lines
8695 {
8796 int ret;
8897 struct pcc_data *data = region_context;
98+ u64 usecs_lat;
8999
90100 reinit_completion(&data->done);
91101
@@ -96,10 +106,22 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr, · 4 unmodified lines
96106 if (ret < 0)
97107 return AE_ERROR;
98108
99− if (data->pcc_chan->mchan->mbox->txdone_irq)
100− wait_for_completion(&data->done);
109+ if (data->pcc_chan->mchan->mbox->txdone_irq) {
110+ /*
111+ * pcc_chan->latency is just a Nominal value. In reality the remote
112+ * processor could be much slower to reply. So add an arbitrary
113+ * amount of wait on top of Nominal.
114+ */
115+ usecs_lat = PCC_CMD_WAIT_RETRIES_NUM * data->pcc_chan->latency;
116+ ret = wait_for_completion_timeout(&data->done,
117+ usecs_to_jiffies(usecs_lat));
118+ if (ret == 0) {
119+ pr_err("PCC command executed timeout!\n");
120+ return AE_TIME;
121+ }
122+ }
101123
102− mbox_client_txdone(data->pcc_chan->mchan, ret);
124+ mbox_chan_txdone(data->pcc_chan->mchan, ret);
103125
104126 memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length);
105127
drivers/acpi/acpi_platform.c+10−12
@@ -20,13 +20,13 @@ · 19 unmodified lines
2020 #include "internal.h"
2121
2222 static const struct acpi_device_id forbidden_id_list[] = {
23+ {"ACPI0009", 0}, /* IOxAPIC */
24+ {"ACPI000A", 0}, /* IOAPIC */
2325 {"PNP0000", 0}, /* PIC */
2426 {"PNP0100", 0}, /* Timer */
2527 {"PNP0200", 0}, /* AT DMA Controller */
26− {"ACPI0009", 0}, /* IOxAPIC */
27− {"ACPI000A", 0}, /* IOAPIC */
2828 {"SMB0001", 0}, /* ACPI SMBUS virtual device */
29− {"", 0},
29+ { }
3030 };
3131
3232 static struct platform_device *acpi_platform_device_find_by_companion(struct acpi_device *adev)
@@ -78,7 +78,7 @@ static void acpi_platform_fill_resource(struct acpi_device *adev, · 45 unmodified lines
7878 * If the device has parent we need to take its resources into
7979 * account as well because this device might consume part of those.
8080 */
81− parent = acpi_get_first_physical_node(adev->parent);
81+ parent = acpi_get_first_physical_node(acpi_dev_parent(adev));
8282 if (parent && dev_is_pci(parent))
8383 dest->parent = pci_find_resource(to_pci_dev(parent), dest);
8484 }
@@ -97,6 +97,7 @@ static void acpi_platform_fill_resource(struct acpi_device *adev, · 12 unmodified lines
9797 struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
9898 const struct property_entry *properties)
9999 {
100+ struct acpi_device *parent = acpi_dev_parent(adev);
100101 struct platform_device *pdev = NULL;
101102 struct platform_device_info pdevinfo;
102103 struct resource_entry *rentry;
@@ -113,13 +114,11 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, · 10 unmodified lines
113114
114115 INIT_LIST_HEAD(&resource_list);
115116 count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
116− if (count < 0) {
117+ if (count < 0)
117118 return NULL;
118− } else if (count > 0) {
119− resources = kcalloc(count, sizeof(struct resource),
120− GFP_KERNEL);
119+ if (count > 0) {
120+ resources = kcalloc(count, sizeof(*resources), GFP_KERNEL);
121121 if (!resources) {
122− dev_err(&adev->dev, "No memory for resources\n");
123122 acpi_dev_free_resource_list(&resource_list);
124123 return ERR_PTR(-ENOMEM);
125124 }
@@ -137,10 +136,9 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, · 11 unmodified lines
137136 * attached to it, that physical device should be the parent of the
138137 * platform device we are about to create.
139138 */
140− pdevinfo.parent = adev->parent ?
141− acpi_get_first_physical_node(adev->parent) : NULL;
139+ pdevinfo.parent = parent ? acpi_get_first_physical_node(parent) : NULL;
142140 pdevinfo.name = dev_name(&adev->dev);
143− pdevinfo.id = -1;
141+ pdevinfo.id = PLATFORM_DEVID_NONE;
144142 pdevinfo.res = resources;
145143 pdevinfo.num_res = count;
146144 pdevinfo.fwnode = acpi_fwnode_handle(adev);
drivers/acpi/acpi_video.c+17−1
@@ -496,6 +496,22 @@ static const struct dmi_system_id video_dmi_table[] = { · 495 unmodified lines
496496 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE R830"),
497497 },
498498 },
499+ {
500+ .callback = video_disable_backlight_sysfs_if,
501+ .ident = "Toshiba Satellite Z830",
502+ .matches = {
503+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
504+ DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE Z830"),
505+ },
506+ },
507+ {
508+ .callback = video_disable_backlight_sysfs_if,
509+ .ident = "Toshiba Portege Z830",
510+ .matches = {
511+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
512+ DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE Z830"),
513+ },
514+ },
499515 /*
500516 * Some machine's _DOD IDs don't have bit 31(Device ID Scheme) set
501517 * but the IDs actually follow the Device ID Scheme.
@@ -2030,7 +2046,7 @@ static int acpi_video_bus_add(struct acpi_device *device) · 1528 unmodified lines
20302046 acpi_status status;
20312047
20322048 status = acpi_walk_namespace(ACPI_TYPE_DEVICE,
2033− device->parent->handle, 1,
2049+ acpi_dev_parent(device)->handle, 1,
20342050 acpi_video_bus_match, NULL,
20352051 device, NULL);
20362052 if (status == AE_ALREADY_EXISTS) {
drivers/acpi/apei/apei-base.c+1−4
@@ -125,12 +125,9 @@ EXPORT_SYMBOL_GPL(apei_exec_write_register); · 124 unmodified lines
125125 int apei_exec_write_register_value(struct apei_exec_context *ctx,
126126 struct acpi_whea_header *entry)
127127 {
128− int rc;
129−
130128 ctx->value = entry->value;
131− rc = apei_exec_write_register(ctx, entry);
132129
133− return rc;
130+ return apei_exec_write_register(ctx, entry);
134131 }
135132 EXPORT_SYMBOL_GPL(apei_exec_write_register_value);
136133
drivers/acpi/apei/bert.c+3−0
@@ -90,6 +90,9 @@ static void __init bert_print_all(struct acpi_bert_region *region, · 89 unmodified lines
9090
9191 if (skipped)
9292 pr_info(HW_ERR "Skipped %d error records\n", skipped);
93+
94+ if (printed + skipped)
95+ pr_info("Total records found: %d\n", printed + skipped);
9396 }
9497
9598 static int __init setup_bert_disable(char *str)
drivers/acpi/apei/erst.c+1−5
@@ -1020,14 +1020,10 @@ static int reader_pos; · 1019 unmodified lines
10201020
10211021 static int erst_open_pstore(struct pstore_info *psi)
10221022 {
1023− int rc;
1024−
10251023 if (erst_disable)
10261024 return -ENODEV;
10271025
1028− rc = erst_get_record_id_begin(&reader_pos);
1029−
1030− return rc;
1026+ return erst_get_record_id_begin(&reader_pos);
10311027 }
10321028
10331029 static int erst_close_pstore(struct pstore_info *psi)
drivers/acpi/arm64/dma.c+17−11
@@ -4,11 +4,12 @@ · 3 unmodified lines
44 #include <linux/device.h>
55 #include <linux/dma-direct.h>
66
7−void acpi_arch_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size)
7+void acpi_arch_dma_setup(struct device *dev)
88 {
99 int ret;
1010 u64 end, mask;
11− u64 dmaaddr = 0, size = 0, offset = 0;
11+ u64 size = 0;
12+ const struct bus_dma_region *map = NULL;
1213
1314 /*
1415 * If @dev is expected to be DMA-capable then the bus code that created
@@ -26,7 +27,19 @@ void acpi_arch_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size) · 11 unmodified lines
2627 else
2728 size = 1ULL << 32;
2829
29− ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
30+ ret = acpi_dma_get_range(dev, &map);
31+ if (!ret && map) {
32+ const struct bus_dma_region *r = map;
33+
34+ for (end = 0; r->size; r++) {
35+ if (r->dma_start + r->size - 1 > end)
36+ end = r->dma_start + r->size - 1;
37+ }
38+
39+ size = end + 1;
40+ dev->dma_range_map = map;
41+ }
42+
3043 if (ret == -ENODEV)
3144 ret = iort_dma_get_ranges(dev, &size);
3245 if (!ret) {
@@ -34,17 +47,10 @@ void acpi_arch_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size) · 1 unmodified line
3447 * Limit coherent and dma mask based on size retrieved from
3548 * firmware.
3649 */
37− end = dmaaddr + size - 1;
50+ end = size - 1;
3851 mask = DMA_BIT_MASK(ilog2(end) + 1);
3952 dev->bus_dma_limit = end;
4053 dev->coherent_dma_mask = min(dev->coherent_dma_mask, mask);
4154 *dev->dma_mask = min(*dev->dma_mask, mask);
4255 }
43−
44− *dma_addr = dmaaddr;
45− *dma_size = size;
46−
47− ret = dma_direct_set_offset(dev, dmaaddr + offset, dmaaddr, size);
48−
49− dev_dbg(dev, "dma_offset(%#08llx)%s\n", offset, ret ? " failed!" : "");
5056 }
drivers/acpi/bus.c+17−20
@@ -456,7 +456,7 @@ out_free: · 455 unmodified lines
456456 Notification Handling
457457 -------------------------------------------------------------------------- */
458458
459−/**
459+/*
460460 * acpi_bus_notify
461461 * ---------------
462462 * Callback for all 'system-level' device notifications (values 0x00-0x7F).
@@ -511,7 +511,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) · 48 unmodified lines
511511 break;
512512 }
513513
514− adev = acpi_bus_get_acpi_device(handle);
514+ adev = acpi_get_acpi_dev(handle);
515515 if (!adev)
516516 goto err;
517517
@@ -524,14 +524,14 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) · 6 unmodified lines
524524 }
525525
526526 if (!hotplug_event) {
527− acpi_bus_put_acpi_device(adev);
527+ acpi_put_acpi_dev(adev);
528528 return;
529529 }
530530
531531 if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
532532 return;
533533
534− acpi_bus_put_acpi_device(adev);
534+ acpi_put_acpi_dev(adev);
535535
536536 err:
537537 acpi_evaluate_ost(handle, type, ost_code, NULL);
@@ -802,7 +802,7 @@ static bool acpi_of_modalias(struct acpi_device *adev, · 264 unmodified lines
802802
803803 str = obj->string.pointer;
804804 chr = strchr(str, ',');
805− strlcpy(modalias, chr ? chr + 1 : str, len);
805+ strscpy(modalias, chr ? chr + 1 : str, len);
806806
807807 return true;
808808 }
@@ -822,7 +822,7 @@ void acpi_set_modalias(struct acpi_device *adev, const char *default_id, · 13 unmodified lines
822822 char *modalias, size_t len)
823823 {
824824 if (!acpi_of_modalias(adev, modalias, len))
825− strlcpy(modalias, default_id, len);
825+ strscpy(modalias, default_id, len);
826826 }
827827 EXPORT_SYMBOL_GPL(acpi_set_modalias);
828828
@@ -925,12 +925,13 @@ static const void *acpi_of_device_get_match_data(const struct device *dev) · 96 unmodified lines
925925
926926 const void *acpi_device_get_match_data(const struct device *dev)
927927 {
928+ const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table;
928929 const struct acpi_device_id *match;
929930
930− if (!dev->driver->acpi_match_table)
931+ if (!acpi_ids)
931932 return acpi_of_device_get_match_data(dev);
932933
933− match = acpi_match_device(dev->driver->acpi_match_table, dev);
934+ match = acpi_match_device(acpi_ids, dev);
934935 if (!match)
935936 return NULL;
936937
@@ -948,14 +949,13 @@ EXPORT_SYMBOL(acpi_match_device_ids); · 11 unmodified lines
948949 bool acpi_driver_match_device(struct device *dev,
949950 const struct device_driver *drv)
950951 {
951− if (!drv->acpi_match_table)
952− return acpi_of_match_device(ACPI_COMPANION(dev),
953− drv->of_match_table,
954− NULL);
955−
956− return __acpi_match_device(acpi_companion_match(dev),
957− drv->acpi_match_table, drv->of_match_table,
958− NULL, NULL);
952+ const struct acpi_device_id *acpi_ids = drv->acpi_match_table;
953+ const struct of_device_id *of_ids = drv->of_match_table;
954+
955+ if (!acpi_ids)
956+ return acpi_of_match_device(ACPI_COMPANION(dev), of_ids, NULL);
957+
958+ return __acpi_match_device(acpi_companion_match(dev), acpi_ids, of_ids, NULL, NULL);
959959 }
960960 EXPORT_SYMBOL_GPL(acpi_driver_match_device);
961961
@@ -973,16 +973,13 @@ EXPORT_SYMBOL_GPL(acpi_driver_match_device); · 11 unmodified lines
973973 */
974974 int acpi_bus_register_driver(struct acpi_driver *driver)
975975 {
976− int ret;
977−
978976 if (acpi_disabled)
979977 return -ENODEV;
980978 driver->drv.name = driver->name;
981979 driver->drv.bus = &acpi_bus_type;
982980 driver->drv.owner = driver->owner;
983981
984− ret = driver_register(&driver->drv);
985− return ret;
982+ return driver_register(&driver->drv);
986983 }
987984
988985 EXPORT_SYMBOL(acpi_bus_register_driver);
drivers/acpi/cppc_acpi.c+45−0
@@ -424,6 +424,9 @@ bool acpi_cpc_valid(void) · 423 unmodified lines
424424 struct cpc_desc *cpc_ptr;
425425 int cpu;
426426
427+ if (acpi_disabled)
428+ return false;
429+
427430 for_each_present_cpu(cpu) {
428431 cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
429432 if (!cpc_ptr)
@@ -1240,6 +1243,48 @@ out_err: · 810 unmodified lines
12401243 }
12411244 EXPORT_SYMBOL_GPL(cppc_get_perf_caps);
12421245
1246+/**
1247+ * cppc_perf_ctrs_in_pcc - Check if any perf counters are in a PCC region.
1248+ *
1249+ * CPPC has flexibility about how CPU performance counters are accessed.
1250+ * One of the choices is PCC regions, which can have a high access latency. This
1251+ * routine allows callers of cppc_get_perf_ctrs() to know this ahead of time.
1252+ *
1253+ * Return: true if any of the counters are in PCC regions, false otherwise
1254+ */
1255+bool cppc_perf_ctrs_in_pcc(void)
1256+{
1257+ int cpu;
1258+
1259+ for_each_present_cpu(cpu) {
1260+ struct cpc_register_resource *ref_perf_reg;
1261+ struct cpc_desc *cpc_desc;
1262+
1263+ cpc_desc = per_cpu(cpc_desc_ptr, cpu);
1264+
1265+ if (CPC_IN_PCC(&cpc_desc->cpc_regs[DELIVERED_CTR]) ||
1266+ CPC_IN_PCC(&cpc_desc->cpc_regs[REFERENCE_CTR]) ||
1267+ CPC_IN_PCC(&cpc_desc->cpc_regs[CTR_WRAP_TIME]))
1268+ return true;
1269+
1270+
1271+ ref_perf_reg = &cpc_desc->cpc_regs[REFERENCE_PERF];
1272+
1273+ /*
1274+ * If reference perf register is not supported then we should
1275+ * use the nominal perf value
1276+ */
1277+ if (!CPC_SUPPORTED(ref_perf_reg))
1278+ ref_perf_reg = &cpc_desc->cpc_regs[NOMINAL_PERF];
1279+
1280+ if (CPC_IN_PCC(ref_perf_reg))
1281+ return true;
1282+ }
1283+
1284+ return false;
1285+}
1286+EXPORT_SYMBOL_GPL(cppc_perf_ctrs_in_pcc);
1287+
12431288 /**
12441289 * cppc_get_perf_ctrs - Read a CPU's performance feedback counters.
12451290 * @cpunum: CPU from which to read counters.
drivers/acpi/device_pm.c+22−16
@@ -75,15 +75,17 @@ static int acpi_dev_pm_explicit_get(struct acpi_device *device, int *state) · 74 unmodified lines
7575 int acpi_device_get_power(struct acpi_device *device, int *state)
7676 {
7777 int result = ACPI_STATE_UNKNOWN;
78+ struct acpi_device *parent;
7879 int error;
7980
8081 if (!device || !state)
8182 return -EINVAL;
8283
84+ parent = acpi_dev_parent(device);
85+
8386 if (!device->flags.power_manageable) {
8487 /* TBD: Non-recursive algorithm for walking up hierarchy. */
85− *state = device->parent ?
86− device->parent->power.state : ACPI_STATE_D0;
88+ *state = parent ? parent->power.state : ACPI_STATE_D0;
8789 goto out;
8890 }
8991
@@ -122,10 +124,10 @@ int acpi_device_get_power(struct acpi_device *device, int *state) · 32 unmodified lines
122124 * point, the fact that the device is in D0 implies that the parent has
123125 * to be in D0 too, except if ignore_parent is set.
124126 */
125− if (!device->power.flags.ignore_parent && device->parent
126− && device->parent->power.state == ACPI_STATE_UNKNOWN
127− && result == ACPI_STATE_D0)
128− device->parent->power.state = ACPI_STATE_D0;
127+ if (!device->power.flags.ignore_parent && parent &&
128+ parent->power.state == ACPI_STATE_UNKNOWN &&
129+ result == ACPI_STATE_D0)
130+ parent->power.state = ACPI_STATE_D0;
129131
130132 *state = result;
131133
@@ -191,13 +193,17 @@ int acpi_device_set_power(struct acpi_device *device, int state) · 59 unmodified lines
191193 return -ENODEV;
192194 }
193195
194− if (!device->power.flags.ignore_parent && device->parent &&
195− state < device->parent->power.state) {
196− acpi_handle_debug(device->handle,
197− "Cannot transition to %s for parent in %s\n",
198− acpi_power_state_string(state),
199− acpi_power_state_string(device->parent->power.state));
200− return -ENODEV;
196+ if (!device->power.flags.ignore_parent) {
197+ struct acpi_device *parent;
198+
199+ parent = acpi_dev_parent(device);
200+ if (parent && state < parent->power.state) {
201+ acpi_handle_debug(device->handle,
202+ "Cannot transition to %s for parent in %s\n",
203+ acpi_power_state_string(state),
204+ acpi_power_state_string(parent->power.state));
205+ return -ENODEV;
206+ }
201207 }
202208
203209 /*
@@ -497,7 +503,7 @@ static void acpi_pm_notify_handler(acpi_handle handle, u32 val, void *not_used) · 293 unmodified lines
497503
498504 acpi_handle_debug(handle, "Wake notify\n");
499505
500− adev = acpi_bus_get_acpi_device(handle);
506+ adev = acpi_get_acpi_dev(handle);
501507 if (!adev)
502508 return;
503509
@@ -515,7 +521,7 @@ static void acpi_pm_notify_handler(acpi_handle handle, u32 val, void *not_used) · 11 unmodified lines
515521
516522 mutex_unlock(&acpi_pm_notifier_lock);
517523
518− acpi_bus_put_acpi_device(adev);
524+ acpi_put_acpi_dev(adev);
519525 }
520526
521527 /**
@@ -1460,7 +1466,7 @@ EXPORT_SYMBOL_GPL(acpi_storage_d3); · 938 unmodified lines
14601466 * not valid to ask for the ACPI power state of the device in that time frame.
14611467 *
14621468 * This function is intended to be used in a driver's probe or remove
1463− * function. See Documentation/firmware-guide/acpi/low-power-probe.rst for
1469+ * function. See Documentation/firmware-guide/acpi/non-d0-probe.rst for
14641470 * more information.
14651471 */
14661472 bool acpi_dev_state_d0(struct device *dev)
drivers/acpi/dptf/Kconfig+0−3
@@ -11,9 +11,6 @@ menuconfig ACPI_DPTF · 10 unmodified lines
1111 a coordinated approach for different policies to effect the hardware
1212 state of a system.
1313
14− For more information see:
15− <https://01.org/intel%C2%AE-dynamic-platform-and-thermal-framework-dptf-chromium-os/overview>
16−
1714 if ACPI_DPTF
1815
1916 config DPTF_POWER
drivers/acpi/ec.c+1−5
@@ -917,14 +917,10 @@ EXPORT_SYMBOL(ec_read); · 916 unmodified lines
917917
918918 int ec_write(u8 addr, u8 val)
919919 {
920− int err;
921−
922920 if (!first_ec)
923921 return -ENODEV;
924922
925− err = acpi_ec_write(first_ec, addr, val);
926−
927− return err;
923+ return acpi_ec_write(first_ec, addr, val);
928924 }
929925 EXPORT_SYMBOL(ec_write);
930926
drivers/acpi/fan_core.c+27−31
@@ -19,43 +19,12 @@ · 18 unmodified lines
1919
2020 #include "fan.h"
2121
22−MODULE_AUTHOR("Paul Diefenbaugh");
23−MODULE_DESCRIPTION("ACPI Fan Driver");
24−MODULE_LICENSE("GPL");
25−
26−static int acpi_fan_probe(struct platform_device *pdev);
27−static int acpi_fan_remove(struct platform_device *pdev);
28−
2922 static const struct acpi_device_id fan_device_ids[] = {
3023 ACPI_FAN_DEVICE_IDS,
3124 {"", 0},
3225 };
3326 MODULE_DEVICE_TABLE(acpi, fan_device_ids);
3427
35−#ifdef CONFIG_PM_SLEEP
36−static int acpi_fan_suspend(struct device *dev);
37−static int acpi_fan_resume(struct device *dev);
38−static const struct dev_pm_ops acpi_fan_pm = {
39− .resume = acpi_fan_resume,
40− .freeze = acpi_fan_suspend,
41− .thaw = acpi_fan_resume,
42− .restore = acpi_fan_resume,
43−};
44−#define FAN_PM_OPS_PTR (&acpi_fan_pm)
45−#else
46−#define FAN_PM_OPS_PTR NULL
47−#endif
48−
49−static struct platform_driver acpi_fan_driver = {
50− .probe = acpi_fan_probe,
51− .remove = acpi_fan_remove,
52− .driver = {
53− .name = "acpi-fan",
54− .acpi_match_table = fan_device_ids,
55− .pm = FAN_PM_OPS_PTR,
56− },
57−};
58−
5928 /* thermal cooling device callbacks */
6029 static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long
6130 *state)
@@ -459,6 +428,33 @@ static int acpi_fan_resume(struct device *dev) · 397 unmodified lines
459428
460429 return result;
461430 }
431+
432+static const struct dev_pm_ops acpi_fan_pm = {
433+ .resume = acpi_fan_resume,
434+ .freeze = acpi_fan_suspend,
435+ .thaw = acpi_fan_resume,
436+ .restore = acpi_fan_resume,
437+};
438+#define FAN_PM_OPS_PTR (&acpi_fan_pm)
439+
440+#else
441+
442+#define FAN_PM_OPS_PTR NULL
443+
462444 #endif
463445
446+static struct platform_driver acpi_fan_driver = {
447+ .probe = acpi_fan_probe,
448+ .remove = acpi_fan_remove,
449+ .driver = {
450+ .name = "acpi-fan",
451+ .acpi_match_table = fan_device_ids,
452+ .pm = FAN_PM_OPS_PTR,
453+ },
454+};
455+
464456 module_platform_driver(acpi_fan_driver);
457+
458+MODULE_AUTHOR("Paul Diefenbaugh");
459+MODULE_DESCRIPTION("ACPI Fan Driver");
460+MODULE_LICENSE("GPL");
drivers/acpi/internal.h+3−3
@@ -102,10 +102,10 @@ struct acpi_device_bus_id { · 101 unmodified lines
102102 struct list_head node;
103103 };
104104
105−int acpi_device_add(struct acpi_device *device,
106− void (*release)(struct device *));
107105 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
108− int type);
106+ int type, void (*release)(struct device *));
107+int acpi_tie_acpi_dev(struct acpi_device *adev);
108+int acpi_device_add(struct acpi_device *device);
109109 int acpi_device_setup_files(struct acpi_device *dev);
110110 void acpi_device_remove_files(struct acpi_device *dev);
111111 void acpi_device_add_finalize(struct acpi_device *device);
drivers/acpi/irq.c+2−2
@@ -118,12 +118,12 @@ acpi_get_irq_source_fwhandle(const struct acpi_resource_source *source, · 117 unmodified lines
118118 if (WARN_ON(ACPI_FAILURE(status)))
119119 return NULL;
120120
121− device = acpi_bus_get_acpi_device(handle);
121+ device = acpi_get_acpi_dev(handle);
122122 if (WARN_ON(!device))
123123 return NULL;
124124
125125 result = &device->fwnode;
126− acpi_bus_put_acpi_device(device);
126+ acpi_put_acpi_dev(device);
127127 return result;
128128 }
129129
drivers/acpi/numa/hmat.c+12−13
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 */
1010
1111 #define pr_fmt(fmt) "acpi/hmat: " fmt
12−#define dev_fmt(fmt) "acpi/hmat: " fmt
1312
1413 #include <linux/acpi.h>
1514 #include <linux/bitops.h>
@@ -302,7 +301,7 @@ static __init int hmat_parse_locality(union acpi_subtable_headers *header, · 286 unmodified lines
302301 u8 type, mem_hier;
303302
304303 if (hmat_loc->header.length < sizeof(*hmat_loc)) {
305− pr_notice("HMAT: Unexpected locality header length: %u\n",
304+ pr_notice("Unexpected locality header length: %u\n",
306305 hmat_loc->header.length);
307306 return -EINVAL;
308307 }
@@ -314,12 +313,12 @@ static __init int hmat_parse_locality(union acpi_subtable_headers *header, · 5 unmodified lines
314313 total_size = sizeof(*hmat_loc) + sizeof(*entries) * ipds * tpds +
315314 sizeof(*inits) * ipds + sizeof(*targs) * tpds;
316315 if (hmat_loc->header.length < total_size) {
317− pr_notice("HMAT: Unexpected locality header length:%u, minimum required:%u\n",
316+ pr_notice("Unexpected locality header length:%u, minimum required:%u\n",
318317 hmat_loc->header.length, total_size);
319318 return -EINVAL;
320319 }
321320
322− pr_info("HMAT: Locality: Flags:%02x Type:%s Initiator Domains:%u Target Domains:%u Base:%lld\n",
321+ pr_info("Locality: Flags:%02x Type:%s Initiator Domains:%u Target Domains:%u Base:%lld\n",
323322 hmat_loc->flags, hmat_data_type(type), ipds, tpds,
324323 hmat_loc->entry_base_unit);
325324
@@ -363,13 +362,13 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header, · 37 unmodified lines
363362 u32 attrs;
364363
365364 if (cache->header.length < sizeof(*cache)) {
366− pr_notice("HMAT: Unexpected cache header length: %u\n",
365+ pr_notice("Unexpected cache header length: %u\n",
367366 cache->header.length);
368367 return -EINVAL;
369368 }
370369
371370 attrs = cache->cache_attributes;
372− pr_info("HMAT: Cache: Domain:%u Size:%llu Attrs:%08x SMBIOS Handles:%d\n",
371+ pr_info("Cache: Domain:%u Size:%llu Attrs:%08x SMBIOS Handles:%d\n",
373372 cache->memory_PD, cache->cache_size, attrs,
374373 cache->number_of_SMBIOShandles);
375374
@@ -424,24 +423,24 @@ static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade · 48 unmodified lines
424423 struct memory_target *target = NULL;
425424
426425 if (p->header.length != sizeof(*p)) {
427− pr_notice("HMAT: Unexpected address range header length: %u\n",
426+ pr_notice("Unexpected address range header length: %u\n",
428427 p->header.length);
429428 return -EINVAL;
430429 }
431430
432431 if (hmat_revision == 1)
433− pr_info("HMAT: Memory (%#llx length %#llx) Flags:%04x Processor Domain:%u Memory Domain:%u\n",
432+ pr_info("Memory (%#llx length %#llx) Flags:%04x Processor Domain:%u Memory Domain:%u\n",
434433 p->reserved3, p->reserved4, p->flags, p->processor_PD,
435434 p->memory_PD);
436435 else
437− pr_info("HMAT: Memory Flags:%04x Processor Domain:%u Memory Domain:%u\n",
436+ pr_info("Memory Flags:%04x Processor Domain:%u Memory Domain:%u\n",
438437 p->flags, p->processor_PD, p->memory_PD);
439438
440439 if ((hmat_revision == 1 && p->flags & ACPI_HMAT_MEMORY_PD_VALID) ||
441440 hmat_revision > 1) {
442441 target = find_mem_target(p->memory_PD);
443442 if (!target) {
444− pr_debug("HMAT: Memory Domain missing from SRAT\n");
443+ pr_debug("Memory Domain missing from SRAT\n");
445444 return -EINVAL;
446445 }
447446 }
@@ -449,7 +448,7 @@ static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade · 1 unmodified line
449448 int p_node = pxm_to_node(p->processor_PD);
450449
451450 if (p_node == NUMA_NO_NODE) {
452− pr_debug("HMAT: Invalid Processor Domain\n");
451+ pr_debug("Invalid Processor Domain\n");
453452 return -EINVAL;
454453 }
455454 target->processor_pxm = p->processor_PD;
@@ -840,7 +839,7 @@ static __init int hmat_init(void) · 384 unmodified lines
840839 case 2:
841840 break;
842841 default:
843− pr_notice("Ignoring HMAT: Unknown revision:%d\n", hmat_revision);
842+ pr_notice("Ignoring: Unknown revision:%d\n", hmat_revision);
844843 goto out_put;
845844 }
846845
@@ -848,7 +847,7 @@ static __init int hmat_init(void) · 1 unmodified line
848847 if (acpi_table_parse_entries(ACPI_SIG_HMAT,
849848 sizeof(struct acpi_table_hmat), i,
850849 hmat_parse_subtable, 0) < 0) {
851− pr_notice("Ignoring HMAT: Invalid table");
850+ pr_notice("Ignoring: Invalid table");
852851 goto out_put;
853852 }
854853 }
drivers/acpi/osi.c+0−24
@@ -44,30 +44,6 @@ osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { · 43 unmodified lines
4444 {"Processor Device", true},
4545 {"3.0 _SCP Extensions", true},
4646 {"Processor Aggregator Device", true},
47− /*
48− * Linux-Dell-Video is used by BIOS to disable RTD3 for NVidia graphics
49− * cards as RTD3 is not supported by drivers now. Systems with NVidia
50− * cards will hang without RTD3 disabled.
51− *
52− * Once NVidia drivers officially support RTD3, this _OSI strings can
53− * be removed if both new and old graphics cards are supported.
54− */
55− {"Linux-Dell-Video", true},
56− /*
57− * Linux-Lenovo-NV-HDMI-Audio is used by BIOS to power on NVidia's HDMI
58− * audio device which is turned off for power-saving in Windows OS.
59− * This power management feature observed on some Lenovo Thinkpad
60− * systems which will not be able to output audio via HDMI without
61− * a BIOS workaround.
62− */
63− {"Linux-Lenovo-NV-HDMI-Audio", true},
64− /*
65− * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to
66− * output video directly to external monitors on HP Inc. mobile
67− * workstations as Nvidia and AMD VGA drivers provide limited
68− * hybrid graphics supports.
69− */
70− {"Linux-HPI-Hybrid-Graphics", true},
7147 };
7248
7349 static u32 acpi_osi_handler(acpi_string interface, u32 supported)
drivers/acpi/pci_root.c+12−63
@@ -312,76 +312,25 @@ struct acpi_handle_node { · 311 unmodified lines
312312 */
313313 struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
314314 {
315− int dev, fn;
316− unsigned long long adr;
317− acpi_status status;
318− acpi_handle phandle;
319− struct pci_bus *pbus;
320− struct pci_dev *pdev = NULL;
321− struct acpi_handle_node *node, *tmp;
322− struct acpi_pci_root *root;
323− LIST_HEAD(device_list);
324−
325− /*
326− * Walk up the ACPI CA namespace until we reach a PCI root bridge.
327− */
328− phandle = handle;
329− while (!acpi_is_root_bridge(phandle)) {
330− node = kzalloc(sizeof(struct acpi_handle_node), GFP_KERNEL);
331− if (!node)
332− goto out;
333−
334− INIT_LIST_HEAD(&node->node);
335− node->handle = phandle;
336− list_add(&node->node, &device_list);
337−
338− status = acpi_get_parent(phandle, &phandle);
339− if (ACPI_FAILURE(status))
340− goto out;
341− }
342−
343− root = acpi_pci_find_root(phandle);
344− if (!root)
345− goto out;
315+ struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
316+ struct acpi_device_physical_node *pn;
317+ struct pci_dev *pci_dev = NULL;
346318
347− pbus = root->bus;
348−
349− /*
350− * Now, walk back down the PCI device tree until we return to our
351− * original handle. Assumes that everything between the PCI root
352− * bridge and the device we're looking for must be a P2P bridge.
353− */
354− list_for_each_entry(node, &device_list, node) {
355− acpi_handle hnd = node->handle;
356− status = acpi_evaluate_integer(hnd, "_ADR", NULL, &adr);
357− if (ACPI_FAILURE(status))
358− goto out;
359− dev = (adr >> 16) & 0xffff;
360− fn = adr & 0xffff;
361−
362− pdev = pci_get_slot(pbus, PCI_DEVFN(dev, fn));
363− if (!pdev || hnd == handle)
364− break;
319+ if (!adev)
320+ return NULL;
365321
366− pbus = pdev->subordinate;
367− pci_dev_put(pdev);
322+ mutex_lock(&adev->physical_node_lock);
368323
369− /*
370− * This function may be called for a non-PCI device that has a
371− * PCI parent (eg. a disk under a PCI SATA controller). In that
372− * case pdev->subordinate will be NULL for the parent.
373− */
374− if (!pbus) {
375− dev_dbg(&pdev->dev, "Not a PCI-to-PCI bridge\n");
376− pdev = NULL;
324+ list_for_each_entry(pn, &adev->physical_node_list, node) {
325+ if (dev_is_pci(pn->dev)) {
326+ pci_dev = to_pci_dev(pn->dev);
377327 break;
378328 }
379329 }
380−out:
381− list_for_each_entry_safe(node, tmp, &device_list, node)
382− kfree(node);
383330
384− return pdev;
331+ mutex_unlock(&adev->physical_node_lock);
332+
333+ return pci_dev;
385334 }
386335 EXPORT_SYMBOL_GPL(acpi_get_pci_dev);
387336
drivers/acpi/power.c+8−3
@@ -944,13 +944,15 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) · 943 unmodified lines
944944 return NULL;
945945
946946 device = &resource->device;
947− acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER);
947+ acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER,
948+ acpi_release_power_resource);
948949 mutex_init(&resource->resource_lock);
949950 INIT_LIST_HEAD(&resource->list_node);
950951 INIT_LIST_HEAD(&resource->dependents);
951952 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
952953 strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
953954 device->power.state = ACPI_STATE_UNKNOWN;
955+ device->flags.match_driver = true;
954956
955957 /* Evaluate the object to get the system level and resource order. */
956958 status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
@@ -967,8 +969,11 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) · 10 unmodified lines
967969
968970 pr_info("%s [%s]\n", acpi_device_name(device), acpi_device_bid(device));
969971
970− device->flags.match_driver = true;
971− result = acpi_device_add(device, acpi_release_power_resource);
972+ result = acpi_tie_acpi_dev(device);
973+ if (result)
974+ goto err;
975+
976+ result = acpi_device_add(device);
972977 if (result)
973978 goto err;
974979
drivers/acpi/processor_idle.c+4−4
@@ -804,7 +804,7 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) · 803 unmodified lines
804804
805805 state = &drv->states[count];
806806 snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
807− strlcpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
807+ strscpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
808808 state->exit_latency = cx->latency;
809809 state->target_residency = cx->latency * latency_factor;
810810 state->enter = acpi_idle_enter;
@@ -973,7 +973,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle, · 162 unmodified lines
973973
974974 obj = pkg_elem + 9;
975975 if (obj->type == ACPI_TYPE_STRING)
976− strlcpy(lpi_state->desc, obj->string.pointer,
976+ strscpy(lpi_state->desc, obj->string.pointer,
977977 ACPI_CX_DESC_LEN);
978978
979979 lpi_state->index = state_idx;
@@ -1039,7 +1039,7 @@ static bool combine_lpi_states(struct acpi_lpi_state *local, · 59 unmodified lines
10391039 result->arch_flags = parent->arch_flags;
10401040 result->index = parent->index;
10411041
1042− strlcpy(result->desc, local->desc, ACPI_CX_DESC_LEN);
1042+ strscpy(result->desc, local->desc, ACPI_CX_DESC_LEN);
10431043 strlcat(result->desc, "+", ACPI_CX_DESC_LEN);
10441044 strlcat(result->desc, parent->desc, ACPI_CX_DESC_LEN);
10451045 return true;
@@ -1213,7 +1213,7 @@ static int acpi_processor_setup_lpi_states(struct acpi_processor *pr) · 167 unmodified lines
12131213
12141214 state = &drv->states[i];
12151215 snprintf(state->name, CPUIDLE_NAME_LEN, "LPI-%d", i);
1216− strlcpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN);
1216+ strscpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN);
12171217 state->exit_latency = lpi->wake_latency;
12181218 state->target_residency = lpi->min_residency;
12191219 if (lpi->arch_flags)
drivers/acpi/property.c+8−5
@@ -304,8 +304,10 @@ static void acpi_init_of_compatible(struct acpi_device *adev) · 303 unmodified lines
304304 ret = acpi_dev_get_property(adev, "compatible",
305305 ACPI_TYPE_STRING, &of_compatible);
306306 if (ret) {
307− if (adev->parent
308− && adev->parent->flags.of_compatible_ok)
307+ struct acpi_device *parent;
308+
309+ parent = acpi_dev_parent(adev);
310+ if (parent && parent->flags.of_compatible_ok)
309311 goto out;
310312
311313 return;
@@ -1267,10 +1269,11 @@ acpi_node_get_parent(const struct fwnode_handle *fwnode) · 955 unmodified lines
12671269 return to_acpi_data_node(fwnode)->parent;
12681270 }
12691271 if (is_acpi_device_node(fwnode)) {
1270− struct device *dev = to_acpi_device_node(fwnode)->dev.parent;
1272+ struct acpi_device *parent;
12711273
1272− if (dev)
1273− return acpi_fwnode_handle(to_acpi_device(dev));
1274+ parent = acpi_dev_parent(to_acpi_device_node(fwnode));
1275+ if (parent)
1276+ return acpi_fwnode_handle(parent);
12741277 }
12751278
12761279 return NULL;
drivers/acpi/resource.c+46−0
@@ -399,6 +399,31 @@ static const struct dmi_system_id medion_laptop[] = { · 398 unmodified lines
399399 { }
400400 };
401401
402+static const struct dmi_system_id asus_laptop[] = {
403+ {
404+ .ident = "Asus Vivobook K3402ZA",
405+ .matches = {
406+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
407+ DMI_MATCH(DMI_BOARD_NAME, "K3402ZA"),
408+ },
409+ },
410+ {
411+ .ident = "Asus Vivobook K3502ZA",
412+ .matches = {
413+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
414+ DMI_MATCH(DMI_BOARD_NAME, "K3502ZA"),
415+ },
416+ },
417+ {
418+ .ident = "Asus Vivobook S5402ZA",
419+ .matches = {
420+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
421+ DMI_MATCH(DMI_BOARD_NAME, "S5402ZA"),
422+ },
423+ },
424+ { }
425+};
426+
402427 struct irq_override_cmp {
403428 const struct dmi_system_id *system;
404429 unsigned char irq;
@@ -409,6 +434,7 @@ struct irq_override_cmp { · 4 unmodified lines
409434
410435 static const struct irq_override_cmp skip_override_table[] = {
411436 { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
437+ { asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
412438 };
413439
414440 static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
@@ -690,6 +716,9 @@ static int is_memory(struct acpi_resource *ares, void *not_used) · 275 unmodified lines
690716
691717 memset(&win, 0, sizeof(win));
692718
719+ if (acpi_dev_filter_resource_type(ares, IORESOURCE_MEM))
720+ return 1;
721+
693722 return !(acpi_dev_resource_memory(ares, res)
694723 || acpi_dev_resource_address_space(ares, &win)
695724 || acpi_dev_resource_ext_address_space(ares, &win));
@@ -718,6 +747,23 @@ int acpi_dev_get_dma_resources(struct acpi_device *adev, struct list_head *list) · 22 unmodified lines
718747 }
719748 EXPORT_SYMBOL_GPL(acpi_dev_get_dma_resources);
720749
750+/**
751+ * acpi_dev_get_memory_resources - Get current memory resources of a device.
752+ * @adev: ACPI device node to get the resources for.
753+ * @list: Head of the resultant list of resources (must be empty).
754+ *
755+ * This is a helper function that locates all memory type resources of @adev
756+ * with acpi_dev_get_resources().
757+ *
758+ * The number of resources in the output list is returned on success, an error
759+ * code reflecting the error condition is returned otherwise.
760+ */
761+int acpi_dev_get_memory_resources(struct acpi_device *adev, struct list_head *list)
762+{
763+ return acpi_dev_get_resources(adev, list, is_memory, NULL);
764+}
765+EXPORT_SYMBOL_GPL(acpi_dev_get_memory_resources);
766+
721767 /**
722768 * acpi_dev_filter_resource_type - Filter ACPI resource according to resource
723769 * types
drivers/acpi/sbs.c+1−1
@@ -632,7 +632,7 @@ static int acpi_sbs_add(struct acpi_device *device) · 631 unmodified lines
632632
633633 mutex_init(&sbs->lock);
634634
635− sbs->hc = acpi_driver_data(device->parent);
635+ sbs->hc = acpi_driver_data(acpi_dev_parent(device));
636636 sbs->device = device;
637637 strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME);
638638 strcpy(acpi_device_class(device), ACPI_SBS_CLASS);
drivers/acpi/sbshc.c+1−1
@@ -266,7 +266,7 @@ static int acpi_smbus_hc_add(struct acpi_device *device) · 265 unmodified lines
266266 mutex_init(&hc->lock);
267267 init_waitqueue_head(&hc->wait);
268268
269− hc->ec = acpi_driver_data(device->parent);
269+ hc->ec = acpi_driver_data(acpi_dev_parent(device));
270270 hc->offset = (val >> 8) & 0xff;
271271 hc->query_bit = val & 0xff;
272272 device->driver_data = hc;
drivers/acpi/scan.c+96−83
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/platform_data/x86/apple.h>
2121 #include <linux/pgtable.h>
2222 #include <linux/crc32.h>
23+#include <linux/dma-direct.h>
2324
2425 #include "internal.h"
2526
@@ -29,8 +30,6 @@ extern struct acpi_device *acpi_root; · 3 unmodified lines
2930 #define ACPI_BUS_HID "LNXSYBUS"
3031 #define ACPI_BUS_DEVICE_NAME "System Bus"
3132
32−#define ACPI_IS_ROOT_DEVICE(device) (!(device)->parent)
33−
3433 #define INVALID_ACPI_HANDLE ((acpi_handle)empty_zero_page)
3534
3635 static const char *dummy_hid = "device";
@@ -429,7 +428,7 @@ void acpi_device_hotplug(struct acpi_device *adev, u32 src) · 392 unmodified lines
429428 acpi_evaluate_ost(adev->handle, src, ost_code, NULL);
430429
431430 out:
432− acpi_bus_put_acpi_device(adev);
431+ acpi_put_acpi_dev(adev);
433432 mutex_unlock(&acpi_scan_lock);
434433 unlock_device_hotplug();
435434 }
@@ -599,11 +598,22 @@ static void get_acpi_device(void *dev) · 163 unmodified lines
599598 acpi_dev_get(dev);
600599 }
601600
602−struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle)
601+/**
602+ * acpi_get_acpi_dev - Retrieve ACPI device object and reference count it.
603+ * @handle: ACPI handle associated with the requested ACPI device object.
604+ *
605+ * Return a pointer to the ACPI device object associated with @handle and bump
606+ * up that object's reference counter (under the ACPI Namespace lock), if
607+ * present, or return NULL otherwise.
608+ *
609+ * The ACPI device object reference acquired by this function needs to be
610+ * dropped via acpi_dev_put().
611+ */
612+struct acpi_device *acpi_get_acpi_dev(acpi_handle handle)
603613 {
604614 return handle_to_device(handle, get_acpi_device);
605615 }
606−EXPORT_SYMBOL_GPL(acpi_bus_get_acpi_device);
616+EXPORT_SYMBOL_GPL(acpi_get_acpi_dev);
607617
608618 static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id)
609619 {
@@ -632,7 +642,7 @@ static int acpi_device_set_name(struct acpi_device *device, · 22 unmodified lines
632642 return 0;
633643 }
634644
635−static int acpi_tie_acpi_dev(struct acpi_device *adev)
645+int acpi_tie_acpi_dev(struct acpi_device *adev)
636646 {
637647 acpi_handle handle = adev->handle;
638648 acpi_status status;
@@ -662,8 +672,7 @@ static void acpi_store_pld_crc(struct acpi_device *adev) · 23 unmodified lines
662672 ACPI_FREE(pld);
663673 }
664674
665−static int __acpi_device_add(struct acpi_device *device,
666− void (*release)(struct device *))
675+int acpi_device_add(struct acpi_device *device)
667676 {
668677 struct acpi_device_bus_id *acpi_device_bus_id;
669678 int result;
@@ -719,11 +728,6 @@ static int __acpi_device_add(struct acpi_device *device, · 49 unmodified lines
719728
720729 mutex_unlock(&acpi_device_lock);
721730
722− if (device->parent)
723− device->dev.parent = &device->parent->dev;
724−
725− device->dev.bus = &acpi_bus_type;
726− device->dev.release = release;
727731 result = device_add(&device->dev);
728732 if (result) {
729733 dev_err(&device->dev, "Error registering device\n");
@@ -750,17 +754,6 @@ err_unlock: · 20 unmodified lines
750754 return result;
751755 }
752756
753−int acpi_device_add(struct acpi_device *adev, void (*release)(struct device *))
754−{
755− int ret;
756−
757− ret = acpi_tie_acpi_dev(adev);
758− if (ret)
759− return ret;
760−
761− return __acpi_device_add(adev, release);
762−}
763−
764757 /* --------------------------------------------------------------------------
765758 Device Enumeration
766759 -------------------------------------------------------------------------- */
@@ -805,10 +798,9 @@ static const char * const acpi_honor_dep_ids[] = { · 38 unmodified lines
805798 NULL
806799 };
807800
808−static struct acpi_device *acpi_bus_get_parent(acpi_handle handle)
801+static struct acpi_device *acpi_find_parent_acpi_dev(acpi_handle handle)
809802 {
810− struct acpi_device *device;
811− acpi_status status;
803+ struct acpi_device *adev;
812804
813805 /*
814806 * Fixed hardware devices do not appear in the namespace and do not
@@ -819,13 +811,18 @@ static struct acpi_device *acpi_bus_get_parent(acpi_handle handle) · 4 unmodified lines
819811 return acpi_root;
820812
821813 do {
814+ acpi_status status;
815+
822816 status = acpi_get_parent(handle, &handle);
823− if (ACPI_FAILURE(status))
824− return status == AE_NULL_ENTRY ? NULL : acpi_root;
817+ if (ACPI_FAILURE(status)) {
818+ if (status != AE_NULL_ENTRY)
819+ return acpi_root;
825820
826− device = acpi_fetch_acpi_dev(handle);
827− } while (!device);
828− return device;
821+ return NULL;
822+ }
823+ adev = acpi_fetch_acpi_dev(handle);
824+ } while (!adev);
825+ return adev;
829826 }
830827
831828 acpi_status
@@ -1112,7 +1109,7 @@ static void acpi_device_get_busid(struct acpi_device *device) · 280 unmodified lines
11121109 * The device's Bus ID is simply the object name.
11131110 * TBD: Shouldn't this value be unique (within the ACPI namespace)?
11141111 */
1115− if (ACPI_IS_ROOT_DEVICE(device)) {
1112+ if (!acpi_dev_parent(device)) {
11161113 strcpy(device->pnp.bus_id, "ACPI");
11171114 return;
11181115 }
@@ -1467,25 +1464,21 @@ enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev) · 348 unmodified lines
14671464 * acpi_dma_get_range() - Get device DMA parameters.
14681465 *
14691466 * @dev: device to configure
1470− * @dma_addr: pointer device DMA address result
1471− * @offset: pointer to the DMA offset result
1472− * @size: pointer to DMA range size result
1467+ * @map: pointer to DMA ranges result
14731468 *
1474− * Evaluate DMA regions and return respectively DMA region start, offset
1475− * and size in dma_addr, offset and size on parsing success; it does not
1476− * update the passed in values on failure.
1469+ * Evaluate DMA regions and return pointer to DMA regions on
1470+ * parsing success; it does not update the passed in values on failure.
14771471 *
14781472 * Return 0 on success, < 0 on failure.
14791473 */
1480−int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset,
1481− u64 *size)
1474+int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map)
14821475 {
14831476 struct acpi_device *adev;
14841477 LIST_HEAD(list);
14851478 struct resource_entry *rentry;
14861479 int ret;
14871480 struct device *dma_dev = dev;
1488− u64 len, dma_start = U64_MAX, dma_end = 0, dma_offset = 0;
1481+ struct bus_dma_region *r;
14891482
14901483 /*
14911484 * Walk the device tree chasing an ACPI companion with a _DMA
@@ -1510,31 +1503,28 @@ int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset, · 18 unmodified lines
15101503
15111504 ret = acpi_dev_get_dma_resources(adev, &list);
15121505 if (ret > 0) {
1506+ r = kcalloc(ret + 1, sizeof(*r), GFP_KERNEL);
1507+ if (!r) {
1508+ ret = -ENOMEM;
1509+ goto out;
1510+ }
1511+
15131512 list_for_each_entry(rentry, &list, node) {
1514− if (dma_offset && rentry->offset != dma_offset) {
1513+ if (rentry->res->start >= rentry->res->end) {
1514+ kfree(r);
15151515 ret = -EINVAL;
1516− dev_warn(dma_dev, "Can't handle multiple windows with different offsets\n");
1516+ dev_dbg(dma_dev, "Invalid DMA regions configuration\n");
15171517 goto out;
15181518 }
1519− dma_offset = rentry->offset;
15201519
1521− /* Take lower and upper limits */
1522− if (rentry->res->start < dma_start)
1523− dma_start = rentry->res->start;
1524− if (rentry->res->end > dma_end)
1525− dma_end = rentry->res->end;
1526− }
1527−
1528− if (dma_start >= dma_end) {
1529− ret = -EINVAL;
1530− dev_dbg(dma_dev, "Invalid DMA regions configuration\n");
1531− goto out;
1520+ r->cpu_start = rentry->res->start;
1521+ r->dma_start = rentry->res->start - rentry->offset;
1522+ r->size = resource_size(rentry->res);
1523+ r->offset = rentry->offset;
1524+ r++;
15321525 }
15331526
1534− *dma_addr = dma_start - dma_offset;
1535− len = dma_end - dma_start;
1536− *size = max(len, len + 1);
1537− *offset = dma_offset;
1527+ *map = r;
15381528 }
15391529 out:
15401530 acpi_dev_free_resource_list(&list);
@@ -1624,20 +1614,19 @@ int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr, · 83 unmodified lines
16241614 const u32 *input_id)
16251615 {
16261616 const struct iommu_ops *iommu;
1627− u64 dma_addr = 0, size = 0;
16281617
16291618 if (attr == DEV_DMA_NOT_SUPPORTED) {
16301619 set_dma_ops(dev, &dma_dummy_ops);
16311620 return 0;
16321621 }
16331622
1634− acpi_arch_dma_setup(dev, &dma_addr, &size);
1623+ acpi_arch_dma_setup(dev);
16351624
16361625 iommu = acpi_iommu_configure_id(dev, input_id);
16371626 if (PTR_ERR(iommu) == -EPROBE_DEFER)
16381627 return -EPROBE_DEFER;
16391628
1640− arch_setup_dma_ops(dev, dma_addr, size,
1629+ arch_setup_dma_ops(dev, 0, U64_MAX,
16411630 iommu, attr == DEV_DMA_COHERENT);
16421631
16431632 return 0;
@@ -1648,7 +1637,7 @@ static void acpi_init_coherency(struct acpi_device *adev) · 4 unmodified lines
16481637 {
16491638 unsigned long long cca = 0;
16501639 acpi_status status;
1651− struct acpi_device *parent = adev->parent;
1640+ struct acpi_device *parent = acpi_dev_parent(adev);
16521641
16531642 if (parent && parent->flags.cca_seen) {
16541643 /*
@@ -1692,7 +1681,7 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data) · 37 unmodified lines
16921681
16931682 static bool acpi_is_indirect_io_slave(struct acpi_device *device)
16941683 {
1695− struct acpi_device *parent = device->parent;
1684+ struct acpi_device *parent = acpi_dev_parent(device);
16961685 static const struct acpi_device_id indirect_io_hosts[] = {
16971686 {"HISI0191", 0},
16981687 {}
@@ -1762,12 +1751,16 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) · 63 unmodified lines
17621751 }
17631752
17641753 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
1765− int type)
1754+ int type, void (*release)(struct device *))
17661755 {
1756+ struct acpi_device *parent = acpi_find_parent_acpi_dev(handle);
1757+
17671758 INIT_LIST_HEAD(&device->pnp.ids);
17681759 device->device_type = type;
17691760 device->handle = handle;
1770− device->parent = acpi_bus_get_parent(handle);
1761+ device->dev.parent = parent ? &parent->dev : NULL;
1762+ device->dev.release = release;
1763+ device->dev.bus = &acpi_bus_type;
17711764 fwnode_init(&device->fwnode, &acpi_device_fwnode_ops);
17721765 acpi_set_device_status(device, ACPI_STA_DEFAULT);
17731766 acpi_device_get_busid(device);
@@ -1821,7 +1814,7 @@ static int acpi_add_single_object(struct acpi_device **child, · 47 unmodified lines
18211814 if (!device)
18221815 return -ENOMEM;
18231816
1824− acpi_init_device_object(device, handle, type);
1817+ acpi_init_device_object(device, handle, type, acpi_device_release);
18251818 /*
18261819 * Getting the status is delayed till here so that we can call
18271820 * acpi_bus_get_status() and use its quirk handling. Note that
@@ -1851,7 +1844,7 @@ static int acpi_add_single_object(struct acpi_device **child, · 23 unmodified lines
18511844 mutex_unlock(&acpi_dep_list_lock);
18521845
18531846 if (!result)
1854− result = __acpi_device_add(device, acpi_device_release);
1847+ result = acpi_device_add(device);
18551848
18561849 if (result) {
18571850 acpi_device_release(&device->dev);
@@ -1862,8 +1855,8 @@ static int acpi_add_single_object(struct acpi_device **child, · 4 unmodified lines
18621855 acpi_device_add_finalize(device);
18631856
18641857 acpi_handle_debug(handle, "Added as %s, parent %s\n",
1865− dev_name(&device->dev), device->parent ?
1866− dev_name(&device->parent->dev) : "(null)");
1858+ dev_name(&device->dev), device->dev.parent ?
1859+ dev_name(device->dev.parent) : "(null)");
18671860
18681861 *child = device;
18691862 return 0;
@@ -2235,11 +2228,24 @@ ok: · 365 unmodified lines
22352228 return 0;
22362229 }
22372230
2238−static int acpi_dev_get_first_consumer_dev_cb(struct acpi_dep_data *dep, void *data)
2231+static int acpi_dev_get_next_consumer_dev_cb(struct acpi_dep_data *dep, void *data)
22392232 {
2240− struct acpi_device *adev;
2233+ struct acpi_device **adev_p = data;
2234+ struct acpi_device *adev = *adev_p;
22412235
2242− adev = acpi_bus_get_acpi_device(dep->consumer);
2236+ /*
2237+ * If we're passed a 'previous' consumer device then we need to skip
2238+ * any consumers until we meet the previous one, and then NULL @data
2239+ * so the next one can be returned.
2240+ */
2241+ if (adev) {
2242+ if (dep->consumer == adev->handle)
2243+ *adev_p = NULL;
2244+
2245+ return 0;
2246+ }
2247+
2248+ adev = acpi_get_acpi_dev(dep->consumer);
22432249 if (adev) {
22442250 *(struct acpi_device **)data = adev;
22452251 return 1;
@@ -2292,7 +2298,7 @@ static bool acpi_scan_clear_dep_queue(struct acpi_device *adev) · 46 unmodified lines
22922298
22932299 static int acpi_scan_clear_dep(struct acpi_dep_data *dep, void *data)
22942300 {
2295− struct acpi_device *adev = acpi_bus_get_acpi_device(dep->consumer);
2301+ struct acpi_device *adev = acpi_get_acpi_dev(dep->consumer);
22962302
22972303 if (adev) {
22982304 adev->dep_unmet--;
@@ -2368,25 +2374,32 @@ bool acpi_dev_ready_for_enumeration(const struct acpi_device *device) · 69 unmodified lines
23682374 EXPORT_SYMBOL_GPL(acpi_dev_ready_for_enumeration);
23692375
23702376 /**
2371− * acpi_dev_get_first_consumer_dev - Return ACPI device dependent on @supplier
2377+ * acpi_dev_get_next_consumer_dev - Return the next adev dependent on @supplier
23722378 * @supplier: Pointer to the dependee device
2379+ * @start: Pointer to the current dependent device
23732380 *
2374− * Returns the first &struct acpi_device which declares itself dependent on
2381+ * Returns the next &struct acpi_device which declares itself dependent on
23752382 * @supplier via the _DEP buffer, parsed from the acpi_dep_list.
23762383 *
2377− * The caller is responsible for putting the reference to adev when it is no
2378− * longer needed.
2384+ * If the returned adev is not passed as @start to this function, the caller is
2385+ * responsible for putting the reference to adev when it is no longer needed.
23792386 */
2380−struct acpi_device *acpi_dev_get_first_consumer_dev(struct acpi_device *supplier)
2387+struct acpi_device *acpi_dev_get_next_consumer_dev(struct acpi_device *supplier,
2388+ struct acpi_device *start)
23812389 {
2382− struct acpi_device *adev = NULL;
2390+ struct acpi_device *adev = start;
23832391
23842392 acpi_walk_dep_device_list(supplier->handle,
2385− acpi_dev_get_first_consumer_dev_cb, &adev);
2393+ acpi_dev_get_next_consumer_dev_cb, &adev);
2394+
2395+ acpi_dev_put(start);
2396+
2397+ if (adev == start)
2398+ return NULL;
23862399
23872400 return adev;
23882401 }
2389−EXPORT_SYMBOL_GPL(acpi_dev_get_first_consumer_dev);
2402+EXPORT_SYMBOL_GPL(acpi_dev_get_next_consumer_dev);
23902403
23912404 /**
23922405 * acpi_bus_scan - Add ACPI device node objects in a given namespace scope.
drivers/acpi/utils.c+27−3
@@ -793,6 +793,30 @@ bool acpi_dev_hid_uid_match(struct acpi_device *adev, · 792 unmodified lines
793793 }
794794 EXPORT_SYMBOL(acpi_dev_hid_uid_match);
795795
796+/**
797+ * acpi_dev_uid_to_integer - treat ACPI device _UID as integer
798+ * @adev: ACPI device to get _UID from
799+ * @integer: output buffer for integer
800+ *
801+ * Considers _UID as integer and converts it to @integer.
802+ *
803+ * Returns 0 on success, or negative error code otherwise.
804+ */
805+int acpi_dev_uid_to_integer(struct acpi_device *adev, u64 *integer)
806+{
807+ const char *uid;
808+
809+ if (!adev)
810+ return -ENODEV;
811+
812+ uid = acpi_device_uid(adev);
813+ if (!uid)
814+ return -ENODATA;
815+
816+ return kstrtou64(uid, 0, integer);
817+}
818+EXPORT_SYMBOL(acpi_dev_uid_to_integer);
819+
796820 /**
797821 * acpi_dev_found - Detect presence of a given ACPI device in the namespace.
798822 * @hid: Hardware ID of the device.
@@ -878,7 +902,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) · 79 unmodified lines
878902 struct acpi_dev_match_info match = {};
879903 struct device *dev;
880904
881− strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id));
905+ strscpy(match.hid[0].id, hid, sizeof(match.hid[0].id));
882906 match.uid = uid;
883907 match.hrv = hrv;
884908
@@ -911,7 +935,7 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha · 26 unmodified lines
911935 struct acpi_dev_match_info match = {};
912936 struct device *dev;
913937
914− strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id));
938+ strscpy(match.hid[0].id, hid, sizeof(match.hid[0].id));
915939 match.uid = uid;
916940 match.hrv = hrv;
917941
@@ -961,7 +985,7 @@ EXPORT_SYMBOL(acpi_video_backlight_string); · 43 unmodified lines
961985
962986 static int __init acpi_backlight(char *str)
963987 {
964− strlcpy(acpi_video_backlight_string, str,
988+ strscpy(acpi_video_backlight_string, str,
965989 sizeof(acpi_video_backlight_string));
966990 return 1;
967991 }
drivers/acpi/x86/apple.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/bitmap.h>
99 #include <linux/platform_data/x86/apple.h>
1010 #include <linux/uuid.h>
11+#include "../internal.h"
1112
1213 /* Apple _DSM device properties GUID */
1314 static const guid_t apple_prp_guid =
drivers/acpi/x86/s2idle.c+123−24
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717
1818 #include <linux/acpi.h>
1919 #include <linux/device.h>
20+#include <linux/dmi.h>
2021 #include <linux/suspend.h>
2122
2223 #include "../sleep.h"
@@ -27,6 +28,10 @@ static bool sleep_no_lps0 __read_mostly; · 4 unmodified lines
2728 module_param(sleep_no_lps0, bool, 0644);
2829 MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface");
2930
31+static bool prefer_microsoft_dsm_guid __read_mostly;
32+module_param(prefer_microsoft_dsm_guid, bool, 0644);
33+MODULE_PARM_DESC(prefer_microsoft_dsm_guid, "Prefer using Microsoft GUID in LPS0 device _DSM evaluation");
34+
3035 static const struct acpi_device_id lps0_device_ids[] = {
3136 {"PNP0D80", },
3237 {"", },
@@ -363,40 +368,132 @@ out: · 330 unmodified lines
363368 return ret;
364369 }
365370
371+struct amd_lps0_hid_device_data {
372+ const unsigned int rev_id;
373+ const bool check_off_by_one;
374+ const bool prefer_amd_guid;
375+};
376+
377+static const struct amd_lps0_hid_device_data amd_picasso = {
378+ .rev_id = 0,
379+ .check_off_by_one = true,
380+ .prefer_amd_guid = false,
381+};
382+
383+static const struct amd_lps0_hid_device_data amd_cezanne = {
384+ .rev_id = 0,
385+ .check_off_by_one = false,
386+ .prefer_amd_guid = false,
387+};
388+
389+static const struct amd_lps0_hid_device_data amd_rembrandt = {
390+ .rev_id = 2,
391+ .check_off_by_one = false,
392+ .prefer_amd_guid = true,
393+};
394+
395+static const struct acpi_device_id amd_hid_ids[] = {
396+ {"AMD0004", (kernel_ulong_t)&amd_picasso, },
397+ {"AMD0005", (kernel_ulong_t)&amd_picasso, },
398+ {"AMDI0005", (kernel_ulong_t)&amd_picasso, },
399+ {"AMDI0006", (kernel_ulong_t)&amd_cezanne, },
400+ {"AMDI0007", (kernel_ulong_t)&amd_rembrandt, },
401+ {}
402+};
403+
404+static int lps0_prefer_microsoft(const struct dmi_system_id *id)
405+{
406+ pr_debug("Preferring Microsoft GUID.\n");
407+ prefer_microsoft_dsm_guid = true;
408+ return 0;
409+}
410+
411+static const struct dmi_system_id s2idle_dmi_table[] __initconst = {
412+ {
413+ /*
414+ * ASUS TUF Gaming A17 FA707RE
415+ * https://bugzilla.kernel.org/show_bug.cgi?id=216101
416+ */
417+ .callback = lps0_prefer_microsoft,
418+ .matches = {
419+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
420+ DMI_MATCH(DMI_PRODUCT_NAME, "ASUS TUF Gaming A17"),
421+ },
422+ },
423+ {
424+ /* ASUS ROG Zephyrus G14 (2022) */
425+ .callback = lps0_prefer_microsoft,
426+ .matches = {
427+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
428+ DMI_MATCH(DMI_PRODUCT_NAME, "ROG Zephyrus G14 GA402"),
429+ },
430+ },
431+ {
432+ /*
433+ * Lenovo Yoga Slim 7 Pro X 14ARH7
434+ * https://bugzilla.kernel.org/show_bug.cgi?id=216473 : 82V2
435+ * https://bugzilla.kernel.org/show_bug.cgi?id=216438 : 82TL
436+ */
437+ .callback = lps0_prefer_microsoft,
438+ .matches = {
439+ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
440+ DMI_MATCH(DMI_PRODUCT_NAME, "82"),
441+ },
442+ },
443+ {
444+ /*
445+ * ASUSTeK COMPUTER INC. ROG Flow X13 GV301RE_GV301RE
446+ * https://gitlab.freedesktop.org/drm/amd/-/issues/2148
447+ */
448+ .callback = lps0_prefer_microsoft,
449+ .matches = {
450+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
451+ DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow X13 GV301"),
452+ },
453+ },
454+ {
455+ /*
456+ * ASUSTeK COMPUTER INC. ROG Flow X16 GV601RW_GV601RW
457+ * https://gitlab.freedesktop.org/drm/amd/-/issues/2148
458+ */
459+ .callback = lps0_prefer_microsoft,
460+ .matches = {
461+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
462+ DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow X16 GV601"),
463+ },
464+ },
465+ {}
466+};
467+
366468 static int lps0_device_attach(struct acpi_device *adev,
367469 const struct acpi_device_id *not_used)
368470 {
369471 if (lps0_device_handle)
370472 return 0;
371473
474+ lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
475+ ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
476+ &lps0_dsm_guid_microsoft);
372477 if (acpi_s2idle_vendor_amd()) {
373− /* AMD0004, AMD0005, AMDI0005:
374− * - Should use rev_id 0x0
375− * - function mask > 0x3: Should use AMD method, but has off by one bug
376− * - function mask = 0x3: Should use Microsoft method
377− * AMDI0006:
378− * - should use rev_id 0x0
379− * - function mask = 0x3: Should use Microsoft method
380− * AMDI0007:
381− * - Should use rev_id 0x2
382− * - Should only use AMD method
383− */
384− const char *hid = acpi_device_hid(adev);
385− rev_id = strcmp(hid, "AMDI0007") ? 0 : 2;
478+ static const struct acpi_device_id *dev_id;
479+ const struct amd_lps0_hid_device_data *data;
480+
481+ for (dev_id = &amd_hid_ids[0]; dev_id->id[0]; dev_id++)
482+ if (acpi_dev_hid_uid_match(adev, dev_id->id, NULL))
483+ break;
484+ if (dev_id->id[0])
485+ data = (const struct amd_lps0_hid_device_data *) dev_id->driver_data;
486+ else
487+ data = &amd_rembrandt;
488+ rev_id = data->rev_id;
386489 lps0_dsm_func_mask = validate_dsm(adev->handle,
387490 ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
388− lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
389− ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
390− &lps0_dsm_guid_microsoft);
391− if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") ||
392− !strcmp(hid, "AMD0005") ||
393− !strcmp(hid, "AMDI0005"))) {
491+ if (lps0_dsm_func_mask > 0x3 && data->check_off_by_one) {
394492 lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
395493 acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
396494 ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
397− } else if (lps0_dsm_func_mask_microsoft > 0 &&
398− (!strcmp(hid, "AMDI0007") ||
399− !strcmp(hid, "AMDI0008"))) {
495+ } else if (lps0_dsm_func_mask_microsoft > 0 && data->prefer_amd_guid &&
496+ !prefer_microsoft_dsm_guid) {
400497 lps0_dsm_func_mask_microsoft = -EINVAL;
401498 acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
402499 }
@@ -404,7 +501,8 @@ static int lps0_device_attach(struct acpi_device *adev, · 1 unmodified line
404501 rev_id = 1;
405502 lps0_dsm_func_mask = validate_dsm(adev->handle,
406503 ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid);
407− lps0_dsm_func_mask_microsoft = -EINVAL;
504+ if (!prefer_microsoft_dsm_guid)
505+ lps0_dsm_func_mask_microsoft = -EINVAL;
408506 }
409507
410508 if (lps0_dsm_func_mask < 0 && lps0_dsm_func_mask_microsoft < 0)
@@ -533,8 +631,9 @@ static const struct platform_s2idle_ops acpi_s2idle_ops_lps0 = { · 122 unmodified lines
533631 .end = acpi_s2idle_end,
534632 };
535633
536−void acpi_s2idle_setup(void)
634+void __init acpi_s2idle_setup(void)
537635 {
636+ dmi_check_system(s2idle_dmi_table);
538637 acpi_scan_add_handler(&lps0_handler);
539638 s2idle_set_ops(&acpi_s2idle_ops_lps0);
540639 }
drivers/acpi/x86/utils.c+28−5
@@ -207,9 +207,26 @@ static const struct x86_cpu_id storage_d3_cpu_ids[] = { · 206 unmodified lines
207207 {}
208208 };
209209
210+static const struct dmi_system_id force_storage_d3_dmi[] = {
211+ {
212+ /*
213+ * _ADR is ambiguous between GPP1.DEV0 and GPP1.NVME
214+ * but .NVME is needed to get StorageD3Enable node
215+ * https://bugzilla.kernel.org/show_bug.cgi?id=216440
216+ */
217+ .matches = {
218+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
219+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"),
220+ }
221+ },
222+ {}
223+};
224+
210225 bool force_storage_d3(void)
211226 {
212− return x86_match_cpu(storage_d3_cpu_ids);
227+ const struct dmi_system_id *dmi_id = dmi_first_match(force_storage_d3_dmi);
228+
229+ return dmi_id || x86_match_cpu(storage_d3_cpu_ids);
213230 }
214231
215232 /*
@@ -351,11 +368,17 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s · 135 unmodified lines
351368 struct acpi_device *adev = ACPI_COMPANION(controller_parent);
352369 const struct dmi_system_id *dmi_id;
353370 long quirks = 0;
371+ u64 uid;
372+ int ret;
354373
355374 *skip = false;
356375
357− /* !dev_is_platform() to not match on PNP enumerated debug UARTs */
358− if (!adev || !adev->pnp.unique_id || !dev_is_platform(controller_parent))
376+ ret = acpi_dev_uid_to_integer(adev, &uid);
377+ if (ret)
378+ return 0;
379+
380+ /* to not match on PNP enumerated debug UARTs */
381+ if (!dev_is_platform(controller_parent))
359382 return 0;
360383
361384 dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
@@ -363,10 +386,10 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s · 1 unmodified line
363386 quirks = (unsigned long)dmi_id->driver_data;
364387
365388 if (quirks & ACPI_QUIRK_UART1_TTY_UART2_SKIP) {
366− if (!strcmp(adev->pnp.unique_id, "1"))
389+ if (uid == 1)
367390 return -ENODEV; /* Create tty cdev instead of serdev */
368391
369− if (!strcmp(adev->pnp.unique_id, "2"))
392+ if (uid == 2)
370393 *skip = true;
371394 }
372395
drivers/ata/ahci_imx.c+10−5
@@ -327,7 +327,7 @@ static int read_adc_sum(void *dev, u16 rtune_ctl_reg, void __iomem * mmio) · 326 unmodified lines
327327 }
328328
329329 /* SATA AHCI temperature monitor */
330−static int sata_ahci_read_temperature(void *dev, int *temp)
330+static int __sata_ahci_read_temperature(void *dev, int *temp)
331331 {
332332 u16 mpll_test_reg, rtune_ctl_reg, dac_ctl_reg, read_sum;
333333 u32 str1, str2, str3, str4;
@@ -416,6 +416,11 @@ static int sata_ahci_read_temperature(void *dev, int *temp) · 82 unmodified lines
416416 return 0;
417417 }
418418
419+static int sata_ahci_read_temperature(struct thermal_zone_device *tz, int *temp)
420+{
421+ return __sata_ahci_read_temperature(tz->devdata, temp);
422+}
423+
419424 static ssize_t sata_ahci_show_temp(struct device *dev,
420425 struct device_attribute *da,
421426 char *buf)
@@ -423,14 +428,14 @@ static ssize_t sata_ahci_show_temp(struct device *dev, · 1 unmodified line
423428 unsigned int temp = 0;
424429 int err;
425430
426− err = sata_ahci_read_temperature(dev, &temp);
431+ err = __sata_ahci_read_temperature(dev, &temp);
427432 if (err < 0)
428433 return err;
429434
430435 return sprintf(buf, "%u\n", temp);
431436 }
432437
433−static const struct thermal_zone_of_device_ops fsl_sata_ahci_of_thermal_ops = {
438+static const struct thermal_zone_device_ops fsl_sata_ahci_of_thermal_ops = {
434439 .get_temp = sata_ahci_read_temperature,
435440 };
436441
@@ -1131,8 +1136,8 @@ static int imx_ahci_probe(struct platform_device *pdev) · 694 unmodified lines
11311136 ret = PTR_ERR(hwmon_dev);
11321137 goto disable_clk;
11331138 }
1134− devm_thermal_zone_of_sensor_register(hwmon_dev, 0, hwmon_dev,
1135− &fsl_sata_ahci_of_thermal_ops);
1139+ devm_thermal_of_zone_register(hwmon_dev, 0, hwmon_dev,
1140+ &fsl_sata_ahci_of_thermal_ops);
11361141 dev_info(dev, "%s: sensor 'sata_ahci'\n", dev_name(hwmon_dev));
11371142 }
11381143
drivers/base/arch_topology.c+1−1
@@ -353,7 +353,7 @@ void topology_init_cpu_capacity_cppc(void) · 352 unmodified lines
353353 struct cppc_perf_caps perf_caps;
354354 int cpu;
355355
356− if (likely(acpi_disabled || !acpi_cpc_valid()))
356+ if (likely(!acpi_cpc_valid()))
357357 return;
358358
359359 raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity),
drivers/base/power/runtime.c+5−2
@@ -792,10 +792,13 @@ static int rpm_resume(struct device *dev, int rpmflags) · 791 unmodified lines
792792 DEFINE_WAIT(wait);
793793
794794 if (rpmflags & (RPM_ASYNC | RPM_NOWAIT)) {
795− if (dev->power.runtime_status == RPM_SUSPENDING)
795+ if (dev->power.runtime_status == RPM_SUSPENDING) {
796796 dev->power.deferred_resume = true;
797− else
797+ if (rpmflags & RPM_NOWAIT)
798+ retval = -EINPROGRESS;
799+ } else {
798800 retval = -EINPROGRESS;
801+ }
799802 goto out;
800803 }
801804
drivers/base/power/wakeup.c+2−0
@@ -944,6 +944,8 @@ void pm_system_irq_wakeup(unsigned int irq_number) · 943 unmodified lines
944944 else
945945 irq_number = 0;
946946
947+ pm_pr_dbg("Triggering wakeup from IRQ %d\n", irq_number);
948+
947949 raw_spin_unlock_irqrestore(&wakeup_irq_lock, flags);
948950
949951 if (irq_number)
drivers/block/virtio_blk.c+5−6
@@ -322,14 +322,14 @@ static blk_status_t virtblk_prep_rq(struct blk_mq_hw_ctx *hctx, · 321 unmodified lines
322322 if (unlikely(status))
323323 return status;
324324
325− blk_mq_start_request(req);
326−
327325 vbr->sg_table.nents = virtblk_map_data(hctx, req, vbr);
328326 if (unlikely(vbr->sg_table.nents < 0)) {
329327 virtblk_cleanup_cmd(req);
330328 return BLK_STS_RESOURCE;
331329 }
332330
331+ blk_mq_start_request(req);
332+
333333 return BLK_STS_OK;
334334 }
335335
@@ -391,8 +391,7 @@ static bool virtblk_prep_rq_batch(struct request *req) · 55 unmodified lines
391391 }
392392
393393 static bool virtblk_add_req_batch(struct virtio_blk_vq *vq,
394− struct request **rqlist,
395− struct request **requeue_list)
394+ struct request **rqlist)
396395 {
397396 unsigned long flags;
398397 int err;
@@ -408,7 +407,7 @@ static bool virtblk_add_req_batch(struct virtio_blk_vq *vq, · 9 unmodified lines
408407 if (err) {
409408 virtblk_unmap_data(req, vbr);
410409 virtblk_cleanup_cmd(req);
411− rq_list_add(requeue_list, req);
410+ blk_mq_requeue_request(req, true);
412411 }
413412 }
414413
@@ -436,7 +435,7 @@ static void virtio_queue_rqs(struct request **rqlist) · 21 unmodified lines
436435
437436 if (!next || req->mq_hctx != next->mq_hctx) {
438437 req->rq_next = NULL;
439− kick = virtblk_add_req_batch(vq, rqlist, &requeue_list);
438+ kick = virtblk_add_req_batch(vq, rqlist);
440439 if (kick)
441440 virtqueue_notify(vq->vq);
442441
drivers/bluetooth/btintel.c+11−9
@@ -449,6 +449,7 @@ static int btintel_version_info_tlv(struct hci_dev *hdev, · 448 unmodified lines
449449 case 0x17: /* TyP */
450450 case 0x18: /* Slr */
451451 case 0x19: /* Slr-F */
452+ case 0x1b: /* Mgr */
452453 break;
453454 default:
454455 bt_dev_err(hdev, "Unsupported Intel hardware variant (0x%x)",
@@ -2330,6 +2331,7 @@ static void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant) · 1875 unmodified lines
23302331 case 0x17:
23312332 case 0x18:
23322333 case 0x19:
2334+ case 0x1b:
23332335 hci_set_msft_opcode(hdev, 0xFC1E);
23342336 break;
23352337 default:
@@ -2439,15 +2441,20 @@ static int btintel_setup_combined(struct hci_dev *hdev) · 103 unmodified lines
24392441 INTEL_ROM_LEGACY_NO_WBS_SUPPORT))
24402442 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
24412443 &hdev->quirks);
2444+ if (ver.hw_variant == 0x08 && ver.fw_variant == 0x22)
2445+ set_bit(HCI_QUIRK_VALID_LE_STATES,
2446+ &hdev->quirks);
24422447
24432448 err = btintel_legacy_rom_setup(hdev, &ver);
24442449 break;
24452450 case 0x0b: /* SfP */
2446− case 0x0c: /* WsP */
24472451 case 0x11: /* JfP */
24482452 case 0x12: /* ThP */
24492453 case 0x13: /* HrP */
24502454 case 0x14: /* CcP */
2455+ set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
2456+ fallthrough;
2457+ case 0x0c: /* WsP */
24512458 /* Apply the device specific HCI quirks
24522459 *
24532460 * All Legacy bootloader devices support WBS
@@ -2455,11 +2462,6 @@ static int btintel_setup_combined(struct hci_dev *hdev) · 1 unmodified line
24552462 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
24562463 &hdev->quirks);
24572464
2458− /* Valid LE States quirk for JfP/ThP familiy */
2459− if (ver.hw_variant == 0x11 || ver.hw_variant == 0x12)
2460− set_bit(HCI_QUIRK_VALID_LE_STATES,
2461− &hdev->quirks);
2462−
24632465 /* Setup MSFT Extension support */
24642466 btintel_set_msft_opcode(hdev, ver.hw_variant);
24652467
@@ -2530,9 +2532,8 @@ static int btintel_setup_combined(struct hci_dev *hdev) · 64 unmodified lines
25302532 */
25312533 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
25322534
2533− /* Valid LE States quirk for JfP/ThP familiy */
2534− if (ver.hw_variant == 0x11 || ver.hw_variant == 0x12)
2535− set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
2535+ /* Set Valid LE States quirk */
2536+ set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
25362537
25372538 /* Setup MSFT Extension support */
25382539 btintel_set_msft_opcode(hdev, ver.hw_variant);
@@ -2542,6 +2543,7 @@ static int btintel_setup_combined(struct hci_dev *hdev) · 3 unmodified lines
25422543 case 0x17:
25432544 case 0x18:
25442545 case 0x19:
2546+ case 0x1b:
25452547 /* Display version information of TLV type */
25462548 btintel_version_info_tlv(hdev, &ver_tlv);
25472549
drivers/bluetooth/btusb.c+33−5
@@ -426,6 +426,8 @@ static const struct usb_device_id blacklist_table[] = { · 425 unmodified lines
426426 BTUSB_WIDEBAND_SPEECH },
427427 { USB_DEVICE(0x04ca, 0x4006), .driver_info = BTUSB_REALTEK |
428428 BTUSB_WIDEBAND_SPEECH },
429+ { USB_DEVICE(0x0cb8, 0xc549), .driver_info = BTUSB_REALTEK |
430+ BTUSB_WIDEBAND_SPEECH },
429431
430432 /* Realtek 8852CE Bluetooth devices */
431433 { USB_DEVICE(0x04ca, 0x4007), .driver_info = BTUSB_REALTEK |
@@ -438,6 +440,8 @@ static const struct usb_device_id blacklist_table[] = { · 6 unmodified lines
438440 BTUSB_WIDEBAND_SPEECH },
439441 { USB_DEVICE(0x13d3, 0x3586), .driver_info = BTUSB_REALTEK |
440442 BTUSB_WIDEBAND_SPEECH },
443+ { USB_DEVICE(0x13d3, 0x3592), .driver_info = BTUSB_REALTEK |
444+ BTUSB_WIDEBAND_SPEECH },
441445
442446 /* Realtek Bluetooth devices */
443447 { USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
@@ -466,6 +470,9 @@ static const struct usb_device_id blacklist_table[] = { · 22 unmodified lines
466470 { USB_DEVICE(0x0489, 0xe0c8), .driver_info = BTUSB_MEDIATEK |
467471 BTUSB_WIDEBAND_SPEECH |
468472 BTUSB_VALID_LE_STATES },
473+ { USB_DEVICE(0x0489, 0xe0e0), .driver_info = BTUSB_MEDIATEK |
474+ BTUSB_WIDEBAND_SPEECH |
475+ BTUSB_VALID_LE_STATES },
469476 { USB_DEVICE(0x04ca, 0x3802), .driver_info = BTUSB_MEDIATEK |
470477 BTUSB_WIDEBAND_SPEECH |
471478 BTUSB_VALID_LE_STATES },
@@ -478,9 +485,18 @@ static const struct usb_device_id blacklist_table[] = { · 6 unmodified lines
478485 { USB_DEVICE(0x13d3, 0x3567), .driver_info = BTUSB_MEDIATEK |
479486 BTUSB_WIDEBAND_SPEECH |
480487 BTUSB_VALID_LE_STATES },
488+ { USB_DEVICE(0x13d3, 0x3578), .driver_info = BTUSB_MEDIATEK |
489+ BTUSB_WIDEBAND_SPEECH |
490+ BTUSB_VALID_LE_STATES },
491+ { USB_DEVICE(0x13d3, 0x3583), .driver_info = BTUSB_MEDIATEK |
492+ BTUSB_WIDEBAND_SPEECH |
493+ BTUSB_VALID_LE_STATES },
481494 { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK |
482495 BTUSB_WIDEBAND_SPEECH |
483496 BTUSB_VALID_LE_STATES },
497+ { USB_DEVICE(0x0e8d, 0x0608), .driver_info = BTUSB_MEDIATEK |
498+ BTUSB_WIDEBAND_SPEECH |
499+ BTUSB_VALID_LE_STATES },
484500
485501 /* MediaTek MT7922A Bluetooth devices */
486502 { USB_DEVICE(0x0489, 0xe0d8), .driver_info = BTUSB_MEDIATEK |
@@ -516,19 +532,17 @@ static const struct usb_device_id blacklist_table[] = { · 29 unmodified lines
516532 { USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK },
517533 { USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK },
518534
519− /* Additional Realtek 8761B Bluetooth devices */
535+ /* Additional Realtek 8761BUV Bluetooth devices */
520536 { USB_DEVICE(0x2357, 0x0604), .driver_info = BTUSB_REALTEK |
521537 BTUSB_WIDEBAND_SPEECH },
522−
523− /* Additional Realtek 8761BU Bluetooth devices */
524538 { USB_DEVICE(0x0b05, 0x190e), .driver_info = BTUSB_REALTEK |
525539 BTUSB_WIDEBAND_SPEECH },
526540 { USB_DEVICE(0x2550, 0x8761), .driver_info = BTUSB_REALTEK |
527541 BTUSB_WIDEBAND_SPEECH },
528−
529− /* Additional Realtek 8761BUV Bluetooth devices */
530542 { USB_DEVICE(0x0bda, 0x8771), .driver_info = BTUSB_REALTEK |
531543 BTUSB_WIDEBAND_SPEECH },
544+ { USB_DEVICE(0x7392, 0xc611), .driver_info = BTUSB_REALTEK |
545+ BTUSB_WIDEBAND_SPEECH },
532546
533547 /* Additional Realtek 8821AE Bluetooth devices */
534548 { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK },
@@ -2477,15 +2491,29 @@ static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev, · 1942 unmodified lines
24772491
24782492 set_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags);
24792493
2494+ /* WMT cmd/event doesn't follow up the generic HCI cmd/event handling,
2495+ * it needs constantly polling control pipe until the host received the
2496+ * WMT event, thus, we should require to specifically acquire PM counter
2497+ * on the USB to prevent the interface from entering auto suspended
2498+ * while WMT cmd/event in progress.
2499+ */
2500+ err = usb_autopm_get_interface(data->intf);
2501+ if (err < 0)
2502+ goto err_free_wc;
2503+
24802504 err = __hci_cmd_send(hdev, 0xfc6f, hlen, wc);
24812505
24822506 if (err < 0) {
24832507 clear_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags);
2508+ usb_autopm_put_interface(data->intf);
24842509 goto err_free_wc;
24852510 }
24862511
24872512 /* Submit control IN URB on demand to process the WMT event */
24882513 err = btusb_mtk_submit_wmt_recv_urb(hdev);
2514+
2515+ usb_autopm_put_interface(data->intf);
2516+
24892517 if (err < 0)
24902518 goto err_free_wc;
24912519
drivers/bluetooth/hci_ldisc.c+5−2
@@ -493,6 +493,11 @@ static int hci_uart_tty_open(struct tty_struct *tty) · 492 unmodified lines
493493 BT_ERR("Can't allocate control structure");
494494 return -ENFILE;
495495 }
496+ if (percpu_init_rwsem(&hu->proto_lock)) {
497+ BT_ERR("Can't allocate semaphore structure");
498+ kfree(hu);
499+ return -ENOMEM;
500+ }
496501
497502 tty->disc_data = hu;
498503 hu->tty = tty;
@@ -505,8 +510,6 @@ static int hci_uart_tty_open(struct tty_struct *tty) · 6 unmodified lines
505510 INIT_WORK(&hu->init_ready, hci_uart_init_work);
506511 INIT_WORK(&hu->write_work, hci_uart_write_work);
507512
508− percpu_init_rwsem(&hu->proto_lock);
509−
510513 /* Flush any pending characters in the driver */
511514 tty_driver_flush_buffer(tty);
512515
drivers/bluetooth/hci_serdev.c+7−3
@@ -310,11 +310,12 @@ int hci_uart_register_device(struct hci_uart *hu, · 309 unmodified lines
310310
311311 serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
312312
313+ if (percpu_init_rwsem(&hu->proto_lock))
314+ return -ENOMEM;
315+
313316 err = serdev_device_open(hu->serdev);
314317 if (err)
315− return err;
316−
317− percpu_init_rwsem(&hu->proto_lock);
318+ goto err_rwsem;
318319
319320 err = p->open(hu);
320321 if (err)
@@ -389,6 +390,8 @@ err_alloc: · 68 unmodified lines
389390 p->close(hu);
390391 err_open:
391392 serdev_device_close(hu->serdev);
393+err_rwsem:
394+ percpu_free_rwsem(&hu->proto_lock);
392395 return err;
393396 }
394397 EXPORT_SYMBOL_GPL(hci_uart_register_device);
@@ -410,5 +413,6 @@ void hci_uart_unregister_device(struct hci_uart *hu) · 15 unmodified lines
410413 clear_bit(HCI_UART_PROTO_READY, &hu->flags);
411414 serdev_device_close(hu->serdev);
412415 }
416+ percpu_free_rwsem(&hu->proto_lock);
413417 }
414418 EXPORT_SYMBOL_GPL(hci_uart_unregister_device);
drivers/clk/bcm/clk-iproc-pll.c+8−4
@@ -726,6 +726,7 @@ void iproc_pll_clk_setup(struct device_node *node, · 725 unmodified lines
726726 const char *parent_name;
727727 struct iproc_clk *iclk_array;
728728 struct clk_hw_onecell_data *clk_data;
729+ const char *clk_name;
729730
730731 if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl))
731732 return;
@@ -773,7 +774,12 @@ void iproc_pll_clk_setup(struct device_node *node, · 41 unmodified lines
773774 iclk = &iclk_array[0];
774775 iclk->pll = pll;
775776
776− init.name = node->name;
777+ ret = of_property_read_string_index(node, "clock-output-names",
778+ 0, &clk_name);
779+ if (WARN_ON(ret))
780+ goto err_pll_register;
781+
782+ init.name = clk_name;
777783 init.ops = &iproc_pll_ops;
778784 init.flags = 0;
779785 parent_name = of_clk_get_parent_name(node, 0);
@@ -793,13 +799,11 @@ void iproc_pll_clk_setup(struct device_node *node, · 13 unmodified lines
793799 goto err_pll_register;
794800
795801 clk_data->hws[0] = &iclk->hw;
802+ parent_name = clk_name;
796803
797804 /* now initialize and register all leaf clocks */
798805 for (i = 1; i < num_clks; i++) {
799− const char *clk_name;
800−
801806 memset(&init, 0, sizeof(init));
802− parent_name = node->name;
803807
804808 ret = of_property_read_string_index(node, "clock-output-names",
805809 i, &clk_name);
drivers/clk/clk-tps68470.c+9−4
@@ -200,7 +200,9 @@ static int tps68470_clk_probe(struct platform_device *pdev) · 199 unmodified lines
200200 .flags = CLK_SET_RATE_GATE,
201201 };
202202 struct tps68470_clkdata *tps68470_clkdata;
203+ struct tps68470_clk_consumer *consumer;
203204 int ret;
205+ int i;
204206
205207 tps68470_clkdata = devm_kzalloc(&pdev->dev, sizeof(*tps68470_clkdata),
206208 GFP_KERNEL);
@@ -223,10 +225,13 @@ static int tps68470_clk_probe(struct platform_device *pdev) · 16 unmodified lines
223225 return ret;
224226
225227 if (pdata) {
226− ret = devm_clk_hw_register_clkdev(&pdev->dev,
227− &tps68470_clkdata->clkout_hw,
228− pdata->consumer_con_id,
229− pdata->consumer_dev_name);
228+ for (i = 0; i < pdata->n_consumers; i++) {
229+ consumer = &pdata->consumers[i];
230+ ret = devm_clk_hw_register_clkdev(&pdev->dev,
231+ &tps68470_clkdata->clkout_hw,
232+ consumer->consumer_con_id,
233+ consumer->consumer_dev_name);
234+ }
230235 }
231236
232237 return ret;
drivers/clk/imx/clk-imx6sx.c+2−2
@@ -280,13 +280,13 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) · 279 unmodified lines
280280 hws[IMX6SX_CLK_SSI3_SEL] = imx_clk_hw_mux("ssi3_sel", base + 0x1c, 14, 2, ssi_sels, ARRAY_SIZE(ssi_sels));
281281 hws[IMX6SX_CLK_SSI2_SEL] = imx_clk_hw_mux("ssi2_sel", base + 0x1c, 12, 2, ssi_sels, ARRAY_SIZE(ssi_sels));
282282 hws[IMX6SX_CLK_SSI1_SEL] = imx_clk_hw_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels));
283− hws[IMX6SX_CLK_QSPI1_SEL] = imx_clk_hw_mux_flags("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels), CLK_SET_RATE_PARENT);
283+ hws[IMX6SX_CLK_QSPI1_SEL] = imx_clk_hw_mux("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels));
284284 hws[IMX6SX_CLK_PERCLK_SEL] = imx_clk_hw_mux("perclk_sel", base + 0x1c, 6, 1, perclk_sels, ARRAY_SIZE(perclk_sels));
285285 hws[IMX6SX_CLK_VID_SEL] = imx_clk_hw_mux("vid_sel", base + 0x20, 21, 3, vid_sels, ARRAY_SIZE(vid_sels));
286286 hws[IMX6SX_CLK_ESAI_SEL] = imx_clk_hw_mux("esai_sel", base + 0x20, 19, 2, audio_sels, ARRAY_SIZE(audio_sels));
287287 hws[IMX6SX_CLK_CAN_SEL] = imx_clk_hw_mux("can_sel", base + 0x20, 8, 2, can_sels, ARRAY_SIZE(can_sels));
288288 hws[IMX6SX_CLK_UART_SEL] = imx_clk_hw_mux("uart_sel", base + 0x24, 6, 1, uart_sels, ARRAY_SIZE(uart_sels));
289− hws[IMX6SX_CLK_QSPI2_SEL] = imx_clk_hw_mux_flags("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels), CLK_SET_RATE_PARENT);
289+ hws[IMX6SX_CLK_QSPI2_SEL] = imx_clk_hw_mux("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels));
290290 hws[IMX6SX_CLK_SPDIF_SEL] = imx_clk_hw_mux("spdif_sel", base + 0x30, 20, 2, audio_sels, ARRAY_SIZE(audio_sels));
291291 hws[IMX6SX_CLK_AUDIO_SEL] = imx_clk_hw_mux("audio_sel", base + 0x30, 7, 2, audio_sels, ARRAY_SIZE(audio_sels));
292292 hws[IMX6SX_CLK_ENET_PRE_SEL] = imx_clk_hw_mux("enet_pre_sel", base + 0x34, 15, 3, enet_pre_sels, ARRAY_SIZE(enet_pre_sels));
drivers/clk/imx/clk-imx93.c+1−1
@@ -332,7 +332,7 @@ static struct platform_driver imx93_clk_driver = { · 331 unmodified lines
332332 .driver = {
333333 .name = "imx93-ccm",
334334 .suppress_bind_attrs = true,
335− .of_match_table = of_match_ptr(imx93_clk_of_match),
335+ .of_match_table = imx93_clk_of_match,
336336 },
337337 };
338338 module_platform_driver(imx93_clk_driver);
drivers/clk/ingenic/tcu.c+5−10
@@ -101,15 +101,11 @@ static bool ingenic_tcu_enable_regs(struct clk_hw *hw) · 100 unmodified lines
101101 bool enabled = false;
102102
103103 /*
104− * If the SoC has no global TCU clock, we must ungate the channel's
105− * clock to be able to access its registers.
106− * If we have a TCU clock, it will be enabled automatically as it has
107− * been attached to the regmap.
104+ * According to the programming manual, a timer channel's registers can
105+ * only be accessed when the channel's stop bit is clear.
108106 */
109− if (!tcu->clk) {
110− enabled = !!ingenic_tcu_is_enabled(hw);
111− regmap_write(tcu->map, TCU_REG_TSCR, BIT(info->gate_bit));
112− }
107+ enabled = !!ingenic_tcu_is_enabled(hw);
108+ regmap_write(tcu->map, TCU_REG_TSCR, BIT(info->gate_bit));
113109
114110 return enabled;
115111 }
@@ -120,8 +116,7 @@ static void ingenic_tcu_disable_regs(struct clk_hw *hw) · 4 unmodified lines
120116 const struct ingenic_tcu_clk_info *info = tcu_clk->info;
121117 struct ingenic_tcu *tcu = tcu_clk->tcu;
122118
123− if (!tcu->clk)
124− regmap_write(tcu->map, TCU_REG_TSSR, BIT(info->gate_bit));
119+ regmap_write(tcu->map, TCU_REG_TSSR, BIT(info->gate_bit));
125120 }
126121
127122 static u8 ingenic_tcu_get_parent(struct clk_hw *hw)
drivers/clk/microchip/clk-mpfs.c+9−2
@@ -239,6 +239,11 @@ static const struct clk_ops mpfs_clk_cfg_ops = { · 238 unmodified lines
239239 .hw.init = CLK_HW_INIT(_name, _parent, &mpfs_clk_cfg_ops, 0), \
240240 }
241241
242+#define CLK_CPU_OFFSET 0u
243+#define CLK_AXI_OFFSET 1u
244+#define CLK_AHB_OFFSET 2u
245+#define CLK_RTCREF_OFFSET 3u
246+
242247 static struct mpfs_cfg_hw_clock mpfs_cfg_clks[] = {
243248 CLK_CFG(CLK_CPU, "clk_cpu", "clk_msspll", 0, 2, mpfs_div_cpu_axi_table, 0,
244249 REG_CLOCK_CONFIG_CR),
@@ -362,7 +367,7 @@ static const struct clk_ops mpfs_periph_clk_ops = { · 117 unmodified lines
362367 _flags), \
363368 }
364369
365−#define PARENT_CLK(PARENT) (&mpfs_cfg_clks[CLK_##PARENT].hw)
370+#define PARENT_CLK(PARENT) (&mpfs_cfg_clks[CLK_##PARENT##_OFFSET].hw)
366371
367372 /*
368373 * Critical clocks:
@@ -370,6 +375,8 @@ static const struct clk_ops mpfs_periph_clk_ops = { · 1 unmodified line
370375 * trap handler
371376 * - CLK_MMUART0: reserved by the hss
372377 * - CLK_DDRC: provides clock to the ddr subsystem
378+ * - CLK_RTC: the onboard RTC's AHB bus clock must be kept running as the rtc will stop
379+ * if the AHB interface clock is disabled
373380 * - CLK_FICx: these provide the processor side clocks to the "FIC" (Fabric InterConnect)
374381 * clock domain crossers which provide the interface to the FPGA fabric. Disabling them
375382 * causes the FPGA fabric to go into reset.
@@ -394,7 +401,7 @@ static struct mpfs_periph_hw_clock mpfs_periph_clks[] = { · 18 unmodified lines
394401 CLK_PERIPH(CLK_CAN0, "clk_periph_can0", PARENT_CLK(AHB), 14, 0),
395402 CLK_PERIPH(CLK_CAN1, "clk_periph_can1", PARENT_CLK(AHB), 15, 0),
396403 CLK_PERIPH(CLK_USB, "clk_periph_usb", PARENT_CLK(AHB), 16, 0),
397− CLK_PERIPH(CLK_RTC, "clk_periph_rtc", PARENT_CLK(AHB), 18, 0),
404+ CLK_PERIPH(CLK_RTC, "clk_periph_rtc", PARENT_CLK(AHB), 18, CLK_IS_CRITICAL),
398405 CLK_PERIPH(CLK_QSPI, "clk_periph_qspi", PARENT_CLK(AHB), 19, 0),
399406 CLK_PERIPH(CLK_GPIO0, "clk_periph_gpio0", PARENT_CLK(AHB), 20, 0),
400407 CLK_PERIPH(CLK_GPIO1, "clk_periph_gpio1", PARENT_CLK(AHB), 21, 0),
drivers/clk/sunxi-ng/ccu-sun50i-h6.c+6−2
@@ -1191,9 +1191,13 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev) · 1190 unmodified lines
11911191 if (IS_ERR(reg))
11921192 return PTR_ERR(reg);
11931193
1194− /* Force PLL_GPU output divider bits to 0 */
1194+ /*
1195+ * Force PLL_GPU output divider bits to 0 and adjust
1196+ * multiplier to sensible default value of 432 MHz.
1197+ */
11951198 val = readl(reg + SUN50I_H6_PLL_GPU_REG);
1196− val &= ~BIT(0);
1199+ val &= ~(GENMASK(15, 8) | BIT(0));
1200+ val |= 17 << 8;
11971201 writel(val, reg + SUN50I_H6_PLL_GPU_REG);
11981202
11991203 /* Force GPU_CLK divider bits to 0 */
drivers/cpufreq/amd-pstate.c+22−19
@@ -46,8 +46,8 @@ · 45 unmodified lines
4646 #include <asm/cpu_device_id.h>
4747 #include "amd-pstate-trace.h"
4848
49−#define AMD_PSTATE_TRANSITION_LATENCY 0x20000
50−#define AMD_PSTATE_TRANSITION_DELAY 500
49+#define AMD_PSTATE_TRANSITION_LATENCY 20000
50+#define AMD_PSTATE_TRANSITION_DELAY 1000
5151
5252 /*
5353 * TODO: We need more time to fine tune processors with shared memory solution
@@ -120,7 +120,7 @@ struct amd_cpudata { · 66 unmodified lines
120120 struct amd_aperf_mperf cur;
121121 struct amd_aperf_mperf prev;
122122
123− u64 freq;
123+ u64 freq;
124124 bool boost_supported;
125125 };
126126
@@ -152,6 +152,7 @@ static inline int amd_pstate_enable(bool enable) · 25 unmodified lines
152152 static int pstate_init_perf(struct amd_cpudata *cpudata)
153153 {
154154 u64 cap1;
155+ u32 highest_perf;
155156
156157 int ret = rdmsrl_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1,
157158 &cap1);
@@ -163,7 +164,11 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) · 5 unmodified lines
163164 *
164165 * CPPC entry doesn't indicate the highest performance in some ASICs.
165166 */
166− WRITE_ONCE(cpudata->highest_perf, amd_get_highest_perf());
167+ highest_perf = amd_get_highest_perf();
168+ if (highest_perf > AMD_CPPC_HIGHEST_PERF(cap1))
169+ highest_perf = AMD_CPPC_HIGHEST_PERF(cap1);
170+
171+ WRITE_ONCE(cpudata->highest_perf, highest_perf);
167172
168173 WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1));
169174 WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1));
@@ -175,12 +180,17 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) · 5 unmodified lines
175180 static int cppc_init_perf(struct amd_cpudata *cpudata)
176181 {
177182 struct cppc_perf_caps cppc_perf;
183+ u32 highest_perf;
178184
179185 int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf);
180186 if (ret)
181187 return ret;
182188
183− WRITE_ONCE(cpudata->highest_perf, amd_get_highest_perf());
189+ highest_perf = amd_get_highest_perf();
190+ if (highest_perf > cppc_perf.highest_perf)
191+ highest_perf = cppc_perf.highest_perf;
192+
193+ WRITE_ONCE(cpudata->highest_perf, highest_perf);
184194
185195 WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf);
186196 WRITE_ONCE(cpudata->lowest_nonlinear_perf,
@@ -269,6 +279,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, · 82 unmodified lines
269279 u64 prev = READ_ONCE(cpudata->cppc_req_cached);
270280 u64 value = prev;
271281
282+ des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
272283 value &= ~AMD_CPPC_MIN_PERF(~0L);
273284 value |= AMD_CPPC_MIN_PERF(min_perf);
274285
@@ -312,7 +323,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy, · 37 unmodified lines
312323 return -ENODEV;
313324
314325 cap_perf = READ_ONCE(cpudata->highest_perf);
315− min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
326+ min_perf = READ_ONCE(cpudata->lowest_perf);
316327 max_perf = cap_perf;
317328
318329 freqs.old = policy->cur;
@@ -357,8 +368,6 @@ static void amd_pstate_adjust_perf(unsigned int cpu, · 38 unmodified lines
357368 if (max_perf < min_perf)
358369 max_perf = min_perf;
359370
360− des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
361−
362371 amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true);
363372 }
364373
@@ -555,9 +564,7 @@ free_cpudata1: · 190 unmodified lines
555564
556565 static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)
557566 {
558− struct amd_cpudata *cpudata;
559−
560− cpudata = policy->driver_data;
567+ struct amd_cpudata *cpudata = policy->driver_data;
561568
562569 freq_qos_remove_request(&cpudata->req[1]);
563570 freq_qos_remove_request(&cpudata->req[0]);
@@ -599,9 +606,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, · 35 unmodified lines
599606 char *buf)
600607 {
601608 int max_freq;
602− struct amd_cpudata *cpudata;
603−
604− cpudata = policy->driver_data;
609+ struct amd_cpudata *cpudata = policy->driver_data;
605610
606611 max_freq = amd_get_max_freq(cpudata);
607612 if (max_freq < 0)
@@ -614,9 +619,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli · 6 unmodified lines
614619 char *buf)
615620 {
616621 int freq;
617− struct amd_cpudata *cpudata;
618−
619− cpudata = policy->driver_data;
622+ struct amd_cpudata *cpudata = policy->driver_data;
620623
621624 freq = amd_get_lowest_nonlinear_freq(cpudata);
622625 if (freq < 0)
@@ -662,7 +665,7 @@ static struct cpufreq_driver amd_pstate_driver = { · 39 unmodified lines
662665 .resume = amd_pstate_cpu_resume,
663666 .set_boost = amd_pstate_set_boost,
664667 .name = "amd-pstate",
665− .attr = amd_pstate_attr,
668+ .attr = amd_pstate_attr,
666669 };
667670
668671 static int __init amd_pstate_init(void)
@@ -673,7 +676,7 @@ static int __init amd_pstate_init(void) · 4 unmodified lines
673676 return -ENODEV;
674677
675678 if (!acpi_cpc_valid()) {
676− pr_debug("the _CPC object is not present in SBIOS\n");
679+ pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n");
677680 return -ENODEV;
678681 }
679682
drivers/cpufreq/bmips-cpufreq.c+8−2
@@ -156,7 +156,7 @@ static struct cpufreq_driver bmips_cpufreq_driver = { · 155 unmodified lines
156156 .name = BMIPS_CPUFREQ_PREFIX,
157157 };
158158
159−static int __init bmips_cpufreq_probe(void)
159+static int __init bmips_cpufreq_driver_init(void)
160160 {
161161 struct cpufreq_compat *cc;
162162 struct device_node *np;
@@ -176,7 +176,13 @@ static int __init bmips_cpufreq_probe(void) · 13 unmodified lines
176176
177177 return cpufreq_register_driver(&bmips_cpufreq_driver);
178178 }
179−device_initcall(bmips_cpufreq_probe);
179+module_init(bmips_cpufreq_driver_init);
180+
181+static void __exit bmips_cpufreq_driver_exit(void)
182+{
183+ cpufreq_unregister_driver(&bmips_cpufreq_driver);
184+}
185+module_exit(bmips_cpufreq_driver_exit);
180186
181187 MODULE_AUTHOR("Markus Mayer <mmayer@broadcom.com>");
182188 MODULE_DESCRIPTION("CPUfreq driver for Broadcom BMIPS SoCs");
drivers/cpufreq/cppc_cpufreq.c+22−5
@@ -63,7 +63,15 @@ static struct cppc_workaround_oem_info wa_info[] = { · 62 unmodified lines
6363
6464 static struct cpufreq_driver cppc_cpufreq_driver;
6565
66+static enum {
67+ FIE_UNSET = -1,
68+ FIE_ENABLED,
69+ FIE_DISABLED
70+} fie_disabled = FIE_UNSET;
71+
6672 #ifdef CONFIG_ACPI_CPPC_CPUFREQ_FIE
73+module_param(fie_disabled, int, 0444);
74+MODULE_PARM_DESC(fie_disabled, "Disable Frequency Invariance Engine (FIE)");
6775
6876 /* Frequency invariance support */
6977 struct cppc_freq_invariance {
@@ -158,7 +166,7 @@ static void cppc_cpufreq_cpu_fie_init(struct cpufreq_policy *policy) · 88 unmodified lines
158166 struct cppc_freq_invariance *cppc_fi;
159167 int cpu, ret;
160168
161− if (cppc_cpufreq_driver.get == hisi_cppc_cpufreq_get_rate)
169+ if (fie_disabled)
162170 return;
163171
164172 for_each_cpu(cpu, policy->cpus) {
@@ -199,7 +207,7 @@ static void cppc_cpufreq_cpu_fie_exit(struct cpufreq_policy *policy) · 34 unmodified lines
199207 struct cppc_freq_invariance *cppc_fi;
200208 int cpu;
201209
202− if (cppc_cpufreq_driver.get == hisi_cppc_cpufreq_get_rate)
210+ if (fie_disabled)
203211 return;
204212
205213 /* policy->cpus will be empty here, use related_cpus instead */
@@ -229,7 +237,15 @@ static void __init cppc_freq_invariance_init(void) · 23 unmodified lines
229237 };
230238 int ret;
231239
232− if (cppc_cpufreq_driver.get == hisi_cppc_cpufreq_get_rate)
240+ if (fie_disabled != FIE_ENABLED && fie_disabled != FIE_DISABLED) {
241+ fie_disabled = FIE_ENABLED;
242+ if (cppc_perf_ctrs_in_pcc()) {
243+ pr_info("FIE not enabled on systems with registers in PCC\n");
244+ fie_disabled = FIE_DISABLED;
245+ }
246+ }
247+
248+ if (fie_disabled)
233249 return;
234250
235251 kworker_fie = kthread_create_worker(0, "cppc_fie");
@@ -247,7 +263,7 @@ static void __init cppc_freq_invariance_init(void) · 11 unmodified lines
247263
248264 static void cppc_freq_invariance_exit(void)
249265 {
250− if (cppc_cpufreq_driver.get == hisi_cppc_cpufreq_get_rate)
266+ if (fie_disabled)
251267 return;
252268
253269 kthread_destroy_worker(kworker_fie);
@@ -936,6 +952,7 @@ static void cppc_check_hisi_workaround(void) · 682 unmodified lines
936952 wa_info[i].oem_revision == tbl->oem_revision) {
937953 /* Overwrite the get() callback */
938954 cppc_cpufreq_driver.get = hisi_cppc_cpufreq_get_rate;
955+ fie_disabled = FIE_DISABLED;
939956 break;
940957 }
941958 }
@@ -947,7 +964,7 @@ static int __init cppc_cpufreq_init(void) · 5 unmodified lines
947964 {
948965 int ret;
949966
950− if ((acpi_disabled) || !acpi_cpc_valid())
967+ if (!acpi_cpc_valid())
951968 return -ENODEV;
952969
953970 cppc_check_hisi_workaround();
drivers/cpufreq/cpufreq-dt-platdev.c+1−0
@@ -146,6 +146,7 @@ static const struct of_device_id blocklist[] __initconst = { · 145 unmodified lines
146146 { .compatible = "qcom,sc8180x", },
147147 { .compatible = "qcom,sc8280xp", },
148148 { .compatible = "qcom,sdm845", },
149+ { .compatible = "qcom,sm6115", },
149150 { .compatible = "qcom,sm6350", },
150151 { .compatible = "qcom,sm8150", },
151152 { .compatible = "qcom,sm8250", },
drivers/cpufreq/highbank-cpufreq.c+1−1
@@ -55,7 +55,7 @@ static struct notifier_block hb_cpufreq_clk_nb = { · 54 unmodified lines
5555 .notifier_call = hb_cpufreq_clk_notify,
5656 };
5757
58−static int hb_cpufreq_driver_init(void)
58+static int __init hb_cpufreq_driver_init(void)
5959 {
6060 struct platform_device_info devinfo = { .name = "cpufreq-dt", };
6161 struct device *cpu_dev;
drivers/cpufreq/intel_pstate.c+1−0
@@ -2416,6 +2416,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = { · 2415 unmodified lines
24162416 X86_MATCH(SKYLAKE_X, core_funcs),
24172417 X86_MATCH(COMETLAKE, core_funcs),
24182418 X86_MATCH(ICELAKE_X, core_funcs),
2419+ X86_MATCH(TIGERLAKE, core_funcs),
24192420 {}
24202421 };
24212422 MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
drivers/cpufreq/qcom-cpufreq-hw.c+19−5
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/of_address.h>
1414 #include <linux/of_platform.h>
1515 #include <linux/pm_opp.h>
16+#include <linux/pm_qos.h>
1617 #include <linux/slab.h>
1718 #include <linux/spinlock.h>
1819 #include <linux/units.h>
@@ -56,6 +57,8 @@ struct qcom_cpufreq_data { · 37 unmodified lines
5657 struct cpufreq_policy *policy;
5758
5859 bool per_core_dcvs;
60+
61+ struct freq_qos_request throttle_freq_req;
5962 };
6063
6164 static unsigned long cpu_hw_rate, xo_rate;
@@ -316,14 +319,16 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) · 254 unmodified lines
316319 if (IS_ERR(opp)) {
317320 dev_warn(dev, "Can't find the OPP for throttling: %pe!\n", opp);
318321 } else {
319− throttled_freq = freq_hz / HZ_PER_KHZ;
320−
321− /* Update thermal pressure (the boost frequencies are accepted) */
322− arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
323−
324322 dev_pm_opp_put(opp);
325323 }
326324
325+ throttled_freq = freq_hz / HZ_PER_KHZ;
326+
327+ freq_qos_update_request(&data->throttle_freq_req, throttled_freq);
328+
329+ /* Update thermal pressure (the boost frequencies are accepted) */
330+ arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
331+
327332 /*
328333 * In the unlikely case policy is unregistered do not enable
329334 * polling or h/w interrupt
@@ -413,6 +418,14 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index) · 83 unmodified lines
413418 if (data->throttle_irq < 0)
414419 return data->throttle_irq;
415420
421+ ret = freq_qos_add_request(&policy->constraints,
422+ &data->throttle_freq_req, FREQ_QOS_MAX,
423+ FREQ_QOS_MAX_DEFAULT_VALUE);
424+ if (ret < 0) {
425+ dev_err(&pdev->dev, "Failed to add freq constraint (%d)\n", ret);
426+ return ret;
427+ }
428+
416429 data->cancel_throttle = false;
417430 data->policy = policy;
418431
@@ -479,6 +492,7 @@ static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data) · 60 unmodified lines
479492 if (data->throttle_irq <= 0)
480493 return;
481494
495+ freq_qos_remove_request(&data->throttle_freq_req);
482496 free_irq(data->throttle_irq, data);
483497 }
484498
drivers/cpufreq/sti-cpufreq.c+1−1
@@ -252,7 +252,7 @@ static int sti_cpufreq_fetch_syscon_registers(void) · 251 unmodified lines
252252 return 0;
253253 }
254254
255−static int sti_cpufreq_init(void)
255+static int __init sti_cpufreq_init(void)
256256 {
257257 int ret;
258258
drivers/cpufreq/tegra194-cpufreq.c+16−19
@@ -38,14 +38,6 @@ · 37 unmodified lines
3838 /* cpufreq transisition latency */
3939 #define TEGRA_CPUFREQ_TRANSITION_LATENCY (300 * 1000) /* unit in nanoseconds */
4040
41−enum cluster {
42− CLUSTER0,
43− CLUSTER1,
44− CLUSTER2,
45− CLUSTER3,
46− MAX_CLUSTERS,
47−};
48−
4941 struct tegra_cpu_ctr {
5042 u32 cpu;
5143 u32 coreclk_cnt, last_coreclk_cnt;
@@ -67,12 +59,12 @@ struct tegra_cpufreq_ops { · 15 unmodified lines
6759 struct tegra_cpufreq_soc {
6860 struct tegra_cpufreq_ops *ops;
6961 int maxcpus_per_cluster;
62+ unsigned int num_clusters;
7063 phys_addr_t actmon_cntr_base;
7164 };
7265
7366 struct tegra194_cpufreq_data {
7467 void __iomem *regs;
75− size_t num_clusters;
7668 struct cpufreq_frequency_table **tables;
7769 const struct tegra_cpufreq_soc *soc;
7870 };
@@ -166,6 +158,14 @@ static const struct tegra_cpufreq_soc tegra234_cpufreq_soc = { · 87 unmodified lines
166158 .ops = &tegra234_cpufreq_ops,
167159 .actmon_cntr_base = 0x9000,
168160 .maxcpus_per_cluster = 4,
161+ .num_clusters = 3,
162+};
163+
164+static const struct tegra_cpufreq_soc tegra239_cpufreq_soc = {
165+ .ops = &tegra234_cpufreq_ops,
166+ .actmon_cntr_base = 0x4000,
167+ .maxcpus_per_cluster = 8,
168+ .num_clusters = 1,
169169 };
170170
171171 static void tegra194_get_cpu_cluster_id(u32 cpu, u32 *cpuid, u32 *clusterid)
@@ -314,11 +314,7 @@ static void tegra194_get_cpu_ndiv_sysreg(void *ndiv) · 142 unmodified lines
314314
315315 static int tegra194_get_cpu_ndiv(u32 cpu, u32 cpuid, u32 clusterid, u64 *ndiv)
316316 {
317− int ret;
318−
319− ret = smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, &ndiv, true);
320−
321− return ret;
317+ return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, &ndiv, true);
322318 }
323319
324320 static void tegra194_set_cpu_ndiv_sysreg(void *data)
@@ -382,7 +378,7 @@ static int tegra194_cpufreq_init(struct cpufreq_policy *policy) · 57 unmodified lines
382378
383379 data->soc->ops->get_cpu_cluster_id(policy->cpu, NULL, &clusterid);
384380
385− if (clusterid >= data->num_clusters || !data->tables[clusterid])
381+ if (clusterid >= data->soc->num_clusters || !data->tables[clusterid])
386382 return -EINVAL;
387383
388384 start_cpu = rounddown(policy->cpu, maxcpus_per_cluster);
@@ -433,6 +429,7 @@ static struct tegra_cpufreq_ops tegra194_cpufreq_ops = { · 44 unmodified lines
433429 static const struct tegra_cpufreq_soc tegra194_cpufreq_soc = {
434430 .ops = &tegra194_cpufreq_ops,
435431 .maxcpus_per_cluster = 2,
432+ .num_clusters = 4,
436433 };
437434
438435 static void tegra194_cpufreq_free_resources(void)
@@ -525,15 +522,14 @@ static int tegra194_cpufreq_probe(struct platform_device *pdev) · 86 unmodified lines
525522
526523 soc = of_device_get_match_data(&pdev->dev);
527524
528− if (soc->ops && soc->maxcpus_per_cluster) {
525+ if (soc->ops && soc->maxcpus_per_cluster && soc->num_clusters) {
529526 data->soc = soc;
530527 } else {
531528 dev_err(&pdev->dev, "soc data missing\n");
532529 return -EINVAL;
533530 }
534531
535− data->num_clusters = MAX_CLUSTERS;
536− data->tables = devm_kcalloc(&pdev->dev, data->num_clusters,
532+ data->tables = devm_kcalloc(&pdev->dev, data->soc->num_clusters,
537533 sizeof(*data->tables), GFP_KERNEL);
538534 if (!data->tables)
539535 return -ENOMEM;
@@ -558,7 +554,7 @@ static int tegra194_cpufreq_probe(struct platform_device *pdev) · 18 unmodified lines
558554 goto put_bpmp;
559555 }
560556
561− for (i = 0; i < data->num_clusters; i++) {
557+ for (i = 0; i < data->soc->num_clusters; i++) {
562558 data->tables[i] = init_freq_table(pdev, bpmp, i);
563559 if (IS_ERR(data->tables[i])) {
564560 err = PTR_ERR(data->tables[i]);
@@ -590,6 +586,7 @@ static int tegra194_cpufreq_remove(struct platform_device *pdev) · 25 unmodified lines
590586 static const struct of_device_id tegra194_cpufreq_of_match[] = {
591587 { .compatible = "nvidia,tegra194-ccplex", .data = &tegra194_cpufreq_soc },
592588 { .compatible = "nvidia,tegra234-ccplex-cluster", .data = &tegra234_cpufreq_soc },
589+ { .compatible = "nvidia,tegra239-ccplex-cluster", .data = &tegra239_cpufreq_soc },
593590 { /* sentinel */ }
594591 };
595592
drivers/cpufreq/ti-cpufreq.c+1−1
@@ -398,7 +398,7 @@ fail_put_node: · 397 unmodified lines
398398 return ret;
399399 }
400400
401−static int ti_cpufreq_init(void)
401+static int __init ti_cpufreq_init(void)
402402 {
403403 const struct of_device_id *match;
404404
drivers/cpuidle/coupled.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 * variable is not locked. It is only written from the cpu that
5555 * it stores (or by the on/offlining cpu if that cpu is offline),
5656 * and only read after all the cpus are ready for the coupled idle
57− * state are are no longer updating it.
57+ * state are no longer updating it.
5858 *
5959 * Three atomic counters are used. alive_count tracks the number
6060 * of cpus in the coupled set that are currently or soon will be
drivers/cpuidle/cpuidle-powernv.c+2−2
@@ -233,8 +233,8 @@ static inline void add_powernv_state(int index, const char *name, · 232 unmodified lines
233233 unsigned int exit_latency,
234234 u64 psscr_val, u64 psscr_mask)
235235 {
236− strlcpy(powernv_states[index].name, name, CPUIDLE_NAME_LEN);
237− strlcpy(powernv_states[index].desc, name, CPUIDLE_NAME_LEN);
236+ strscpy(powernv_states[index].name, name, CPUIDLE_NAME_LEN);
237+ strscpy(powernv_states[index].desc, name, CPUIDLE_NAME_LEN);
238238 powernv_states[index].flags = flags;
239239 powernv_states[index].target_residency = target_residency;
240240 powernv_states[index].exit_latency = exit_latency;
drivers/cpuidle/governor.c+5−6
@@ -63,12 +63,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov) · 62 unmodified lines
6363
6464 cpuidle_curr_governor = gov;
6565
66− if (gov) {
67− list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
68− cpuidle_enable_device(dev);
69− cpuidle_install_idle_handler();
70− printk(KERN_INFO "cpuidle: using governor %s\n", gov->name);
71− }
66+ list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
67+ cpuidle_enable_device(dev);
68+
69+ cpuidle_install_idle_handler();
70+ pr_info("cpuidle: using governor %s\n", gov->name);
7271
7372 return 0;
7473 }
drivers/crypto/virtio/virtio_crypto_akcipher_algs.c+4−0
@@ -56,6 +56,10 @@ static void virtio_crypto_akcipher_finalize_req( · 55 unmodified lines
5656 struct virtio_crypto_akcipher_request *vc_akcipher_req,
5757 struct akcipher_request *req, int err)
5858 {
59+ kfree(vc_akcipher_req->src_buf);
60+ kfree(vc_akcipher_req->dst_buf);
61+ vc_akcipher_req->src_buf = NULL;
62+ vc_akcipher_req->dst_buf = NULL;
5963 virtcrypto_clear_request(&vc_akcipher_req->base);
6064
6165 crypto_finalize_akcipher_request(vc_akcipher_req->base.dataq->engine, req, err);
drivers/devfreq/event/rockchip-dfi.c+3−4
@@ -189,10 +189,9 @@ static int rockchip_dfi_probe(struct platform_device *pdev) · 188 unmodified lines
189189 return PTR_ERR(data->regs);
190190
191191 data->clk = devm_clk_get(dev, "pclk_ddr_mon");
192− if (IS_ERR(data->clk)) {
193− dev_err(dev, "Cannot get the clk dmc_clk\n");
194− return PTR_ERR(data->clk);
195− }
192+ if (IS_ERR(data->clk))
193+ return dev_err_probe(dev, PTR_ERR(data->clk),
194+ "Cannot get the clk pclk_ddr_mon\n");
196195
197196 /* try to find the optional reference to the pmu syscon */
198197 node = of_parse_phandle(np, "rockchip,pmu", 0);
drivers/devfreq/mtk-cci-devfreq.c+6−2
@@ -291,9 +291,13 @@ static int mtk_ccifreq_probe(struct platform_device *pdev) · 290 unmodified lines
291291 }
292292
293293 drv->sram_reg = devm_regulator_get_optional(dev, "sram");
294− if (IS_ERR(drv->sram_reg))
294+ if (IS_ERR(drv->sram_reg)) {
295+ ret = PTR_ERR(drv->sram_reg);
296+ if (ret == -EPROBE_DEFER)
297+ goto out_free_resources;
298+
295299 drv->sram_reg = NULL;
296− else {
300+ } else {
297301 ret = regulator_enable(drv->sram_reg);
298302 if (ret) {
299303 dev_err(dev, "failed to enable sram regulator\n");
drivers/edac/edac_mc.c+0−1
@@ -103,7 +103,6 @@ static void edac_mc_dump_dimm(struct dimm_info *dimm) · 102 unmodified lines
103103 edac_dbg(4, " dimm->label = '%s'\n", dimm->label);
104104 edac_dbg(4, " dimm->nr_pages = 0x%x\n", dimm->nr_pages);
105105 edac_dbg(4, " dimm->grain = %d\n", dimm->grain);
106− edac_dbg(4, " dimm->nr_pages = 0x%x\n", dimm->nr_pages);
107106 }
108107
109108 static void edac_mc_dump_csrow(struct csrow_info *csrow)
drivers/edac/edac_module.h+0−4
@@ -28,13 +28,9 @@ void edac_mc_sysfs_exit(void); · 27 unmodified lines
2828 extern int edac_create_sysfs_mci_device(struct mem_ctl_info *mci,
2929 const struct attribute_group **groups);
3030 extern void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci);
31−extern int edac_get_log_ue(void);
32−extern int edac_get_log_ce(void);
33−extern int edac_get_panic_on_ue(void);
3431 extern int edac_mc_get_log_ue(void);
3532 extern int edac_mc_get_log_ce(void);
3633 extern int edac_mc_get_panic_on_ue(void);
37−extern int edac_get_poll_msec(void);
3834 extern unsigned int edac_mc_get_poll_msec(void);
3935
4036 unsigned edac_dimm_info_location(struct dimm_info *dimm, char *buf,
drivers/edac/i10nm_base.c+263−24
@@ -74,31 +74,47 @@ static struct list_head *i10nm_edac_list; · 73 unmodified lines
7474
7575 static struct res_config *res_cfg;
7676 static int retry_rd_err_log;
77+static int decoding_via_mca;
78+static bool mem_cfg_2lm;
7779
7880 static u32 offsets_scrub_icx[] = {0x22c60, 0x22c54, 0x22c5c, 0x22c58, 0x22c28, 0x20ed8};
7981 static u32 offsets_scrub_spr[] = {0x22c60, 0x22c54, 0x22f08, 0x22c58, 0x22c28, 0x20ed8};
82+static u32 offsets_scrub_spr_hbm0[] = {0x2860, 0x2854, 0x2b08, 0x2858, 0x2828, 0x0ed8};
83+static u32 offsets_scrub_spr_hbm1[] = {0x2c60, 0x2c54, 0x2f08, 0x2c58, 0x2c28, 0x0fa8};
8084 static u32 offsets_demand_icx[] = {0x22e54, 0x22e60, 0x22e64, 0x22e58, 0x22e5c, 0x20ee0};
8185 static u32 offsets_demand_spr[] = {0x22e54, 0x22e60, 0x22f10, 0x22e58, 0x22e5c, 0x20ee0};
86+static u32 offsets_demand2_spr[] = {0x22c70, 0x22d80, 0x22f18, 0x22d58, 0x22c64, 0x20f10};
87+static u32 offsets_demand_spr_hbm0[] = {0x2a54, 0x2a60, 0x2b10, 0x2a58, 0x2a5c, 0x0ee0};
88+static u32 offsets_demand_spr_hbm1[] = {0x2e54, 0x2e60, 0x2f10, 0x2e58, 0x2e5c, 0x0fb0};
8289
83−static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable)
90+static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable,
91+ u32 *offsets_scrub, u32 *offsets_demand,
92+ u32 *offsets_demand2)
8493 {
85− u32 s, d;
94+ u32 s, d, d2;
8695
87− if (!imc->mbase)
88− return;
89−
90− s = I10NM_GET_REG32(imc, chan, res_cfg->offsets_scrub[0]);
91− d = I10NM_GET_REG32(imc, chan, res_cfg->offsets_demand[0]);
96+ s = I10NM_GET_REG32(imc, chan, offsets_scrub[0]);
97+ d = I10NM_GET_REG32(imc, chan, offsets_demand[0]);
98+ if (offsets_demand2)
99+ d2 = I10NM_GET_REG32(imc, chan, offsets_demand2[0]);
92100
93101 if (enable) {
94102 /* Save default configurations */
95103 imc->chan[chan].retry_rd_err_log_s = s;
96104 imc->chan[chan].retry_rd_err_log_d = d;
105+ if (offsets_demand2)
106+ imc->chan[chan].retry_rd_err_log_d2 = d2;
97107
98108 s &= ~RETRY_RD_ERR_LOG_NOOVER_UC;
99109 s |= RETRY_RD_ERR_LOG_EN;
100110 d &= ~RETRY_RD_ERR_LOG_NOOVER_UC;
101111 d |= RETRY_RD_ERR_LOG_EN;
112+
113+ if (offsets_demand2) {
114+ d2 &= ~RETRY_RD_ERR_LOG_UC;
115+ d2 |= RETRY_RD_ERR_LOG_NOOVER;
116+ d2 |= RETRY_RD_ERR_LOG_EN;
117+ }
102118 } else {
103119 /* Restore default configurations */
104120 if (imc->chan[chan].retry_rd_err_log_s & RETRY_RD_ERR_LOG_UC)
@@ -113,23 +129,55 @@ static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable · 8 unmodified lines
113129 d |= RETRY_RD_ERR_LOG_NOOVER;
114130 if (!(imc->chan[chan].retry_rd_err_log_d & RETRY_RD_ERR_LOG_EN))
115131 d &= ~RETRY_RD_ERR_LOG_EN;
132+
133+ if (offsets_demand2) {
134+ if (imc->chan[chan].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_UC)
135+ d2 |= RETRY_RD_ERR_LOG_UC;
136+ if (!(imc->chan[chan].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_NOOVER))
137+ d2 &= ~RETRY_RD_ERR_LOG_NOOVER;
138+ if (!(imc->chan[chan].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_EN))
139+ d2 &= ~RETRY_RD_ERR_LOG_EN;
140+ }
116141 }
117142
118− I10NM_SET_REG32(imc, chan, res_cfg->offsets_scrub[0], s);
119− I10NM_SET_REG32(imc, chan, res_cfg->offsets_demand[0], d);
143+ I10NM_SET_REG32(imc, chan, offsets_scrub[0], s);
144+ I10NM_SET_REG32(imc, chan, offsets_demand[0], d);
145+ if (offsets_demand2)
146+ I10NM_SET_REG32(imc, chan, offsets_demand2[0], d2);
120147 }
121148
122149 static void enable_retry_rd_err_log(bool enable)
123150 {
151+ struct skx_imc *imc;
124152 struct skx_dev *d;
125153 int i, j;
126154
127155 edac_dbg(2, "\n");
128156
129157 list_for_each_entry(d, i10nm_edac_list, list)
130− for (i = 0; i < I10NM_NUM_IMC; i++)
131− for (j = 0; j < I10NM_NUM_CHANNELS; j++)
132− __enable_retry_rd_err_log(&d->imc[i], j, enable);
158+ for (i = 0; i < I10NM_NUM_IMC; i++) {
159+ imc = &d->imc[i];
160+ if (!imc->mbase)
161+ continue;
162+
163+ for (j = 0; j < I10NM_NUM_CHANNELS; j++) {
164+ if (imc->hbm_mc) {
165+ __enable_retry_rd_err_log(imc, j, enable,
166+ res_cfg->offsets_scrub_hbm0,
167+ res_cfg->offsets_demand_hbm0,
168+ NULL);
169+ __enable_retry_rd_err_log(imc, j, enable,
170+ res_cfg->offsets_scrub_hbm1,
171+ res_cfg->offsets_demand_hbm1,
172+ NULL);
173+ } else {
174+ __enable_retry_rd_err_log(imc, j, enable,
175+ res_cfg->offsets_scrub,
176+ res_cfg->offsets_demand,
177+ res_cfg->offsets_demand2);
178+ }
179+ }
180+ }
133181 }
134182
135183 static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
@@ -138,14 +186,33 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg, · 2 unmodified lines
138186 struct skx_imc *imc = &res->dev->imc[res->imc];
139187 u32 log0, log1, log2, log3, log4;
140188 u32 corr0, corr1, corr2, corr3;
189+ u32 lxg0, lxg1, lxg3, lxg4;
190+ u32 *xffsets = NULL;
141191 u64 log2a, log5;
192+ u64 lxg2a, lxg5;
142193 u32 *offsets;
143− int n;
194+ int n, pch;
144195
145196 if (!imc->mbase)
146197 return;
147198
148− offsets = scrub_err ? res_cfg->offsets_scrub : res_cfg->offsets_demand;
199+ if (imc->hbm_mc) {
200+ pch = res->cs & 1;
201+
202+ if (pch)
203+ offsets = scrub_err ? res_cfg->offsets_scrub_hbm1 :
204+ res_cfg->offsets_demand_hbm1;
205+ else
206+ offsets = scrub_err ? res_cfg->offsets_scrub_hbm0 :
207+ res_cfg->offsets_demand_hbm0;
208+ } else {
209+ if (scrub_err) {
210+ offsets = res_cfg->offsets_scrub;
211+ } else {
212+ offsets = res_cfg->offsets_demand;
213+ xffsets = res_cfg->offsets_demand2;
214+ }
215+ }
149216
150217 log0 = I10NM_GET_REG32(imc, res->channel, offsets[0]);
151218 log1 = I10NM_GET_REG32(imc, res->channel, offsets[1]);
@@ -153,20 +220,52 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg, · 1 unmodified line
153220 log4 = I10NM_GET_REG32(imc, res->channel, offsets[4]);
154221 log5 = I10NM_GET_REG64(imc, res->channel, offsets[5]);
155222
223+ if (xffsets) {
224+ lxg0 = I10NM_GET_REG32(imc, res->channel, xffsets[0]);
225+ lxg1 = I10NM_GET_REG32(imc, res->channel, xffsets[1]);
226+ lxg3 = I10NM_GET_REG32(imc, res->channel, xffsets[3]);
227+ lxg4 = I10NM_GET_REG32(imc, res->channel, xffsets[4]);
228+ lxg5 = I10NM_GET_REG64(imc, res->channel, xffsets[5]);
229+ }
230+
156231 if (res_cfg->type == SPR) {
157232 log2a = I10NM_GET_REG64(imc, res->channel, offsets[2]);
158− n = snprintf(msg, len, " retry_rd_err_log[%.8x %.8x %.16llx %.8x %.8x %.16llx]",
233+ n = snprintf(msg, len, " retry_rd_err_log[%.8x %.8x %.16llx %.8x %.8x %.16llx",
159234 log0, log1, log2a, log3, log4, log5);
235+
236+ if (len - n > 0) {
237+ if (xffsets) {
238+ lxg2a = I10NM_GET_REG64(imc, res->channel, xffsets[2]);
239+ n += snprintf(msg + n, len - n, " %.8x %.8x %.16llx %.8x %.8x %.16llx]",
240+ lxg0, lxg1, lxg2a, lxg3, lxg4, lxg5);
241+ } else {
242+ n += snprintf(msg + n, len - n, "]");
243+ }
244+ }
160245 } else {
161246 log2 = I10NM_GET_REG32(imc, res->channel, offsets[2]);
162247 n = snprintf(msg, len, " retry_rd_err_log[%.8x %.8x %.8x %.8x %.8x %.16llx]",
163248 log0, log1, log2, log3, log4, log5);
164249 }
165250
166− corr0 = I10NM_GET_REG32(imc, res->channel, 0x22c18);
167− corr1 = I10NM_GET_REG32(imc, res->channel, 0x22c1c);
168− corr2 = I10NM_GET_REG32(imc, res->channel, 0x22c20);
169− corr3 = I10NM_GET_REG32(imc, res->channel, 0x22c24);
251+ if (imc->hbm_mc) {
252+ if (pch) {
253+ corr0 = I10NM_GET_REG32(imc, res->channel, 0x2c18);
254+ corr1 = I10NM_GET_REG32(imc, res->channel, 0x2c1c);
255+ corr2 = I10NM_GET_REG32(imc, res->channel, 0x2c20);
256+ corr3 = I10NM_GET_REG32(imc, res->channel, 0x2c24);
257+ } else {
258+ corr0 = I10NM_GET_REG32(imc, res->channel, 0x2818);
259+ corr1 = I10NM_GET_REG32(imc, res->channel, 0x281c);
260+ corr2 = I10NM_GET_REG32(imc, res->channel, 0x2820);
261+ corr3 = I10NM_GET_REG32(imc, res->channel, 0x2824);
262+ }
263+ } else {
264+ corr0 = I10NM_GET_REG32(imc, res->channel, 0x22c18);
265+ corr1 = I10NM_GET_REG32(imc, res->channel, 0x22c1c);
266+ corr2 = I10NM_GET_REG32(imc, res->channel, 0x22c20);
267+ corr3 = I10NM_GET_REG32(imc, res->channel, 0x22c24);
268+ }
170269
171270 if (len - n > 0)
172271 snprintf(msg + n, len - n,
@@ -177,9 +276,16 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg, · 4 unmodified lines
177276 corr3 & 0xffff, corr3 >> 16);
178277
179278 /* Clear status bits */
180− if (retry_rd_err_log == 2 && (log0 & RETRY_RD_ERR_LOG_OVER_UC_V)) {
181− log0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V;
182− I10NM_SET_REG32(imc, res->channel, offsets[0], log0);
279+ if (retry_rd_err_log == 2) {
280+ if (log0 & RETRY_RD_ERR_LOG_OVER_UC_V) {
281+ log0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V;
282+ I10NM_SET_REG32(imc, res->channel, offsets[0], log0);
283+ }
284+
285+ if (xffsets && (lxg0 & RETRY_RD_ERR_LOG_OVER_UC_V)) {
286+ lxg0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V;
287+ I10NM_SET_REG32(imc, res->channel, xffsets[0], lxg0);
288+ }
183289 }
184290 }
185291
@@ -231,6 +337,103 @@ static bool i10nm_check_2lm(struct res_config *cfg) · 45 unmodified lines
231337 return false;
232338 }
233339
340+/*
341+ * Check whether the error comes from DDRT by ICX/Tremont model specific error code.
342+ * Refer to SDM vol3B 16.11.3 Intel IMC MC error codes for IA32_MCi_STATUS.
343+ */
344+static bool i10nm_mscod_is_ddrt(u32 mscod)
345+{
346+ switch (mscod) {
347+ case 0x0106: case 0x0107:
348+ case 0x0800: case 0x0804:
349+ case 0x0806 ... 0x0808:
350+ case 0x080a ... 0x080e:
351+ case 0x0810: case 0x0811:
352+ case 0x0816: case 0x081e:
353+ case 0x081f:
354+ return true;
355+ }
356+
357+ return false;
358+}
359+
360+static bool i10nm_mc_decode_available(struct mce *mce)
361+{
362+ u8 bank;
363+
364+ if (!decoding_via_mca || mem_cfg_2lm)
365+ return false;
366+
367+ if ((mce->status & (MCI_STATUS_MISCV | MCI_STATUS_ADDRV))
368+ != (MCI_STATUS_MISCV | MCI_STATUS_ADDRV))
369+ return false;
370+
371+ bank = mce->bank;
372+
373+ switch (res_cfg->type) {
374+ case I10NM:
375+ if (bank < 13 || bank > 26)
376+ return false;
377+
378+ /* DDRT errors can't be decoded from MCA bank registers */
379+ if (MCI_MISC_ECC_MODE(mce->misc) == MCI_MISC_ECC_DDRT)
380+ return false;
381+
382+ if (i10nm_mscod_is_ddrt(MCI_STATUS_MSCOD(mce->status)))
383+ return false;
384+
385+ /* Check whether one of {13,14,17,18,21,22,25,26} */
386+ return ((bank - 13) & BIT(1)) == 0;
387+ default:
388+ return false;
389+ }
390+}
391+
392+static bool i10nm_mc_decode(struct decoded_addr *res)
393+{
394+ struct mce *m = res->mce;
395+ struct skx_dev *d;
396+ u8 bank;
397+
398+ if (!i10nm_mc_decode_available(m))
399+ return false;
400+
401+ list_for_each_entry(d, i10nm_edac_list, list) {
402+ if (d->imc[0].src_id == m->socketid) {
403+ res->socket = m->socketid;
404+ res->dev = d;
405+ break;
406+ }
407+ }
408+
409+ switch (res_cfg->type) {
410+ case I10NM:
411+ bank = m->bank - 13;
412+ res->imc = bank / 4;
413+ res->channel = bank % 2;
414+ break;
415+ default:
416+ return false;
417+ }
418+
419+ if (!res->dev) {
420+ skx_printk(KERN_ERR, "No device for src_id %d imc %d\n",
421+ m->socketid, res->imc);
422+ return false;
423+ }
424+
425+ res->column = GET_BITFIELD(m->misc, 9, 18) << 2;
426+ res->row = GET_BITFIELD(m->misc, 19, 39);
427+ res->bank_group = GET_BITFIELD(m->misc, 40, 41);
428+ res->bank_address = GET_BITFIELD(m->misc, 42, 43);
429+ res->bank_group |= GET_BITFIELD(m->misc, 44, 44) << 2;
430+ res->rank = GET_BITFIELD(m->misc, 56, 58);
431+ res->dimm = res->rank >> 2;
432+ res->rank = res->rank % 4;
433+
434+ return true;
435+}
436+
234437 static int i10nm_get_ddr_munits(void)
235438 {
236439 struct pci_dev *mdev;
@@ -420,7 +623,12 @@ static struct res_config spr_cfg = { · 183 unmodified lines
420623 .sad_all_devfn = PCI_DEVFN(10, 0),
421624 .sad_all_offset = 0x300,
422625 .offsets_scrub = offsets_scrub_spr,
626+ .offsets_scrub_hbm0 = offsets_scrub_spr_hbm0,
627+ .offsets_scrub_hbm1 = offsets_scrub_spr_hbm1,
423628 .offsets_demand = offsets_demand_spr,
629+ .offsets_demand2 = offsets_demand2_spr,
630+ .offsets_demand_hbm0 = offsets_demand_spr_hbm0,
631+ .offsets_demand_hbm1 = offsets_demand_spr_hbm1,
424632 };
425633
426634 static const struct x86_cpu_id i10nm_cpuids[] = {
@@ -574,7 +782,8 @@ static int __init i10nm_init(void) · 147 unmodified lines
574782 return -ENODEV;
575783 }
576784
577− skx_set_mem_cfg(i10nm_check_2lm(cfg));
785+ mem_cfg_2lm = i10nm_check_2lm(cfg);
786+ skx_set_mem_cfg(mem_cfg_2lm);
578787
579788 rc = i10nm_get_ddr_munits();
580789
@@ -626,9 +835,11 @@ static int __init i10nm_init(void) · 45 unmodified lines
626835 setup_i10nm_debug();
627836
628837 if (retry_rd_err_log && res_cfg->offsets_scrub && res_cfg->offsets_demand) {
629− skx_set_decode(NULL, show_retry_rd_err_log);
838+ skx_set_decode(i10nm_mc_decode, show_retry_rd_err_log);
630839 if (retry_rd_err_log == 2)
631840 enable_retry_rd_err_log(true);
841+ } else {
842+ skx_set_decode(i10nm_mc_decode, NULL);
632843 }
633844
634845 i10nm_printk(KERN_INFO, "%s\n", I10NM_REVISION);
@@ -658,6 +869,34 @@ static void __exit i10nm_exit(void) · 23 unmodified lines
658869 module_init(i10nm_init);
659870 module_exit(i10nm_exit);
660871

31 more lines aren’t shown here.

drivers/edac/i7300_edac.c+1−1

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

drivers/edac/ie31200_edac.c+19−9

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

drivers/edac/ppc4xx_edac.c+9−14

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

drivers/edac/sb_edac.c+138−10

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

drivers/edac/skx_base.c+7−2

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

drivers/edac/skx_common.c+17−9

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

drivers/edac/skx_common.h+16−0

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

drivers/edac/wq.c+0−1

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

drivers/firmware/efi/dev-path-parser.c+6−4

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

drivers/firmware/efi/libstub/Makefile+2−0

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

drivers/firmware/psci/psci.c+6−6

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

drivers/gpio/gpio-mvebu.c+6−9

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

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c+4−0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+26−1

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

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+0−1

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

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h+4−0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h+2−0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c+264−0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h+3−1

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

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h+4−0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c+1−1

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

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+8−147

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

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+1−1

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

drivers/gpu/drm/amd/amdgpu/mes_v11_0.c+4−0

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

drivers/gpu/drm/amd/amdgpu/soc21.c+1−0

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

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c+2−0

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

drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c+3−3

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

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c+4−0

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

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c+7−1

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

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c+10−1

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

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c+14−0

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

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c+2−4

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

drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c+47−0

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

drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c+19−6

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

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c+53−0

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

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c+7−3

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

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c+41−2

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

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h+2−0

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

drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h+2−0

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

drivers/gpu/drm/amd/include/mes_v11_api_def.h+2−1

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

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+27−62

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

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c+0−13

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

drivers/gpu/drm/bridge/lontium-lt8912b.c+11−2

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

drivers/gpu/drm/i915/gt/intel_engine_types.h+15−0

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

drivers/gpu/drm/i915/gt/intel_execlists_submission.c+20−1

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

drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c+11−4

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

drivers/hv/vmbus_drv.c+2−1

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

drivers/hwmon/acpi_power_meter.c+1−1

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

drivers/hwmon/hwmon.c+7−7

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

drivers/hwmon/pmbus/pmbus_core.c+5−5

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

drivers/hwmon/scpi-hwmon.c+7−7

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

drivers/i2c/busses/i2c-amd-mp2-plat.c+9−18

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

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

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

drivers/i2c/busses/i2c-mlxbf.c+6−14

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

drivers/idle/intel_idle.c+52−1

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

drivers/iio/adc/sun4i-gpadc-iio.c+6−8

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

drivers/input/touchscreen/sun4i-ts.c+5−5

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

drivers/isdn/mISDN/l1oip.h+1−0

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

drivers/isdn/mISDN/l1oip_core.c+7−6

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

drivers/md/dm-verity-loadpin.c+8−0

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

drivers/md/dm-verity-target.c+16−0

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

drivers/md/dm-verity.h+1−0

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

drivers/md/md-cluster.c+2−2

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

drivers/media/dvb-core/dvb_vb2.c+11−0

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

drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c+3−6

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

drivers/media/usb/uvc/uvc_driver.c+1−1

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

drivers/media/v4l2-core/v4l2-compat-ioctl32.c+2−0

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

drivers/media/v4l2-core/v4l2-ioctl.c+12−14

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

drivers/misc/lkdtm/cfi.c+9−6

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

drivers/misc/lkdtm/fortify.c+83−13

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

drivers/misc/lkdtm/usercopy.c+1−1

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

drivers/net/Kconfig+2−0

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

drivers/net/Makefile+1−0

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

drivers/net/ethernet/atheros/alx/main.c+5−0

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

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+1−0

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

drivers/net/ethernet/cavium/octeon/octeon_mgmt.c+2−2

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

drivers/net/ethernet/freescale/Kconfig+1−0

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

drivers/net/ethernet/freescale/fec.h+19−2

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

drivers/net/ethernet/freescale/fec_main.c+99−56

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

drivers/net/ethernet/marvell/mvpp2/mvpp2.h+1−0

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c+8−2

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+12−1

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

drivers/net/ethernet/marvell/octeontx2/af/Makefile+1−1

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

drivers/net/ethernet/marvell/octeontx2/af/mbox.h+468−3

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

drivers/net/ethernet/marvell/octeontx2/af/mcs.c+1601−0

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

drivers/net/ethernet/marvell/octeontx2/af/mcs.h+246−0

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

drivers/net/ethernet/marvell/octeontx2/af/mcs_cnf10kb.c+214−0

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

drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h+1102−0

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

drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c+889−0

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

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

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

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

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c+346−0

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

drivers/net/ethernet/marvell/octeontx2/nic/Makefile+1−0

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

drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c+1668−0

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

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

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h+90−0

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+16−0

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

drivers/net/ethernet/marvell/prestera/prestera.h+12−0

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

drivers/net/ethernet/marvell/prestera/prestera_acl.c+6−2

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

drivers/net/ethernet/marvell/prestera/prestera_acl.h+2−2

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

drivers/net/ethernet/marvell/prestera/prestera_flower.c+5−1

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

drivers/net/ethernet/marvell/prestera/prestera_hw.c+130−0

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

drivers/net/ethernet/marvell/prestera/prestera_hw.h+11−0

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

drivers/net/ethernet/marvell/prestera/prestera_main.c+11−0

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

drivers/net/ethernet/marvell/prestera/prestera_router.c+1083−36

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

drivers/net/ethernet/marvell/prestera/prestera_router_hw.c+361−5

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

drivers/net/ethernet/marvell/prestera/prestera_router_hw.h+75−1

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

drivers/net/ethernet/mediatek/mtk_ppe.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/en.h+13−15

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

drivers/net/ethernet/mellanox/mlx5/core/en/channels.c+17−12

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

drivers/net/ethernet/mellanox/mlx5/core/en/channels.h+2−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/params.c+198−49

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

drivers/net/ethernet/mellanox/mlx5/core/en/params.h+17−39

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c+15−103

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

drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h+3−6

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

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h+7−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c+23−12

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

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c+212−11

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

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.h+3−14

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

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c+2−2

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

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c+3−9

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

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.h+0−12

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c+2−11

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

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+134−43

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

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+0−3

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+83−135

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h+4−0

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

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

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c+5−1

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+9−7

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

drivers/net/ethernet/mellanox/mlx5/core/health.c+24−5

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c+0−1

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

drivers/net/ethernet/mellanox/mlx5/core/main.c+10−7

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

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

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

drivers/net/ethernet/mellanox/mlxsw/core_thermal.c+2−75

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

drivers/net/ethernet/microchip/lan743x_ptp.c+7−0

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

drivers/net/ethernet/microchip/lan966x/Makefile+2−1

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

drivers/net/ethernet/microchip/lan966x/lan966x_main.c+2−1

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

drivers/net/ethernet/microchip/lan966x/lan966x_main.h+44−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_mirror.c+138−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_police.c+235−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_regs.h+96−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_tc.c+50−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_tc_matchall.c+95−0

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

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

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

drivers/net/ethernet/microchip/sparx5/sparx5_packet.c+2−2

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

drivers/net/ethernet/netronome/nfp/nfp_main.c+73−1

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

drivers/net/ethernet/netronome/nfp/nfp_main.h+1−2

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

drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c+0−8

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

drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h+3−7

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

drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c+56−5

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

drivers/net/ethernet/netronome/nfp/nfp_net_main.c+1−48

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

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h+3−0

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

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c+10−1

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

drivers/net/ethernet/realtek/r8169_main.c+10−6

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

drivers/net/ethernet/sunplus/spl2sw_driver.c+1−1

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

drivers/net/ipa/gsi.c+13−13

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

drivers/net/ipa/gsi.h+1−1

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

drivers/net/ipa/gsi_private.h+5−5

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

drivers/net/ipa/gsi_reg.h+1−1

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

drivers/net/ipa/gsi_trans.c+28−30

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

drivers/net/ipa/gsi_trans.h+2−2

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

drivers/net/ipa/ipa.h+1−1

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

drivers/net/ipa/ipa_cmd.c+2−2

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

drivers/net/ipa/ipa_cmd.h+1−1

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

drivers/net/ipa/ipa_data.h+2−2

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

drivers/net/ipa/ipa_endpoint.c+1−3

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

drivers/net/ipa/ipa_endpoint.h+1−1

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

drivers/net/ipa/ipa_interrupt.c+1−1

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

drivers/net/ipa/ipa_interrupt.h+1−1

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

drivers/net/ipa/ipa_main.c+1−1

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

drivers/net/ipa/ipa_mem.c+1−1

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

drivers/net/ipa/ipa_modem.c+1−1

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

drivers/net/ipa/ipa_modem.h+1−1

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

drivers/net/ipa/ipa_power.c+1−1

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

drivers/net/ipa/ipa_power.h+1−1

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

drivers/net/ipa/ipa_qmi.c+1−1

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

drivers/net/ipa/ipa_qmi.h+1−1

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

drivers/net/ipa/ipa_qmi_msg.c+1−1

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

drivers/net/ipa/ipa_qmi_msg.h+1−1

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

drivers/net/ipa/ipa_reg.c+1−1

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

drivers/net/ipa/ipa_reg.h+30−45

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

drivers/net/ipa/ipa_resource.c+1−1

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

drivers/net/ipa/ipa_smp2p.c+1−1

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

drivers/net/ipa/ipa_smp2p.h+1−1

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

drivers/net/ipa/ipa_sysfs.c+1−1

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

drivers/net/ipa/ipa_sysfs.h+1−1

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

drivers/net/ipa/ipa_table.c+1−1

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

drivers/net/ipa/ipa_table.h+1−1

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

drivers/net/ipa/ipa_uc.c+1−1

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

drivers/net/ipa/ipa_uc.h+1−1

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

drivers/net/ipa/ipa_version.h+1−1

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

drivers/net/mdio/fwnode_mdio.c+47−11

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

drivers/net/mdio/mdio-i2c.c+305−5

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

drivers/net/phy/at803x.c+2−1

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

drivers/net/phy/marvell-88x2222.c+2−1

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

drivers/net/phy/marvell.c+2−1

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

drivers/net/phy/marvell10g.c+123−10

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

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

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

drivers/net/phy/phylink.c+166−44

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

drivers/net/phy/sfp-bus.c+57−18

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

drivers/net/phy/sfp.c+122−57

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

drivers/net/phy/sfp.h+2−1

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

drivers/net/pse-pd/Kconfig+22−0

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

drivers/net/pse-pd/Makefile+6−0

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

drivers/net/pse-pd/pse_core.c+314−0

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

drivers/net/pse-pd/pse_regulator.c+147−0

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

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

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

drivers/net/wireless/mediatek/mt76/tx.c+8−2

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

drivers/net/wwan/iosm/iosm_ipc_wwan.c+3−2

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

drivers/nvme/host/core.c+3−3

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

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

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

drivers/perf/arm_dsu_pmu.c+2−2

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

drivers/perf/qcom_l2_pmu.c+5−5

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

drivers/perf/qcom_l3_pmu.c+2−1

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

drivers/platform/x86/intel/int3472/common.c+1−1

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

drivers/platform/x86/intel/int3472/tps68470.c+64−12

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

drivers/platform/x86/intel/int3472/tps68470.h+2−1

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

drivers/platform/x86/intel/int3472/tps68470_board_data.c+51−3

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

drivers/pnp/pnpbios/pnpbios.h+0−1

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

drivers/powercap/intel_rapl_common.c+4−1

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

drivers/ras/cec.c+8−0

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

drivers/regulator/max8973-regulator.c+5−5

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

drivers/spi/spi-pxa2xx.c+10−27

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

drivers/spi/spi.c+1−1

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

drivers/staging/media/rkvdec/rkvdec-h264.c+2−2

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

drivers/thermal/amlogic_thermal.c+8−8

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

drivers/thermal/armada_thermal.c+6−6

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

drivers/thermal/broadcom/bcm2711_thermal.c+7−7

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

drivers/thermal/broadcom/bcm2835_thermal.c+7−7

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

drivers/thermal/broadcom/brcmstb_thermal.c+10−10

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

drivers/thermal/broadcom/ns-thermal.c+21−29

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

drivers/thermal/broadcom/sr-thermal.c+8−8

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

drivers/thermal/cpufreq_cooling.c+6−6

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

drivers/thermal/da9062-thermal.c+2−3

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

drivers/thermal/db8500_thermal.c+4−4

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

drivers/thermal/gov_bang_bang.c+2−8

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

drivers/thermal/gov_fair_share.c+1−2

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

drivers/thermal/gov_power_allocator.c+6−14

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

drivers/thermal/gov_step_wise.c+2−8

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

drivers/thermal/gov_user_space.c+3−2

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

drivers/thermal/hisi_thermal.c+7−7

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

drivers/thermal/imx8mm_thermal.c+7−7

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

drivers/thermal/imx_sc_thermal.c+7−7

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

drivers/thermal/intel/int340x_thermal/int3400_thermal.c+2−3

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

drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c+1−12

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

drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c+1−12

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

drivers/thermal/intel/intel_powerclamp.c+7−20

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

drivers/thermal/k3_bandgap.c+6−6

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

drivers/thermal/k3_j72xx_bandgap.c+5−7

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

drivers/thermal/max77620_thermal.c+4−4

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

drivers/thermal/mtk_thermal.c+5−5

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

drivers/thermal/qcom/qcom-spmi-adc-tm5.c+10−13

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

drivers/thermal/qcom/qcom-spmi-temp-alarm.c+6−6

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

drivers/thermal/qcom/tsens.c+8−8

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

drivers/thermal/qoriq_thermal.c+6−6

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

drivers/thermal/rcar_gen3_thermal.c+8−8

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

drivers/thermal/rcar_thermal.c+3−10

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

drivers/thermal/rockchip_thermal.c+7−7

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

drivers/thermal/rzg2l_thermal.c+5−5

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

drivers/thermal/samsung/exynos_tmu.c+10−14

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

drivers/thermal/sprd_thermal.c+9−9

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

drivers/thermal/st/stm_thermal.c+8−10

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

drivers/thermal/sun8i_thermal.c+7−7

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

drivers/thermal/tegra/soctherm.c+10−11

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

drivers/thermal/tegra/tegra-bpmp-thermal.c+12−7

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

drivers/thermal/tegra/tegra30-tsensor.c+6−6

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

drivers/thermal/thermal-generic-adc.c+5−5

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

drivers/thermal/thermal_core.c+32−48

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

drivers/thermal/thermal_core.h+2−2

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

drivers/thermal/thermal_helpers.c+43−30

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

drivers/thermal/thermal_hwmon.c+1−1

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

drivers/thermal/thermal_mmio.c+9−10

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

drivers/thermal/thermal_of.c+386−762

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

drivers/thermal/thermal_sysfs.c+9−2

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

drivers/thermal/ti-soc-thermal/ti-thermal-common.c+8−8

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

drivers/thermal/uniphier_thermal.c+5−5

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

drivers/thunderbolt/acpi.c+1−1

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

drivers/thunderbolt/switch.c+1−0

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

drivers/usb/dwc3/dwc3-st.c+1−1

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

drivers/usb/storage/unusual_uas.h+21−0

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

drivers/usb/typec/mux/intel_pmc_mux.c+1−10

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

drivers/usb/typec/ucsi/ucsi.c+0−2

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

drivers/vdpa/ifcvf/ifcvf_base.c+2−2

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

drivers/vdpa/mlx5/net/mlx5_vnet.c+10−7

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

drivers/vdpa/vdpa_user/vduse_dev.c+7−2

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

drivers/vhost/vsock.c+1−1

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

fs/Kconfig.binfmt+0−33

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

fs/Makefile+0−1

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

fs/binfmt_aout.c+0−342

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

fs/coredump.c+34−5

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

fs/crypto/bio.c+10−6

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

fs/crypto/fscrypt_private.h+58−24

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

fs/crypto/hooks.c+3−7

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

fs/crypto/inline_crypt.c+95−101

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

fs/crypto/keyring.c+267−228

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

fs/crypto/keysetup.c+37−52

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

fs/crypto/keysetup_v1.c+3−1

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

fs/crypto/policy.c+2−19

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

fs/dlm/ast.c+9−6

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

fs/dlm/ast.h+0−1

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

fs/dlm/dlm_internal.h+1−1

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

fs/dlm/lock.c+109−58

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

fs/dlm/lock.h+1−1

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

fs/dlm/lockspace.c+26−6

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

fs/dlm/lockspace.h+13−0

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

fs/dlm/lowcomms.c+4−0

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

fs/dlm/user.c+11−6

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

fs/erofs/decompressor.c+28−19

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

fs/erofs/decompressor_lzma.c+3−0

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

fs/erofs/erofs_fs.h+34−6

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

fs/erofs/fscache.c+312−165

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

fs/erofs/inode.c+9−17

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

fs/erofs/internal.h+41−16

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

fs/erofs/namei.c+2−11

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

fs/erofs/super.c+77−19

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

fs/erofs/sysfs.c+21−2

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

fs/erofs/xattr.h+0−2

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

fs/erofs/zdata.c+50−1

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

fs/erofs/zmap.c+70−34

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

fs/exec.c+1−2

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

fs/ext4/ext4.h+1−0

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

fs/ext4/file.c+26−11

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

fs/ext4/inode.c+37−0

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

fs/ext4/readpage.c+6−4

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

fs/f2fs/data.c+10−8

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

fs/f2fs/f2fs.h+0−40

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

fs/f2fs/file.c+42−1

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

fs/f2fs/super.c+12−12

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

fs/fat/file.c+3−2

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

fs/gfs2/lock_dlm.c+1−1

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

fs/internal.h+3−0

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

fs/lockd/host.c+1−1

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

fs/lockd/svc4proc.c+24−0

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

fs/lockd/svcproc.c+24−0

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

fs/nfs/callback_xdr.c+1−0

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

fs/nfsd/cache.h+1−1

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

fs/nfsd/filecache.c+1−6

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

fs/nfsd/filecache.h+1−1

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

fs/nfsd/netns.h+4−0

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

fs/nfsd/nfs2acl.c+5−0

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

fs/nfsd/nfs3acl.c+3−0

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

fs/nfsd/nfs3proc.c+29−14

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

fs/nfsd/nfs3xdr.c+4−14

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

fs/nfsd/nfs4callback.c+12−2

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

fs/nfsd/nfs4idmap.c+4−4

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

fs/nfsd/nfs4layouts.c+1−1

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

fs/nfsd/nfs4proc.c+133−93

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

fs/nfsd/nfs4recover.c+8−6

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

fs/nfsd/nfs4state.c+173−45

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

fs/nfsd/nfs4xdr.c+67−35

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

fs/nfsd/nfscache.c+3−10

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

fs/nfsd/nfsctl.c+14−40

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

fs/nfsd/nfsd.h+11−2

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

fs/nfsd/nfsfh.c+1−7

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

fs/nfsd/nfsproc.c+24−15

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

fs/nfsd/nfssvc.c+1−1

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

fs/nfsd/nfsxdr.c+1−3

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

fs/nfsd/state.h+5−6

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

fs/nfsd/stats.c+2−12

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

fs/nfsd/trace.h+121−10

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

fs/nfsd/vfs.c+84−44

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

fs/nfsd/vfs.h+2−2

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

fs/nfsd/xdr4.h+5−4

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

fs/ntfs3/inode.c+0−2

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

fs/ntfs3/xattr.c+6−96

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

fs/ocfs2/stack_user.c+1−1

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

fs/overlayfs/overlayfs.h+1−1

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

fs/overlayfs/super.c+14−1

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

fs/posix_acl.c+221−67

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

fs/pstore/platform.c+12−51

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

fs/read_write.c+14−8

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

fs/stat.c+14−0

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

fs/super.c+1−1

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

fs/userfaultfd.c+2−2

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

fs/verity/read_metadata.c+3−3

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

fs/verity/verify.c+2−12

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

fs/xattr.c+4−11

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

fs/xfs/xfs_iops.c+10−0

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

include/acpi/acpi_bus.h+27−7

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

include/acpi/cppc_acpi.h+5−0

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

include/asm-generic/bug.h+0−16

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

include/asm-generic/vmlinux.lds.h+29−18

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

include/linux/a.out.h+0−18

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

include/linux/acpi.h+13−5

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

include/linux/binfmts.h+0−3

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

include/linux/blkdev.h+4−0

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

include/linux/bpf.h+137−24

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

include/linux/bpf_types.h+1−0

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

include/linux/bpf_verifier.h+29−0

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

include/linux/btf.h+19−0

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

include/linux/cfi.h+24−35

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

include/linux/cfi_types.h+45−0

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

include/linux/compiler-clang.h+3−11

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

include/linux/compiler.h+4−12

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

include/linux/compiler_types.h+5−5

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

include/linux/dlm.h+1−4

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

include/linux/edac.h+15−15

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

include/linux/filter.h+12−1

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

include/linux/fortify-string.h+178−67

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

include/linux/fs.h+1−1

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

include/linux/fscrypt.h+16−23

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

include/linux/init.h+3−3

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

include/linux/kallsyms.h+1−1

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

include/linux/key.h+6−0

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

include/linux/kprobes.h+1−0

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

include/linux/lsm_hook_defs.h+1−0

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

include/linux/lsm_hooks.h+4−0

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

include/linux/mdio/mdio-i2c.h+9−1

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

include/linux/mlx5/driver.h+5−0

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

include/linux/mlx5/mlx5_ifc.h+6−2

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

include/linux/module.h+5−5

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

include/linux/once.h+28−0

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

include/linux/overflow.h+41−31

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

include/linux/pci.h+2−2

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

include/linux/pci_ids.h+3−0

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

include/linux/phy.h+6−0

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

include/linux/platform_data/tps68470.h+6−1

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

include/linux/poison.h+3−0

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

include/linux/posix_acl_xattr.h+3−9

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

include/linux/pse-pd/pse.h+129−0

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

include/linux/rcupdate.h+37−5

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

include/linux/rcutiny.h+50−0

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

include/linux/rcutree.h+40−0

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

include/linux/resctrl.h+60−4

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

include/linux/security.h+6−0

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

include/linux/sfp.h+3−2

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

include/linux/srcutiny.h+6−4

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

include/linux/stat.h+2−0

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

include/linux/string.h+43−0

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

include/linux/sunrpc/svc.h+16−4

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

include/linux/sunrpc/xdr.h+2−0

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

include/linux/suspend.h+1−1

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

include/linux/tcp.h+7−1

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

include/linux/thermal.h+28−59

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

include/linux/verification.h+8−0

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

include/linux/wireless.h+9−1

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

include/linux/xattr.h+1−1

This diff is large: its 9 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.h+4−0

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

include/net/bluetooth/hci_core.h+15−2

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

include/net/bluetooth/hci_sync.h+8−1

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

include/net/bluetooth/mgmt.h+52−0

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

include/net/devlink.h+6−1

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

include/net/dsa.h+0−2

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

include/net/dst_metadata.h+31−0

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

include/net/flow.h+0−26

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

include/net/ip_tunnels.h+6−0

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

include/net/ipcomp.h+1−1

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

include/net/netfilter/nf_conntrack_bpf.h+24−1

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

include/net/pkt_cls.h+12−0

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

include/net/tcp.h+4−1

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

include/net/xfrm.h+17−7

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

include/net/xsk_buff_pool.h+1−1

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

include/trace/events/dlm.h+14−12

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

include/trace/events/erofs.h+4−7

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

include/uapi/linux/bpf.h+60−6

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

include/uapi/linux/dlm.h+0−1

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

include/uapi/linux/ethtool.h+45−0

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

include/uapi/linux/ethtool_netlink.h+16−0

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

include/uapi/linux/if_link.h+1−0

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

include/uapi/linux/landlock.h+5−5

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

include/uapi/linux/lwtunnel.h+10−0

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

include/uapi/linux/stat.h+3−1

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

init/Kconfig+45−1

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

io_uring/io_uring.c+7−0

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

io_uring/poll.c+1−1

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

kernel/audit.c+3−5

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

kernel/audit.h+1−3

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

kernel/auditsc.c+5−5

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

kernel/bpf/arraymap.c+24−9

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

kernel/bpf/bpf_lsm.c+1−0

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

kernel/bpf/btf.c+223−48

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

kernel/bpf/cgroup.c+18−10

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

kernel/bpf/core.c+7−2

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

kernel/bpf/dispatcher.c+21−6

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

kernel/bpf/hashtab.c+16−52

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

kernel/bpf/helpers.c+22−18

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

kernel/bpf/memalloc.c+3−2

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

kernel/bpf/percpu_freelist.c+16−32

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

kernel/bpf/ringbuf.c+232−11

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

kernel/bpf/syscall.c+20−11

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

kernel/bpf/task_iter.c+202−22

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

kernel/bpf/trampoline.c+30−30

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

kernel/bpf/verifier.c+196−143

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

kernel/cfi.c+57−295

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

kernel/configs/rust.config+1−0

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

kernel/events/core.c+9−0

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

kernel/kallsyms.c+22−21

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

kernel/kprobes.c+5−1

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

kernel/kthread.c+1−2

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

kernel/livepatch/core.c+2−2

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

kernel/module/main.c+3−47

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

kernel/rcu/rcutorture.c+248−42

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

kernel/rcu/srcutiny.c+7−7

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

kernel/rcu/tasks.h+4−1

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

kernel/rcu/tiny.c+26−1

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

kernel/rcu/tree.c+252−78

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

kernel/rcu/tree_exp.h+54−3

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

kernel/rcu/tree_nocb.h+5−5

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

kernel/rcu/tree_plugin.h+15−11

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

kernel/rcu/tree_stall.h+2−3

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

kernel/sched/core.c+14−0

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

kernel/sched/cpufreq_schedutil.c+15−15

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

kernel/smp.c+1−2

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

kernel/trace/Kconfig+6−0

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

kernel/trace/bpf_trace.c+208−3

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

kernel/trace/ftrace.c+1−2

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

kernel/user_namespace.c+5−0

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

kernel/workqueue.c+1−1

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

lib/Kconfig.debug+55−0

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

lib/Makefile+2−0

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

lib/fortify_kunit.c+76−0

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

lib/is_signed_type_kunit.c+53−0

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

lib/memcpy_kunit.c+55−4

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

lib/once.c+30−0

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

lib/overflow_kunit.c+122−55

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

lib/vsprintf.c+13−0

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

mm/damon/sysfs.c+1−1

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

mm/util.c+4−0

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

net/bluetooth/hci_conn.c+151−11

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

net/bluetooth/hci_core.c+51−17

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

net/bluetooth/hci_debugfs.c+1−1

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

net/bluetooth/hci_event.c+102−73

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

net/bluetooth/hci_request.c+149−1501

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

net/bluetooth/hci_request.h+0−53

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

net/bluetooth/hci_sock.c+1−3

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

net/bluetooth/hci_sync.c+466−25

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

net/bluetooth/hci_sysfs.c+3−0

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

net/bluetooth/l2cap_core.c+13−4

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

net/bluetooth/mgmt.c+591−19

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

net/bluetooth/mgmt_util.c+74−0

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

net/bluetooth/mgmt_util.h+18−0

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

net/bluetooth/rfcomm/sock.c+3−0

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

net/bpf/test_run.c+37−0

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

net/core/devlink.c+64−16

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

net/core/filter.c+108−16

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

net/core/gro.c+14−4

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

net/core/lwtunnel.c+1−0

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

net/core/skmsg.c+8−4

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

net/core/stream.c+2−1

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

net/dsa/dsa2.c+77−107

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

net/dsa/dsa_priv.h+1−0

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

net/dsa/port.c+15−7

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

net/dsa/slave.c+3−3

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

net/ethtool/Makefile+2−1

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

net/ethtool/common.h+1−0

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

net/ethtool/netlink.c+17−0

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

net/ethtool/netlink.h+4−0

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

net/ethtool/pse-pd.c+185−0

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

net/ieee802154/socket.c+3−0

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

net/ipv4/ah4.c+14−9

This diff is large: its 56 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+33−22

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

net/ipv4/esp4_offload.c+4−1

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

net/ipv4/inet_hashtables.c+2−2

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

net/ipv4/ip_tunnel_core.c+67−0

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

net/ipv4/ipcomp.c+7−3

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

net/ipv4/ipip.c+3−59

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

net/ipv4/ping.c+15−0

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

net/ipv4/tcp.c+2−0

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

net/ipv4/tcp_minisocks.c+1−0

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

net/ipv4/tcp_offload.c+15−2

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

net/ipv4/tcp_output.c+12−7

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

net/ipv4/xfrm4_tunnel.c+7−3

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

net/ipv6/ah6.c+15−8

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

net/ipv6/esp6.c+33−22

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

net/ipv6/esp6_offload.c+4−1

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

net/ipv6/ip6_tunnel.c+2−35

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

net/ipv6/ipcomp6.c+7−3

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

net/ipv6/mip6.c+6−8

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

net/ipv6/ping.c+16−0

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

net/ipv6/sit.c+3−62

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

net/ipv6/xfrm6_tunnel.c+7−3

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

net/mac80211/iface.c+4−4

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

net/mac80211/mlme.c+4−3

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

net/mac80211/rx.c+5−4

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

net/mac80211/tx.c+6−4

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

net/mac80211/util.c+1−1

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

net/mptcp/protocol.c+87−37

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

net/netfilter/Makefile+6−0

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

net/netfilter/nf_conntrack_bpf.c+67−7

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

net/netfilter/nf_conntrack_core.c+1−0

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

net/netfilter/nf_nat_bpf.c+79−0

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

net/netfilter/nf_nat_core.c+2−2

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

net/netlink/genetlink.c+31−1

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

net/rds/tcp.c+1−1

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

net/sched/cls_basic.c+1−6

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

net/sched/cls_bpf.c+1−6

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

net/sched/cls_flower.c+1−6

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

net/sched/cls_fw.c+1−6

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

net/sched/cls_matchall.c+1−6

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

net/sched/cls_route.c+1−6

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

net/sched/cls_rsvp.h+1−6

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

net/sched/cls_tcindex.c+1−6

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

net/sched/cls_u32.c+1−6

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

net/sched/sch_api.c+1−1

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

net/sctp/auth.c+14−4

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

net/sunrpc/svc.c+18−16

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

net/sunrpc/xdr.c+23−1

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

net/unix/af_unix.c+7−6

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

net/vmw_vsock/virtio_transport_common.c+1−1

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

net/wireless/nl80211.c+3−1

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

net/wireless/util.c+21−19

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

net/wireless/wext-core.c+10−7

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

net/xdp/xsk.c+13−13

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

net/xdp/xsk_buff_pool.c+3−2

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

net/xdp/xsk_queue.h+10−12

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

net/xfrm/xfrm_device.c+15−5

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

net/xfrm/xfrm_input.c+18−7

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

net/xfrm/xfrm_interface.c+186−20

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

net/xfrm/xfrm_ipcomp.c+8−3

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

net/xfrm/xfrm_policy.c+12−13

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

net/xfrm/xfrm_replay.c+7−3

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

net/xfrm/xfrm_state.c+21−9

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

net/xfrm/xfrm_user.c+250−120

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

rust/.gitignore+8−0

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

rust/Makefile+381−0

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

rust/alloc/README.md+33−0

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

rust/alloc/alloc.rs+440−0

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

rust/alloc/borrow.rs+498−0

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

rust/alloc/boxed.rs+2028−0

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

rust/alloc/collections/mod.rs+156−0

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

rust/alloc/lib.rs+244−0

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

rust/alloc/raw_vec.rs+527−0

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

rust/alloc/slice.rs+1204−0

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

rust/alloc/vec/drain.rs+186−0

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

rust/alloc/vec/drain_filter.rs+145−0

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

rust/alloc/vec/into_iter.rs+366−0

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

rust/alloc/vec/is_zero.rs+120−0

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

rust/alloc/vec/mod.rs+3140−0

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

rust/alloc/vec/partial_eq.rs+49−0

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

rust/bindgen_parameters+21−0

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

rust/bindings/bindings_helper.h+13−0

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

rust/bindings/lib.rs+53−0

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

rust/compiler_builtins.rs+63−0

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

rust/exports.c+21−0

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

rust/helpers.c+51−0

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

rust/kernel/allocator.rs+64−0

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

rust/kernel/error.rs+59−0

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

rust/kernel/lib.rs+78−0

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

rust/kernel/prelude.rs+20−0

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

rust/kernel/print.rs+198−0

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

rust/kernel/str.rs+72−0

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

rust/macros/helpers.rs+51−0

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

rust/macros/lib.rs+72−0

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

rust/macros/module.rs+282−0

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

samples/Kconfig+2−0

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

samples/Makefile+1−0

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

samples/bpf/task_fd_query_kern.c+1−1

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

samples/bpf/task_fd_query_user.c+1−1

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

samples/bpf/tracex3_kern.c+1−1

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

samples/bpf/xdp_router_ipv4_user.c+1−1

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

samples/landlock/sandboxer.c+29−8

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

samples/rust/Kconfig+30−0

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

samples/rust/Makefile+5−0

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

samples/rust/hostprogs/.gitignore+3−0

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

samples/rust/hostprogs/Makefile+5−0

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

samples/rust/hostprogs/a.rs+7−0

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

samples/rust/hostprogs/b.rs+5−0

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

samples/rust/hostprogs/single.rs+12−0

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

samples/rust/rust_minimal.rs+38−0

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

scripts/.gitignore+1−0

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

scripts/Kconfig.include+3−3

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

scripts/Makefile+3−0

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

scripts/Makefile.build+60−0

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

scripts/Makefile.debug+8−0

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

scripts/Makefile.extrawarn+1−0

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

scripts/Makefile.host+31−3

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

scripts/Makefile.lib+12−0

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

scripts/Makefile.modfinal+5−3

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

scripts/cc-version.sh+6−6

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

scripts/checkpatch.pl+12−8

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

scripts/decode_stacktrace.sh+14−0

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

scripts/generate_rust_analyzer.py+135−0

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

scripts/generate_rust_target.rs+182−0

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

scripts/is_rust_module.sh+16−0

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

scripts/kallsyms.c+47−7

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

scripts/kconfig/confdata.c+75−0

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

scripts/min-tool-version.sh+6−0

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

scripts/module.lds.S+4−19

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

scripts/rust_is_available.sh+160−0

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

scripts/rust_is_available_bindgen_libclang.h+2−0

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

scripts/selinux/install_policy.sh+2−3

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

security/Kconfig.hardening+10−4

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

security/integrity/evm/evm_main.c+14−3

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

security/integrity/ima/ima_appraise.c+8−4

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

security/integrity/platform_certs/load_uefi.c+1−1

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

security/keys/internal.h+0−2

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

security/landlock/fs.c+1−1

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

security/landlock/syscalls.c+20−20

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

security/loadpin/Kconfig+6−1

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

security/loadpin/loadpin.c+15−1

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

security/lockdown/lockdown.c+1−1

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

security/lsm_audit.c+1−13

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

security/security.c+5−0

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

security/selinux/hooks.c+18−15

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

security/selinux/include/classmap.h+2−0

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

security/selinux/selinuxfs.c+6−9

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

security/selinux/ss/context.h+9−8

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

security/selinux/ss/ebitmap.c+11−10

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

security/selinux/ss/ebitmap.h+9−9

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

security/selinux/ss/mls_types.h+2−2

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

security/smack/smack.h+0−9

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

security/smack/smack_lsm.c+17−3

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

tools/bpf/bpftool/Documentation/bpftool-map.rst+1−1

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

tools/bpf/bpftool/btf.c+5−11

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

tools/bpf/bpftool/cgroup.c+49−5

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

tools/bpf/bpftool/gen.c+2−2

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

tools/bpf/bpftool/link.c+19−0

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

tools/bpf/bpftool/map.c+1−1

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

tools/bpf/bpftool/map_perf_ring.c+3−11

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

tools/include/linux/kallsyms.h+1−1

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

tools/include/nolibc/arch-riscv.h+1−1

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

tools/include/nolibc/sys.h+2−2

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

tools/include/uapi/linux/bpf.h+60−6

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

tools/lib/bpf/bpf_helpers.h+6−25

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

tools/lib/bpf/bpf_tracing.h+107−0

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

tools/lib/bpf/btf.c+13−19

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

tools/lib/bpf/btf.h+24−1

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

tools/lib/bpf/btf_dump.c+1−1

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

tools/lib/bpf/libbpf.c+50−56

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

tools/lib/bpf/libbpf.h+110−1

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

tools/lib/bpf/libbpf.map+10−0

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

tools/lib/bpf/libbpf_probes.c+1−0

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

tools/lib/bpf/libbpf_version.h+1−1

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

tools/lib/bpf/nlattr.c+1−1

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

tools/lib/bpf/ringbuf.c+271−0

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

tools/lib/bpf/usdt.c+1−1

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

tools/lib/perf/include/perf/event.h+1−1

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

tools/lib/symbol/kallsyms.h+1−1

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

tools/memory-model/Documentation/litmus-tests.txt+27−10

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

tools/objtool/check.c+10−1

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

tools/objtool/elf.c+6−1

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

tools/perf/tests/mmap-basic.c+1−2

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

tools/perf/tests/perf-record.c+1−1

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

tools/perf/tests/shell/record.sh+1−1

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

tools/perf/tests/shell/test_brstack.sh+2−1

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

tools/perf/tests/vmlinux-kallsyms.c+3−2

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

tools/perf/util/Build+1−1

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

tools/perf/util/arm-spe.c+1−1

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

tools/perf/util/bpf_skel/bperf_cgroup.bpf.c+10−1

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

tools/perf/util/bpf_skel/off_cpu.bpf.c+14−4

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

tools/perf/util/parse-events-hybrid.c+17−4

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

tools/perf/util/parse-events.c+39−0

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

tools/perf/util/parse-events.h+1−0

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

tools/perf/util/print-events.c+0−39

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

tools/perf/util/scripting-engines/Build+1−1

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

tools/power/acpi/tools/pfrut/pfrut.c+1−1

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

tools/testing/selftests/bpf/.gitignore+2−0

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

tools/testing/selftests/bpf/DENYLIST.s390x+5−0

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

tools/testing/selftests/bpf/Makefile+21−6

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

tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c+48−0

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

tools/testing/selftests/bpf/config+20−13

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

tools/testing/selftests/bpf/config.x86_64+1−6

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

tools/testing/selftests/bpf/map_tests/array_map_batch_ops.c+2−0

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

tools/testing/selftests/bpf/map_tests/htab_map_batch_ops.c+2−0

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

tools/testing/selftests/bpf/map_tests/lpm_trie_map_batch_ops.c+2−0

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

tools/testing/selftests/bpf/map_tests/task_storage_map.c+6−1

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

tools/testing/selftests/bpf/prog_tests/bpf_iter.c+261−21

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

tools/testing/selftests/bpf/prog_tests/bpf_nf.c+10−3

This diff is large: its 43 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/btf_dump.c+1−1

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

tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c+0−20

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

tools/testing/selftests/bpf/prog_tests/cgroup_hierarchical_stats.c+76−94

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

tools/testing/selftests/bpf/prog_tests/cgroup_link.c+4−7

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

tools/testing/selftests/bpf/prog_tests/connect_ping.c+178−0

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

tools/testing/selftests/bpf/prog_tests/deny_namespace.c+102−0

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

tools/testing/selftests/bpf/prog_tests/dynptr.c+1−1

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

tools/testing/selftests/bpf/prog_tests/get_func_ip_test.c+48−11

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

tools/testing/selftests/bpf/prog_tests/kfunc_call.c+206−21

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

tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c+164−0

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

tools/testing/selftests/bpf/prog_tests/lookup_key.c+112−0

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

tools/testing/selftests/bpf/prog_tests/sockmap_basic.c+33−54

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

tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c+10−29

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

tools/testing/selftests/bpf/prog_tests/sockopt.c+2−2

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

tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c+13−17

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

tools/testing/selftests/bpf/prog_tests/sockopt_multi.c+5−5

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

tools/testing/selftests/bpf/prog_tests/sockopt_sk.c+1−1

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

tools/testing/selftests/bpf/prog_tests/tcp_estats.c+1−3

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

tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c+28−72

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

tools/testing/selftests/bpf/prog_tests/tcp_rtt.c+5−8

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

tools/testing/selftests/bpf/prog_tests/tcpbpf_user.c+12−20

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

tools/testing/selftests/bpf/prog_tests/tracing_struct.c+63−0

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

tools/testing/selftests/bpf/prog_tests/udp_limit.c+7−11

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

tools/testing/selftests/bpf/prog_tests/user_ringbuf.c+754−0

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

tools/testing/selftests/bpf/prog_tests/verify_pkcs7_sig.c+399−0

This diff is large: its 400 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bpf_dctcp.c+17−8

This diff is large: its 48 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bpf_iter_task.c+9−0

This diff is large: its 23 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bpf_iter_task_file.c+8−1

This diff is large: its 30 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bpf_iter_task_vma.c+6−1

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bpf_iter_vma_offset.c+37−0

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/bpf/progs/cgroup_hierarchical_stats.c+55−126

This diff is large: its 277 lines aren’t shown here.

tools/testing/selftests/bpf/progs/connect_ping.c+53−0

This diff is large: its 54 lines aren’t shown here.

tools/testing/selftests/bpf/progs/get_func_ip_test.c+13−12

This diff is large: its 49 lines aren’t shown here.

tools/testing/selftests/bpf/progs/kfunc_call_fail.c+160−0

This diff is large: its 161 lines aren’t shown here.

tools/testing/selftests/bpf/progs/kfunc_call_test.c+71−0

This diff is large: its 83 lines aren’t shown here.

tools/testing/selftests/bpf/progs/kprobe_multi.c+1−3

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_bpf_nf.c+38−5

This diff is large: its 92 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c+14−0

This diff is large: its 21 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_deny_namespace.c+33−0

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c+94−0

This diff is large: its 95 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_lookup_key.c+46−0

This diff is large: its 47 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_user_ringbuf.h+35−0

This diff is large: its 36 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_verif_scale1.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_verif_scale3.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/progs/test_verify_pkcs7_sig.c+90−0

This diff is large: its 91 lines aren’t shown here.

tools/testing/selftests/bpf/progs/timer.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/bpf/progs/tracing_struct.c+120−0

This diff is large: its 121 lines aren’t shown here.

tools/testing/selftests/bpf/progs/user_ringbuf_fail.c+177−0

This diff is large: its 178 lines aren’t shown here.

tools/testing/selftests/bpf/progs/user_ringbuf_success.c+218−0

This diff is large: its 219 lines aren’t shown here.

tools/testing/selftests/bpf/test_kmod.sh+13−7

This diff is large: its 48 lines aren’t shown here.

tools/testing/selftests/bpf/test_maps.c+16−10

This diff is large: its 114 lines aren’t shown here.

tools/testing/selftests/bpf/test_maps.h+2−0

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/bpf/test_progs.c+17−0

This diff is large: its 24 lines aren’t shown here.

tools/testing/selftests/bpf/test_progs.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/bpf/test_sockmap.c+42−0

This diff is large: its 91 lines aren’t shown here.

tools/testing/selftests/bpf/test_verifier.c+2−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/bpf/verifier/calls.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/verifier/ref_tracking.c+139−0

This diff is large: its 146 lines aren’t shown here.

tools/testing/selftests/bpf/verifier/var_off.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/verify_sig_setup.sh+104−0

This diff is large: its 105 lines aren’t shown here.

tools/testing/selftests/bpf/veristat.c+1322−0

This diff is large: its 1323 lines aren’t shown here.

tools/testing/selftests/bpf/veristat.cfg+17−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/bpf/xskxceiver.c+4−3

This diff is large: its 28 lines aren’t shown here.

tools/testing/selftests/kvm/Makefile+10−1

This diff is large: its 32 lines aren’t shown here.

tools/testing/selftests/kvm/access_tracking_perf_test.c+16−9

This diff is large: its 43 lines aren’t shown here.

tools/testing/selftests/kvm/include/x86_64/vmx.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/kvm/lib/assert.c+13−7

This diff is large: its 40 lines aren’t shown here.

tools/testing/selftests/kvm/lib/string_override.c+39−0

This diff is large: its 40 lines aren’t shown here.

tools/testing/selftests/kvm/lib/x86_64/vmx.c+20−0

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c+16−18

This diff is large: its 79 lines aren’t shown here.

tools/testing/selftests/lkdtm/tests.txt+5−3

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/net/ipsec.c+45−59

This diff is large: its 125 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_connect.c+57−8

This diff is large: its 164 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_join.sh+73−17

This diff is large: its 209 lines aren’t shown here.

tools/testing/selftests/nolibc/.gitignore+4−0

This diff is large: its 5 lines aren’t shown here.

tools/testing/selftests/nolibc/Makefile+135−0

This diff is large: its 136 lines aren’t shown here.

tools/testing/selftests/nolibc/nolibc-test.c+757−0

This diff is large: its 758 lines aren’t shown here.

tools/testing/selftests/tc-testing/config+24−1

This diff is large: its 54 lines aren’t shown here.

tools/virtio/linux/virtio.h+3−0

This diff is large: its 18 lines aren’t shown here.

tools/virtio/linux/virtio_config.h+5−0

This diff is large: its 12 lines aren’t shown here.