History

Merge series "Compatible string consolidation for NXP DSPI driver" from Vladimir Oltean <olteanv@gmail.com>:

This series makes room in the driver for differentiation between the controllers which currently operate in TCFQ mode. Most of these are actually capable of a lot more in terms of throughput. This is in preparation of a second series which will convert the remaining users of TCFQ mode altogether to XSPI mode with command cycling. Vladimir Oltean (6): doc: spi-fsl-dspi: Add specific compatibles for all Layerscape SoCs spi: spi-fsl-dspi: Use specific compatible strings for all SoC instantiations spi: spi-fsl-dspi: Parameterize the FIFO size and DMA buffer size spi: spi-fsl-dspi: LS2080A and LX2160A support XSPI mode spi: spi-fsl-dspi: Support SPI software timestamping in all non-DMA modes spi: spi-fsl-dspi: Convert the instantiations that support it to DMA .../devicetree/bindings/spi/spi-fsl-dspi.txt | 17 +- drivers/spi/spi-fsl-dspi.c | 162 +++++++++++++----- 2 files changed, 128 insertions(+), 51 deletions(-) -- 2.17.1

Mark Brown committed 6 years ago

Commit cb71d8e2 parents 4709d86 50b6207979 files · +16305 −11462Browse files

Unified · Split

979 files
  1. .gitignore +4 −0
  2. COPYING +2 −0
  3. CREDITS +5 −0
  4. Documentation/admin-guide/bootconfig.rst +31 −3
  5. Documentation/admin-guide/kernel-parameters.txt +4 −0
  6. Documentation/arm64/memory.rst +1 −1
  7. Documentation/arm64/tagged-address-abi.rst +9 −2
  8. Documentation/dev-tools/kunit/usage.rst +1 −0
  9. Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml +5 −1
  10. Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt +2 −1
  11. Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +28 −12
  12. Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.yaml +12 −8
  13. Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +1 −1
  14. Documentation/devicetree/bindings/net/mdio.yaml +0 −1
  15. Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +11 −6
  16. Documentation/driver-api/ipmb.rst +4 −0
  17. Documentation/filesystems/zonefs.txt +10 −10
  18. Documentation/hwmon/xdpe12284.rst +1 −0
  19. Documentation/kbuild/makefiles.rst +1 −4
  20. Documentation/networking/phy.rst +3 −2
  21. Documentation/power/index.rst +0 −1
  22. Documentation/process/embargoed-hardware-issues.rst +4 −4
  23. Documentation/sphinx/parallel-wrapper.sh +1 −1
  24. Documentation/translations/zh_CN/process/embargoed-hardware-issues.rst +1 −1
  25. Documentation/virt/guest-halt-polling.rst +9 −3
  26. Documentation/virt/index.rst +2 −0
  27. Documentation/virt/kvm/api.rst +1981 −1402
  28. Documentation/virt/kvm/arm/hyp-abi.rst +19 −9
  29. Documentation/virt/kvm/arm/index.rst +12 −0
  30. Documentation/virt/kvm/arm/psci.rst +31 −15
  31. Documentation/virt/kvm/devices/arm-vgic-its.rst +67 −39
  32. Documentation/virt/kvm/devices/arm-vgic-v3.rst +86 −46
  33. Documentation/virt/kvm/devices/arm-vgic.rst +59 −30
  34. Documentation/virt/kvm/devices/index.rst +19 −0
  35. Documentation/virt/kvm/devices/mpic.rst +8 −3
  36. Documentation/virt/kvm/devices/s390_flic.rst +40 −30
  37. Documentation/virt/kvm/devices/vcpu.rst +114 −0
  38. Documentation/virt/kvm/devices/vcpu.txt +0 −76
  39. Documentation/virt/kvm/devices/vfio.rst +15 −10
  40. Documentation/virt/kvm/devices/vm.rst +126 −80
  41. Documentation/virt/kvm/devices/xics.rst +22 −6
  42. Documentation/virt/kvm/devices/xive.rst +97 −55
  43. Documentation/virt/kvm/halt-polling.rst +47 −43
  44. Documentation/virt/kvm/hypercalls.rst +73 −56
  45. Documentation/virt/kvm/index.rst +16 −0
  46. Documentation/virt/kvm/locking.rst +243 −0
  47. Documentation/virt/kvm/locking.txt +0 −215
  48. Documentation/virt/kvm/mmu.rst +48 −14
  49. Documentation/virt/kvm/msr.rst +92 −55
  50. Documentation/virt/kvm/nested-vmx.rst +21 −16
  51. Documentation/virt/kvm/ppc-pv.rst +18 −8
  52. Documentation/virt/kvm/review-checklist.rst +3 −0
  53. Documentation/virt/kvm/s390-diag.rst +8 −5
  54. Documentation/virt/kvm/timekeeping.rst +128 −95
  55. Documentation/virt/uml/user_mode_linux.rst +812 −998
  56. Documentation/x86/index.rst +0 −1
  57. MAINTAINERS +46 −47
  58. Makefile +4 −2
  59. arch/arm/boot/dts/stih410-b2260.dts +0 −3
  60. arch/arm/boot/dts/stihxxx-b2120.dtsi +1 −1
  61. arch/arm/configs/am200epdkit_defconfig +0 −2
  62. arch/arm/configs/axm55xx_defconfig +0 −1
  63. arch/arm/configs/clps711x_defconfig +0 −1
  64. arch/arm/configs/cns3420vb_defconfig +1 −1
  65. arch/arm/configs/colibri_pxa300_defconfig +0 −1
  66. arch/arm/configs/collie_defconfig +0 −2
  67. arch/arm/configs/davinci_all_defconfig +0 −2
  68. arch/arm/configs/efm32_defconfig +0 −2
  69. arch/arm/configs/ep93xx_defconfig +0 −1
  70. arch/arm/configs/eseries_pxa_defconfig +0 −2
  71. arch/arm/configs/ezx_defconfig +0 −1
  72. arch/arm/configs/h3600_defconfig +0 −2
  73. arch/arm/configs/h5000_defconfig +0 −1
  74. arch/arm/configs/imote2_defconfig +0 −1
  75. arch/arm/configs/imx_v4_v5_defconfig +0 −2
  76. arch/arm/configs/lpc18xx_defconfig +0 −4
  77. arch/arm/configs/magician_defconfig +0 −2
  78. arch/arm/configs/moxart_defconfig +0 −1
  79. arch/arm/configs/mxs_defconfig +0 −2
  80. arch/arm/configs/omap1_defconfig +0 −2
  81. arch/arm/configs/palmz72_defconfig +0 −2
  82. arch/arm/configs/pcm027_defconfig +0 −2
  83. arch/arm/configs/pleb_defconfig +0 −2
  84. arch/arm/configs/realview_defconfig +0 −1
  85. arch/arm/configs/sama5_defconfig +0 −3
  86. arch/arm/configs/stm32_defconfig +0 −2
  87. arch/arm/configs/sunxi_defconfig +1 −0
  88. arch/arm/configs/u300_defconfig +0 −2
  89. arch/arm/configs/vexpress_defconfig +0 −2
  90. arch/arm/configs/viper_defconfig +0 −1
  91. arch/arm/configs/zeus_defconfig +0 −2
  92. arch/arm/configs/zx_defconfig +0 −1
  93. arch/arm/include/asm/kvm_host.h +0 −3
  94. arch/arm/kernel/ftrace.c +2 −5
  95. arch/arm/kernel/patch.c +9 −10
  96. arch/arm/mach-npcm/Kconfig +1 −1
  97. arch/arm64/boot/dts/arm/fvp-base-revc.dts +4 −4
  98. arch/arm64/configs/defconfig +3 −1
  99. arch/arm64/include/asm/arch_gicv3.h +1 −1
  100. arch/arm64/include/asm/cache.h +1 −1
  101. arch/arm64/include/asm/cacheflush.h +1 −1
  102. arch/arm64/include/asm/cpufeature.h +5 −5
  103. arch/arm64/include/asm/exception.h +0 −4
  104. arch/arm64/include/asm/io.h +2 −2
  105. arch/arm64/include/asm/kvm_emulate.h +24 −24
  106. arch/arm64/include/asm/kvm_host.h +0 −32
  107. arch/arm64/include/asm/kvm_hyp.h +7 −0
  108. arch/arm64/include/asm/kvm_mmu.h +2 −1
  109. arch/arm64/include/asm/lse.h +1 −1
  110. arch/arm64/include/asm/memory.h +1 −1
  111. arch/arm64/include/asm/spinlock.h +5 −1
  112. arch/arm64/include/asm/virt.h +1 −1
  113. arch/arm64/kernel/kaslr.c +1 −0
  114. arch/arm64/kernel/process.c +9 −4
  115. arch/arm64/kernel/time.c +1 −1
  116. arch/arm64/kvm/hyp/switch.c +37 −2
  117. arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c +2 −2
  118. arch/csky/Kconfig +48 −3
  119. arch/csky/Kconfig.platforms +9 −0
  120. arch/csky/abiv1/inc/abi/cacheflush.h +2 −3
  121. arch/csky/abiv1/inc/abi/entry.h +14 −5
  122. arch/csky/abiv2/cacheflush.c +59 −25
  123. arch/csky/abiv2/inc/abi/cacheflush.h +21 −12
  124. arch/csky/abiv2/inc/abi/entry.h +11 −0
  125. arch/csky/configs/defconfig +0 −8
  126. arch/csky/include/asm/Kbuild +0 −1
  127. arch/csky/include/asm/cache.h +1 −0
  128. arch/csky/include/asm/cacheflush.h +1 −0
  129. arch/csky/include/asm/fixmap.h +8 −1
  130. arch/csky/include/asm/memory.h +25 −0
  131. arch/csky/include/asm/mmu.h +1 −0
  132. arch/csky/include/asm/mmu_context.h +2 −0
  133. arch/csky/include/asm/pci.h +34 −0
  134. arch/csky/include/asm/pgtable.h +1 −5
  135. arch/csky/include/asm/stackprotector.h +29 −0
  136. arch/csky/include/asm/tcm.h +24 −0
  137. arch/csky/include/uapi/asm/unistd.h +3 −0
  138. arch/csky/kernel/atomic.S +6 −2
  139. arch/csky/kernel/process.c +10 −3
  140. arch/csky/kernel/setup.c +2 −3
  141. arch/csky/kernel/smp.c +1 −1
  142. arch/csky/kernel/time.c +1 −1
  143. arch/csky/kernel/vmlinux.lds.S +49 −0
  144. arch/csky/mm/Makefile +3 −0
  145. arch/csky/mm/cachev1.c +5 −0
  146. arch/csky/mm/cachev2.c +22 −23
  147. arch/csky/mm/highmem.c +4 −60
  148. arch/csky/mm/init.c +92 −0
  149. arch/csky/mm/syscache.c +5 −8
  150. arch/csky/mm/tcm.c +169 −0
  151. arch/mips/boot/dts/ingenic/jz4740.dtsi +9 −8
  152. arch/mips/boot/dts/ingenic/jz4780.dtsi +9 −8
  153. arch/mips/boot/dts/ingenic/x1000.dtsi +2 −4
  154. arch/mips/include/asm/sync.h +3 −1
  155. arch/mips/kernel/vpe.c +1 −1
  156. arch/mips/vdso/Makefile +25 −3
  157. arch/powerpc/include/asm/page.h +5 −0
  158. arch/powerpc/include/asm/processor.h +4 −0
  159. arch/powerpc/kernel/asm-offsets.c +12 −0
  160. arch/powerpc/kernel/eeh_driver.c +11 −10
  161. arch/powerpc/kernel/entry_32.S +9 −4
  162. arch/powerpc/kernel/head_32.S +150 −5
  163. arch/powerpc/kernel/head_32.h +20 −1
  164. arch/powerpc/kernel/head_8xx.S +1 −1
  165. arch/powerpc/kernel/idle_6xx.S +8 −0
  166. arch/powerpc/kernel/signal.c +15 −2
  167. arch/powerpc/kernel/signal_32.c +14 −14
  168. arch/powerpc/kernel/signal_64.c +10 −12
  169. arch/powerpc/mm/book3s32/hash_low.S +23 −29
  170. arch/powerpc/mm/book3s32/mmu.c +2 −8
  171. arch/powerpc/mm/hugetlbpage.c +18 −11
  172. arch/powerpc/mm/kasan/kasan_init_32.c +1 −2
  173. arch/powerpc/xmon/xmon.c +5 −0
  174. arch/riscv/boot/.gitignore +2 −0
  175. arch/riscv/include/asm/csr.h +12 −0
  176. arch/riscv/kernel/head.S +6 −0
  177. arch/riscv/kernel/traps.c +2 −2
  178. arch/riscv/mm/kasan_init.c +31 −22
  179. arch/s390/Makefile +1 −1
  180. arch/s390/boot/Makefile +1 −1
  181. arch/s390/boot/kaslr.c +1 −1
  182. arch/s390/boot/uv.c +2 −1
  183. arch/s390/configs/debug_defconfig +13 −15
  184. arch/s390/configs/defconfig +5 −6
  185. arch/s390/include/asm/page.h +1 −1
  186. arch/s390/include/asm/processor.h +0 −1
  187. arch/s390/include/asm/qdio.h +3 −3
  188. arch/s390/include/asm/timex.h +1 −1
  189. arch/x86/boot/compressed/kaslr_64.c +0 −3
  190. arch/x86/events/amd/core.c +1 −0
  191. arch/x86/events/intel/core.c +1 −0
  192. arch/x86/events/intel/cstate.c +13 −9
  193. arch/x86/events/intel/ds.c +2 −0
  194. arch/x86/events/msr.c +2 −1
  195. arch/x86/include/asm/io_bitmap.h +8 −1
  196. arch/x86/include/asm/kvm_emulate.h +12 −1
  197. arch/x86/include/asm/kvm_host.h +15 −4
  198. arch/x86/include/asm/msr-index.h +2 −0
  199. arch/x86/include/asm/paravirt.h +7 −0
  200. arch/x86/include/asm/paravirt_types.h +4 −0
  201. arch/x86/include/asm/vmx.h +1 −1
  202. arch/x86/include/asm/vmxfeatures.h +1 −0
  203. arch/x86/include/uapi/asm/kvm.h +1 −0
  204. arch/x86/kernel/cpu/amd.c +14 −0
  205. arch/x86/kernel/cpu/common.c +1 −1
  206. arch/x86/kernel/cpu/mce/amd.c +27 −23
  207. arch/x86/kernel/ima_arch.c +2 −4
  208. arch/x86/kernel/kvm.c +44 −21
  209. arch/x86/kernel/paravirt.c +5 −0
  210. arch/x86/kernel/process.c +1 −1
  211. arch/x86/kvm/Kconfig +13 −0
  212. arch/x86/kvm/Makefile +1 −0
  213. arch/x86/kvm/emulate.c +14 −22
  214. arch/x86/kvm/irq_comm.c +1 −1
  215. arch/x86/kvm/lapic.c +4 −8
  216. arch/x86/kvm/mmu.h +13 −0
  217. arch/x86/kvm/mmu/mmu.c +5 −6
  218. arch/x86/kvm/mmu/paging_tmpl.h +1 −1
  219. arch/x86/kvm/mmutrace.h +1 −1
  220. arch/x86/kvm/svm.c +41 −31
  221. arch/x86/kvm/vmx/capabilities.h +1 −0
  222. arch/x86/kvm/vmx/nested.c +97 −25
  223. arch/x86/kvm/vmx/nested.h +8 −2
  224. arch/x86/kvm/vmx/vmx.c +131 −21
  225. arch/x86/kvm/vmx/vmx.h +3 −0
  226. arch/x86/kvm/x86.c +35 −23
  227. arch/x86/mm/dump_pagetables.c +1 −6
  228. arch/x86/platform/efi/efi_64.c +52 −99
  229. arch/x86/xen/enlighten_pv.c +29 −3
  230. block/blk-flush.c +1 −1
  231. block/blk-mq-sched.c +15 −7
  232. block/blk-mq-tag.c +2 −2
  233. block/blk-mq-tag.h +2 −2
  234. block/blk-mq.c +15 −13
  235. block/blk-mq.h +3 −2
  236. crypto/Kconfig +0 −4
  237. crypto/hash_info.c +1 −1
  238. crypto/testmgr.c +36 −0
  239. drivers/acpi/acpi_watchdog.c +12 −3
  240. drivers/acpi/acpica/achware.h +2 −0
  241. drivers/acpi/acpica/evevent.c +45 −0
  242. drivers/acpi/acpica/evxfgpe.c +32 −0
  243. drivers/acpi/acpica/hwgpe.c +71 −0
  244. drivers/acpi/ec.c +26 −18
  245. drivers/acpi/sleep.c +44 −13
  246. drivers/block/floppy.c +5 −2
  247. drivers/block/null_blk.h +0 −3
  248. drivers/block/null_blk_main.c +0 −2
  249. drivers/block/paride/pcd.c +1 −1
  250. drivers/bus/moxtet.c +1 −1
  251. drivers/cdrom/gdrom.c +1 −1
  252. drivers/char/ipmi/ipmb_dev_int.c +31 −2
  253. drivers/char/ipmi/ipmi_ssif.c +7 −3
  254. drivers/char/tpm/Makefile +5 −3
  255. drivers/char/tpm/tpm2-cmd.c +2 −0
  256. drivers/char/tpm/tpm_tis_spi_main.c +0 −0
  257. drivers/cpufreq/cpufreq.c +12 −5
  258. drivers/dax/super.c +1 −1
  259. drivers/devfreq/devfreq.c +1 −3
  260. drivers/edac/edac_mc.c +3 −9
  261. drivers/edac/edac_mc_sysfs.c +4 −14
  262. drivers/firmware/efi/efi.c +2 −2
  263. drivers/fsi/Kconfig +1 −0
  264. drivers/gpio/gpio-bd71828.c +0 −10
  265. drivers/gpio/gpio-sifive.c +3 −3
  266. drivers/gpio/gpio-xilinx.c +3 −2
  267. drivers/gpio/gpiolib.c +25 −5
  268. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 −1
  269. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1 −0
  270. drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c +8 −7
  271. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +25 −1
  272. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1 −2
  273. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 −0
  274. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +22 −5
  275. drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +36 −1
  276. drivers/gpu/drm/amd/amdgpu/soc15.c +6 −1
  277. drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +8 −6
  278. drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +3 −3
  279. drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +4 −4
  280. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 −6
  281. drivers/gpu/drm/amd/display/dc/bios/command_table2.c +0 −4
  282. drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +6 −0
  283. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +1 −1
  284. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +13 −7
  285. drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +1 −1
  286. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 −1
  287. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +6 −0
  288. drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c +2 −2
  289. drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_offset.h +2 −0
  290. drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h +32 −14
  291. drivers/gpu/drm/amd/powerplay/navi10_ppt.c +11 −11
  292. drivers/gpu/drm/amd/powerplay/smu_v11_0.c +8 −4
  293. drivers/gpu/drm/bridge/tc358767.c +4 −4
  294. drivers/gpu/drm/bridge/ti-tfp410.c +2 −1
  295. drivers/gpu/drm/drm_client_modeset.c +2 −1
  296. drivers/gpu/drm/drm_dp_mst_topology.c +2 −1
  297. drivers/gpu/drm/drm_edid.c +1 −1
  298. drivers/gpu/drm/drm_modes.c +7 −0
  299. drivers/gpu/drm/i915/Kconfig +2 −3
  300. drivers/gpu/drm/i915/Makefile +1 −1
  301. drivers/gpu/drm/i915/display/intel_bios.c +4 −2
  302. drivers/gpu/drm/i915/display/intel_ddi.c +3 −1
  303. drivers/gpu/drm/i915/display/intel_display.c +37 −27
  304. drivers/gpu/drm/i915/display/intel_dsi_vbt.c +32 −18
  305. drivers/gpu/drm/i915/gem/i915_gem_context.c +16 −0
  306. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +36 −1
  307. drivers/gpu/drm/i915/gem/i915_gem_mman.c +87 −42
  308. drivers/gpu/drm/i915/gem/i915_gem_object.c +7 −11
  309. drivers/gpu/drm/i915/gem/i915_gem_object.h +10 −2
  310. drivers/gpu/drm/i915/gem/i915_gem_object_types.h +2 −7
  311. drivers/gpu/drm/i915/gem/i915_gem_phys.c +50 −48
  312. drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +1 −3
  313. drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +3 −0
  314. drivers/gpu/drm/i915/gt/intel_context.c +25 −21
  315. drivers/gpu/drm/i915/gt/intel_engine_cs.c +13 −0
  316. drivers/gpu/drm/i915/gt/intel_engine_types.h +1 −0
  317. drivers/gpu/drm/i915/gt/intel_gt_requests.c +3 −0
  318. drivers/gpu/drm/i915/gt/intel_lrc.c +372 −43
  319. drivers/gpu/drm/i915/gt/intel_ring.c +1 −0
  320. drivers/gpu/drm/i915/gt/intel_ring.h +8 −0
  321. drivers/gpu/drm/i915/gt/intel_ring_types.h +4 −3
  322. drivers/gpu/drm/i915/gt/mock_engine.c +16 −1
  323. drivers/gpu/drm/i915/gt/selftest_lrc.c +259 −1
  324. drivers/gpu/drm/i915/gvt/dmabuf.c +1 −1
  325. drivers/gpu/drm/i915/gvt/firmware.c +2 −2
  326. drivers/gpu/drm/i915/gvt/gtt.c +4 −0
  327. drivers/gpu/drm/i915/gvt/vgpu.c +1 −1
  328. drivers/gpu/drm/i915/i915_active.c +19 −16
  329. drivers/gpu/drm/i915/i915_active.h +6 −0
  330. drivers/gpu/drm/i915/i915_gem.c +8 −5
  331. drivers/gpu/drm/i915/i915_gpu_error.c +3 −2
  332. drivers/gpu/drm/i915/i915_gpu_error.h +5 −2
  333. drivers/gpu/drm/i915/i915_pci.c +2 −2
  334. drivers/gpu/drm/i915/i915_pmu.c +43 −28
  335. drivers/gpu/drm/i915/i915_pmu.h +9 −2
  336. drivers/gpu/drm/i915/i915_request.c +19 −8
  337. drivers/gpu/drm/i915/i915_request.h +60 −0
  338. drivers/gpu/drm/i915/i915_scheduler.c +14 −14
  339. drivers/gpu/drm/i915/i915_utils.c +2 −3
  340. drivers/gpu/drm/i915/i915_vma.c +12 −2
  341. drivers/gpu/drm/msm/adreno/a6xx_gmu.c +31 −6
  342. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +6 −59
  343. drivers/gpu/drm/msm/adreno/a6xx_hfi.c +60 −25
  344. drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +2 −2
  345. drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c +57 −1
  346. drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +2 −2
  347. drivers/gpu/drm/msm/dsi/dsi_manager.c +6 −1
  348. drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +0 −4
  349. drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c +6 −0
  350. drivers/gpu/drm/msm/msm_drv.c +8 −0
  351. drivers/gpu/drm/nouveau/dispnv50/wndw.c +2 −0
  352. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +4 −0
  353. drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c +26 −0
  354. drivers/gpu/drm/nouveau/nvkm/subdev/acr/tu102.c +14 −0
  355. drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c +2 −0
  356. drivers/gpu/drm/panfrost/panfrost_drv.c +1 −0
  357. drivers/gpu/drm/panfrost/panfrost_gem.h +6 −0
  358. drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c +3 −0
  359. drivers/gpu/drm/panfrost/panfrost_job.c +7 −6
  360. drivers/gpu/drm/panfrost/panfrost_mmu.c +6 −1
  361. drivers/gpu/drm/panfrost/panfrost_perfcnt.c +4 −7
  362. drivers/gpu/drm/radeon/radeon_drv.c +41 −2
  363. drivers/gpu/drm/radeon/radeon_kms.c +6 −0
  364. drivers/gpu/drm/selftests/drm_cmdline_selftests.h +1 −0
  365. drivers/gpu/drm/selftests/test-drm_cmdline_parser.c +13 −2
  366. drivers/gpu/drm/sun4i/sun4i_drv.c +0 −1
  367. drivers/gpu/drm/vgem/vgem_drv.c +6 −3
  368. drivers/hid/hid-alps.c +1 −1
  369. drivers/hid/hid-apple.c +2 −1
  370. drivers/hid/hid-bigbenff.c +24 −7
  371. drivers/hid/hid-core.c +3 −1
  372. drivers/hid/hid-ite.c +3 −2
  373. drivers/hid/hid-logitech-hidpp.c +21 −22
  374. drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +8 −0
  375. drivers/hid/usbhid/hiddev.c +1 −1
  376. drivers/hwmon/acpi_power_meter.c +8 −8
  377. drivers/hwmon/pmbus/ltc2978.c +2 −2
  378. drivers/hwmon/pmbus/xdpe12284.c +2 −2
  379. drivers/hwmon/w83627ehf.c +6 −1
  380. drivers/i2c/busses/i2c-altera.c +1 −1
  381. drivers/i2c/busses/i2c-jz4780.c +2 −34
  382. drivers/ide/ide-gd.c +1 −1
  383. drivers/infiniband/core/security.c +9 −15
  384. drivers/infiniband/core/user_mad.c +3 −2
  385. drivers/infiniband/core/uverbs_cmd.c +7 −8
  386. drivers/infiniband/core/uverbs_std_types.c +1 −0
  387. drivers/infiniband/hw/cxgb4/cm.c +4 −0
  388. drivers/infiniband/hw/cxgb4/qp.c +2 −2
  389. drivers/infiniband/hw/hfi1/affinity.c +2 −0
  390. drivers/infiniband/hw/hfi1/file_ops.c +32 −20
  391. drivers/infiniband/hw/hfi1/hfi.h +4 −1
  392. drivers/infiniband/hw/hfi1/user_exp_rcv.c +2 −3
  393. drivers/infiniband/hw/hfi1/user_sdma.c +12 −5
  394. drivers/infiniband/hw/mlx5/devx.c +28 −23
  395. drivers/infiniband/hw/mlx5/main.c +3 −3
  396. drivers/infiniband/hw/mlx5/qp.c +6 −3
  397. drivers/infiniband/sw/rdmavt/qp.c +51 −33
  398. drivers/infiniband/sw/rxe/rxe_comp.c +4 −4
  399. drivers/infiniband/sw/siw/siw_cm.c +2 −3
  400. drivers/infiniband/ulp/isert/ib_isert.c +12 −0
  401. drivers/input/keyboard/goldfish_events.c +1 −1
  402. drivers/input/keyboard/gpio_keys.c +1 −1
  403. drivers/input/keyboard/gpio_keys_polled.c +1 −1
  404. drivers/input/keyboard/tca6416-keypad.c +2 −2
  405. drivers/input/mouse/cyapa_gen5.c +4 −4
  406. drivers/input/mouse/psmouse-smbus.c +5 −3
  407. drivers/input/mouse/synaptics.c +3 −1
  408. drivers/input/touchscreen/ili210x.c +33 −1
  409. drivers/iommu/Makefile +2 −2
  410. drivers/iommu/amd_iommu_init.c +12 −1
  411. drivers/iommu/intel-iommu.c +24 −17
  412. drivers/iommu/qcom_iommu.c +12 −16
  413. drivers/macintosh/therm_windtunnel.c +31 −21
  414. drivers/md/bcache/alloc.c +16 −2
  415. drivers/md/bcache/btree.c +13 −0
  416. drivers/md/bcache/journal.c +2 −5
  417. drivers/md/bcache/super.c +0 −17
  418. drivers/misc/habanalabs/device.c +4 −1
  419. drivers/misc/habanalabs/goya/goya.c +42 −2
  420. drivers/net/bonding/bond_main.c +52 −3
  421. drivers/net/bonding/bond_options.c +2 −0
  422. drivers/net/dsa/b53/b53_common.c +3 −0
  423. drivers/net/dsa/bcm_sf2.c +1 −2
  424. drivers/net/dsa/mv88e6xxx/chip.h +6 −6
  425. drivers/net/dsa/mv88e6xxx/global1.c +2 −2
  426. drivers/net/ethernet/amazon/ena/ena_com.c +58 −38
  427. drivers/net/ethernet/amazon/ena/ena_com.h +9 −0
  428. drivers/net/ethernet/amazon/ena/ena_ethtool.c +43 −3
  429. drivers/net/ethernet/amazon/ena/ena_netdev.c +3 −3
  430. drivers/net/ethernet/amazon/ena/ena_netdev.h +2 −0
  431. drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +5 −0
  432. drivers/net/ethernet/aquantia/atlantic/aq_filters.c +1 −1
  433. drivers/net/ethernet/aquantia/atlantic/aq_hw.h +2 −0
  434. drivers/net/ethernet/aquantia/atlantic/aq_nic.c +3 −5
  435. drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +8 −5
  436. drivers/net/ethernet/aquantia/atlantic/aq_ring.c +7 −3
  437. drivers/net/ethernet/aquantia/atlantic/aq_ring.h +2 −1
  438. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +14 −8
  439. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c +17 −2
  440. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c +12 −0
  441. drivers/net/ethernet/broadcom/bnxt/bnxt.c +12 −4
  442. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +5 −5
  443. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 −2
  444. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +24 −24
  445. drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +5 −5
  446. drivers/net/ethernet/broadcom/cnic_defs.h +2 −2
  447. drivers/net/ethernet/broadcom/genet/bcmmii.c +1 −0
  448. drivers/net/ethernet/cadence/macb.h +1 −0
  449. drivers/net/ethernet/cadence/macb_main.c +37 −29
  450. drivers/net/ethernet/cavium/thunder/thunder_bgx.c +59 −3
  451. drivers/net/ethernet/cavium/thunder/thunder_bgx.h +9 −0
  452. drivers/net/ethernet/cisco/enic/enic_main.c +1 −1
  453. drivers/net/ethernet/davicom/dm9000.c +2 −0
  454. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +16 −6
  455. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +1 −1
  456. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +1 −0
  457. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h +1 −1
  458. drivers/net/ethernet/huawei/hinic/hinic_hw_if.h +1 −0
  459. drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h +1 −0
  460. drivers/net/ethernet/huawei/hinic/hinic_main.c +2 −1
  461. drivers/net/ethernet/huawei/hinic/hinic_rx.c +2 −3
  462. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 −2
  463. drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +1 −0
  464. drivers/net/ethernet/intel/ice/ice_base.c +12 −23
  465. drivers/net/ethernet/intel/ice/ice_common.c +14 −23
  466. drivers/net/ethernet/intel/ice/ice_common.h +0 −2
  467. drivers/net/ethernet/intel/ice/ice_dcb.c +4 −4
  468. drivers/net/ethernet/intel/ice/ice_dcb_lib.c +40 −59
  469. drivers/net/ethernet/intel/ice/ice_dcb_nl.c +9 −11
  470. drivers/net/ethernet/intel/ice/ice_ethtool.c +74 −335
  471. drivers/net/ethernet/intel/ice/ice_hw_autogen.h +6 −1
  472. drivers/net/ethernet/intel/ice/ice_lib.c +20 −51
  473. drivers/net/ethernet/intel/ice/ice_lib.h +0 −2
  474. drivers/net/ethernet/intel/ice/ice_main.c +71 −124
  475. drivers/net/ethernet/intel/ice/ice_txrx.c +4 −7
  476. drivers/net/ethernet/intel/ice/ice_txrx.h +3 −3
  477. drivers/net/ethernet/intel/ice/ice_txrx_lib.c +1 −1
  478. drivers/net/ethernet/intel/ice/ice_type.h +1 −1
  479. drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +97 −104
  480. drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h +2 −1
  481. drivers/net/ethernet/intel/ice/ice_xsk.c +2 −2
  482. drivers/net/ethernet/mellanox/mlx5/core/en/health.c +1 −1
  483. drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +8 −0
  484. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4 −2
  485. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +1 −2
  486. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +8 −12
  487. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +2 −2
  488. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c +1 −1
  489. drivers/net/ethernet/mellanox/mlx5/core/lag.c +3 −8
  490. drivers/net/ethernet/mellanox/mlx5/core/lag.h +0 −1
  491. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +1 −1
  492. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c +4 −1
  493. drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +7 −2
  494. drivers/net/ethernet/mellanox/mlx5/core/wq.c +30 −9
  495. drivers/net/ethernet/mellanox/mlx5/core/wq.h +2 −0
  496. drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +1 −1
  497. drivers/net/ethernet/micrel/ks8851_mll.c +17 −50
  498. drivers/net/ethernet/mscc/ocelot_board.c +8 −0
  499. drivers/net/ethernet/pensando/ionic/ionic_dev.c +7 −4
  500. drivers/net/ethernet/pensando/ionic/ionic_if.h +1 −0
  501. drivers/net/ethernet/qlogic/qede/qede.h +2 −0
  502. drivers/net/ethernet/qlogic/qede/qede_rdma.c +28 −1
  503. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +91 −95
  504. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h +2 −1
  505. drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c +5 −2
  506. drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c +0 −8
  507. drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.h +0 −1
  508. drivers/net/ethernet/sfc/ptp.c +35 −3
  509. drivers/net/ethernet/socionext/sni_ave.c +9 −0
  510. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +8 −5
  511. drivers/net/ethernet/sun/sunvnet_common.c +4 −19
  512. drivers/net/ethernet/xilinx/ll_temac.h +4 −0
  513. drivers/net/ethernet/xilinx/ll_temac_main.c +171 −38
  514. drivers/net/gtp.c +2 −2
  515. drivers/net/hyperv/netvsc.c +1 −1
  516. drivers/net/hyperv/netvsc_drv.c +3 −0
  517. drivers/net/phy/broadcom.c +2 −2
  518. drivers/net/phy/marvell.c +5 −0
  519. drivers/net/phy/mdio-bcm-iproc.c +20 −0
  520. drivers/net/phy/mscc.c +2 −2
  521. drivers/net/phy/phy-c45.c +3 −3
  522. drivers/net/phy/phy_device.c +6 −5
  523. drivers/net/slip/slip.c +3 −0
  524. drivers/net/usb/qmi_wwan.c +19 −27
  525. drivers/net/wireguard/device.c +6 −5
  526. drivers/net/wireguard/receive.c +5 −2
  527. drivers/net/wireguard/send.c +11 −5
  528. drivers/net/wireguard/socket.c +0 −1
  529. drivers/nfc/pn544/i2c.c +1 −0
  530. drivers/nfc/pn544/pn544.c +1 −1
  531. drivers/nvme/host/core.c +7 −7
  532. drivers/nvme/host/multipath.c +1 −0
  533. drivers/nvme/host/pci.c +33 −7
  534. drivers/nvme/host/rdma.c +1 −1
  535. drivers/nvme/host/tcp.c +7 −2
  536. drivers/pci/controller/pcie-brcmstb.c +1 −1
  537. drivers/perf/arm_smmuv3_pmu.c +1 −1
  538. drivers/platform/chrome/wilco_ec/properties.c +1 −1
  539. drivers/s390/cio/blacklist.c +3 −2
  540. drivers/s390/cio/chp.c +2 −2
  541. drivers/s390/cio/qdio.h +1 −3
  542. drivers/s390/cio/qdio_debug.c +2 −3
  543. drivers/s390/cio/qdio_main.c +11 −18
  544. drivers/s390/cio/qdio_setup.c +3 −2
  545. drivers/s390/cio/vfio_ccw_trace.h +2 −2
  546. drivers/s390/crypto/ap_bus.h +2 −2
  547. drivers/s390/crypto/ap_card.c +4 −4
  548. drivers/s390/crypto/ap_queue.c +3 −3
  549. drivers/s390/crypto/pkey_api.c +1 −1
  550. drivers/s390/crypto/zcrypt_api.c +9 −7
  551. drivers/s390/crypto/zcrypt_ep11misc.c +2 −2
  552. drivers/s390/net/qeth_core_main.c +24 −25
  553. drivers/s390/net/qeth_l2_main.c +13 −16
  554. drivers/s390/scsi/zfcp_fsf.c +1 −1
  555. drivers/s390/scsi/zfcp_fsf.h +1 −1
  556. drivers/s390/scsi/zfcp_qdio.c +3 −3
  557. drivers/s390/scsi/zfcp_qdio.h +3 −3
  558. drivers/s390/scsi/zfcp_sysfs.c +1 −1
  559. drivers/scsi/libfc/fc_disc.c +2 −0
  560. drivers/scsi/megaraid/megaraid_sas_fusion.c +3 −2
  561. drivers/scsi/sd_zbc.c +6 −1
  562. drivers/scsi/sr.c +1 −1
  563. drivers/soc/tegra/fuse/fuse-tegra30.c +2 −1
  564. drivers/spi/spi-fsl-dspi.c +117 −45
  565. drivers/spmi/spmi-pmic-arb.c +4 −0
  566. drivers/staging/android/Kconfig +0 −8
  567. drivers/staging/android/Makefile +0 −1
  568. drivers/staging/android/TODO +0 −9
  569. drivers/staging/android/ashmem.c +28 −0
  570. drivers/staging/android/uapi/vsoc_shm.h +0 −295
  571. drivers/staging/android/vsoc.c +0 −1149
  572. drivers/staging/greybus/audio_manager.c +1 −1
  573. drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +12 −28
  574. drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +2 −3
  575. drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +12 −35
  576. drivers/staging/vt6656/dpc.c +1 −1
  577. drivers/target/iscsi/iscsi_target.c +5 −11
  578. drivers/target/target_core_transport.c +28 −3
  579. drivers/tee/amdtee/Kconfig +1 −1
  580. drivers/thunderbolt/switch.c +7 −0
  581. drivers/tty/serdev/serdev-ttyport.c +2 −4
  582. drivers/tty/serial/8250/8250_aspeed_vuart.c +0 −1
  583. drivers/tty/serial/8250/8250_core.c +2 −3
  584. drivers/tty/serial/8250/8250_of.c +0 −1
  585. drivers/tty/serial/8250/8250_port.c +4 −0
  586. drivers/tty/serial/ar933x_uart.c +8 −0
  587. drivers/tty/serial/atmel_serial.c +2 −1
  588. drivers/tty/serial/cpm_uart/cpm_uart_core.c +1 −0
  589. drivers/tty/serial/imx.c +1 −1
  590. drivers/tty/serial/qcom_geni_serial.c +14 −4
  591. drivers/tty/serial/serial-tegra.c +16 −19
  592. drivers/tty/tty_port.c +3 −2
  593. drivers/tty/vt/selection.c +25 −7
  594. drivers/tty/vt/vt.c +13 −2
  595. drivers/tty/vt/vt_ioctl.c +11 −6
  596. drivers/usb/core/config.c +19 −12
  597. drivers/usb/core/hub.c +15 −5
  598. drivers/usb/core/hub.h +1 −0
  599. drivers/usb/core/quirks.c +40 −0
  600. drivers/usb/core/usb.h +3 −0
  601. drivers/usb/dwc2/gadget.c +23 −17
  602. drivers/usb/dwc3/debug.h +15 −24
  603. drivers/usb/dwc3/gadget.c +2 −1
  604. drivers/usb/gadget/composite.c +20 −10
  605. drivers/usb/gadget/function/f_fs.c +3 −2
  606. drivers/usb/gadget/function/u_audio.c +5 −5
  607. drivers/usb/gadget/function/u_serial.c +3 −1
  608. drivers/usb/gadget/udc/udc-xilinx.c +0 −1
  609. drivers/usb/host/xhci-hub.c +17 −8
  610. drivers/usb/host/xhci-mem.c +46 −25
  611. drivers/usb/host/xhci-pci.c +6 −4
  612. drivers/usb/host/xhci.h +11 −3
  613. drivers/usb/misc/iowarrior.c +29 −2
  614. drivers/usb/phy/phy-tegra-usb.c +8 −0
  615. drivers/usb/serial/ch341.c +10 −0
  616. drivers/usb/serial/ir-usb.c +1 −1
  617. drivers/usb/storage/uas.c +22 −1
  618. drivers/vhost/net.c +1 −9
  619. drivers/watchdog/Kconfig +2 −0
  620. drivers/watchdog/da9062_wdt.c +12 −7
  621. drivers/watchdog/wdat_wdt.c +24 −1
  622. drivers/xen/preempt.c +3 −1
  623. fs/btrfs/disk-io.c +3 −1
  624. fs/btrfs/extent-tree.c +2 −0
  625. fs/btrfs/extent_map.c +11 −0
  626. fs/btrfs/inode.c +21 −5
  627. fs/btrfs/ordered-data.c +6 −1
  628. fs/btrfs/qgroup.c +13 −0
  629. fs/btrfs/qgroup.h +1 −0
  630. fs/btrfs/ref-verify.c +5 −0
  631. fs/btrfs/super.c +2 −0
  632. fs/btrfs/sysfs.c +16 −1
  633. fs/btrfs/transaction.c +2 −0
  634. fs/btrfs/volumes.h +1 −0
  635. fs/ceph/file.c +11 −6
  636. fs/ceph/super.c +32 −97
  637. fs/ceph/super.h +1 −1
  638. fs/cifs/cifs_dfs_ref.c +2 −0
  639. fs/cifs/cifsacl.c +2 −2
  640. fs/cifs/cifsfs.c +7 −1
  641. fs/cifs/cifsglob.h +7 −0
  642. fs/cifs/cifsproto.h +3 −2
  643. fs/cifs/cifssmb.c +2 −1
  644. fs/cifs/connect.c +1 −1
  645. fs/cifs/file.c +12 −7
  646. fs/cifs/inode.c +11 −7
  647. fs/cifs/smb1ops.c +1 −1
  648. fs/cifs/smb2inode.c +2 −2
  649. fs/cifs/smb2ops.c +37 −2
  650. fs/cifs/smb2pdu.c +1 −0
  651. fs/dax.c +4 −7
  652. fs/ecryptfs/crypto.c +4 −2
  653. fs/ecryptfs/ecryptfs_kernel.h +1 −1
  654. fs/ecryptfs/keystore.c +1 −1
  655. fs/ecryptfs/main.c +1 −1
  656. fs/ecryptfs/messaging.c +2 −1
  657. fs/ext2/inode.c +3 −2
  658. fs/ext4/balloc.c +11 −3
  659. fs/ext4/block_validity.c +1 −0
  660. fs/ext4/dir.c +8 −6
  661. fs/ext4/ext4.h +34 −10
  662. fs/ext4/ialloc.c +14 −9
  663. fs/ext4/inode.c +21 −9
  664. fs/ext4/mballoc.c +41 −20
  665. fs/ext4/migrate.c +19 −8
  666. fs/ext4/mmp.c +7 −5
  667. fs/ext4/namei.c +8 −0
  668. fs/ext4/resize.c +49 −13
  669. fs/ext4/super.c +92 −61
  670. fs/io-wq.c +77 −34
  671. fs/io-wq.h +7 −9
  672. fs/io_uring.c +295 −187
  673. fs/jbd2/commit.c +25 −21
  674. fs/jbd2/transaction.c +16 −10
  675. fs/nfs/delegation.c +40 −10
  676. fs/nfs/delegation.h +1 −0
  677. fs/nfs/dir.c +116 −10
  678. fs/nfs/inode.c +1 −0
  679. fs/nfs/nfs4file.c +0 −1
  680. fs/nfs/nfs4proc.c +17 −3
  681. fs/pipe.c +10 −8
  682. fs/xfs/xfs_aops.c +1 −1
  683. fs/zonefs/Kconfig +1 −0
  684. fs/zonefs/super.c +4 −4
  685. include/acpi/acpixf.h +2 −0
  686. include/acpi/actypes.h +2 −1
  687. include/linux/blkdev.h +1 −1
  688. include/linux/blktrace_api.h +13 −5
  689. include/linux/bootconfig.h +3 −0
  690. include/linux/compat.h +0 −29
  691. include/linux/cpufreq.h +0 −3
  692. include/linux/dax.h +2 −12
  693. include/linux/hid.h +1 −1
  694. include/linux/icmpv6.h +10 −0
  695. include/linux/intel-svm.h +1 −1
  696. include/linux/irqdomain.h +1 −1
  697. include/linux/ktime.h +0 −37
  698. include/linux/kvm_host.h +3 −1
  699. include/linux/mlx5/mlx5_ifc.h +4 −1
  700. include/linux/netdevice.h +18 −5
  701. include/linux/netfilter/ipset/ip_set.h +10 −1
  702. include/linux/nfs_fs.h +6 −20
  703. include/linux/pipe_fs_i.h +2 −1
  704. include/linux/rculist_nulls.h +7 −0
  705. include/linux/sched/nohz.h +2 −0
  706. include/linux/skbuff.h +30 −0
  707. include/linux/suspend.h +1 −1
  708. include/linux/swiotlb.h +3 −8
  709. include/linux/time32.h +1 −153
  710. include/linux/timekeeping32.h +0 −32
  711. include/linux/trace_events.h +1 −1
  712. include/linux/tty.h +2 −0
  713. include/linux/types.h +0 −5
  714. include/linux/usb/quirks.h +3 −0
  715. include/net/flow_dissector.h +9 −1
  716. include/net/icmp.h +6 −0
  717. include/net/mac80211.h +5 −6
  718. include/net/sock.h +33 −5
  719. include/scsi/iscsi_proto.h +0 −1
  720. include/sound/rawmidi.h +3 −3
  721. include/sound/soc-dapm.h +0 −2
  722. include/uapi/asm-generic/posix_types.h +2 −0
  723. include/uapi/linux/bpf.h +7 −9
  724. include/uapi/linux/netfilter/nf_conntrack_common.h +11 −1
  725. include/uapi/linux/swab.h +2 −2
  726. include/uapi/linux/time.h +12 −10
  727. include/uapi/linux/usb/charger.h +8 −8
  728. init/Kconfig +2 −4
  729. init/main.c +52 −23
  730. ipc/sem.c +2 −4
  731. kernel/audit.c +21 −19
  732. kernel/auditfilter.c +39 −32
  733. kernel/bpf/btf.c +3 −3
  734. kernel/bpf/hashtab.c +53 −5
  735. kernel/bpf/offload.c +1 −1
  736. kernel/cgroup/cgroup.c +8 −5
  737. kernel/compat.c +0 −64
  738. kernel/dma/contiguous.c +8 −1
  739. kernel/dma/direct.c +25 −36
  740. kernel/dma/swiotlb.c +23 −19
  741. kernel/irq/internals.h +0 −2
  742. kernel/irq/manage.c +2 −16
  743. kernel/irq/proc.c +22 −0
  744. kernel/power/snapshot.c +1 −1
  745. kernel/power/suspend.c +5 −4
  746. kernel/sched/core.c +34 −29
  747. kernel/sched/fair.c +45 −13
  748. kernel/sched/loadavg.c +23 −10
  749. kernel/sched/psi.c +3 −0
  750. kernel/sched/sched.h +14 −1
  751. kernel/signal.c +14 −9
  752. kernel/sysctl.c +0 −9
  753. kernel/time/time.c +0 −43
  754. kernel/trace/Kconfig +2 −2
  755. kernel/trace/blktrace.c +83 −31
  756. kernel/trace/synth_event_gen_test.c +22 −22
  757. kernel/trace/trace.c +2 −0
  758. kernel/trace/trace_events_hist.c +177 −142
  759. kernel/trace/trace_kprobe.c +1 −1
  760. lib/Kconfig +0 −3
  761. lib/Makefile +1 −1
  762. lib/bootconfig.c +39 −12
  763. lib/crypto/chacha20poly1305.c +3 −0
  764. lib/stackdepot.c +6 −2
  765. lib/string.c +16 −0
  766. mm/memcontrol.c +3 −1
  767. mm/mmap.c +0 −4
  768. mm/mremap.c +0 −1
  769. mm/shmem.c +0 −2
  770. mm/sparse.c +1 −1
  771. mm/swapfile.c +1 −1
  772. mm/vmscan.c +6 −3
  773. net/Kconfig +0 −1
  774. net/bridge/br_device.c +2 −4
  775. net/bridge/br_stp.c +2 −1
  776. net/core/dev.c +15 −25
  777. net/core/devlink.c +23 −15
  778. net/core/fib_rules.c +1 −1
  779. net/core/page_pool.c +8 −14
  780. net/core/rtnetlink.c +12 −14
  781. net/core/skbuff.c +2 −4
  782. net/dsa/tag_ar9331.c +1 −1
  783. net/dsa/tag_qca.c +1 −1
  784. net/ethtool/bitset.c +5 −1
  785. net/ethtool/bitset.h +2 −0
  786. net/hsr/hsr_framereg.c +2 −1
  787. net/ipv4/cipso_ipv4.c +6 −1
  788. net/ipv4/icmp.c +33 −0
  789. net/ipv4/tcp_input.c +5 −1
  790. net/ipv4/udp.c +5 −1
  791. net/ipv6/ip6_fib.c +4 −3
  792. net/ipv6/ip6_gre.c +5 −3
  793. net/ipv6/ip6_icmp.c +34 −0
  794. net/ipv6/ip6_tunnel.c +56 −25
  795. net/ipv6/ipv6_sockglue.c +8 −2
  796. net/ipv6/route.c +1 −0
  797. net/mac80211/cfg.c +1 −1
  798. net/mac80211/mlme.c +5 −9
  799. net/mac80211/rx.c +1 −1
  800. net/mac80211/tx.c +1 −1
  801. net/mac80211/util.c +26 −8
  802. net/mptcp/Kconfig +1 −0
  803. net/mptcp/protocol.c +26 −30
  804. net/mptcp/protocol.h +2 −2
  805. net/netfilter/ipset/ip_set_core.c +24 −10
  806. net/netfilter/ipset/ip_set_hash_gen.h +440 −195
  807. net/netfilter/nf_conntrack_core.c +164 −28
  808. net/netfilter/nf_conntrack_proto_udp.c +16 −4
  809. net/netfilter/nf_flow_table_offload.c +3 −3
  810. net/netfilter/nft_set_pipapo.c +7 −5
  811. net/netfilter/xt_hashlimit.c +22 −16
  812. net/netlabel/netlabel_domainhash.c +2 −1
  813. net/netlabel/netlabel_unlabeled.c +2 −1
  814. net/netlink/af_netlink.c +3 −2
  815. net/netlink/genetlink.c +3 −2
  816. net/openvswitch/datapath.c +6 −3
  817. net/openvswitch/flow_netlink.c +10 −8
  818. net/openvswitch/flow_table.c +4 −2
  819. net/openvswitch/meter.c +2 −1
  820. net/openvswitch/vport.c +2 −1
  821. net/rds/rdma.c +12 −12
  822. net/sched/act_api.c +1 −0
  823. net/sched/cls_flower.c +2 −0
  824. net/sched/cls_matchall.c +1 −0
  825. net/sctp/sm_statefuns.c +20 −9
  826. net/smc/af_smc.c +17 −10
  827. net/smc/smc_clc.c +3 −1
  828. net/smc/smc_core.c +12 −0
  829. net/smc/smc_core.h +1 −1
  830. net/smc/smc_diag.c +2 −3
  831. net/smc/smc_ib.c +2 −0
  832. net/sunrpc/xprtrdma/frwr_ops.c +7 −6
  833. net/tipc/node.c +4 −3
  834. net/tipc/socket.c +2 −0
  835. net/tls/tls_device.c +19 −1
  836. net/unix/af_unix.c +4 −0
  837. net/vmw_vsock/af_vsock.c +12 −8
  838. net/vmw_vsock/hyperv_transport.c +0 −3
  839. net/vmw_vsock/virtio_transport_common.c +0 −2
  840. net/wireless/ethtool.c +6 −2
  841. net/wireless/nl80211.c +4 −2
  842. net/wireless/reg.c +1 −1
  843. net/xdp/xsk.c +2 −0
  844. net/xdp/xsk_queue.h +2 −1
  845. net/xfrm/xfrm_interface.c +3 −3
  846. scripts/Makefile.lib +3 −3
  847. scripts/get_maintainer.pl +4 −28
  848. scripts/kallsyms.c +2 −2
  849. scripts/link-vmlinux.sh +1 −1
  850. security/integrity/ima/Kconfig +5 −0
  851. security/integrity/platform_certs/load_uefi.c +26 −14
  852. security/selinux/hooks.c +1 −1
  853. security/selinux/ss/sidtab.c +3 −9
  854. sound/core/pcm_native.c +2 −1
  855. sound/core/seq/seq_clientmgr.c +2 −2
  856. sound/core/seq/seq_queue.c +22 −7
  857. sound/core/seq/seq_timer.c +10 −3
  858. sound/core/seq/seq_timer.h +2 −1
  859. sound/hda/ext/hdac_ext_controller.c +6 −3
  860. sound/hda/hdmi_chmap.c +1 −1
  861. sound/pci/hda/hda_codec.c +1 −1
  862. sound/pci/hda/hda_eld.c +1 −1
  863. sound/pci/hda/hda_sysfs.c +2 −2
  864. sound/pci/hda/patch_realtek.c +6 −0
  865. sound/soc/amd/raven/acp3x-i2s.c +8 −0
  866. sound/soc/amd/raven/acp3x-pcm-dma.c +1 −6
  867. sound/soc/amd/raven/pci-acp3x.c +0 −23
  868. sound/soc/atmel/Kconfig +2 −2
  869. sound/soc/atmel/Makefile +8 −2
  870. sound/soc/codecs/hdmi-codec.c +10 −0
  871. sound/soc/codecs/max98090.c +123 −311
  872. sound/soc/codecs/max98090.h +1 −2
  873. sound/soc/fsl/fsl_sai.c +17 −5
  874. sound/soc/soc-dapm.c +13 −44
  875. sound/soc/sof/intel/hda-codec.c +8 −4
  876. sound/soc/sof/intel/hda-dsp.c +11 −0
  877. sound/soc/sof/intel/hda.c +9 −10
  878. sound/soc/sunxi/sun8i-codec.c +2 −1
  879. sound/usb/clock.c +63 −28
  880. sound/usb/clock.h +2 −2
  881. sound/usb/format.c +23 −13
  882. sound/usb/mixer.c +10 −2
  883. sound/usb/quirks.c +1 −0
  884. tools/arch/arm64/include/uapi/asm/kvm.h +10 −2
  885. tools/arch/arm64/include/uapi/asm/unistd.h +1 −0
  886. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  887. tools/arch/x86/include/asm/disabled-features.h +1 −7
  888. tools/arch/x86/include/asm/msr-index.h +2 −0
  889. tools/arch/x86/include/uapi/asm/kvm.h +1 −0
  890. tools/bootconfig/include/linux/memblock.h +12 −0
  891. tools/bootconfig/include/linux/printk.h +1 −4
  892. tools/bootconfig/main.c +46 −33
  893. tools/bootconfig/samples/bad-mixed-kv1.bconf +3 −0
  894. tools/bootconfig/samples/bad-mixed-kv2.bconf +3 −0
  895. tools/bootconfig/samples/bad-samekey.bconf +6 −0
  896. tools/bootconfig/test-bootconfig.sh +23 −2
  897. tools/include/uapi/asm-generic/mman-common.h +2 −0
  898. tools/include/uapi/asm-generic/unistd.h +6 −1
  899. tools/include/uapi/drm/i915_drm.h +32 −0
  900. tools/include/uapi/linux/bpf.h +7 −9
  901. tools/include/uapi/linux/fcntl.h +1 −1
  902. tools/include/uapi/linux/fscrypt.h +13 −1
  903. tools/include/uapi/linux/kvm.h +5 −0
  904. tools/include/uapi/linux/openat2.h +39 −0
  905. tools/include/uapi/linux/prctl.h +4 −0
  906. tools/include/uapi/linux/sched.h +6 −0
  907. tools/include/uapi/sound/asound.h +132 −23
  908. tools/lib/bpf/libbpf.c +7 −1
  909. tools/perf/Documentation/perf-config.txt +73 −1
  910. tools/perf/arch/arm/util/cs-etm.c +2 −16
  911. tools/perf/arch/arm64/util/arm-spe.c +2 −15
  912. tools/perf/arch/arm64/util/header.c +48 −15
  913. tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +2 −0
  914. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +2 −0
  915. tools/perf/arch/x86/util/intel-bts.c +2 −15
  916. tools/perf/arch/x86/util/intel-pt.c +2 −15
  917. tools/perf/builtin-annotate.c +2 −2
  918. tools/perf/builtin-probe.c +4 −2
  919. tools/perf/builtin-report.c +1 −1
  920. tools/perf/builtin-top.c +2 −2
  921. tools/perf/builtin-trace.c +3 −1
  922. tools/perf/check-headers.sh +1 −0
  923. tools/perf/include/bpf/pid_filter.h +1 −1
  924. tools/perf/include/bpf/stdio.h +1 −1
  925. tools/perf/include/bpf/unistd.h +1 −1
  926. tools/perf/tests/shell/lib/probe_vfs_getname.sh +1 −1
  927. tools/perf/trace/beauty/beauty.h +2 −0
  928. tools/perf/trace/beauty/prctl.c +2 −1
  929. tools/perf/ui/browsers/annotate.c +9 −10
  930. tools/perf/ui/gtk/annotate.c +1 −1
  931. tools/perf/util/annotate.c +75 −119
  932. tools/perf/util/annotate.h +3 −6
  933. tools/perf/util/auxtrace.c +21 −1
  934. tools/perf/util/auxtrace.h +6 −0
  935. tools/perf/util/config.c +12 −0
  936. tools/perf/util/config.h +1 −0
  937. tools/perf/util/llvm-utils.c +1 −0
  938. tools/perf/util/machine.c +12 −14
  939. tools/perf/util/map.c +16 −1
  940. tools/perf/util/probe-file.c +24 −4
  941. tools/perf/util/stat-shadow.c +0 −6
  942. tools/perf/util/symbol.c +12 −5
  943. tools/testing/kunit/kunit.py +12 −0
  944. tools/testing/kunit/kunit_kernel.py +16 −12
  945. tools/testing/selftests/Makefile +10 −2
  946. tools/testing/selftests/bpf/prog_tests/select_reuseport.c +6 −2
  947. tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +5 −0
  948. tools/testing/selftests/ftrace/Makefile +1 −1
  949. tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc +1 −7
  950. tools/testing/selftests/futex/functional/Makefile +1 −1
  951. tools/testing/selftests/kvm/Makefile +2 −1
  952. tools/testing/selftests/kvm/include/x86_64/processor.h +22 −22
  953. tools/testing/selftests/kvm/include/x86_64/svm.h +297 −0
  954. tools/testing/selftests/kvm/include/x86_64/svm_util.h +38 −0
  955. tools/testing/selftests/kvm/lib/x86_64/svm.c +161 −0
  956. tools/testing/selftests/kvm/lib/x86_64/vmx.c +3 −3
  957. tools/testing/selftests/kvm/x86_64/svm_vmcall_test.c +79 −0
  958. tools/testing/selftests/lib.mk +13 −10
  959. tools/testing/selftests/livepatch/Makefile +2 −0
  960. tools/testing/selftests/net/Makefile +2 −2
  961. tools/testing/selftests/net/fib_tests.sh +6 −0
  962. tools/testing/selftests/net/forwarding/mirror_gre.sh +13 −12
  963. tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh +3 −3
  964. tools/testing/selftests/net/mptcp/Makefile +2 −0
  965. tools/testing/selftests/netfilter/nft_concat_range.sh +45 −10
  966. tools/testing/selftests/openat2/helpers.c +1 −1
  967. tools/testing/selftests/openat2/resolve_test.c +1 −1
  968. tools/testing/selftests/rseq/Makefile +3 −1
  969. tools/testing/selftests/rtc/Makefile +3 −1
  970. tools/testing/selftests/timens/Makefile +1 −1
  971. tools/testing/selftests/tpm2/test_smoke.sh +11 −2
  972. tools/testing/selftests/tpm2/test_space.sh +8 −1
  973. tools/testing/selftests/vm/run_vmtests +33 −0
  974. tools/testing/selftests/wireguard/netns.sh +11 −0
  975. tools/testing/selftests/wireguard/qemu/Makefile +14 −24
  976. virt/kvm/arm/arm.c +0 −2
  977. virt/kvm/arm/trace.h +1 −0
  978. virt/kvm/arm/vgic/vgic-mmio.c +0 −12
  979. virt/kvm/kvm_main.c +13 −3
.gitignore+4−0
@@ -100,6 +100,10 @@ modules.order · 99 unmodified lines
100100 /include/ksym/
101101 /arch/*/include/generated/
102102
103+# Generated lkdtm tests
104+/tools/testing/selftests/lkdtm/*.sh
105+!/tools/testing/selftests/lkdtm/run.sh
106+
103107 # stgit generated dirs
104108 patches-*
105109
COPYING+2−0
@@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see: · 15 unmodified lines
1616 Documentation/process/license-rules.rst
1717
1818 for more details.
19+
20+All contributions to the Linux Kernel are subject to this COPYING file.
CREDITS+5−0
@@ -567,6 +567,11 @@ D: Original author of Amiga FFS filesystem · 566 unmodified lines
567567 S: Orlando, Florida
568568 S: USA
569569
570+N: Paul Burton
571+E: paulburton@kernel.org
572+W: https://pburton.com
573+D: MIPS maintainer 2018-2020
574+
570575 N: Lennert Buytenhek
571576 E: kernel@wantstofly.org
572577 D: Original (2.4) rewrite of the ethernet bridging code
Documentation/admin-guide/bootconfig.rst+31−3
@@ -62,6 +62,30 @@ Or more shorter, written as following:: · 61 unmodified lines
6262 In both styles, same key words are automatically merged when parsing it
6363 at boot time. So you can append similar trees or key-values.
6464
65+Same-key Values
66+---------------
67+
68+It is prohibited that two or more values or arrays share a same-key.
69+For example,::
70+
71+ foo = bar, baz
72+ foo = qux # !ERROR! we can not re-define same key
73+
74+If you want to append the value to existing key as an array member,
75+you can use ``+=`` operator. For example::
76+
77+ foo = bar, baz
78+ foo += qux
79+
80+In this case, the key ``foo`` has ``bar``, ``baz`` and ``qux``.
81+
82+However, a sub-key and a value can not co-exist under a parent key.
83+For example, following config is NOT allowed.::
84+
85+ foo = value1
86+ foo.bar = value2 # !ERROR! subkey "bar" and value "value1" can NOT co-exist
87+
88+
6589 Comments
6690 --------
6791
@@ -102,9 +126,13 @@ Boot Kernel With a Boot Config · 34 unmodified lines
102126 ==============================
103127
104128 Since the boot configuration file is loaded with initrd, it will be added
105−to the end of the initrd (initramfs) image file. The Linux kernel decodes
106−the last part of the initrd image in memory to get the boot configuration
107−data.
129+to the end of the initrd (initramfs) image file with size, checksum and
130+12-byte magic word as below.
131+
132+[initrd][bootconfig][size(u32)][checksum(u32)][#BOOTCONFIG\n]
133+
134+The Linux kernel decodes the last part of the initrd image in memory to
135+get the boot configuration data.
108136 Because of this "piggyback" method, there is no need to change or
109137 update the boot loader and the kernel image itself.
110138
Documentation/admin-guide/kernel-parameters.txt+4−0
@@ -136,6 +136,10 @@ · 135 unmodified lines
136136 dynamic table installation which will install SSDT
137137 tables to /sys/firmware/acpi/tables/dynamic.
138138
139+ acpi_no_watchdog [HW,ACPI,WDT]
140+ Ignore the ACPI-based watchdog interface (WDAT) and let
141+ a native driver control the watchdog device instead.
142+
139143 acpi_rsdp= [ACPI,EFI,KEXEC]
140144 Pass the RSDP address to the kernel, mostly used
141145 on machines running EFI runtime service to boot the
Documentation/arm64/memory.rst+1−1
@@ -129,7 +129,7 @@ this logic. · 128 unmodified lines
129129
130130 As a single binary will need to support both 48-bit and 52-bit VA
131131 spaces, the VMEMMAP must be sized large enough for 52-bit VAs and
132−also must be sized large enought to accommodate a fixed PAGE_OFFSET.
132+also must be sized large enough to accommodate a fixed PAGE_OFFSET.
133133
134134 Most code in the kernel should not need to consider the VA_BITS, for
135135 code that does need to know the VA size the variables are
Documentation/arm64/tagged-address-abi.rst+9−2
@@ -44,8 +44,15 @@ The AArch64 Tagged Address ABI has two stages of relaxation depending · 43 unmodified lines
4444 how the user addresses are used by the kernel:
4545
4646 1. User addresses not accessed by the kernel but used for address space
47− management (e.g. ``mmap()``, ``mprotect()``, ``madvise()``). The use
48− of valid tagged pointers in this context is always allowed.
47+ management (e.g. ``mprotect()``, ``madvise()``). The use of valid
48+ tagged pointers in this context is allowed with the exception of
49+ ``brk()``, ``mmap()`` and the ``new_address`` argument to
50+ ``mremap()`` as these have the potential to alias with existing
51+ user addresses.
52+
53+ NOTE: This behaviour changed in v5.6 and so some earlier kernels may
54+ incorrectly accept valid tagged pointers for the ``brk()``,
55+ ``mmap()`` and ``mremap()`` system calls.
4956
5057 2. User addresses accessed by the kernel (e.g. ``write()``). This ABI
5158 relaxation is disabled by default and the application thread needs to
Documentation/dev-tools/kunit/usage.rst+1−0
@@ -551,6 +551,7 @@ options to your ``.config``: · 550 unmodified lines
551551 Once the kernel is built and installed, a simple
552552
553553 .. code-block:: bash
554+
554555 modprobe example-test
555556
556557 ...will run the tests.
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml+5−1
@@ -43,9 +43,13 @@ properties: · 42 unmodified lines
4343 - enum:
4444 - allwinner,sun8i-h3-tcon-tv
4545 - allwinner,sun50i-a64-tcon-tv
46− - allwinner,sun50i-h6-tcon-tv
4746 - const: allwinner,sun8i-a83t-tcon-tv
4847
48+ - items:
49+ - enum:
50+ - allwinner,sun50i-h6-tcon-tv
51+ - const: allwinner,sun8i-r40-tcon-tv
52+
4953 reg:
5054 maxItems: 1
5155
Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt+2−1
@@ -1,9 +1,10 @@
1−Ilitek ILI210x/ILI2117/ILI251x touchscreen controller
1+Ilitek ILI210x/ILI2117/ILI2120/ILI251x touchscreen controller
22
33 Required properties:
44 - compatible:
55 ilitek,ili210x for ILI210x
66 ilitek,ili2117 for ILI2117
7+ ilitek,ili2120 for ILI2120
78 ilitek,ili251x for ILI251x
89
910 - reg: The I2C address of the device
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml+28−12
@@ -33,24 +33,40 @@ properties: · 32 unmodified lines
3333 maxItems: 1
3434
3535 clocks:
36− minItems: 2
37− maxItems: 3
38− items:
39− - description: The CSI interface clock
40− - description: The CSI ISP clock
41− - description: The CSI DRAM clock
36+ oneOf:
37+ - items:
38+ - description: The CSI interface clock
39+ - description: The CSI DRAM clock
40+
41+ - items:
42+ - description: The CSI interface clock
43+ - description: The CSI ISP clock
44+ - description: The CSI DRAM clock
4245
4346 clock-names:
44− minItems: 2
45− maxItems: 3
46− items:
47− - const: bus
48− - const: isp
49− - const: ram
47+ oneOf:
48+ - items:
49+ - const: bus
50+ - const: ram
51+
52+ - items:
53+ - const: bus
54+ - const: isp
55+ - const: ram
5056
5157 resets:
5258 maxItems: 1
5359
60+ # FIXME: This should be made required eventually once every SoC will
61+ # have the MBUS declared.
62+ interconnects:
63+ maxItems: 1
64+
65+ # FIXME: This should be made required eventually once every SoC will
66+ # have the MBUS declared.
67+ interconnect-names:
68+ const: dma-mem
69+
5470 # See ./video-interfaces.txt for details
5571 port:
5672 type: object
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.yaml+12−8
@@ -347,6 +347,7 @@ examples: · 346 unmodified lines
347347 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
348348
349349 #iommu-cells = <1>;
350+ #reset-cells = <1>;
350351 };
351352
352353 external-memory-controller@7001b000 {
@@ -363,20 +364,23 @@ examples: · 10 unmodified lines
363364 timing-0 {
364365 clock-frequency = <12750000>;
365366
366− nvidia,emc-zcal-cnt-long = <0x00000042>;
367− nvidia,emc-auto-cal-interval = <0x001fffff>;
368− nvidia,emc-ctt-term-ctrl = <0x00000802>;
369− nvidia,emc-cfg = <0x73240000>;
370− nvidia,emc-cfg-2 = <0x000008c5>;
371− nvidia,emc-sel-dpd-ctrl = <0x00040128>;
372− nvidia,emc-bgbias-ctl0 = <0x00000008>;
373367 nvidia,emc-auto-cal-config = <0xa1430000>;
374368 nvidia,emc-auto-cal-config2 = <0x00000000>;
375369 nvidia,emc-auto-cal-config3 = <0x00000000>;
376− nvidia,emc-mode-reset = <0x80001221>;
370+ nvidia,emc-auto-cal-interval = <0x001fffff>;
371+ nvidia,emc-bgbias-ctl0 = <0x00000008>;
372+ nvidia,emc-cfg = <0x73240000>;
373+ nvidia,emc-cfg-2 = <0x000008c5>;
374+ nvidia,emc-ctt-term-ctrl = <0x00000802>;
377375 nvidia,emc-mode-1 = <0x80100003>;
378376 nvidia,emc-mode-2 = <0x80200008>;
379377 nvidia,emc-mode-4 = <0x00000000>;
378+ nvidia,emc-mode-reset = <0x80001221>;
379+ nvidia,emc-mrs-wait-cnt = <0x000e000e>;
380+ nvidia,emc-sel-dpd-ctrl = <0x00040128>;
381+ nvidia,emc-xm2dqspadctrl2 = <0x0130b118>;
382+ nvidia,emc-zcal-cnt-long = <0x00000042>;
383+ nvidia,emc-zcal-interval = <0x00000000>;
380384
381385 nvidia,emc-configuration = <
382386 0x00000000 /* EMC_RC */
Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt+1−1
@@ -124,7 +124,7 @@ not every application needs SDIO irq, e.g. MMC cards. · 123 unmodified lines
124124 pinctrl-1 = <&mmc1_idle>;
125125 pinctrl-2 = <&mmc1_sleep>;
126126 ...
127− interrupts-extended = <&intc 64 &gpio2 28 GPIO_ACTIVE_LOW>;
127+ interrupts-extended = <&intc 64 &gpio2 28 IRQ_TYPE_LEVEL_LOW>;
128128 };
129129
130130 mmc1_idle : pinmux_cirq_pin {
Documentation/devicetree/bindings/net/mdio.yaml+0−1
@@ -56,7 +56,6 @@ patternProperties: · 55 unmodified lines
5656 examples:
5757 - |
5858 davinci_mdio: mdio@5c030000 {
59− compatible = "ti,davinci_mdio";
6059 reg = <0x5c030000 0x1000>;
6160 #address-cells = <1>;
6261 #size-cells = <0>;
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt+11−6
@@ -1,12 +1,17 @@
11 ARM Freescale DSPI controller
22
33 Required properties:
4−- compatible : "fsl,vf610-dspi", "fsl,ls1021a-v1.0-dspi",
5− "fsl,ls2085a-dspi"
6− or
7− "fsl,ls2080a-dspi" followed by "fsl,ls2085a-dspi"
8− "fsl,ls1012a-dspi" followed by "fsl,ls1021a-v1.0-dspi"
9− "fsl,ls1088a-dspi" followed by "fsl,ls1021a-v1.0-dspi"
4+- compatible : must be one of:
5+ "fsl,vf610-dspi",
6+ "fsl,ls1021a-v1.0-dspi",
7+ "fsl,ls1012a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
8+ "fsl,ls1028a-dspi",
9+ "fsl,ls1043a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
10+ "fsl,ls1046a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
11+ "fsl,ls1088a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
12+ "fsl,ls2080a-dspi" (optionally followed by "fsl,ls2085a-dspi"),
13+ "fsl,ls2085a-dspi",
14+ "fsl,lx2160a-dspi",
1015 - reg : Offset and length of the register set for the device
1116 - interrupts : Should contain SPI controller interrupt
1217 - clocks: from common clock binding: handle to dspi clock.
Documentation/driver-api/ipmb.rst+4−0
@@ -71,9 +71,13 @@ b) Example for device tree:: · 70 unmodified lines
7171 ipmb@10 {
7272 compatible = "ipmb-dev";
7373 reg = <0x10>;
74+ i2c-protocol;
7475 };
7576 };
7677
78+If xmit of data to be done using raw i2c block vs smbus
79+then "i2c-protocol" needs to be defined as above.
80+
7781 2) Manually from Linux::
7882
7983 modprobe ipmb-dev-int
Documentation/filesystems/zonefs.txt+10−10
@@ -134,7 +134,7 @@ Sequential zone files can only be written sequentially, starting from the file · 133 unmodified lines
134134 end, that is, write operations can only be append writes. Zonefs makes no
135135 attempt at accepting random writes and will fail any write request that has a
136136 start offset not corresponding to the end of the file, or to the end of the last
137−write issued and still in-flight (for asynchrnous I/O operations).
137+write issued and still in-flight (for asynchronous I/O operations).
138138
139139 Since dirty page writeback by the page cache does not guarantee a sequential
140140 write pattern, zonefs prevents buffered writes and writeable shared mappings
@@ -142,7 +142,7 @@ on sequential files. Only direct I/O writes are accepted for these files. · 1 unmodified line
142142 zonefs relies on the sequential delivery of write I/O requests to the device
143143 implemented by the block layer elevator. An elevator implementing the sequential
144144 write feature for zoned block device (ELEVATOR_F_ZBD_SEQ_WRITE elevator feature)
145−must be used. This type of elevator (e.g. mq-deadline) is the set by default
145+must be used. This type of elevator (e.g. mq-deadline) is set by default
146146 for zoned block devices on device initialization.
147147
148148 There are no restrictions on the type of I/O used for read operations in
@@ -196,7 +196,7 @@ additional conditions that result in I/O errors. · 47 unmodified lines
196196 may still happen in the case of a partial failure of a very large direct I/O
197197 operation split into multiple BIOs/requests or asynchronous I/O operations.
198198 If one of the write request within the set of sequential write requests
199− issued to the device fails, all write requests after queued after it will
199+ issued to the device fails, all write requests queued after it will
200200 become unaligned and fail.
201201
202202 * Delayed write errors: similarly to regular block devices, if the device side
@@ -207,7 +207,7 @@ additional conditions that result in I/O errors. · 4 unmodified lines
207207 causing all data to be dropped after the sector that caused the error.
208208
209209 All I/O errors detected by zonefs are notified to the user with an error code
210−return for the system call that trigered or detected the error. The recovery
210+return for the system call that triggered or detected the error. The recovery
211211 actions taken by zonefs in response to I/O errors depend on the I/O type (read
212212 vs write) and on the reason for the error (bad sector, unaligned writes or zone
213213 condition change).
@@ -222,7 +222,7 @@ condition change). · 8 unmodified lines
222222 * A zone condition change to read-only or offline also always triggers zonefs
223223 I/O error recovery.
224224
225−Zonefs minimal I/O error recovery may change a file size and a file access
225+Zonefs minimal I/O error recovery may change a file size and file access
226226 permissions.
227227
228228 * File size changes:
@@ -237,7 +237,7 @@ permissions. · 8 unmodified lines
237237 A file size may also be reduced to reflect a delayed write error detected on
238238 fsync(): in this case, the amount of data effectively written in the zone may
239239 be less than originally indicated by the file inode size. After such I/O
240− error, zonefs always fixes a file inode size to reflect the amount of data
240+ error, zonefs always fixes the file inode size to reflect the amount of data
241241 persistently stored in the file zone.
242242
243243 * Access permission changes:
@@ -281,11 +281,11 @@ Further notes: · 37 unmodified lines
281281 permissions to read-only applies to all files. The file system is remounted
282282 read-only.
283283 * Access permission and file size changes due to the device transitioning zones
284− to the offline condition are permanent. Remounting or reformating the device
284+ to the offline condition are permanent. Remounting or reformatting the device
285285 with mkfs.zonefs (mkzonefs) will not change back offline zone files to a good
286286 state.
287287 * File access permission changes to read-only due to the device transitioning
288− zones to the read-only condition are permanent. Remounting or reformating
288+ zones to the read-only condition are permanent. Remounting or reformatting
289289 the device will not re-enable file write access.
290290 * File access permission changes implied by the remount-ro, zone-ro and
291291 zone-offline mount options are temporary for zones in a good condition.
@@ -301,13 +301,13 @@ Mount options · 9 unmodified lines
301301
302302 zonefs define the "errors=<behavior>" mount option to allow the user to specify
303303 zonefs behavior in response to I/O errors, inode size inconsistencies or zone
304−condition chages. The defined behaviors are as follow:
304+condition changes. The defined behaviors are as follow:
305305 * remount-ro (default)
306306 * zone-ro
307307 * zone-offline
308308 * repair
309309
310−The I/O error actions defined for each behavior is detailed in the previous
310+The I/O error actions defined for each behavior are detailed in the previous
311311 section.
312312
313313 Zonefs User Space Tools
Documentation/hwmon/xdpe12284.rst+1−0
@@ -24,6 +24,7 @@ This driver implements support for Infineon Multi-phase XDPE122 family · 23 unmodified lines
2424 dual loop voltage regulators.
2525 The family includes XDPE12284 and XDPE12254 devices.
2626 The devices from this family complaint with:
27+
2728 - Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC
2829 converter specification.
2930 - Intel SVID rev 1.9. protocol.
Documentation/kbuild/makefiles.rst+1−4
@@ -765,7 +765,7 @@ is not sufficient this sometimes needs to be explicit. · 764 unmodified lines
765765 Example::
766766
767767 #arch/x86/boot/Makefile
768− subdir- := compressed/
768+ subdir- := compressed
769769
770770 The above assignment instructs kbuild to descend down in the
771771 directory compressed/ when "make clean" is executed.
@@ -1379,9 +1379,6 @@ See subsequent chapter for the syntax of the Kbuild file. · 607 unmodified lines
13791379 in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
13801380 a wrapper of the asm-generic one.
13811381
1382− The convention is to list one subdir per line and
1383− preferably in alphabetic order.
1384−
13851382 8 Kbuild Variables
13861383 ==================
13871384
Documentation/networking/phy.rst+3−2
@@ -487,8 +487,9 @@ phy_register_fixup_for_id():: · 486 unmodified lines
487487 The stubs set one of the two matching criteria, and set the other one to
488488 match anything.
489489
490−When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module,
491−unregister fixup and free allocate memory are required.
490+When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module load
491+time, the module needs to unregister the fixup and free allocated memory when
492+it's unloaded.
492493
493494 Call one of following function before unloading module::
494495
Documentation/power/index.rst+0−1
@@ -13,7 +13,6 @@ Power Management · 12 unmodified lines
1313 drivers-testing
1414 energy-model
1515 freezing-of-tasks
16− interface
1716 opp
1817 pci
1918 pm_qos_interface
Documentation/process/embargoed-hardware-issues.rst+4−4
@@ -244,23 +244,23 @@ disclosure of a particular issue, unless requested by a response team or by · 243 unmodified lines
244244 an involved disclosed party. The current ambassadors list:
245245
246246 ============= ========================================================
247− ARM
247+ ARM Grant Likely <grant.likely@arm.com>
248248 AMD Tom Lendacky <tom.lendacky@amd.com>
249249 IBM
250250 Intel Tony Luck <tony.luck@intel.com>
251251 Qualcomm Trilok Soni <tsoni@codeaurora.org>
252252
253− Microsoft Sasha Levin <sashal@kernel.org>
253+ Microsoft James Morris <jamorris@linux.microsoft.com>
254254 VMware
255255 Xen Andrew Cooper <andrew.cooper3@citrix.com>
256256
257− Canonical Tyler Hicks <tyhicks@canonical.com>
257+ Canonical John Johansen <john.johansen@canonical.com>
258258 Debian Ben Hutchings <ben@decadent.org.uk>
259259 Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
260260 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>
261261 SUSE Jiri Kosina <jkosina@suse.cz>
262262
263− Amazon Peter Bowen <pzb@amzn.com>
263+ Amazon
264264 Google Kees Cook <keescook@chromium.org>
265265 ============= ========================================================
266266
Documentation/sphinx/parallel-wrapper.sh+1−1
@@ -30,4 +30,4 @@ if [ -n "$parallel" ] ; then · 29 unmodified lines
3030 parallel="-j$parallel"
3131 fi
3232
33−exec "$sphinx" "$parallel" "$@"
33+exec "$sphinx" $parallel "$@"
Documentation/translations/zh_CN/process/embargoed-hardware-issues.rst+1−1
@@ -183,7 +183,7 @@ CVE分配 · 182 unmodified lines
183183 VMware
184184 Xen Andrew Cooper <andrew.cooper3@citrix.com>
185185
186− Canonical Tyler Hicks <tyhicks@canonical.com>
186+ Canonical John Johansen <john.johansen@canonical.com>
187187 Debian Ben Hutchings <ben@decadent.org.uk>
188188 Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
189189 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>
Documentation/virt/guest-halt-polling.rstrenamed from Documentation/virtual/guest-halt-polling.txt+9−3
@@ -1,9 +1,11 @@
1+==================
12 Guest halt polling
23 ==================
34
45 The cpuidle_haltpoll driver, with the haltpoll governor, allows
56 the guest vcpus to poll for a specified amount of time before
67 halting.
8+
79 This provides the following benefits to host side polling:
810
911 1) The POLL flag is set while polling is performed, which allows
@@ -29,18 +31,21 @@ Module Parameters · 19 unmodified lines
2931 The haltpoll governor has 5 tunable module parameters:
3032
3133 1) guest_halt_poll_ns:
34+
3235 Maximum amount of time, in nanoseconds, that polling is
3336 performed before halting.
3437
3538 Default: 200000
3639
3740 2) guest_halt_poll_shrink:
41+
3842 Division factor used to shrink per-cpu guest_halt_poll_ns when
3943 wakeup event occurs after the global guest_halt_poll_ns.
4044
4145 Default: 2
4246
4347 3) guest_halt_poll_grow:
48+
4449 Multiplication factor used to grow per-cpu guest_halt_poll_ns
4550 when event occurs after per-cpu guest_halt_poll_ns
4651 but before global guest_halt_poll_ns.
@@ -48,6 +53,7 @@ but before global guest_halt_poll_ns. · 1 unmodified line
4853 Default: 2
4954
5055 4) guest_halt_poll_grow_start:
56+
5157 The per-cpu guest_halt_poll_ns eventually reaches zero
5258 in case of an idle system. This value sets the initial
5359 per-cpu guest_halt_poll_ns when growing. This can
@@ -66,7 +72,7 @@ high once achieves global guest_halt_poll_ns value). · 12 unmodified lines
6672
6773 Default: Y
6874
69−The module parameters can be set from the debugfs files in:
75+The module parameters can be set from the debugfs files in::
7076
7177 /sys/module/haltpoll/parameters/
7278
@@ -74,5 +80,5 @@ Further Notes · 1 unmodified line
7480 =============
7581
7682 - Care should be taken when setting the guest_halt_poll_ns parameter as a
77−large value has the potential to drive the cpu usage to 100% on a machine which
78−would be almost entirely idle otherwise.
83+ large value has the potential to drive the cpu usage to 100% on a machine
84+ which would be almost entirely idle otherwise.
Documentation/virt/index.rst+2−0
@@ -8,7 +8,9 @@ Linux Virtualization Support · 7 unmodified lines
88 :maxdepth: 2
99
1010 kvm/index
11+ uml/user_mode_linux
1112 paravirt_ops
13+ guest-halt-polling
1214
1315 .. only:: html and subproject
1416
Documentation/virt/kvm/api.rstrenamed from Documentation/virt/kvm/api.txt+1981−1402
@@ -1,8 +1,11 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===================================================================
14 The Definitive KVM (Kernel-based Virtual Machine) API Documentation
25 ===================================================================
36
47 1. General description
5−----------------------
8+======================
69
710 The kvm API is a set of ioctls that are issued to control various aspects
811 of a virtual machine. The ioctls belong to the following classes:
@@ -33,7 +36,7 @@ of a virtual machine. The ioctls belong to the following classes: · 24 unmodified lines
3336 was used to create the VM.
3437
3538 2. File descriptors
36−-------------------
39+===================
3740
3841 The kvm API is centered around file descriptors. An initial
3942 open("/dev/kvm") obtains a handle to the kvm subsystem; this handle
@@ -70,7 +73,7 @@ the VM is shut down. · 30 unmodified lines
7073
7174
7275 3. Extensions
73−-------------
76+=============
7477
7578 As of Linux 2.6.22, the KVM ABI has been stabilized: no backward
7679 incompatible change are allowed. However, there is an extension
@@ -84,13 +87,14 @@ set of ioctls is available for application use. · 7 unmodified lines
8487
8588
8689 4. API description
87−------------------
90+==================
8891
8992 This section describes ioctls that can be used to control kvm guests.
9093 For each ioctl, the following information is provided along with a
9194 description:
9295
93− Capability: which KVM extension provides this ioctl. Can be 'basic',
96+ Capability:
97+ which KVM extension provides this ioctl. Can be 'basic',
9498 which means that is will be provided by any kernel that supports
9599 API version 12 (see section 4.1), a KVM_CAP_xyz constant, which
96100 means availability needs to be checked with KVM_CHECK_EXTENSION
@@ -99,24 +103,29 @@ description: · 2 unmodified lines
99103 availability: for kernels that don't support the ioctl,
100104 the ioctl returns -ENOTTY.
101105
102− Architectures: which instruction set architectures provide this ioctl.
106+ Architectures:
107+ which instruction set architectures provide this ioctl.
103108 x86 includes both i386 and x86_64.
104109
105− Type: system, vm, or vcpu.
110+ Type:
111+ system, vm, or vcpu.
106112
107− Parameters: what parameters are accepted by the ioctl.
113+ Parameters:
114+ what parameters are accepted by the ioctl.
108115
109− Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL)
116+ Returns:
117+ the return value. General error numbers (EBADF, ENOMEM, EINVAL)
110118 are not detailed, but errors with specific meanings are.
111119
112120
113121 4.1 KVM_GET_API_VERSION
122+-----------------------
114123
115−Capability: basic
116−Architectures: all
117−Type: system ioctl
118−Parameters: none
119−Returns: the constant KVM_API_VERSION (=12)
124+:Capability: basic
125+:Architectures: all
126+:Type: system ioctl
127+:Parameters: none
128+:Returns: the constant KVM_API_VERSION (=12)
120129
121130 This identifies the API version as the stable kvm API. It is not
122131 expected that this number will change. However, Linux 2.6.20 and
@@ -127,12 +136,13 @@ described as 'basic' will be available. · 4 unmodified lines
127136
128137
129138 4.2 KVM_CREATE_VM
139+-----------------
130140
131−Capability: basic
132−Architectures: all
133−Type: system ioctl
134−Parameters: machine type identifier (KVM_VM_*)
135−Returns: a VM fd that can be used to control the new virtual machine.
141+:Capability: basic
142+:Architectures: all
143+:Type: system ioctl
144+:Parameters: machine type identifier (KVM_VM_*)
145+:Returns: a VM fd that can be used to control the new virtual machine.
136146
137147 The new VM has no virtual cpus and no memory.
138148 You probably want to use 0 as machine type.
@@ -155,17 +165,17 @@ identifier, where IPA_Bits is the maximum width of any physical · 16 unmodified lines
155165 address used by the VM. The IPA_Bits is encoded in bits[7-0] of the
156166 machine type identifier.
157167
158−e.g, to configure a guest to use 48bit physical address size :
168+e.g, to configure a guest to use 48bit physical address size::
159169
160170 vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48));
161171
162−The requested size (IPA_Bits) must be :
163− 0 - Implies default size, 40bits (for backward compatibility)
172+The requested size (IPA_Bits) must be:
164173
165− or
166−
167− N - Implies N bits, where N is a positive integer such that,
174+ == =========================================================
175+ 0 Implies default size, 40bits (for backward compatibility)
176+ N Implies N bits, where N is a positive integer such that,
168177 32 <= N <= Host_IPA_Limit
178+ == =========================================================
169179
170180 Host_IPA_Limit is the maximum possible value for IPA_Bits on the host and
171181 is dependent on the CPU capability and the kernel configuration. The limit can
@@ -179,21 +189,28 @@ host physical address translations). · 7 unmodified lines
179189
180190
181191 4.3 KVM_GET_MSR_INDEX_LIST, KVM_GET_MSR_FEATURE_INDEX_LIST
192+----------------------------------------------------------
193+
194+:Capability: basic, KVM_CAP_GET_MSR_FEATURES for KVM_GET_MSR_FEATURE_INDEX_LIST
195+:Architectures: x86
196+:Type: system ioctl
197+:Parameters: struct kvm_msr_list (in/out)
198+:Returns: 0 on success; -1 on error
182199
183−Capability: basic, KVM_CAP_GET_MSR_FEATURES for KVM_GET_MSR_FEATURE_INDEX_LIST
184−Architectures: x86
185−Type: system ioctl
186−Parameters: struct kvm_msr_list (in/out)
187−Returns: 0 on success; -1 on error
188200 Errors:
189− EFAULT: the msr index list cannot be read from or written to
190− E2BIG: the msr index list is to be to fit in the array specified by
201+
202+ ====== ============================================================
203+ EFAULT the msr index list cannot be read from or written to
204+ E2BIG the msr index list is to be to fit in the array specified by
191205 the user.
206+ ====== ============================================================
192207
193−struct kvm_msr_list {
208+::
209+
210+ struct kvm_msr_list {
194211 __u32 nmsrs; /* number of msrs in entries */
195212 __u32 indices[0];
196−};
213+ };
197214
198215 The user fills in the size of the indices array in nmsrs, and in return
199216 kvm adjusts nmsrs to reflect the actual number of msrs and fills in the
@@ -214,12 +231,13 @@ otherwise. · 14 unmodified lines
214231
215232
216233 4.4 KVM_CHECK_EXTENSION
234+-----------------------
217235
218−Capability: basic, KVM_CAP_CHECK_EXTENSION_VM for vm ioctl
219−Architectures: all
220−Type: system ioctl, vm ioctl
221−Parameters: extension identifier (KVM_CAP_*)
222−Returns: 0 if unsupported; 1 (or some other positive integer) if supported
236+:Capability: basic, KVM_CAP_CHECK_EXTENSION_VM for vm ioctl
237+:Architectures: all
238+:Type: system ioctl, vm ioctl
239+:Parameters: extension identifier (KVM_CAP_*)
240+:Returns: 0 if unsupported; 1 (or some other positive integer) if supported
223241
224242 The API allows the application to query about extensions to the core
225243 kvm API. Userspace passes an extension identifier (an integer) and
@@ -232,12 +250,13 @@ It is thus encouraged to use the vm ioctl to query for capabilities (available · 6 unmodified lines
232250 with KVM_CAP_CHECK_EXTENSION_VM on the vm fd)
233251
234252 4.5 KVM_GET_VCPU_MMAP_SIZE
253+--------------------------
235254
236−Capability: basic
237−Architectures: all
238−Type: system ioctl
239−Parameters: none
240−Returns: size of vcpu mmap area, in bytes
255+:Capability: basic
256+:Architectures: all
257+:Type: system ioctl
258+:Parameters: none
259+:Returns: size of vcpu mmap area, in bytes
241260
242261 The KVM_RUN ioctl (cf.) communicates with userspace via a shared
243262 memory region. This ioctl returns the size of that region. See the
@@ -245,23 +264,25 @@ KVM_RUN documentation for details. · 1 unmodified line
245264
246265
247266 4.6 KVM_SET_MEMORY_REGION
267+-------------------------
248268
249−Capability: basic
250−Architectures: all
251−Type: vm ioctl
252−Parameters: struct kvm_memory_region (in)
253−Returns: 0 on success, -1 on error
269+:Capability: basic
270+:Architectures: all
271+:Type: vm ioctl
272+:Parameters: struct kvm_memory_region (in)
273+:Returns: 0 on success, -1 on error
254274
255275 This ioctl is obsolete and has been removed.
256276
257277
258278 4.7 KVM_CREATE_VCPU
279+-------------------
259280
260−Capability: basic
261−Architectures: all
262−Type: vm ioctl
263−Parameters: vcpu id (apic id on x86)
264−Returns: vcpu fd on success, -1 on error
281+:Capability: basic
282+:Architectures: all
283+:Type: vm ioctl
284+:Parameters: vcpu id (apic id on x86)
285+:Returns: vcpu fd on success, -1 on error
265286
266287 This API adds a vcpu to a virtual machine. No more than max_vcpus may be added.
267288 The vcpu id is an integer in the range [0, max_vcpu_id).
@@ -302,22 +323,25 @@ cpu's hardware control block. · 34 unmodified lines
302323
303324
304325 4.8 KVM_GET_DIRTY_LOG (vm ioctl)
326+--------------------------------
305327
306−Capability: basic
307−Architectures: all
308−Type: vm ioctl
309−Parameters: struct kvm_dirty_log (in/out)
310−Returns: 0 on success, -1 on error
328+:Capability: basic
329+:Architectures: all
330+:Type: vm ioctl
331+:Parameters: struct kvm_dirty_log (in/out)
332+:Returns: 0 on success, -1 on error
311333
312−/* for KVM_GET_DIRTY_LOG */
313−struct kvm_dirty_log {
334+::
335+
336+ /* for KVM_GET_DIRTY_LOG */
337+ struct kvm_dirty_log {
314338 __u32 slot;
315339 __u32 padding;
316340 union {
317341 void __user *dirty_bitmap; /* one bit per page */
318342 __u64 padding;
319343 };
320−};
344+ };
321345
322346 Given a memory slot, return a bitmap containing any pages dirtied
323347 since the last call to this ioctl. Bit 0 is the first page in the
@@ -334,25 +358,31 @@ KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is enabled. For more information, · 10 unmodified lines
334358 see the description of the capability.
335359
336360 4.9 KVM_SET_MEMORY_ALIAS
361+------------------------
337362
338−Capability: basic
339−Architectures: x86
340−Type: vm ioctl
341−Parameters: struct kvm_memory_alias (in)
342−Returns: 0 (success), -1 (error)
363+:Capability: basic
364+:Architectures: x86
365+:Type: vm ioctl
366+:Parameters: struct kvm_memory_alias (in)
367+:Returns: 0 (success), -1 (error)
343368
344369 This ioctl is obsolete and has been removed.
345370
346371
347372 4.10 KVM_RUN
373+------------
374+
375+:Capability: basic
376+:Architectures: all
377+:Type: vcpu ioctl
378+:Parameters: none
379+:Returns: 0 on success, -1 on error
348380
349−Capability: basic
350−Architectures: all
351−Type: vcpu ioctl
352−Parameters: none
353−Returns: 0 on success, -1 on error
354381 Errors:
355− EINTR: an unmasked signal is pending
382+
383+ ===== =============================
384+ EINTR an unmasked signal is pending
385+ ===== =============================
356386
357387 This ioctl is used to run a guest virtual cpu. While there are no
358388 explicit parameters, there is an implicit parameter block that can be
@@ -362,42 +392,46 @@ kvm_run' (see below). · 3 unmodified lines
362392
363393
364394 4.11 KVM_GET_REGS
395+-----------------
365396
366−Capability: basic
367−Architectures: all except ARM, arm64
368−Type: vcpu ioctl
369−Parameters: struct kvm_regs (out)
370−Returns: 0 on success, -1 on error
397+:Capability: basic
398+:Architectures: all except ARM, arm64
399+:Type: vcpu ioctl
400+:Parameters: struct kvm_regs (out)
401+:Returns: 0 on success, -1 on error
371402
372403 Reads the general purpose registers from the vcpu.
373404
374−/* x86 */
375−struct kvm_regs {
405+::
406+
407+ /* x86 */
408+ struct kvm_regs {
376409 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
377410 __u64 rax, rbx, rcx, rdx;
378411 __u64 rsi, rdi, rsp, rbp;
379412 __u64 r8, r9, r10, r11;
380413 __u64 r12, r13, r14, r15;
381414 __u64 rip, rflags;
382−};
415+ };
383416
384−/* mips */
385−struct kvm_regs {
417+ /* mips */
418+ struct kvm_regs {
386419 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
387420 __u64 gpr[32];
388421 __u64 hi;
389422 __u64 lo;
390423 __u64 pc;
391−};
424+ };
392425
393426
394427 4.12 KVM_SET_REGS
428+-----------------
395429
396−Capability: basic
397−Architectures: all except ARM, arm64
398−Type: vcpu ioctl
399−Parameters: struct kvm_regs (in)
400−Returns: 0 on success, -1 on error
430+:Capability: basic
431+:Architectures: all except ARM, arm64
432+:Type: vcpu ioctl
433+:Parameters: struct kvm_regs (in)
434+:Returns: 0 on success, -1 on error
401435
402436 Writes the general purpose registers into the vcpu.
403437
@@ -405,17 +439,20 @@ See KVM_GET_REGS for the data structure. · 1 unmodified line
405439
406440
407441 4.13 KVM_GET_SREGS
442+------------------
408443
409−Capability: basic
410−Architectures: x86, ppc
411−Type: vcpu ioctl
412−Parameters: struct kvm_sregs (out)
413−Returns: 0 on success, -1 on error
444+:Capability: basic
445+:Architectures: x86, ppc
446+:Type: vcpu ioctl
447+:Parameters: struct kvm_sregs (out)
448+:Returns: 0 on success, -1 on error
414449
415450 Reads special registers from the vcpu.
416451
417−/* x86 */
418−struct kvm_sregs {
452+::
453+
454+ /* x86 */
455+ struct kvm_sregs {
419456 struct kvm_segment cs, ds, es, fs, gs, ss;
420457 struct kvm_segment tr, ldt;
421458 struct kvm_dtable gdt, idt;
@@ -423,9 +460,9 @@ struct kvm_sregs { · 1 unmodified line
423460 __u64 efer;
424461 __u64 apic_base;
425462 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
426−};
463+ };
427464
428−/* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */
465+ /* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */
429466
430467 interrupt_bitmap is a bitmap of pending external interrupts. At most
431468 one bit may be set. This interrupt has been acknowledged by the APIC
@@ -433,29 +470,33 @@ but not yet injected into the cpu core. · 1 unmodified line
433470
434471
435472 4.14 KVM_SET_SREGS
473+------------------
436474
437−Capability: basic
438−Architectures: x86, ppc
439−Type: vcpu ioctl
440−Parameters: struct kvm_sregs (in)
441−Returns: 0 on success, -1 on error
475+:Capability: basic
476+:Architectures: x86, ppc
477+:Type: vcpu ioctl
478+:Parameters: struct kvm_sregs (in)
479+:Returns: 0 on success, -1 on error
442480
443481 Writes special registers into the vcpu. See KVM_GET_SREGS for the
444482 data structures.
445483
446484
447485 4.15 KVM_TRANSLATE
486+------------------
448487
449−Capability: basic
450−Architectures: x86
451−Type: vcpu ioctl
452−Parameters: struct kvm_translation (in/out)
453−Returns: 0 on success, -1 on error
488+:Capability: basic
489+:Architectures: x86
490+:Type: vcpu ioctl
491+:Parameters: struct kvm_translation (in/out)
492+:Returns: 0 on success, -1 on error
454493
455494 Translates a virtual address according to the vcpu's current address
456495 translation mode.
457496
458−struct kvm_translation {
497+::
498+
499+ struct kvm_translation {
459500 /* in */
460501 __u64 linear_address;
461502
@@ -465,59 +506,68 @@ struct kvm_translation { · 3 unmodified lines
465506 __u8 writeable;
466507 __u8 usermode;
467508 __u8 pad[5];
468−};
509+ };
469510
470511
471512 4.16 KVM_INTERRUPT
513+------------------
472514
473−Capability: basic
474−Architectures: x86, ppc, mips
475−Type: vcpu ioctl
476−Parameters: struct kvm_interrupt (in)
477−Returns: 0 on success, negative on failure.
515+:Capability: basic
516+:Architectures: x86, ppc, mips
517+:Type: vcpu ioctl
518+:Parameters: struct kvm_interrupt (in)
519+:Returns: 0 on success, negative on failure.
478520
479521 Queues a hardware interrupt vector to be injected.
480522
481−/* for KVM_INTERRUPT */
482−struct kvm_interrupt {
523+::
524+
525+ /* for KVM_INTERRUPT */
526+ struct kvm_interrupt {
483527 /* in */
484528 __u32 irq;
485−};
529+ };
486530
487531 X86:
532+^^^^
533+
534+:Returns:
488535
489−Returns: 0 on success,
490− -EEXIST if an interrupt is already enqueued
491− -EINVAL the the irq number is invalid
492− -ENXIO if the PIC is in the kernel
493− -EFAULT if the pointer is invalid
536+ ========= ===================================
537+ 0 on success,
538+ -EEXIST if an interrupt is already enqueued
539+ -EINVAL the the irq number is invalid
540+ -ENXIO if the PIC is in the kernel
541+ -EFAULT if the pointer is invalid
542+ ========= ===================================
494543
495544 Note 'irq' is an interrupt vector, not an interrupt pin or line. This
496545 ioctl is useful if the in-kernel PIC is not used.
497546
498547 PPC:
548+^^^^
499549
500550 Queues an external interrupt to be injected. This ioctl is overleaded
501551 with 3 different irq values:
502552
503553 a) KVM_INTERRUPT_SET
504554
505− This injects an edge type external interrupt into the guest once it's ready
506− to receive interrupts. When injected, the interrupt is done.
555+ This injects an edge type external interrupt into the guest once it's ready
556+ to receive interrupts. When injected, the interrupt is done.
507557
508558 b) KVM_INTERRUPT_UNSET
509559
510− This unsets any pending interrupt.
560+ This unsets any pending interrupt.
511561
512− Only available with KVM_CAP_PPC_UNSET_IRQ.
562+ Only available with KVM_CAP_PPC_UNSET_IRQ.
513563
514564 c) KVM_INTERRUPT_SET_LEVEL
515565
516− This injects a level type external interrupt into the guest context. The
517− interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET
518− is triggered.
566+ This injects a level type external interrupt into the guest context. The
567+ interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET
568+ is triggered.
519569
520− Only available with KVM_CAP_PPC_IRQ_LEVEL.
570+ Only available with KVM_CAP_PPC_IRQ_LEVEL.
521571
522572 Note that any value for 'irq' other than the ones stated above is invalid
523573 and incurs unexpected behavior.
@@ -525,6 +575,7 @@ and incurs unexpected behavior. · 1 unmodified line
525575 This is an asynchronous vcpu ioctl and can be invoked from any thread.
526576
527577 MIPS:
578+^^^^^
528579
529580 Queues an external interrupt to be injected into the virtual CPU. A negative
530581 interrupt number dequeues the interrupt.
@@ -533,24 +584,26 @@ This is an asynchronous vcpu ioctl and can be invoked from any thread. · 2 unmodified lines
533584
534585
535586 4.17 KVM_DEBUG_GUEST
587+--------------------
536588
537−Capability: basic
538−Architectures: none
539−Type: vcpu ioctl
540−Parameters: none)
541−Returns: -1 on error
589+:Capability: basic
590+:Architectures: none
591+:Type: vcpu ioctl
592+:Parameters: none)
593+:Returns: -1 on error
542594
543595 Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead.
544596
545597
546598 4.18 KVM_GET_MSRS
599+-----------------
547600
548−Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system)
549−Architectures: x86
550−Type: system ioctl, vcpu ioctl
551−Parameters: struct kvm_msrs (in/out)
552−Returns: number of msrs successfully returned;
553− -1 on error
601+:Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system)
602+:Architectures: x86
603+:Type: system ioctl, vcpu ioctl
604+:Parameters: struct kvm_msrs (in/out)
605+:Returns: number of msrs successfully returned;
606+ -1 on error
554607
555608 When used as a system ioctl:
556609 Reads the values of MSR-based features that are available for the VM. This
@@ -562,18 +615,20 @@ When used as a vcpu ioctl: · 5 unmodified lines
562615 Reads model-specific registers from the vcpu. Supported msr indices can
563616 be obtained using KVM_GET_MSR_INDEX_LIST in a system ioctl.
564617
565−struct kvm_msrs {
618+::
619+
620+ struct kvm_msrs {
566621 __u32 nmsrs; /* number of msrs in entries */
567622 __u32 pad;
568623
569624 struct kvm_msr_entry entries[0];
570−};
625+ };
571626
572−struct kvm_msr_entry {
627+ struct kvm_msr_entry {
573628 __u32 index;
574629 __u32 reserved;
575630 __u64 data;
576−};
631+ };
577632
578633 Application code should set the 'nmsrs' member (which indicates the
579634 size of the entries array) and the 'index' member of each array entry.
@@ -581,12 +636,13 @@ kvm will fill in the 'data' member. · 1 unmodified line
581636
582637
583638 4.19 KVM_SET_MSRS
639+-----------------
584640
585−Capability: basic
586−Architectures: x86
587−Type: vcpu ioctl
588−Parameters: struct kvm_msrs (in)
589−Returns: number of msrs successfully set (see below), -1 on error
641+:Capability: basic
642+:Architectures: x86
643+:Type: vcpu ioctl
644+:Parameters: struct kvm_msrs (in)
645+:Returns: number of msrs successfully set (see below), -1 on error
590646
591647 Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the
592648 data structures.
@@ -602,41 +658,44 @@ MSRs that have been set successfully. · 9 unmodified lines
602658
603659
604660 4.20 KVM_SET_CPUID
661+------------------
605662
606−Capability: basic
607−Architectures: x86
608−Type: vcpu ioctl
609−Parameters: struct kvm_cpuid (in)
610−Returns: 0 on success, -1 on error
663+:Capability: basic
664+:Architectures: x86
665+:Type: vcpu ioctl
666+:Parameters: struct kvm_cpuid (in)
667+:Returns: 0 on success, -1 on error
611668
612669 Defines the vcpu responses to the cpuid instruction. Applications
613670 should use the KVM_SET_CPUID2 ioctl if available.
614671
672+::
615673
616−struct kvm_cpuid_entry {
674+ struct kvm_cpuid_entry {
617675 __u32 function;
618676 __u32 eax;
619677 __u32 ebx;
620678 __u32 ecx;
621679 __u32 edx;
622680 __u32 padding;
623−};
681+ };
624682
625−/* for KVM_SET_CPUID */
626−struct kvm_cpuid {
683+ /* for KVM_SET_CPUID */
684+ struct kvm_cpuid {
627685 __u32 nent;
628686 __u32 padding;
629687 struct kvm_cpuid_entry entries[0];
630−};
688+ };
631689
632690
633691 4.21 KVM_SET_SIGNAL_MASK
692+------------------------
634693
635−Capability: basic
636−Architectures: all
637−Type: vcpu ioctl
638−Parameters: struct kvm_signal_mask (in)
639−Returns: 0 on success, -1 on error
694+:Capability: basic
695+:Architectures: all
696+:Type: vcpu ioctl
697+:Parameters: struct kvm_signal_mask (in)
698+:Returns: 0 on success, -1 on error
640699
641700 Defines which signals are blocked during execution of KVM_RUN. This
642701 signal mask temporarily overrides the threads signal mask. Any
@@ -646,25 +705,30 @@ their traditional behaviour) will cause KVM_RUN to return with -EINTR. · 3 unmodified lines
646705 Note the signal will only be delivered if not blocked by the original
647706 signal mask.
648707
649−/* for KVM_SET_SIGNAL_MASK */
650−struct kvm_signal_mask {
708+::
709+
710+ /* for KVM_SET_SIGNAL_MASK */
711+ struct kvm_signal_mask {
651712 __u32 len;
652713 __u8 sigset[0];
653−};
714+ };
654715
655716
656717 4.22 KVM_GET_FPU
718+----------------
657719
658−Capability: basic
659−Architectures: x86
660−Type: vcpu ioctl
661−Parameters: struct kvm_fpu (out)
662−Returns: 0 on success, -1 on error
720+:Capability: basic
721+:Architectures: x86
722+:Type: vcpu ioctl
723+:Parameters: struct kvm_fpu (out)
724+:Returns: 0 on success, -1 on error
663725
664726 Reads the floating point state from the vcpu.
665727
666−/* for KVM_GET_FPU and KVM_SET_FPU */
667−struct kvm_fpu {
728+::
729+
730+ /* for KVM_GET_FPU and KVM_SET_FPU */
731+ struct kvm_fpu {
668732 __u8 fpr[8][16];
669733 __u16 fcw;
670734 __u16 fsw;
@@ -676,21 +740,24 @@ struct kvm_fpu { · 5 unmodified lines
676740 __u8 xmm[16][16];
677741 __u32 mxcsr;
678742 __u32 pad2;
679−};
743+ };
680744
681745
682746 4.23 KVM_SET_FPU
747+----------------
683748
684−Capability: basic
685−Architectures: x86
686−Type: vcpu ioctl
687−Parameters: struct kvm_fpu (in)
688−Returns: 0 on success, -1 on error
749+:Capability: basic
750+:Architectures: x86
751+:Type: vcpu ioctl
752+:Parameters: struct kvm_fpu (in)
753+:Returns: 0 on success, -1 on error
689754
690755 Writes the floating point state to the vcpu.
691756
692−/* for KVM_GET_FPU and KVM_SET_FPU */
693−struct kvm_fpu {
757+::
758+
759+ /* for KVM_GET_FPU and KVM_SET_FPU */
760+ struct kvm_fpu {
694761 __u8 fpr[8][16];
695762 __u16 fcw;
696763 __u16 fsw;
@@ -702,16 +769,17 @@ struct kvm_fpu { · 5 unmodified lines
702769 __u8 xmm[16][16];
703770 __u32 mxcsr;
704771 __u32 pad2;
705−};
772+ };
706773
707774
708775 4.24 KVM_CREATE_IRQCHIP
776+-----------------------
709777
710−Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390)
711−Architectures: x86, ARM, arm64, s390
712−Type: vm ioctl
713−Parameters: none
714−Returns: 0 on success, -1 on error
778+:Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390)
779+:Architectures: x86, ARM, arm64, s390
780+:Type: vm ioctl
781+:Parameters: none
782+:Returns: 0 on success, -1 on error
715783
716784 Creates an interrupt controller model in the kernel.
717785 On x86, creates a virtual ioapic, a virtual PIC (two PICs, nested), and sets up
@@ -727,12 +795,13 @@ before KVM_CREATE_IRQCHIP can be used. · 9 unmodified lines
727795
728796
729797 4.25 KVM_IRQ_LINE
798+-----------------
730799
731−Capability: KVM_CAP_IRQCHIP
732−Architectures: x86, arm, arm64
733−Type: vm ioctl
734−Parameters: struct kvm_irq_level
735−Returns: 0 on success, -1 on error
800+:Capability: KVM_CAP_IRQCHIP
801+:Architectures: x86, arm, arm64
802+:Type: vm ioctl
803+:Parameters: struct kvm_irq_level
804+:Returns: 0 on success, -1 on error
736805
737806 Sets the level of a GSI input to the interrupt controller model in the kernel.
738807 On some architectures it is required that an interrupt controller model has
@@ -756,16 +825,20 @@ of course). · 17 unmodified lines
756825 ARM/arm64 can signal an interrupt either at the CPU level, or at the
757826 in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to
758827 use PPIs designated for specific cpus. The irq field is interpreted
759−like this:
828+like this::
760829
761830  bits: | 31 ... 28 | 27 ... 24 | 23 ... 16 | 15 ... 0 |
762831 field: | vcpu2_index | irq_type | vcpu_index | irq_id |
763832
764833 The irq_type field has the following values:
765−- irq_type[0]: out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ
766−- irq_type[1]: in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.)
834+
835+- irq_type[0]:
836+ out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ
837+- irq_type[1]:
838+ in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.)
767839 (the vcpu_index field is ignored)
768−- irq_type[2]: in-kernel GIC: PPI, irq_id between 16 and 31 (incl.)
840+- irq_type[2]:
841+ in-kernel GIC: PPI, irq_id between 16 and 31 (incl.)
769842
770843 (The irq_id field thus corresponds nicely to the IRQ ID in the ARM GIC specs)
771844
@@ -779,27 +852,32 @@ Note that on arm/arm64, the KVM_CAP_IRQCHIP capability only conditions · 7 unmodified lines
779852 injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always
780853 be used for a userspace interrupt controller.
781854
782−struct kvm_irq_level {
855+::
856+
857+ struct kvm_irq_level {
783858 union {
784859 __u32 irq; /* GSI */
785860 __s32 status; /* not used for KVM_IRQ_LEVEL */
786861 };
787862 __u32 level; /* 0 or 1 */
788−};
863+ };
789864
790865
791866 4.26 KVM_GET_IRQCHIP
867+--------------------
792868
793−Capability: KVM_CAP_IRQCHIP
794−Architectures: x86
795−Type: vm ioctl
796−Parameters: struct kvm_irqchip (in/out)
797−Returns: 0 on success, -1 on error
869+:Capability: KVM_CAP_IRQCHIP
870+:Architectures: x86
871+:Type: vm ioctl
872+:Parameters: struct kvm_irqchip (in/out)
873+:Returns: 0 on success, -1 on error
798874
799875 Reads the state of a kernel interrupt controller created with
800876 KVM_CREATE_IRQCHIP into a buffer provided by the caller.
801877
802−struct kvm_irqchip {
878+::
879+
880+ struct kvm_irqchip {
803881 __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */
804882 __u32 pad;
805883 union {
@@ -807,21 +885,24 @@ struct kvm_irqchip { · 1 unmodified line
807885 struct kvm_pic_state pic;
808886 struct kvm_ioapic_state ioapic;
809887 } chip;
810−};
888+ };
811889
812890
813891 4.27 KVM_SET_IRQCHIP
892+--------------------
814893
815−Capability: KVM_CAP_IRQCHIP
816−Architectures: x86
817−Type: vm ioctl
818−Parameters: struct kvm_irqchip (in)
819−Returns: 0 on success, -1 on error
894+:Capability: KVM_CAP_IRQCHIP
895+:Architectures: x86
896+:Type: vm ioctl
897+:Parameters: struct kvm_irqchip (in)
898+:Returns: 0 on success, -1 on error
820899
821900 Sets the state of a kernel interrupt controller created with
822901 KVM_CREATE_IRQCHIP from a buffer provided by the caller.
823902
824−struct kvm_irqchip {
903+::
904+
905+ struct kvm_irqchip {
825906 __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */
826907 __u32 pad;
827908 union {
@@ -829,16 +910,17 @@ struct kvm_irqchip { · 1 unmodified line
829910 struct kvm_pic_state pic;
830911 struct kvm_ioapic_state ioapic;
831912 } chip;
832−};
913+ };
833914
834915
835916 4.28 KVM_XEN_HVM_CONFIG
917+-----------------------
836918
837−Capability: KVM_CAP_XEN_HVM
838−Architectures: x86
839−Type: vm ioctl
840−Parameters: struct kvm_xen_hvm_config (in)
841−Returns: 0 on success, -1 on error
919+:Capability: KVM_CAP_XEN_HVM
920+:Architectures: x86
921+:Type: vm ioctl
922+:Parameters: struct kvm_xen_hvm_config (in)
923+:Returns: 0 on success, -1 on error
842924
843925 Sets the MSR that the Xen HVM guest uses to initialize its hypercall
844926 page, and provides the starting address and size of the hypercall
@@ -846,7 +928,9 @@ blobs in userspace. When the guest writes the MSR, kvm copies one · 1 unmodified line
846928 page of a blob (32- or 64-bit, depending on the vcpu mode) to guest
847929 memory.
848930
849−struct kvm_xen_hvm_config {
931+::
932+
933+ struct kvm_xen_hvm_config {
850934 __u32 flags;
851935 __u32 msr;
852936 __u64 blob_addr_32;
@@ -854,16 +938,17 @@ struct kvm_xen_hvm_config { · 1 unmodified line
854938 __u8 blob_size_32;
855939 __u8 blob_size_64;
856940 __u8 pad2[30];
857−};
941+ };
858942
859943
860944 4.29 KVM_GET_CLOCK
945+------------------
861946
862−Capability: KVM_CAP_ADJUST_CLOCK
863−Architectures: x86
864−Type: vm ioctl
865−Parameters: struct kvm_clock_data (out)
866−Returns: 0 on success, -1 on error
947+:Capability: KVM_CAP_ADJUST_CLOCK
948+:Architectures: x86
949+:Type: vm ioctl
950+:Parameters: struct kvm_clock_data (out)
951+:Returns: 0 on success, -1 on error
867952
868953 Gets the current timestamp of kvmclock as seen by the current guest. In
869954 conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios
@@ -880,47 +965,56 @@ with KVM_SET_CLOCK. KVM will try to make all VCPUs follow this clock, · 10 unmodified lines
880965 but the exact value read by each VCPU could differ, because the host
881966 TSC is not stable.
882967
883−struct kvm_clock_data {
968+::
969+
970+ struct kvm_clock_data {
884971 __u64 clock; /* kvmclock current value */
885972 __u32 flags;
886973 __u32 pad[9];
887−};
974+ };
888975
889976
890977 4.30 KVM_SET_CLOCK
978+------------------
891979
892−Capability: KVM_CAP_ADJUST_CLOCK
893−Architectures: x86
894−Type: vm ioctl
895−Parameters: struct kvm_clock_data (in)
896−Returns: 0 on success, -1 on error
980+:Capability: KVM_CAP_ADJUST_CLOCK
981+:Architectures: x86
982+:Type: vm ioctl
983+:Parameters: struct kvm_clock_data (in)
984+:Returns: 0 on success, -1 on error
897985
898986 Sets the current timestamp of kvmclock to the value specified in its parameter.
899987 In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios
900988 such as migration.
901989
902−struct kvm_clock_data {
990+::
991+
992+ struct kvm_clock_data {
903993 __u64 clock; /* kvmclock current value */
904994 __u32 flags;
905995 __u32 pad[9];
906−};
996+ };
907997
908998
909999 4.31 KVM_GET_VCPU_EVENTS
1000+------------------------
9101001
911−Capability: KVM_CAP_VCPU_EVENTS
912−Extended by: KVM_CAP_INTR_SHADOW
913−Architectures: x86, arm, arm64
914−Type: vcpu ioctl
915−Parameters: struct kvm_vcpu_event (out)
916−Returns: 0 on success, -1 on error
1002+:Capability: KVM_CAP_VCPU_EVENTS
1003+:Extended by: KVM_CAP_INTR_SHADOW
1004+:Architectures: x86, arm, arm64
1005+:Type: vcpu ioctl
1006+:Parameters: struct kvm_vcpu_event (out)
1007+:Returns: 0 on success, -1 on error
9171008
9181009 X86:
1010+^^^^
9191011
9201012 Gets currently pending exceptions, interrupts, and NMIs as well as related
9211013 states of the vcpu.
9221014
923−struct kvm_vcpu_events {
1015+::
1016+
1017+ struct kvm_vcpu_events {
9241018 struct {
9251019 __u8 injected;
9261020 __u8 nr;
@@ -951,7 +1045,7 @@ struct kvm_vcpu_events { · 24 unmodified lines
9511045 __u8 reserved[27];
9521046 __u8 exception_has_payload;
9531047 __u64 exception_payload;
954−};
1048+ };
9551049
9561050 The following bits are defined in the flags field:
9571051
@@ -967,6 +1061,7 @@ The following bits are defined in the flags field: · 9 unmodified lines
9671061 KVM_CAP_EXCEPTION_PAYLOAD is enabled.
9681062
9691063 ARM/ARM64:
1064+^^^^^^^^^^
9701065
9711066 If the guest accesses a device that is being emulated by the host kernel in
9721067 such a way that a real device would generate a physical SError, KVM may make
@@ -1006,8 +1101,9 @@ It is not possible to read back a pending external abort (injected via · 33 unmodified lines
10061101 KVM_SET_VCPU_EVENTS or otherwise) because such an exception is always delivered
10071102 directly to the virtual CPU).
10081103
1104+::
10091105
1010−struct kvm_vcpu_events {
1106+ struct kvm_vcpu_events {
10111107 struct {
10121108 __u8 serror_pending;
10131109 __u8 serror_has_esr;
@@ -1017,18 +1113,20 @@ struct kvm_vcpu_events { · 3 unmodified lines
10171113 __u64 serror_esr;
10181114 } exception;
10191115 __u32 reserved[12];
1020−};
1116+ };
10211117
10221118 4.32 KVM_SET_VCPU_EVENTS
1119+------------------------
10231120
1024−Capability: KVM_CAP_VCPU_EVENTS
1025−Extended by: KVM_CAP_INTR_SHADOW
1026−Architectures: x86, arm, arm64
1027−Type: vcpu ioctl
1028−Parameters: struct kvm_vcpu_event (in)
1029−Returns: 0 on success, -1 on error
1121+:Capability: KVM_CAP_VCPU_EVENTS
1122+:Extended by: KVM_CAP_INTR_SHADOW
1123+:Architectures: x86, arm, arm64
1124+:Type: vcpu ioctl
1125+:Parameters: struct kvm_vcpu_event (in)
1126+:Returns: 0 on success, -1 on error
10301127
10311128 X86:
1129+^^^^
10321130
10331131 Set pending exceptions, interrupts, and NMIs as well as related states of the
10341132 vcpu.
@@ -1040,9 +1138,11 @@ from the update. These fields are nmi.pending, sipi_vector, smi.smm, · 5 unmodified lines
10401138 smi.pending. Keep the corresponding bits in the flags field cleared to
10411139 suppress overwriting the current in-kernel state. The bits are:
10421140
1043−KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel
1044−KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector
1045−KVM_VCPUEVENT_VALID_SMM - transfer the smi sub-struct.
1141+=============================== ==================================
1142+KVM_VCPUEVENT_VALID_NMI_PENDING transfer nmi.pending to the kernel
1143+KVM_VCPUEVENT_VALID_SIPI_VECTOR transfer sipi_vector
1144+KVM_VCPUEVENT_VALID_SMM transfer the smi sub-struct.
1145+=============================== ==================================
10461146
10471147 If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in
10481148 the flags field to signal that interrupt.shadow contains a valid state and
@@ -1056,6 +1156,7 @@ exception_has_payload, exception_payload, and exception.pending fields · 7 unmodified lines
10561156 contain a valid state and shall be written into the VCPU.
10571157
10581158 ARM/ARM64:
1159+^^^^^^^^^^
10591160
10601161 User space may need to inject several types of events to the guest.
10611162
@@ -1078,31 +1179,35 @@ See KVM_GET_VCPU_EVENTS for the data structure. · 16 unmodified lines
10781179
10791180
10801181 4.33 KVM_GET_DEBUGREGS
1182+----------------------
10811183
1082−Capability: KVM_CAP_DEBUGREGS
1083−Architectures: x86
1084−Type: vm ioctl
1085−Parameters: struct kvm_debugregs (out)
1086−Returns: 0 on success, -1 on error
1184+:Capability: KVM_CAP_DEBUGREGS
1185+:Architectures: x86
1186+:Type: vm ioctl
1187+:Parameters: struct kvm_debugregs (out)
1188+:Returns: 0 on success, -1 on error
10871189
10881190 Reads debug registers from the vcpu.
10891191
1090−struct kvm_debugregs {
1192+::
1193+
1194+ struct kvm_debugregs {
10911195 __u64 db[4];
10921196 __u64 dr6;
10931197 __u64 dr7;
10941198 __u64 flags;
10951199 __u64 reserved[9];
1096−};
1200+ };
10971201
10981202
10991203 4.34 KVM_SET_DEBUGREGS
1204+----------------------
11001205
1101−Capability: KVM_CAP_DEBUGREGS
1102−Architectures: x86
1103−Type: vm ioctl
1104−Parameters: struct kvm_debugregs (in)
1105−Returns: 0 on success, -1 on error
1206+:Capability: KVM_CAP_DEBUGREGS
1207+:Architectures: x86
1208+:Type: vm ioctl
1209+:Parameters: struct kvm_debugregs (in)
1210+:Returns: 0 on success, -1 on error
11061211
11071212 Writes debug registers into the vcpu.
11081213
@@ -1111,24 +1216,27 @@ yet and must be cleared on entry. · 2 unmodified lines
11111216
11121217
11131218 4.35 KVM_SET_USER_MEMORY_REGION
1219+-------------------------------
11141220
1115−Capability: KVM_CAP_USER_MEMORY
1116−Architectures: all
1117−Type: vm ioctl
1118−Parameters: struct kvm_userspace_memory_region (in)
1119−Returns: 0 on success, -1 on error
1221+:Capability: KVM_CAP_USER_MEMORY
1222+:Architectures: all
1223+:Type: vm ioctl
1224+:Parameters: struct kvm_userspace_memory_region (in)
1225+:Returns: 0 on success, -1 on error
11201226
1121−struct kvm_userspace_memory_region {
1227+::
1228+
1229+ struct kvm_userspace_memory_region {
11221230 __u32 slot;
11231231 __u32 flags;
11241232 __u64 guest_phys_addr;
11251233 __u64 memory_size; /* bytes */
11261234 __u64 userspace_addr; /* start of the userspace allocated memory */
1127−};
1235+ };
11281236
1129−/* for kvm_memory_region::flags */
1130−#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
1131−#define KVM_MEM_READONLY (1UL << 1)
1237+ /* for kvm_memory_region::flags */
1238+ #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
1239+ #define KVM_MEM_READONLY (1UL << 1)
11321240
11331241 This ioctl allows the user to create, modify or delete a guest physical
11341242 memory slot. Bits 0-15 of "slot" specify the slot id and this value
@@ -1174,12 +1282,13 @@ allocation and is deprecated. · 39 unmodified lines
11741282
11751283
11761284 4.36 KVM_SET_TSS_ADDR
1285+---------------------
11771286
1178−Capability: KVM_CAP_SET_TSS_ADDR
1179−Architectures: x86
1180−Type: vm ioctl
1181−Parameters: unsigned long tss_address (in)
1182−Returns: 0 on success, -1 on error
1287+:Capability: KVM_CAP_SET_TSS_ADDR
1288+:Architectures: x86
1289+:Type: vm ioctl
1290+:Parameters: unsigned long tss_address (in)
1291+:Returns: 0 on success, -1 on error
11831292
11841293 This ioctl defines the physical address of a three-page region in the guest
11851294 physical address space. The region must be within the first 4GB of the
@@ -1193,21 +1302,24 @@ documentation when it pops into existence). · 7 unmodified lines
11931302
11941303
11951304 4.37 KVM_ENABLE_CAP
1305+-------------------
1306+
1307+:Capability: KVM_CAP_ENABLE_CAP
1308+:Architectures: mips, ppc, s390
1309+:Type: vcpu ioctl
1310+:Parameters: struct kvm_enable_cap (in)
1311+:Returns: 0 on success; -1 on error
11961312
1197−Capability: KVM_CAP_ENABLE_CAP
1198−Architectures: mips, ppc, s390
1199−Type: vcpu ioctl
1200−Parameters: struct kvm_enable_cap (in)
1201−Returns: 0 on success; -1 on error
1313+:Capability: KVM_CAP_ENABLE_CAP_VM
1314+:Architectures: all
1315+:Type: vcpu ioctl
1316+:Parameters: struct kvm_enable_cap (in)
1317+:Returns: 0 on success; -1 on error
12021318
1203−Capability: KVM_CAP_ENABLE_CAP_VM
1204−Architectures: all
1205−Type: vcpu ioctl
1206−Parameters: struct kvm_enable_cap (in)
1207−Returns: 0 on success; -1 on error
1319+.. note::
12081320
1209−+Not all extensions are enabled by default. Using this ioctl the application
1210−can enable an extension, making it available to the guest.
1321+ Not all extensions are enabled by default. Using this ioctl the application
1322+ can enable an extension, making it available to the guest.
12111323
12121324 On systems that do not support this ioctl, it always fails. On systems that
12131325 do support it, it only works for extensions that are supported for enablement.
@@ -1215,76 +1327,91 @@ do support it, it only works for extensions that are supported for enablement. · 1 unmodified line
12151327 To check if a capability can be enabled, the KVM_CHECK_EXTENSION ioctl should
12161328 be used.
12171329
1218−struct kvm_enable_cap {
1330+::
1331+
1332+ struct kvm_enable_cap {
12191333 /* in */
12201334 __u32 cap;
12211335
12221336 The capability that is supposed to get enabled.
12231337
1338+::
1339+
12241340 __u32 flags;
12251341
12261342 A bitfield indicating future enhancements. Has to be 0 for now.
12271343
1344+::
1345+
12281346 __u64 args[4];
12291347
12301348 Arguments for enabling a feature. If a feature needs initial values to
12311349 function properly, this is the place to put them.
12321350
1351+::
1352+
12331353 __u8 pad[64];
1234−};
1354+ };
12351355
12361356 The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl
12371357 for vm-wide capabilities.
12381358
12391359 4.38 KVM_GET_MP_STATE
1360+---------------------
1361+
1362+:Capability: KVM_CAP_MP_STATE
1363+:Architectures: x86, s390, arm, arm64
1364+:Type: vcpu ioctl
1365+:Parameters: struct kvm_mp_state (out)
1366+:Returns: 0 on success; -1 on error
12401367
1241−Capability: KVM_CAP_MP_STATE
1242−Architectures: x86, s390, arm, arm64
1243−Type: vcpu ioctl
1244−Parameters: struct kvm_mp_state (out)
1245−Returns: 0 on success; -1 on error
1368+::
12461369
1247−struct kvm_mp_state {
1370+ struct kvm_mp_state {
12481371 __u32 mp_state;
1249−};
1372+ };
12501373
12511374 Returns the vcpu's current "multiprocessing state" (though also valid on
12521375 uniprocessor guests).
12531376
12541377 Possible values are:
12551378
1256− - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86,arm/arm64]
1257− - KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP)
1379+ ========================== ===============================================
1380+ KVM_MP_STATE_RUNNABLE the vcpu is currently running [x86,arm/arm64]
1381+ KVM_MP_STATE_UNINITIALIZED the vcpu is an application processor (AP)
12581382 which has not yet received an INIT signal [x86]
1259− - KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is
1383+ KVM_MP_STATE_INIT_RECEIVED the vcpu has received an INIT signal, and is
12601384 now ready for a SIPI [x86]
1261− - KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and
1385+ KVM_MP_STATE_HALTED the vcpu has executed a HLT instruction and
12621386 is waiting for an interrupt [x86]
1263− - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector
1387+ KVM_MP_STATE_SIPI_RECEIVED the vcpu has just received a SIPI (vector
12641388 accessible via KVM_GET_VCPU_EVENTS) [x86]
1265− - KVM_MP_STATE_STOPPED: the vcpu is stopped [s390,arm/arm64]
1266− - KVM_MP_STATE_CHECK_STOP: the vcpu is in a special error state [s390]
1267− - KVM_MP_STATE_OPERATING: the vcpu is operating (running or halted)
1389+ KVM_MP_STATE_STOPPED the vcpu is stopped [s390,arm/arm64]
1390+ KVM_MP_STATE_CHECK_STOP the vcpu is in a special error state [s390]
1391+ KVM_MP_STATE_OPERATING the vcpu is operating (running or halted)
12681392 [s390]
1269− - KVM_MP_STATE_LOAD: the vcpu is in a special load/startup state
1393+ KVM_MP_STATE_LOAD the vcpu is in a special load/startup state
12701394 [s390]
1395+ ========================== ===============================================
12711396
12721397 On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
12731398 in-kernel irqchip, the multiprocessing state must be maintained by userspace on
12741399 these architectures.
12751400
12761401 For arm/arm64:
1402+^^^^^^^^^^^^^^
12771403
12781404 The only states that are valid are KVM_MP_STATE_STOPPED and
12791405 KVM_MP_STATE_RUNNABLE which reflect if the vcpu is paused or not.
12801406
12811407 4.39 KVM_SET_MP_STATE
1408+---------------------
12821409
1283−Capability: KVM_CAP_MP_STATE
1284−Architectures: x86, s390, arm, arm64
1285−Type: vcpu ioctl
1286−Parameters: struct kvm_mp_state (in)
1287−Returns: 0 on success; -1 on error
1410+:Capability: KVM_CAP_MP_STATE
1411+:Architectures: x86, s390, arm, arm64
1412+:Type: vcpu ioctl
1413+:Parameters: struct kvm_mp_state (in)
1414+:Returns: 0 on success; -1 on error
12881415
12891416 Sets the vcpu's current "multiprocessing state"; see KVM_GET_MP_STATE for
12901417 arguments.
@@ -1294,17 +1421,19 @@ in-kernel irqchip, the multiprocessing state must be maintained by userspace on · 3 unmodified lines
12941421 these architectures.
12951422
12961423 For arm/arm64:
1424+^^^^^^^^^^^^^^
12971425
12981426 The only states that are valid are KVM_MP_STATE_STOPPED and
12991427 KVM_MP_STATE_RUNNABLE which reflect if the vcpu should be paused or not.
13001428
13011429 4.40 KVM_SET_IDENTITY_MAP_ADDR
1430+------------------------------
13021431
1303−Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR
1304−Architectures: x86
1305−Type: vm ioctl
1306−Parameters: unsigned long identity (in)
1307−Returns: 0 on success, -1 on error
1432+:Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR
1433+:Architectures: x86
1434+:Type: vm ioctl
1435+:Parameters: unsigned long identity (in)
1436+:Returns: 0 on success, -1 on error
13081437
13091438 This ioctl defines the physical address of a one-page region in the guest
13101439 physical address space. The region must be within the first 4GB of the
@@ -1322,12 +1451,13 @@ documentation when it pops into existence). · 11 unmodified lines
13221451 Fails if any VCPU has already been created.
13231452
13241453 4.41 KVM_SET_BOOT_CPU_ID
1454+------------------------
13251455
1326−Capability: KVM_CAP_SET_BOOT_CPU_ID
1327−Architectures: x86
1328−Type: vm ioctl
1329−Parameters: unsigned long vcpu_id
1330−Returns: 0 on success, -1 on error
1456+:Capability: KVM_CAP_SET_BOOT_CPU_ID
1457+:Architectures: x86
1458+:Type: vm ioctl
1459+:Parameters: unsigned long vcpu_id
1460+:Returns: 0 on success, -1 on error
13311461
13321462 Define which vcpu is the Bootstrap Processor (BSP). Values are the same
13331463 as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default
@@ -1335,102 +1465,119 @@ is vcpu 0. · 1 unmodified line
13351465
13361466
13371467 4.42 KVM_GET_XSAVE
1468+------------------
13381469
1339−Capability: KVM_CAP_XSAVE
1340−Architectures: x86
1341−Type: vcpu ioctl
1342−Parameters: struct kvm_xsave (out)
1343−Returns: 0 on success, -1 on error
1470+:Capability: KVM_CAP_XSAVE
1471+:Architectures: x86
1472+:Type: vcpu ioctl
1473+:Parameters: struct kvm_xsave (out)
1474+:Returns: 0 on success, -1 on error
13441475
1345−struct kvm_xsave {
1476+
1477+::
1478+
1479+ struct kvm_xsave {
13461480 __u32 region[1024];
1347−};
1481+ };
13481482
13491483 This ioctl would copy current vcpu's xsave struct to the userspace.
13501484
13511485
13521486 4.43 KVM_SET_XSAVE
1487+------------------
1488+
1489+:Capability: KVM_CAP_XSAVE
1490+:Architectures: x86
1491+:Type: vcpu ioctl
1492+:Parameters: struct kvm_xsave (in)
1493+:Returns: 0 on success, -1 on error
13531494
1354−Capability: KVM_CAP_XSAVE
1355−Architectures: x86
1356−Type: vcpu ioctl
1357−Parameters: struct kvm_xsave (in)
1358−Returns: 0 on success, -1 on error
1495+::
13591496
1360−struct kvm_xsave {
1497+
1498+ struct kvm_xsave {
13611499 __u32 region[1024];
1362−};
1500+ };
13631501
13641502 This ioctl would copy userspace's xsave struct to the kernel.
13651503
13661504
13671505 4.44 KVM_GET_XCRS
1506+-----------------
1507+
1508+:Capability: KVM_CAP_XCRS
1509+:Architectures: x86
1510+:Type: vcpu ioctl
1511+:Parameters: struct kvm_xcrs (out)
1512+:Returns: 0 on success, -1 on error
13681513
1369−Capability: KVM_CAP_XCRS
1370−Architectures: x86
1371−Type: vcpu ioctl
1372−Parameters: struct kvm_xcrs (out)
1373−Returns: 0 on success, -1 on error
1514+::
13741515
1375−struct kvm_xcr {
1516+ struct kvm_xcr {
13761517 __u32 xcr;
13771518 __u32 reserved;
13781519 __u64 value;
1379−};
1520+ };
13801521
1381−struct kvm_xcrs {
1522+ struct kvm_xcrs {
13821523 __u32 nr_xcrs;
13831524 __u32 flags;
13841525 struct kvm_xcr xcrs[KVM_MAX_XCRS];
13851526 __u64 padding[16];
1386−};
1527+ };
13871528
13881529 This ioctl would copy current vcpu's xcrs to the userspace.
13891530
13901531
13911532 4.45 KVM_SET_XCRS
1533+-----------------
1534+
1535+:Capability: KVM_CAP_XCRS
1536+:Architectures: x86
1537+:Type: vcpu ioctl
1538+:Parameters: struct kvm_xcrs (in)
1539+:Returns: 0 on success, -1 on error
13921540
1393−Capability: KVM_CAP_XCRS
1394−Architectures: x86
1395−Type: vcpu ioctl
1396−Parameters: struct kvm_xcrs (in)
1397−Returns: 0 on success, -1 on error
1541+::
13981542
1399−struct kvm_xcr {
1543+ struct kvm_xcr {
14001544 __u32 xcr;
14011545 __u32 reserved;
14021546 __u64 value;
1403−};
1547+ };
14041548
1405−struct kvm_xcrs {
1549+ struct kvm_xcrs {
14061550 __u32 nr_xcrs;
14071551 __u32 flags;
14081552 struct kvm_xcr xcrs[KVM_MAX_XCRS];
14091553 __u64 padding[16];
1410−};
1554+ };
14111555
14121556 This ioctl would set vcpu's xcr to the value userspace specified.
14131557
14141558
14151559 4.46 KVM_GET_SUPPORTED_CPUID
1560+----------------------------
14161561
1417−Capability: KVM_CAP_EXT_CPUID
1418−Architectures: x86
1419−Type: system ioctl
1420−Parameters: struct kvm_cpuid2 (in/out)
1421−Returns: 0 on success, -1 on error
1562+:Capability: KVM_CAP_EXT_CPUID
1563+:Architectures: x86
1564+:Type: system ioctl
1565+:Parameters: struct kvm_cpuid2 (in/out)
1566+:Returns: 0 on success, -1 on error
14221567
1423−struct kvm_cpuid2 {
1568+::
1569+
1570+ struct kvm_cpuid2 {
14241571 __u32 nent;
14251572 __u32 padding;
14261573 struct kvm_cpuid_entry2 entries[0];
1427−};
1574+ };
14281575
1429−#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
1430−#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
1431−#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
1576+ #define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
1577+ #define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
1578+ #define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
14321579
1433−struct kvm_cpuid_entry2 {
1580+ struct kvm_cpuid_entry2 {
14341581 __u32 function;
14351582 __u32 index;
14361583 __u32 flags;
@@ -1439,7 +1586,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines
14391586 __u32 ecx;
14401587 __u32 edx;
14411588 __u32 padding[3];
1442−};
1589+ };
14431590
14441591 This ioctl returns x86 cpuid features which are supported by both the
14451592 hardware and kvm in its default configuration. Userspace can use the
@@ -1467,10 +1614,16 @@ with unknown or unsupported features masked out. Some features (for example, · 21 unmodified lines
14671614 x2apic), may not be present in the host cpu, but are exposed by kvm if it can
14681615 emulate them efficiently. The fields in each entry are defined as follows:
14691616
1470− function: the eax value used to obtain the entry
1471− index: the ecx value used to obtain the entry (for entries that are
1617+ function:
1618+ the eax value used to obtain the entry
1619+
1620+ index:
1621+ the ecx value used to obtain the entry (for entries that are
14721622 affected by ecx)
1473− flags: an OR of zero or more of the following:
1623+
1624+ flags:
1625+ an OR of zero or more of the following:
1626+
14741627 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
14751628 if the index field is valid
14761629 KVM_CPUID_FLAG_STATEFUL_FUNC:
@@ -1480,12 +1633,14 @@ emulate them efficiently. The fields in each entry are defined as follows: · 3 unmodified lines
14801633 KVM_CPUID_FLAG_STATE_READ_NEXT:
14811634 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
14821635 the first entry to be read by a cpu
1483− eax, ebx, ecx, edx: the values returned by the cpuid instruction for
1636+
1637+ eax, ebx, ecx, edx:
1638+ the values returned by the cpuid instruction for
14841639 this function/index combination
14851640
14861641 The TSC deadline timer feature (CPUID leaf 1, ecx[24]) is always returned
14871642 as false, since the feature depends on KVM_CREATE_IRQCHIP for local APIC
1488−support. Instead it is reported via
1643+support. Instead it is reported via::
14891644
14901645 ioctl(KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER)
14911646
@@ -1494,18 +1649,21 @@ feature in userspace, then you can enable the feature for KVM_SET_CPUID2. · 2 unmodified lines
14941649
14951650
14961651 4.47 KVM_PPC_GET_PVINFO
1652+-----------------------
14971653
1498−Capability: KVM_CAP_PPC_GET_PVINFO
1499−Architectures: ppc
1500−Type: vm ioctl
1501−Parameters: struct kvm_ppc_pvinfo (out)
1502−Returns: 0 on success, !0 on error
1654+:Capability: KVM_CAP_PPC_GET_PVINFO
1655+:Architectures: ppc
1656+:Type: vm ioctl
1657+:Parameters: struct kvm_ppc_pvinfo (out)
1658+:Returns: 0 on success, !0 on error
15031659
1504−struct kvm_ppc_pvinfo {
1660+::
1661+
1662+ struct kvm_ppc_pvinfo {
15051663 __u32 flags;
15061664 __u32 hcall[4];
15071665 __u8 pad[108];
1508−};
1666+ };
15091667
15101668 This ioctl fetches PV specific information that need to be passed to the guest
15111669 using the device tree or other means from vm context.
@@ -1515,33 +1673,39 @@ The hcall array defines 4 instructions that make up a hypercall. · 3 unmodified lines
15151673 If any additional field gets added to this structure later on, a bit for that
15161674 additional piece of information will be set in the flags bitmap.
15171675
1518−The flags bitmap is defined as:
1676+The flags bitmap is defined as::
15191677
15201678 /* the host supports the ePAPR idle hcall
15211679 #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
15221680
15231681 4.52 KVM_SET_GSI_ROUTING
1682+------------------------
15241683
1525−Capability: KVM_CAP_IRQ_ROUTING
1526−Architectures: x86 s390 arm arm64
1527−Type: vm ioctl
1528−Parameters: struct kvm_irq_routing (in)
1529−Returns: 0 on success, -1 on error
1684+:Capability: KVM_CAP_IRQ_ROUTING
1685+:Architectures: x86 s390 arm arm64
1686+:Type: vm ioctl
1687+:Parameters: struct kvm_irq_routing (in)
1688+:Returns: 0 on success, -1 on error
15301689
15311690 Sets the GSI routing table entries, overwriting any previously set entries.
15321691
15331692 On arm/arm64, GSI routing has the following limitation:
1693+
15341694 - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.
15351695
1536−struct kvm_irq_routing {
1696+::
1697+
1698+ struct kvm_irq_routing {
15371699 __u32 nr;
15381700 __u32 flags;
15391701 struct kvm_irq_routing_entry entries[0];
1540−};
1702+ };
15411703
15421704 No flags are specified so far, the corresponding field must be set to zero.
15431705
1544−struct kvm_irq_routing_entry {
1706+::
1707+
1708+ struct kvm_irq_routing_entry {
15451709 __u32 gsi;
15461710 __u32 type;
15471711 __u32 flags;
@@ -1553,15 +1717,16 @@ struct kvm_irq_routing_entry { · 5 unmodified lines
15531717 struct kvm_irq_routing_hv_sint hv_sint;
15541718 __u32 pad[8];
15551719 } u;
1556−};
1720+ };
15571721
1558−/* gsi routing entry types */
1559−#define KVM_IRQ_ROUTING_IRQCHIP 1
1560−#define KVM_IRQ_ROUTING_MSI 2
1561−#define KVM_IRQ_ROUTING_S390_ADAPTER 3
1562−#define KVM_IRQ_ROUTING_HV_SINT 4
1722+ /* gsi routing entry types */
1723+ #define KVM_IRQ_ROUTING_IRQCHIP 1
1724+ #define KVM_IRQ_ROUTING_MSI 2
1725+ #define KVM_IRQ_ROUTING_S390_ADAPTER 3
1726+ #define KVM_IRQ_ROUTING_HV_SINT 4
15631727
15641728 flags:
1729+
15651730 - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
15661731 type, specifies that the devid field contains a valid value. The per-VM
15671732 KVM_CAP_MSI_DEVID capability advertises the requirement to provide
@@ -1569,12 +1734,14 @@ flags: · 1 unmodified line
15691734 never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.
15701735 - zero otherwise
15711736
1572−struct kvm_irq_routing_irqchip {
1737+::
1738+
1739+ struct kvm_irq_routing_irqchip {
15731740 __u32 irqchip;
15741741 __u32 pin;
1575−};
1742+ };
15761743
1577−struct kvm_irq_routing_msi {
1744+ struct kvm_irq_routing_msi {
15781745 __u32 address_lo;
15791746 __u32 address_hi;
15801747 __u32 data;
@@ -1582,7 +1749,7 @@ struct kvm_irq_routing_msi { · 1 unmodified line
15821749 __u32 pad;
15831750 __u32 devid;
15841751 };
1585−};
1752+ };
15861753
15871754 If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier
15881755 for the device that wrote the MSI message. For PCI, this is usually a
@@ -1593,39 +1760,43 @@ feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled, · 4 unmodified lines
15931760 address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
15941761 address_hi must be zero.
15951762
1596−struct kvm_irq_routing_s390_adapter {
1763+::
1764+
1765+ struct kvm_irq_routing_s390_adapter {
15971766 __u64 ind_addr;
15981767 __u64 summary_addr;
15991768 __u64 ind_offset;
16001769 __u32 summary_offset;
16011770 __u32 adapter_id;
1602−};
1771+ };
16031772
1604−struct kvm_irq_routing_hv_sint {
1773+ struct kvm_irq_routing_hv_sint {
16051774 __u32 vcpu;
16061775 __u32 sint;
1607−};
1776+ };
16081777
16091778
16101779 4.55 KVM_SET_TSC_KHZ
1780+--------------------
16111781
1612−Capability: KVM_CAP_TSC_CONTROL
1613−Architectures: x86
1614−Type: vcpu ioctl
1615−Parameters: virtual tsc_khz
1616−Returns: 0 on success, -1 on error
1782+:Capability: KVM_CAP_TSC_CONTROL
1783+:Architectures: x86
1784+:Type: vcpu ioctl
1785+:Parameters: virtual tsc_khz
1786+:Returns: 0 on success, -1 on error
16171787
16181788 Specifies the tsc frequency for the virtual machine. The unit of the
16191789 frequency is KHz.
16201790
16211791
16221792 4.56 KVM_GET_TSC_KHZ
1793+--------------------
16231794
1624−Capability: KVM_CAP_GET_TSC_KHZ
1625−Architectures: x86
1626−Type: vcpu ioctl
1627−Parameters: none
1628−Returns: virtual tsc-khz on success, negative value on error
1795+:Capability: KVM_CAP_GET_TSC_KHZ
1796+:Architectures: x86
1797+:Type: vcpu ioctl
1798+:Parameters: none
1799+:Returns: virtual tsc-khz on success, negative value on error
16291800
16301801 Returns the tsc frequency of the guest. The unit of the return value is
16311802 KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
@@ -1633,17 +1804,20 @@ error. · 1 unmodified line
16331804
16341805
16351806 4.57 KVM_GET_LAPIC
1807+------------------
16361808
1637−Capability: KVM_CAP_IRQCHIP
1638−Architectures: x86
1639−Type: vcpu ioctl
1640−Parameters: struct kvm_lapic_state (out)
1641−Returns: 0 on success, -1 on error
1809+:Capability: KVM_CAP_IRQCHIP
1810+:Architectures: x86
1811+:Type: vcpu ioctl
1812+:Parameters: struct kvm_lapic_state (out)
1813+:Returns: 0 on success, -1 on error
16421814
1643−#define KVM_APIC_REG_SIZE 0x400
1644−struct kvm_lapic_state {
1815+::
1816+
1817+ #define KVM_APIC_REG_SIZE 0x400
1818+ struct kvm_lapic_state {
16451819 char regs[KVM_APIC_REG_SIZE];
1646−};
1820+ };
16471821
16481822 Reads the Local APIC registers and copies them into the input argument. The
16491823 data format and layout are the same as documented in the architecture manual.
@@ -1661,17 +1835,20 @@ always uses xAPIC format. · 11 unmodified lines
16611835
16621836
16631837 4.58 KVM_SET_LAPIC
1838+------------------
16641839
1665−Capability: KVM_CAP_IRQCHIP
1666−Architectures: x86
1667−Type: vcpu ioctl
1668−Parameters: struct kvm_lapic_state (in)
1669−Returns: 0 on success, -1 on error
1840+:Capability: KVM_CAP_IRQCHIP
1841+:Architectures: x86
1842+:Type: vcpu ioctl
1843+:Parameters: struct kvm_lapic_state (in)
1844+:Returns: 0 on success, -1 on error
16701845
1671−#define KVM_APIC_REG_SIZE 0x400
1672−struct kvm_lapic_state {
1846+::
1847+
1848+ #define KVM_APIC_REG_SIZE 0x400
1849+ struct kvm_lapic_state {
16731850 char regs[KVM_APIC_REG_SIZE];
1674−};
1851+ };
16751852
16761853 Copies the input argument into the Local APIC registers. The data format
16771854 and layout are the same as documented in the architecture manual.
@@ -1682,35 +1859,38 @@ See the note in KVM_GET_LAPIC. · 4 unmodified lines
16821859
16831860
16841861 4.59 KVM_IOEVENTFD
1862+------------------
16851863
1686−Capability: KVM_CAP_IOEVENTFD
1687−Architectures: all
1688−Type: vm ioctl
1689−Parameters: struct kvm_ioeventfd (in)
1690−Returns: 0 on success, !0 on error
1864+:Capability: KVM_CAP_IOEVENTFD
1865+:Architectures: all
1866+:Type: vm ioctl
1867+:Parameters: struct kvm_ioeventfd (in)
1868+:Returns: 0 on success, !0 on error
16911869
16921870 This ioctl attaches or detaches an ioeventfd to a legal pio/mmio address
16931871 within the guest. A guest write in the registered address will signal the
16941872 provided event instead of triggering an exit.
16951873
1696−struct kvm_ioeventfd {
1874+::
1875+
1876+ struct kvm_ioeventfd {
16971877 __u64 datamatch;
16981878 __u64 addr; /* legal pio/mmio address */
16991879 __u32 len; /* 0, 1, 2, 4, or 8 bytes */
17001880 __s32 fd;
17011881 __u32 flags;
17021882 __u8 pad[36];
1703−};
1883+ };
17041884
17051885 For the special case of virtio-ccw devices on s390, the ioevent is matched
17061886 to a subchannel/virtqueue tuple instead.
17071887
1708−The following flags are defined:
1888+The following flags are defined::
17091889
1710−#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
1711−#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
1712−#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
1713−#define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \
1890+ #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
1891+ #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
1892+ #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
1893+ #define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \
17141894 (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify)
17151895
17161896 If datamatch flag is set, the event will be signaled only if the written value
@@ -1725,17 +1905,20 @@ The speedup may only apply to specific architectures, but the ioeventfd will · 8 unmodified lines
17251905 work anyway.
17261906
17271907 4.60 KVM_DIRTY_TLB
1908+------------------
1909+
1910+:Capability: KVM_CAP_SW_TLB
1911+:Architectures: ppc
1912+:Type: vcpu ioctl
1913+:Parameters: struct kvm_dirty_tlb (in)
1914+:Returns: 0 on success, -1 on error
17281915
1729−Capability: KVM_CAP_SW_TLB
1730−Architectures: ppc
1731−Type: vcpu ioctl
1732−Parameters: struct kvm_dirty_tlb (in)
1733−Returns: 0 on success, -1 on error
1916+::
17341917
1735−struct kvm_dirty_tlb {
1918+ struct kvm_dirty_tlb {
17361919 __u64 bitmap;
17371920 __u32 num_dirty;
1738−};
1921+ };
17391922
17401923 This must be called whenever userspace has changed an entry in the shared
17411924 TLB, prior to calling KVM_RUN on the associated vcpu.
@@ -1758,23 +1941,26 @@ be set to the number of set bits in the bitmap. · 16 unmodified lines
17581941
17591942
17601943 4.62 KVM_CREATE_SPAPR_TCE
1944+-------------------------
17611945
1762−Capability: KVM_CAP_SPAPR_TCE
1763−Architectures: powerpc
1764−Type: vm ioctl
1765−Parameters: struct kvm_create_spapr_tce (in)
1766−Returns: file descriptor for manipulating the created TCE table
1946+:Capability: KVM_CAP_SPAPR_TCE
1947+:Architectures: powerpc
1948+:Type: vm ioctl
1949+:Parameters: struct kvm_create_spapr_tce (in)
1950+:Returns: file descriptor for manipulating the created TCE table
17671951
17681952 This creates a virtual TCE (translation control entry) table, which
17691953 is an IOMMU for PAPR-style virtual I/O. It is used to translate
17701954 logical addresses used in virtual I/O into guest physical addresses,
17711955 and provides a scatter/gather capability for PAPR virtual I/O.
17721956
1773−/* for KVM_CAP_SPAPR_TCE */
1774−struct kvm_create_spapr_tce {
1957+::
1958+
1959+ /* for KVM_CAP_SPAPR_TCE */
1960+ struct kvm_create_spapr_tce {
17751961 __u64 liobn;
17761962 __u32 window_size;
1777−};
1963+ };
17781964
17791965 The liobn field gives the logical IO bus number for which to create a
17801966 TCE table. The window_size field specifies the size of the DMA window
@@ -1794,12 +1980,13 @@ circumstances. · 13 unmodified lines
17941980
17951981
17961982 4.63 KVM_ALLOCATE_RMA
1983+---------------------
17971984
1798−Capability: KVM_CAP_PPC_RMA
1799−Architectures: powerpc
1800−Type: vm ioctl
1801−Parameters: struct kvm_allocate_rma (out)
1802−Returns: file descriptor for mapping the allocated RMA
1985+:Capability: KVM_CAP_PPC_RMA
1986+:Architectures: powerpc
1987+:Type: vm ioctl
1988+:Parameters: struct kvm_allocate_rma (out)
1989+:Returns: file descriptor for mapping the allocated RMA
18031990
18041991 This allocates a Real Mode Area (RMA) from the pool allocated at boot
18051992 time by the kernel. An RMA is a physically-contiguous, aligned region
@@ -1808,10 +1995,12 @@ will be accessed by real-mode (MMU off) accesses in a KVM guest. · 2 unmodified lines
18081995 POWER processors support a set of sizes for the RMA that usually
18091996 includes 64MB, 128MB, 256MB and some larger powers of two.
18101997
1811−/* for KVM_ALLOCATE_RMA */
1812−struct kvm_allocate_rma {
1998+::
1999+
2000+ /* for KVM_ALLOCATE_RMA */
2001+ struct kvm_allocate_rma {
18132002 __u64 rma_size;
1814−};
2003+ };
18152004
18162005 The return value is a file descriptor which can be passed to mmap(2)
18172006 to map the allocated RMA into userspace. The mapped area can then be
@@ -1827,12 +2016,13 @@ because it supports the Virtual RMA (VRMA) facility. · 9 unmodified lines
18272016
18282017
18292018 4.64 KVM_NMI
2019+------------
18302020
1831−Capability: KVM_CAP_USER_NMI
1832−Architectures: x86
1833−Type: vcpu ioctl
1834−Parameters: none
1835−Returns: 0 on success, -1 on error
2021+:Capability: KVM_CAP_USER_NMI
2022+:Architectures: x86
2023+:Type: vcpu ioctl
2024+:Parameters: none
2025+:Returns: 0 on success, -1 on error
18362026
18372027 Queues an NMI on the thread's vcpu. Note this is well defined only
18382028 when KVM_CREATE_IRQCHIP has not been called, since this is an interface
@@ -1853,14 +2043,16 @@ debugging. · 14 unmodified lines
18532043
18542044
18552045 4.65 KVM_S390_UCAS_MAP
2046+----------------------
18562047
1857−Capability: KVM_CAP_S390_UCONTROL
1858−Architectures: s390
1859−Type: vcpu ioctl
1860−Parameters: struct kvm_s390_ucas_mapping (in)
1861−Returns: 0 in case of success
2048+:Capability: KVM_CAP_S390_UCONTROL
2049+:Architectures: s390
2050+:Type: vcpu ioctl
2051+:Parameters: struct kvm_s390_ucas_mapping (in)
2052+:Returns: 0 in case of success
2053+
2054+The parameter is defined like this::
18622055
1863−The parameter is defined like this:
18642056 struct kvm_s390_ucas_mapping {
18652057 __u64 user_addr;
18662058 __u64 vcpu_addr;
@@ -1873,14 +2065,16 @@ be aligned by 1 megabyte. · 6 unmodified lines
18732065
18742066
18752067 4.66 KVM_S390_UCAS_UNMAP
2068+------------------------
18762069
1877−Capability: KVM_CAP_S390_UCONTROL
1878−Architectures: s390
1879−Type: vcpu ioctl
1880−Parameters: struct kvm_s390_ucas_mapping (in)
1881−Returns: 0 in case of success
2070+:Capability: KVM_CAP_S390_UCONTROL
2071+:Architectures: s390
2072+:Type: vcpu ioctl
2073+:Parameters: struct kvm_s390_ucas_mapping (in)
2074+:Returns: 0 in case of success
2075+
2076+The parameter is defined like this::
18822077
1883−The parameter is defined like this:
18842078 struct kvm_s390_ucas_mapping {
18852079 __u64 user_addr;
18862080 __u64 vcpu_addr;
@@ -1893,12 +2087,13 @@ All parameters need to be aligned by 1 megabyte. · 6 unmodified lines
18932087
18942088
18952089 4.67 KVM_S390_VCPU_FAULT
2090+------------------------
18962091
1897−Capability: KVM_CAP_S390_UCONTROL
1898−Architectures: s390
1899−Type: vcpu ioctl
1900−Parameters: vcpu absolute address (in)
1901−Returns: 0 in case of success
2092+:Capability: KVM_CAP_S390_UCONTROL
2093+:Architectures: s390
2094+:Type: vcpu ioctl
2095+:Parameters: vcpu absolute address (in)
2096+:Returns: 0 in case of success
19022097
19032098 This call creates a page table entry on the virtual cpu's address space
19042099 (for user controlled virtual machines) or the virtual machine's address
@@ -1910,23 +2105,31 @@ prior to calling the KVM_RUN ioctl. · 5 unmodified lines
19102105
19112106
19122107 4.68 KVM_SET_ONE_REG
2108+--------------------
2109+
2110+:Capability: KVM_CAP_ONE_REG
2111+:Architectures: all
2112+:Type: vcpu ioctl
2113+:Parameters: struct kvm_one_reg (in)
2114+:Returns: 0 on success, negative value on failure
19132115
1914−Capability: KVM_CAP_ONE_REG
1915−Architectures: all
1916−Type: vcpu ioctl
1917−Parameters: struct kvm_one_reg (in)
1918−Returns: 0 on success, negative value on failure
19192116 Errors:
1920−  ENOENT:   no such register
1921−  EINVAL:   invalid register ID, or no such register
1922−  EPERM:    (arm64) register access not allowed before vcpu finalization
2117+
2118+ ====== ============================================================
2119+  ENOENT   no such register
2120+  EINVAL   invalid register ID, or no such register
2121+  EPERM    (arm64) register access not allowed before vcpu finalization
2122+ ====== ============================================================
2123+
19232124 (These error codes are indicative only: do not rely on a specific error
19242125 code being returned in a specific situation.)
19252126
1926−struct kvm_one_reg {
2127+::
2128+
2129+ struct kvm_one_reg {
19272130 __u64 id;
19282131 __u64 addr;
1929−};
2132+ };
19302133
19312134 Using this ioctl, a single vcpu register can be set to a specific value
19322135 defined by user space with the passed in struct kvm_one_reg, where id
@@ -1936,217 +2139,226 @@ and architecture specific registers. Each have their own range of operation · 3 unmodified lines
19362139 and their own constants and width. To keep track of the implemented
19372140 registers, find a list below:
19382141
1939− Arch | Register | Width (bits)
1940− | |
1941− PPC | KVM_REG_PPC_HIOR | 64
1942− PPC | KVM_REG_PPC_IAC1 | 64
1943− PPC | KVM_REG_PPC_IAC2 | 64
1944− PPC | KVM_REG_PPC_IAC3 | 64
1945− PPC | KVM_REG_PPC_IAC4 | 64
1946− PPC | KVM_REG_PPC_DAC1 | 64
1947− PPC | KVM_REG_PPC_DAC2 | 64
1948− PPC | KVM_REG_PPC_DABR | 64
1949− PPC | KVM_REG_PPC_DSCR | 64
1950− PPC | KVM_REG_PPC_PURR | 64
1951− PPC | KVM_REG_PPC_SPURR | 64
1952− PPC | KVM_REG_PPC_DAR | 64
1953− PPC | KVM_REG_PPC_DSISR | 32
1954− PPC | KVM_REG_PPC_AMR | 64
1955− PPC | KVM_REG_PPC_UAMOR | 64
1956− PPC | KVM_REG_PPC_MMCR0 | 64
1957− PPC | KVM_REG_PPC_MMCR1 | 64
1958− PPC | KVM_REG_PPC_MMCRA | 64
1959− PPC | KVM_REG_PPC_MMCR2 | 64
1960− PPC | KVM_REG_PPC_MMCRS | 64
1961− PPC | KVM_REG_PPC_SIAR | 64
1962− PPC | KVM_REG_PPC_SDAR | 64
1963− PPC | KVM_REG_PPC_SIER | 64
1964− PPC | KVM_REG_PPC_PMC1 | 32
1965− PPC | KVM_REG_PPC_PMC2 | 32
1966− PPC | KVM_REG_PPC_PMC3 | 32
1967− PPC | KVM_REG_PPC_PMC4 | 32
1968− PPC | KVM_REG_PPC_PMC5 | 32
1969− PPC | KVM_REG_PPC_PMC6 | 32
1970− PPC | KVM_REG_PPC_PMC7 | 32
1971− PPC | KVM_REG_PPC_PMC8 | 32
1972− PPC | KVM_REG_PPC_FPR0 | 64
1973− ...
1974− PPC | KVM_REG_PPC_FPR31 | 64
1975− PPC | KVM_REG_PPC_VR0 | 128
1976− ...
1977− PPC | KVM_REG_PPC_VR31 | 128
1978− PPC | KVM_REG_PPC_VSR0 | 128
1979− ...
1980− PPC | KVM_REG_PPC_VSR31 | 128
1981− PPC | KVM_REG_PPC_FPSCR | 64
1982− PPC | KVM_REG_PPC_VSCR | 32
1983− PPC | KVM_REG_PPC_VPA_ADDR | 64
1984− PPC | KVM_REG_PPC_VPA_SLB | 128
1985− PPC | KVM_REG_PPC_VPA_DTL | 128
1986− PPC | KVM_REG_PPC_EPCR | 32
1987− PPC | KVM_REG_PPC_EPR | 32
1988− PPC | KVM_REG_PPC_TCR | 32
1989− PPC | KVM_REG_PPC_TSR | 32
1990− PPC | KVM_REG_PPC_OR_TSR | 32
1991− PPC | KVM_REG_PPC_CLEAR_TSR | 32
1992− PPC | KVM_REG_PPC_MAS0 | 32
1993− PPC | KVM_REG_PPC_MAS1 | 32
1994− PPC | KVM_REG_PPC_MAS2 | 64
1995− PPC | KVM_REG_PPC_MAS7_3 | 64
1996− PPC | KVM_REG_PPC_MAS4 | 32
1997− PPC | KVM_REG_PPC_MAS6 | 32
1998− PPC | KVM_REG_PPC_MMUCFG | 32
1999− PPC | KVM_REG_PPC_TLB0CFG | 32
2000− PPC | KVM_REG_PPC_TLB1CFG | 32
2001− PPC | KVM_REG_PPC_TLB2CFG | 32
2002− PPC | KVM_REG_PPC_TLB3CFG | 32
2003− PPC | KVM_REG_PPC_TLB0PS | 32
2004− PPC | KVM_REG_PPC_TLB1PS | 32
2005− PPC | KVM_REG_PPC_TLB2PS | 32
2006− PPC | KVM_REG_PPC_TLB3PS | 32
2007− PPC | KVM_REG_PPC_EPTCFG | 32
2008− PPC | KVM_REG_PPC_ICP_STATE | 64
2009− PPC | KVM_REG_PPC_VP_STATE | 128
2010− PPC | KVM_REG_PPC_TB_OFFSET | 64
2011− PPC | KVM_REG_PPC_SPMC1 | 32
2012− PPC | KVM_REG_PPC_SPMC2 | 32
2013− PPC | KVM_REG_PPC_IAMR | 64
2014− PPC | KVM_REG_PPC_TFHAR | 64
2015− PPC | KVM_REG_PPC_TFIAR | 64
2016− PPC | KVM_REG_PPC_TEXASR | 64
2017− PPC | KVM_REG_PPC_FSCR | 64
2018− PPC | KVM_REG_PPC_PSPB | 32
2019− PPC | KVM_REG_PPC_EBBHR | 64
2020− PPC | KVM_REG_PPC_EBBRR | 64
2021− PPC | KVM_REG_PPC_BESCR | 64
2022− PPC | KVM_REG_PPC_TAR | 64
2023− PPC | KVM_REG_PPC_DPDES | 64
2024− PPC | KVM_REG_PPC_DAWR | 64
2025− PPC | KVM_REG_PPC_DAWRX | 64
2026− PPC | KVM_REG_PPC_CIABR | 64
2027− PPC | KVM_REG_PPC_IC | 64
2028− PPC | KVM_REG_PPC_VTB | 64
2029− PPC | KVM_REG_PPC_CSIGR | 64
2030− PPC | KVM_REG_PPC_TACR | 64
2031− PPC | KVM_REG_PPC_TCSCR | 64
2032− PPC | KVM_REG_PPC_PID | 64
2033− PPC | KVM_REG_PPC_ACOP | 64
2034− PPC | KVM_REG_PPC_VRSAVE | 32
2035− PPC | KVM_REG_PPC_LPCR | 32
2036− PPC | KVM_REG_PPC_LPCR_64 | 64
2037− PPC | KVM_REG_PPC_PPR | 64
2038− PPC | KVM_REG_PPC_ARCH_COMPAT | 32
2039− PPC | KVM_REG_PPC_DABRX | 32
2040− PPC | KVM_REG_PPC_WORT | 64
2041− PPC | KVM_REG_PPC_SPRG9 | 64
2042− PPC | KVM_REG_PPC_DBSR | 32
2043− PPC | KVM_REG_PPC_TIDR | 64
2044− PPC | KVM_REG_PPC_PSSCR | 64
2045− PPC | KVM_REG_PPC_DEC_EXPIRY | 64
2046− PPC | KVM_REG_PPC_PTCR | 64
2047− PPC | KVM_REG_PPC_TM_GPR0 | 64
2048− ...
2049− PPC | KVM_REG_PPC_TM_GPR31 | 64
2050− PPC | KVM_REG_PPC_TM_VSR0 | 128
2051− ...
2052− PPC | KVM_REG_PPC_TM_VSR63 | 128
2053− PPC | KVM_REG_PPC_TM_CR | 64
2054− PPC | KVM_REG_PPC_TM_LR | 64
2055− PPC | KVM_REG_PPC_TM_CTR | 64
2056− PPC | KVM_REG_PPC_TM_FPSCR | 64
2057− PPC | KVM_REG_PPC_TM_AMR | 64
2058− PPC | KVM_REG_PPC_TM_PPR | 64
2059− PPC | KVM_REG_PPC_TM_VRSAVE | 64
2060− PPC | KVM_REG_PPC_TM_VSCR | 32
2061− PPC | KVM_REG_PPC_TM_DSCR | 64
2062− PPC | KVM_REG_PPC_TM_TAR | 64
2063− PPC | KVM_REG_PPC_TM_XER | 64
2064− | |
2065− MIPS | KVM_REG_MIPS_R0 | 64
2066− ...
2067− MIPS | KVM_REG_MIPS_R31 | 64
2068− MIPS | KVM_REG_MIPS_HI | 64
2069− MIPS | KVM_REG_MIPS_LO | 64
2070− MIPS | KVM_REG_MIPS_PC | 64
2071− MIPS | KVM_REG_MIPS_CP0_INDEX | 32
2072− MIPS | KVM_REG_MIPS_CP0_ENTRYLO0 | 64
2073− MIPS | KVM_REG_MIPS_CP0_ENTRYLO1 | 64
2074− MIPS | KVM_REG_MIPS_CP0_CONTEXT | 64
2075− MIPS | KVM_REG_MIPS_CP0_CONTEXTCONFIG| 32
2076− MIPS | KVM_REG_MIPS_CP0_USERLOCAL | 64
2077− MIPS | KVM_REG_MIPS_CP0_XCONTEXTCONFIG| 64
2078− MIPS | KVM_REG_MIPS_CP0_PAGEMASK | 32
2079− MIPS | KVM_REG_MIPS_CP0_PAGEGRAIN | 32
2080− MIPS | KVM_REG_MIPS_CP0_SEGCTL0 | 64
2081− MIPS | KVM_REG_MIPS_CP0_SEGCTL1 | 64
2082− MIPS | KVM_REG_MIPS_CP0_SEGCTL2 | 64
2083− MIPS | KVM_REG_MIPS_CP0_PWBASE | 64
2084− MIPS | KVM_REG_MIPS_CP0_PWFIELD | 64
2085− MIPS | KVM_REG_MIPS_CP0_PWSIZE | 64
2086− MIPS | KVM_REG_MIPS_CP0_WIRED | 32
2087− MIPS | KVM_REG_MIPS_CP0_PWCTL | 32
2088− MIPS | KVM_REG_MIPS_CP0_HWRENA | 32
2089− MIPS | KVM_REG_MIPS_CP0_BADVADDR | 64
2090− MIPS | KVM_REG_MIPS_CP0_BADINSTR | 32
2091− MIPS | KVM_REG_MIPS_CP0_BADINSTRP | 32
2092− MIPS | KVM_REG_MIPS_CP0_COUNT | 32
2093− MIPS | KVM_REG_MIPS_CP0_ENTRYHI | 64
2094− MIPS | KVM_REG_MIPS_CP0_COMPARE | 32
2095− MIPS | KVM_REG_MIPS_CP0_STATUS | 32
2096− MIPS | KVM_REG_MIPS_CP0_INTCTL | 32
2097− MIPS | KVM_REG_MIPS_CP0_CAUSE | 32
2098− MIPS | KVM_REG_MIPS_CP0_EPC | 64
2099− MIPS | KVM_REG_MIPS_CP0_PRID | 32
2100− MIPS | KVM_REG_MIPS_CP0_EBASE | 64
2101− MIPS | KVM_REG_MIPS_CP0_CONFIG | 32
2102− MIPS | KVM_REG_MIPS_CP0_CONFIG1 | 32
2103− MIPS | KVM_REG_MIPS_CP0_CONFIG2 | 32
2104− MIPS | KVM_REG_MIPS_CP0_CONFIG3 | 32
2105− MIPS | KVM_REG_MIPS_CP0_CONFIG4 | 32
2106− MIPS | KVM_REG_MIPS_CP0_CONFIG5 | 32
2107− MIPS | KVM_REG_MIPS_CP0_CONFIG7 | 32
2108− MIPS | KVM_REG_MIPS_CP0_XCONTEXT | 64
2109− MIPS | KVM_REG_MIPS_CP0_ERROREPC | 64
2110− MIPS | KVM_REG_MIPS_CP0_KSCRATCH1 | 64
2111− MIPS | KVM_REG_MIPS_CP0_KSCRATCH2 | 64
2112− MIPS | KVM_REG_MIPS_CP0_KSCRATCH3 | 64
2113− MIPS | KVM_REG_MIPS_CP0_KSCRATCH4 | 64
2114− MIPS | KVM_REG_MIPS_CP0_KSCRATCH5 | 64
2115− MIPS | KVM_REG_MIPS_CP0_KSCRATCH6 | 64
2116− MIPS | KVM_REG_MIPS_CP0_MAAR(0..63) | 64
2117− MIPS | KVM_REG_MIPS_COUNT_CTL | 64
2118− MIPS | KVM_REG_MIPS_COUNT_RESUME | 64
2119− MIPS | KVM_REG_MIPS_COUNT_HZ | 64
2120− MIPS | KVM_REG_MIPS_FPR_32(0..31) | 32
2121− MIPS | KVM_REG_MIPS_FPR_64(0..31) | 64
2122− MIPS | KVM_REG_MIPS_VEC_128(0..31) | 128
2123− MIPS | KVM_REG_MIPS_FCR_IR | 32
2124− MIPS | KVM_REG_MIPS_FCR_CSR | 32
2125− MIPS | KVM_REG_MIPS_MSA_IR | 32
2126− MIPS | KVM_REG_MIPS_MSA_CSR | 32
2142+ ======= =============================== ============
2143+ Arch Register Width (bits)
2144+ ======= =============================== ============
2145+ PPC KVM_REG_PPC_HIOR 64
2146+ PPC KVM_REG_PPC_IAC1 64
2147+ PPC KVM_REG_PPC_IAC2 64
2148+ PPC KVM_REG_PPC_IAC3 64
2149+ PPC KVM_REG_PPC_IAC4 64
2150+ PPC KVM_REG_PPC_DAC1 64
2151+ PPC KVM_REG_PPC_DAC2 64
2152+ PPC KVM_REG_PPC_DABR 64
2153+ PPC KVM_REG_PPC_DSCR 64
2154+ PPC KVM_REG_PPC_PURR 64
2155+ PPC KVM_REG_PPC_SPURR 64
2156+ PPC KVM_REG_PPC_DAR 64
2157+ PPC KVM_REG_PPC_DSISR 32
2158+ PPC KVM_REG_PPC_AMR 64
2159+ PPC KVM_REG_PPC_UAMOR 64
2160+ PPC KVM_REG_PPC_MMCR0 64
2161+ PPC KVM_REG_PPC_MMCR1 64
2162+ PPC KVM_REG_PPC_MMCRA 64
2163+ PPC KVM_REG_PPC_MMCR2 64
2164+ PPC KVM_REG_PPC_MMCRS 64
2165+ PPC KVM_REG_PPC_SIAR 64
2166+ PPC KVM_REG_PPC_SDAR 64
2167+ PPC KVM_REG_PPC_SIER 64
2168+ PPC KVM_REG_PPC_PMC1 32
2169+ PPC KVM_REG_PPC_PMC2 32
2170+ PPC KVM_REG_PPC_PMC3 32
2171+ PPC KVM_REG_PPC_PMC4 32
2172+ PPC KVM_REG_PPC_PMC5 32
2173+ PPC KVM_REG_PPC_PMC6 32
2174+ PPC KVM_REG_PPC_PMC7 32
2175+ PPC KVM_REG_PPC_PMC8 32
2176+ PPC KVM_REG_PPC_FPR0 64
2177+ ...
2178+ PPC KVM_REG_PPC_FPR31 64
2179+ PPC KVM_REG_PPC_VR0 128
2180+ ...
2181+ PPC KVM_REG_PPC_VR31 128
2182+ PPC KVM_REG_PPC_VSR0 128
2183+ ...
2184+ PPC KVM_REG_PPC_VSR31 128
2185+ PPC KVM_REG_PPC_FPSCR 64
2186+ PPC KVM_REG_PPC_VSCR 32
2187+ PPC KVM_REG_PPC_VPA_ADDR 64
2188+ PPC KVM_REG_PPC_VPA_SLB 128
2189+ PPC KVM_REG_PPC_VPA_DTL 128
2190+ PPC KVM_REG_PPC_EPCR 32
2191+ PPC KVM_REG_PPC_EPR 32
2192+ PPC KVM_REG_PPC_TCR 32
2193+ PPC KVM_REG_PPC_TSR 32
2194+ PPC KVM_REG_PPC_OR_TSR 32
2195+ PPC KVM_REG_PPC_CLEAR_TSR 32
2196+ PPC KVM_REG_PPC_MAS0 32
2197+ PPC KVM_REG_PPC_MAS1 32
2198+ PPC KVM_REG_PPC_MAS2 64
2199+ PPC KVM_REG_PPC_MAS7_3 64
2200+ PPC KVM_REG_PPC_MAS4 32
2201+ PPC KVM_REG_PPC_MAS6 32
2202+ PPC KVM_REG_PPC_MMUCFG 32
2203+ PPC KVM_REG_PPC_TLB0CFG 32
2204+ PPC KVM_REG_PPC_TLB1CFG 32
2205+ PPC KVM_REG_PPC_TLB2CFG 32
2206+ PPC KVM_REG_PPC_TLB3CFG 32
2207+ PPC KVM_REG_PPC_TLB0PS 32
2208+ PPC KVM_REG_PPC_TLB1PS 32
2209+ PPC KVM_REG_PPC_TLB2PS 32
2210+ PPC KVM_REG_PPC_TLB3PS 32
2211+ PPC KVM_REG_PPC_EPTCFG 32
2212+ PPC KVM_REG_PPC_ICP_STATE 64
2213+ PPC KVM_REG_PPC_VP_STATE 128
2214+ PPC KVM_REG_PPC_TB_OFFSET 64
2215+ PPC KVM_REG_PPC_SPMC1 32
2216+ PPC KVM_REG_PPC_SPMC2 32
2217+ PPC KVM_REG_PPC_IAMR 64
2218+ PPC KVM_REG_PPC_TFHAR 64
2219+ PPC KVM_REG_PPC_TFIAR 64
2220+ PPC KVM_REG_PPC_TEXASR 64
2221+ PPC KVM_REG_PPC_FSCR 64
2222+ PPC KVM_REG_PPC_PSPB 32
2223+ PPC KVM_REG_PPC_EBBHR 64
2224+ PPC KVM_REG_PPC_EBBRR 64
2225+ PPC KVM_REG_PPC_BESCR 64
2226+ PPC KVM_REG_PPC_TAR 64
2227+ PPC KVM_REG_PPC_DPDES 64
2228+ PPC KVM_REG_PPC_DAWR 64
2229+ PPC KVM_REG_PPC_DAWRX 64
2230+ PPC KVM_REG_PPC_CIABR 64
2231+ PPC KVM_REG_PPC_IC 64
2232+ PPC KVM_REG_PPC_VTB 64
2233+ PPC KVM_REG_PPC_CSIGR 64
2234+ PPC KVM_REG_PPC_TACR 64
2235+ PPC KVM_REG_PPC_TCSCR 64
2236+ PPC KVM_REG_PPC_PID 64
2237+ PPC KVM_REG_PPC_ACOP 64
2238+ PPC KVM_REG_PPC_VRSAVE 32
2239+ PPC KVM_REG_PPC_LPCR 32
2240+ PPC KVM_REG_PPC_LPCR_64 64
2241+ PPC KVM_REG_PPC_PPR 64
2242+ PPC KVM_REG_PPC_ARCH_COMPAT 32
2243+ PPC KVM_REG_PPC_DABRX 32
2244+ PPC KVM_REG_PPC_WORT 64
2245+ PPC KVM_REG_PPC_SPRG9 64
2246+ PPC KVM_REG_PPC_DBSR 32
2247+ PPC KVM_REG_PPC_TIDR 64
2248+ PPC KVM_REG_PPC_PSSCR 64
2249+ PPC KVM_REG_PPC_DEC_EXPIRY 64
2250+ PPC KVM_REG_PPC_PTCR 64
2251+ PPC KVM_REG_PPC_TM_GPR0 64
2252+ ...
2253+ PPC KVM_REG_PPC_TM_GPR31 64
2254+ PPC KVM_REG_PPC_TM_VSR0 128
2255+ ...
2256+ PPC KVM_REG_PPC_TM_VSR63 128
2257+ PPC KVM_REG_PPC_TM_CR 64
2258+ PPC KVM_REG_PPC_TM_LR 64
2259+ PPC KVM_REG_PPC_TM_CTR 64
2260+ PPC KVM_REG_PPC_TM_FPSCR 64
2261+ PPC KVM_REG_PPC_TM_AMR 64
2262+ PPC KVM_REG_PPC_TM_PPR 64
2263+ PPC KVM_REG_PPC_TM_VRSAVE 64
2264+ PPC KVM_REG_PPC_TM_VSCR 32
2265+ PPC KVM_REG_PPC_TM_DSCR 64
2266+ PPC KVM_REG_PPC_TM_TAR 64
2267+ PPC KVM_REG_PPC_TM_XER 64
2268+
2269+ MIPS KVM_REG_MIPS_R0 64
2270+ ...
2271+ MIPS KVM_REG_MIPS_R31 64
2272+ MIPS KVM_REG_MIPS_HI 64
2273+ MIPS KVM_REG_MIPS_LO 64
2274+ MIPS KVM_REG_MIPS_PC 64
2275+ MIPS KVM_REG_MIPS_CP0_INDEX 32
2276+ MIPS KVM_REG_MIPS_CP0_ENTRYLO0 64
2277+ MIPS KVM_REG_MIPS_CP0_ENTRYLO1 64
2278+ MIPS KVM_REG_MIPS_CP0_CONTEXT 64
2279+ MIPS KVM_REG_MIPS_CP0_CONTEXTCONFIG 32
2280+ MIPS KVM_REG_MIPS_CP0_USERLOCAL 64
2281+ MIPS KVM_REG_MIPS_CP0_XCONTEXTCONFIG 64
2282+ MIPS KVM_REG_MIPS_CP0_PAGEMASK 32
2283+ MIPS KVM_REG_MIPS_CP0_PAGEGRAIN 32
2284+ MIPS KVM_REG_MIPS_CP0_SEGCTL0 64
2285+ MIPS KVM_REG_MIPS_CP0_SEGCTL1 64
2286+ MIPS KVM_REG_MIPS_CP0_SEGCTL2 64
2287+ MIPS KVM_REG_MIPS_CP0_PWBASE 64
2288+ MIPS KVM_REG_MIPS_CP0_PWFIELD 64
2289+ MIPS KVM_REG_MIPS_CP0_PWSIZE 64
2290+ MIPS KVM_REG_MIPS_CP0_WIRED 32
2291+ MIPS KVM_REG_MIPS_CP0_PWCTL 32
2292+ MIPS KVM_REG_MIPS_CP0_HWRENA 32
2293+ MIPS KVM_REG_MIPS_CP0_BADVADDR 64
2294+ MIPS KVM_REG_MIPS_CP0_BADINSTR 32
2295+ MIPS KVM_REG_MIPS_CP0_BADINSTRP 32
2296+ MIPS KVM_REG_MIPS_CP0_COUNT 32
2297+ MIPS KVM_REG_MIPS_CP0_ENTRYHI 64
2298+ MIPS KVM_REG_MIPS_CP0_COMPARE 32
2299+ MIPS KVM_REG_MIPS_CP0_STATUS 32
2300+ MIPS KVM_REG_MIPS_CP0_INTCTL 32
2301+ MIPS KVM_REG_MIPS_CP0_CAUSE 32
2302+ MIPS KVM_REG_MIPS_CP0_EPC 64
2303+ MIPS KVM_REG_MIPS_CP0_PRID 32
2304+ MIPS KVM_REG_MIPS_CP0_EBASE 64
2305+ MIPS KVM_REG_MIPS_CP0_CONFIG 32
2306+ MIPS KVM_REG_MIPS_CP0_CONFIG1 32
2307+ MIPS KVM_REG_MIPS_CP0_CONFIG2 32
2308+ MIPS KVM_REG_MIPS_CP0_CONFIG3 32
2309+ MIPS KVM_REG_MIPS_CP0_CONFIG4 32
2310+ MIPS KVM_REG_MIPS_CP0_CONFIG5 32
2311+ MIPS KVM_REG_MIPS_CP0_CONFIG7 32
2312+ MIPS KVM_REG_MIPS_CP0_XCONTEXT 64
2313+ MIPS KVM_REG_MIPS_CP0_ERROREPC 64
2314+ MIPS KVM_REG_MIPS_CP0_KSCRATCH1 64
2315+ MIPS KVM_REG_MIPS_CP0_KSCRATCH2 64
2316+ MIPS KVM_REG_MIPS_CP0_KSCRATCH3 64
2317+ MIPS KVM_REG_MIPS_CP0_KSCRATCH4 64
2318+ MIPS KVM_REG_MIPS_CP0_KSCRATCH5 64
2319+ MIPS KVM_REG_MIPS_CP0_KSCRATCH6 64
2320+ MIPS KVM_REG_MIPS_CP0_MAAR(0..63) 64
2321+ MIPS KVM_REG_MIPS_COUNT_CTL 64
2322+ MIPS KVM_REG_MIPS_COUNT_RESUME 64
2323+ MIPS KVM_REG_MIPS_COUNT_HZ 64
2324+ MIPS KVM_REG_MIPS_FPR_32(0..31) 32
2325+ MIPS KVM_REG_MIPS_FPR_64(0..31) 64
2326+ MIPS KVM_REG_MIPS_VEC_128(0..31) 128
2327+ MIPS KVM_REG_MIPS_FCR_IR 32
2328+ MIPS KVM_REG_MIPS_FCR_CSR 32
2329+ MIPS KVM_REG_MIPS_MSA_IR 32
2330+ MIPS KVM_REG_MIPS_MSA_CSR 32
2331+ ======= =============================== ============
21272332
21282333 ARM registers are mapped using the lower 32 bits. The upper 16 of that
21292334 is the register group type, or coprocessor number:
21302335
2131−ARM core registers have the following id bit patterns:
2336+ARM core registers have the following id bit patterns::
2337+
21322338 0x4020 0000 0010 <index into the kvm_regs struct:16>
21332339
2134−ARM 32-bit CP15 registers have the following id bit patterns:
2340+ARM 32-bit CP15 registers have the following id bit patterns::
2341+
21352342 0x4020 0000 000F <zero:1> <crn:4> <crm:4> <opc1:4> <opc2:3>
21362343
2137−ARM 64-bit CP15 registers have the following id bit patterns:
2344+ARM 64-bit CP15 registers have the following id bit patterns::
2345+
21382346 0x4030 0000 000F <zero:1> <zero:4> <crm:4> <opc1:4> <zero:3>
21392347
2140−ARM CCSIDR registers are demultiplexed by CSSELR value:
2348+ARM CCSIDR registers are demultiplexed by CSSELR value::
2349+
21412350 0x4020 0000 0011 00 <csselr:8>
21422351
2143−ARM 32-bit VFP control registers have the following id bit patterns:
2352+ARM 32-bit VFP control registers have the following id bit patterns::
2353+
21442354 0x4020 0000 0012 1 <regno:12>
21452355
2146−ARM 64-bit FP registers have the following id bit patterns:
2356+ARM 64-bit FP registers have the following id bit patterns::
2357+
21472358 0x4030 0000 0012 0 <regno:12>
21482359
2149−ARM firmware pseudo-registers have the following bit pattern:
2360+ARM firmware pseudo-registers have the following bit pattern::
2361+
21502362 0x4030 0000 0014 <regno:16>
21512363
21522364
@@ -2156,15 +2368,18 @@ that is the register group type, or coprocessor number: · 3 unmodified lines
21562368 arm64 core/FP-SIMD registers have the following id bit patterns. Note
21572369 that the size of the access is variable, as the kvm_regs structure
21582370 contains elements ranging from 32 to 128 bits. The index is a 32bit
2159−value in the kvm_regs structure seen as a 32bit array.
2371+value in the kvm_regs structure seen as a 32bit array::
2372+
21602373 0x60x0 0000 0010 <index into the kvm_regs struct:16>
21612374
21622375 Specifically:
2376+
2377+======================= ========= ===== =======================================
21632378 Encoding Register Bits kvm_regs member
2164−----------------------------------------------------------------
2379+======================= ========= ===== =======================================
21652380 0x6030 0000 0010 0000 X0 64 regs.regs[0]
21662381 0x6030 0000 0010 0002 X1 64 regs.regs[1]
2167− ...
2382+ ...
21682383 0x6030 0000 0010 003c X30 64 regs.regs[30]
21692384 0x6030 0000 0010 003e SP 64 regs.sp
21702385 0x6030 0000 0010 0040 PC 64 regs.pc
@@ -2176,27 +2391,31 @@ Specifically: · 5 unmodified lines
21762391 0x6030 0000 0010 004c SPSR_UND 64 spsr[KVM_SPSR_UND]
21772392 0x6030 0000 0010 004e SPSR_IRQ 64 spsr[KVM_SPSR_IRQ]
21782393 0x6060 0000 0010 0050 SPSR_FIQ 64 spsr[KVM_SPSR_FIQ]
2179− 0x6040 0000 0010 0054 V0 128 fp_regs.vregs[0] (*)
2180− 0x6040 0000 0010 0058 V1 128 fp_regs.vregs[1] (*)
2181− ...
2182− 0x6040 0000 0010 00d0 V31 128 fp_regs.vregs[31] (*)
2394+ 0x6040 0000 0010 0054 V0 128 fp_regs.vregs[0] [1]_
2395+ 0x6040 0000 0010 0058 V1 128 fp_regs.vregs[1] [1]_
2396+ ...
2397+ 0x6040 0000 0010 00d0 V31 128 fp_regs.vregs[31] [1]_
21832398 0x6020 0000 0010 00d4 FPSR 32 fp_regs.fpsr
21842399 0x6020 0000 0010 00d5 FPCR 32 fp_regs.fpcr
2400+======================= ========= ===== =======================================
2401+
2402+.. [1] These encodings are not accepted for SVE-enabled vcpus. See
2403+ KVM_ARM_VCPU_INIT.
21852404
2186−(*) These encodings are not accepted for SVE-enabled vcpus. See
2187− KVM_ARM_VCPU_INIT.
2405+ The equivalent register content can be accessed via bits [127:0] of
2406+ the corresponding SVE Zn registers instead for vcpus that have SVE
2407+ enabled (see below).
21882408
2189− The equivalent register content can be accessed via bits [127:0] of
2190− the corresponding SVE Zn registers instead for vcpus that have SVE
2191− enabled (see below).
2409+arm64 CCSIDR registers are demultiplexed by CSSELR value::
21922410
2193−arm64 CCSIDR registers are demultiplexed by CSSELR value:
21942411 0x6020 0000 0011 00 <csselr:8>
21952412
2196−arm64 system registers have the following id bit patterns:
2413+arm64 system registers have the following id bit patterns::
2414+
21972415 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>
21982416
2199−WARNING:
2417+.. warning::
2418+
22002419 Two system register IDs do not follow the specified pattern. These
22012420 are KVM_REG_ARM_TIMER_CVAL and KVM_REG_ARM_TIMER_CNT, which map to
22022421 system registers CNTV_CVAL_EL0 and CNTVCT_EL0 respectively. These
@@ -2205,10 +2424,12 @@ WARNING: · 2 unmodified lines
22052424 derived from the register encoding for CNTV_CVAL_EL0. As this is
22062425 API, it must remain this way.
22072426
2208−arm64 firmware pseudo-registers have the following bit pattern:
2427+arm64 firmware pseudo-registers have the following bit pattern::
2428+
22092429 0x6030 0000 0014 <regno:16>
22102430
2211−arm64 SVE registers have the following bit patterns:
2431+arm64 SVE registers have the following bit patterns::
2432+
22122433 0x6080 0000 0015 00 <n:5> <slice:5> Zn bits[2048*slice + 2047 : 2048*slice]
22132434 0x6050 0000 0015 04 <n:4> <slice:5> Pn bits[256*slice + 255 : 256*slice]
22142435 0x6050 0000 0015 060 <slice:5> FFR bits[256*slice + 255 : 256*slice]
@@ -2216,7 +2437,7 @@ arm64 SVE registers have the following bit patterns: · 1 unmodified line
22162437
22172438 Access to register IDs where 2048 * slice >= 128 * max_vq will fail with
22182439 ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit
2219−quadwords: see (**) below.
2440+quadwords: see [2]_ below.
22202441
22212442 These registers are only accessible on vcpus for which SVE is enabled.
22222443 See KVM_ARM_VCPU_INIT for details.
@@ -2231,21 +2452,21 @@ lengths supported by the vcpu to be discovered and configured by · 8 unmodified lines
22312452 userspace. When transferred to or from user memory via KVM_GET_ONE_REG
22322453 or KVM_SET_ONE_REG, the value of this register is of type
22332454 __u64[KVM_ARM64_SVE_VLS_WORDS], and encodes the set of vector lengths as
2234−follows:
2455+follows::
22352456
2236−__u64 vector_lengths[KVM_ARM64_SVE_VLS_WORDS];
2457+ __u64 vector_lengths[KVM_ARM64_SVE_VLS_WORDS];
22372458
2238−if (vq >= SVE_VQ_MIN && vq <= SVE_VQ_MAX &&
2239− ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>
2459+ if (vq >= SVE_VQ_MIN && vq <= SVE_VQ_MAX &&
2460+ ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>
22402461 ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1))
22412462 /* Vector length vq * 16 bytes supported */
2242−else
2463+ else
22432464 /* Vector length vq * 16 bytes not supported */
22442465
2245−(**) The maximum value vq for which the above condition is true is
2246−max_vq. This is the maximum vector length available to the guest on
2247−this vcpu, and determines which register slices are visible through
2248−this ioctl interface.
2466+.. [2] The maximum value vq for which the above condition is true is
2467+ max_vq. This is the maximum vector length available to the guest on
2468+ this vcpu, and determines which register slices are visible through
2469+ this ioctl interface.
22492470
22502471 (See Documentation/arm64/sve.rst for an explanation of the "vq"
22512472 nomenclature.)
@@ -2270,11 +2491,13 @@ write this register will fail with EPERM. · 18 unmodified lines
22702491 MIPS registers are mapped using the lower 32 bits. The upper 16 of that is
22712492 the register group type:
22722493
2273−MIPS core registers (see above) have the following id bit patterns:
2494+MIPS core registers (see above) have the following id bit patterns::
2495+
22742496 0x7030 0000 0000 <reg:16>
22752497
22762498 MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit
2277−patterns depending on whether they're 32-bit or 64-bit registers:
2499+patterns depending on whether they're 32-bit or 64-bit registers::
2500+
22782501 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)
22792502 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)
22802503
@@ -2285,10 +2508,12 @@ with the RI and XI bits (if they exist) in bits 63 and 62 respectively, and · 4 unmodified lines
22852508 the PFNX field starting at bit 30.
22862509
22872510 MIPS MAARs (see KVM_REG_MIPS_CP0_MAAR(*) above) have the following id bit
2288−patterns:
2511+patterns::
2512+
22892513 0x7030 0000 0001 01 <reg:8>
22902514
2291−MIPS KVM control registers (see above) have the following id bit patterns:
2515+MIPS KVM control registers (see above) have the following id bit patterns::
2516+
22922517 0x7030 0000 0002 <reg:16>
22932518
22942519 MIPS FPU registers (see KVM_REG_MIPS_FPR_{32,64}() above) have the following
@@ -2297,31 +2522,40 @@ always accessed according to the current guest FPU mode (Status.FR and · 2 unmodified lines
22972522 Config5.FRE), i.e. as the guest would see them, and they become unpredictable
22982523 if the guest FPU mode is changed. MIPS SIMD Architecture (MSA) vector
22992524 registers (see KVM_REG_MIPS_VEC_128() above) have similar patterns as they
2300−overlap the FPU registers:
2525+overlap the FPU registers::
2526+
23012527 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers)
23022528 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers)
23032529 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers)
23042530
23052531 MIPS FPU control registers (see KVM_REG_MIPS_FCR_{IR,CSR} above) have the
2306−following id bit patterns:
2532+following id bit patterns::
2533+
23072534 0x7020 0000 0003 01 <0:3> <reg:5>
23082535
23092536 MIPS MSA control registers (see KVM_REG_MIPS_MSA_{IR,CSR} above) have the
2310−following id bit patterns:
2537+following id bit patterns::
2538+
23112539 0x7020 0000 0003 02 <0:3> <reg:5>
23122540
23132541
23142542 4.69 KVM_GET_ONE_REG
2543+--------------------
2544+
2545+:Capability: KVM_CAP_ONE_REG
2546+:Architectures: all
2547+:Type: vcpu ioctl
2548+:Parameters: struct kvm_one_reg (in and out)
2549+:Returns: 0 on success, negative value on failure
23152550
2316−Capability: KVM_CAP_ONE_REG
2317−Architectures: all
2318−Type: vcpu ioctl
2319−Parameters: struct kvm_one_reg (in and out)
2320−Returns: 0 on success, negative value on failure
23212551 Errors include:
2322−  ENOENT:   no such register
2323−  EINVAL:   invalid register ID, or no such register
2324−  EPERM:    (arm64) register access not allowed before vcpu finalization
2552+
2553+ ======== ============================================================
2554+  ENOENT   no such register
2555+  EINVAL   invalid register ID, or no such register
2556+  EPERM    (arm64) register access not allowed before vcpu finalization
2557+ ======== ============================================================
2558+
23252559 (These error codes are indicative only: do not rely on a specific error
23262560 code being returned in a specific situation.)
23272561
@@ -2335,12 +2569,13 @@ list in 4.68. · 7 unmodified lines
23352569
23362570
23372571 4.70 KVM_KVMCLOCK_CTRL
2572+----------------------
23382573
2339−Capability: KVM_CAP_KVMCLOCK_CTRL
2340−Architectures: Any that implement pvclocks (currently x86 only)
2341−Type: vcpu ioctl
2342−Parameters: None
2343−Returns: 0 on success, -1 on error
2574+:Capability: KVM_CAP_KVMCLOCK_CTRL
2575+:Architectures: Any that implement pvclocks (currently x86 only)
2576+:Type: vcpu ioctl
2577+:Parameters: None
2578+:Returns: 0 on success, -1 on error
23442579
23452580 This signals to the host kernel that the specified guest is being paused by
23462581 userspace. The host will set a flag in the pvclock structure that is checked
@@ -2356,26 +2591,30 @@ after pausing the vcpu, but before it is resumed. · 9 unmodified lines
23562591
23572592
23582593 4.71 KVM_SIGNAL_MSI
2594+-------------------
23592595
2360−Capability: KVM_CAP_SIGNAL_MSI
2361−Architectures: x86 arm arm64
2362−Type: vm ioctl
2363−Parameters: struct kvm_msi (in)
2364−Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error
2596+:Capability: KVM_CAP_SIGNAL_MSI
2597+:Architectures: x86 arm arm64
2598+:Type: vm ioctl
2599+:Parameters: struct kvm_msi (in)
2600+:Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error
23652601
23662602 Directly inject a MSI message. Only valid with in-kernel irqchip that handles
23672603 MSI messages.
23682604
2369−struct kvm_msi {
2605+::
2606+
2607+ struct kvm_msi {
23702608 __u32 address_lo;
23712609 __u32 address_hi;
23722610 __u32 data;
23732611 __u32 flags;
23742612 __u32 devid;
23752613 __u8 pad[12];
2376−};
2614+ };
23772615
2378−flags: KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
2616+flags:
2617+ KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
23792618 KVM_CAP_MSI_DEVID capability advertises the requirement to provide
23802619 the device ID. If this capability is not available, userspace
23812620 should never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.
@@ -2391,30 +2630,31 @@ address_hi must be zero. · 9 unmodified lines
23912630
23922631
23932632 4.71 KVM_CREATE_PIT2
2633+--------------------
23942634
2395−Capability: KVM_CAP_PIT2
2396−Architectures: x86
2397−Type: vm ioctl
2398−Parameters: struct kvm_pit_config (in)
2399−Returns: 0 on success, -1 on error
2635+:Capability: KVM_CAP_PIT2
2636+:Architectures: x86
2637+:Type: vm ioctl
2638+:Parameters: struct kvm_pit_config (in)
2639+:Returns: 0 on success, -1 on error
24002640
24012641 Creates an in-kernel device model for the i8254 PIT. This call is only valid
24022642 after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following
2403−parameters have to be passed:
2643+parameters have to be passed::
24042644
2405−struct kvm_pit_config {
2645+ struct kvm_pit_config {
24062646 __u32 flags;
24072647 __u32 pad[15];
2408−};
2648+ };
24092649
2410−Valid flags are:
2650+Valid flags are::
24112651
2412−#define KVM_PIT_SPEAKER_DUMMY 1 /* emulate speaker port stub */
2652+ #define KVM_PIT_SPEAKER_DUMMY 1 /* emulate speaker port stub */
24132653
24142654 PIT timer interrupts may use a per-VM kernel thread for injection. If it
2415−exists, this thread will have a name of the following pattern:
2655+exists, this thread will have a name of the following pattern::
24162656
2417−kvm-pit/<owner-process-pid>
2657+ kvm-pit/<owner-process-pid>
24182658
24192659 When running a guest with elevated priorities, the scheduling parameters of
24202660 this thread may have to be adjusted accordingly.
@@ -2423,37 +2663,39 @@ This IOCTL replaces the obsolete KVM_CREATE_PIT. · 2 unmodified lines
24232663
24242664
24252665 4.72 KVM_GET_PIT2
2666+-----------------
24262667
2427−Capability: KVM_CAP_PIT_STATE2
2428−Architectures: x86
2429−Type: vm ioctl
2430−Parameters: struct kvm_pit_state2 (out)
2431−Returns: 0 on success, -1 on error
2668+:Capability: KVM_CAP_PIT_STATE2
2669+:Architectures: x86
2670+:Type: vm ioctl
2671+:Parameters: struct kvm_pit_state2 (out)
2672+:Returns: 0 on success, -1 on error
24322673
24332674 Retrieves the state of the in-kernel PIT model. Only valid after
2434−KVM_CREATE_PIT2. The state is returned in the following structure:
2675+KVM_CREATE_PIT2. The state is returned in the following structure::
24352676
2436−struct kvm_pit_state2 {
2677+ struct kvm_pit_state2 {
24372678 struct kvm_pit_channel_state channels[3];
24382679 __u32 flags;
24392680 __u32 reserved[9];
2440−};
2681+ };
24412682
2442−Valid flags are:
2683+Valid flags are::
24432684
2444−/* disable PIT in HPET legacy mode */
2445−#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
2685+ /* disable PIT in HPET legacy mode */
2686+ #define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
24462687
24472688 This IOCTL replaces the obsolete KVM_GET_PIT.
24482689
24492690
24502691 4.73 KVM_SET_PIT2
2692+-----------------
24512693
2452−Capability: KVM_CAP_PIT_STATE2
2453−Architectures: x86
2454−Type: vm ioctl
2455−Parameters: struct kvm_pit_state2 (in)
2456−Returns: 0 on success, -1 on error
2694+:Capability: KVM_CAP_PIT_STATE2
2695+:Architectures: x86
2696+:Type: vm ioctl
2697+:Parameters: struct kvm_pit_state2 (in)
2698+:Returns: 0 on success, -1 on error
24572699
24582700 Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2.
24592701 See KVM_GET_PIT2 for details on struct kvm_pit_state2.
@@ -2462,12 +2704,13 @@ This IOCTL replaces the obsolete KVM_SET_PIT. · 2 unmodified lines
24622704
24632705
24642706 4.74 KVM_PPC_GET_SMMU_INFO
2707+--------------------------
24652708
2466−Capability: KVM_CAP_PPC_GET_SMMU_INFO
2467−Architectures: powerpc
2468−Type: vm ioctl
2469−Parameters: None
2470−Returns: 0 on success, -1 on error
2709+:Capability: KVM_CAP_PPC_GET_SMMU_INFO
2710+:Architectures: powerpc
2711+:Type: vm ioctl
2712+:Parameters: None
2713+:Returns: 0 on success, -1 on error
24712714
24722715 This populates and returns a structure describing the features of
24732716 the "Server" class MMU emulation supported by KVM.
@@ -2475,7 +2718,7 @@ This can in turn be used by userspace to generate the appropriate · 1 unmodified line
24752718 device-tree properties for the guest operating system.
24762719
24772720 The structure contains some global information, followed by an
2478−array of supported segment page sizes:
2721+array of supported segment page sizes::
24792722
24802723 struct kvm_ppc_smmu_info {
24812724 __u64 flags;
@@ -2503,7 +2746,7 @@ The "slb_size" field indicates how many SLB entries are supported · 21 unmodified lines
25032746
25042747 The "sps" array contains 8 entries indicating the supported base
25052748 page sizes for a segment in increasing order. Each entry is defined
2506−as follow:
2749+as follow::
25072750
25082751 struct kvm_ppc_one_seg_page_size {
25092752 __u32 page_shift; /* Base page shift of segment (or 0) */
@@ -2524,7 +2767,7 @@ size provides the list of supported actual page sizes (which can be · 14 unmodified lines
25242767 only larger or equal to the base page size), along with the
25252768 corresponding encoding in the hash PTE. Similarly, the array is
25262769 8 entries sorted by increasing sizes and an entry with a "0" shift
2527−is an empty entry and a terminator:
2770+is an empty entry and a terminator::
25282771
25292772 struct kvm_ppc_one_page_size {
25302773 __u32 page_shift; /* Page shift (or 0) */
@@ -2536,12 +2779,13 @@ PTE's RPN field (ie, it needs to be shifted left by 12 to OR it · 5 unmodified lines
25362779 into the hash PTE second double word).
25372780
25382781 4.75 KVM_IRQFD
2782+--------------
25392783
2540−Capability: KVM_CAP_IRQFD
2541−Architectures: x86 s390 arm arm64
2542−Type: vm ioctl
2543−Parameters: struct kvm_irqfd (in)
2544−Returns: 0 on success, -1 on error
2784+:Capability: KVM_CAP_IRQFD
2785+:Architectures: x86 s390 arm arm64
2786+:Type: vm ioctl
2787+:Parameters: struct kvm_irqfd (in)
2788+:Returns: 0 on success, -1 on error
25452789
25462790 Allows setting an eventfd to directly trigger a guest interrupt.
25472791 kvm_irqfd.fd specifies the file descriptor to use as the eventfd and
@@ -2565,6 +2809,7 @@ irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment · 17 unmodified lines
25652809 and need not be specified with KVM_IRQFD_FLAG_DEASSIGN.
25662810
25672811 On arm/arm64, gsi routing being supported, the following can happen:
2812+
25682813 - in case no routing entry is associated to this gsi, injection fails
25692814 - in case the gsi is associated to an irqchip routing entry,
25702815 irqchip.pin + 32 corresponds to the injected SPI ID.
@@ -2573,12 +2818,13 @@ On arm/arm64, gsi routing being supported, the following can happen: · 2 unmodified lines
25732818 to GICv3 ITS in-kernel emulation).
25742819
25752820 4.76 KVM_PPC_ALLOCATE_HTAB
2821+--------------------------
25762822
2577−Capability: KVM_CAP_PPC_ALLOC_HTAB
2578−Architectures: powerpc
2579−Type: vm ioctl
2580−Parameters: Pointer to u32 containing hash table order (in/out)
2581−Returns: 0 on success, -1 on error
2823+:Capability: KVM_CAP_PPC_ALLOC_HTAB
2824+:Architectures: powerpc
2825+:Type: vm ioctl
2826+:Parameters: Pointer to u32 containing hash table order (in/out)
2827+:Returns: 0 on success, -1 on error
25822828
25832829 This requests the host kernel to allocate an MMU hash table for a
25842830 guest using the PAPR paravirtualization interface. This only does
@@ -2609,75 +2855,88 @@ real-mode area (VRMA) facility, the kernel will re-create the VMRA · 24 unmodified lines
26092855 HPTEs on the next KVM_RUN of any vcpu.
26102856
26112857 4.77 KVM_S390_INTERRUPT
2858+-----------------------
26122859
2613−Capability: basic
2614−Architectures: s390
2615−Type: vm ioctl, vcpu ioctl
2616−Parameters: struct kvm_s390_interrupt (in)
2617−Returns: 0 on success, -1 on error
2860+:Capability: basic
2861+:Architectures: s390
2862+:Type: vm ioctl, vcpu ioctl
2863+:Parameters: struct kvm_s390_interrupt (in)
2864+:Returns: 0 on success, -1 on error
26182865
26192866 Allows to inject an interrupt to the guest. Interrupts can be floating
26202867 (vm ioctl) or per cpu (vcpu ioctl), depending on the interrupt type.
26212868
2622−Interrupt parameters are passed via kvm_s390_interrupt:
2869+Interrupt parameters are passed via kvm_s390_interrupt::
26232870
2624−struct kvm_s390_interrupt {
2871+ struct kvm_s390_interrupt {
26252872 __u32 type;
26262873 __u32 parm;
26272874 __u64 parm64;
2628−};
2875+ };
26292876
26302877 type can be one of the following:
26312878
2632−KVM_S390_SIGP_STOP (vcpu) - sigp stop; optional flags in parm
2633−KVM_S390_PROGRAM_INT (vcpu) - program check; code in parm
2634−KVM_S390_SIGP_SET_PREFIX (vcpu) - sigp set prefix; prefix address in parm
2635−KVM_S390_RESTART (vcpu) - restart
2636−KVM_S390_INT_CLOCK_COMP (vcpu) - clock comparator interrupt
2637−KVM_S390_INT_CPU_TIMER (vcpu) - CPU timer interrupt
2638−KVM_S390_INT_VIRTIO (vm) - virtio external interrupt; external interrupt
2639− parameters in parm and parm64
2640−KVM_S390_INT_SERVICE (vm) - sclp external interrupt; sclp parameter in parm
2641−KVM_S390_INT_EMERGENCY (vcpu) - sigp emergency; source cpu in parm
2642−KVM_S390_INT_EXTERNAL_CALL (vcpu) - sigp external call; source cpu in parm
2643−KVM_S390_INT_IO(ai,cssid,ssid,schid) (vm) - compound value to indicate an
2644− I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel);
2645− I/O interruption parameters in parm (subchannel) and parm64 (intparm,
2646− interruption subclass)
2647−KVM_S390_MCHK (vm, vcpu) - machine check interrupt; cr 14 bits in parm,
2648− machine check interrupt code in parm64 (note that
2649− machine checks needing further payload are not
2650− supported by this ioctl)
2879+KVM_S390_SIGP_STOP (vcpu)
2880+ - sigp stop; optional flags in parm
2881+KVM_S390_PROGRAM_INT (vcpu)
2882+ - program check; code in parm
2883+KVM_S390_SIGP_SET_PREFIX (vcpu)
2884+ - sigp set prefix; prefix address in parm
2885+KVM_S390_RESTART (vcpu)
2886+ - restart
2887+KVM_S390_INT_CLOCK_COMP (vcpu)
2888+ - clock comparator interrupt
2889+KVM_S390_INT_CPU_TIMER (vcpu)
2890+ - CPU timer interrupt
2891+KVM_S390_INT_VIRTIO (vm)
2892+ - virtio external interrupt; external interrupt
2893+ parameters in parm and parm64
2894+KVM_S390_INT_SERVICE (vm)
2895+ - sclp external interrupt; sclp parameter in parm
2896+KVM_S390_INT_EMERGENCY (vcpu)
2897+ - sigp emergency; source cpu in parm
2898+KVM_S390_INT_EXTERNAL_CALL (vcpu)
2899+ - sigp external call; source cpu in parm
2900+KVM_S390_INT_IO(ai,cssid,ssid,schid) (vm)
2901+ - compound value to indicate an
2902+ I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel);
2903+ I/O interruption parameters in parm (subchannel) and parm64 (intparm,
2904+ interruption subclass)
2905+KVM_S390_MCHK (vm, vcpu)
2906+ - machine check interrupt; cr 14 bits in parm, machine check interrupt
2907+ code in parm64 (note that machine checks needing further payload are not
2908+ supported by this ioctl)
26512909
26522910 This is an asynchronous vcpu ioctl and can be invoked from any thread.
26532911
26542912 4.78 KVM_PPC_GET_HTAB_FD
2913+------------------------
26552914
2656−Capability: KVM_CAP_PPC_HTAB_FD
2657−Architectures: powerpc
2658−Type: vm ioctl
2659−Parameters: Pointer to struct kvm_get_htab_fd (in)
2660−Returns: file descriptor number (>= 0) on success, -1 on error
2915+:Capability: KVM_CAP_PPC_HTAB_FD
2916+:Architectures: powerpc
2917+:Type: vm ioctl
2918+:Parameters: Pointer to struct kvm_get_htab_fd (in)
2919+:Returns: file descriptor number (>= 0) on success, -1 on error
26612920
26622921 This returns a file descriptor that can be used either to read out the
26632922 entries in the guest's hashed page table (HPT), or to write entries to
26642923 initialize the HPT. The returned fd can only be written to if the
26652924 KVM_GET_HTAB_WRITE bit is set in the flags field of the argument, and
26662925 can only be read if that bit is clear. The argument struct looks like
2667−this:
2926+this::
26682927
2669−/* For KVM_PPC_GET_HTAB_FD */
2670−struct kvm_get_htab_fd {
2928+ /* For KVM_PPC_GET_HTAB_FD */
2929+ struct kvm_get_htab_fd {
26712930 __u64 flags;
26722931 __u64 start_index;
26732932 __u64 reserved[2];
2674−};
2933+ };
26752934
2676−/* Values for kvm_get_htab_fd.flags */
2677−#define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1)
2678−#define KVM_GET_HTAB_WRITE ((__u64)0x2)
2935+ /* Values for kvm_get_htab_fd.flags */
2936+ #define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1)
2937+ #define KVM_GET_HTAB_WRITE ((__u64)0x2)
26792938
2680−The `start_index' field gives the index in the HPT of the entry at
2939+The 'start_index' field gives the index in the HPT of the entry at
26812940 which to start reading. It is ignored when writing.
26822941
26832942 Reads on the fd will initially supply information about all
@@ -2692,29 +2951,34 @@ Data read or written is structured as a header (8 bytes) followed by a · 8 unmodified lines
26922951 series of valid HPT entries (16 bytes) each. The header indicates how
26932952 many valid HPT entries there are and how many invalid entries follow
26942953 the valid entries. The invalid entries are not represented explicitly
2695−in the stream. The header format is:
2954+in the stream. The header format is::
26962955
2697−struct kvm_get_htab_header {
2956+ struct kvm_get_htab_header {
26982957 __u32 index;
26992958 __u16 n_valid;
27002959 __u16 n_invalid;
2701−};
2960+ };
27022961
27032962 Writes to the fd create HPT entries starting at the index given in the
2704−header; first `n_valid' valid entries with contents from the data
2705−written, then `n_invalid' invalid entries, invalidating any previously
2963+header; first 'n_valid' valid entries with contents from the data
2964+written, then 'n_invalid' invalid entries, invalidating any previously
27062965 valid entries found.
27072966
27082967 4.79 KVM_CREATE_DEVICE
2968+----------------------
2969+
2970+:Capability: KVM_CAP_DEVICE_CTRL
2971+:Type: vm ioctl
2972+:Parameters: struct kvm_create_device (in/out)
2973+:Returns: 0 on success, -1 on error
27092974
2710−Capability: KVM_CAP_DEVICE_CTRL
2711−Type: vm ioctl
2712−Parameters: struct kvm_create_device (in/out)
2713−Returns: 0 on success, -1 on error
27142975 Errors:
2715− ENODEV: The device type is unknown or unsupported
2716− EEXIST: Device already created, and this type of device may not
2976+
2977+ ====== =======================================================
2978+ ENODEV The device type is unknown or unsupported
2979+ EEXIST Device already created, and this type of device may not
27172980 be instantiated multiple times
2981+ ====== =======================================================
27182982
27192983 Other error conditions may be defined by individual device types or
27202984 have their standard meanings.
@@ -2730,25 +2994,32 @@ Individual devices should not define flags. Attributes should be used · 9 unmodified lines
27302994 for specifying any behavior that is not implied by the device type
27312995 number.
27322996
2733−struct kvm_create_device {
2997+::
2998+
2999+ struct kvm_create_device {
27343000 __u32 type; /* in: KVM_DEV_TYPE_xxx */
27353001 __u32 fd; /* out: device handle */
27363002 __u32 flags; /* in: KVM_CREATE_DEVICE_xxx */
2737−};
3003+ };
27383004
27393005 4.80 KVM_SET_DEVICE_ATTR/KVM_GET_DEVICE_ATTR
3006+--------------------------------------------
3007+
3008+:Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
3009+ KVM_CAP_VCPU_ATTRIBUTES for vcpu device
3010+:Type: device ioctl, vm ioctl, vcpu ioctl
3011+:Parameters: struct kvm_device_attr
3012+:Returns: 0 on success, -1 on error
27403013
2741−Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
2742− KVM_CAP_VCPU_ATTRIBUTES for vcpu device
2743−Type: device ioctl, vm ioctl, vcpu ioctl
2744−Parameters: struct kvm_device_attr
2745−Returns: 0 on success, -1 on error
27463014 Errors:
2747− ENXIO: The group or attribute is unknown/unsupported for this device
3015+
3016+ ===== =============================================================
3017+ ENXIO The group or attribute is unknown/unsupported for this device
27483018 or hardware support is missing.
2749− EPERM: The attribute cannot (currently) be accessed this way
3019+ EPERM The attribute cannot (currently) be accessed this way
27503020 (e.g. read-only attribute, or attribute that only makes
27513021 sense when the device is in a different state)
3022+ ===== =============================================================
27523023
27533024 Other error conditions may be defined by individual device types.
27543025
@@ -2757,23 +3028,30 @@ semantics are device-specific. See individual device documentation in · 2 unmodified lines
27573028 the "devices" directory. As with ONE_REG, the size of the data
27583029 transferred is defined by the particular attribute.
27593030
2760−struct kvm_device_attr {
3031+::
3032+
3033+ struct kvm_device_attr {
27613034 __u32 flags; /* no flags currently defined */
27623035 __u32 group; /* device-defined */
27633036 __u64 attr; /* group-defined */
27643037 __u64 addr; /* userspace address of attr data */
2765−};
3038+ };
27663039
27673040 4.81 KVM_HAS_DEVICE_ATTR
3041+------------------------
3042+
3043+:Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
3044+ KVM_CAP_VCPU_ATTRIBUTES for vcpu device
3045+:Type: device ioctl, vm ioctl, vcpu ioctl
3046+:Parameters: struct kvm_device_attr
3047+:Returns: 0 on success, -1 on error
27683048
2769−Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
2770− KVM_CAP_VCPU_ATTRIBUTES for vcpu device
2771−Type: device ioctl, vm ioctl, vcpu ioctl
2772−Parameters: struct kvm_device_attr
2773−Returns: 0 on success, -1 on error
27743049 Errors:
2775− ENXIO: The group or attribute is unknown/unsupported for this device
3050+
3051+ ===== =============================================================
3052+ ENXIO The group or attribute is unknown/unsupported for this device
27763053 or hardware support is missing.
3054+ ===== =============================================================
27773055
27783056 Tests whether a device supports a particular attribute. A successful
27793057 return indicates the attribute is implemented. It does not necessarily
@@ -2781,15 +3059,20 @@ indicate that the attribute can be read or written in the device's · 1 unmodified line
27813059 current state. "addr" is ignored.
27823060
27833061 4.82 KVM_ARM_VCPU_INIT
3062+----------------------
3063+
3064+:Capability: basic
3065+:Architectures: arm, arm64
3066+:Type: vcpu ioctl
3067+:Parameters: struct kvm_vcpu_init (in)
3068+:Returns: 0 on success; -1 on error
27843069
2785−Capability: basic
2786−Architectures: arm, arm64
2787−Type: vcpu ioctl
2788−Parameters: struct kvm_vcpu_init (in)
2789−Returns: 0 on success; -1 on error
27903070 Errors:
2791−  EINVAL:    the target is unknown, or the combination of features is invalid.
2792−  ENOENT:    a features bit specified is unknown.
3071+
3072+ ====== =================================================================
3073+  EINVAL    the target is unknown, or the combination of features is invalid.
3074+  ENOENT    a features bit specified is unknown.
3075+ ====== =================================================================
27933076
27943077 This tells KVM what type of CPU to present to the guest, and what
27953078 optional features it should have.  This will cause a reset of the cpu
@@ -2805,6 +3088,7 @@ state. All calls to this function after the initial call must use the same · 9 unmodified lines
28053088 target and same set of feature flags, otherwise EINVAL will be returned.
28063089
28073090 Possible features:
3091+
28083092 - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
28093093 Depends on KVM_CAP_ARM_PSCI. If not set, the CPU will be powered on
28103094 and execute guest code when KVM_RUN is called.
@@ -2861,14 +3145,19 @@ Possible features: · 50 unmodified lines
28613145 no longer be written using KVM_SET_ONE_REG.
28623146
28633147 4.83 KVM_ARM_PREFERRED_TARGET
3148+-----------------------------
3149+
3150+:Capability: basic
3151+:Architectures: arm, arm64
3152+:Type: vm ioctl
3153+:Parameters: struct struct kvm_vcpu_init (out)
3154+:Returns: 0 on success; -1 on error
28643155
2865−Capability: basic
2866−Architectures: arm, arm64
2867−Type: vm ioctl
2868−Parameters: struct struct kvm_vcpu_init (out)
2869−Returns: 0 on success; -1 on error
28703156 Errors:
2871− ENODEV: no preferred target available for the host
3157+
3158+ ====== ==========================================
3159+ ENODEV no preferred target available for the host
3160+ ====== ==========================================
28723161
28733162 This queries KVM for preferred CPU target type which can be emulated
28743163 by KVM on underlying host.
@@ -2885,43 +3174,57 @@ in VCPU matching underlying host. · 10 unmodified lines
28853174
28863175
28873176 4.84 KVM_GET_REG_LIST
3177+---------------------
3178+
3179+:Capability: basic
3180+:Architectures: arm, arm64, mips
3181+:Type: vcpu ioctl
3182+:Parameters: struct kvm_reg_list (in/out)
3183+:Returns: 0 on success; -1 on error
28883184
2889−Capability: basic
2890−Architectures: arm, arm64, mips
2891−Type: vcpu ioctl
2892−Parameters: struct kvm_reg_list (in/out)
2893−Returns: 0 on success; -1 on error
28943185 Errors:
2895−  E2BIG:     the reg index list is too big to fit in the array specified by
3186+
3187+ ===== ==============================================================
3188+  E2BIG     the reg index list is too big to fit in the array specified by
28963189             the user (the number required will be written into n).
3190+ ===== ==============================================================
3191+
3192+::
28973193
2898−struct kvm_reg_list {
3194+ struct kvm_reg_list {
28993195 __u64 n; /* number of registers in reg[] */
29003196 __u64 reg[0];
2901−};
3197+ };
29023198
29033199 This ioctl returns the guest registers that are supported for the
29043200 KVM_GET_ONE_REG/KVM_SET_ONE_REG calls.
29053201
29063202
29073203 4.85 KVM_ARM_SET_DEVICE_ADDR (deprecated)
3204+-----------------------------------------
3205+
3206+:Capability: KVM_CAP_ARM_SET_DEVICE_ADDR
3207+:Architectures: arm, arm64
3208+:Type: vm ioctl
3209+:Parameters: struct kvm_arm_device_address (in)
3210+:Returns: 0 on success, -1 on error
29083211
2909−Capability: KVM_CAP_ARM_SET_DEVICE_ADDR
2910−Architectures: arm, arm64
2911−Type: vm ioctl
2912−Parameters: struct kvm_arm_device_address (in)
2913−Returns: 0 on success, -1 on error
29143212 Errors:
2915− ENODEV: The device id is unknown
2916− ENXIO: Device not supported on current system
2917− EEXIST: Address already set
2918− E2BIG: Address outside guest physical address space
2919− EBUSY: Address overlaps with other device range
29203213
2921−struct kvm_arm_device_addr {
3214+ ====== ============================================
3215+ ENODEV The device id is unknown
3216+ ENXIO Device not supported on current system
3217+ EEXIST Address already set
3218+ E2BIG Address outside guest physical address space
3219+ EBUSY Address overlaps with other device range
3220+ ====== ============================================
3221+
3222+::
3223+
3224+ struct kvm_arm_device_addr {
29223225 __u64 id;
29233226 __u64 addr;
2924−};
3227+ };
29253228
29263229 Specify a device address in the guest's physical address space where guests
29273230 can access emulated or directly exposed devices, which the host kernel needs
@@ -2929,7 +3232,7 @@ to know about. The id field is an architecture specific identifier for a · 1 unmodified line
29293232 specific device.
29303233
29313234 ARM/arm64 divides the id field into two parts, a device id and an
2932−address type id specific to the individual device.
3235+address type id specific to the individual device::
29333236
29343237  bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 |
29353238 field: | 0x00000000 | device id | addr type id |
@@ -2947,12 +3250,13 @@ should be used instead. · 11 unmodified lines
29473250
29483251
29493252 4.86 KVM_PPC_RTAS_DEFINE_TOKEN
3253+------------------------------
29503254
2951−Capability: KVM_CAP_PPC_RTAS
2952−Architectures: ppc
2953−Type: vm ioctl
2954−Parameters: struct kvm_rtas_token_args
2955−Returns: 0 on success, -1 on error
3255+:Capability: KVM_CAP_PPC_RTAS
3256+:Architectures: ppc
3257+:Type: vm ioctl
3258+:Parameters: struct kvm_rtas_token_args
3259+:Returns: 0 on success, -1 on error
29563260
29573261 Defines a token value for a RTAS (Run Time Abstraction Services)
29583262 service in order to allow it to be handled in the kernel. The
@@ -2966,18 +3270,21 @@ calls by the guest for that service will be passed to userspace to be · 7 unmodified lines
29663270 handled.
29673271
29683272 4.87 KVM_SET_GUEST_DEBUG
3273+------------------------
29693274
2970−Capability: KVM_CAP_SET_GUEST_DEBUG
2971−Architectures: x86, s390, ppc, arm64
2972−Type: vcpu ioctl
2973−Parameters: struct kvm_guest_debug (in)
2974−Returns: 0 on success; -1 on error
3275+:Capability: KVM_CAP_SET_GUEST_DEBUG
3276+:Architectures: x86, s390, ppc, arm64
3277+:Type: vcpu ioctl
3278+:Parameters: struct kvm_guest_debug (in)
3279+:Returns: 0 on success; -1 on error
29753280
2976−struct kvm_guest_debug {
3281+::
3282+
3283+ struct kvm_guest_debug {
29773284 __u32 control;
29783285 __u32 pad;
29793286 struct kvm_guest_debug_arch arch;
2980−};
3287+ };
29813288
29823289 Set up the processor specific debug registers and configure vcpu for
29833290 handling guest debug events. There are two parts to the structure, the
@@ -3019,26 +3326,31 @@ KVM_EXIT_DEBUG with the kvm_debug_exit_arch part of the kvm_run · 35 unmodified lines
30193326 structure containing architecture specific debug information.
30203327
30213328 4.88 KVM_GET_EMULATED_CPUID
3329+---------------------------
3330+
3331+:Capability: KVM_CAP_EXT_EMUL_CPUID
3332+:Architectures: x86
3333+:Type: system ioctl
3334+:Parameters: struct kvm_cpuid2 (in/out)
3335+:Returns: 0 on success, -1 on error
30223336
3023−Capability: KVM_CAP_EXT_EMUL_CPUID
3024−Architectures: x86
3025−Type: system ioctl
3026−Parameters: struct kvm_cpuid2 (in/out)
3027−Returns: 0 on success, -1 on error
3337+::
30283338
3029−struct kvm_cpuid2 {
3339+ struct kvm_cpuid2 {
30303340 __u32 nent;
30313341 __u32 flags;
30323342 struct kvm_cpuid_entry2 entries[0];
3033−};
3343+ };
30343344
30353345 The member 'flags' is used for passing flags from userspace.
30363346
3037−#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
3038−#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
3039−#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
3347+::
30403348
3041−struct kvm_cpuid_entry2 {
3349+ #define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
3350+ #define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
3351+ #define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
3352+
3353+ struct kvm_cpuid_entry2 {
30423354 __u32 function;
30433355 __u32 index;
30443356 __u32 flags;
@@ -3047,7 +3359,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines
30473359 __u32 ecx;
30483360 __u32 edx;
30493361 __u32 padding[3];
3050−};
3362+ };
30513363
30523364 This ioctl returns x86 cpuid features which are emulated by
30533365 kvm.Userspace can use the information returned by this ioctl to query
@@ -3072,10 +3384,14 @@ emulated efficiently and thus not included here. · 18 unmodified lines
30723384
30733385 The fields in each entry are defined as follows:
30743386
3075− function: the eax value used to obtain the entry
3076− index: the ecx value used to obtain the entry (for entries that are
3387+ function:
3388+ the eax value used to obtain the entry
3389+ index:
3390+ the ecx value used to obtain the entry (for entries that are
30773391 affected by ecx)
3078− flags: an OR of zero or more of the following:
3392+ flags:
3393+ an OR of zero or more of the following:
3394+
30793395 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
30803396 if the index field is valid
30813397 KVM_CPUID_FLAG_STATEFUL_FUNC:
@@ -3085,24 +3401,28 @@ The fields in each entry are defined as follows: · 3 unmodified lines
30853401 KVM_CPUID_FLAG_STATE_READ_NEXT:
30863402 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
30873403 the first entry to be read by a cpu
3088− eax, ebx, ecx, edx: the values returned by the cpuid instruction for
3404+
3405+ eax, ebx, ecx, edx:
3406+
3407+ the values returned by the cpuid instruction for
30893408 this function/index combination
30903409
30913410 4.89 KVM_S390_MEM_OP
3411+--------------------
30923412
3093−Capability: KVM_CAP_S390_MEM_OP
3094−Architectures: s390
3095−Type: vcpu ioctl
3096−Parameters: struct kvm_s390_mem_op (in)
3097−Returns: = 0 on success,
3098− < 0 on generic error (e.g. -EFAULT or -ENOMEM),
3099− > 0 if an exception occurred while walking the page tables
3413+:Capability: KVM_CAP_S390_MEM_OP
3414+:Architectures: s390
3415+:Type: vcpu ioctl
3416+:Parameters: struct kvm_s390_mem_op (in)
3417+:Returns: = 0 on success,
3418+ < 0 on generic error (e.g. -EFAULT or -ENOMEM),
3419+ > 0 if an exception occurred while walking the page tables
31003420
31013421 Read or write data from/to the logical (virtual) memory of a VCPU.
31023422
3103−Parameters are specified via the following structure:
3423+Parameters are specified via the following structure::
31043424
3105−struct kvm_s390_mem_op {
3425+ struct kvm_s390_mem_op {
31063426 __u64 gaddr; /* the guest address */
31073427 __u64 flags; /* flags */
31083428 __u32 size; /* amount of bytes */
@@ -3110,7 +3430,7 @@ struct kvm_s390_mem_op { · 1 unmodified line
31103430 __u64 buf; /* buffer in userspace */
31113431 __u8 ar; /* the access register number */
31123432 __u8 reserved[31]; /* should be set to 0 */
3113−};
3433+ };
31143434
31153435 The type of operation is specified in the "op" field. It is either
31163436 KVM_S390_MEMOP_LOGICAL_READ for reading from logical memory space or
@@ -3137,24 +3457,25 @@ The "reserved" field is meant for future extensions. It is not used by · 20 unmodified lines
31373457 KVM with the currently defined set of flags.
31383458
31393459 4.90 KVM_S390_GET_SKEYS
3460+-----------------------
31403461
3141−Capability: KVM_CAP_S390_SKEYS
3142−Architectures: s390
3143−Type: vm ioctl
3144−Parameters: struct kvm_s390_skeys
3145−Returns: 0 on success, KVM_S390_GET_KEYS_NONE if guest is not using storage
3146− keys, negative value on error
3462+:Capability: KVM_CAP_S390_SKEYS
3463+:Architectures: s390
3464+:Type: vm ioctl
3465+:Parameters: struct kvm_s390_skeys
3466+:Returns: 0 on success, KVM_S390_GET_KEYS_NONE if guest is not using storage
3467+ keys, negative value on error
31473468
31483469 This ioctl is used to get guest storage key values on the s390
3149−architecture. The ioctl takes parameters via the kvm_s390_skeys struct.
3470+architecture. The ioctl takes parameters via the kvm_s390_skeys struct::
31503471
3151−struct kvm_s390_skeys {
3472+ struct kvm_s390_skeys {
31523473 __u64 start_gfn;
31533474 __u64 count;
31543475 __u64 skeydata_addr;
31553476 __u32 flags;
31563477 __u32 reserved[9];
3157−};
3478+ };
31583479
31593480 The start_gfn field is the number of the first guest frame whose storage keys
31603481 you want to get.
@@ -3168,12 +3489,13 @@ The skeydata_addr field is the address to a buffer large enough to hold count · 7 unmodified lines
31683489 bytes. This buffer will be filled with storage key data by the ioctl.
31693490
31703491 4.91 KVM_S390_SET_SKEYS
3492+-----------------------
31713493
3172−Capability: KVM_CAP_S390_SKEYS
3173−Architectures: s390
3174−Type: vm ioctl
3175−Parameters: struct kvm_s390_skeys
3176−Returns: 0 on success, negative value on error
3494+:Capability: KVM_CAP_S390_SKEYS
3495+:Architectures: s390
3496+:Type: vm ioctl
3497+:Parameters: struct kvm_s390_skeys
3498+:Returns: 0 on success, negative value on error
31773499
31783500 This ioctl is used to set guest storage key values on the s390
31793501 architecture. The ioctl takes parameters via the kvm_s390_skeys struct.
@@ -3195,21 +3517,27 @@ Note: If any architecturally invalid key value is found in the given data then · 15 unmodified lines
31953517 the ioctl will return -EINVAL.
31963518
31973519 4.92 KVM_S390_IRQ
3520+-----------------
3521+
3522+:Capability: KVM_CAP_S390_INJECT_IRQ
3523+:Architectures: s390
3524+:Type: vcpu ioctl
3525+:Parameters: struct kvm_s390_irq (in)
3526+:Returns: 0 on success, -1 on error
31983527
3199−Capability: KVM_CAP_S390_INJECT_IRQ
3200−Architectures: s390
3201−Type: vcpu ioctl
3202−Parameters: struct kvm_s390_irq (in)
3203−Returns: 0 on success, -1 on error
32043528 Errors:
3205− EINVAL: interrupt type is invalid
3206− type is KVM_S390_SIGP_STOP and flag parameter is invalid value
3529+
3530+
3531+ ====== =================================================================
3532+ EINVAL interrupt type is invalid
3533+ type is KVM_S390_SIGP_STOP and flag parameter is invalid value,
32073534 type is KVM_S390_INT_EXTERNAL_CALL and code is bigger
3208− than the maximum of VCPUs
3209− EBUSY: type is KVM_S390_SIGP_SET_PREFIX and vcpu is not stopped
3210− type is KVM_S390_SIGP_STOP and a stop irq is already pending
3535+ than the maximum of VCPUs
3536+ EBUSY type is KVM_S390_SIGP_SET_PREFIX and vcpu is not stopped,
3537+ type is KVM_S390_SIGP_STOP and a stop irq is already pending,
32113538 type is KVM_S390_INT_EXTERNAL_CALL and an external call interrupt
3212− is already pending
3539+ is already pending
3540+ ====== =================================================================
32133541
32143542 Allows to inject an interrupt to the guest.
32153543
@@ -3217,9 +3545,9 @@ Using struct kvm_s390_irq as a parameter allows · 1 unmodified line
32173545 to inject additional payload which is not
32183546 possible via KVM_S390_INTERRUPT.
32193547
3220−Interrupt parameters are passed via kvm_s390_irq:
3548+Interrupt parameters are passed via kvm_s390_irq::
32213549
3222−struct kvm_s390_irq {
3550+ struct kvm_s390_irq {
32233551 __u64 type;
32243552 union {
32253553 struct kvm_s390_io_info io;
@@ -3232,44 +3560,45 @@ struct kvm_s390_irq { · 6 unmodified lines
32323560 struct kvm_s390_mchk_info mchk;
32333561 char reserved[64];
32343562 } u;
3235−};
3563+ };
32363564
32373565 type can be one of the following:
32383566
3239−KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
3240−KVM_S390_PROGRAM_INT - program check; parameters in .pgm
3241−KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
3242−KVM_S390_RESTART - restart; no parameters
3243−KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
3244−KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
3245−KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
3246−KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
3247−KVM_S390_MCHK - machine check interrupt; parameters in .mchk
3567+- KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
3568+- KVM_S390_PROGRAM_INT - program check; parameters in .pgm
3569+- KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
3570+- KVM_S390_RESTART - restart; no parameters
3571+- KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
3572+- KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
3573+- KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
3574+- KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
3575+- KVM_S390_MCHK - machine check interrupt; parameters in .mchk
32483576
32493577 This is an asynchronous vcpu ioctl and can be invoked from any thread.
32503578
32513579 4.94 KVM_S390_GET_IRQ_STATE
3580+---------------------------
32523581
3253−Capability: KVM_CAP_S390_IRQ_STATE
3254−Architectures: s390
3255−Type: vcpu ioctl
3256−Parameters: struct kvm_s390_irq_state (out)
3257−Returns: >= number of bytes copied into buffer,
3258− -EINVAL if buffer size is 0,
3259− -ENOBUFS if buffer size is too small to fit all pending interrupts,
3260− -EFAULT if the buffer address was invalid
3582+:Capability: KVM_CAP_S390_IRQ_STATE
3583+:Architectures: s390
3584+:Type: vcpu ioctl
3585+:Parameters: struct kvm_s390_irq_state (out)
3586+:Returns: >= number of bytes copied into buffer,
3587+ -EINVAL if buffer size is 0,
3588+ -ENOBUFS if buffer size is too small to fit all pending interrupts,
3589+ -EFAULT if the buffer address was invalid
32613590
32623591 This ioctl allows userspace to retrieve the complete state of all currently
32633592 pending interrupts in a single buffer. Use cases include migration
32643593 and introspection. The parameter structure contains the address of a
3265−userspace buffer and its length:
3594+userspace buffer and its length::
32663595
3267−struct kvm_s390_irq_state {
3596+ struct kvm_s390_irq_state {
32683597 __u64 buf;
32693598 __u32 flags; /* will stay unused for compatibility reasons */
32703599 __u32 len;
32713600 __u32 reserved[4]; /* will stay unused for compatibility reasons */
3272−};
3601+ };
32733602
32743603 Userspace passes in the above struct and for each pending interrupt a
32753604 struct kvm_s390_irq is copied to the provided buffer.
@@ -3283,29 +3612,30 @@ If -ENOBUFS is returned the buffer provided was too small and userspace · 7 unmodified lines
32833612 may retry with a bigger buffer.
32843613
32853614 4.95 KVM_S390_SET_IRQ_STATE
3286−
3287−Capability: KVM_CAP_S390_IRQ_STATE
3288−Architectures: s390
3289−Type: vcpu ioctl
3290−Parameters: struct kvm_s390_irq_state (in)
3291−Returns: 0 on success,
3292− -EFAULT if the buffer address was invalid,
3293− -EINVAL for an invalid buffer length (see below),
3294− -EBUSY if there were already interrupts pending,
3295− errors occurring when actually injecting the
3615+---------------------------
3616+
3617+:Capability: KVM_CAP_S390_IRQ_STATE
3618+:Architectures: s390
3619+:Type: vcpu ioctl
3620+:Parameters: struct kvm_s390_irq_state (in)
3621+:Returns: 0 on success,
3622+ -EFAULT if the buffer address was invalid,
3623+ -EINVAL for an invalid buffer length (see below),
3624+ -EBUSY if there were already interrupts pending,
3625+ errors occurring when actually injecting the
32963626 interrupt. See KVM_S390_IRQ.
32973627
32983628 This ioctl allows userspace to set the complete state of all cpu-local
32993629 interrupts currently pending for the vcpu. It is intended for restoring
33003630 interrupt state after a migration. The input parameter is a userspace buffer
3301−containing a struct kvm_s390_irq_state:
3631+containing a struct kvm_s390_irq_state::
33023632
3303−struct kvm_s390_irq_state {
3633+ struct kvm_s390_irq_state {
33043634 __u64 buf;
33053635 __u32 flags; /* will stay unused for compatibility reasons */
33063636 __u32 len;
33073637 __u32 reserved[4]; /* will stay unused for compatibility reasons */
3308−};
3638+ };
33093639
33103640 The restrictions for flags and reserved apply as well.
33113641 (see KVM_S390_GET_IRQ_STATE)
@@ -3320,20 +3650,22 @@ and it must not exceed (max_vcpus + 32) * sizeof(struct kvm_s390_irq), · 8 unmodified lines
33203650 which is the maximum number of possibly pending cpu-local interrupts.
33213651
33223652 4.96 KVM_SMI
3653+------------
33233654
3324−Capability: KVM_CAP_X86_SMM
3325−Architectures: x86
3326−Type: vcpu ioctl
3327−Parameters: none
3328−Returns: 0 on success, -1 on error
3655+:Capability: KVM_CAP_X86_SMM
3656+:Architectures: x86
3657+:Type: vcpu ioctl
3658+:Parameters: none
3659+:Returns: 0 on success, -1 on error
33293660
33303661 Queues an SMI on the thread's vcpu.
33313662
33323663 4.97 KVM_CAP_PPC_MULTITCE
3664+-------------------------
33333665
3334−Capability: KVM_CAP_PPC_MULTITCE
3335−Architectures: ppc
3336−Type: vm
3666+:Capability: KVM_CAP_PPC_MULTITCE
3667+:Architectures: ppc
3668+:Type: vm
33373669
33383670 This capability means the kernel is capable of handling hypercalls
33393671 H_PUT_TCE_INDIRECT and H_STUFF_TCE without passing those into the user
@@ -3355,26 +3687,27 @@ an implementation for these despite the in kernel acceleration. · 15 unmodified lines
33553687 This capability is always enabled.
33563688
33573689 4.98 KVM_CREATE_SPAPR_TCE_64
3690+----------------------------
33583691
3359−Capability: KVM_CAP_SPAPR_TCE_64
3360−Architectures: powerpc
3361−Type: vm ioctl
3362−Parameters: struct kvm_create_spapr_tce_64 (in)
3363−Returns: file descriptor for manipulating the created TCE table
3692+:Capability: KVM_CAP_SPAPR_TCE_64
3693+:Architectures: powerpc
3694+:Type: vm ioctl
3695+:Parameters: struct kvm_create_spapr_tce_64 (in)
3696+:Returns: file descriptor for manipulating the created TCE table
33643697
33653698 This is an extension for KVM_CAP_SPAPR_TCE which only supports 32bit
33663699 windows, described in 4.62 KVM_CREATE_SPAPR_TCE
33673700
3368−This capability uses extended struct in ioctl interface:
3701+This capability uses extended struct in ioctl interface::
33693702
3370−/* for KVM_CAP_SPAPR_TCE_64 */
3371−struct kvm_create_spapr_tce_64 {
3703+ /* for KVM_CAP_SPAPR_TCE_64 */
3704+ struct kvm_create_spapr_tce_64 {
33723705 __u64 liobn;
33733706 __u32 page_shift;
33743707 __u32 flags;
33753708 __u64 offset; /* in pages */
33763709 __u64 size; /* in pages */
3377−};
3710+ };
33783711
33793712 The aim of extension is to support an additional bigger DMA window with
33803713 a variable page size.
@@ -3387,12 +3720,13 @@ of IOMMU pages. · 6 unmodified lines
33873720 The rest of functionality is identical to KVM_CREATE_SPAPR_TCE.
33883721
33893722 4.99 KVM_REINJECT_CONTROL
3723+-------------------------
33903724
3391−Capability: KVM_CAP_REINJECT_CONTROL
3392−Architectures: x86
3393−Type: vm ioctl
3394−Parameters: struct kvm_reinject_control (in)
3395−Returns: 0 on success,
3725+:Capability: KVM_CAP_REINJECT_CONTROL
3726+:Architectures: x86
3727+:Type: vm ioctl
3728+:Parameters: struct kvm_reinject_control (in)
3729+:Returns: 0 on success,
33963730 -EFAULT if struct kvm_reinject_control cannot be read,
33973731 -ENXIO if KVM_CREATE_PIT or KVM_CREATE_PIT2 didn't succeed earlier.
33983732
@@ -3402,21 +3736,24 @@ vector(s) that i8254 injects. Reinject mode dequeues a tick and injects its · 3 unmodified lines
34023736 interrupt whenever there isn't a pending interrupt from i8254.
34033737 !reinject mode injects an interrupt as soon as a tick arrives.
34043738
3405−struct kvm_reinject_control {
3739+::
3740+
3741+ struct kvm_reinject_control {
34063742 __u8 pit_reinject;
34073743 __u8 reserved[31];
3408−};
3744+ };
34093745
34103746 pit_reinject = 0 (!reinject mode) is recommended, unless running an old
34113747 operating system that uses the PIT for timing (e.g. Linux 2.4.x).
34123748
34133749 4.100 KVM_PPC_CONFIGURE_V3_MMU
3750+------------------------------
34143751
3415−Capability: KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3
3416−Architectures: ppc
3417−Type: vm ioctl
3418−Parameters: struct kvm_ppc_mmuv3_cfg (in)
3419−Returns: 0 on success,
3752+:Capability: KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3
3753+:Architectures: ppc
3754+:Type: vm ioctl
3755+:Parameters: struct kvm_ppc_mmuv3_cfg (in)
3756+:Returns: 0 on success,
34203757 -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read,
34213758 -EINVAL if the configuration is invalid
34223759
@@ -3424,10 +3761,12 @@ This ioctl controls whether the guest will use radix or HPT (hashed · 1 unmodified line
34243761 page table) translation, and sets the pointer to the process table for
34253762 the guest.
34263763
3427−struct kvm_ppc_mmuv3_cfg {
3764+::
3765+
3766+ struct kvm_ppc_mmuv3_cfg {
34283767 __u64 flags;
34293768 __u64 process_table;
3430−};
3769+ };
34313770
34323771 There are two bits that can be set in flags; KVM_PPC_MMUV3_RADIX and
34333772 KVM_PPC_MMUV3_GTSE. KVM_PPC_MMUV3_RADIX, if set, configures the guest
@@ -3442,12 +3781,13 @@ as the second doubleword of the partition table entry, as defined in · 8 unmodified lines
34423781 the Power ISA V3.00, Book III section 5.7.6.1.
34433782
34443783 4.101 KVM_PPC_GET_RMMU_INFO
3784+---------------------------
34453785
3446−Capability: KVM_CAP_PPC_RADIX_MMU
3447−Architectures: ppc
3448−Type: vm ioctl
3449−Parameters: struct kvm_ppc_rmmu_info (out)
3450−Returns: 0 on success,
3786+:Capability: KVM_CAP_PPC_RADIX_MMU
3787+:Architectures: ppc
3788+:Type: vm ioctl
3789+:Parameters: struct kvm_ppc_rmmu_info (out)
3790+:Returns: 0 on success,
34513791 -EFAULT if struct kvm_ppc_rmmu_info cannot be written,
34523792 -EINVAL if no useful information can be returned
34533793
@@ -3456,14 +3796,16 @@ containing supported radix tree geometries, and (b) a list that maps · 2 unmodified lines
34563796 page sizes to put in the "AP" (actual page size) field for the tlbie
34573797 (TLB invalidate entry) instruction.
34583798
3459−struct kvm_ppc_rmmu_info {
3799+::
3800+
3801+ struct kvm_ppc_rmmu_info {
34603802 struct kvm_ppc_radix_geom {
34613803 __u8 page_shift;
34623804 __u8 level_bits[4];
34633805 __u8 pad[3];
34643806 } geometries[8];
34653807 __u32 ap_encodings[8];
3466−};
3808+ };
34673809
34683810 The geometries[] field gives up to 8 supported geometries for the
34693811 radix page table, in terms of the log base 2 of the smallest page
@@ -3476,19 +3818,54 @@ encodings, encoded with the AP value in the top 3 bits and the log · 6 unmodified lines
34763818 base 2 of the page size in the bottom 6 bits.
34773819
34783820 4.102 KVM_PPC_RESIZE_HPT_PREPARE
3821+--------------------------------
34793822
3480−Capability: KVM_CAP_SPAPR_RESIZE_HPT
3481−Architectures: powerpc
3482−Type: vm ioctl
3483−Parameters: struct kvm_ppc_resize_hpt (in)
3484−Returns: 0 on successful completion,
3823+:Capability: KVM_CAP_SPAPR_RESIZE_HPT
3824+:Architectures: powerpc
3825+:Type: vm ioctl
3826+:Parameters: struct kvm_ppc_resize_hpt (in)
3827+:Returns: 0 on successful completion,
34853828 >0 if a new HPT is being prepared, the value is an estimated
3486− number of milliseconds until preparation is complete
3829+ number of milliseconds until preparation is complete,
34873830 -EFAULT if struct kvm_reinject_control cannot be read,
3488− -EINVAL if the supplied shift or flags are invalid
3489− -ENOMEM if unable to allocate the new HPT
3490− -ENOSPC if there was a hash collision when moving existing
3491− HPT entries to the new HPT
3831+ -EINVAL if the supplied shift or flags are invalid,
3832+ -ENOMEM if unable to allocate the new HPT,
3833+ -ENOSPC if there was a hash collision
3834+
3835+::
3836+
3837+ struct kvm_ppc_rmmu_info {
3838+ struct kvm_ppc_radix_geom {
3839+ __u8 page_shift;
3840+ __u8 level_bits[4];
3841+ __u8 pad[3];
3842+ } geometries[8];
3843+ __u32 ap_encodings[8];
3844+ };
3845+
3846+The geometries[] field gives up to 8 supported geometries for the
3847+radix page table, in terms of the log base 2 of the smallest page
3848+size, and the number of bits indexed at each level of the tree, from
3849+the PTE level up to the PGD level in that order. Any unused entries
3850+will have 0 in the page_shift field.
3851+
3852+The ap_encodings gives the supported page sizes and their AP field
3853+encodings, encoded with the AP value in the top 3 bits and the log
3854+base 2 of the page size in the bottom 6 bits.
3855+
3856+4.102 KVM_PPC_RESIZE_HPT_PREPARE
3857+--------------------------------
3858+
3859+:Capability: KVM_CAP_SPAPR_RESIZE_HPT
3860+:Architectures: powerpc
3861+:Type: vm ioctl
3862+:Parameters: struct kvm_ppc_resize_hpt (in)
3863+:Returns: 0 on successful completion,
3864+ >0 if a new HPT is being prepared, the value is an estimated
3865+ number of milliseconds until preparation is complete,
3866+ -EFAULT if struct kvm_reinject_control cannot be read,
3867+ -EINVAL if the supplied shift or flags are invalid,when moving existing
3868+ HPT entries to the new HPT,
34923869 -EIO on other error conditions
34933870
34943871 Used to implement the PAPR extension for runtime resizing of a guest's
@@ -3506,6 +3883,7 @@ requested in the parameters, discards the existing pending HPT and · 11 unmodified lines
35063883 creates a new one as above.
35073884
35083885 If called when there is a pending HPT of the size requested, will:
3886+
35093887 * If preparation of the pending HPT is already complete, return 0
35103888 * If preparation of the pending HPT has failed, return an error
35113889 code, then discard the pending HPT.
@@ -3522,26 +3900,29 @@ Normally this will be called repeatedly with the same parameters until · 10 unmodified lines
35223900 it returns <= 0. The first call will initiate preparation, subsequent
35233901 ones will monitor preparation until it completes or fails.
35243902
3525−struct kvm_ppc_resize_hpt {
3903+::
3904+
3905+ struct kvm_ppc_resize_hpt {
35263906 __u64 flags;
35273907 __u32 shift;
35283908 __u32 pad;
3529−};
3909+ };
35303910
35313911 4.103 KVM_PPC_RESIZE_HPT_COMMIT
3912+-------------------------------
35323913
3533−Capability: KVM_CAP_SPAPR_RESIZE_HPT
3534−Architectures: powerpc
3535−Type: vm ioctl
3536−Parameters: struct kvm_ppc_resize_hpt (in)
3537−Returns: 0 on successful completion,
3914+:Capability: KVM_CAP_SPAPR_RESIZE_HPT
3915+:Architectures: powerpc
3916+:Type: vm ioctl
3917+:Parameters: struct kvm_ppc_resize_hpt (in)
3918+:Returns: 0 on successful completion,
35383919 -EFAULT if struct kvm_reinject_control cannot be read,
3539− -EINVAL if the supplied shift or flags are invalid
3920+ -EINVAL if the supplied shift or flags are invalid,
35403921 -ENXIO is there is no pending HPT, or the pending HPT doesn't
3541− have the requested size
3542− -EBUSY if the pending HPT is not fully prepared
3922+ have the requested size,
3923+ -EBUSY if the pending HPT is not fully prepared,
35433924 -ENOSPC if there was a hash collision when moving existing
3544− HPT entries to the new HPT
3925+ HPT entries to the new HPT,
35453926 -EIO on other error conditions
35463927
35473928 Used to implement the PAPR extension for runtime resizing of a guest's
@@ -3564,31 +3945,35 @@ HPT and the previous HPT will be discarded. · 16 unmodified lines
35643945
35653946 On failure, the guest will still be operating on its previous HPT.
35663947
3567−struct kvm_ppc_resize_hpt {
3948+::
3949+
3950+ struct kvm_ppc_resize_hpt {
35683951 __u64 flags;
35693952 __u32 shift;
35703953 __u32 pad;
3571−};
3954+ };
35723955
35733956 4.104 KVM_X86_GET_MCE_CAP_SUPPORTED
3957+-----------------------------------
35743958
3575−Capability: KVM_CAP_MCE
3576−Architectures: x86
3577−Type: system ioctl
3578−Parameters: u64 mce_cap (out)
3579−Returns: 0 on success, -1 on error
3959+:Capability: KVM_CAP_MCE
3960+:Architectures: x86
3961+:Type: system ioctl
3962+:Parameters: u64 mce_cap (out)
3963+:Returns: 0 on success, -1 on error
35803964
35813965 Returns supported MCE capabilities. The u64 mce_cap parameter
35823966 has the same format as the MSR_IA32_MCG_CAP register. Supported
35833967 capabilities will have the corresponding bits set.
35843968
35853969 4.105 KVM_X86_SETUP_MCE
3970+-----------------------
35863971
3587−Capability: KVM_CAP_MCE
3588−Architectures: x86
3589−Type: vcpu ioctl
3590−Parameters: u64 mcg_cap (in)
3591−Returns: 0 on success,
3972+:Capability: KVM_CAP_MCE
3973+:Architectures: x86
3974+:Type: vcpu ioctl
3975+:Parameters: u64 mcg_cap (in)
3976+:Returns: 0 on success,
35923977 -EFAULT if u64 mcg_cap cannot be read,
35933978 -EINVAL if the requested number of banks is invalid,
35943979 -EINVAL if requested MCE capability is not supported.
@@ -3601,20 +3986,21 @@ checking for KVM_CAP_MCE. The supported capabilities can be · 6 unmodified lines
36013986 retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED.
36023987
36033988 4.106 KVM_X86_SET_MCE
3989+---------------------
36043990
3605−Capability: KVM_CAP_MCE
3606−Architectures: x86
3607−Type: vcpu ioctl
3608−Parameters: struct kvm_x86_mce (in)
3609−Returns: 0 on success,
3991+:Capability: KVM_CAP_MCE
3992+:Architectures: x86
3993+:Type: vcpu ioctl
3994+:Parameters: struct kvm_x86_mce (in)
3995+:Returns: 0 on success,
36103996 -EFAULT if struct kvm_x86_mce cannot be read,
36113997 -EINVAL if the bank number is invalid,
36123998 -EINVAL if VAL bit is not set in status field.
36133999
36144000 Inject a machine check error (MCE) into the guest. The input
3615−parameter is:
4001+parameter is::
36164002
3617−struct kvm_x86_mce {
4003+ struct kvm_x86_mce {
36184004 __u64 status;
36194005 __u64 addr;
36204006 __u64 misc;
@@ -3622,7 +4008,7 @@ struct kvm_x86_mce { · 1 unmodified line
36224008 __u8 bank;
36234009 __u8 pad1[7];
36244010 __u64 pad2[3];
3625−};
4011+ };
36264012
36274013 If the MCE being reported is an uncorrected error, KVM will
36284014 inject it as an MCE exception into the guest. If the guest
@@ -3634,15 +4020,17 @@ store it in the corresponding bank (provided this bank is · 5 unmodified lines
36344020 not holding a previously reported uncorrected error).
36354021
36364022 4.107 KVM_S390_GET_CMMA_BITS
4023+----------------------------
36374024
3638−Capability: KVM_CAP_S390_CMMA_MIGRATION
3639−Architectures: s390
3640−Type: vm ioctl
3641−Parameters: struct kvm_s390_cmma_log (in, out)
3642−Returns: 0 on success, a negative value on error
4025+:Capability: KVM_CAP_S390_CMMA_MIGRATION
4026+:Architectures: s390
4027+:Type: vm ioctl
4028+:Parameters: struct kvm_s390_cmma_log (in, out)
4029+:Returns: 0 on success, a negative value on error
36434030
36444031 This ioctl is used to get the values of the CMMA bits on the s390
36454032 architecture. It is meant to be used in two scenarios:
4033+
36464034 - During live migration to save the CMMA values. Live migration needs
36474035 to be enabled via the KVM_REQ_START_MIGRATION VM property.
36484036 - To non-destructively peek at the CMMA values, with the flag
@@ -3652,9 +4040,12 @@ The ioctl takes parameters via the kvm_s390_cmma_log struct. The desired · 3 unmodified lines
36524040 values are written to a buffer whose location is indicated via the "values"
36534041 member in the kvm_s390_cmma_log struct. The values in the input struct are
36544042 also updated as needed.
4043+
36554044 Each CMMA value takes up one byte.
36564045
3657−struct kvm_s390_cmma_log {
4046+::
4047+
4048+ struct kvm_s390_cmma_log {
36584049 __u64 start_gfn;
36594050 __u32 count;
36604051 __u32 flags;
@@ -3663,7 +4054,7 @@ struct kvm_s390_cmma_log { · 2 unmodified lines
36634054 __u64 mask;
36644055 };
36654056 __u64 values;
3666−};
4057+ };
36674058
36684059 start_gfn is the number of the first guest frame whose CMMA values are
36694060 to be retrieved,
@@ -3724,12 +4115,13 @@ KVM_S390_CMMA_PEEK is not set but migration mode was not enabled, with · 54 unmodified lines
37244115 present for the addresses (e.g. when using hugepages).
37254116
37264117 4.108 KVM_S390_SET_CMMA_BITS
4118+----------------------------
37274119
3728−Capability: KVM_CAP_S390_CMMA_MIGRATION
3729−Architectures: s390
3730−Type: vm ioctl
3731−Parameters: struct kvm_s390_cmma_log (in)
3732−Returns: 0 on success, a negative value on error
4120+:Capability: KVM_CAP_S390_CMMA_MIGRATION
4121+:Architectures: s390
4122+:Type: vm ioctl
4123+:Parameters: struct kvm_s390_cmma_log (in)
4124+:Returns: 0 on success, a negative value on error
37334125
37344126 This ioctl is used to set the values of the CMMA bits on the s390
37354127 architecture. It is meant to be used during live migration to restore
@@ -3737,16 +4129,18 @@ the CMMA values, but there are no restrictions on its use. · 1 unmodified line
37374129 The ioctl takes parameters via the kvm_s390_cmma_values struct.
37384130 Each CMMA value takes up one byte.
37394131
3740−struct kvm_s390_cmma_log {
4132+::
4133+
4134+ struct kvm_s390_cmma_log {
37414135 __u64 start_gfn;
37424136 __u32 count;
37434137 __u32 flags;
37444138 union {
37454139 __u64 remaining;
37464140 __u64 mask;
3747− };
4141+ };
37484142 __u64 values;
3749−};
4143+ };
37504144
37514145 start_gfn indicates the starting guest frame number,
37524146
@@ -3769,26 +4163,27 @@ or if no page table is present for the addresses (e.g. when using · 16 unmodified lines
37694163 hugepages).
37704164
37714165 4.109 KVM_PPC_GET_CPU_CHAR
4166+--------------------------
37724167
3773−Capability: KVM_CAP_PPC_GET_CPU_CHAR
3774−Architectures: powerpc
3775−Type: vm ioctl
3776−Parameters: struct kvm_ppc_cpu_char (out)
3777−Returns: 0 on successful completion
4168+:Capability: KVM_CAP_PPC_GET_CPU_CHAR
4169+:Architectures: powerpc
4170+:Type: vm ioctl
4171+:Parameters: struct kvm_ppc_cpu_char (out)
4172+:Returns: 0 on successful completion,
37784173 -EFAULT if struct kvm_ppc_cpu_char cannot be written
37794174
37804175 This ioctl gives userspace information about certain characteristics
37814176 of the CPU relating to speculative execution of instructions and
37824177 possible information leakage resulting from speculative execution (see
37834178 CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is
3784−returned in struct kvm_ppc_cpu_char, which looks like this:
4179+returned in struct kvm_ppc_cpu_char, which looks like this::
37854180
3786−struct kvm_ppc_cpu_char {
4181+ struct kvm_ppc_cpu_char {
37874182 __u64 character; /* characteristics of the CPU */
37884183 __u64 behaviour; /* recommended software behaviour */
37894184 __u64 character_mask; /* valid bits in character */
37904185 __u64 behaviour_mask; /* valid bits in behaviour */
3791−};
4186+ };
37924187
37934188 For extensibility, the character_mask and behaviour_mask fields
37944189 indicate which bits of character and behaviour have been filled in by
@@ -3815,12 +4210,13 @@ These fields use the same bit definitions as the new · 20 unmodified lines
38154210 H_GET_CPU_CHARACTERISTICS hypercall.
38164211
38174212 4.110 KVM_MEMORY_ENCRYPT_OP
4213+---------------------------
38184214
3819−Capability: basic
3820−Architectures: x86
3821−Type: system
3822−Parameters: an opaque platform specific structure (in/out)
3823−Returns: 0 on success; -1 on error
4215+:Capability: basic
4216+:Architectures: x86
4217+:Type: system
4218+:Parameters: an opaque platform specific structure (in/out)
4219+:Returns: 0 on success; -1 on error
38244220
38254221 If the platform supports creating encrypted VMs then this ioctl can be used
38264222 for issuing platform-specific memory encryption commands to manage those
@@ -3831,12 +4227,13 @@ Currently, this ioctl is used for issuing Secure Encrypted Virtualization · 4 unmodified lines
38314227 Documentation/virt/kvm/amd-memory-encryption.rst.
38324228
38334229 4.111 KVM_MEMORY_ENCRYPT_REG_REGION
4230+-----------------------------------
38344231
3835−Capability: basic
3836−Architectures: x86
3837−Type: system
3838−Parameters: struct kvm_enc_region (in)
3839−Returns: 0 on success; -1 on error
4232+:Capability: basic
4233+:Architectures: x86
4234+:Type: system
4235+:Parameters: struct kvm_enc_region (in)
4236+:Returns: 0 on success; -1 on error
38404237
38414238 This ioctl can be used to register a guest memory region which may
38424239 contain encrypted data (e.g. guest RAM, SMRAM etc).
@@ -3854,60 +4251,71 @@ swap or migrate (move) ciphertext pages. Hence, for now we pin the guest · 11 unmodified lines
38544251 memory region registered with the ioctl.
38554252
38564253 4.112 KVM_MEMORY_ENCRYPT_UNREG_REGION
4254+-------------------------------------
38574255
3858−Capability: basic
3859−Architectures: x86
3860−Type: system
3861−Parameters: struct kvm_enc_region (in)
3862−Returns: 0 on success; -1 on error
4256+:Capability: basic
4257+:Architectures: x86
4258+:Type: system
4259+:Parameters: struct kvm_enc_region (in)
4260+:Returns: 0 on success; -1 on error
38634261
38644262 This ioctl can be used to unregister the guest memory region registered
38654263 with KVM_MEMORY_ENCRYPT_REG_REGION ioctl above.
38664264
38674265 4.113 KVM_HYPERV_EVENTFD
4266+------------------------
38684267
3869−Capability: KVM_CAP_HYPERV_EVENTFD
3870−Architectures: x86
3871−Type: vm ioctl
3872−Parameters: struct kvm_hyperv_eventfd (in)
4268+:Capability: KVM_CAP_HYPERV_EVENTFD
4269+:Architectures: x86
4270+:Type: vm ioctl
4271+:Parameters: struct kvm_hyperv_eventfd (in)
38734272
38744273 This ioctl (un)registers an eventfd to receive notifications from the guest on
38754274 the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without
38764275 causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number
38774276 (bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit.
38784277
3879−struct kvm_hyperv_eventfd {
4278+::
4279+
4280+ struct kvm_hyperv_eventfd {
38804281 __u32 conn_id;
38814282 __s32 fd;
38824283 __u32 flags;
38834284 __u32 padding[3];
3884−};
4285+ };
38854286
3886−The conn_id field should fit within 24 bits:
4287+The conn_id field should fit within 24 bits::
38874288
3888−#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff
4289+ #define KVM_HYPERV_CONN_ID_MASK 0x00ffffff
38894290
3890−The acceptable values for the flags field are:
4291+The acceptable values for the flags field are::
38914292
3892−#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
4293+ #define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
38934294
3894−Returns: 0 on success,
3895− -EINVAL if conn_id or flags is outside the allowed range
3896− -ENOENT on deassign if the conn_id isn't registered
3897− -EEXIST on assign if the conn_id is already registered
4295+:Returns: 0 on success,
4296+ -EINVAL if conn_id or flags is outside the allowed range,
4297+ -ENOENT on deassign if the conn_id isn't registered,
4298+ -EEXIST on assign if the conn_id is already registered
38984299
38994300 4.114 KVM_GET_NESTED_STATE
4301+--------------------------
4302+
4303+:Capability: KVM_CAP_NESTED_STATE
4304+:Architectures: x86
4305+:Type: vcpu ioctl
4306+:Parameters: struct kvm_nested_state (in/out)
4307+:Returns: 0 on success, -1 on error
39004308
3901−Capability: KVM_CAP_NESTED_STATE
3902−Architectures: x86
3903−Type: vcpu ioctl
3904−Parameters: struct kvm_nested_state (in/out)
3905−Returns: 0 on success, -1 on error
39064309 Errors:
3907− E2BIG: the total state size exceeds the value of 'size' specified by
4310+
4311+ ===== =============================================================
4312+ E2BIG the total state size exceeds the value of 'size' specified by
39084313 the user; the size required will be written into size.
4314+ ===== =============================================================
4315+
4316+::
39094317
3910−struct kvm_nested_state {
4318+ struct kvm_nested_state {
39114319 __u16 flags;
39124320 __u16 format;
39134321 __u32 size;
@@ -3924,33 +4332,33 @@ struct kvm_nested_state { · 10 unmodified lines
39244332 struct kvm_vmx_nested_state_data vmx[0];
39254333 struct kvm_svm_nested_state_data svm[0];
39264334 } data;
3927−};
4335+ };
39284336
3929−#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
3930−#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
3931−#define KVM_STATE_NESTED_EVMCS 0x00000004
4337+ #define KVM_STATE_NESTED_GUEST_MODE 0x00000001
4338+ #define KVM_STATE_NESTED_RUN_PENDING 0x00000002
4339+ #define KVM_STATE_NESTED_EVMCS 0x00000004
39324340
3933−#define KVM_STATE_NESTED_FORMAT_VMX 0
3934−#define KVM_STATE_NESTED_FORMAT_SVM 1
4341+ #define KVM_STATE_NESTED_FORMAT_VMX 0
4342+ #define KVM_STATE_NESTED_FORMAT_SVM 1
39354343
3936−#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
4344+ #define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
39374345
3938−#define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001
3939−#define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002
4346+ #define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001
4347+ #define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002
39404348
3941−struct kvm_vmx_nested_state_hdr {
4349+ struct kvm_vmx_nested_state_hdr {
39424350 __u64 vmxon_pa;
39434351 __u64 vmcs12_pa;
39444352
39454353 struct {
39464354 __u16 flags;
39474355 } smm;
3948−};
4356+ };
39494357
3950−struct kvm_vmx_nested_state_data {
4358+ struct kvm_vmx_nested_state_data {
39514359 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
39524360 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
3953−};
4361+ };
39544362
39554363 This ioctl copies the vcpu's nested virtualization state from the kernel to
39564364 userspace.
@@ -3959,24 +4367,26 @@ The maximum size of the state can be retrieved by passing KVM_CAP_NESTED_STATE · 2 unmodified lines
39594367 to the KVM_CHECK_EXTENSION ioctl().
39604368
39614369 4.115 KVM_SET_NESTED_STATE
4370+--------------------------
39624371
3963−Capability: KVM_CAP_NESTED_STATE
3964−Architectures: x86
3965−Type: vcpu ioctl
3966−Parameters: struct kvm_nested_state (in)
3967−Returns: 0 on success, -1 on error
4372+:Capability: KVM_CAP_NESTED_STATE
4373+:Architectures: x86
4374+:Type: vcpu ioctl
4375+:Parameters: struct kvm_nested_state (in)
4376+:Returns: 0 on success, -1 on error
39684377
39694378 This copies the vcpu's kvm_nested_state struct from userspace to the kernel.
39704379 For the definition of struct kvm_nested_state, see KVM_GET_NESTED_STATE.
39714380
39724381 4.116 KVM_(UN)REGISTER_COALESCED_MMIO
4382+-------------------------------------
39734383
3974−Capability: KVM_CAP_COALESCED_MMIO (for coalesced mmio)
3975− KVM_CAP_COALESCED_PIO (for coalesced pio)
3976−Architectures: all
3977−Type: vm ioctl
3978−Parameters: struct kvm_coalesced_mmio_zone
3979−Returns: 0 on success, < 0 on error
4384+:Capability: KVM_CAP_COALESCED_MMIO (for coalesced mmio)
4385+ KVM_CAP_COALESCED_PIO (for coalesced pio)
4386+:Architectures: all
4387+:Type: vm ioctl
4388+:Parameters: struct kvm_coalesced_mmio_zone
4389+:Returns: 0 on success, < 0 on error
39804390
39814391 Coalesced I/O is a performance optimization that defers hardware
39824392 register write emulation so that userspace exits are avoided. It is
@@ -3998,15 +4408,18 @@ between coalesced mmio and pio except that coalesced pio records accesses · 15 unmodified lines
39984408 to I/O ports.
39994409
40004410 4.117 KVM_CLEAR_DIRTY_LOG (vm ioctl)
4411+------------------------------------
40014412
4002−Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2
4003−Architectures: x86, arm, arm64, mips
4004−Type: vm ioctl
4005−Parameters: struct kvm_dirty_log (in)
4006−Returns: 0 on success, -1 on error
4413+:Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2
4414+:Architectures: x86, arm, arm64, mips
4415+:Type: vm ioctl
4416+:Parameters: struct kvm_dirty_log (in)
4417+:Returns: 0 on success, -1 on error
40074418
4008−/* for KVM_CLEAR_DIRTY_LOG */
4009−struct kvm_clear_dirty_log {
4419+::
4420+
4421+ /* for KVM_CLEAR_DIRTY_LOG */
4422+ struct kvm_clear_dirty_log {
40104423 __u32 slot;
40114424 __u32 num_pages;
40124425 __u64 first_page;
@@ -4014,7 +4427,7 @@ struct kvm_clear_dirty_log { · 1 unmodified line
40144427 void __user *dirty_bitmap; /* one bit per page */
40154428 __u64 padding;
40164429 };
4017−};
4430+ };
40184431
40194432 The ioctl clears the dirty status of pages in a memory slot, according to
40204433 the bitmap that is passed in struct kvm_clear_dirty_log's dirty_bitmap
@@ -4038,20 +4451,23 @@ However, it can always be used as long as KVM_CHECK_EXTENSION confirms · 17 unmodified lines
40384451 that KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is present.
40394452
40404453 4.118 KVM_GET_SUPPORTED_HV_CPUID
4454+--------------------------------
4455+
4456+:Capability: KVM_CAP_HYPERV_CPUID
4457+:Architectures: x86
4458+:Type: vcpu ioctl
4459+:Parameters: struct kvm_cpuid2 (in/out)
4460+:Returns: 0 on success, -1 on error
40414461
4042−Capability: KVM_CAP_HYPERV_CPUID
4043−Architectures: x86
4044−Type: vcpu ioctl
4045−Parameters: struct kvm_cpuid2 (in/out)
4046−Returns: 0 on success, -1 on error
4462+::
40474463
4048−struct kvm_cpuid2 {
4464+ struct kvm_cpuid2 {
40494465 __u32 nent;
40504466 __u32 padding;
40514467 struct kvm_cpuid_entry2 entries[0];
4052−};
4468+ };
40534469
4054−struct kvm_cpuid_entry2 {
4470+ struct kvm_cpuid_entry2 {
40554471 __u32 function;
40564472 __u32 index;
40574473 __u32 flags;
@@ -4060,7 +4476,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines
40604476 __u32 ecx;
40614477 __u32 edx;
40624478 __u32 padding[3];
4063−};
4479+ };
40644480
40654481 This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in
40664482 KVM. Userspace can use the information returned by this ioctl to construct
@@ -4073,13 +4489,13 @@ KVM_GET_SUPPORTED_CPUID ioctl because some of them intersect with KVM feature · 6 unmodified lines
40734489 leaves (0x40000000, 0x40000001).
40744490
40754491 Currently, the following list of CPUID leaves are returned:
4076− HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
4077− HYPERV_CPUID_INTERFACE
4078− HYPERV_CPUID_VERSION
4079− HYPERV_CPUID_FEATURES
4080− HYPERV_CPUID_ENLIGHTMENT_INFO
4081− HYPERV_CPUID_IMPLEMENT_LIMITS
4082− HYPERV_CPUID_NESTED_FEATURES
4492+ - HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
4493+ - HYPERV_CPUID_INTERFACE
4494+ - HYPERV_CPUID_VERSION
4495+ - HYPERV_CPUID_FEATURES
4496+ - HYPERV_CPUID_ENLIGHTMENT_INFO
4497+ - HYPERV_CPUID_IMPLEMENT_LIMITS
4498+ - HYPERV_CPUID_NESTED_FEATURES
40834499
40844500 HYPERV_CPUID_NESTED_FEATURES leaf is only exposed when Enlightened VMCS was
40854501 enabled on the corresponding vCPU (KVM_CAP_HYPERV_ENLIGHTENED_VMCS).
@@ -4095,17 +4511,25 @@ number of valid entries in the 'entries' array, which is then filled. · 9 unmodified lines
40954511 userspace should not expect to get any particular value there.
40964512
40974513 4.119 KVM_ARM_VCPU_FINALIZE
4514+---------------------------
4515+
4516+:Architectures: arm, arm64
4517+:Type: vcpu ioctl
4518+:Parameters: int feature (in)
4519+:Returns: 0 on success, -1 on error
40984520
4099−Architectures: arm, arm64
4100−Type: vcpu ioctl
4101−Parameters: int feature (in)
4102−Returns: 0 on success, -1 on error
41034521 Errors:
4104− EPERM: feature not enabled, needs configuration, or already finalized
4105− EINVAL: feature unknown or not present
4522+
4523+ ====== ==============================================================
4524+ EPERM feature not enabled, needs configuration, or already finalized
4525+ EINVAL feature unknown or not present
4526+ ====== ==============================================================
41064527
41074528 Recognised values for feature:
4529+
4530+ ===== ===========================================
41084531 arm64 KVM_ARM_VCPU_SVE (requires KVM_CAP_ARM_SVE)
4532+ ===== ===========================================
41094533
41104534 Finalizes the configuration of the specified vcpu feature.
41114535
@@ -4129,21 +4553,24 @@ See KVM_ARM_VCPU_INIT for details of vcpu features that require finalization · 17 unmodified lines
41294553 using this ioctl.
41304554
41314555 4.120 KVM_SET_PMU_EVENT_FILTER
4556+------------------------------
41324557
4133−Capability: KVM_CAP_PMU_EVENT_FILTER
4134−Architectures: x86
4135−Type: vm ioctl
4136−Parameters: struct kvm_pmu_event_filter (in)
4137−Returns: 0 on success, -1 on error
4558+:Capability: KVM_CAP_PMU_EVENT_FILTER
4559+:Architectures: x86
4560+:Type: vm ioctl
4561+:Parameters: struct kvm_pmu_event_filter (in)
4562+:Returns: 0 on success, -1 on error
41384563
4139−struct kvm_pmu_event_filter {
4564+::
4565+
4566+ struct kvm_pmu_event_filter {
41404567 __u32 action;
41414568 __u32 nevents;
41424569 __u32 fixed_counter_bitmap;
41434570 __u32 flags;
41444571 __u32 pad[4];
41454572 __u64 events[0];
4146−};
4573+ };
41474574
41484575 This ioctl restricts the set of PMU events that the guest can program.
41494576 The argument holds a list of events which will be allowed or denied.
@@ -4154,20 +4581,26 @@ counters are controlled by the fixed_counter_bitmap. · 4 unmodified lines
41544581
41554582 No flags are defined yet, the field must be zero.
41564583
4157−Valid values for 'action':
4158−#define KVM_PMU_EVENT_ALLOW 0
4159−#define KVM_PMU_EVENT_DENY 1
4584+Valid values for 'action'::
4585+
4586+ #define KVM_PMU_EVENT_ALLOW 0
4587+ #define KVM_PMU_EVENT_DENY 1
41604588
41614589 4.121 KVM_PPC_SVM_OFF
4590+---------------------
4591+
4592+:Capability: basic
4593+:Architectures: powerpc
4594+:Type: vm ioctl
4595+:Parameters: none
4596+:Returns: 0 on successful completion,
41624597
4163−Capability: basic
4164−Architectures: powerpc
4165−Type: vm ioctl
4166−Parameters: none
4167−Returns: 0 on successful completion,
41684598 Errors:
4169− EINVAL: if ultravisor failed to terminate the secure guest
4170− ENOMEM: if hypervisor failed to allocate new radix page tables for guest
4599+
4600+ ====== ================================================================
4601+ EINVAL if ultravisor failed to terminate the secure guest
4602+ ENOMEM if hypervisor failed to allocate new radix page tables for guest
4603+ ====== ================================================================
41714604
41724605 This ioctl is used to turn off the secure mode of the guest or transition
41734606 the guest from secure mode to normal mode. This is invoked when the guest
@@ -4178,35 +4611,38 @@ unpins the VPA pages and releases all the device pages that are used to · 4 unmodified lines
41784611 track the secure pages by hypervisor.
41794612
41804613 4.122 KVM_S390_NORMAL_RESET
4614+---------------------------
41814615
4182−Capability: KVM_CAP_S390_VCPU_RESETS
4183−Architectures: s390
4184−Type: vcpu ioctl
4185−Parameters: none
4186−Returns: 0
4616+:Capability: KVM_CAP_S390_VCPU_RESETS
4617+:Architectures: s390
4618+:Type: vcpu ioctl
4619+:Parameters: none
4620+:Returns: 0
41874621
41884622 This ioctl resets VCPU registers and control structures according to
41894623 the cpu reset definition in the POP (Principles Of Operation).
41904624
41914625 4.123 KVM_S390_INITIAL_RESET
4626+----------------------------
41924627
4193−Capability: none
4194−Architectures: s390
4195−Type: vcpu ioctl
4196−Parameters: none
4197−Returns: 0
4628+:Capability: none
4629+:Architectures: s390
4630+:Type: vcpu ioctl
4631+:Parameters: none
4632+:Returns: 0
41984633
41994634 This ioctl resets VCPU registers and control structures according to
42004635 the initial cpu reset definition in the POP. However, the cpu is not
42014636 put into ESA mode. This reset is a superset of the normal reset.
42024637
42034638 4.124 KVM_S390_CLEAR_RESET
4639+--------------------------
42044640
4205−Capability: KVM_CAP_S390_VCPU_RESETS
4206−Architectures: s390
4207−Type: vcpu ioctl
4208−Parameters: none
4209−Returns: 0
4641+:Capability: KVM_CAP_S390_VCPU_RESETS
4642+:Architectures: s390
4643+:Type: vcpu ioctl
4644+:Parameters: none
4645+:Returns: 0
42104646
42114647 This ioctl resets VCPU registers and control structures according to
42124648 the clear cpu reset definition in the POP. However, the cpu is not put
@@ -4214,7 +4650,7 @@ into ESA mode. This reset is a superset of the initial reset. · 1 unmodified line
42144650
42154651
42164652 5. The kvm_run structure
4217−------------------------
4653+========================
42184654
42194655 Application code obtains a pointer to the kvm_run structure by
42204656 mmap()ing a vcpu fd. From that point, application code can control
@@ -4222,13 +4658,17 @@ execution by changing fields in kvm_run prior to calling the KVM_RUN · 1 unmodified line
42224658 ioctl, and obtain information about the reason KVM_RUN returned by
42234659 looking up structure members.
42244660
4225−struct kvm_run {
4661+::
4662+
4663+ struct kvm_run {
42264664 /* in */
42274665 __u8 request_interrupt_window;
42284666
42294667 Request that KVM_RUN return when it becomes possible to inject external
42304668 interrupts into the guest. Useful in conjunction with KVM_INTERRUPT.
42314669
4670+::
4671+
42324672 __u8 immediate_exit;
42334673
42344674 This field is polled once when KVM_RUN starts; if non-zero, KVM_RUN
@@ -4240,6 +4680,8 @@ a signal handler that sets run->immediate_exit to a non-zero value. · 5 unmodified lines
42404680
42414681 This field is ignored if KVM_CAP_IMMEDIATE_EXIT is not available.
42424682
4683+::
4684+
42434685 __u8 padding1[6];
42444686
42454687 /* out */
@@ -4249,16 +4691,22 @@ When KVM_RUN has returned successfully (return value 0), this informs · 3 unmodified lines
42494691 application code why KVM_RUN has returned. Allowable values for this
42504692 field are detailed below.
42514693
4694+::
4695+
42524696 __u8 ready_for_interrupt_injection;
42534697
42544698 If request_interrupt_window has been specified, this field indicates
42554699 an interrupt can be injected now with KVM_INTERRUPT.
42564700
4701+::
4702+
42574703 __u8 if_flag;
42584704
42594705 The value of the current interrupt flag. Only valid if in-kernel
42604706 local APIC is not used.
42614707
4708+::
4709+
42624710 __u16 flags;
42634711
42644712 More architecture-specific flags detailing state of the VCPU that may
@@ -4266,17 +4714,23 @@ affect the device's behavior. The only currently defined flag is · 1 unmodified line
42664714 KVM_RUN_X86_SMM, which is valid on x86 machines and is set if the
42674715 VCPU is in system management mode.
42684716
4717+::
4718+
42694719 /* in (pre_kvm_run), out (post_kvm_run) */
42704720 __u64 cr8;
42714721
42724722 The value of the cr8 register. Only valid if in-kernel local APIC is
42734723 not used. Both input and output.
42744724
4725+::
4726+
42754727 __u64 apic_base;
42764728
42774729 The value of the APIC BASE msr. Only valid if in-kernel local
42784730 APIC is not used. Both input and output.
42794731
4732+::
4733+
42804734 union {
42814735 /* KVM_EXIT_UNKNOWN */
42824736 struct {
@@ -4287,6 +4741,8 @@ If exit_reason is KVM_EXIT_UNKNOWN, the vcpu has exited due to unknown · 4 unmodified lines
42874741 reasons. Further architecture-specific information is available in
42884742 hardware_exit_reason.
42894743
4744+::
4745+
42904746 /* KVM_EXIT_FAIL_ENTRY */
42914747 struct {
42924748 __u64 hardware_entry_failure_reason;
@@ -4296,6 +4752,8 @@ If exit_reason is KVM_EXIT_FAIL_ENTRY, the vcpu could not be run due · 3 unmodified lines
42964752 to unknown reasons. Further architecture-specific information is
42974753 available in hardware_entry_failure_reason.
42984754
4755+::
4756+
42994757 /* KVM_EXIT_EXCEPTION */
43004758 struct {
43014759 __u32 exception;
@@ -4304,10 +4762,12 @@ available in hardware_entry_failure_reason. · 2 unmodified lines
43044762
43054763 Unused.
43064764
4765+::
4766+
43074767 /* KVM_EXIT_IO */
43084768 struct {
4309−#define KVM_EXIT_IO_IN 0
4310−#define KVM_EXIT_IO_OUT 1
4769+ #define KVM_EXIT_IO_IN 0
4770+ #define KVM_EXIT_IO_OUT 1
43114771 __u8 direction;
43124772 __u8 size; /* bytes */
43134773 __u16 port;
@@ -4321,6 +4781,8 @@ data_offset describes where the data is located (KVM_EXIT_IO_OUT) or · 7 unmodified lines
43214781 where kvm expects application code to place the data for the next
43224782 KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array.
43234783
4784+::
4785+
43244786 /* KVM_EXIT_DEBUG */
43254787 struct {
43264788 struct kvm_debug_exit_arch arch;
@@ -4329,6 +4791,8 @@ KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array. · 2 unmodified lines
43294791 If the exit_reason is KVM_EXIT_DEBUG, then a vcpu is processing a debug event
43304792 for which architecture specific information is returned.
43314793
4794+::
4795+
43324796 /* KVM_EXIT_MMIO */
43334797 struct {
43344798 __u64 phys_addr;
@@ -4346,14 +4810,19 @@ The 'data' member contains, in its first 'len' bytes, the value as it would · 11 unmodified lines
43464810 appear if the VCPU performed a load or store of the appropriate width directly
43474811 to the byte array.
43484812
4349−NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR and
4813+.. note::
4814+
4815+ For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR and
43504816 KVM_EXIT_EPR the corresponding
4817+
43514818 operations are complete (and guest state is consistent) only after userspace
43524819 has re-entered the kernel with KVM_RUN. The kernel side will first finish
43534820 incomplete operations and then check for pending signals. Userspace
43544821 can re-enter the guest with an unmasked signal pending to complete
43554822 pending operations.
43564823
4824+::
4825+
43574826 /* KVM_EXIT_HYPERCALL */
43584827 struct {
43594828 __u64 nr;
@@ -4365,7 +4834,10 @@ pending operations. · 5 unmodified lines
43654834
43664835 Unused. This was once used for 'hypercall to userspace'. To implement
43674836 such functionality, use KVM_EXIT_IO (x86) or KVM_EXIT_MMIO (all except s390).
4368−Note KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO.
4837+
4838+.. note:: KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO.
4839+
4840+::
43694841
43704842 /* KVM_EXIT_TPR_ACCESS */
43714843 struct {
@@ -4376,6 +4848,8 @@ Note KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO. · 4 unmodified lines
43764848
43774849 To be documented (KVM_TPR_ACCESS_REPORTING).
43784850
4851+::
4852+
43794853 /* KVM_EXIT_S390_SIEIC */
43804854 struct {
43814855 __u8 icptcode;
@@ -4387,16 +4861,20 @@ To be documented (KVM_TPR_ACCESS_REPORTING). · 5 unmodified lines
43874861
43884862 s390 specific.
43894863
4864+::
4865+
43904866 /* KVM_EXIT_S390_RESET */
4391−#define KVM_S390_RESET_POR 1
4392−#define KVM_S390_RESET_CLEAR 2
4393−#define KVM_S390_RESET_SUBSYSTEM 4
4394−#define KVM_S390_RESET_CPU_INIT 8
4395−#define KVM_S390_RESET_IPL 16
4867+ #define KVM_S390_RESET_POR 1
4868+ #define KVM_S390_RESET_CLEAR 2
4869+ #define KVM_S390_RESET_SUBSYSTEM 4
4870+ #define KVM_S390_RESET_CPU_INIT 8
4871+ #define KVM_S390_RESET_IPL 16
43964872 __u64 s390_reset_flags;
43974873
43984874 s390 specific.
43994875
4876+::
4877+
44004878 /* KVM_EXIT_S390_UCONTROL */
44014879 struct {
44024880 __u64 trans_exc_code;
@@ -4411,6 +4889,8 @@ in the cpu's lowcore are presented here as defined by the z Architecture · 8 unmodified lines
44114889 Principles of Operation Book in the Chapter for Dynamic Address Translation
44124890 (DAT)

1015 more lines aren’t shown here.

Documentation/virt/kvm/arm/hyp-abi.rstrenamed from Documentation/virt/kvm/arm/hyp-abi.txt+19−9
@@ -1,4 +1,8 @@
1−* Internal ABI between the kernel and HYP
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=======================================
4+Internal ABI between the kernel and HYP
5+=======================================
26
37 This file documents the interaction between the Linux kernel and the
48 hypervisor layer when running Linux as a hypervisor (for example
@@ -19,25 +23,31 @@ and only act on individual CPUs. · 14 unmodified lines
1923 Unless specified otherwise, any built-in hypervisor must implement
2024 these functions (see arch/arm{,64}/include/asm/virt.h):
2125
22−* r0/x0 = HVC_SET_VECTORS
23− r1/x1 = vectors
26+* ::
27+
28+ r0/x0 = HVC_SET_VECTORS
29+ r1/x1 = vectors
2430
2531 Set HVBAR/VBAR_EL2 to 'vectors' to enable a hypervisor. 'vectors'
2632 must be a physical address, and respect the alignment requirements
2733 of the architecture. Only implemented by the initial stubs, not by
2834 Linux hypervisors.
2935
30−* r0/x0 = HVC_RESET_VECTORS
36+* ::
37+
38+ r0/x0 = HVC_RESET_VECTORS
3139
3240 Turn HYP/EL2 MMU off, and reset HVBAR/VBAR_EL2 to the initials
3341 stubs' exception vector value. This effectively disables an existing
3442 hypervisor.
3543
36−* r0/x0 = HVC_SOFT_RESTART
37− r1/x1 = restart address
38− x2 = x0's value when entering the next payload (arm64)
39− x3 = x1's value when entering the next payload (arm64)
40− x4 = x2's value when entering the next payload (arm64)
44+* ::
45+
46+ r0/x0 = HVC_SOFT_RESTART
47+ r1/x1 = restart address
48+ x2 = x0's value when entering the next payload (arm64)
49+ x3 = x1's value when entering the next payload (arm64)
50+ x4 = x2's value when entering the next payload (arm64)
4151
4252 Mask all exceptions, disable the MMU, move the arguments into place
4353 (arm64 only), and jump to the restart address while at HYP/EL2. This
Documentation/virt/kvm/arm/index.rst+12−0
@@ -0,0 +1,12 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===
4+ARM
5+===
6+
7+.. toctree::
8+ :maxdepth: 2
9+
10+ hyp-abi
11+ psci
12+ pvtime
Documentation/virt/kvm/arm/psci.rstrenamed from Documentation/virt/kvm/arm/psci.txt+31−15
@@ -1,3 +1,9 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=========================================
4+Power State Coordination Interface (PSCI)
5+=========================================
6+
17 KVM implements the PSCI (Power State Coordination Interface)
28 specification in order to provide services such as CPU on/off, reset
39 and power-off to the guest.
@@ -30,32 +36,42 @@ The following register is defined: · 26 unmodified lines
3036 - Affects the whole VM (even if the register view is per-vcpu)
3137
3238 * KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1:
33− Holds the state of the firmware support to mitigate CVE-2017-5715, as
34− offered by KVM to the guest via a HVC call. The workaround is described
35− under SMCCC_ARCH_WORKAROUND_1 in [1].
39+ Holds the state of the firmware support to mitigate CVE-2017-5715, as
40+ offered by KVM to the guest via a HVC call. The workaround is described
41+ under SMCCC_ARCH_WORKAROUND_1 in [1].
42+
3643 Accepted values are:
37− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL: KVM does not offer
44+
45+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL:
46+ KVM does not offer
3847 firmware support for the workaround. The mitigation status for the
3948 guest is unknown.
40− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL: The workaround HVC call is
49+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL:
50+ The workaround HVC call is
4151 available to the guest and required for the mitigation.
42− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED: The workaround HVC call
52+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED:
53+ The workaround HVC call
4354 is available to the guest, but it is not needed on this VCPU.
4455
4556 * KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2:
46− Holds the state of the firmware support to mitigate CVE-2018-3639, as
47− offered by KVM to the guest via a HVC call. The workaround is described
48− under SMCCC_ARCH_WORKAROUND_2 in [1].
57+ Holds the state of the firmware support to mitigate CVE-2018-3639, as
58+ offered by KVM to the guest via a HVC call. The workaround is described
59+ under SMCCC_ARCH_WORKAROUND_2 in [1]_.
60+
4961 Accepted values are:
50− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL: A workaround is not
62+
63+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL:
64+ A workaround is not
5165 available. KVM does not offer firmware support for the workaround.
52− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN: The workaround state is
66+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN:
67+ The workaround state is
5368 unknown. KVM does not offer firmware support for the workaround.
54− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_AVAIL: The workaround is available,
69+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_AVAIL:
70+ The workaround is available,
5571 and can be disabled by a vCPU. If
5672 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED is set, it is active for
5773 this vCPU.
58− KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED: The workaround is
59− always active on this vCPU or it is not needed.
74+ KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED:
75+ The workaround is always active on this vCPU or it is not needed.
6076
61−[1] https://developer.arm.com/-/media/developer/pdf/ARM_DEN_0070A_Firmware_interfaces_for_mitigating_CVE-2017-5715.pdf
77+.. [1] https://developer.arm.com/-/media/developer/pdf/ARM_DEN_0070A_Firmware_interfaces_for_mitigating_CVE-2017-5715.pdf
Documentation/virt/kvm/devices/arm-vgic-its.rstrenamed from Documentation/virt/kvm/devices/arm-vgic-its.txt+67−39
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===============================================
14 ARM Virtual Interrupt Translation Service (ITS)
25 ===============================================
36
@@ -12,22 +15,32 @@ There can be multiple ITS controllers per guest, each of them has to have · 8 unmodified lines
1215 a separate, non-overlapping MMIO region.
1316
1417
15−Groups:
16− KVM_DEV_ARM_VGIC_GRP_ADDR
18+Groups
19+======
20+
21+KVM_DEV_ARM_VGIC_GRP_ADDR
22+-------------------------
23+
1724 Attributes:
1825 KVM_VGIC_ITS_ADDR_TYPE (rw, 64-bit)
1926 Base address in the guest physical address space of the GICv3 ITS
2027 control register frame.
2128 This address needs to be 64K aligned and the region covers 128K.
29+
2230 Errors:
23− -E2BIG: Address outside of addressable IPA range
24− -EINVAL: Incorrectly aligned address
25− -EEXIST: Address already configured
26− -EFAULT: Invalid user pointer for attr->addr.
27− -ENODEV: Incorrect attribute or the ITS is not supported.
2831
32+ ======= =================================================
33+ -E2BIG Address outside of addressable IPA range
34+ -EINVAL Incorrectly aligned address
35+ -EEXIST Address already configured
36+ -EFAULT Invalid user pointer for attr->addr.
37+ -ENODEV Incorrect attribute or the ITS is not supported.
38+ ======= =================================================
39+
40+
41+KVM_DEV_ARM_VGIC_GRP_CTRL
42+-------------------------
2943
30− KVM_DEV_ARM_VGIC_GRP_CTRL
3144 Attributes:
3245 KVM_DEV_ARM_VGIC_CTRL_INIT
3346 request the initialization of the ITS, no additional parameter in
@@ -58,16 +71,21 @@ Groups: · 24 unmodified lines
5871 "ITS Restore Sequence".
5972
6073 Errors:
61− -ENXIO: ITS not properly configured as required prior to setting
74+
75+ ======= ==========================================================
76+ -ENXIO ITS not properly configured as required prior to setting
6277 this attribute
63− -ENOMEM: Memory shortage when allocating ITS internal data
64− -EINVAL: Inconsistent restored data
65− -EFAULT: Invalid guest ram access
66− -EBUSY: One or more VCPUS are running
67− -EACCES: The virtual ITS is backed by a physical GICv4 ITS, and the
78+ -ENOMEM Memory shortage when allocating ITS internal data
79+ -EINVAL Inconsistent restored data
80+ -EFAULT Invalid guest ram access
81+ -EBUSY One or more VCPUS are running
82+ -EACCES The virtual ITS is backed by a physical GICv4 ITS, and the
6883 state is not available
84+ ======= ==========================================================
85+
86+KVM_DEV_ARM_VGIC_GRP_ITS_REGS
87+-----------------------------
6988
70− KVM_DEV_ARM_VGIC_GRP_ITS_REGS
7189 Attributes:
7290 The attr field of kvm_device_attr encodes the offset of the
7391 ITS register, relative to the ITS control frame base address
@@ -78,6 +96,7 @@ Groups: · 4 unmodified lines
7896 be accessed with full length.
7997
8098 Writes to read-only registers are ignored by the kernel except for:
99+
81100 - GITS_CREADR. It must be restored otherwise commands in the queue
82101 will be re-executed after restoring CWRITER. GITS_CREADR must be
83102 restored before restoring the GITS_CTLR which is likely to enable the
@@ -91,30 +110,36 @@ Groups: · 7 unmodified lines
91110
92111 For other registers, getting or setting a register has the same
93112 effect as reading/writing the register on real hardware.
113+
94114 Errors:
95− -ENXIO: Offset does not correspond to any supported register
96− -EFAULT: Invalid user pointer for attr->addr
97− -EINVAL: Offset is not 64-bit aligned
98− -EBUSY: one or more VCPUS are running
99115
100− ITS Restore Sequence:
101− -------------------------
116+ ======= ====================================================
117+ -ENXIO Offset does not correspond to any supported register
118+ -EFAULT Invalid user pointer for attr->addr
119+ -EINVAL Offset is not 64-bit aligned
120+ -EBUSY one or more VCPUS are running
121+ ======= ====================================================
122+
123+ITS Restore Sequence:
124+---------------------
102125
103126 The following ordering must be followed when restoring the GIC and the ITS:
127+
104128 a) restore all guest memory and create vcpus
105129 b) restore all redistributors
106130 c) provide the ITS base address
107131 (KVM_DEV_ARM_VGIC_GRP_ADDR)
108132 d) restore the ITS in the following order:
109− 1. Restore GITS_CBASER
110− 2. Restore all other GITS_ registers, except GITS_CTLR!
111− 3. Load the ITS table data (KVM_DEV_ARM_ITS_RESTORE_TABLES)
112− 4. Restore GITS_CTLR
133+
134+ 1. Restore GITS_CBASER
135+ 2. Restore all other ``GITS_`` registers, except GITS_CTLR!
136+ 3. Load the ITS table data (KVM_DEV_ARM_ITS_RESTORE_TABLES)
137+ 4. Restore GITS_CTLR
113138
114139 Then vcpus can be started.
115140
116− ITS Table ABI REV0:
117− -------------------
141+ITS Table ABI REV0:
142+-------------------
118143
119144 Revision 0 of the ABI only supports the features of a virtual GICv3, and does
120145 not support a virtual GICv4 with support for direct injection of virtual
@@ -125,12 +150,13 @@ Then vcpus can be started. · 4 unmodified lines
125150 entries in the collection are listed in no particular order.
126151 All entries are 8 bytes.
127152
128− Device Table Entry (DTE):
153+ Device Table Entry (DTE)::
129154
130− bits: | 63| 62 ... 49 | 48 ... 5 | 4 ... 0 |
131− values: | V | next | ITT_addr | Size |
155+ bits: | 63| 62 ... 49 | 48 ... 5 | 4 ... 0 |
156+ values: | V | next | ITT_addr | Size |
157+
158+ where:
132159
133− where;
134160 - V indicates whether the entry is valid. If not, other fields
135161 are not meaningful.
136162 - next: equals to 0 if this entry is the last one; otherwise it
@@ -140,32 +166,34 @@ Then vcpus can be started. · 3 unmodified lines
140166 - Size specifies the supported number of bits for the EventID,
141167 minus one
142168
143− Collection Table Entry (CTE):
169+ Collection Table Entry (CTE)::
144170
145− bits: | 63| 62 .. 52 | 51 ... 16 | 15 ... 0 |
146− values: | V | RES0 | RDBase | ICID |
171+ bits: | 63| 62 .. 52 | 51 ... 16 | 15 ... 0 |
172+ values: | V | RES0 | RDBase | ICID |
147173
148174 where:
175+
149176 - V indicates whether the entry is valid. If not, other fields are
150177 not meaningful.
151178 - RES0: reserved field with Should-Be-Zero-or-Preserved behavior.
152179 - RDBase is the PE number (GICR_TYPER.Processor_Number semantic),
153180 - ICID is the collection ID
154181
155− Interrupt Translation Entry (ITE):
182+ Interrupt Translation Entry (ITE)::
156183
157− bits: | 63 ... 48 | 47 ... 16 | 15 ... 0 |
158− values: | next | pINTID | ICID |
184+ bits: | 63 ... 48 | 47 ... 16 | 15 ... 0 |
185+ values: | next | pINTID | ICID |
159186
160187 where:
188+
161189 - next: equals to 0 if this entry is the last one; otherwise it corresponds
162190 to the EventID offset to the next ITE capped by 2^16 -1.
163191 - pINTID is the physical LPI ID; if zero, it means the entry is not valid
164192 and other fields are not meaningful.
165193 - ICID is the collection ID
166194
167− ITS Reset State:
168− ----------------
195+ITS Reset State:
196+----------------
169197
170198 RESET returns the ITS to the same state that it was when first created and
171199 initialized. When the RESET command returns, the following things are
Documentation/virt/kvm/devices/arm-vgic-v3.rstrenamed from Documentation/virt/kvm/devices/arm-vgic-v3.txt+86−46
@@ -1,9 +1,12 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==============================================================
14 ARM Virtual Generic Interrupt Controller v3 and later (VGICv3)
25 ==============================================================
36
47
58 Device types supported:
6− KVM_DEV_TYPE_ARM_VGIC_V3 ARM Generic Interrupt Controller v3.0
9+ - KVM_DEV_TYPE_ARM_VGIC_V3 ARM Generic Interrupt Controller v3.0
710
811 Only one VGIC instance may be instantiated through this API. The created VGIC
912 will act as the VM interrupt controller, requiring emulated user-space devices
@@ -15,7 +18,8 @@ Creating a guest GICv3 device requires a host GICv3 as well. · 5 unmodified lines
1518
1619 Groups:
1720 KVM_DEV_ARM_VGIC_GRP_ADDR
18− Attributes:
21+ Attributes:
22+
1923 KVM_VGIC_V3_ADDR_TYPE_DIST (rw, 64-bit)
2024 Base address in the guest physical address space of the GICv3 distributor
2125 register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V3.
@@ -29,21 +33,25 @@ Groups: · 7 unmodified lines
2933 This address needs to be 64K aligned.
3034
3135 KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION (rw, 64-bit)
32− The attribute data pointed to by kvm_device_attr.addr is a __u64 value:
33− bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 0
34− values: | count | base | flags | index
36+ The attribute data pointed to by kvm_device_attr.addr is a __u64 value::
37+
38+ bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 0
39+ values: | count | base | flags | index
40+
3541 - index encodes the unique redistributor region index
3642 - flags: reserved for future use, currently 0
3743 - base field encodes bits [51:16] of the guest physical base address
3844 of the first redistributor in the region.
3945 - count encodes the number of redistributors in the region. Must be
4046 greater than 0.
47+
4148 There are two 64K pages for each redistributor in the region and
4249 redistributors are laid out contiguously within the region. Regions
4350 are filled with redistributors in the index order. The sum of all
4451 region count fields must be greater than or equal to the number of
4552 VCPUs. Redistributor regions must be registered in the incremental
4653 index order, starting from index 0.
54+
4755 The characteristics of a specific redistributor region can be read
4856 by presetting the index field in the attr data.
4957 Only valid for KVM_DEV_TYPE_ARM_VGIC_V3.
@@ -52,23 +60,27 @@ Groups: · 2 unmodified lines
5260 KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attributes.
5361
5462 Errors:
55− -E2BIG: Address outside of addressable IPA range
56− -EINVAL: Incorrectly aligned address, bad redistributor region
63+
64+ ======= =============================================================
65+ -E2BIG Address outside of addressable IPA range
66+ -EINVAL Incorrectly aligned address, bad redistributor region
5767 count/index, mixed redistributor region attribute usage
58− -EEXIST: Address already configured
59− -ENOENT: Attempt to read the characteristics of a non existing
68+ -EEXIST Address already configured
69+ -ENOENT Attempt to read the characteristics of a non existing
6070 redistributor region
61− -ENXIO: The group or attribute is unknown/unsupported for this device
71+ -ENXIO The group or attribute is unknown/unsupported for this device
6272 or hardware support is missing.
63− -EFAULT: Invalid user pointer for attr->addr.
73+ -EFAULT Invalid user pointer for attr->addr.
74+ ======= =============================================================
75+
6476
77+ KVM_DEV_ARM_VGIC_GRP_DIST_REGS, KVM_DEV_ARM_VGIC_GRP_REDIST_REGS
78+ Attributes:
6579
66− KVM_DEV_ARM_VGIC_GRP_DIST_REGS
67− KVM_DEV_ARM_VGIC_GRP_REDIST_REGS
68− Attributes:
69− The attr field of kvm_device_attr encodes two values:
70− bits: | 63 .... 32 | 31 .... 0 |
71− values: | mpidr | offset |
80+ The attr field of kvm_device_attr encodes two values::
81+
82+ bits: | 63 .... 32 | 31 .... 0 |
83+ values: | mpidr | offset |
7284
7385 All distributor regs are (rw, 32-bit) and kvm_device_attr.addr points to a
7486 __u32 value. 64-bit registers must be accessed by separately accessing the
@@ -93,7 +105,8 @@ Groups: · 18 unmodified lines
93105 redistributor is accessed. The mpidr is ignored for the distributor.
94106
95107 The mpidr encoding is based on the affinity information in the
96− architecture defined MPIDR, and the field is encoded as follows:
108+ architecture defined MPIDR, and the field is encoded as follows::
109+
97110 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |
98111 | Aff3 | Aff2 | Aff1 | Aff0 |
99112
@@ -148,24 +161,30 @@ Groups: · 48 unmodified lines
148161 ignored.
149162
150163 Errors:
151− -ENXIO: Getting or setting this register is not yet supported
152− -EBUSY: One or more VCPUs are running
164+
165+ ====== =====================================================
166+ -ENXIO Getting or setting this register is not yet supported
167+ -EBUSY One or more VCPUs are running
168+ ====== =====================================================
153169
154170
155171 KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS
156− Attributes:
157− The attr field of kvm_device_attr encodes two values:
158− bits: | 63 .... 32 | 31 .... 16 | 15 .... 0 |
159− values: | mpidr | RES | instr |
172+ Attributes:
173+
174+ The attr field of kvm_device_attr encodes two values::
175+
176+ bits: | 63 .... 32 | 31 .... 16 | 15 .... 0 |
177+ values: | mpidr | RES | instr |
160178
161179 The mpidr field encodes the CPU ID based on the affinity information in the
162− architecture defined MPIDR, and the field is encoded as follows:
180+ architecture defined MPIDR, and the field is encoded as follows::
181+
163182 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |
164183 | Aff3 | Aff2 | Aff1 | Aff0 |
165184
166185 The instr field encodes the system register to access based on the fields
167186 defined in the A64 instruction set encoding for system register access
168− (RES means the bits are reserved for future use and should be zero):
187+ (RES means the bits are reserved for future use and should be zero)::
169188
170189 | 15 ... 14 | 13 ... 11 | 10 ... 7 | 6 ... 3 | 2 ... 0 |
171190 | Op 0 | Op1 | CRn | CRm | Op2 |
@@ -178,26 +197,35 @@ Groups: · 6 unmodified lines
178197
179198 CPU interface registers access is not implemented for AArch32 mode.
180199 Error -ENXIO is returned when accessed in AArch32 mode.
200+
181201 Errors:
182− -ENXIO: Getting or setting this register is not yet supported
183− -EBUSY: VCPU is running
184− -EINVAL: Invalid mpidr or register value supplied
202+
203+ ======= =====================================================
204+ -ENXIO Getting or setting this register is not yet supported
205+ -EBUSY VCPU is running
206+ -EINVAL Invalid mpidr or register value supplied
207+ ======= =====================================================
185208
186209
187210 KVM_DEV_ARM_VGIC_GRP_NR_IRQS
188− Attributes:
211+ Attributes:
212+
189213 A value describing the number of interrupts (SGI, PPI and SPI) for
190214 this GIC instance, ranging from 64 to 1024, in increments of 32.
191215
192216 kvm_device_attr.addr points to a __u32 value.
193217
194218 Errors:
195− -EINVAL: Value set is out of the expected range
196− -EBUSY: Value has already be set.
219+
220+ ======= ======================================
221+ -EINVAL Value set is out of the expected range
222+ -EBUSY Value has already be set.
223+ ======= ======================================
197224
198225
199226 KVM_DEV_ARM_VGIC_GRP_CTRL
200− Attributes:
227+ Attributes:
228+
201229 KVM_DEV_ARM_VGIC_CTRL_INIT
202230 request the initialization of the VGIC, no additional parameter in
203231 kvm_device_attr.addr.
@@ -205,20 +233,26 @@ Groups: · 1 unmodified line
205233 save all LPI pending bits into guest RAM pending tables.
206234
207235 The first kB of the pending table is not altered by this operation.
236+
208237 Errors:
209− -ENXIO: VGIC not properly configured as required prior to calling
210− this attribute
211− -ENODEV: no online VCPU
212− -ENOMEM: memory shortage when allocating vgic internal data
213− -EFAULT: Invalid guest ram access
214− -EBUSY: One or more VCPUS are running
238+
239+ ======= ========================================================
240+ -ENXIO VGIC not properly configured as required prior to calling
241+ this attribute
242+ -ENODEV no online VCPU
243+ -ENOMEM memory shortage when allocating vgic internal data
244+ -EFAULT Invalid guest ram access
245+ -EBUSY One or more VCPUS are running
246+ ======= ========================================================
215247
216248
217249 KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO
218− Attributes:
219− The attr field of kvm_device_attr encodes the following values:
220− bits: | 63 .... 32 | 31 .... 10 | 9 .... 0 |
221− values: | mpidr | info | vINTID |
250+ Attributes:
251+
252+ The attr field of kvm_device_attr encodes the following values::
253+
254+ bits: | 63 .... 32 | 31 .... 10 | 9 .... 0 |
255+ values: | mpidr | info | vINTID |
222256
223257 The vINTID specifies which set of IRQs is reported on.
224258
@@ -228,6 +262,7 @@ Groups: · 3 unmodified lines
228262 VGIC_LEVEL_INFO_LINE_LEVEL:
229263 Get/Set the input level of the IRQ line for a set of 32 contiguously
230264 numbered interrupts.
265+
231266 vINTID must be a multiple of 32.
232267
233268 kvm_device_attr.addr points to a __u32 value which will contain a
@@ -243,9 +278,14 @@ Groups: · 9 unmodified lines
243278 reported with the same value regardless of the mpidr specified.
244279
245280 The mpidr field encodes the CPU ID based on the affinity information in the
246− architecture defined MPIDR, and the field is encoded as follows:
281+ architecture defined MPIDR, and the field is encoded as follows::
282+
247283 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |
248284 | Aff3 | Aff2 | Aff1 | Aff0 |
285+
249286 Errors:
250− -EINVAL: vINTID is not multiple of 32 or
251− info field is not VGIC_LEVEL_INFO_LINE_LEVEL
287+
288+ ======= =============================================
289+ -EINVAL vINTID is not multiple of 32 or info field is
290+ not VGIC_LEVEL_INFO_LINE_LEVEL
291+ ======= =============================================
Documentation/virt/kvm/devices/arm-vgic.rstrenamed from Documentation/virt/kvm/devices/arm-vgic.txt+59−30
@@ -1,8 +1,12 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==================================================
14 ARM Virtual Generic Interrupt Controller v2 (VGIC)
25 ==================================================
36
47 Device types supported:
5− KVM_DEV_TYPE_ARM_VGIC_V2 ARM Generic Interrupt Controller v2.0
8+
9+ - KVM_DEV_TYPE_ARM_VGIC_V2 ARM Generic Interrupt Controller v2.0
610
711 Only one VGIC instance may be instantiated through either this API or the
812 legacy KVM_CREATE_IRQCHIP API. The created VGIC will act as the VM interrupt
@@ -17,7 +21,8 @@ create both a GICv3 and GICv2 device on the same VM. · 8 unmodified lines
1721
1822 Groups:
1923 KVM_DEV_ARM_VGIC_GRP_ADDR
20− Attributes:
24+ Attributes:
25+
2126 KVM_VGIC_V2_ADDR_TYPE_DIST (rw, 64-bit)
2227 Base address in the guest physical address space of the GIC distributor
2328 register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2.
@@ -27,19 +32,25 @@ Groups: · 3 unmodified lines
2732 Base address in the guest physical address space of the GIC virtual cpu
2833 interface register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2.
2934 This address needs to be 4K aligned and the region covers 4 KByte.
35+
3036 Errors:
31− -E2BIG: Address outside of addressable IPA range
32− -EINVAL: Incorrectly aligned address
33− -EEXIST: Address already configured
34− -ENXIO: The group or attribute is unknown/unsupported for this device
37+
38+ ======= =============================================================
39+ -E2BIG Address outside of addressable IPA range
40+ -EINVAL Incorrectly aligned address
41+ -EEXIST Address already configured
42+ -ENXIO The group or attribute is unknown/unsupported for this device
3543 or hardware support is missing.
36− -EFAULT: Invalid user pointer for attr->addr.
44+ -EFAULT Invalid user pointer for attr->addr.
45+ ======= =============================================================
3746
3847 KVM_DEV_ARM_VGIC_GRP_DIST_REGS
39− Attributes:
40− The attr field of kvm_device_attr encodes two values:
41− bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |
42− values: | reserved | vcpu_index | offset |
48+ Attributes:
49+
50+ The attr field of kvm_device_attr encodes two values::
51+
52+ bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |
53+ values: | reserved | vcpu_index | offset |
4354
4455 All distributor regs are (rw, 32-bit)
4556
@@ -58,16 +69,22 @@ Groups: · 12 unmodified lines
5869 KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_CPU_REGS) to ensure
5970 the expected behavior. Unless GICD_IIDR has been set from userspace, writes
6071 to the interrupt group registers (GICD_IGROUPR) are ignored.
72+
6173 Errors:
62− -ENXIO: Getting or setting this register is not yet supported
63− -EBUSY: One or more VCPUs are running
64− -EINVAL: Invalid vcpu_index supplied
74+
75+ ======= =====================================================
76+ -ENXIO Getting or setting this register is not yet supported
77+ -EBUSY One or more VCPUs are running
78+ -EINVAL Invalid vcpu_index supplied
79+ ======= =====================================================
6580
6681 KVM_DEV_ARM_VGIC_GRP_CPU_REGS
67− Attributes:
68− The attr field of kvm_device_attr encodes two values:
69− bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |
70− values: | reserved | vcpu_index | offset |
82+ Attributes:
83+
84+ The attr field of kvm_device_attr encodes two values::
85+
86+ bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |
87+ values: | reserved | vcpu_index | offset |
7188
7289 All CPU interface regs are (rw, 32-bit)
7390
@@ -101,27 +118,39 @@ Groups: · 27 unmodified lines
101118 value left by 3 places to obtain the actual priority mask level.
102119
103120 Errors:
104− -ENXIO: Getting or setting this register is not yet supported
105− -EBUSY: One or more VCPUs are running
106− -EINVAL: Invalid vcpu_index supplied
121+
122+ ======= =====================================================
123+ -ENXIO Getting or setting this register is not yet supported
124+ -EBUSY One or more VCPUs are running
125+ -EINVAL Invalid vcpu_index supplied
126+ ======= =====================================================
107127
108128 KVM_DEV_ARM_VGIC_GRP_NR_IRQS
109− Attributes:
129+ Attributes:
130+
110131 A value describing the number of interrupts (SGI, PPI and SPI) for
111132 this GIC instance, ranging from 64 to 1024, in increments of 32.
112133
113134 Errors:
114− -EINVAL: Value set is out of the expected range
115− -EBUSY: Value has already be set, or GIC has already been initialized
116− with default values.
135+
136+ ======= =============================================================
137+ -EINVAL Value set is out of the expected range
138+ -EBUSY Value has already be set, or GIC has already been initialized
139+ with default values.
140+ ======= =============================================================
117141
118142 KVM_DEV_ARM_VGIC_GRP_CTRL
119− Attributes:
143+ Attributes:
144+
120145 KVM_DEV_ARM_VGIC_CTRL_INIT
121146 request the initialization of the VGIC or ITS, no additional parameter
122147 in kvm_device_attr.addr.
148+
123149 Errors:
124− -ENXIO: VGIC not properly configured as required prior to calling
125− this attribute
126− -ENODEV: no online VCPU
127− -ENOMEM: memory shortage when allocating vgic internal data
150+
151+ ======= =========================================================
152+ -ENXIO VGIC not properly configured as required prior to calling
153+ this attribute
154+ -ENODEV no online VCPU
155+ -ENOMEM memory shortage when allocating vgic internal data
156+ ======= =========================================================
Documentation/virt/kvm/devices/index.rst+19−0
@@ -0,0 +1,19 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=======
4+Devices
5+=======
6+
7+.. toctree::
8+ :maxdepth: 2
9+
10+ arm-vgic-its
11+ arm-vgic
12+ arm-vgic-v3
13+ mpic
14+ s390_flic
15+ vcpu
16+ vfio
17+ vm
18+ xics
19+ xive
Documentation/virt/kvm/devices/mpic.rstrenamed from Documentation/virt/kvm/devices/mpic.txt+8−3
@@ -1,9 +1,13 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=========================
14 MPIC interrupt controller
25 =========================
36
47 Device types supported:
5− KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.0
6− KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.2
8+
9+ - KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.0
10+ - KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.2
711
812 Only one MPIC instance, of any type, may be instantiated. The created
913 MPIC will act as the system interrupt controller, connecting to each
@@ -11,7 +15,8 @@ vcpu's interrupt inputs. · 1 unmodified line
1115
1216 Groups:
1317 KVM_DEV_MPIC_GRP_MISC
14− Attributes:
18+ Attributes:
19+
1520 KVM_DEV_MPIC_BASE_ADDR (rw, 64-bit)
1621 Base address of the 256 KiB MPIC register space. Must be
1722 naturally aligned. A value of zero disables the mapping.
Documentation/virt/kvm/devices/s390_flic.rstrenamed from Documentation/virt/kvm/devices/s390_flic.txt+40−30
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+====================================
14 FLIC (floating interrupt controller)
25 ====================================
36
@@ -31,8 +34,10 @@ Groups: · 27 unmodified lines
3134 Copies all floating interrupts into a buffer provided by userspace.
3235 When the buffer is too small it returns -ENOMEM, which is the indication
3336 for userspace to try again with a bigger buffer.
37+
3438 -ENOBUFS is returned when the allocation of a kernelspace buffer has
3539 failed.
40+
3641 -EFAULT is returned when copying data to userspace failed.
3742 All interrupts remain pending, i.e. are not deleted from the list of
3843 currently pending interrupts.
@@ -60,38 +65,41 @@ Groups: · 21 unmodified lines
6065
6166 KVM_DEV_FLIC_ADAPTER_REGISTER
6267 Register an I/O adapter interrupt source. Takes a kvm_s390_io_adapter
63− describing the adapter to register:
68+ describing the adapter to register::
6469
65−struct kvm_s390_io_adapter {
66− __u32 id;
67− __u8 isc;
68− __u8 maskable;
69− __u8 swap;
70− __u8 flags;
71−};
70+ struct kvm_s390_io_adapter {
71+ __u32 id;
72+ __u8 isc;
73+ __u8 maskable;
74+ __u8 swap;
75+ __u8 flags;
76+ };
7277
7378 id contains the unique id for the adapter, isc the I/O interruption subclass
7479 to use, maskable whether this adapter may be masked (interrupts turned off),
7580 swap whether the indicators need to be byte swapped, and flags contains
7681 further characteristics of the adapter.
82+
7783 Currently defined values for 'flags' are:
84+
7885 - KVM_S390_ADAPTER_SUPPRESSIBLE: adapter is subject to AIS
7986 (adapter-interrupt-suppression) facility. This flag only has an effect if
8087 the AIS capability is enabled.
88+
8189 Unknown flag values are ignored.
8290
8391
8492 KVM_DEV_FLIC_ADAPTER_MODIFY
8593 Modifies attributes of an existing I/O adapter interrupt source. Takes
86− a kvm_s390_io_adapter_req specifying the adapter and the operation:
94+ a kvm_s390_io_adapter_req specifying the adapter and the operation::
8795
88−struct kvm_s390_io_adapter_req {
89− __u32 id;
90− __u8 type;
91− __u8 mask;
92− __u16 pad0;
93− __u64 addr;
94−};
96+ struct kvm_s390_io_adapter_req {
97+ __u32 id;
98+ __u8 type;
99+ __u8 mask;
100+ __u16 pad0;
101+ __u64 addr;
102+ };
95103
96104 id specifies the adapter and type the operation. The supported operations
97105 are:
@@ -103,8 +111,9 @@ struct kvm_s390_io_adapter_req { · 5 unmodified lines
103111 perform a gmap translation for the guest address provided in addr,
104112 pin a userspace page for the translated address and add it to the
105113 list of mappings
106− Note: A new mapping will be created unconditionally; therefore,
107− the calling code should avoid making duplicate mappings.
114+
115+ .. note:: A new mapping will be created unconditionally; therefore,
116+ the calling code should avoid making duplicate mappings.
108117
109118 KVM_S390_IO_ADAPTER_UNMAP
110119 release a userspace page for the translated address specified in addr
@@ -112,16 +121,17 @@ struct kvm_s390_io_adapter_req { · 1 unmodified line
112121
113122 KVM_DEV_FLIC_AISM
114123 modify the adapter-interruption-suppression mode for a given isc if the
115− AIS capability is enabled. Takes a kvm_s390_ais_req describing:
124+ AIS capability is enabled. Takes a kvm_s390_ais_req describing::
116125
117−struct kvm_s390_ais_req {
118− __u8 isc;
119− __u16 mode;
120−};
126+ struct kvm_s390_ais_req {
127+ __u8 isc;
128+ __u16 mode;
129+ };
121130
122131 isc contains the target I/O interruption subclass, mode the target
123132 adapter-interruption-suppression mode. The following modes are
124133 currently supported:
134+
125135 - KVM_S390_AIS_MODE_ALL: ALL-Interruptions Mode, i.e. airq injection
126136 is always allowed;
127137 - KVM_S390_AIS_MODE_SINGLE: SINGLE-Interruption Mode, i.e. airq
@@ -139,12 +149,12 @@ struct kvm_s390_ais_req { · 11 unmodified lines
139149
140150 KVM_DEV_FLIC_AISM_ALL
141151 Gets or sets the adapter-interruption-suppression mode for all ISCs. Takes
142− a kvm_s390_ais_all describing:
152+ a kvm_s390_ais_all describing::
143153
144−struct kvm_s390_ais_all {
145− __u8 simm; /* Single-Interruption-Mode mask */
146− __u8 nimm; /* No-Interruption-Mode mask *
147−};
154+ struct kvm_s390_ais_all {
155+ __u8 simm; /* Single-Interruption-Mode mask */
156+ __u8 nimm; /* No-Interruption-Mode mask *
157+ };
148158
149159 simm contains Single-Interruption-Mode mask for all ISCs, nimm contains
150160 No-Interruption-Mode mask for all ISCs. Each bit in simm and nimm corresponds
@@ -159,5 +169,5 @@ ENXIO, as specified in the API documentation). It is not possible to conclude · 8 unmodified lines
159169 that a FLIC operation is unavailable based on the error code resulting from a
160170 usage attempt.
161171
162−Note: The KVM_DEV_FLIC_CLEAR_IO_IRQ ioctl will return EINVAL in case a zero
163−schid is specified.
172+.. note:: The KVM_DEV_FLIC_CLEAR_IO_IRQ ioctl will return EINVAL in case a
173+ zero schid is specified.
Documentation/virt/kvm/devices/vcpu.rst+114−0
@@ -0,0 +1,114 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+======================
4+Generic vcpu interface
5+======================
6+
7+The virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
8+KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct
9+kvm_device_attr as other devices, but targets VCPU-wide settings and controls.
10+
11+The groups and attributes per virtual cpu, if any, are architecture specific.
12+
13+1. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL
14+==================================
15+
16+:Architectures: ARM64
17+
18+1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ
19+---------------------------------------
20+
21+:Parameters: in kvm_device_attr.addr the address for PMU overflow interrupt is a
22+ pointer to an int
23+
24+Returns:
25+
26+ ======= ========================================================
27+ -EBUSY The PMU overflow interrupt is already set
28+ -ENXIO The overflow interrupt not set when attempting to get it
29+ -ENODEV PMUv3 not supported
30+ -EINVAL Invalid PMU overflow interrupt number supplied or
31+ trying to set the IRQ number without using an in-kernel
32+ irqchip.
33+ ======= ========================================================
34+
35+A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt
36+number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt
37+type must be same for each vcpu. As a PPI, the interrupt number is the same for
38+all vcpus, while as an SPI it must be a separate number per vcpu.
39+
40+1.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT
41+---------------------------------------
42+
43+:Parameters: no additional parameter in kvm_device_attr.addr
44+
45+Returns:
46+
47+ ======= ======================================================
48+ -ENODEV PMUv3 not supported or GIC not initialized
49+ -ENXIO PMUv3 not properly configured or in-kernel irqchip not
50+ configured as required prior to calling this attribute
51+ -EBUSY PMUv3 already initialized
52+ ======= ======================================================
53+
54+Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel
55+virtual GIC implementation, this must be done after initializing the in-kernel
56+irqchip.
57+
58+
59+2. GROUP: KVM_ARM_VCPU_TIMER_CTRL
60+=================================
61+
62+:Architectures: ARM, ARM64
63+
64+2.1. ATTRIBUTES: KVM_ARM_VCPU_TIMER_IRQ_VTIMER, KVM_ARM_VCPU_TIMER_IRQ_PTIMER
65+-----------------------------------------------------------------------------
66+
67+:Parameters: in kvm_device_attr.addr the address for the timer interrupt is a
68+ pointer to an int
69+
70+Returns:
71+
72+ ======= =================================
73+ -EINVAL Invalid timer interrupt number
74+ -EBUSY One or more VCPUs has already run
75+ ======= =================================
76+
77+A value describing the architected timer interrupt number when connected to an
78+in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the
79+attribute overrides the default values (see below).
80+
81+============================= ==========================================
82+KVM_ARM_VCPU_TIMER_IRQ_VTIMER The EL1 virtual timer intid (default: 27)
83+KVM_ARM_VCPU_TIMER_IRQ_PTIMER The EL1 physical timer intid (default: 30)
84+============================= ==========================================
85+
86+Setting the same PPI for different timers will prevent the VCPUs from running.
87+Setting the interrupt number on a VCPU configures all VCPUs created at that
88+time to use the number provided for a given timer, overwriting any previously
89+configured values on other VCPUs. Userspace should configure the interrupt
90+numbers on at least one VCPU after creating all VCPUs and before running any
91+VCPUs.
92+
93+3. GROUP: KVM_ARM_VCPU_PVTIME_CTRL
94+==================================
95+
96+:Architectures: ARM64
97+
98+3.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA
99+--------------------------------------
100+
101+:Parameters: 64-bit base address
102+
103+Returns:
104+
105+ ======= ======================================
106+ -ENXIO Stolen time not implemented
107+ -EEXIST Base address already set for this VCPU
108+ -EINVAL Base address not 64 byte aligned
109+ ======= ======================================
110+
111+Specifies the base address of the stolen time structure for this VCPU. The
112+base address must be 64 byte aligned and exist within a valid guest memory
113+region. See Documentation/virt/kvm/arm/pvtime.txt for more information
114+including the layout of the stolen time structure.
Documentation/virt/kvm/devices/vcpu.txt+0−76
@@ -1,76 +0,0 @@
1−Generic vcpu interface
2−====================================
3−
4−The virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
5−KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct
6−kvm_device_attr as other devices, but targets VCPU-wide settings and controls.
7−
8−The groups and attributes per virtual cpu, if any, are architecture specific.
9−
10−1. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL
11−Architectures: ARM64
12−
13−1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ
14−Parameters: in kvm_device_attr.addr the address for PMU overflow interrupt is a
15− pointer to an int
16−Returns: -EBUSY: The PMU overflow interrupt is already set
17− -ENXIO: The overflow interrupt not set when attempting to get it
18− -ENODEV: PMUv3 not supported
19− -EINVAL: Invalid PMU overflow interrupt number supplied or
20− trying to set the IRQ number without using an in-kernel
21− irqchip.
22−
23−A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt
24−number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt
25−type must be same for each vcpu. As a PPI, the interrupt number is the same for
26−all vcpus, while as an SPI it must be a separate number per vcpu.
27−
28−1.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT
29−Parameters: no additional parameter in kvm_device_attr.addr
30−Returns: -ENODEV: PMUv3 not supported or GIC not initialized
31− -ENXIO: PMUv3 not properly configured or in-kernel irqchip not
32− configured as required prior to calling this attribute
33− -EBUSY: PMUv3 already initialized
34−
35−Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel
36−virtual GIC implementation, this must be done after initializing the in-kernel
37−irqchip.
38−
39−
40−2. GROUP: KVM_ARM_VCPU_TIMER_CTRL
41−Architectures: ARM,ARM64
42−
43−2.1. ATTRIBUTE: KVM_ARM_VCPU_TIMER_IRQ_VTIMER
44−2.2. ATTRIBUTE: KVM_ARM_VCPU_TIMER_IRQ_PTIMER
45−Parameters: in kvm_device_attr.addr the address for the timer interrupt is a
46− pointer to an int
47−Returns: -EINVAL: Invalid timer interrupt number
48− -EBUSY: One or more VCPUs has already run
49−
50−A value describing the architected timer interrupt number when connected to an
51−in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the
52−attribute overrides the default values (see below).
53−
54−KVM_ARM_VCPU_TIMER_IRQ_VTIMER: The EL1 virtual timer intid (default: 27)
55−KVM_ARM_VCPU_TIMER_IRQ_PTIMER: The EL1 physical timer intid (default: 30)
56−
57−Setting the same PPI for different timers will prevent the VCPUs from running.
58−Setting the interrupt number on a VCPU configures all VCPUs created at that
59−time to use the number provided for a given timer, overwriting any previously
60−configured values on other VCPUs. Userspace should configure the interrupt
61−numbers on at least one VCPU after creating all VCPUs and before running any
62−VCPUs.
63−
64−3. GROUP: KVM_ARM_VCPU_PVTIME_CTRL
65−Architectures: ARM64
66−
67−3.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA
68−Parameters: 64-bit base address
69−Returns: -ENXIO: Stolen time not implemented
70− -EEXIST: Base address already set for this VCPU
71− -EINVAL: Base address not 64 byte aligned
72−
73−Specifies the base address of the stolen time structure for this VCPU. The
74−base address must be 64 byte aligned and exist within a valid guest memory
75−region. See Documentation/virt/kvm/arm/pvtime.txt for more information
76−including the layout of the stolen time structure.
Documentation/virt/kvm/devices/vfio.rstrenamed from Documentation/virt/kvm/devices/vfio.txt+15−10
@@ -1,8 +1,12 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===================
14 VFIO virtual device
25 ===================
36
47 Device types supported:
5− KVM_DEV_TYPE_VFIO
8+
9+ - KVM_DEV_TYPE_VFIO
610
711 Only one VFIO instance may be created per VM. The created device
812 tracks VFIO groups in use by the VM and features of those groups
@@ -23,14 +27,15 @@ KVM_DEV_VFIO_GROUP attributes: · 14 unmodified lines
2327 for the VFIO group.
2428 KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table
2529 allocated by sPAPR KVM.
26− kvm_device_attr.addr points to a struct:
30+ kvm_device_attr.addr points to a struct::
31+
32+ struct kvm_vfio_spapr_tce {
33+ __s32 groupfd;
34+ __s32 tablefd;
35+ };
2736
28− struct kvm_vfio_spapr_tce {
29− __s32 groupfd;
30− __s32 tablefd;
31− };
37+ where:
3238
33− where
34− @groupfd is a file descriptor for a VFIO group;
35− @tablefd is a file descriptor for a TCE table allocated via
36− KVM_CREATE_SPAPR_TCE.
39+ - @groupfd is a file descriptor for a VFIO group;
40+ - @tablefd is a file descriptor for a TCE table allocated via
41+ KVM_CREATE_SPAPR_TCE.
Documentation/virt/kvm/devices/vm.rstrenamed from Documentation/virt/kvm/devices/vm.txt+126−80
@@ -1,5 +1,8 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+====================
14 Generic vm interface
2−====================================
5+====================
36
47 The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
58 KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same
@@ -10,30 +13,38 @@ The groups and attributes per virtual machine, if any, are architecture · 4 unmodified lines
1013 specific.
1114
1215 1. GROUP: KVM_S390_VM_MEM_CTRL
13−Architectures: s390
16+==============================
17+
18+:Architectures: s390
1419
1520 1.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA
16−Parameters: none
17−Returns: -EBUSY if a vcpu is already defined, otherwise 0
21+-------------------------------------------
22+
23+:Parameters: none
24+:Returns: -EBUSY if a vcpu is already defined, otherwise 0
1825
1926 Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.
2027
2128 1.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA
22−Parameters: none
23−Returns: -EINVAL if CMMA was not enabled
24− 0 otherwise
29+----------------------------------------
30+
31+:Parameters: none
32+:Returns: -EINVAL if CMMA was not enabled;
33+ 0 otherwise
2534
2635 Clear the CMMA status for all guest pages, so any pages the guest marked
2736 as unused are again used any may not be reclaimed by the host.
2837
2938 1.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE
30−Parameters: in attr->addr the address for the new limit of guest memory
31−Returns: -EFAULT if the given address is not accessible
32− -EINVAL if the virtual machine is of type UCONTROL
33− -E2BIG if the given guest memory is to big for that machine
34− -EBUSY if a vcpu is already defined
35− -ENOMEM if not enough memory is available for a new shadow guest mapping
36− 0 otherwise
39+-----------------------------------------
40+
41+:Parameters: in attr->addr the address for the new limit of guest memory
42+:Returns: -EFAULT if the given address is not accessible;
43+ -EINVAL if the virtual machine is of type UCONTROL;
44+ -E2BIG if the given guest memory is to big for that machine;
45+ -EBUSY if a vcpu is already defined;
46+ -ENOMEM if not enough memory is available for a new shadow guest mapping;
47+ 0 otherwise.
3748
3849 Allows userspace to query the actual limit and set a new limit for
3950 the maximum guest memory size. The limit will be rounded up to
@@ -42,78 +53,92 @@ the number of page table levels. In the case that there is no limit we will set · 2 unmodified lines
4253 the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX).
4354
4455 2. GROUP: KVM_S390_VM_CPU_MODEL
45−Architectures: s390
56+===============================
57+
58+:Architectures: s390
4659
4760 2.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o)
61+---------------------------------------------
4862
49−Allows user space to retrieve machine and kvm specific cpu related information:
63+Allows user space to retrieve machine and kvm specific cpu related information::
5064
51−struct kvm_s390_vm_cpu_machine {
65+ struct kvm_s390_vm_cpu_machine {
5266 __u64 cpuid; # CPUID of host
5367 __u32 ibc; # IBC level range offered by host
5468 __u8 pad[4];
5569 __u64 fac_mask[256]; # set of cpu facilities enabled by KVM
5670 __u64 fac_list[256]; # set of cpu facilities offered by host
57−}
71+ }
5872
59−Parameters: address of buffer to store the machine related cpu data
60− of type struct kvm_s390_vm_cpu_machine*
61−Returns: -EFAULT if the given address is not accessible from kernel space
62− -ENOMEM if not enough memory is available to process the ioctl
63− 0 in case of success
73+:Parameters: address of buffer to store the machine related cpu data
74+ of type struct kvm_s390_vm_cpu_machine*
75+:Returns: -EFAULT if the given address is not accessible from kernel space;
76+ -ENOMEM if not enough memory is available to process the ioctl;
77+ 0 in case of success.
6478
6579 2.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w)
80+===============================================
6681
67−Allows user space to retrieve or request to change cpu related information for a vcpu:
82+Allows user space to retrieve or request to change cpu related information for a vcpu::
6883
69−struct kvm_s390_vm_cpu_processor {
84+ struct kvm_s390_vm_cpu_processor {
7085 __u64 cpuid; # CPUID currently (to be) used by this vcpu
7186 __u16 ibc; # IBC level currently (to be) used by this vcpu
7287 __u8 pad[6];
7388 __u64 fac_list[256]; # set of cpu facilities currently (to be) used
74− # by this vcpu
75−}
89+ # by this vcpu
90+ }
7691
7792 KVM does not enforce or limit the cpu model data in any form. Take the information
7893 retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration
7994 setups. Instruction interceptions triggered by additionally set facility bits that
8095 are not handled by KVM need to by imlemented in the VM driver code.
8196
82−Parameters: address of buffer to store/set the processor related cpu
83− data of type struct kvm_s390_vm_cpu_processor*.
84−Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case)
85− -EFAULT if the given address is not accessible from kernel space
86− -ENOMEM if not enough memory is available to process the ioctl
87− 0 in case of success
97+:Parameters: address of buffer to store/set the processor related cpu
98+ data of type struct kvm_s390_vm_cpu_processor*.
99+:Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case);
100+ -EFAULT if the given address is not accessible from kernel space;
101+ -ENOMEM if not enough memory is available to process the ioctl;
102+ 0 in case of success.
103+
104+.. _KVM_S390_VM_CPU_MACHINE_FEAT:
88105
89106 2.3. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_FEAT (r/o)
107+--------------------------------------------------
90108
91109 Allows user space to retrieve available cpu features. A feature is available if
92110 provided by the hardware and supported by kvm. In theory, cpu features could
93111 even be completely emulated by kvm.
94112
95−struct kvm_s390_vm_cpu_feat {
96− __u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering
97−};
113+::
98114
99−Parameters: address of a buffer to load the feature list from.
100−Returns: -EFAULT if the given address is not accessible from kernel space.
101− 0 in case of success.
115+ struct kvm_s390_vm_cpu_feat {
116+ __u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering
117+ };
118+
119+:Parameters: address of a buffer to load the feature list from.
120+:Returns: -EFAULT if the given address is not accessible from kernel space;
121+ 0 in case of success.
102122
103123 2.4. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_FEAT (r/w)
124+----------------------------------------------------
104125
105126 Allows user space to retrieve or change enabled cpu features for all VCPUs of a
106127 VM. Features that are not available cannot be enabled.
107128
108−See 2.3. for a description of the parameter struct.
129+See :ref:`KVM_S390_VM_CPU_MACHINE_FEAT` for
130+a description of the parameter struct.
109131
110−Parameters: address of a buffer to store/load the feature list from.
111−Returns: -EFAULT if the given address is not accessible from kernel space.
112− -EINVAL if a cpu feature that is not available is to be enabled.
113− -EBUSY if at least one VCPU has already been defined.
132+:Parameters: address of a buffer to store/load the feature list from.
133+:Returns: -EFAULT if the given address is not accessible from kernel space;
134+ -EINVAL if a cpu feature that is not available is to be enabled;
135+ -EBUSY if at least one VCPU has already been defined;
114136 0 in case of success.
115137
138+.. _KVM_S390_VM_CPU_MACHINE_SUBFUNC:
139+
116140 2.5. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_SUBFUNC (r/o)
141+-----------------------------------------------------
117142
118143 Allows user space to retrieve available cpu subfunctions without any filtering
119144 done by a set IBC. These subfunctions are indicated to the guest VCPU via
@@ -126,7 +151,9 @@ contained in the returned struct. If the affected instruction · 6 unmodified lines
126151 indicates subfunctions via a "test bit" mechanism, the subfunction codes are
127152 contained in the returned struct in MSB 0 bit numbering.
128153
129−struct kvm_s390_vm_cpu_subfunc {
154+::
155+
156+ struct kvm_s390_vm_cpu_subfunc {
130157 u8 plo[32]; # always valid (ESA/390 feature)
131158 u8 ptff[16]; # valid with TOD-clock steering
132159 u8 kmac[16]; # valid with Message-Security-Assist
@@ -143,13 +170,14 @@ struct kvm_s390_vm_cpu_subfunc { · 10 unmodified lines
143170 u8 kma[16]; # valid with Message-Security-Assist-Extension 8
144171 u8 kdsa[16]; # valid with Message-Security-Assist-Extension 9
145172 u8 reserved[1792]; # reserved for future instructions
146−};
173+ };
147174
148−Parameters: address of a buffer to load the subfunction blocks from.
149−Returns: -EFAULT if the given address is not accessible from kernel space.
175+:Parameters: address of a buffer to load the subfunction blocks from.
176+:Returns: -EFAULT if the given address is not accessible from kernel space;
150177 0 in case of success.
151178
152179 2.6. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_SUBFUNC (r/w)
180+-------------------------------------------------------
153181
154182 Allows user space to retrieve or change cpu subfunctions to be indicated for
155183 all VCPUs of a VM. This attribute will only be available if kernel and
@@ -164,107 +192,125 @@ As long as no data has been written, a read will fail. The IBC will be used · 8 unmodified lines
164192 to determine available subfunctions in this case, this will guarantee backward
165193 compatibility.
166194
167−See 2.5. for a description of the parameter struct.
195+See :ref:`KVM_S390_VM_CPU_MACHINE_SUBFUNC` for a
196+description of the parameter struct.
168197
169−Parameters: address of a buffer to store/load the subfunction blocks from.
170−Returns: -EFAULT if the given address is not accessible from kernel space.
171− -EINVAL when reading, if there was no write yet.
172− -EBUSY if at least one VCPU has already been defined.
198+:Parameters: address of a buffer to store/load the subfunction blocks from.
199+:Returns: -EFAULT if the given address is not accessible from kernel space;
200+ -EINVAL when reading, if there was no write yet;
201+ -EBUSY if at least one VCPU has already been defined;
173202 0 in case of success.
174203
175204 3. GROUP: KVM_S390_VM_TOD
176−Architectures: s390
205+=========================
206+
207+:Architectures: s390
177208
178209 3.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH
210+------------------------------------
179211
180212 Allows user space to set/get the TOD clock extension (u8) (superseded by
181213 KVM_S390_VM_TOD_EXT).
182214
183−Parameters: address of a buffer in user space to store the data (u8) to
184−Returns: -EFAULT if the given address is not accessible from kernel space
215+:Parameters: address of a buffer in user space to store the data (u8) to
216+:Returns: -EFAULT if the given address is not accessible from kernel space;
185217 -EINVAL if setting the TOD clock extension to != 0 is not supported
186218
187219 3.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW
220+-----------------------------------
188221
189222 Allows user space to set/get bits 0-63 of the TOD clock register as defined in
190223 the POP (u64).
191224
192−Parameters: address of a buffer in user space to store the data (u64) to
193−Returns: -EFAULT if the given address is not accessible from kernel space
225+:Parameters: address of a buffer in user space to store the data (u64) to
226+:Returns: -EFAULT if the given address is not accessible from kernel space
194227
195228 3.3. ATTRIBUTE: KVM_S390_VM_TOD_EXT
229+-----------------------------------
230+
196231 Allows user space to set/get bits 0-63 of the TOD clock register as defined in
197232 the POP (u64). If the guest CPU model supports the TOD clock extension (u8), it
198233 also allows user space to get/set it. If the guest CPU model does not support
199234 it, it is stored as 0 and not allowed to be set to a value != 0.
200235
201−Parameters: address of a buffer in user space to store the data
202− (kvm_s390_vm_tod_clock) to
203−Returns: -EFAULT if the given address is not accessible from kernel space
236+:Parameters: address of a buffer in user space to store the data
237+ (kvm_s390_vm_tod_clock) to
238+:Returns: -EFAULT if the given address is not accessible from kernel space;
204239 -EINVAL if setting the TOD clock extension to != 0 is not supported
205240
206241 4. GROUP: KVM_S390_VM_CRYPTO
207−Architectures: s390
242+============================
243+
244+:Architectures: s390
208245
209246 4.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o)
247+------------------------------------------------------
210248
211249 Allows user space to enable aes key wrapping, including generating a new
212250 wrapping key.
213251
214−Parameters: none
215−Returns: 0
252+:Parameters: none
253+:Returns: 0
216254
217255 4.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o)
256+------------------------------------------------------
218257
219258 Allows user space to enable dea key wrapping, including generating a new
220259 wrapping key.
221260
222−Parameters: none
223−Returns: 0
261+:Parameters: none
262+:Returns: 0
224263
225264 4.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o)
265+-------------------------------------------------------
226266
227267 Allows user space to disable aes key wrapping, clearing the wrapping key.
228268
229−Parameters: none
230−Returns: 0
269+:Parameters: none
270+:Returns: 0
231271
232272 4.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o)
273+-------------------------------------------------------
233274
234275 Allows user space to disable dea key wrapping, clearing the wrapping key.
235276
236−Parameters: none
237−Returns: 0
277+:Parameters: none
278+:Returns: 0
238279
239280 5. GROUP: KVM_S390_VM_MIGRATION
240−Architectures: s390
281+===============================
282+
283+:Architectures: s390
241284
242285 5.1. ATTRIBUTE: KVM_S390_VM_MIGRATION_STOP (w/o)
286+------------------------------------------------
243287
244288 Allows userspace to stop migration mode, needed for PGSTE migration.
245289 Setting this attribute when migration mode is not active will have no
246290 effects.
247291
248−Parameters: none
249−Returns: 0
292+:Parameters: none
293+:Returns: 0
250294
251295 5.2. ATTRIBUTE: KVM_S390_VM_MIGRATION_START (w/o)
296+-------------------------------------------------
252297
253298 Allows userspace to start migration mode, needed for PGSTE migration.
254299 Setting this attribute when migration mode is already active will have
255300 no effects.
256301
257−Parameters: none
258−Returns: -ENOMEM if there is not enough free memory to start migration mode
259− -EINVAL if the state of the VM is invalid (e.g. no memory defined)
302+:Parameters: none
303+:Returns: -ENOMEM if there is not enough free memory to start migration mode;
304+ -EINVAL if the state of the VM is invalid (e.g. no memory defined);
260305 0 in case of success.
261306
262307 5.3. ATTRIBUTE: KVM_S390_VM_MIGRATION_STATUS (r/o)
308+--------------------------------------------------
263309
264310 Allows userspace to query the status of migration mode.
265311
266−Parameters: address of a buffer in user space to store the data (u64) to;
267− the data itself is either 0 if migration mode is disabled or 1
268− if it is enabled
269−Returns: -EFAULT if the given address is not accessible from kernel space
312+:Parameters: address of a buffer in user space to store the data (u64) to;
313+ the data itself is either 0 if migration mode is disabled or 1
314+ if it is enabled
315+:Returns: -EFAULT if the given address is not accessible from kernel space;
270316 0 in case of success.
Documentation/virt/kvm/devices/xics.rstrenamed from Documentation/virt/kvm/devices/xics.txt+22−6
@@ -1,20 +1,31 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=========================
14 XICS interrupt controller
5+=========================
26
37 Device type supported: KVM_DEV_TYPE_XICS
48
59 Groups:
610 1. KVM_DEV_XICS_GRP_SOURCES
7− Attributes: One per interrupt source, indexed by the source number.
11+ Attributes:
812
13+ One per interrupt source, indexed by the source number.
914 2. KVM_DEV_XICS_GRP_CTRL
10− Attributes:
11− 2.1 KVM_DEV_XICS_NR_SERVERS (write only)
15+ Attributes:
16+
17+ 2.1 KVM_DEV_XICS_NR_SERVERS (write only)
18+
1219 The kvm_device_attr.addr points to a __u32 value which is the number of
1320 interrupt server numbers (ie, highest possible vcpu id plus one).
21+
1422 Errors:
15− -EINVAL: Value greater than KVM_MAX_VCPU_ID.
16− -EFAULT: Invalid user pointer for attr->addr.
17− -EBUSY: A vcpu is already connected to the device.
23+
24+ ======= ==========================================
25+ -EINVAL Value greater than KVM_MAX_VCPU_ID.
26+ -EFAULT Invalid user pointer for attr->addr.
27+ -EBUSY A vcpu is already connected to the device.
28+ ======= ==========================================
1829
1930 This device emulates the XICS (eXternal Interrupt Controller
2031 Specification) defined in PAPR. The XICS has a set of interrupt
@@ -53,24 +64,29 @@ the interrupt source number. The 64 bit state word has the following · 32 unmodified lines
5364 bitfields, starting from the least-significant end of the word:
5465
5566 * Destination (server number), 32 bits
67+
5668 This specifies where the interrupt should be sent, and is the
5769 interrupt server number specified for the destination vcpu.
5870
5971 * Priority, 8 bits
72+
6073 This is the priority specified for this interrupt source, where 0 is
6174 the highest priority and 255 is the lowest. An interrupt with a
6275 priority of 255 will never be delivered.
6376
6477 * Level sensitive flag, 1 bit
78+
6579 This bit is 1 for a level-sensitive interrupt source, or 0 for
6680 edge-sensitive (or MSI).
6781
6882 * Masked flag, 1 bit
83+
6984 This bit is set to 1 if the interrupt is masked (cannot be delivered
7085 regardless of its priority), for example by the ibm,int-off RTAS
7186 call, or 0 if it is not masked.
7287
7388 * Pending flag, 1 bit
89+
7490 This bit is 1 if the source has a pending interrupt, otherwise 0.
7591
7692 Only one XICS instance may be created per VM.
Documentation/virt/kvm/devices/xive.rstrenamed from Documentation/virt/kvm/devices/xive.txt+97−55
@@ -1,8 +1,11 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===========================================================
14 POWER9 eXternal Interrupt Virtualization Engine (XIVE Gen1)
2−==========================================================
5+===========================================================
36
47 Device types supported:
5− KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1
8+ - KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1
69
710 This device acts as a VM interrupt controller. It provides the KVM
811 interface to configure the interrupt sources of a VM in the underlying
@@ -64,72 +67,100 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 55 unmodified lines
6467
6568 * Groups:
6669
67− 1. KVM_DEV_XIVE_GRP_CTRL
68− Provides global controls on the device
70+1. KVM_DEV_XIVE_GRP_CTRL
71+ Provides global controls on the device
72+
6973 Attributes:
7074 1.1 KVM_DEV_XIVE_RESET (write only)
7175 Resets the interrupt controller configuration for sources and event
7276 queues. To be used by kexec and kdump.
77+
7378 Errors: none
7479
7580 1.2 KVM_DEV_XIVE_EQ_SYNC (write only)
7681 Sync all the sources and queues and mark the EQ pages dirty. This
7782 to make sure that a consistent memory state is captured when
7883 migrating the VM.
84+
7985 Errors: none
8086
8187 1.3 KVM_DEV_XIVE_NR_SERVERS (write only)
8288 The kvm_device_attr.addr points to a __u32 value which is the number of
8389 interrupt server numbers (ie, highest possible vcpu id plus one).
90+
8491 Errors:
85− -EINVAL: Value greater than KVM_MAX_VCPU_ID.
86− -EFAULT: Invalid user pointer for attr->addr.
87− -EBUSY: A vCPU is already connected to the device.
8892
89− 2. KVM_DEV_XIVE_GRP_SOURCE (write only)
90− Initializes a new source in the XIVE device and mask it.
93+ ======= ==========================================
94+ -EINVAL Value greater than KVM_MAX_VCPU_ID.
95+ -EFAULT Invalid user pointer for attr->addr.
96+ -EBUSY A vCPU is already connected to the device.
97+ ======= ==========================================
98+
99+2. KVM_DEV_XIVE_GRP_SOURCE (write only)
100+ Initializes a new source in the XIVE device and mask it.
101+
91102 Attributes:
92103 Interrupt source number (64-bit)
93− The kvm_device_attr.addr points to a __u64 value:
94− bits: | 63 .... 2 | 1 | 0
95− values: | unused | level | type
104+
105+ The kvm_device_attr.addr points to a __u64 value::
106+
107+ bits: | 63 .... 2 | 1 | 0
108+ values: | unused | level | type
109+
96110 - type: 0:MSI 1:LSI
97111 - level: assertion level in case of an LSI.
112+
98113 Errors:
99− -E2BIG: Interrupt source number is out of range
100− -ENOMEM: Could not create a new source block
101− -EFAULT: Invalid user pointer for attr->addr.
102− -ENXIO: Could not allocate underlying HW interrupt
103114
104− 3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only)
105− Configures source targeting
115+ ======= ==========================================
116+ -E2BIG Interrupt source number is out of range
117+ -ENOMEM Could not create a new source block
118+ -EFAULT Invalid user pointer for attr->addr.
119+ -ENXIO Could not allocate underlying HW interrupt
120+ ======= ==========================================
121+
122+3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only)
123+ Configures source targeting
124+
106125 Attributes:
107126 Interrupt source number (64-bit)
108− The kvm_device_attr.addr points to a __u64 value:
109− bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0
110− values: | eisn | mask | server | priority
127+
128+ The kvm_device_attr.addr points to a __u64 value::
129+
130+ bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0
131+ values: | eisn | mask | server | priority
132+
111133 - priority: 0-7 interrupt priority level
112134 - server: CPU number chosen to handle the interrupt
113135 - mask: mask flag (unused)
114136 - eisn: Effective Interrupt Source Number
137+
115138 Errors:
116− -ENOENT: Unknown source number
117− -EINVAL: Not initialized source number
118− -EINVAL: Invalid priority
119− -EINVAL: Invalid CPU number.
120− -EFAULT: Invalid user pointer for attr->addr.
121− -ENXIO: CPU event queues not configured or configuration of the
122− underlying HW interrupt failed
123− -EBUSY: No CPU available to serve interrupt
124−
125− 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
126− Configures an event queue of a CPU
139+
140+ ======= =======================================================
141+ -ENOENT Unknown source number
142+ -EINVAL Not initialized source number
143+ -EINVAL Invalid priority
144+ -EINVAL Invalid CPU number.
145+ -EFAULT Invalid user pointer for attr->addr.
146+ -ENXIO CPU event queues not configured or configuration of the
147+ underlying HW interrupt failed
148+ -EBUSY No CPU available to serve interrupt
149+ ======= =======================================================
150+
151+4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
152+ Configures an event queue of a CPU
153+
127154 Attributes:
128155 EQ descriptor identifier (64-bit)
129− The EQ descriptor identifier is a tuple (server, priority) :
130− bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
131− values: | unused | server | priority
132− The kvm_device_attr.addr points to :
156+
157+ The EQ descriptor identifier is a tuple (server, priority)::
158+
159+ bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
160+ values: | unused | server | priority
161+
162+ The kvm_device_attr.addr points to::
163+
133164 struct kvm_ppc_xive_eq {
134165 __u32 flags;
135166 __u32 qshift;
@@ -138,8 +169,9 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 2 unmodified lines
138169 __u32 qindex;
139170 __u8 pad[40];
140171 };
172+
141173 - flags: queue flags
142− KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
174+ KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
143175 forces notification without using the coalescing mechanism
144176 provided by the XIVE END ESBs.
145177 - qshift: queue size (power of 2)
@@ -147,22 +179,31 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 1 unmodified line
147179 - qtoggle: current queue toggle bit
148180 - qindex: current queue index
149181 - pad: reserved for future use
182+
150183 Errors:
151− -ENOENT: Invalid CPU number
152− -EINVAL: Invalid priority
153− -EINVAL: Invalid flags
154− -EINVAL: Invalid queue size
155− -EINVAL: Invalid queue address
156− -EFAULT: Invalid user pointer for attr->addr.
157− -EIO: Configuration of the underlying HW failed
158−
159− 5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only)
160− Synchronize the source to flush event notifications
184+
185+ ======= =========================================
186+ -ENOENT Invalid CPU number
187+ -EINVAL Invalid priority
188+ -EINVAL Invalid flags
189+ -EINVAL Invalid queue size
190+ -EINVAL Invalid queue address
191+ -EFAULT Invalid user pointer for attr->addr.
192+ -EIO Configuration of the underlying HW failed
193+ ======= =========================================
194+
195+5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only)
196+ Synchronize the source to flush event notifications
197+
161198 Attributes:
162199 Interrupt source number (64-bit)
200+
163201 Errors:
164− -ENOENT: Unknown source number
165− -EINVAL: Not initialized source number
202+
203+ ======= =============================
204+ -ENOENT Unknown source number
205+ -EINVAL Not initialized source number
206+ ======= =============================
166207
167208 * VCPU state
168209
@@ -175,11 +216,12 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 6 unmodified lines
175216 as it synthesizes the priorities of the pending interrupts. We
176217 capture a bit more to report debug information.
177218
178− KVM_REG_PPC_VP_STATE (2 * 64bits)
179− bits: | 63 .... 32 | 31 .... 0 |
180− values: | TIMA word0 | TIMA word1 |
181− bits: | 127 .......... 64 |
182− values: | unused |
219+ KVM_REG_PPC_VP_STATE (2 * 64bits)::
220+
221+ bits: | 63 .... 32 | 31 .... 0 |
222+ values: | TIMA word0 | TIMA word1 |
223+ bits: | 127 .......... 64 |
224+ values: | unused |
183225
184226 * Migration:
185227
@@ -196,7 +238,7 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 10 unmodified lines
196238 3. Capture the state of the source targeting, the EQs configuration
197239 and the state of thread interrupt context registers.
198240
199− Restore is similar :
241+ Restore is similar:
200242
201243 1. Restore the EQ configuration. As targeting depends on it.
202244 2. Restore targeting
Documentation/virt/kvm/halt-polling.rstrenamed from Documentation/virt/kvm/halt-polling.txt+47−43
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===========================
14 The KVM halt polling system
25 ===========================
36
@@ -68,7 +71,8 @@ steady state polling interval but will only really do a good job for wakeups · 64 unmodified lines
6871 which come at an approximately constant rate, otherwise there will be constant
6972 adjustment of the polling interval.
7073
71−[0] total block time: the time between when the halt polling function is
74+[0] total block time:
75+ the time between when the halt polling function is
7276 invoked and a wakeup source received (irrespective of
7377 whether the scheduler is invoked within that function).
7478
@@ -81,31 +85,32 @@ shrunk. These variables are defined in include/linux/kvm_host.h and as module · 6 unmodified lines
8185 parameters in virt/kvm/kvm_main.c, or arch/powerpc/kvm/book3s_hv.c in the
8286 powerpc kvm-hv case.
8387
84−Module Parameter | Description | Default Value
85−--------------------------------------------------------------------------------
86−halt_poll_ns | The global max polling | KVM_HALT_POLL_NS_DEFAULT
87− | interval which defines |
88− | the ceiling value of the |
89− | polling interval for | (per arch value)
90− | each vcpu. |
91−--------------------------------------------------------------------------------
92−halt_poll_ns_grow | The value by which the | 2
93− | halt polling interval is |
94− | multiplied in the |
95− | grow_halt_poll_ns() |
96− | function. |
97−--------------------------------------------------------------------------------
98−halt_poll_ns_grow_start | The initial value to grow | 10000
99− | to from zero in the |
100− | grow_halt_poll_ns() |
101− | function. |
102−--------------------------------------------------------------------------------
103−halt_poll_ns_shrink | The value by which the | 0
104− | halt polling interval is |
105− | divided in the |
106− | shrink_halt_poll_ns() |
107− | function. |
108−--------------------------------------------------------------------------------
88++-----------------------+---------------------------+-------------------------+
89+|Module Parameter | Description | Default Value |
90++-----------------------+---------------------------+-------------------------+
91+|halt_poll_ns | The global max polling | KVM_HALT_POLL_NS_DEFAULT|
92+| | interval which defines | |
93+| | the ceiling value of the | |
94+| | polling interval for | (per arch value) |
95+| | each vcpu. | |
96++-----------------------+---------------------------+-------------------------+
97+|halt_poll_ns_grow | The value by which the | 2 |
98+| | halt polling interval is | |
99+| | multiplied in the | |
100+| | grow_halt_poll_ns() | |
101+| | function. | |
102++-----------------------+---------------------------+-------------------------+
103+|halt_poll_ns_grow_start| The initial value to grow | 10000 |
104+| | to from zero in the | |
105+| | grow_halt_poll_ns() | |
106+| | function. | |
107++-----------------------+---------------------------+-------------------------+
108+|halt_poll_ns_shrink | The value by which the | 0 |
109+| | halt polling interval is | |
110+| | divided in the | |
111+| | shrink_halt_poll_ns() | |
112+| | function. | |
113++-----------------------+---------------------------+-------------------------+
109114
110115 These module parameters can be set from the debugfs files in:
111116
@@ -117,20 +122,19 @@ Note: that these module parameters are system wide values and are not able to · 5 unmodified lines
117122 Further Notes
118123 =============
119124
120−- Care should be taken when setting the halt_poll_ns module parameter as a
121−large value has the potential to drive the cpu usage to 100% on a machine which
122−would be almost entirely idle otherwise. This is because even if a guest has
123−wakeups during which very little work is done and which are quite far apart, if
124−the period is shorter than the global max polling interval (halt_poll_ns) then
125−the host will always poll for the entire block time and thus cpu utilisation
126−will go to 100%.
127−
128−- Halt polling essentially presents a trade off between power usage and latency
129−and the module parameters should be used to tune the affinity for this. Idle
130−cpu time is essentially converted to host kernel time with the aim of decreasing
131−latency when entering the guest.
132−
133−- Halt polling will only be conducted by the host when no other tasks are
134−runnable on that cpu, otherwise the polling will cease immediately and
135−schedule will be invoked to allow that other task to run. Thus this doesn't
136−allow a guest to denial of service the cpu.
125+- Care should be taken when setting the halt_poll_ns module parameter as a large value
126+ has the potential to drive the cpu usage to 100% on a machine which would be almost
127+ entirely idle otherwise. This is because even if a guest has wakeups during which very
128+ little work is done and which are quite far apart, if the period is shorter than the
129+ global max polling interval (halt_poll_ns) then the host will always poll for the
130+ entire block time and thus cpu utilisation will go to 100%.
131+
132+- Halt polling essentially presents a trade off between power usage and latency and
133+ the module parameters should be used to tune the affinity for this. Idle cpu time is
134+ essentially converted to host kernel time with the aim of decreasing latency when
135+ entering the guest.
136+
137+- Halt polling will only be conducted by the host when no other tasks are runnable on
138+ that cpu, otherwise the polling will cease immediately and schedule will be invoked to
139+ allow that other task to run. Thus this doesn't allow a guest to denial of service the
140+ cpu.
Documentation/virt/kvm/hypercalls.rstrenamed from Documentation/virt/kvm/hypercalls.txt+73−56
@@ -1,5 +1,9 @@
1−Linux KVM Hypercall:
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+===================
4+Linux KVM Hypercall
25 ===================
6+
37 X86:
48 KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall
59 instruction. The hypervisor can replace it with instructions that are
@@ -20,7 +24,7 @@ S390: · 14 unmodified lines
2024 For further information on the S390 diagnose call as supported by KVM,
2125 refer to Documentation/virt/kvm/s390-diag.txt.
2226
23− PowerPC:
27+PowerPC:
2428 It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers.
2529 Return value is placed in R3.
2630
@@ -34,7 +38,8 @@ MIPS: · 7 unmodified lines
3438 the return value is placed in $2 (v0).
3539
3640 KVM Hypercalls Documentation
37−===========================
41+============================
42+
3843 The template for each hypercall is:
3944 1. Hypercall name.
4045 2. Architecture(s)
@@ -43,56 +48,64 @@ The template for each hypercall is: · 2 unmodified lines
4348
4449 1. KVM_HC_VAPIC_POLL_IRQ
4550 ------------------------
46−Architecture: x86
47−Status: active
48−Purpose: Trigger guest exit so that the host can check for pending
49−interrupts on reentry.
51+
52+:Architecture: x86
53+:Status: active
54+:Purpose: Trigger guest exit so that the host can check for pending
55+ interrupts on reentry.
5056
5157 2. KVM_HC_MMU_OP
52−------------------------
53−Architecture: x86
54−Status: deprecated.
55−Purpose: Support MMU operations such as writing to PTE,
56−flushing TLB, release PT.
58+----------------
59+
60+:Architecture: x86
61+:Status: deprecated.
62+:Purpose: Support MMU operations such as writing to PTE,
63+ flushing TLB, release PT.
5764
5865 3. KVM_HC_FEATURES
59−------------------------
60−Architecture: PPC
61−Status: active
62−Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid
63−used to enumerate which hypercalls are available. On PPC, either device tree
64−based lookup ( which is also what EPAPR dictates) OR KVM specific enumeration
65−mechanism (which is this hypercall) can be used.
66+------------------
67+
68+:Architecture: PPC
69+:Status: active
70+:Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid
71+ used to enumerate which hypercalls are available. On PPC, either
72+ device tree based lookup ( which is also what EPAPR dictates)
73+ OR KVM specific enumeration mechanism (which is this hypercall)
74+ can be used.
6675
6776 4. KVM_HC_PPC_MAP_MAGIC_PAGE
68−------------------------
69−Architecture: PPC
70−Status: active
71−Purpose: To enable communication between the hypervisor and guest there is a
72−shared page that contains parts of supervisor visible register state.
73−The guest can map this shared page to access its supervisor register through
74−memory using this hypercall.
77+----------------------------
78+
79+:Architecture: PPC
80+:Status: active
81+:Purpose: To enable communication between the hypervisor and guest there is a
82+ shared page that contains parts of supervisor visible register state.
83+ The guest can map this shared page to access its supervisor register
84+ through memory using this hypercall.
7585
7686 5. KVM_HC_KICK_CPU
77−------------------------
78−Architecture: x86
79−Status: active
80−Purpose: Hypercall used to wakeup a vcpu from HLT state
81−Usage example : A vcpu of a paravirtualized guest that is busywaiting in guest
82−kernel mode for an event to occur (ex: a spinlock to become available) can
83−execute HLT instruction once it has busy-waited for more than a threshold
84−time-interval. Execution of HLT instruction would cause the hypervisor to put
85−the vcpu to sleep until occurrence of an appropriate event. Another vcpu of the
86−same guest can wakeup the sleeping vcpu by issuing KVM_HC_KICK_CPU hypercall,
87−specifying APIC ID (a1) of the vcpu to be woken up. An additional argument (a0)
88−is used in the hypercall for future use.
87+------------------
88+
89+:Architecture: x86
90+:Status: active
91+:Purpose: Hypercall used to wakeup a vcpu from HLT state
92+:Usage example:
93+ A vcpu of a paravirtualized guest that is busywaiting in guest
94+ kernel mode for an event to occur (ex: a spinlock to become available) can
95+ execute HLT instruction once it has busy-waited for more than a threshold
96+ time-interval. Execution of HLT instruction would cause the hypervisor to put
97+ the vcpu to sleep until occurrence of an appropriate event. Another vcpu of the
98+ same guest can wakeup the sleeping vcpu by issuing KVM_HC_KICK_CPU hypercall,
99+ specifying APIC ID (a1) of the vcpu to be woken up. An additional argument (a0)
100+ is used in the hypercall for future use.
89101
90102
91103 6. KVM_HC_CLOCK_PAIRING
92−------------------------
93−Architecture: x86
94−Status: active
95−Purpose: Hypercall used to synchronize host and guest clocks.
104+-----------------------
105+:Architecture: x86
106+:Status: active
107+:Purpose: Hypercall used to synchronize host and guest clocks.
108+
96109 Usage:
97110
98111 a0: guest physical address where host copies
@@ -101,6 +114,8 @@ a0: guest physical address where host copies · 2 unmodified lines
101114 a1: clock_type, ATM only KVM_CLOCK_PAIRING_WALLCLOCK (0)
102115 is supported (corresponding to the host's CLOCK_REALTIME clock).
103116
117+ ::
118+
104119 struct kvm_clock_pairing {
105120 __s64 sec;
106121 __s64 nsec;
@@ -123,15 +138,16 @@ Returns KVM_EOPNOTSUPP if the host does not use TSC clocksource, · 16 unmodified lines
123138 or if clock type is different than KVM_CLOCK_PAIRING_WALLCLOCK.
124139
125140 6. KVM_HC_SEND_IPI
126−------------------------
127−Architecture: x86
128−Status: active
129−Purpose: Send IPIs to multiple vCPUs.
141+------------------
142+
143+:Architecture: x86
144+:Status: active
145+:Purpose: Send IPIs to multiple vCPUs.
130146
131−a0: lower part of the bitmap of destination APIC IDs
132−a1: higher part of the bitmap of destination APIC IDs
133−a2: the lowest APIC ID in bitmap
134−a3: APIC ICR
147+- a0: lower part of the bitmap of destination APIC IDs
148+- a1: higher part of the bitmap of destination APIC IDs
149+- a2: the lowest APIC ID in bitmap
150+- a3: APIC ICR
135151
136152 The hypercall lets a guest send multicast IPIs, with at most 128
137153 128 destinations per hypercall in 64-bit mode and 64 vCPUs per
@@ -143,12 +159,13 @@ corresponds to the APIC ID a2+1, and so on. · 5 unmodified lines
143159 Returns the number of CPUs to which the IPIs were delivered successfully.
144160
145161 7. KVM_HC_SCHED_YIELD
146−------------------------
147−Architecture: x86
148−Status: active
149−Purpose: Hypercall used to yield if the IPI target vCPU is preempted
162+---------------------
163+
164+:Architecture: x86
165+:Status: active
166+:Purpose: Hypercall used to yield if the IPI target vCPU is preempted
150167
151168 a0: destination APIC ID
152169
153−Usage example: When sending a call-function IPI-many to vCPUs, yield if
154−any of the IPI target vCPUs was preempted.
170+:Usage example: When sending a call-function IPI-many to vCPUs, yield if
171+ any of the IPI target vCPUs was preempted.
Documentation/virt/kvm/index.rst+16−0
@@ -7,6 +7,22 @@ KVM · 6 unmodified lines
77 .. toctree::
88 :maxdepth: 2
99
10+ api
1011 amd-memory-encryption
1112 cpuid
13+ halt-polling
14+ hypercalls
15+ locking
16+ mmu
17+ msr
18+ nested-vmx
19+ ppc-pv
20+ s390-diag
21+ timekeeping
1222 vcpu-requests
23+
24+ review-checklist
25+
26+ arm/index
27+
28+ devices/index
Documentation/virt/kvm/locking.rst+243−0
@@ -0,0 +1,243 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=================
4+KVM Lock Overview
5+=================
6+
7+1. Acquisition Orders
8+---------------------
9+
10+The acquisition orders for mutexes are as follows:
11+
12+- kvm->lock is taken outside vcpu->mutex
13+
14+- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock
15+
16+- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
17+ them together is quite rare.
18+
19+On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock.
20+
21+Everything else is a leaf: no other lock is taken inside the critical
22+sections.
23+
24+2. Exception
25+------------
26+
27+Fast page fault:
28+
29+Fast page fault is the fast path which fixes the guest page fault out of
30+the mmu-lock on x86. Currently, the page fault can be fast in one of the
31+following two cases:
32+
33+1. Access Tracking: The SPTE is not present, but it is marked for access
34+ tracking i.e. the SPTE_SPECIAL_MASK is set. That means we need to
35+ restore the saved R/X bits. This is described in more detail later below.
36+
37+2. Write-Protection: The SPTE is present and the fault is
38+ caused by write-protect. That means we just need to change the W bit of
39+ the spte.
40+
41+What we use to avoid all the race is the SPTE_HOST_WRITEABLE bit and
42+SPTE_MMU_WRITEABLE bit on the spte:
43+
44+- SPTE_HOST_WRITEABLE means the gfn is writable on host.
45+- SPTE_MMU_WRITEABLE means the gfn is writable on mmu. The bit is set when
46+ the gfn is writable on guest mmu and it is not write-protected by shadow
47+ page write-protection.
48+
49+On fast page fault path, we will use cmpxchg to atomically set the spte W
50+bit if spte.SPTE_HOST_WRITEABLE = 1 and spte.SPTE_WRITE_PROTECT = 1, or
51+restore the saved R/X bits if VMX_EPT_TRACK_ACCESS mask is set, or both. This
52+is safe because whenever changing these bits can be detected by cmpxchg.
53+
54+But we need carefully check these cases:
55+
56+1) The mapping from gfn to pfn
57+
58+The mapping from gfn to pfn may be changed since we can only ensure the pfn
59+is not changed during cmpxchg. This is a ABA problem, for example, below case
60+will happen:
61+
62++------------------------------------------------------------------------+
63+| At the beginning:: |
64+| |
65+| gpte = gfn1 |
66+| gfn1 is mapped to pfn1 on host |
67+| spte is the shadow page table entry corresponding with gpte and |
68+| spte = pfn1 |
69++------------------------------------------------------------------------+
70+| On fast page fault path: |
71++------------------------------------+-----------------------------------+
72+| CPU 0: | CPU 1: |
73++------------------------------------+-----------------------------------+
74+| :: | |
75+| | |
76+| old_spte = *spte; | |
77++------------------------------------+-----------------------------------+
78+| | pfn1 is swapped out:: |
79+| | |
80+| | spte = 0; |
81+| | |
82+| | pfn1 is re-alloced for gfn2. |
83+| | |
84+| | gpte is changed to point to |
85+| | gfn2 by the guest:: |
86+| | |
87+| | spte = pfn1; |
88++------------------------------------+-----------------------------------+
89+| :: |
90+| |
91+| if (cmpxchg(spte, old_spte, old_spte+W) |
92+| mark_page_dirty(vcpu->kvm, gfn1) |
93+| OOPS!!! |
94++------------------------------------------------------------------------+
95+
96+We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.
97+
98+For direct sp, we can easily avoid it since the spte of direct sp is fixed
99+to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
100+to pin gfn to pfn, because after gfn_to_pfn_atomic():
101+
102+- We have held the refcount of pfn that means the pfn can not be freed and
103+ be reused for another gfn.
104+- The pfn is writable that means it can not be shared between different gfns
105+ by KSM.
106+
107+Then, we can ensure the dirty bitmaps is correctly set for a gfn.
108+
109+Currently, to simplify the whole things, we disable fast page fault for
110+indirect shadow page.
111+
112+2) Dirty bit tracking
113+
114+In the origin code, the spte can be fast updated (non-atomically) if the
115+spte is read-only and the Accessed bit has already been set since the
116+Accessed bit and Dirty bit can not be lost.
117+
118+But it is not true after fast page fault since the spte can be marked
119+writable between reading spte and updating spte. Like below case:
120+
121++------------------------------------------------------------------------+
122+| At the beginning:: |
123+| |
124+| spte.W = 0 |
125+| spte.Accessed = 1 |
126++------------------------------------+-----------------------------------+
127+| CPU 0: | CPU 1: |
128++------------------------------------+-----------------------------------+
129+| In mmu_spte_clear_track_bits():: | |
130+| | |
131+| old_spte = *spte; | |
132+| | |
133+| | |
134+| /* 'if' condition is satisfied. */| |
135+| if (old_spte.Accessed == 1 && | |
136+| old_spte.W == 0) | |
137+| spte = 0ull; | |
138++------------------------------------+-----------------------------------+
139+| | on fast page fault path:: |
140+| | |
141+| | spte.W = 1 |
142+| | |
143+| | memory write on the spte:: |
144+| | |
145+| | spte.Dirty = 1 |
146++------------------------------------+-----------------------------------+
147+| :: | |
148+| | |
149+| else | |
150+| old_spte = xchg(spte, 0ull) | |
151+| if (old_spte.Accessed == 1) | |
152+| kvm_set_pfn_accessed(spte.pfn);| |
153+| if (old_spte.Dirty == 1) | |
154+| kvm_set_pfn_dirty(spte.pfn); | |
155+| OOPS!!! | |
156++------------------------------------+-----------------------------------+
157+
158+The Dirty bit is lost in this case.
159+
160+In order to avoid this kind of issue, we always treat the spte as "volatile"
161+if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means,
162+the spte is always atomically updated in this case.
163+
164+3) flush tlbs due to spte updated
165+
166+If the spte is updated from writable to readonly, we should flush all TLBs,
167+otherwise rmap_write_protect will find a read-only spte, even though the
168+writable spte might be cached on a CPU's TLB.
169+
170+As mentioned before, the spte can be updated to writable out of mmu-lock on
171+fast page fault path, in order to easily audit the path, we see if TLBs need
172+be flushed caused by this reason in mmu_spte_update() since this is a common
173+function to update spte (present -> present).
174+
175+Since the spte is "volatile" if it can be updated out of mmu-lock, we always
176+atomically update the spte, the race caused by fast page fault can be avoided,
177+See the comments in spte_has_volatile_bits() and mmu_spte_update().
178+
179+Lockless Access Tracking:
180+
181+This is used for Intel CPUs that are using EPT but do not support the EPT A/D
182+bits. In this case, when the KVM MMU notifier is called to track accesses to a
183+page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present
184+by clearing the RWX bits in the PTE and storing the original R & X bits in
185+some unused/ignored bits. In addition, the SPTE_SPECIAL_MASK is also set on the
186+PTE (using the ignored bit 62). When the VM tries to access the page later on,
187+a fault is generated and the fast page fault mechanism described above is used
188+to atomically restore the PTE to a Present state. The W bit is not saved when
189+the PTE is marked for access tracking and during restoration to the Present
190+state, the W bit is set depending on whether or not it was a write access. If
191+it wasn't, then the W bit will remain clear until a write access happens, at
192+which time it will be set using the Dirty tracking mechanism described above.
193+
194+3. Reference
195+------------
196+
197+:Name: kvm_lock
198+:Type: mutex
199+:Arch: any
200+:Protects: - vm_list
201+
202+:Name: kvm_count_lock
203+:Type: raw_spinlock_t
204+:Arch: any
205+:Protects: - hardware virtualization enable/disable
206+:Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
207+ migration.
208+
209+:Name: kvm_arch::tsc_write_lock
210+:Type: raw_spinlock
211+:Arch: x86
212+:Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
213+ - tsc offset in vmcb
214+:Comment: 'raw' because updating the tsc offsets must not be preempted.
215+
216+:Name: kvm->mmu_lock
217+:Type: spinlock_t
218+:Arch: any
219+:Protects: -shadow page/shadow tlb entry
220+:Comment: it is a spinlock since it is used in mmu notifier.
221+
222+:Name: kvm->srcu
223+:Type: srcu lock
224+:Arch: any
225+:Protects: - kvm->memslots
226+ - kvm->buses
227+:Comment: The srcu read lock must be held while accessing memslots (e.g.
228+ when using gfn_to_* functions) and while accessing in-kernel
229+ MMIO/PIO address->device structure mapping (kvm->buses).
230+ The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
231+ if it is needed by multiple functions.
232+
233+:Name: blocked_vcpu_on_cpu_lock
234+:Type: spinlock_t
235+:Arch: x86
236+:Protects: blocked_vcpu_on_cpu
237+:Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
238+ When VT-d posted-interrupts is supported and the VM has assigned
239+ devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu
240+ protected by blocked_vcpu_on_cpu_lock, when VT-d hardware issues
241+ wakeup notification event since external interrupts from the
242+ assigned devices happens, we will find the vCPU on the list to
243+ wakeup.
Documentation/virt/kvm/locking.txt+0−215
@@ -1,215 +0,0 @@
1−KVM Lock Overview
2−=================
3−
4−1. Acquisition Orders
5−---------------------
6−
7−The acquisition orders for mutexes are as follows:
8−
9−- kvm->lock is taken outside vcpu->mutex
10−
11−- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock
12−
13−- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
14− them together is quite rare.
15−
16−On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock.
17−
18−Everything else is a leaf: no other lock is taken inside the critical
19−sections.
20−
21−2: Exception
22−------------
23−
24−Fast page fault:
25−
26−Fast page fault is the fast path which fixes the guest page fault out of
27−the mmu-lock on x86. Currently, the page fault can be fast in one of the
28−following two cases:
29−
30−1. Access Tracking: The SPTE is not present, but it is marked for access
31−tracking i.e. the SPTE_SPECIAL_MASK is set. That means we need to
32−restore the saved R/X bits. This is described in more detail later below.
33−
34−2. Write-Protection: The SPTE is present and the fault is
35−caused by write-protect. That means we just need to change the W bit of the
36−spte.
37−
38−What we use to avoid all the race is the SPTE_HOST_WRITEABLE bit and
39−SPTE_MMU_WRITEABLE bit on the spte:
40−- SPTE_HOST_WRITEABLE means the gfn is writable on host.
41−- SPTE_MMU_WRITEABLE means the gfn is writable on mmu. The bit is set when
42− the gfn is writable on guest mmu and it is not write-protected by shadow
43− page write-protection.
44−
45−On fast page fault path, we will use cmpxchg to atomically set the spte W
46−bit if spte.SPTE_HOST_WRITEABLE = 1 and spte.SPTE_WRITE_PROTECT = 1, or
47−restore the saved R/X bits if VMX_EPT_TRACK_ACCESS mask is set, or both. This
48−is safe because whenever changing these bits can be detected by cmpxchg.
49−
50−But we need carefully check these cases:
51−1): The mapping from gfn to pfn
52−The mapping from gfn to pfn may be changed since we can only ensure the pfn
53−is not changed during cmpxchg. This is a ABA problem, for example, below case
54−will happen:
55−
56−At the beginning:
57−gpte = gfn1
58−gfn1 is mapped to pfn1 on host
59−spte is the shadow page table entry corresponding with gpte and
60−spte = pfn1
61−
62− VCPU 0 VCPU0
63−on fast page fault path:
64−
65− old_spte = *spte;
66− pfn1 is swapped out:
67− spte = 0;
68−
69− pfn1 is re-alloced for gfn2.
70−
71− gpte is changed to point to
72− gfn2 by the guest:
73− spte = pfn1;
74−
75− if (cmpxchg(spte, old_spte, old_spte+W)
76− mark_page_dirty(vcpu->kvm, gfn1)
77− OOPS!!!
78−
79−We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.
80−
81−For direct sp, we can easily avoid it since the spte of direct sp is fixed
82−to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
83−to pin gfn to pfn, because after gfn_to_pfn_atomic():
84−- We have held the refcount of pfn that means the pfn can not be freed and
85− be reused for another gfn.
86−- The pfn is writable that means it can not be shared between different gfns
87− by KSM.
88−
89−Then, we can ensure the dirty bitmaps is correctly set for a gfn.
90−
91−Currently, to simplify the whole things, we disable fast page fault for
92−indirect shadow page.
93−
94−2): Dirty bit tracking
95−In the origin code, the spte can be fast updated (non-atomically) if the
96−spte is read-only and the Accessed bit has already been set since the
97−Accessed bit and Dirty bit can not be lost.
98−
99−But it is not true after fast page fault since the spte can be marked
100−writable between reading spte and updating spte. Like below case:
101−
102−At the beginning:
103−spte.W = 0
104−spte.Accessed = 1
105−
106− VCPU 0 VCPU0
107−In mmu_spte_clear_track_bits():
108−
109− old_spte = *spte;
110−
111− /* 'if' condition is satisfied. */
112− if (old_spte.Accessed == 1 &&
113− old_spte.W == 0)
114− spte = 0ull;
115− on fast page fault path:
116− spte.W = 1
117− memory write on the spte:
118− spte.Dirty = 1
119−
120−
121− else
122− old_spte = xchg(spte, 0ull)
123−
124−
125− if (old_spte.Accessed == 1)
126− kvm_set_pfn_accessed(spte.pfn);
127− if (old_spte.Dirty == 1)
128− kvm_set_pfn_dirty(spte.pfn);
129− OOPS!!!
130−
131−The Dirty bit is lost in this case.
132−
133−In order to avoid this kind of issue, we always treat the spte as "volatile"
134−if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means,
135−the spte is always atomically updated in this case.
136−
137−3): flush tlbs due to spte updated
138−If the spte is updated from writable to readonly, we should flush all TLBs,
139−otherwise rmap_write_protect will find a read-only spte, even though the
140−writable spte might be cached on a CPU's TLB.
141−
142−As mentioned before, the spte can be updated to writable out of mmu-lock on
143−fast page fault path, in order to easily audit the path, we see if TLBs need
144−be flushed caused by this reason in mmu_spte_update() since this is a common
145−function to update spte (present -> present).
146−
147−Since the spte is "volatile" if it can be updated out of mmu-lock, we always
148−atomically update the spte, the race caused by fast page fault can be avoided,
149−See the comments in spte_has_volatile_bits() and mmu_spte_update().
150−
151−Lockless Access Tracking:
152−
153−This is used for Intel CPUs that are using EPT but do not support the EPT A/D
154−bits. In this case, when the KVM MMU notifier is called to track accesses to a
155−page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present
156−by clearing the RWX bits in the PTE and storing the original R & X bits in
157−some unused/ignored bits. In addition, the SPTE_SPECIAL_MASK is also set on the
158−PTE (using the ignored bit 62). When the VM tries to access the page later on,
159−a fault is generated and the fast page fault mechanism described above is used
160−to atomically restore the PTE to a Present state. The W bit is not saved when
161−the PTE is marked for access tracking and during restoration to the Present
162−state, the W bit is set depending on whether or not it was a write access. If
163−it wasn't, then the W bit will remain clear until a write access happens, at
164−which time it will be set using the Dirty tracking mechanism described above.
165−
166−3. Reference
167−------------
168−
169−Name: kvm_lock
170−Type: mutex
171−Arch: any
172−Protects: - vm_list
173−
174−Name: kvm_count_lock
175−Type: raw_spinlock_t
176−Arch: any
177−Protects: - hardware virtualization enable/disable
178−Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
179− migration.
180−
181−Name: kvm_arch::tsc_write_lock
182−Type: raw_spinlock
183−Arch: x86
184−Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
185− - tsc offset in vmcb
186−Comment: 'raw' because updating the tsc offsets must not be preempted.
187−
188−Name: kvm->mmu_lock
189−Type: spinlock_t
190−Arch: any
191−Protects: -shadow page/shadow tlb entry
192−Comment: it is a spinlock since it is used in mmu notifier.
193−
194−Name: kvm->srcu
195−Type: srcu lock
196−Arch: any
197−Protects: - kvm->memslots
198− - kvm->buses
199−Comment: The srcu read lock must be held while accessing memslots (e.g.
200− when using gfn_to_* functions) and while accessing in-kernel
201− MMIO/PIO address->device structure mapping (kvm->buses).
202− The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
203− if it is needed by multiple functions.
204−
205−Name: blocked_vcpu_on_cpu_lock
206−Type: spinlock_t
207−Arch: x86
208−Protects: blocked_vcpu_on_cpu
209−Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
210− When VT-d posted-interrupts is supported and the VM has assigned
211− devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu
212− protected by blocked_vcpu_on_cpu_lock, when VT-d hardware issues
213− wakeup notification event since external interrupts from the
214− assigned devices happens, we will find the vCPU on the list to
215− wakeup.
Documentation/virt/kvm/mmu.rstrenamed from Documentation/virt/kvm/mmu.txt+48−14
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+======================
14 The x86 kvm shadow mmu
25 ======================
36
@@ -7,27 +10,37 @@ physical addresses to host physical addresses. · 3 unmodified lines
710
811 The mmu code attempts to satisfy the following requirements:
912
10−- correctness: the guest should not be able to determine that it is running
13+- correctness:
14+ the guest should not be able to determine that it is running
1115 on an emulated mmu except for timing (we attempt to comply
1216 with the specification, not emulate the characteristics of
1317 a particular implementation such as tlb size)
14−- security: the guest must not be able to touch host memory not assigned
18+- security:
19+ the guest must not be able to touch host memory not assigned
1520 to it
16−- performance: minimize the performance penalty imposed by the mmu
17−- scaling: need to scale to large memory and large vcpu guests
18−- hardware: support the full range of x86 virtualization hardware
19−- integration: Linux memory management code must be in control of guest memory
21+- performance:
22+ minimize the performance penalty imposed by the mmu
23+- scaling:
24+ need to scale to large memory and large vcpu guests
25+- hardware:
26+ support the full range of x86 virtualization hardware
27+- integration:
28+ Linux memory management code must be in control of guest memory
2029 so that swapping, page migration, page merging, transparent
2130 hugepages, and similar features work without change
22−- dirty tracking: report writes to guest memory to enable live migration
31+- dirty tracking:
32+ report writes to guest memory to enable live migration
2333 and framebuffer-based displays
24−- footprint: keep the amount of pinned kernel memory low (most memory
34+- footprint:
35+ keep the amount of pinned kernel memory low (most memory
2536 should be shrinkable)
26−- reliability: avoid multipage or GFP_ATOMIC allocations
37+- reliability:
38+ avoid multipage or GFP_ATOMIC allocations
2739
2840 Acronyms
2941 ========
3042
43+==== ====================================================================
3144 pfn host page frame number
3245 hpa host physical address
3346 hva host virtual address
@@ -41,6 +54,7 @@ pte page table entry (used also to refer generically to paging structure · 7 unmodified lines
4154 gpte guest pte (referring to gfns)
4255 spte shadow pte (referring to pfns)
4356 tdp two dimensional paging (vendor neutral term for NPT and EPT)
57+==== ====================================================================
4458
4559 Virtual and real hardware supported
4660 ===================================
@@ -90,11 +104,13 @@ Events · 43 unmodified lines
90104 The mmu is driven by events, some from the guest, some from the host.
91105
92106 Guest generated events:
107+
93108 - writes to control registers (especially cr3)
94109 - invlpg/invlpga instruction execution
95110 - access to missing or protected translations
96111
97112 Host generated events:
113+
98114 - changes in the gpa->hpa translation (either through gpa->hva changes or
99115 through hva->hpa changes)
100116 - memory pressure (the shrinker)
@@ -117,16 +133,19 @@ Leaf ptes point at guest pages. · 16 unmodified lines
117133 The following table shows translations encoded by leaf ptes, with higher-level
118134 translations in parentheses:
119135
120− Non-nested guests:
136+ Non-nested guests::
137+
121138 nonpaging: gpa->hpa
122139 paging: gva->gpa->hpa
123140 paging, tdp: (gva->)gpa->hpa
124− Nested guests:
141+
142+ Nested guests::
143+
125144 non-tdp: ngva->gpa->hpa (*)
126145 tdp: (ngva->)ngpa->gpa->hpa
127146
128−(*) the guest hypervisor will encode the ngva->gpa translation into its page
129− tables if npt is not present
147+ (*) the guest hypervisor will encode the ngva->gpa translation into its page
148+ tables if npt is not present
130149
131150 Shadow pages contain the following information:
132151 role.level:
@@ -291,28 +310,41 @@ Handling a page fault is performed as follows: · 158 unmodified lines
291310
292311 - if the RSV bit of the error code is set, the page fault is caused by guest
293312 accessing MMIO and cached MMIO information is available.
313+
294314 - walk shadow page table
295315 - check for valid generation number in the spte (see "Fast invalidation of
296316 MMIO sptes" below)
297317 - cache the information to vcpu->arch.mmio_gva, vcpu->arch.mmio_access and
298318 vcpu->arch.mmio_gfn, and call the emulator
319+
299320 - If both P bit and R/W bit of error code are set, this could possibly
300321 be handled as a "fast page fault" (fixed without taking the MMU lock). See
301322 the description in Documentation/virt/kvm/locking.txt.
323+
302324 - if needed, walk the guest page tables to determine the guest translation
303325 (gva->gpa or ngpa->gpa)
326+
304327 - if permissions are insufficient, reflect the fault back to the guest
328+
305329 - determine the host page
330+
306331 - if this is an mmio request, there is no host page; cache the info to
307332 vcpu->arch.mmio_gva, vcpu->arch.mmio_access and vcpu->arch.mmio_gfn
333+
308334 - walk the shadow page table to find the spte for the translation,
309335 instantiating missing intermediate page tables as necessary
336+
310337 - If this is an mmio request, cache the mmio info to the spte and set some
311338 reserved bit on the spte (see callers of kvm_mmu_set_mmio_spte_mask)
339+
312340 - try to unsynchronize the page
341+
313342 - if successful, we can let the guest continue and modify the gpte
343+
314344 - emulate the instruction
345+
315346 - if failed, unshadow the page and let the guest continue
347+
316348 - update any translations that were modified by the instruction
317349
318350 invlpg handling:
@@ -324,10 +356,12 @@ invlpg handling: · 5 unmodified lines
324356 Guest control register updates:
325357
326358 - mov to cr3
359+
327360 - look up new shadow roots
328361 - synchronize newly reachable shadow pages
329362
330363 - mov to cr0/cr4/efer
364+
331365 - set up mmu context for new paging mode
332366 - look up new shadow roots
333367 - synchronize newly reachable shadow pages
@@ -358,6 +392,7 @@ on fault type: · 24 unmodified lines
358392 (user write faults generate a #PF)
359393
360394 In the first case there are two additional complications:
395+
361396 - if CR4.SMEP is enabled: since we've turned the page into a kernel page,
362397 the kernel may now execute it. We handle this by also setting spte.nx.
363398 If we get a user fetch or read fault, we'll change spte.u=1 and
@@ -446,4 +481,3 @@ Further reading · 82 unmodified lines
446481
447482 - NPT presentation from KVM Forum 2008
448483 http://www.linux-kvm.org/images/c/c8/KvmForum2008%24kdf2008_21.pdf
449−
Documentation/virt/kvm/msr.rstrenamed from Documentation/virt/kvm/msr.txt+92−55
@@ -1,6 +1,10 @@
1−KVM-specific MSRs.
2−Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010
3−=====================================================
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=================
4+KVM-specific MSRs
5+=================
6+
7+:Author: Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010
48
59 KVM makes use of some custom MSRs to service some requests.
610
@@ -9,34 +13,39 @@ Custom MSRs have a range reserved for them, that goes from · 2 unmodified lines
913 but they are deprecated and their use is discouraged.
1014
1115 Custom MSR list
12−--------
16+---------------
1317
1418 The current supported Custom MSR list is:
1519
16−MSR_KVM_WALL_CLOCK_NEW: 0x4b564d00
20+MSR_KVM_WALL_CLOCK_NEW:
21+ 0x4b564d00
1722
18− data: 4-byte alignment physical address of a memory area which must be
23+data:
24+ 4-byte alignment physical address of a memory area which must be
1925 in guest RAM. This memory is expected to hold a copy of the following
20− structure:
26+ structure::
2127
22− struct pvclock_wall_clock {
28+ struct pvclock_wall_clock {
2329 u32 version;
2430 u32 sec;
2531 u32 nsec;
26− } __attribute__((__packed__));
32+ } __attribute__((__packed__));
2733
2834 whose data will be filled in by the hypervisor. The hypervisor is only
2935 guaranteed to update this data at the moment of MSR write.
3036 Users that want to reliably query this information more than once have
3137 to write more than once to this MSR. Fields have the following meanings:
3238
33− version: guest has to check version before and after grabbing
39+ version:
40+ guest has to check version before and after grabbing
3441 time information and check that they are both equal and even.
3542 An odd version indicates an in-progress update.
3643
37− sec: number of seconds for wallclock at time of boot.
44+ sec:
45+ number of seconds for wallclock at time of boot.
3846
39− nsec: number of nanoseconds for wallclock at time of boot.
47+ nsec:
48+ number of nanoseconds for wallclock at time of boot.
4049
4150 In order to get the current wallclock time, the system_time from
4251 MSR_KVM_SYSTEM_TIME_NEW needs to be added.
@@ -47,13 +56,15 @@ MSR_KVM_WALL_CLOCK_NEW: 0x4b564d00 · 4 unmodified lines
4756 Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid
4857 leaf prior to usage.
4958
50−MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01
59+MSR_KVM_SYSTEM_TIME_NEW:
60+ 0x4b564d01
5161
52− data: 4-byte aligned physical address of a memory area which must be in
62+data:
63+ 4-byte aligned physical address of a memory area which must be in
5364 guest RAM, plus an enable bit in bit 0. This memory is expected to hold
54− a copy of the following structure:
65+ a copy of the following structure::
5566
56− struct pvclock_vcpu_time_info {
67+ struct pvclock_vcpu_time_info {
5768 u32 version;
5869 u32 pad0;
5970 u64 tsc_timestamp;
@@ -62,7 +73,7 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 2 unmodified lines
6273 s8 tsc_shift;
6374 u8 flags;
6475 u8 pad[2];
65− } __attribute__((__packed__)); /* 32 bytes */
76+ } __attribute__((__packed__)); /* 32 bytes */
6677
6778 whose data will be filled in by the hypervisor periodically. Only one
6879 write, or registration, is needed for each VCPU. The interval between
@@ -72,23 +83,28 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 3 unmodified lines
7283
7384 Fields have the following meanings:
7485
75− version: guest has to check version before and after grabbing
86+ version:
87+ guest has to check version before and after grabbing
7688 time information and check that they are both equal and even.
7789 An odd version indicates an in-progress update.
7890
79− tsc_timestamp: the tsc value at the current VCPU at the time
91+ tsc_timestamp:
92+ the tsc value at the current VCPU at the time
8093 of the update of this structure. Guests can subtract this value
8194 from current tsc to derive a notion of elapsed time since the
8295 structure update.
8396
84− system_time: a host notion of monotonic time, including sleep
97+ system_time:
98+ a host notion of monotonic time, including sleep
8599 time at the time this structure was last updated. Unit is
86100 nanoseconds.
87101
88− tsc_to_system_mul: multiplier to be used when converting
102+ tsc_to_system_mul:
103+ multiplier to be used when converting
89104 tsc-related quantity to nanoseconds
90105
91− tsc_shift: shift to be used when converting tsc-related
106+ tsc_shift:
107+ shift to be used when converting tsc-related
92108 quantity to nanoseconds. This shift will ensure that
93109 multiplication with tsc_to_system_mul does not overflow.
94110 A positive value denotes a left shift, a negative value
@@ -96,7 +112,7 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 1 unmodified line
96112
97113 The conversion from tsc to nanoseconds involves an additional
98114 right shift by 32 bits. With this information, guests can
99− derive per-CPU time by doing:
115+ derive per-CPU time by doing::
100116
101117 time = (current_tsc - tsc_timestamp)
102118 if (tsc_shift >= 0)
@@ -106,29 +122,34 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 3 unmodified lines
106122 time = (time * tsc_to_system_mul) >> 32
107123 time = time + system_time
108124
109− flags: bits in this field indicate extended capabilities
125+ flags:
126+ bits in this field indicate extended capabilities
110127 coordinated between the guest and the hypervisor. Availability
111128 of specific flags has to be checked in 0x40000001 cpuid leaf.
112129 Current flags are:
113130
114− flag bit | cpuid bit | meaning
115− -------------------------------------------------------------
116− | | time measures taken across
117− 0 | 24 | multiple cpus are guaranteed to
118− | | be monotonic
119− -------------------------------------------------------------
120− | | guest vcpu has been paused by
121− 1 | N/A | the host
122− | | See 4.70 in api.txt
123− -------------------------------------------------------------
131+
132+ +-----------+--------------+----------------------------------+
133+ | flag bit | cpuid bit | meaning |
134+ +-----------+--------------+----------------------------------+
135+ | | | time measures taken across |
136+ | 0 | 24 | multiple cpus are guaranteed to |
137+ | | | be monotonic |
138+ +-----------+--------------+----------------------------------+
139+ | | | guest vcpu has been paused by |
140+ | 1 | N/A | the host |
141+ | | | See 4.70 in api.txt |
142+ +-----------+--------------+----------------------------------+
124143
125144 Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid
126145 leaf prior to usage.
127146
128147
129−MSR_KVM_WALL_CLOCK: 0x11
148+MSR_KVM_WALL_CLOCK:
149+ 0x11
130150
131− data and functioning: same as MSR_KVM_WALL_CLOCK_NEW. Use that instead.
151+data and functioning:
152+ same as MSR_KVM_WALL_CLOCK_NEW. Use that instead.
132153
133154 This MSR falls outside the reserved KVM range and may be removed in the
134155 future. Its usage is deprecated.
@@ -136,9 +157,11 @@ MSR_KVM_WALL_CLOCK: 0x11 · 1 unmodified line
136157 Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid
137158 leaf prior to usage.
138159
139−MSR_KVM_SYSTEM_TIME: 0x12
160+MSR_KVM_SYSTEM_TIME:
161+ 0x12
140162
141− data and functioning: same as MSR_KVM_SYSTEM_TIME_NEW. Use that instead.
163+data and functioning:
164+ same as MSR_KVM_SYSTEM_TIME_NEW. Use that instead.
142165
143166 This MSR falls outside the reserved KVM range and may be removed in the
144167 future. Its usage is deprecated.
@@ -146,7 +169,7 @@ MSR_KVM_SYSTEM_TIME: 0x12 · 1 unmodified line
146169 Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid
147170 leaf prior to usage.
148171
149− The suggested algorithm for detecting kvmclock presence is then:
172+ The suggested algorithm for detecting kvmclock presence is then::
150173
151174 if (!kvm_para_available()) /* refer to cpuid.txt */
152175 return NON_PRESENT;
@@ -163,8 +186,11 @@ MSR_KVM_SYSTEM_TIME: 0x12 · 10 unmodified lines
163186 } else
164187 return NON_PRESENT;
165188
166−MSR_KVM_ASYNC_PF_EN: 0x4b564d02
167− data: Bits 63-6 hold 64-byte aligned physical address of a
189+MSR_KVM_ASYNC_PF_EN:
190+ 0x4b564d02
191+
192+data:
193+ Bits 63-6 hold 64-byte aligned physical address of a
168194 64 byte memory area which must be in guest RAM and must be
169195 zeroed. Bits 5-3 are reserved and should be zero. Bit 0 is 1
170196 when asynchronous page faults are enabled on the vcpu 0 when
@@ -200,20 +226,22 @@ MSR_KVM_ASYNC_PF_EN: 0x4b564d02 · 29 unmodified lines
200226 Currently type 2 APF will be always delivered on the same vcpu as
201227 type 1 was, but guest should not rely on that.
202228
203−MSR_KVM_STEAL_TIME: 0x4b564d03
229+MSR_KVM_STEAL_TIME:
230+ 0x4b564d03
204231
205− data: 64-byte alignment physical address of a memory area which must be
232+data:
233+ 64-byte alignment physical address of a memory area which must be
206234 in guest RAM, plus an enable bit in bit 0. This memory is expected to
207− hold a copy of the following structure:
235+ hold a copy of the following structure::
208236
209− struct kvm_steal_time {
237+ struct kvm_steal_time {
210238 __u64 steal;
211239 __u32 version;
212240 __u32 flags;
213241 __u8 preempted;
214242 __u8 u8_pad[3];
215243 __u32 pad[11];
216− }
244+ }
217245
218246 whose data will be filled in by the hypervisor periodically. Only one
219247 write, or registration, is needed for each VCPU. The interval between
@@ -224,25 +252,32 @@ MSR_KVM_STEAL_TIME: 0x4b564d03 · 4 unmodified lines
224252
225253 Fields have the following meanings:
226254
227− version: a sequence counter. In other words, guest has to check
255+ version:
256+ a sequence counter. In other words, guest has to check
228257 this field before and after grabbing time information and make
229258 sure they are both equal and even. An odd version indicates an
230259 in-progress update.
231260
232− flags: At this point, always zero. May be used to indicate
261+ flags:
262+ At this point, always zero. May be used to indicate
233263 changes in this structure in the future.
234264
235− steal: the amount of time in which this vCPU did not run, in
265+ steal:
266+ the amount of time in which this vCPU did not run, in
236267 nanoseconds. Time during which the vcpu is idle, will not be
237268 reported as steal time.
238269
239− preempted: indicate the vCPU who owns this struct is running or
270+ preempted:
271+ indicate the vCPU who owns this struct is running or
240272 not. Non-zero values mean the vCPU has been preempted. Zero
241273 means the vCPU is not preempted. NOTE, it is always zero if the
242274 the hypervisor doesn't support this field.
243275
244−MSR_KVM_EOI_EN: 0x4b564d04
245− data: Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0
276+MSR_KVM_EOI_EN:
277+ 0x4b564d04
278+
279+data:
280+ Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0
246281 when disabled. Bit 1 is reserved and must be zero. When PV end of
247282 interrupt is enabled (bit 0 set), bits 63-2 hold a 4-byte aligned
248283 physical address of a 4 byte memory area which must be in guest RAM and
@@ -274,11 +309,13 @@ MSR_KVM_EOI_EN: 0x4b564d04 · 25 unmodified lines
274309 clear it using a single CPU instruction, such as test and clear, or
275310 compare and exchange.
276311
277−MSR_KVM_POLL_CONTROL: 0x4b564d05
312+MSR_KVM_POLL_CONTROL:
313+ 0x4b564d05
314+
278315 Control host-side polling.
279316
280− data: Bit 0 enables (1) or disables (0) host-side HLT polling logic.
317+data:
318+ Bit 0 enables (1) or disables (0) host-side HLT polling logic.
281319
282320 KVM guests can request the host not to poll on HLT, for example if
283321 they are performing polling themselves.
284−
Documentation/virt/kvm/nested-vmx.rstrenamed from Documentation/virt/kvm/nested-vmx.txt+21−16
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==========
14 Nested VMX
25 ==========
36
@@ -41,9 +44,9 @@ No modifications are required to user space (qemu). However, qemu's default · 37 unmodified lines
4144 emulated CPU type (qemu64) does not list the "VMX" CPU feature, so it must be
4245 explicitly enabled, by giving qemu one of the following options:
4346
44− -cpu host (emulated CPU has all features of the real CPU)
47+ - cpu host (emulated CPU has all features of the real CPU)
4548
46− -cpu qemu64,+vmx (add just the vmx feature to a named CPU type)
49+ - cpu qemu64,+vmx (add just the vmx feature to a named CPU type)
4750
4851
4952 ABIs
@@ -75,6 +78,8 @@ of this structure changes, this can break live migration across KVM versions. · 25 unmodified lines
7578 VMCS12_REVISION (from vmx.c) should be changed if struct vmcs12 or its inner
7679 struct shadow_vmcs is ever changed.
7780
81+::
82+
7883 typedef u64 natural_width;
7984 struct __packed vmcs12 {
8085 /* According to the Intel spec, a VMCS region must start with
@@ -220,21 +225,21 @@ Authors · 139 unmodified lines
220225 -------
221226
222227 These patches were written by:
223− Abel Gordon, abelg <at> il.ibm.com
224− Nadav Har'El, nyh <at> il.ibm.com
225− Orit Wasserman, oritw <at> il.ibm.com
226− Ben-Ami Yassor, benami <at> il.ibm.com
227− Muli Ben-Yehuda, muli <at> il.ibm.com
228+ - Abel Gordon, abelg <at> il.ibm.com
229+ - Nadav Har'El, nyh <at> il.ibm.com
230+ - Orit Wasserman, oritw <at> il.ibm.com
231+ - Ben-Ami Yassor, benami <at> il.ibm.com
232+ - Muli Ben-Yehuda, muli <at> il.ibm.com
228233
229234 With contributions by:
230− Anthony Liguori, aliguori <at> us.ibm.com
231− Mike Day, mdday <at> us.ibm.com
232− Michael Factor, factor <at> il.ibm.com
233− Zvi Dubitzky, dubi <at> il.ibm.com
235+ - Anthony Liguori, aliguori <at> us.ibm.com
236+ - Mike Day, mdday <at> us.ibm.com
237+ - Michael Factor, factor <at> il.ibm.com
238+ - Zvi Dubitzky, dubi <at> il.ibm.com
234239
235240 And valuable reviews by:
236− Avi Kivity, avi <at> redhat.com
237− Gleb Natapov, gleb <at> redhat.com
238− Marcelo Tosatti, mtosatti <at> redhat.com
239− Kevin Tian, kevin.tian <at> intel.com
240− and others.
241+ - Avi Kivity, avi <at> redhat.com
242+ - Gleb Natapov, gleb <at> redhat.com
243+ - Marcelo Tosatti, mtosatti <at> redhat.com
244+ - Kevin Tian, kevin.tian <at> intel.com
245+ - and others.
Documentation/virt/kvm/ppc-pv.rstrenamed from Documentation/virt/kvm/ppc-pv.txt+18−8
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=================================
14 The PPC KVM paravirtual interface
25 =================================
36
@@ -34,8 +37,9 @@ up the hypercall. To call a hypercall, just call these instructions. · 30 unmodified lines
3437
3538 The parameters are as follows:
3639
40+ ======== ================ ================
3741 Register IN OUT
38−
42+ ======== ================ ================
3943 r0 - volatile
4044 r3 1st parameter Return code
4145 r4 2nd parameter 1st output value
@@ -47,6 +51,7 @@ The parameters are as follows: · 5 unmodified lines
4751 r10 8th parameter 7th output value
4852 r11 hypercall number 8th output value
4953 r12 - volatile
54+ ======== ================ ================
5055
5156 Hypercall definitions are shared in generic code, so the same hypercall numbers
5257 apply for x86 and powerpc alike with the exception that each KVM hypercall
@@ -54,11 +59,13 @@ also needs to be ORed with the KVM vendor code which is (42 << 16). · 1 unmodified line
5459
5560 Return codes can be as follows:
5661
62+ ==== =========================
5763 Code Meaning
58−
64+ ==== =========================
5965 0 Success
6066 12 Hypercall not implemented
6167 <0 Error
68+ ==== =========================
6269
6370 The magic page
6471 ==============
@@ -72,7 +79,7 @@ desired location. The first parameter indicates the effective address when the · 7 unmodified lines
7279 MMU is enabled. The second parameter indicates the address in real mode, if
7380 applicable to the target. For now, we always map the page to -4096. This way we
7481 can access it using absolute load and store functions. The following
75−instruction reads the first field of the magic page:
82+instruction reads the first field of the magic page::
7683
7784 ld rX, -4096(0)
7885
@@ -93,8 +100,10 @@ a bitmap of available features inside the magic page. · 14 unmodified lines
93100
94101 The following enhancements to the magic page are currently available:
95102
103+ ============================ =======================================
96104 KVM_MAGIC_FEAT_SR Maps SR registers r/w in the magic page
97105 KVM_MAGIC_FEAT_MAS0_TO_SPRG7 Maps MASn, ESR, PIR and high SPRGs
106+ ============================ =======================================
98107
99108 For enhanced features in the magic page, please check for the existence of the
100109 feature before using them!
@@ -121,8 +130,8 @@ when entering the guest or don't have any impact on the hypervisor's behavior. · 20 unmodified lines
121130
122131 The following bits are safe to be set inside the guest:
123132
124− MSR_EE
125− MSR_RI
133+ - MSR_EE
134+ - MSR_RI
126135
127136 If any other bit changes in the MSR, please still use mtmsr(d).
128137
@@ -138,9 +147,9 @@ guest. Implementing any of those mappings is optional, as the instruction traps · 9 unmodified lines
138147 also act on the shared page. So calling privileged instructions still works as
139148 before.
140149
150+======================= ================================
141151 From To
142−==== ==
143−
152+======================= ================================
144153 mfmsr rX ld rX, magic_page->msr
145154 mfsprg rX, 0 ld rX, magic_page->sprg0
146155 mfsprg rX, 1 ld rX, magic_page->sprg1
@@ -173,7 +182,7 @@ mtsrin rX, rY b <special mtsrin section> · 26 unmodified lines
173182
174183 [BookE only]
175184 wrteei [0|1] b <special wrteei section>
176−
185+======================= ================================
177186
178187 Some instructions require more logic to determine what's going on than a load
179188 or store instruction can deliver. To enable patching of those, we keep some
@@ -191,6 +200,7 @@ for example. · 11 unmodified lines
191200
192201 Hypercall ABIs in KVM on PowerPC
193202 =================================
203+
194204 1) KVM hypercalls (ePAPR)
195205
196206 These are ePAPR compliant hypercall implementation (mentioned above). Even
Documentation/virt/kvm/review-checklist.rstrenamed from Documentation/virt/kvm/review-checklist.txt+3−0
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+================================
14 Review checklist for kvm patches
25 ================================
36
Documentation/virt/kvm/s390-diag.rstrenamed from Documentation/virt/kvm/s390-diag.txt+8−5
@@ -1,3 +1,6 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=============================
14 The s390 DIAGNOSE call on KVM
25 =============================
36
@@ -16,12 +19,12 @@ DIAGNOSE calls by the guest cause a mandatory intercept. This implies · 12 unmodified lines
1619 all supported DIAGNOSE calls need to be handled by either KVM or its
1720 userspace.
1821
19−All DIAGNOSE calls supported by KVM use the RS-a format:
22+All DIAGNOSE calls supported by KVM use the RS-a format::
2023
21−--------------------------------------
22−| '83' | R1 | R3 | B2 | D2 |
23−--------------------------------------
24−0 8 12 16 20 31
24+ --------------------------------------
25+ | '83' | R1 | R3 | B2 | D2 |
26+ --------------------------------------
27+ 0 8 12 16 20 31
2528
2629 The second-operand address (obtained by the base/displacement calculation)
2730 is not used to address data. Instead, bits 48-63 of this address specify
Documentation/virt/kvm/timekeeping.rstrenamed from Documentation/virt/kvm/timekeeping.txt+128−95
@@ -1,17 +1,21 @@
1+.. SPDX-License-Identifier: GPL-2.0
12
2− Timekeeping Virtualization for X86-Based Architectures
3+======================================================
4+Timekeeping Virtualization for X86-Based Architectures
5+======================================================
36
4− Zachary Amsden <zamsden@redhat.com>
5− Copyright (c) 2010, Red Hat. All rights reserved.
7+:Author: Zachary Amsden <zamsden@redhat.com>
8+:Copyright: (c) 2010, Red Hat. All rights reserved.
69
7−1) Overview
8−2) Timing Devices
9−3) TSC Hardware
10−4) Virtualization Problems
10+.. Contents
1111
12−=========================================================================
12+ 1) Overview
13+ 2) Timing Devices
14+ 3) TSC Hardware
15+ 4) Virtualization Problems
1316
14−1) Overview
17+1. Overview
18+===========
1519
1620 One of the most complicated parts of the X86 platform, and specifically,
1721 the virtualization of this platform is the plethora of timing devices available
@@ -27,15 +31,15 @@ The purpose of this document is to collect data and information relevant to · 9 unmodified lines
2731 timekeeping which may be difficult to find elsewhere, specifically,
2832 information relevant to KVM and hardware-based virtualization.
2933
30−=========================================================================
31−
32−2) Timing Devices
34+2. Timing Devices
35+=================
3336
3437 First we discuss the basic hardware devices available. TSC and the related
3538 KVM clock are special enough to warrant a full exposition and are described in
3639 the following section.
3740
38−2.1) i8254 - PIT
41+2.1. i8254 - PIT
42+----------------
3943
4044 One of the first timer devices available is the programmable interrupt timer,
4145 or PIT. The PIT has a fixed frequency 1.193182 MHz base clock and three
@@ -50,13 +54,13 @@ The PIT uses I/O ports 0x40 - 0x43. Access to the 16-bit counters is done · 8 unmodified lines
5054 using single or multiple byte access to the I/O ports. There are 6 modes
5155 available, but not all modes are available to all timers, as only timer 2
5256 has a connected gate input, required for modes 1 and 5. The gate line is
53−controlled by port 61h, bit 0, as illustrated in the following diagram.
57+controlled by port 61h, bit 0, as illustrated in the following diagram::
5458
55− -------------- ----------------
56−| | | |
57−| 1.1932 MHz |---------->| CLOCK OUT | ---------> IRQ 0
58−| Clock | | | |
59− -------------- | +->| GATE TIMER 0 |
59+ -------------- ----------------
60+ | | | |
61+ | 1.1932 MHz|---------->| CLOCK OUT | ---------> IRQ 0
62+ | Clock | | | |
63+ -------------- | +->| GATE TIMER 0 |
6064 | ----------------
6165 |
6266 | ----------------
@@ -70,29 +74,33 @@ controlled by port 61h, bit 0, as illustrated in the following diagram. · 7 unmodified lines
7074 | | |
7175 |------>| CLOCK OUT | ---------> Port 61h, bit 5
7276 | | |
73−Port 61h, bit 0 ---------->| GATE TIMER 2 | \_.---- ____
77+ Port 61h, bit 0 -------->| GATE TIMER 2 | \_.---- ____
7478 ---------------- _| )--|LPF|---Speaker
7579 / *---- \___/
76−Port 61h, bit 1 -----------------------------------/
80+ Port 61h, bit 1 ---------------------------------/
7781
7882 The timer modes are now described.
7983
80−Mode 0: Single Timeout. This is a one-shot software timeout that counts down
84+Mode 0: Single Timeout.
85+ This is a one-shot software timeout that counts down
8186 when the gate is high (always true for timers 0 and 1). When the count
8287 reaches zero, the output goes high.
8388
84−Mode 1: Triggered One-shot. The output is initially set high. When the gate
89+Mode 1: Triggered One-shot.
90+ The output is initially set high. When the gate
8591 line is set high, a countdown is initiated (which does not stop if the gate is
8692 lowered), during which the output is set low. When the count reaches zero,
8793 the output goes high.
8894
89−Mode 2: Rate Generator. The output is initially set high. When the countdown
95+Mode 2: Rate Generator.
96+ The output is initially set high. When the countdown
9097 reaches 1, the output goes low for one count and then returns high. The value
9198 is reloaded and the countdown automatically resumes. If the gate line goes
9299 low, the count is halted. If the output is low when the gate is lowered, the
93100 output automatically goes high (this only affects timer 2).
94101
95−Mode 3: Square Wave. This generates a high / low square wave. The count
102+Mode 3: Square Wave.
103+ This generates a high / low square wave. The count
96104 determines the length of the pulse, which alternates between high and low
97105 when zero is reached. The count only proceeds when gate is high and is
98106 automatically reloaded on reaching zero. The count is decremented twice at
@@ -103,12 +111,14 @@ Mode 3: Square Wave. This generates a high / low square wave. The count · 4 unmodified lines
103111 values are not observed when reading. This is the intended mode for timer 2,
104112 which generates sine-like tones by low-pass filtering the square wave output.
105113
106−Mode 4: Software Strobe. After programming this mode and loading the counter,
114+Mode 4: Software Strobe.
115+ After programming this mode and loading the counter,
107116 the output remains high until the counter reaches zero. Then the output
108117 goes low for 1 clock cycle and returns high. The counter is not reloaded.
109118 Counting only occurs when gate is high.
110119
111−Mode 5: Hardware Strobe. After programming and loading the counter, the
120+Mode 5: Hardware Strobe.
121+ After programming and loading the counter, the
112122 output remains high. When the gate is raised, a countdown is initiated
113123 (which does not stop if the gate is lowered). When the counter reaches zero,
114124 the output goes low for 1 clock cycle and then returns high. The counter is
@@ -118,49 +128,49 @@ In addition to normal binary counting, the PIT supports BCD counting. The · 3 unmodified lines
118128 command port, 0x43 is used to set the counter and mode for each of the three
119129 timers.
120130
121−PIT commands, issued to port 0x43, using the following bit encoding:
131+PIT commands, issued to port 0x43, using the following bit encoding::
122132
123−Bit 7-4: Command (See table below)
124−Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined)
125−Bit 0 : Binary (0) / BCD (1)
133+ Bit 7-4: Command (See table below)
134+ Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined)
135+ Bit 0 : Binary (0) / BCD (1)
126136
127−Command table:
137+Command table::
128138
129−0000 - Latch Timer 0 count for port 0x40
139+ 0000 - Latch Timer 0 count for port 0x40
130140 sample and hold the count to be read in port 0x40;
131141 additional commands ignored until counter is read;
132142 mode bits ignored.
133143
134−0001 - Set Timer 0 LSB mode for port 0x40
144+ 0001 - Set Timer 0 LSB mode for port 0x40
135145 set timer to read LSB only and force MSB to zero;
136146 mode bits set timer mode
137147
138−0010 - Set Timer 0 MSB mode for port 0x40
148+ 0010 - Set Timer 0 MSB mode for port 0x40
139149 set timer to read MSB only and force LSB to zero;
140150 mode bits set timer mode
141151
142−0011 - Set Timer 0 16-bit mode for port 0x40
152+ 0011 - Set Timer 0 16-bit mode for port 0x40
143153 set timer to read / write LSB first, then MSB;
144154 mode bits set timer mode
145155
146−0100 - Latch Timer 1 count for port 0x41 - as described above
147−0101 - Set Timer 1 LSB mode for port 0x41 - as described above
148−0110 - Set Timer 1 MSB mode for port 0x41 - as described above
149−0111 - Set Timer 1 16-bit mode for port 0x41 - as described above
156+ 0100 - Latch Timer 1 count for port 0x41 - as described above
157+ 0101 - Set Timer 1 LSB mode for port 0x41 - as described above
158+ 0110 - Set Timer 1 MSB mode for port 0x41 - as described above
159+ 0111 - Set Timer 1 16-bit mode for port 0x41 - as described above
150160
151−1000 - Latch Timer 2 count for port 0x42 - as described above
152−1001 - Set Timer 2 LSB mode for port 0x42 - as described above
153−1010 - Set Timer 2 MSB mode for port 0x42 - as described above
154−1011 - Set Timer 2 16-bit mode for port 0x42 as described above
161+ 1000 - Latch Timer 2 count for port 0x42 - as described above
162+ 1001 - Set Timer 2 LSB mode for port 0x42 - as described above
163+ 1010 - Set Timer 2 MSB mode for port 0x42 - as described above
164+ 1011 - Set Timer 2 16-bit mode for port 0x42 as described above
155165
156−1101 - General counter latch
166+ 1101 - General counter latch
157167 Latch combination of counters into corresponding ports
158168 Bit 3 = Counter 2
159169 Bit 2 = Counter 1
160170 Bit 1 = Counter 0
161171 Bit 0 = Unused
162172
163−1110 - Latch timer status
173+ 1110 - Latch timer status
164174 Latch combination of counter mode into corresponding ports
165175 Bit 3 = Counter 2
166176 Bit 2 = Counter 1
@@ -177,7 +187,8 @@ Command table: · 10 unmodified lines
177187 Bit 3-1 = Mode
178188 Bit 0 = Binary (0) / BCD mode (1)
179189
180−2.2) RTC
190+2.2. RTC
191+--------
181192
182193 The second device which was available in the original PC was the MC146818 real
183194 time clock. The original device is now obsolete, and usually emulated by the
@@ -201,21 +212,21 @@ in progress, as indicated in the status register. · 17 unmodified lines
201212 The clock uses a 32.768kHz crystal, so bits 6-4 of register A should be
202213 programmed to a 32kHz divider if the RTC is to count seconds.
203214
204−This is the RAM map originally used for the RTC/CMOS:
205−
206−Location Size Description
207−------------------------------------------
208−00h byte Current second (BCD)
209−01h byte Seconds alarm (BCD)
210−02h byte Current minute (BCD)
211−03h byte Minutes alarm (BCD)
212−04h byte Current hour (BCD)
213−05h byte Hours alarm (BCD)
214−06h byte Current day of week (BCD)
215−07h byte Current day of month (BCD)
216−08h byte Current month (BCD)
217−09h byte Current year (BCD)
218−0Ah byte Register A
215+This is the RAM map originally used for the RTC/CMOS::
216+
217+ Location Size Description
218+ ------------------------------------------
219+ 00h byte Current second (BCD)
220+ 01h byte Seconds alarm (BCD)
221+ 02h byte Current minute (BCD)
222+ 03h byte Minutes alarm (BCD)
223+ 04h byte Current hour (BCD)
224+ 05h byte Hours alarm (BCD)
225+ 06h byte Current day of week (BCD)
226+ 07h byte Current day of month (BCD)
227+ 08h byte Current month (BCD)
228+ 09h byte Current year (BCD)
229+ 0Ah byte Register A
219230 bit 7 = Update in progress
220231 bit 6-4 = Divider for clock
221232 000 = 4.194 MHz
@@ -234,7 +245,7 @@ Location Size Description · 12 unmodified lines
234245 1101 = 125 mS
235246 1110 = 250 mS
236247 1111 = 500 mS
237−0Bh byte Register B
248+ 0Bh byte Register B
238249 bit 7 = Run (0) / Halt (1)
239250 bit 6 = Periodic interrupt enable
240251 bit 5 = Alarm interrupt enable
@@ -243,19 +254,20 @@ Location Size Description · 2 unmodified lines
243254 bit 2 = BCD calendar (0) / Binary (1)
244255 bit 1 = 12-hour mode (0) / 24-hour mode (1)
245256 bit 0 = 0 (DST off) / 1 (DST enabled)
246−OCh byte Register C (read only)
257+ OCh byte Register C (read only)
247258 bit 7 = interrupt request flag (IRQF)
248259 bit 6 = periodic interrupt flag (PF)
249260 bit 5 = alarm interrupt flag (AF)
250261 bit 4 = update interrupt flag (UF)
251262 bit 3-0 = reserved
252−ODh byte Register D (read only)
263+ ODh byte Register D (read only)
253264 bit 7 = RTC has power
254265 bit 6-0 = reserved
255−32h byte Current century BCD (*)
266+ 32h byte Current century BCD (*)
256267 (*) location vendor specific and now determined from ACPI global tables
257268
258−2.3) APIC
269+2.3. APIC
270+---------
259271
260272 On Pentium and later processors, an on-board timer is available to each CPU
261273 as part of the Advanced Programmable Interrupt Controller. The APIC is
@@ -276,7 +288,8 @@ timer is programmed through the LVT (local vector timer) register, is capable · 14 unmodified lines
276288 of one-shot or periodic operation, and is based on the bus clock divided down
277289 by the programmable divider register.
278290
279−2.4) HPET
291+2.4. HPET
292+---------
280293
281294 HPET is quite complex, and was originally intended to replace the PIT / RTC
282295 support of the X86 PC. It remains to be seen whether that will be the case, as
@@ -297,7 +310,8 @@ indicated through ACPI tables by the BIOS. · 14 unmodified lines
297310 Detailed specification of the HPET is beyond the current scope of this
298311 document, as it is also very well documented elsewhere.
299312
300−2.5) Offboard Timers
313+2.5. Offboard Timers
314+--------------------
301315
302316 Several cards, both proprietary (watchdog boards) and commonplace (e1000) have
303317 timing chips built into the cards which may have registers which are accessible
@@ -307,9 +321,8 @@ general frowned upon as not playing by the agreed rules of the game. Such a · 3 unmodified lines
307321 timer device would require additional support to be virtualized properly and is
308322 not considered important at this time as no known operating system does this.
309323
310−=========================================================================
311−
312−3) TSC Hardware
324+3. TSC Hardware
325+===============
313326
314327 The TSC or time stamp counter is relatively simple in theory; it counts
315328 instruction cycles issued by the processor, which can be used as a measure of
@@ -340,7 +353,8 @@ allows the guest visible TSC to be offset by a constant. Newer implementations · 24 unmodified lines
340353 promise to allow the TSC to additionally be scaled, but this hardware is not
341354 yet widely available.
342355
343−3.1) TSC synchronization
356+3.1. TSC synchronization
357+------------------------
344358
345359 The TSC is a CPU-local clock in most implementations. This means, on SMP
346360 platforms, the TSCs of different CPUs may start at different times depending
@@ -357,7 +371,8 @@ practice, getting a perfectly synchronized TSC will not be possible unless all · 10 unmodified lines
357371 values are read from the same clock, which generally only is possible on single
358372 socket systems or those with special hardware support.
359373
360−3.2) TSC and CPU hotplug
374+3.2. TSC and CPU hotplug
375+------------------------
361376
362377 As touched on already, CPUs which arrive later than the boot time of the system
363378 may not have a TSC value that is synchronized with the rest of the system.
@@ -367,7 +382,8 @@ a guarantee. This can have the effect of bringing a system from a state where · 3 unmodified lines
367382 TSC is synchronized back to a state where TSC synchronization flaws, however
368383 small, may be exposed to the OS and any virtualization environment.
369384
370−3.3) TSC and multi-socket / NUMA
385+3.3. TSC and multi-socket / NUMA
386+--------------------------------
371387
372388 Multi-socket systems, especially large multi-socket systems are likely to have
373389 individual clocksources rather than a single, universally distributed clock.
@@ -385,7 +401,8 @@ standards for telecommunications and computer equipment. · 11 unmodified lines
385401 It is recommended not to trust the TSCs to remain synchronized on NUMA or
386402 multiple socket systems for these reasons.
387403
388−3.4) TSC and C-states
404+3.4. TSC and C-states
405+---------------------
389406
390407 C-states, or idling states of the processor, especially C1E and deeper sleep
391408 states may be problematic for TSC as well. The TSC may stop advancing in such
@@ -396,7 +413,8 @@ based on CPU and chipset identifications. · 4 unmodified lines
396413 The TSC in such a case may be corrected by catching it up to a known external
397414 clocksource.
398415
399−3.5) TSC frequency change / P-states
416+3.5. TSC frequency change / P-states
417+------------------------------------
400418
401419 To make things slightly more interesting, some CPUs may change frequency. They
402420 may or may not run the TSC at the same rate, and because the frequency change
@@ -416,14 +434,16 @@ other processors. In such cases, the TSC on halted CPUs could advance faster · 13 unmodified lines
416434 than that of non-halted processors. AMD Turion processors are known to have
417435 this problem.
418436
419−3.6) TSC and STPCLK / T-states
437+3.6. TSC and STPCLK / T-states
438+------------------------------
420439
421440 External signals given to the processor may also have the effect of stopping
422441 the TSC. This is typically done for thermal emergency power control to prevent
423442 an overheating condition, and typically, there is no way to detect that this
424443 condition has happened.
425444
426−3.7) TSC virtualization - VMX
445+3.7. TSC virtualization - VMX
446+-----------------------------
427447
428448 VMX provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP
429449 instructions, which is enough for full virtualization of TSC in any manner. In
@@ -431,14 +451,16 @@ addition, VMX allows passing through the host TSC plus an additional TSC_OFFSET · 1 unmodified line
431451 field specified in the VMCS. Special instructions must be used to read and
432452 write the VMCS field.
433453
434−3.8) TSC virtualization - SVM
454+3.8. TSC virtualization - SVM
455+-----------------------------
435456
436457 SVM provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP
437458 instructions, which is enough for full virtualization of TSC in any manner. In
438459 addition, SVM allows passing through the host TSC plus an additional offset
439460 field specified in the SVM control block.
440461
441−3.9) TSC feature bits in Linux
462+3.9. TSC feature bits in Linux
463+------------------------------
442464
443465 In summary, there is no way to guarantee the TSC remains in perfect
444466 synchronization unless it is explicitly guaranteed by the architecture. Even
@@ -448,13 +470,16 @@ despite being locally consistent. · 3 unmodified lines
448470 The following feature bits are used by Linux to signal various TSC attributes,
449471 but they can only be taken to be meaningful for UP or single node systems.
450472
451−X86_FEATURE_TSC : The TSC is available in hardware
452−X86_FEATURE_RDTSCP : The RDTSCP instruction is available
453−X86_FEATURE_CONSTANT_TSC : The TSC rate is unchanged with P-states
454−X86_FEATURE_NONSTOP_TSC : The TSC does not stop in C-states
455−X86_FEATURE_TSC_RELIABLE : TSC sync checks are skipped (VMware)
473+========================= =======================================
474+X86_FEATURE_TSC The TSC is available in hardware
475+X86_FEATURE_RDTSCP The RDTSCP instruction is available
476+X86_FEATURE_CONSTANT_TSC The TSC rate is unchanged with P-states
477+X86_FEATURE_NONSTOP_TSC The TSC does not stop in C-states
478+X86_FEATURE_TSC_RELIABLE TSC sync checks are skipped (VMware)
479+========================= =======================================
456480
457−4) Virtualization Problems
481+4. Virtualization Problems
482+==========================
458483
459484 Timekeeping is especially problematic for virtualization because a number of
460485 challenges arise. The most obvious problem is that time is now shared between
@@ -473,7 +498,8 @@ BIOS, but not in such an extreme fashion. However, the fact that SMM mode may · 12 unmodified lines
473498 cause similar problems to virtualization makes it a good justification for
474499 solving many of these problems on bare metal.
475500
476−4.1) Interrupt clocking
501+4.1. Interrupt clocking
502+-----------------------
477503
478504 One of the most immediate problems that occurs with legacy operating systems
479505 is that the system timekeeping routines are often designed to keep track of
@@ -502,7 +528,8 @@ thus requires interrupt slewing to keep proper time. It does use a low enough · 22 unmodified lines
502528 rate (ed: is it 18.2 Hz?) however that it has not yet been a problem in
503529 practice.
504530
505−4.2) TSC sampling and serialization
531+4.2. TSC sampling and serialization
532+-----------------------------------
506533
507534 As the highest precision time source available, the cycle counter of the CPU
508535 has aroused much interest from developers. As explained above, this timer has
@@ -524,7 +551,8 @@ it may be necessary for an implementation to guard against "backwards" reads of · 15 unmodified lines
524551 the TSC as seen from other CPUs, even in an otherwise perfectly synchronized
525552 system.
526553
527−4.3) Timespec aliasing
554+4.3. Timespec aliasing
555+----------------------
528556
529557 Additionally, this lack of serialization from the TSC poses another challenge
530558 when using results of the TSC when measured against another time source. As
@@ -548,7 +576,8 @@ This aliasing requires care in the computation and recalibration of kvmclock · 17 unmodified lines
548576 and any other values derived from TSC computation (such as TSC virtualization
549577 itself).
550578
551−4.4) Migration
579+4.4. Migration
580+--------------
552581
553582 Migration of a virtual machine raises problems for timekeeping in two ways.
554583 First, the migration itself may take time, during which interrupts cannot be
@@ -566,7 +595,8 @@ always be caught up to the original rate. KVM clock avoids these problems by · 11 unmodified lines
566595 simply storing multipliers and offsets against the TSC for the guest to convert
567596 back into nanosecond resolution values.
568597
569−4.5) Scheduling
598+4.5. Scheduling
599+---------------
570600
571601 Since scheduling may be based on precise timing and firing of interrupts, the
572602 scheduling algorithms of an operating system may be adversely affected by
@@ -579,7 +609,8 @@ In an attempt to work around this, several implementations have provided a · 6 unmodified lines
579609 paravirtualized scheduler clock, which reveals the true amount of CPU time for
580610 which a virtual machine has been running.
581611
582−4.6) Watchdogs
612+4.6. Watchdogs
613+--------------
583614
584615 Watchdog timers, such as the lock detector in Linux may fire accidentally when
585616 running under hardware virtualization due to timer interrupts being delayed or
@@ -587,7 +618,8 @@ misinterpretation of the passage of real time. Usually, these warnings are · 1 unmodified line
587618 spurious and can be ignored, but in some circumstances it may be necessary to
588619 disable such detection.
589620
590−4.7) Delays and precision timing
621+4.7. Delays and precision timing
622+--------------------------------
591623
592624 Precise timing and delays may not be possible in a virtualized system. This
593625 can happen if the system is controlling physical hardware, or issues delays to
@@ -600,7 +632,8 @@ The second issue may cause performance problems, but this is unlikely to be a · 6 unmodified lines
600632 significant issue. In many cases these delays may be eliminated through
601633 configuration or paravirtualization.
602634
603−4.8) Covert channels and leaks
635+4.8. Covert channels and leaks
636+------------------------------
604637
605638 In addition to the above problems, time information will inevitably leak to the
606639 guest about the host in anything but a perfect implementation of virtualized
Documentation/virt/uml/user_mode_linux.rstrenamed from Documentation/virt/uml/UserModeLinux-HOWTO.txt+812−998
@@ -1,12 +1,17 @@
1− User Mode Linux HOWTO
2− User Mode Linux Core Team
3− Mon Nov 18 14:16:16 EST 2002
1+.. SPDX-License-Identifier: GPL-2.0
42
5− This document describes the use and abuse of Jeff Dike's User Mode
6− Linux: a port of the Linux kernel as a normal Intel Linux process.
7− ______________________________________________________________________
3+=====================
4+User Mode Linux HOWTO
5+=====================
86
9− Table of Contents
7+:Author: User Mode Linux Core Team
8+:Last-updated: Sat Jan 25 16:07:55 CET 2020
9+
10+This document describes the use and abuse of Jeff Dike's User Mode
11+Linux: a port of the Linux kernel as a normal Intel Linux process.
12+
13+
14+.. Table of Contents
1015
1116 1. Introduction
1217
@@ -132,19 +137,19 @@ · 119 unmodified lines
132137 15.5 Other contributions
133138
134139
135− ______________________________________________________________________
136−
137− 1. Introduction
140+1. Introduction
141+================
138142
139143 Welcome to User Mode Linux. It's going to be fun.
140144
141145
142146
143− 1.1. How is User Mode Linux Different?
147+1.1. How is User Mode Linux Different?
148+---------------------------------------
144149
145150 Normally, the Linux Kernel talks straight to your hardware (video
146151 card, keyboard, hard drives, etc), and any programs which run ask the
147− kernel to operate the hardware, like so:
152+ kernel to operate the hardware, like so::
148153
149154
150155
@@ -160,10 +165,10 @@ · 9 unmodified lines
160165
161166
162167 The User Mode Linux Kernel is different; instead of talking to the
163− hardware, it talks to a `real' Linux kernel (called the `host kernel'
168+ hardware, it talks to a `real` Linux kernel (called the `host kernel`
164169 from now on), like any other program. Programs can then run inside
165170 User-Mode Linux as if they were running under a normal kernel, like
166− so:
171+ so::
167172
168173
169174
@@ -181,7 +186,8 @@ · 11 unmodified lines
181186
182187
183188
184− 1.2. Why Would I Want User Mode Linux?
189+1.2. Why Would I Want User Mode Linux?
190+---------------------------------------
185191
186192
187193 1. If User Mode Linux crashes, your host kernel is still fine.
@@ -204,83 +210,41 @@ · 16 unmodified lines
204210
205211
206212
213+.. _Compiling_the_kernel_and_modules:
207214
208−
209− 2. Compiling the kernel and modules
215+2. Compiling the kernel and modules
216+====================================
210217
211218
212219
213220
214− 2.1. Compiling the kernel
221+2.1. Compiling the kernel
222+--------------------------
215223
216224
217225 Compiling the user mode kernel is just like compiling any other
218− kernel. Let's go through the steps, using 2.4.0-prerelease (current
219− as of this writing) as an example:
220−
221−
222− 1. Download the latest UML patch from
223−
224− the download page <http://user-mode-linux.sourceforge.net/
225−
226− In this example, the file is uml-patch-2.4.0-prerelease.bz2.
226+ kernel.
227227
228228
229− 2. Download the matching kernel from your favourite kernel mirror,
229+ 1. Download the latest kernel from your favourite kernel mirror,
230230 such as:
231231
232− ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2
233− <ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2>
234− .
235−
236−
237− 3. Make a directory and unpack the kernel into it.
238−
232+ https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.14.tar.xz
239233
234+ 2. Make a directory and unpack the kernel into it::
240235
241236 host%
242237 mkdir ~/uml
243238
244−
245−
246−
247−
248−
249239 host%
250240 cd ~/uml
251241
252−
253−
254−
255−
256−
257− host%
258− tar -xzvf linux-2.4.0-prerelease.tar.bz2
259−
260−
261−
262−
263−
264−
265− 4. Apply the patch using
266−
267−
268−
269− host%
270− cd ~/uml/linux
271−
272−
273−
274242 host%
275− bzcat uml-patch-2.4.0-prerelease.bz2 | patch -p1
243+ tar xvf linux-5.4.14.tar.xz
276244
277245
278−
279−
280−
281−
282− 5. Run your favorite config; `make xconfig ARCH=um' is the most
283− convenient. `make config ARCH=um' and 'make menuconfig ARCH=um'
246+ 3. Run your favorite config; ``make xconfig ARCH=um`` is the most
247+ convenient. ``make config ARCH=um`` and ``make menuconfig ARCH=um``
284248 will work as well. The defaults will give you a useful kernel. If
285249 you want to change something, go ahead, it probably won't hurt
286250 anything.
@@ -288,44 +252,20 @@ · 1 unmodified line
288252
289253 Note: If the host is configured with a 2G/2G address space split
290254 rather than the usual 3G/1G split, then the packaged UML binaries
291− will not run. They will immediately segfault. See ``UML on 2G/2G
292− hosts'' for the scoop on running UML on your system.
293−
294−
295−
296− 6. Finish with `make linux ARCH=um': the result is a file called
297− `linux' in the top directory of your source tree.
298−
299− Make sure that you don't build this kernel in /usr/src/linux. On some
300− distributions, /usr/include/asm is a link into this pool. The user-
301− mode build changes the other end of that link, and things that include
302− <asm/anything.h> stop compiling.
303−
304− The sources are also available from cvs at the project's cvs page,
305− which has directions on getting the sources. You can also browse the
306− CVS pool from there.
255+ will not run. They will immediately segfault. See
256+ :ref:`UML_on_2G/2G_hosts` for the scoop on running UML on your system.
307257
308− If you get the CVS sources, you will have to check them out into an
309− empty directory. You will then have to copy each file into the
310− corresponding directory in the appropriate kernel pool.
311258
312− If you don't have the latest kernel pool, you can get the
313− corresponding user-mode sources with
314259
260+ 4. Finish with ``make linux ARCH=um``: the result is a file called
261+ ``linux`` in the top directory of your source tree.
315262
316− host% cvs co -r v_2_3_x linux
317263
318−
319−
320−
321− where 'x' is the version in your pool. Note that you will not get the
322− bug fixes and enhancements that have gone into subsequent releases.
323−
324−
325− 2.2. Compiling and installing kernel modules
264+2.2. Compiling and installing kernel modules
265+---------------------------------------------
326266
327267 UML modules are built in the same way as the native kernel (with the
328− exception of the 'ARCH=um' that you always need for UML):
268+ exception of the 'ARCH=um' that you always need for UML)::
329269
330270
331271 host% make modules ARCH=um
@@ -337,12 +277,12 @@ · 5 unmodified lines
337277 the user-mode pool. Modules from the native kernel won't work.
338278
339279 You can install them by using ftp or something to copy them into the
340− virtual machine and dropping them into /lib/modules/`uname -r`.
280+ virtual machine and dropping them into ``/lib/modules/$(uname -r)``.
341281
342282 You can also get the kernel build process to install them as follows:
343283
344284 1. with the kernel not booted, mount the root filesystem in the top
345− level of the kernel pool:
285+ level of the kernel pool::
346286
347287
348288 host% mount root_fs mnt -o loop
@@ -352,7 +292,7 @@ · 3 unmodified lines
352292
353293
354294
355− 2. run
295+ 2. run::
356296
357297
358298 host%
@@ -363,7 +303,7 @@ · 4 unmodified lines
363303
364304
365305
366− 3. unmount the filesystem
306+ 3. unmount the filesystem::
367307
368308
369309 host% umount mnt
@@ -381,27 +321,28 @@ · 11 unmodified lines
381321 as modules, especially filesystems and network protocols and filters,
382322 so most symbols which need to be exported probably already are.
383323 However, if you do find symbols that need exporting, let us
384− <http://user-mode-linux.sourceforge.net/> know, and
324+ know at http://user-mode-linux.sourceforge.net/, and
385325 they'll be "taken care of".
386326
387327
388328
389− 2.3. Compiling and installing uml_utilities
329+2.3. Compiling and installing uml_utilities
330+--------------------------------------------
390331
391332 Many features of the UML kernel require a user-space helper program,
392333 so a uml_utilities package is distributed separately from the kernel
393334 patch which provides these helpers. Included within this is:
394335
395− o port-helper - Used by consoles which connect to xterms or ports
336+ - port-helper - Used by consoles which connect to xterms or ports
396337
397− o tunctl - Configuration tool to create and delete tap devices
338+ - tunctl - Configuration tool to create and delete tap devices
398339
399− o uml_net - Setuid binary for automatic tap device configuration
340+ - uml_net - Setuid binary for automatic tap device configuration
400341
401− o uml_switch - User-space virtual switch required for daemon
342+ - uml_switch - User-space virtual switch required for daemon
402343 transport
403344
404− The uml_utilities tree is compiled with:
345+ The uml_utilities tree is compiled with::
405346
406347
407348 host#
@@ -423,38 +364,42 @@ · 15 unmodified lines
423364
424365
425366
426− 3. Running UML and logging in
367+3. Running UML and logging in
368+==============================
427369
428370
429371
430− 3.1. Running UML
372+3.1. Running UML
373+-----------------
431374
432− It runs on 2.2.15 or later, and all 2.4 kernels.
375+ It runs on 2.2.15 or later, and all kernel versions since 2.4.
433376
434377
435378 Booting UML is straightforward. Simply run 'linux': it will try to
436− mount the file `root_fs' in the current directory. You do not need to
437− run it as root. If your root filesystem is not named `root_fs', then
438− you need to put a `ubd0=root_fs_whatever' switch on the linux command
379+ mount the file ``root_fs`` in the current directory. You do not need to
380+ run it as root. If your root filesystem is not named ``root_fs``, then
381+ you need to put a ``ubd0=root_fs_whatever`` switch on the linux command
439382 line.
440383
441384
442385 You will need a filesystem to boot UML from. There are a number
443− available for download from here <http://user-mode-
444− linux.sourceforge.net/> . There are also several tools
445− <http://user-mode-linux.sourceforge.net/> which can be
386+ available for download from http://user-mode-linux.sourceforge.net.
387+ There are also several tools at
388+ http://user-mode-linux.sourceforge.net/ which can be
446389 used to generate UML-compatible filesystem images from media.
447390 The kernel will boot up and present you with a login prompt.
448391
449392
450− Note: If the host is configured with a 2G/2G address space split
393+Note:
394+ If the host is configured with a 2G/2G address space split
451395 rather than the usual 3G/1G split, then the packaged UML binaries will
452− not run. They will immediately segfault. See ``UML on 2G/2G hosts''
396+ not run. They will immediately segfault. See :ref:`UML_on_2G/2G_hosts`
453397 for the scoop on running UML on your system.
454398
455399
456400
457− 3.2. Logging in
401+3.2. Logging in
402+----------------
458403
459404
460405
@@ -468,22 +413,22 @@ · 7 unmodified lines
468413
469414 There are a couple of other ways to log in:
470415
471− o On a virtual console
416+ - On a virtual console
472417
473418
474419
475420 Each virtual console that is configured (i.e. the device exists in
476421 /dev and /etc/inittab runs a getty on it) will come up in its own
477− xterm. If you get tired of the xterms, read ``Setting up serial
478− lines and consoles'' to see how to attach the consoles to
479− something else, like host ptys.
422+ xterm. If you get tired of the xterms, read
423+ :ref:`setting_up_serial_lines_and_consoles` to see how to attach
424+ the consoles to something else, like host ptys.
480425
481426
482427
483− o Over the serial line
428+ - Over the serial line
484429
485430
486− In the boot output, find a line that looks like:
431+ In the boot output, find a line that looks like::
487432
488433
489434
@@ -493,7 +438,7 @@ · 3 unmodified lines
493438
494439
495440 Attach your favorite terminal program to the corresponding tty. I.e.
496− for minicom, the command would be
441+ for minicom, the command would be::
497442
498443
499444 host% minicom -o -p /dev/ttyp1
@@ -503,37 +448,40 @@ · 3 unmodified lines
503448
504449
505450
506− o Over the net
451+ - Over the net
507452
508453
509454 If the network is running, then you can telnet to the virtual
510− machine and log in to it. See ``Setting up the network'' to learn
455+ machine and log in to it. See :ref:`Setting_up_the_network` to learn
511456 about setting up a virtual network.
512457
513458 When you're done using it, run halt, and the kernel will bring itself
514459 down and the process will exit.
515460
516461
517− 3.3. Examples
462+3.3. Examples
463+--------------
518464
519465 Here are some examples of UML in action:
520466
521− o A login session <http://user-mode-linux.sourceforge.net/login.html>
467+ - A login session http://user-mode-linux.sourceforge.net/old/login.html
522468
523− o A virtual network <http://user-mode-linux.sourceforge.net/net.html>
469+ - A virtual network http://user-mode-linux.sourceforge.net/old/net.html
524470
525471
526472
527473
528474
475+.. _UML_on_2G/2G_hosts:
529476
477+4. UML on 2G/2G hosts
478+======================
530479
531− 4. UML on 2G/2G hosts
532480
533481
534482
535−
536− 4.1. Introduction
483+4.1. Introduction
484+------------------
537485
538486
539487 Most Linux machines are configured so that the kernel occupies the
@@ -546,7 +494,8 @@ · 6 unmodified lines
546494
547495
548496
549− 4.2. The problem
497+4.2. The problem
498+-----------------
550499
551500
552501 The prebuilt UML binaries on this site will not run on 2G/2G hosts
@@ -558,13 +507,14 @@ · 5 unmodified lines
558507
559508
560509
561− 4.3. The solution
510+4.3. The solution
511+------------------
562512
563513
564514 The fix for this is to rebuild UML from source after enabling
565515 CONFIG_HOST_2G_2G (under 'General Setup'). This will cause UML to
566516 load itself in the top .5G of that smaller process address space,
567− where it will run fine. See ``Compiling the kernel and modules'' if
517+ where it will run fine. See :ref:`Compiling_the_kernel_and_modules` if
568518 you need help building UML from source.
569519
570520
@@ -573,10 +523,11 @@ · 2 unmodified lines
573523
574524
575525
526+.. _setting_up_serial_lines_and_consoles:
576527
577528
578−
579− 5. Setting up serial lines and consoles
529+5. Setting up serial lines and consoles
530+========================================
580531
581532
582533 It is possible to attach UML serial lines and consoles to many types
@@ -584,22 +535,23 @@ · 1 unmodified line
584535
585536
586537 You can attach them to host ptys, ttys, file descriptors, and ports.
587− This allows you to do things like
538+ This allows you to do things like:
588539
589− o have a UML console appear on an unused host console,
540+ - have a UML console appear on an unused host console,
590541
591− o hook two virtual machines together by having one attach to a pty
542+ - hook two virtual machines together by having one attach to a pty
592543 and having the other attach to the corresponding tty
593544
594− o make a virtual machine accessible from the net by attaching a
545+ - make a virtual machine accessible from the net by attaching a
595546 console to a port on the host.
596547
597548
598− The general format of the command line option is device=channel.
549+ The general format of the command line option is ``device=channel``.
599550
600551
601552
602− 5.1. Specifying the device
553+5.1. Specifying the device
554+---------------------------
603555
604556 Devices are specified with "con" or "ssl" (console or serial line,
605557 respectively), optionally with a device number if you are talking
@@ -613,7 +565,7 @@ · 7 unmodified lines
613565
614566 A specific device name will override a less general "con=" or "ssl=".
615567 So, for example, you can assign a pty to each of the serial lines
616− except for the first two like this:
568+ except for the first two like this::
617569
618570
619571 ssl=pty ssl0=tty:/dev/tty0 ssl1=tty:/dev/tty1
@@ -626,13 +578,14 @@ · 6 unmodified lines
626578
627579
628580
629− 5.2. Specifying the channel
581+5.2. Specifying the channel
582+----------------------------
630583
631584 There are a number of different types of channels to attach a UML
632585 device to, each with a different way of specifying exactly what to
633586 attach to.
634587
635− o pseudo-terminals - device=pty pts terminals - device=pts
588+ - pseudo-terminals - device=pty pts terminals - device=pts
636589
637590
638591 This will cause UML to allocate a free host pseudo-terminal for the
@@ -640,23 +593,23 @@ · 1 unmodified line
640593 log. You access it by attaching a terminal program to the
641594 corresponding tty:
642595
643− o screen /dev/pts/n
596+ - screen /dev/pts/n
644597
645− o screen /dev/ttyxx
598+ - screen /dev/ttyxx
646599
647− o minicom -o -p /dev/ttyxx - minicom seems not able to handle pts
600+ - minicom -o -p /dev/ttyxx - minicom seems not able to handle pts
648601 devices
649602
650− o kermit - start it up, 'open' the device, then 'connect'
603+ - kermit - start it up, 'open' the device, then 'connect'
651604
652605
653606
654607
655608
656− o terminals - device=tty:tty device file
609+ - terminals - device=tty:tty device file
657610
658611
659− This will make UML attach the device to the specified tty (i.e
612+ This will make UML attach the device to the specified tty (i.e::
660613
661614
662615 con1=tty:/dev/tty3
@@ -672,7 +625,7 @@ · 9 unmodified lines
672625
673626
674627
675− o xterms - device=xterm
628+ - xterms - device=xterm
676629
677630
678631 UML will run an xterm and the device will be attached to it.
@@ -681,12 +634,12 @@ · 2 unmodified lines
681634
682635
683636
684− o Port - device=port:port number
637+ - Port - device=port:port number
685638
686639
687640 This will attach the UML devices to the specified host port.
688641 Attaching console 1 to the host's port 9000 would be done like
689− this:
642+ this::
690643
691644
692645 con1=port:9000
@@ -694,7 +647,7 @@ · 1 unmodified line
694647
695648
696649
697− Attaching all the serial lines to that port would be done similarly:
650+ Attaching all the serial lines to that port would be done similarly::
698651
699652
700653 ssl=port:9000
@@ -702,8 +655,8 @@ · 1 unmodified line
702655
703656
704657
705− You access these devices by telnetting to that port. Each active tel-
706− net session gets a different device. If there are more telnets to a
658+ You access these devices by telnetting to that port. Each active
659+ telnet session gets a different device. If there are more telnets to a
707660 port than UML devices attached to it, then the extra telnet sessions
708661 will block until an existing telnet detaches, or until another device
709662 becomes active (i.e. by being activated in /etc/inittab).
@@ -725,13 +678,13 @@ · 15 unmodified lines
725678
726679
727680
728− o already-existing file descriptors - device=file descriptor
681+ - already-existing file descriptors - device=file descriptor
729682
730683
731684 If you set up a file descriptor on the UML command line, you can
732685 attach a UML device to it. This is most commonly used to put the
733686 main console back on stdin and stdout after assigning all the other
734− consoles to something else:
687+ consoles to something else::
735688
736689
737690 con0=fd:0,fd:1 con=pts
@@ -743,7 +696,7 @@ · 5 unmodified lines
743696
744697
745698
746− o Nothing - device=null
699+ - Nothing - device=null
747700
748701
749702 This allows the device to be opened, in contrast to 'none', but
@@ -754,7 +707,7 @@ · 4 unmodified lines
754707
755708
756709
757− o None - device=none
710+ - None - device=none
758711
759712
760713 This causes the device to disappear.
@@ -762,7 +715,7 @@ · 1 unmodified line
762715
763716
764717 You can also specify different input and output channels for a device
765− by putting a comma between them:
718+ by putting a comma between them::
766719
767720
768721 ssl3=tty:/dev/tty2,xterm
@@ -785,14 +738,15 @@ · 16 unmodified lines
785738
786739
787740
788− 5.3. Examples
741+5.3. Examples
742+--------------
789743
790744 There are a number of interesting things you can do with this
791745 capability.
792746
793747
794748 First, this is how you get rid of those bleeding console xterms by
795− attaching them to host ptys:
749+ attaching them to host ptys::
796750
797751
798752 con=pty con0=fd:0,fd:1
@@ -802,7 +756,7 @@ · 3 unmodified lines
802756
803757 This will make a UML console take over an unused host virtual console,
804758 so that when you switch to it, you will see the UML login prompt
805− rather than the host login prompt:
759+ rather than the host login prompt::
806760
807761
808762 con1=tty:/dev/tty6
@@ -813,7 +767,7 @@ · 4 unmodified lines
813767 You can attach two virtual machines together with what amounts to a
814768 serial line as follows:
815769
816− Run one UML with a serial line attached to a pty -
770+ Run one UML with a serial line attached to a pty::
817771
818772
819773 ssl1=pty
@@ -825,7 +779,7 @@ · 5 unmodified lines
825779 that it got /dev/ptyp1).
826780
827781 Boot the other UML with a serial line attached to the corresponding
828− tty -
782+ tty::
829783
830784
831785 ssl1=tty:/dev/ttyp1
@@ -838,7 +792,10 @@ · 6 unmodified lines
838792 prompt of the other virtual machine.
839793
840794
841− 6. Setting up the network
795+.. _setting_up_the_network:
796+
797+6. Setting up the network
798+==========================
842799
843800
844801
@@ -858,19 +815,19 @@ · 13 unmodified lines
858815 There are currently five transport types available for a UML virtual
859816 machine to exchange packets with other hosts:
860817
861− o ethertap
818+ - ethertap
862819
863− o TUN/TAP
820+ - TUN/TAP
864821
865− o Multicast
822+ - Multicast
866823
867− o a switch daemon
824+ - a switch daemon
868825
869− o slip
826+ - slip
870827
871− o slirp
828+ - slirp
872829
873− o pcap
830+ - pcap
874831
875832 The TUN/TAP, ethertap, slip, and slirp transports allow a UML
876833 instance to exchange packets with the host. They may be directed
@@ -893,28 +850,28 @@ · 16 unmodified lines
893850 With so many host transports, which one should you use? Here's when
894851 you should use each one:
895852
896− o ethertap - if you want access to the host networking and it is
853+ - ethertap - if you want access to the host networking and it is
897854 running 2.2
898855
899− o TUN/TAP - if you want access to the host networking and it is
856+ - TUN/TAP - if you want access to the host networking and it is
900857 running 2.4. Also, the TUN/TAP transport is able to use a
901858 preconfigured device, allowing it to avoid using the setuid uml_net
902859 helper, which is a security advantage.
903860
904− o Multicast - if you want a purely virtual network and you don't want
861+ - Multicast - if you want a purely virtual network and you don't want
905862 to set up anything but the UML
906863
907− o a switch daemon - if you want a purely virtual network and you
864+ - a switch daemon - if you want a purely virtual network and you
908865 don't mind running the daemon in order to get somewhat better
909866 performance
910867
911− o slip - there is no particular reason to run the slip backend unless
868+ - slip - there is no particular reason to run the slip backend unless
912869 ethertap and TUN/TAP are just not available for some reason
913870
914− o slirp - if you don't have root access on the host to setup
871+ - slirp - if you don't have root access on the host to setup
915872 networking, or if you don't want to allocate an IP to your UML
916873
917− o pcap - not much use for actual network connectivity, but great for
874+ - pcap - not much use for actual network connectivity, but great for
918875 monitoring traffic on the host
919876
920877 Ethertap is available on 2.4 and works fine. TUN/TAP is preferred
@@ -926,7 +883,8 @@ · 5 unmodified lines
926883 exploit the helper's root privileges.
927884
928885
929− 6.1. General setup
886+6.1. General setup
887+-------------------
930888
931889 First, you must have the virtual network enabled in your UML. If are
932890 running a prebuilt kernel from this site, everything is already
@@ -938,7 +896,7 @@ · 5 unmodified lines
938896 The next step is to provide a network device to the virtual machine.
939897 This is done by describing it on the kernel command line.
940898
941− The general format is
899+ The general format is::
942900
943901
944902 eth <n> = <transport> , <transport args>
@@ -947,7 +905,7 @@ · 2 unmodified lines
947905
948906
949907 For example, a virtual ethernet device may be attached to a host
950− ethertap device as follows:
908+ ethertap device as follows::
951909
952910
953911 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254
@@ -978,7 +936,7 @@ · 24 unmodified lines
978936
979937
980938 You can also add devices to a UML and remove them at runtime. See the
981− ``The Management Console'' page for details.
939+ :ref:`The_Management_Console` page for details.
982940
983941
984942 The sections below describe this in more detail.
@@ -995,7 +953,8 @@ · 10 unmodified lines
995953
996954
997955
998− 6.2. Userspace daemons
956+6.2. Userspace daemons
957+-----------------------
999958
1000959 You will likely need the setuid helper, or the switch daemon, or both.
1001960 They are both installed with the RPM and deb, so if you've installed
@@ -1011,7 +970,8 @@ · 9 unmodified lines
1011970
1012971
1013972
1014− 6.3. Specifying ethernet addresses
973+6.3. Specifying ethernet addresses
974+-----------------------------------
1015975
1016976 Below, you will see that the TUN/TAP, ethertap, and daemon interfaces
1017977 allow you to specify hardware addresses for the virtual ethernet
@@ -1023,21 +983,21 @@ · 5 unmodified lines
1023983 sufficient to guarantee a unique hardware address for the device. A
1024984 couple of exceptions are:
1025985
1026− o Another set of virtual ethernet devices are on the same network and
986+ - Another set of virtual ethernet devices are on the same network and
1027987 they are assigned hardware addresses using a different scheme which
1028988 may conflict with the UML IP address-based scheme
1029989
1030− o You aren't going to use the device for IP networking, so you don't
990+ - You aren't going to use the device for IP networking, so you don't
1031991 assign the device an IP address
1032992
1033993 If you let the driver provide the hardware address, you should make
1034994 sure that the device IP address is known before the interface is
1035− brought up. So, inside UML, this will guarantee that:
995+ brought up. So, inside UML, this will guarantee that::
1036996
1037997
1038998
1039− UML#
1040− ifconfig eth0 192.168.0.250 up
999+ UML#
1000+ ifconfig eth0 192.168.0.250 up
10411001
10421002
10431003
@@ -1049,13 +1009,14 @@ · 5 unmodified lines
10491009
10501010
10511011
1052− 6.4. UML interface setup
1012+6.4. UML interface setup
1013+-------------------------
10531014
10541015 Once the network devices have been described on the command line, you
10551016 should boot UML and log in.
10561017
10571018
1058− The first thing to do is bring the interface up:
1019+ The first thing to do is bring the interface up::
10591020
10601021
10611022 UML# ifconfig ethn ip-address up
@@ -1067,7 +1028,7 @@ · 5 unmodified lines
10671028
10681029
10691030 To reach the rest of the world, you should set a default route to the
1070− host:
1031+ host::
10711032
10721033
10731034 UML# route add default gw host ip
@@ -1075,7 +1036,7 @@ · 1 unmodified line
10751036
10761037
10771038
1078− Again, with host ip of 192.168.0.4:
1039+ Again, with host ip of 192.168.0.4::
10791040
10801041
10811042 UML# route add default gw 192.168.0.4
@@ -1097,29 +1058,25 @@ · 15 unmodified lines
10971058 Note: If you can't communicate with other hosts on your physical
10981059 ethernet, it's probably because of a network route that's
10991060 automatically set up. If you run 'route -n' and see a route that
1100− looks like this:
1061+ looks like this::
11011062
11021063
11031064
11041065
1105− Destination Gateway Genmask Flags Metric Ref Use Iface
1106− 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
1066+ Destination Gateway Genmask Flags Metric Ref Use Iface
1067+ 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
11071068
11081069
11091070
11101071
11111072 with a mask that's not 255.255.255.255, then replace it with a route
1112− to your host:
1073+ to your host::
11131074
11141075
11151076 UML#
11161077 route del -net 192.168.0.0 dev eth0 netmask 255.255.255.0
11171078
11181079
1119−
1120−
1121−
1122−
11231080 UML#
11241081 route add -host 192.168.0.4 dev eth0
11251082
@@ -1131,7 +1088,8 @@ · 5 unmodified lines
11311088
11321089
11331090
1134− 6.5. Multicast
1091+6.5. Multicast
1092+---------------
11351093
11361094 The simplest way to set up a virtual network between multiple UMLs is
11371095 to use the mcast transport. This was written by Harald Welte and is
@@ -1142,7 +1100,7 @@ · 4 unmodified lines
11421100 messages when you bring the device up inside UML.
11431101
11441102
1145− To use it, run two UMLs with
1103+ To use it, run two UMLs with::
11461104
11471105
11481106 eth0=mcast
@@ -1151,16 +1109,12 @@ · 2 unmodified lines
11511109
11521110
11531111 on their command lines. Log in, configure the ethernet device in each
1154− machine with different IP addresses:
1112+ machine with different IP addresses::
11551113
11561114
11571115 UML1# ifconfig eth0 192.168.0.254
11581116
11591117
1160−
1161−
1162−
1163−
11641118 UML2# ifconfig eth0 192.168.0.253
11651119
11661120
@@ -1168,7 +1122,7 @@ · 1 unmodified line
11681122
11691123 and they should be able to talk to each other.
11701124
1171− The full set of command line options for this transport are
1125+ The full set of command line options for this transport are::
11721126
11731127
11741128
@@ -1177,16 +1131,11 @@ · 2 unmodified lines
11771131
11781132
11791133
1180−
1181− Harald's original README is here <http://user-mode-linux.source-
1182− forge.net/> and explains these in detail, as well as
1183− some other issues.
1184−
11851134 There is also a related point-to-point only "ucast" transport.
11861135 This is useful when your network does not support multicast, and
11871136 all network connections are simple point to point links.
11881137
1189− The full set of command line options for this transport are
1138+ The full set of command line options for this transport are::
11901139
11911140
11921141 ethn=ucast,ethernet address,remote address,listen port,remote port
@@ -1194,7 +1143,8 @@ · 1 unmodified line
11941143
11951144
11961145
1197− 6.6. TUN/TAP with the uml_net helper
1146+6.6. TUN/TAP with the uml_net helper
1147+-------------------------------------
11981148
11991149 TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the
12001150 host. The TUN/TAP backend has been in UML since 2.4.9-3um.
@@ -1216,7 +1166,7 @@ · 15 unmodified lines
12161166 kernel or as the tun.o module.
12171167
12181168 The format of the command line switch to attach a device to a TUN/TAP
1219− device is
1169+ device is::
12201170
12211171
12221172 eth <n> =tuntap,,, <IP address>
@@ -1226,7 +1176,7 @@ · 3 unmodified lines
12261176
12271177 For example, this argument will attach the UML's eth0 to the next
12281178 available tap device and assign an ethernet address to it based on its
1229− IP address
1179+ IP address::
12301180
12311181
12321182 eth0=tuntap,,,192.168.0.254
@@ -1247,10 +1197,10 @@ · 14 unmodified lines
12471197 There are a couple potential problems with running the TUN/TAP
12481198 transport on a 2.4 host kernel
12491199
1250− o TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host
1200+ - TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host
12511201 kernel or use the ethertap transport.
12521202
1253− o With an upgraded kernel, TUN/TAP may fail with
1203+ - With an upgraded kernel, TUN/TAP may fail with::
12541204
12551205
12561206 File descriptor in bad state
@@ -1263,13 +1213,12 @@ · 6 unmodified lines
12631213 make sure that /usr/src/linux points to the headers for the running
12641214 kernel.
12651215
1266− These were pointed out by Tim Robinson <timro at trkr dot net> in
1267− <http://www.geocrawler.com/> name="this uml-
1268− user post"> .
1216+ These were pointed out by Tim Robinson <timro at trkr dot net> in the past.
12691217
12701218
12711219
1272− 6.7. TUN/TAP with a preconfigured tap device
1220+6.7. TUN/TAP with a preconfigured tap device
1221+---------------------------------------------
12731222
12741223 If you prefer not to have UML use uml_net (which is somewhat
12751224 insecure), with UML 2.4.17-11, you can set up a TUN/TAP device
@@ -1277,8 +1226,8 @@ · 1 unmodified line
12771226 there is no need for root assistance. Setting up the device is done
12781227 as follows:
12791228
1280− o Create the device with tunctl (available from the UML utilities
1281− tarball)
1229+ - Create the device with tunctl (available from the UML utilities
1230+ tarball)::
12821231
12831232
12841233
@@ -1291,8 +1240,8 @@ · 6 unmodified lines
12911240 where uid is the user id or username that UML will be run as. This
12921241 will tell you what device was created.
12931242
1294− o Configure the device IP (change IP addresses and device name to
1295− suit)
1243+ - Configure the device IP (change IP addresses and device name to
1244+ suit)::
12961245
12971246
12981247
@@ -1303,8 +1252,8 @@ · 4 unmodified lines
13031252
13041253
13051254
1306− o Set up routing and arping if desired - this is my recipe, there are
1307− other ways of doing the same thing
1255+ - Set up routing and arping if desired - this is my recipe, there are
1256+ other ways of doing the same thing::
13081257
13091258
13101259 host#
@@ -1313,19 +1262,9 @@ · 2 unmodified lines
13131262 host#
13141263 route add -host 192.168.0.253 dev tap0
13151264
1316−
1317−
1318−
1319−
1320−
13211265 host#
13221266 bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
13231267
1324−
1325−
1326−
1327−
1328−
13291268 host#
13301269 arp -Ds 192.168.0.253 eth0 pub
13311270
@@ -1338,76 +1277,43 @@ · 6 unmodified lines
13381277 utility which reads the information from a config file and sets up
13391278 devices at boot time.
13401279
1341− o Rather than using up two IPs and ARPing for one of them, you can
1280+ - Rather than using up two IPs and ARPing for one of them, you can
13421281 also provide direct access to your LAN by the UML by using a
1343− bridge.
1282+ bridge::
13441283
13451284
13461285 host#
13471286 brctl addbr br0
13481287
13491288
1350−
1351−
1352−
1353−
13541289 host#
13551290 ifconfig eth0 0.0.0.0 promisc up
13561291
13571292
1358−
1359−
1360−
1361−
13621293 host#
13631294 ifconfig tap0 0.0.0.0 promisc up
13641295
13651296
1366−
1367−
1368−
1369−
13701297 host#
13711298 ifconfig br0 192.168.0.1 netmask 255.255.255.0 up
13721299
13731300
1374−
1375−
1376−
1377−
1378−
1379− host#
1380− brctl stp br0 off
1381−
1382−
1383−
1384−
1301+ host#
1302+ brctl stp br0 off
13851303
13861304
13871305 host#
13881306 brctl setfd br0 1
13891307
13901308
1391−
1392−
1393−
1394−
13951309 host#
13961310 brctl sethello br0 1
13971311
13981312
1399−
1400−
1401−
1402−
14031313 host#
14041314 brctl addif br0 eth0
14051315
14061316
1407−
1408−
1409−
1410−
14111317 host#
14121318 brctl addif br0 tap0
14131319
@@ -1417,12 +1323,12 @@ · 3 unmodified lines
14171323 Note that 'br0' should be setup using ifconfig with the existing IP
14181324 address of eth0, as eth0 no longer has its own IP.
14191325
1420− o
1326+ -
14211327
14221328
14231329 Also, the /dev/net/tun device must be writable by the user running
14241330 UML in order for the UML to use the device that's been configured
1425− for it. The simplest thing to do is
1331+ for it. The simplest thing to do is::
14261332
14271333
14281334 host# chmod 666 /dev/net/tun
@@ -1438,14 +1344,14 @@ · 9 unmodified lines
14381344 devices and chgrp /dev/net/tun to that group with mode 664 or 660.
14391345
14401346
1441− o Once the device is set up, run UML with 'eth0=tuntap,device name'
1347+ - Once the device is set up, run UML with 'eth0=tuntap,device name'
14421348 (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the
14431349 mconsole config command).
14441350
1445− o Bring the eth device up in UML and you're in business.
1351+ - Bring the eth device up in UML and you're in business.
14461352
14471353 If you don't want that tap device any more, you can make it non-
1448− persistent with
1354+ persistent with::
14491355
14501356
14511357 host# tunctl -d tap device
@@ -1455,7 +1361,7 @@ · 3 unmodified lines
14551361
14561362 Finally, tunctl has a -b (for brief mode) switch which causes it to
14571363 output only the name of the tap device it created. This makes it
1458− suitable for capture by a script:
1364+ suitable for capture by a script::
14591365
14601366
14611367 host# TAP=`tunctl -u 1000 -b`
@@ -1465,7 +1371,8 @@ · 3 unmodified lines
14651371
14661372
14671373
1468− 6.8. Ethertap
1374+6.8. Ethertap
1375+--------------
14691376
14701377 Ethertap is the general mechanism on 2.2 for userspace processes to
14711378 exchange packets with the kernel.
@@ -1473,7 +1380,7 @@ · 1 unmodified line
14731380
14741381
14751382 To use this transport, you need to describe the virtual network device
1476− on the UML command line. The general format for this is
1383+ on the UML command line. The general format for this is::
14771384
14781385
14791386 eth <n> =ethertap, <device> , <ethernet address> , <tap IP address>
@@ -1481,7 +1388,7 @@ · 1 unmodified line
14811388
14821389
14831390
1484− So, the previous example
1391+ So, the previous example::
14851392
14861393
14871394 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254
@@ -1521,7 +1428,7 @@ · 33 unmodified lines
15211428
15221429 If you want to set things up yourself, you need to make sure that the
15231430 appropriate /dev entry exists. If it doesn't, become root and create
1524− it as follows:
1431+ it as follows::
15251432
15261433
15271434 mknod /dev/tap <minor> c 36 <minor> + 16
@@ -1529,7 +1436,7 @@ · 1 unmodified line
15291436
15301437
15311438
1532− For example, this is how to create /dev/tap0:
1439+ For example, this is how to create /dev/tap0::
15331440
15341441
15351442 mknod /dev/tap0 c 36 0 + 16
@@ -1539,7 +1446,7 @@ · 3 unmodified lines
15391446
15401447 You also need to make sure that the host kernel has ethertap support.
15411448 If ethertap is enabled as a module, you apparently need to insmod
1542− ethertap once for each ethertap device you want to enable. So,
1449+ ethertap once for each ethertap device you want to enable. So,::
15431450
15441451
15451452 host#
@@ -1549,7 +1456,7 @@ · 3 unmodified lines
15491456
15501457
15511458 will give you the tap0 interface. To get the tap1 interface, you need
1552− to run
1459+ to run::
15531460
15541461
15551462 host#
@@ -1561,7 +1468,8 @@ · 5 unmodified lines
15611468
15621469
15631470
1564− 6.9. The switch daemon
1471+6.9. The switch daemon
1472+-----------------------
15651473
15661474 Note: This is the daemon formerly known as uml_router, but which was
15671475 renamed so the network weenies of the world would stop growling at me.
@@ -1577,7 +1485,7 @@ · 9 unmodified lines
15771485 sockets.
15781486
15791487
1580− If you want it to listen on a different pair of sockets, use
1488+ If you want it to listen on a different pair of sockets, use::
15811489
15821490
15831491 -unix control socket data socket
@@ -1586,7 +1494,7 @@ · 2 unmodified lines
15861494
15871495
15881496
1589− If you want it to act as a hub rather than a switch, use
1497+ If you want it to act as a hub rather than a switch, use::
15901498
15911499
15921500 -hub
@@ -1596,7 +1504,7 @@ · 3 unmodified lines
15961504
15971505
15981506 If you want the switch to be connected to host networking (allowing
1599− the umls to get access to the outside world through the host), use
1507+ the umls to get access to the outside world through the host), use::
16001508
16011509
16021510 -tap tap0
@@ -1610,7 +1518,7 @@ · 7 unmodified lines
16101518 device than tap0, specify that instead of tap0.
16111519
16121520
1613− uml_switch can be backgrounded as follows
1521+ uml_switch can be backgrounded as follows::
16141522
16151523
16161524 host%
@@ -1623,7 +1531,7 @@ · 6 unmodified lines
16231531 stdin for EOF. When it sees that, it exits.
16241532
16251533
1626− The general format of the kernel command line switch is
1534+ The general format of the kernel command line switch is::
16271535
16281536
16291537
@@ -1639,7 +1547,8 @@ · 9 unmodified lines
16391547 how to communicate with the daemon. You should only specify them if
16401548 you told the daemon to use different sockets than the default. So, if
16411549 you ran the daemon with no arguments, running the UML on the same
1642− machine with
1550+ machine with::
1551+
16431552 eth0=daemon
16441553
16451554
@@ -1649,7 +1558,8 @@ · 3 unmodified lines
16491558
16501559
16511560
1652− 6.10. Slip
1561+6.10. Slip
1562+-----------
16531563
16541564 Slip is another, less general, mechanism for a process to communicate
16551565 with the host networking. In contrast to the ethertap interface,
@@ -1658,7 +1568,7 @@ · 2 unmodified lines
16581568 IP.
16591569
16601570
1661− The general format of the command line switch is
1571+ The general format of the command line switch is::
16621572
16631573
16641574
@@ -1681,7 +1591,8 @@ · 16 unmodified lines
16811591
16821592
16831593
1684− 6.11. Slirp
1594+6.11. Slirp
1595+------------
16851596
16861597 slirp uses an external program, usually /usr/bin/slirp, to provide IP
16871598 only networking connectivity through the host. This is similar to IP
@@ -1691,7 +1602,7 @@ · 3 unmodified lines
16911602 root access or setuid binaries on the host.
16921603
16931604
1694− The general format of the command line switch for slirp is:
1605+ The general format of the command line switch for slirp is::
16951606
16961607
16971608
@@ -1716,7 +1627,7 @@ · 18 unmodified lines
17161627 The eth0 interface on UML should be set up with the IP 10.2.0.15,
17171628 although you can use anything as long as it is not used by a network
17181629 you will be connecting to. The default route on UML should be set to
1719− use
1630+ use::
17201631
17211632
17221633 UML#
@@ -1737,10 +1648,11 @@ · 14 unmodified lines
17371648
17381649
17391650
1740− 6.12. pcap
1651+6.12. pcap
1652+-----------
17411653
17421654 The pcap transport is attached to a UML ethernet device on the command
1743− line or with uml_mconsole with the following syntax:
1655+ line or with uml_mconsole with the following syntax::
17441656
17451657
17461658
@@ -1762,7 +1674,7 @@ · 15 unmodified lines
17621674 expression optimizer is used.
17631675
17641676
1765− Example:
1677+ Example::
17661678
17671679
17681680
@@ -1777,7 +1689,8 @@ · 8 unmodified lines
17771689
17781690
17791691
1780− 6.13. Setting up the host yourself
1692+6.13. Setting up the host yourself
1693+-----------------------------------
17811694
17821695 If you don't specify an address for the host side of the ethertap or
17831696 slip device, UML won't do any setup on the host. So this is what is
@@ -1785,19 +1698,15 @@ · 1 unmodified line
17851698 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your
17861699 own network):
17871700
1788− o The device needs to be configured with its IP address. Tap devices
1701+ - The device needs to be configured with its IP address. Tap devices
17891702 are also configured with an mtu of 1484. Slip devices are
17901703 configured with a point-to-point address pointing at the UML ip
1791− address.
1704+ address::
17921705
17931706
17941707 host# ifconfig tap0 arp mtu 1484 192.168.0.251 up
17951708
17961709
1797−
1798−
1799−
1800−
18011710 host#
18021711 ifconfig sl0 192.168.0.251 pointopoint 192.168.0.250 up
18031712
@@ -1805,7 +1714,7 @@ · 1 unmodified line
18051714
18061715
18071716
1808− o If a tap device is being set up, a route is set to the UML IP.
1717+ - If a tap device is being set up, a route is set to the UML IP::
18091718
18101719
18111720 UML# route add -host 192.168.0.250 gw 192.168.0.251
@@ -1814,8 +1723,8 @@ · 2 unmodified lines
18141723
18151724
18161725
1817− o To allow other hosts on your network to see the virtual machine,
1818− proxy arp is set up for it.
1726+ - To allow other hosts on your network to see the virtual machine,
1727+ proxy arp is set up for it::
18191728
18201729
18211730 host# arp -Ds 192.168.0.250 eth0 pub
@@ -1824,7 +1733,7 @@ · 2 unmodified lines
18241733
18251734
18261735
1827− o Finally, the host is set up to route packets.
1736+ - Finally, the host is set up to route packets::
18281737
18291738
18301739 host# echo 1 > /proc/sys/net/ipv4/ip_forward
@@ -1838,12 +1747,14 @@ · 7 unmodified lines
18381747
18391748
18401749
1841− 7. Sharing Filesystems between Virtual Machines
1750+7. Sharing Filesystems between Virtual Machines
1751+================================================
18421752
18431753
18441754
18451755
1846− 7.1. A warning
1756+7.1. A warning
1757+---------------
18471758
18481759 Don't attempt to share filesystems simply by booting two UMLs from the
18491760 same file. That's the same thing as booting two physical machines
@@ -1851,7 +1762,8 @@ · 1 unmodified line
18511762
18521763
18531764
1854− 7.2. Using layered block devices
1765+7.2. Using layered block devices
1766+---------------------------------
18551767
18561768 The way to share a filesystem between two virtual machines is to use
18571769 the copy-on-write (COW) layering capability of the ubd block driver.
@@ -1872,7 +1784,7 @@ · 14 unmodified lines
18721784
18731785
18741786 To add a copy-on-write layer to an existing block device file, simply
1875− add the name of the COW file to the appropriate ubd switch:
1787+ add the name of the COW file to the appropriate ubd switch::
18761788
18771789
18781790 ubd0=root_fs_cow,root_fs_debian_22
@@ -1883,7 +1795,7 @@ · 4 unmodified lines
18831795 where 'root_fs_cow' is the private COW file and 'root_fs_debian_22' is
18841796 the existing shared filesystem. The COW file need not exist. If it
18851797 doesn't, the driver will create and initialize it. Once the COW file
1886− has been initialized, it can be used on its own on the command line:
1798+ has been initialized, it can be used on its own on the command line::
18871799
18881800
18891801 ubd0=root_fs_cow
@@ -1896,14 +1808,16 @@ · 6 unmodified lines
18961808
18971809
18981810
1899− 7.3. Note!
1811+7.3. Note!
1812+-----------
19001813
19011814 When checking the size of the COW file in order to see the gobs of
19021815 space that you're saving, make sure you use 'ls -ls' to see the actual
19031816 disk consumption rather than the length of the file. The COW file is
19041817 sparse, so the length will be very different from the disk usage.
19051818 Here is a 'ls -l' of a COW file and backing file from one boot and
1906− shutdown:
1819+ shutdown::
1820+
19071821 host% ls -l cow.debian debian2.2
19081822 -rw-r--r-- 1 jdike jdike 492504064 Aug 6 21:16 cow.debian
19091823 -rwxrw-rw- 1 jdike jdike 537919488 Aug 6 20:42 debian2.2
@@ -1911,7 +1825,7 @@ · 1 unmodified line
19111825
19121826
19131827
1914− Doesn't look like much saved space, does it? Well, here's 'ls -ls':
1828+ Doesn't look like much saved space, does it? Well, here's 'ls -ls'::
19151829
19161830
19171831 host% ls -ls cow.debian debian2.2
@@ -1926,7 +1840,8 @@ · 8 unmodified lines
19261840
19271841
19281842
1929− 7.4. Another warning
1843+7.4. Another warning
1844+---------------------
19301845
19311846 Once a filesystem is being used as a readonly backing file for a COW
19321847 file, do not boot directly from it or modify it in any way. Doing so
@@ -1952,7 +1867,8 @@ · 19 unmodified lines
19521867
19531868
19541869
1955− 7.5. uml_moo : Merging a COW file with its backing file
1870+7.5. uml_moo : Merging a COW file with its backing file
1871+--------------------------------------------------------
19561872
19571873 Depending on how you use UML and COW devices, it may be advisable to
19581874 merge the changes in the COW file into the backing file every once in
@@ -1961,7 +1877,7 @@ · 2 unmodified lines
19611877
19621878
19631879
1964− The utility that does this is uml_moo. Its usage is
1880+ The utility that does this is uml_moo. Its usage is::
19651881
19661882
19671883 host% uml_moo COW file new backing file
@@ -1991,8 +1907,8 @@ · 23 unmodified lines
19911907
19921908 uml_moo is installed with the UML deb and RPM. If you didn't install
19931909 UML from one of those packages, you can also get it from the UML
1994− utilities <http://user-mode-linux.sourceforge.net/
1995− utilities> tar file in tools/moo.
1910+ utilities http://user-mode-linux.sourceforge.net/utilities tar file
1911+ in tools/moo.
19961912
19971913
19981914
@@ -2001,7 +1917,8 @@ · 2 unmodified lines
20011917
20021918
20031919
2004− 8. Creating filesystems
1920+8. Creating filesystems
1921+========================
20051922
20061923
20071924 You may want to create and mount new UML filesystems, either because
@@ -2015,13 +1932,14 @@ · 7 unmodified lines
20151932 should be easy to translate to the filesystem of your choice.
20161933
20171934
2018− 8.1. Create the filesystem file
1935+8.1. Create the filesystem file
1936+================================
20191937
20201938 dd is your friend. All you need to do is tell dd to create an empty
20211939 file of the appropriate size. I usually make it sparse to save time
20221940 and to avoid allocating disk space until it's actually used. For
20231941 example, the following command will create a sparse 100 meg file full
2024− of zeroes.
1942+ of zeroes::
20251943
20261944
20271945 host%
@@ -2034,9 +1952,9 @@ · 6 unmodified lines
20341952
20351953 8.2. Assign the file to a UML device
20361954
2037− Add an argument like the following to the UML command line:
1955+ Add an argument like the following to the UML command line::
20381956
2039− ubd4=new_filesystem
1957+ ubd4=new_filesystem
20401958
20411959
20421960
@@ -2053,7 +1971,7 @@ · 10 unmodified lines
20531971 etc), then get them into UML by way of the net or hostfs.
20541972
20551973
2056− Make the new filesystem on the device assigned to the new file:
1974+ Make the new filesystem on the device assigned to the new file::
20571975
20581976
20591977 host# mkreiserfs /dev/ubd/4
@@ -2077,7 +1995,7 @@ · 17 unmodified lines
20771995
20781996
20791997
2080− Now, mount it:
1998+ Now, mount it::
20811999
20822000
20832001 UML#
@@ -2096,7 +2014,8 @@ · 12 unmodified lines
20962014
20972015
20982016
2099− 9. Host file access
2017+9. Host file access
2018+====================
21002019
21012020
21022021 If you want to access files on the host machine from inside UML, you
@@ -2112,10 +2031,11 @@ · 9 unmodified lines
21122031 files contained in it just as you would on the host.
21132032
21142033
2115− 9.1. Using hostfs
2034+9.1. Using hostfs
2035+------------------
21162036
21172037 To begin with, make sure that hostfs is available inside the virtual
2118− machine with
2038+ machine with::
21192039
21202040
21212041 UML# cat /proc/filesystems
@@ -2127,7 +2047,7 @@ · 5 unmodified lines
21272047 module and available inside the virtual machine, and insmod it.
21282048
21292049
2130− Now all you need to do is run mount:
2050+ Now all you need to do is run mount::
21312051
21322052
21332053 UML# mount none /mnt/host -t hostfs
@@ -2139,7 +2059,7 @@ · 5 unmodified lines
21392059
21402060
21412061 If you don't want to mount the host root directory, then you can
2142− specify a subdirectory to mount with the -o switch to mount:
2062+ specify a subdirectory to mount with the -o switch to mount::
21432063
21442064
21452065 UML# mount none /mnt/home -t hostfs -o /home
@@ -2151,13 +2071,14 @@ · 5 unmodified lines
21512071
21522072
21532073
2154− 9.2. hostfs as the root filesystem
2074+9.2. hostfs as the root filesystem
2075+-----------------------------------
21552076
21562077 It's possible to boot from a directory hierarchy on the host using
21572078 hostfs rather than using the standard filesystem in a file.
21582079
21592080 To start, you need that hierarchy. The easiest way is to loop mount
2160− an existing root_fs file:
2081+ an existing root_fs file::
21612082
21622083
21632084 host# mount root_fs uml_root_dir -o loop
@@ -2166,15 +2087,15 @@ · 2 unmodified lines
21662087
21672088
21682089 You need to change the filesystem type of / in etc/fstab to be
2169− 'hostfs', so that line looks like this:
2090+ 'hostfs', so that line looks like this::
21702091
2171− /dev/ubd/0 / hostfs defaults 1 1
2092+ /dev/ubd/0 / hostfs defaults 1 1
21722093
21732094
21742095
21752096
21762097 Then you need to chown to yourself all the files in that directory
2177− that are owned by root. This worked for me:
2098+ that are owned by root. This worked for me::
21782099
21792100
21802101 host# find . -uid 0 -exec chown jdike {} \;
@@ -2183,7 +2104,7 @@ · 2 unmodified lines
21832104
21842105
21852106 Next, make sure that your UML kernel has hostfs compiled in, not as a
2186− module. Then run UML with the boot device pointing at that directory:
2107+ module. Then run UML with the boot device pointing at that directory::
21872108
21882109
21892110 ubd0=/path/to/uml/root/directory
@@ -2194,41 +2115,35 @@ · 4 unmodified lines
21942115 UML should then boot as it does normally.
21952116
21962117
2197− 9.3. Building hostfs
2118+9.3. Building hostfs
2119+---------------------
21982120
21992121 If you need to build hostfs because it's not in your kernel, you have
22002122 two choices:
22012123
22022124
22032125
2204− o Compiling hostfs into the kernel:
2126+ - Compiling hostfs into the kernel:
22052127
22062128
22072129 Reconfigure the kernel and set the 'Host filesystem' option under
22082130
22092131
2210− o Compiling hostfs as a module:
2132+ - Compiling hostfs as a module:
22112133
22122134
22132135 Reconfigure the kernel and set the 'Host filesystem' option under
22142136 be in arch/um/fs/hostfs/hostfs.o. Install that in
2215− /lib/modules/`uname -r`/fs in the virtual machine, boot it up, and
2137+ ``/lib/modules/$(uname -r)/fs`` in the virtual machine, boot it up, and::
22162138
22172139
22182140 UML# insmod hostfs
22192141
22202142
2143+.. _The_Management_Console:
22212144
2222−
2223−
2224−
2225−
2226−
2227−
2228−
2229−
2230−
2231− 10. The Management Console
2145+10. The Management Console
2146+===========================
22322147
22332148
22342149
@@ -2240,15 +2155,15 @@ · 5 unmodified lines
22402155
22412156 There are a number of things you can do with the mconsole interface:
22422157
2243− o get the kernel version
2158+ - get the kernel version
22442159
2245− o add and remove devices
2160+ - add and remove devices
22462161
2247− o halt or reboot the machine
2162+ - halt or reboot the machine
22482163
2249− o Send SysRq commands
2164+ - Send SysRq commands
22502165
2251− o Pause and resume the UML
2166+ - Pause and resume the UML
22522167
22532168
22542169 You need the mconsole client (uml_mconsole) which is present in CVS
@@ -2257,7 +2172,7 @@ · 2 unmodified lines
22572172
22582173
22592174 You also need CONFIG_MCONSOLE (under 'General Setup') enabled in UML.
2260− When you boot UML, you'll see a line like:
2175+ When you boot UML, you'll see a line like::
22612176
22622177
22632178 mconsole initialized on /home/jdike/.uml/umlNJ32yL/mconsole
@@ -2265,7 +2180,7 @@ · 1 unmodified line
22652180
22662181
22672182
2268− If you specify a unique machine id one the UML command line, i.e.
2183+ If you specify a unique machine id one the UML command line, i.e.::
22692184
22702185
22712186 umid=debian
@@ -2273,7 +2188,7 @@ · 1 unmodified line
22732188
22742189
22752190
2276− you'll see this
2191+ you'll see this::
22772192
22782193
22792194 mconsole initialized on /home/jdike/.uml/debian/mconsole
@@ -2282,7 +2197,7 @@ · 2 unmodified lines
22822197
22832198
22842199 That file is the socket that uml_mconsole will use to communicate with
2285− UML. Run it with either the umid or the full path as its argument:
2200+ UML. Run it with either the umid or the full path as its argument::
22862201
22872202
22882203 host% uml_mconsole debian
@@ -2290,7 +2205,7 @@ · 1 unmodified line
22902205
22912206
22922207
2293− or
2208+ or::
22942209
22952210
22962211 host% uml_mconsole /home/jdike/.uml/debian/mconsole
@@ -2300,30 +2215,31 @@ · 3 unmodified lines
23002215
23012216 You'll get a prompt, at which you can run one of these commands:
23022217
2303− o version
2218+ - version
23042219
2305− o halt
2220+ - halt
23062221
2307− o reboot
2222+ - reboot
23082223
2309− o config
2224+ - config
23102225
2311− o remove
2226+ - remove
23122227
2313− o sysrq
2228+ - sysrq
23142229
2315− o help
2230+ - help
23162231
2317− o cad
2232+ - cad
23182233
2319− o stop
2234+ - stop
23202235
2321− o go
2236+ - go
23222237
23232238
2324− 10.1. version
2239+10.1. version
2240+--------------
23252241
2326− This takes no arguments. It prints the UML version.
2242+ This takes no arguments. It prints the UML version::
23272243
23282244
23292245 (mconsole) version
@@ -2342,11 +2258,12 @@ · 12 unmodified lines
23422258
23432259
23442260
2345− 10.2. halt and reboot
2261+10.2. halt and reboot
2262+----------------------
23462263
23472264 These take no arguments. They shut the machine down immediately, with
23482265 no syncing of disks and no clean shutdown of userspace. So, they are
2349− pretty close to crashing the machine.
2266+ pretty close to crashing the machine::
23502267
23512268
23522269 (mconsole) halt
@@ -2357,34 +2274,36 @@ · 4 unmodified lines
23572274
23582275
23592276
2360− 10.3. config
2277+10.3. config
2278+-------------
23612279
23622280 "config" adds a new device to the virtual machine. Currently the ubd
23632281 and network drivers support this. It takes one argument, which is the
2364− device to add, with the same syntax as the kernel command line.
2282+ device to add, with the same syntax as the kernel command line::
23652283
23662284
23672285
23682286
2369− (mconsole)
2370− config ubd3=/home/jdike/incoming/roots/root_fs_debian22
2287+ (mconsole)
2288+ config ubd3=/home/jdike/incoming/roots/root_fs_debian22
23712289
2372− OK
2373− (mconsole) config eth1=mcast
2374− OK
2290+ OK
2291+ (mconsole) config eth1=mcast
2292+ OK
23752293
23762294
23772295
23782296
23792297
23802298
2381− 10.4. remove
2299+10.4. remove
2300+-------------
23822301
23832302 "remove" deletes a device from the system. Its argument is just the
23842303 name of the device to be removed. The device must be idle in whatever
23852304 sense the driver considers necessary. In the case of the ubd driver,
23862305 the removed block device must not be mounted, swapped on, or otherwise
2387− open, and in the case of the network driver, the device must be down.
2306+ open, and in the case of the network driver, the device must be down::
23882307
23892308
23902309 (mconsole) remove ubd3
@@ -2397,7 +2316,8 @@ · 6 unmodified lines
23972316
23982317
23992318
2400− 10.5. sysrq
2319+10.5. sysrq
2320+------------
24012321
24022322 This takes one argument, which is a single letter. It calls the
24032323 generic kernel's SysRq driver, which does whatever is called for by
@@ -2407,19 +2327,21 @@ · 3 unmodified lines
24072327
24082328
24092329
2410− 10.6. help
2330+10.6. help
2331+-----------
24112332
24122333 "help" returns a string listing the valid commands and what each one
24132334 does.
24142335
24152336
24162337
2417− 10.7. cad
2338+10.7. cad
2339+----------
24182340
24192341 This invokes the Ctl-Alt-Del action on init. What exactly this ends
24202342 up doing is up to /etc/inittab. Normally, it reboots the machine.
24212343 With UML, this is usually not desired, so if a halt would be better,
2422− then find the section of inittab that looks like this
2344+ then find the section of inittab that looks like this::
24232345
24242346
24252347 # What to do when CTRL-ALT-DEL is pressed.
@@ -2432,7 +2354,8 @@ · 6 unmodified lines
24322354
24332355
24342356
2435− 10.8. stop
2357+10.8. stop
2358+-----------
24362359
24372360 This puts the UML in a loop reading mconsole requests until a 'go'
24382361 mconsole command is received. This is very useful for making backups
@@ -2448,7 +2371,8 @@ · 9 unmodified lines
24482371
24492372
24502373
2451− 10.9. go
2374+10.9. go
2375+---------
24522376
24532377 This resumes a UML after being paused by a 'stop' command. Note that
24542378 when the UML has resumed, TCP connections may have timed out and if
@@ -2460,9 +2384,10 @@ · 5 unmodified lines
24602384
24612385
24622386
2387+.. _Kernel_debugging:
24632388
2464−
2465− 11. Kernel debugging
2389+11. Kernel debugging
2390+=====================
24662391
24672392
24682393 Note: The interface that makes debugging, as described here, possible
@@ -2477,15 +2402,16 @@ · 8 unmodified lines
24772402
24782403
24792404 In order to debug the kernel, you need build it from source. See
2480− ``Compiling the kernel and modules'' for information on doing that.
2405+ :ref:`Compiling_the_kernel_and_modules` for information on doing that.
24812406 Make sure that you enable CONFIG_DEBUGSYM and CONFIG_PT_PROXY during
2482− the config. These will compile the kernel with -g, and enable the
2407+ the config. These will compile the kernel with ``-g``, and enable the
24832408 ptrace proxy so that gdb works with UML, respectively.
24842409
24852410
24862411
24872412
2488− 11.1. Starting the kernel under gdb
2413+11.1. Starting the kernel under gdb
2414+------------------------------------
24892415
24902416 You can have the kernel running under the control of gdb from the
24912417 beginning by putting 'debug' on the command line. You will get an
@@ -2498,7 +2424,11 @@ · 6 unmodified lines
24982424 There is a transcript of a debugging session here <debug-
24992425 session.html> , with breakpoints being set in the scheduler and in an
25002426 interrupt handler.
2501− 11.2. Examining sleeping processes
2427+
2428+
2429+11.2. Examining sleeping processes
2430+-----------------------------------
2431+
25022432
25032433 Not every bug is evident in the currently running process. Sometimes,
25042434 processes hang in the kernel when they shouldn't because they've
@@ -2516,7 +2446,7 @@ · 11 unmodified lines
25162446
25172447 Now what you do is this:
25182448
2519− o detach from the current thread
2449+ - detach from the current thread::
25202450
25212451
25222452 (UML gdb) det
@@ -2525,7 +2455,7 @@ · 2 unmodified lines
25252455
25262456
25272457
2528− o attach to the thread you are interested in
2458+ - attach to the thread you are interested in::
25292459
25302460
25312461 (UML gdb) att <host pid>
@@ -2534,7 +2464,7 @@ · 2 unmodified lines
25342464
25352465
25362466
2537− o look at its stack and anything else of interest
2467+ - look at its stack and anything else of interest::
25382468
25392469
25402470 (UML gdb) bt
@@ -2545,18 +2475,14 @@ · 4 unmodified lines
25452475 Note that you can't do anything at this point that requires that a
25462476 process execute, e.g. calling a function
25472477
2548− o when you're done looking at that process, reattach to the current
2549− thread and continue it
2478+ - when you're done looking at that process, reattach to the current
2479+ thread and continue it::
25502480
25512481
25522482 (UML gdb)
25532483 att 1
25542484
25552485
2556−
2557−
2558−
2559−
25602486 (UML gdb)
25612487 c
25622488
@@ -2569,12 +2495,13 @@ · 6 unmodified lines
25692495
25702496
25712497
2572− 11.3. Running ddd on UML
2498+11.3. Running ddd on UML
2499+-------------------------
25732500
25742501 ddd works on UML, but requires a special kludge. The process goes
25752502 like this:
25762503
2577− o Start ddd
2504+ - Start ddd::
25782505
25792506
25802507 host% ddd linux
@@ -2583,14 +2510,14 @@ · 2 unmodified lines
25832510
25842511
25852512
2586− o With ps, get the pid of the gdb that ddd started. You can ask the
2513+ - With ps, get the pid of the gdb that ddd started. You can ask the
25872514 gdb to tell you, but for some reason that confuses things and
25882515 causes a hang.
25892516
2590− o run UML with 'debug=parent gdb-pid=<pid>' added to the command line
2517+ - run UML with 'debug=parent gdb-pid=<pid>' added to the command line
25912518 - it will just sit there after you hit return
25922519
2593− o type 'att 1' to the ddd gdb and you will see something like
2520+ - type 'att 1' to the ddd gdb and you will see something like::
25942521
25952522
25962523 0xa013dc51 in __kill ()
@@ -2602,12 +2529,14 @@ · 5 unmodified lines
26022529
26032530
26042531
2605− o At this point, type 'c', UML will boot up, and you can use ddd just
2532+ - At this point, type 'c', UML will boot up, and you can use ddd just
26062533 as you do on any other process.
26072534
26082535
26092536
2610− 11.4. Debugging modules
2537+11.4. Debugging modules
2538+------------------------
2539+
26112540
26122541 gdb has support for debugging code which is dynamically loaded into
26132542 the process. This support is what is needed to debug kernel modules
@@ -2629,7 +2558,8 @@ · 15 unmodified lines
26292558
26302559
26312560 First, you must tell it where your modules are. There is a list in
2632− the script that looks like this:
2561+ the script that looks like this::
2562+
26332563 set MODULE_PATHS {
26342564 "fat" "/usr/src/uml/linux-2.4.18/fs/fat/fat.o"
26352565 "isofs" "/usr/src/uml/linux-2.4.18/fs/isofs/isofs.o"
@@ -2641,9 +2571,7 @@ · 5 unmodified lines
26412571
26422572 You change that to list the names and paths of the modules that you
26432573 are going to debug. Then you run it from the toplevel directory of
2644− your UML pool and it basically tells you what to do:
2645−
2646−
2574+ your UML pool and it basically tells you what to do::
26472575
26482576
26492577 ******** GDB pid is 21903 ********
@@ -2666,7 +2594,7 @@ · 16 unmodified lines
26662594
26672595
26682596 After you run UML and it sits there doing nothing, you hit return at
2669− the 'att 1' and continue it:
2597+ the 'att 1' and continue it::
26702598
26712599
26722600 Attaching to program: /home/jdike/linux/2.4/um/./linux, process 1
@@ -2678,63 +2606,48 @@ · 5 unmodified lines
26782606
26792607
26802608 At this point, you debug normally. When you insmod something, the
2681− expect magic will kick in and you'll see something like:
2682−
2683−
2684−
2685−
2686−
2687−
2688−
2689−
2690−
2691−
2692−
2693−
2694−
2695−
2696−
2697−
2698−
2699− *** Module hostfs loaded ***
2700− Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs",
2701− mod_user=0x8070e00) at module.c:349
2702− 349 char *name, *n_name, *name_tmp = NULL;
2703− (UML gdb) finish
2704− Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs",
2705− mod_user=0x8070e00) at module.c:349
2706− 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411
2707− 411 else res = EXECUTE_SYSCALL(syscall, regs);
2708− Value returned is $1 = 0
2709− (UML gdb)
2710− p/x (int)module_list + module_list->size_of_struct
2711−
2712− $2 = 0xa9021054
2713− (UML gdb) symbol-file ./linux
2714− Load new symbol table from "./linux"? (y or n) y
2715− Reading symbols from ./linux...
2716− done.
2717− (UML gdb)
2718− add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054
2719−
2720− add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at
2721− .text_addr = 0xa9021054
2722− (y or n) y
2723−
2724− Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o...
2725− done.
2726− (UML gdb) p *module_list
2727− $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs",
2728− size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1,
2729− nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0,
2730− init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>,
2731− ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0,
2732− persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0,
2733− kallsyms_end = 0x0,
2734− archdata_start = 0x1b855 <Address 0x1b855 out of bounds>,
2735− archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>,
2736− kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>}
2737− >> Finished loading symbols for hostfs ...
2609+ expect magic will kick in and you'll see something like::
2610+
2611+
2612+ *** Module hostfs loaded ***
2613+ Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs",
2614+ mod_user=0x8070e00) at module.c:349
2615+ 349 char *name, *n_name, *name_tmp = NULL;
2616+ (UML gdb) finish
2617+ Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs",
2618+ mod_user=0x8070e00) at module.c:349
2619+ 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411
2620+ 411 else res = EXECUTE_SYSCALL(syscall, regs);
2621+ Value returned is $1 = 0
2622+ (UML gdb)
2623+ p/x (int)module_list + module_list->size_of_struct
2624+
2625+ $2 = 0xa9021054
2626+ (UML gdb) symbol-file ./linux
2627+ Load new symbol table from "./linux"? (y or n) y
2628+ Reading symbols from ./linux...
2629+ done.
2630+ (UML gdb)
2631+ add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054
2632+
2633+ add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at
2634+ .text_addr = 0xa9021054
2635+ (y or n) y
2636+
2637+ Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o...
2638+ done.
2639+ (UML gdb) p *module_list
2640+ $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs",
2641+ size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1,
2642+ nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0,
2643+ init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>,
2644+ ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0,
2645+ persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0,
2646+ kallsyms_end = 0x0,
2647+ archdata_start = 0x1b855 <Address 0x1b855 out of bounds>,
2648+ archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>,
2649+ kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>}
2650+ >> Finished loading symbols for hostfs ...
27382651
27392652
27402653
@@ -2744,7 +2657,7 @@ · 3 unmodified lines
27442657
27452658
27462659 Boot the kernel under the debugger and load the module with insmod or
2747− modprobe. With gdb, do:
2660+ modprobe. With gdb, do::
27482661
27492662
27502663 (UML gdb) p module_list
@@ -2758,12 +2671,12 @@ · 7 unmodified lines
27582671 the name fields until find the module you want to debug. Take the
27592672 address of that structure, and add module.size_of_struct (which in
27602673 2.4.10 kernels is 96 (0x60)) to it. Gdb can make this hard addition
2761− for you :-):
2674+ for you :-)::
27622675
27632676
27642677
2765− (UML gdb)
2766− printf "%#x\n", (int)module_list module_list->size_of_struct
2678+ (UML gdb)
2679+ printf "%#x\n", (int)module_list module_list->size_of_struct
27672680
27682681
27692682
@@ -2771,7 +2684,7 @@ · 1 unmodified line
27712684 The offset from the module start occasionally changes (before 2.4.0,
27722685 it was module.size_of_struct + 4), so it's a good idea to check the
27732686 init and cleanup addresses once in a while, as describe below. Now
2774− do:
2687+ do::
27752688
27762689
27772690 (UML gdb)
@@ -2786,7 +2699,7 @@ · 8 unmodified lines
27862699 If there's any doubt that you got the offset right, like breakpoints
27872700 appear not to work, or they're appearing in the wrong place, you can
27882701 check it by looking at the module structure. The init and cleanup
2789− fields should look like:
2702+ fields should look like::
27902703
27912704
27922705 init = 0x588066b0 <init_hostfs>, cleanup = 0x588066c0 <exit_hostfs>
@@ -2801,7 +2714,7 @@ · 8 unmodified lines
28012714
28022715 When you want to load in a new version of the module, you need to get
28032716 gdb to forget about the old one. The only way I've found to do that
2804− is to tell gdb to forget about all symbols that it knows about:
2717+ is to tell gdb to forget about all symbols that it knows about::
28052718
28062719
28072720 (UML gdb) symbol-file
@@ -2809,7 +2722,7 @@ · 1 unmodified line
28092722
28102723
28112724
2812− Then reload the symbols from the kernel binary:
2725+ Then reload the symbols from the kernel binary::
28132726
28142727
28152728 (UML gdb) symbol-file /path/to/kernel
@@ -2823,17 +2736,19 @@ · 7 unmodified lines
28232736
28242737
28252738
2826− 11.5. Attaching gdb to the kernel
2739+11.5. Attaching gdb to the kernel
2740+----------------------------------
28272741
28282742 If you don't have the kernel running under gdb, you can attach gdb to
28292743 it later by sending the tracing thread a SIGUSR1. The first line of
2830− the console output identifies its pid:
2744+ the console output identifies its pid::
2745+
28312746 tracing thread pid = 20093
28322747
28332748
28342749
28352750
2836− When you send it the signal:
2751+ When you send it the signal::
28372752
28382753
28392754 host% kill -USR1 20093
@@ -2845,7 +2760,7 @@ · 5 unmodified lines
28452760
28462761
28472762 If you have the mconsole compiled into UML, then the mconsole client
2848− can be used to start gdb:
2763+ can be used to start gdb::
28492764
28502765
28512766 (mconsole) (mconsole) config gdb=xterm
@@ -2857,7 +2772,8 @@ · 5 unmodified lines
28572772
28582773
28592774
2860− 11.6. Using alternate debuggers
2775+11.6. Using alternate debuggers
2776+--------------------------------
28612777
28622778 UML has support for attaching to an already running debugger rather
28632779 than starting gdb itself. This is present in CVS as of 17 Apr 2001.
@@ -2886,7 +2802,7 @@ · 22 unmodified lines
28862802 An example of an alternate debugger is strace. You can strace the
28872803 actual kernel as follows:
28882804
2889− o Run the following in a shell
2805+ - Run the following in a shell::
28902806
28912807
28922808 host%
@@ -2894,13 +2810,13 @@ · 1 unmodified line
28942810
28952811
28962812
2897− o Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out
2813+ - Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out
28982814 by the previous command
28992815
2900− o Hit return in the shell, and UML will start running, and strace
2816+ - Hit return in the shell, and UML will start running, and strace
29012817 output will start accumulating in the output file.
29022818
2903− Note that this is different from running
2819+ Note that this is different from running::
29042820
29052821
29062822 host% strace ./linux
@@ -2917,95 +2833,57 @@ · 10 unmodified lines
29172833
29182834
29192835
2920− 12. Kernel debugging examples
2836+12. Kernel debugging examples
2837+==============================
29212838
2922− 12.1. The case of the hung fsck
2839+12.1. The case of the hung fsck
2840+--------------------------------
29232841
29242842 When booting up the kernel, fsck failed, and dropped me into a shell
2925− to fix things up. I ran fsck -y, which hung:
2926−
2927−
2928−
2929−
2930−
2931−
2932−
2933−
2934−
2935−
2936−
2937−
2938−
2939−
2940−
2941−
2942−
2943−
2944−
2945−
2946−
2947−
2948−
2949−
2950−
2843+ to fix things up. I ran fsck -y, which hung::
29512844
29522845
2846+ Setting hostname uml [ OK ]
2847+ Checking root filesystem
2848+ /dev/fhd0 was not cleanly unmounted, check forced.
2849+ Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780.
29532850
2851+ /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
2852+ (i.e., without -a or -p options)
2853+ [ FAILED ]
29542854
2855+ *** An error occurred during the file system check.
2856+ *** Dropping you to a shell; the system will reboot
2857+ *** when you leave the shell.
2858+ Give root password for maintenance
2859+ (or type Control-D for normal startup):
29552860
2861+ [root@uml /root]# fsck -y /dev/fhd0
2862+ fsck -y /dev/fhd0
2863+ Parallelizing fsck version 1.14 (9-Jan-1999)
2864+ e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
2865+ /dev/fhd0 contains a file system with errors, check forced.
2866+ Pass 1: Checking inodes, blocks, and sizes
2867+ Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes
29562868
2869+ Inode 19780, i_blocks is 1548, should be 540. Fix? yes
29572870
2871+ Pass 2: Checking directory structure
2872+ Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes
29582873
2874+ Directory inode 11858, block 0, offset 0: directory corrupted
2875+ Salvage? yes
29592876
2877+ Missing '.' in directory inode 11858.
2878+ Fix? yes
29602879
2961−
2962−
2963− Setting hostname uml [ OK ]
2964− Checking root filesystem
2965− /dev/fhd0 was not cleanly unmounted, check forced.
2966− Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780.
2967−
2968− /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
2969− (i.e., without -a or -p options)
2970− [ FAILED ]
2971−
2972− *** An error occurred during the file system check.
2973− *** Dropping you to a shell; the system will reboot
2974− *** when you leave the shell.
2975− Give root password for maintenance
2976− (or type Control-D for normal startup):
2977−
2978− [root@uml /root]# fsck -y /dev/fhd0
2979− fsck -y /dev/fhd0
2980− Parallelizing fsck version 1.14 (9-Jan-1999)
2981− e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
2982− /dev/fhd0 contains a file system with errors, check forced.
2983− Pass 1: Checking inodes, blocks, and sizes
2984− Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes
2985−
2986− Inode 19780, i_blocks is 1548, should be 540. Fix? yes
2987−
2988− Pass 2: Checking directory structure
2989− Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes
2990−
2991− Directory inode 11858, block 0, offset 0: directory corrupted
2992− Salvage? yes
2993−
2994− Missing '.' in directory inode 11858.
2995− Fix? yes
2996−
2997− Missing '..' in directory inode 11858.
2998− Fix? yes
2999−
3000−
3001−
2880+ Missing '..' in directory inode 11858.
2881+ Fix? yes
30022882
30032883
30042884 The standard drill in this sort of situation is to fire up gdb on the
30052885 signal thread, which, in this case, was pid 1935. In another window,
3006− I run gdb and attach pid 1935.
3007−
3008−
2886+ I run gdb and attach pid 1935::
30092887
30102888
30112889 ~/linux/2.3.26/um 1016: gdb linux
@@ -3022,11 +2900,7 @@ · 10 unmodified lines
30222900 0x100756d9 in __wait4 ()
30232901
30242902
3025−
3026−
3027−
3028−
3029− Let's see what's currently running:
2903+ Let's see what's currently running::
30302904
30312905
30322906
@@ -3041,7 +2915,7 @@ · 8 unmodified lines
30412915 reason and never woke up.
30422916
30432917
3044− Let's guess that the last process in the process list is fsck:
2918+ Let's guess that the last process in the process list is fsck::
30452919
30462920
30472921
@@ -3052,7 +2926,7 @@ · 4 unmodified lines
30522926
30532927
30542928
3055− It is, so let's see what it thinks it's up to:
2929+ It is, so let's see what it thinks it's up to::
30562930
30572931
30582932
@@ -3068,8 +2942,6 @@ · 9 unmodified lines
30682942
30692943
30702944
3071−
3072−
30732945 The interesting things here are the fact that its .thread.syscall.id
30742946 is __NR_write (see the big switch in arch/um/kernel/syscall_kern.c or
30752947 the defines in include/asm-um/arch/unistd.h), and that it never
@@ -3081,30 +2953,20 @@ · 5 unmodified lines
30812953 The fact that it never returned from write means that its stack should
30822954 be fairly interesting. Its pid is 1980 (.thread.extern_pid). That
30832955 process is being ptraced by the signal thread, so it must be detached
3084− before gdb can attach it:
3085−
3086−
3087−
3088−
3089−
3090−
2956+ before gdb can attach it::
30912957
30922958
30932959
2960+ (gdb) call detach(1980)
30942961
3095− (gdb) call detach(1980)
3096−
3097− Program received signal SIGSEGV, Segmentation fault.
3098− <function called from gdb>
3099− The program being debugged stopped while in a function called from GDB.
3100− When the function (detach) is done executing, GDB will silently
3101− stop (instead of continuing to evaluate the expression containing
3102− the function call).
3103− (gdb) call detach(1980)
3104− $15 = 0
3105−
3106−
3107−
2962+ Program received signal SIGSEGV, Segmentation fault.
2963+ <function called from gdb>
2964+ The program being debugged stopped while in a function called from GDB.
2965+ When the function (detach) is done executing, GDB will silently
2966+ stop (instead of continuing to evaluate the expression containing
2967+ the function call).
2968+ (gdb) call detach(1980)
2969+ $15 = 0
31082970
31092971
31102972 The first detach segfaults for some reason, and the second one
@@ -3112,7 +2974,7 @@ · 1 unmodified line
31122974
31132975
31142976 Now I detach from the signal thread, attach to the fsck thread, and
3115− look at its stack:
2977+ look at its stack::
31162978
31172979
31182980 (gdb) det
@@ -3152,14 +3014,14 @@ · 33 unmodified lines
31523014
31533015
31543016
3155− The interesting things here are :
3017+ The interesting things here are:
31563018
3157− o There are two segfaults on this stack (frames 9 and 14)
3019+ - There are two segfaults on this stack (frames 9 and 14)
31583020
3159− o The first faulting address (frame 11) is 0x50000800
3021+ - The first faulting address (frame 11) is 0x50000800::
31603022
3161− (gdb) p (void *)1342179328
3162− $16 = (void *) 0x50000800
3023+ (gdb) p (void *)1342179328
3024+ $16 = (void *) 0x50000800
31633025
31643026
31653027
@@ -3175,7 +3037,7 @@ · 9 unmodified lines
31753037
31763038 However, the more immediate problem is that second segfault and I'm
31773039 going to concentrate on that. First, I want to see where the fault
3178− happened, so I have to go look at the sigcontent struct in frame 8:
3040+ happened, so I have to go look at the sigcontent struct in frame 8::
31793041
31803042
31813043
@@ -3211,7 +3073,7 @@ · 29 unmodified lines
32113073
32123074
32133075
3214− That's not very useful, so I'll try a more manual method:
3076+ That's not very useful, so I'll try a more manual method::
32153077
32163078
32173079 (gdb) p *((struct sigcontext *) (&sig + 1))
@@ -3224,7 +3086,7 @@ · 6 unmodified lines
32243086
32253087
32263088
3227− The ip is in handle_mm_fault:
3089+ The ip is in handle_mm_fault::
32283090
32293091
32303092 (gdb) p (void *)268480945
@@ -3236,7 +3098,7 @@ · 5 unmodified lines
32363098
32373099
32383100
3239− Specifically, it's in pte_alloc:
3101+ Specifically, it's in pte_alloc::
32403102
32413103
32423104 (gdb) i line *$20
@@ -3249,7 +3111,7 @@ · 6 unmodified lines
32493111
32503112
32513113 To find where in handle_mm_fault this is, I'll jump forward in the
3252− code until I see an address in that procedure:
3114+ code until I see an address in that procedure::
32533115
32543116
32553117
@@ -3286,21 +3148,21 @@ · 30 unmodified lines
32863148
32873149
32883150 Something is apparently wrong with the page tables or vma_structs, so
3289− lets go back to frame 11 and have a look at them:
3151+ lets go back to frame 11 and have a look at them::
32903152
32913153
32923154
3293− #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:50
3294− 50 handle_mm_fault(current, vma, address, is_write);
3295− (gdb) call pgd_offset_proc(vma->vm_mm, address)
3296− $22 = (pgd_t *) 0x80a548c
3155+ #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:50
3156+ 50 handle_mm_fault(current, vma, address, is_write);
3157+ (gdb) call pgd_offset_proc(vma->vm_mm, address)
3158+ $22 = (pgd_t *) 0x80a548c
32973159
32983160
32993161
33003162
33013163
33023164 That's pretty bogus. Page tables aren't supposed to be in process
3303− text or data areas. Let's see what's in the vma:
3165+ text or data areas. Let's see what's in the vma::
33043166
33053167
33063168 (gdb) p *vma
@@ -3325,12 +3187,9 @@ · 18 unmodified lines
33253187
33263188
33273189
3328−
3329−
33303190 This also pretty bogus. With all of the 0x80xxxxx and 0xaffffxxx
33313191 addresses, this is looking like a stack was plonked down on top of
3332− these structures. Maybe it's a stack overflow from the next page:
3333−
3192+ these structures. Maybe it's a stack overflow from the next page::
33343193
33353194
33363195 (gdb) p vma
@@ -3338,52 +3197,36 @@ · 1 unmodified line
33383197
33393198
33403199
3341−
3342−
33433200 That's towards the lower quarter of the page, so that would have to
3344− have been pretty heavy stack overflow:
3345−
3346−
3347−
3348−
3349−
3350−
3351−
3352−
3353−
3354−
3355−
3356−
3357−
3358−
3359− (gdb) x/100x $25
3360− 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c
3361− 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000
3362− 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a
3363− 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000
3364− 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000
3365− 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000
3366− 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000
3367− 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000
3368− 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000
3369− 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000
3370− 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000
3371− 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000
3372− 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000
3373− 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000
3374− 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000
3375− 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000
3376− 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000
3377− 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000
3378− 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000
3379− 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000
3380− 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000
3381− 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000
3382− 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000
3383− 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000
3384− 0x507d25b4: 0x00000000 0x00000000 0x00000000 0x00000000
3385−
3386−
3201+ have been pretty heavy stack overflow::
3202+
3203+
3204+ (gdb) x/100x $25
3205+ 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c
3206+ 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000
3207+ 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a
3208+ 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000
3209+ 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000
3210+ 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000
3211+ 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000
3212+ 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000
3213+ 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000
3214+ 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000
3215+ 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000
3216+ 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000
3217+ 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000
3218+ 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000
3219+ 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000
3220+ 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000
3221+ 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000
3222+ 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000
3223+ 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000
3224+ 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000
3225+ 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000
3226+ 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000
3227+ 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000
3228+ 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000
3229+ 0x507d25b4: 0x00000000 0x00000000 0x00000000 0x00000000
33873230
33883231
33893232
@@ -3399,65 +3242,53 @@ · 9 unmodified lines
33993242 on will be somewhat clearer.
34003243
34013244
3402− 12.2. Episode 2: The case of the hung fsck
3245+12.2. Episode 2: The case of the hung fsck
3246+-------------------------------------------
34033247
34043248 After setting a trap in the SEGV handler for accesses to the signal
34053249 thread's stack, I reran the kernel.
34063250
34073251
3408− fsck hung again, this time by hitting the trap:
3409−
3410−
3252+ fsck hung again, this time by hitting the trap::
34113253
34123254
34133255
3256+ Setting hostname uml [ OK ]
3257+ Checking root filesystem
3258+ /dev/fhd0 contains a file system with errors, check forced.
3259+ Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780.
34143260
3261+ /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
3262+ (i.e., without -a or -p options)
3263+ [ FAILED ]
34153264
3265+ *** An error occurred during the file system check.
3266+ *** Dropping you to a shell; the system will reboot
3267+ *** when you leave the shell.
3268+ Give root password for maintenance
3269+ (or type Control-D for normal startup):
34163270
3271+ [root@uml /root]# fsck -y /dev/fhd0
3272+ fsck -y /dev/fhd0
3273+ Parallelizing fsck version 1.14 (9-Jan-1999)
3274+ e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
3275+ /dev/fhd0 contains a file system with errors, check forced.
3276+ Pass 1: Checking inodes, blocks, and sizes
3277+ Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes
34173278
3279+ Pass 2: Checking directory structure
3280+ Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes
34183281
3282+ Directory inode 11858, block 0, offset 0: directory corrupted
3283+ Salvage? yes
34193284
3285+ Missing '.' in directory inode 11858.
3286+ Fix? yes
34203287
3288+ Missing '..' in directory inode 11858.
3289+ Fix? yes
34213290
3422−
3423−
3424−
3425− Setting hostname uml [ OK ]
3426− Checking root filesystem
3427− /dev/fhd0 contains a file system with errors, check forced.
3428− Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780.
3429−
3430− /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
3431− (i.e., without -a or -p options)
3432− [ FAILED ]
3433−
3434− *** An error occurred during the file system check.
3435− *** Dropping you to a shell; the system will reboot
3436− *** when you leave the shell.
3437− Give root password for maintenance
3438− (or type Control-D for normal startup):
3439−
3440− [root@uml /root]# fsck -y /dev/fhd0
3441− fsck -y /dev/fhd0
3442− Parallelizing fsck version 1.14 (9-Jan-1999)
3443− e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
3444− /dev/fhd0 contains a file system with errors, check forced.
3445− Pass 1: Checking inodes, blocks, and sizes
3446− Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes
3447−
3448− Pass 2: Checking directory structure
3449− Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes
3450−
3451− Directory inode 11858, block 0, offset 0: directory corrupted
3452− Salvage? yes
3453−
3454− Missing '.' in directory inode 11858.
3455− Fix? yes
3456−
3457− Missing '..' in directory inode 11858.
3458− Fix? yes
3459−
3460− Untested (4127) [100fe44c]: trap_kern.c line 31
3291+ Untested (4127) [100fe44c]: trap_kern.c line 31
34613292
34623293
34633294
@@ -3465,7 +3296,7 @@ · 1 unmodified line
34653296
34663297 I need to get the signal thread to detach from pid 4127 so that I can
34673298 attach to it with gdb. This is done by sending it a SIGUSR1, which is
3468− caught by the signal thread, which detaches the process:
3299+ caught by the signal thread, which detaches the process::
34693300
34703301
34713302 kill -USR1 4127
@@ -3474,31 +3305,20 @@ · 2 unmodified lines
34743305
34753306
34763307
3477− Now I can run gdb on it:
3478−
3479−
3480−
3481−
3482−
3483−
3484−
3308+ Now I can run gdb on it::
34853309
34863310
3487−
3488−
3489−
3490−
3491− ~/linux/2.3.26/um 1034: gdb linux
3492− GNU gdb 4.17.0.11 with Linux support
3493− Copyright 1998 Free Software Foundation, Inc.
3494− GDB is free software, covered by the GNU General Public License, and you are
3495− welcome to change it and/or distribute copies of it under certain conditions.
3496− Type "show copying" to see the conditions.
3497− There is absolutely no warranty for GDB. Type "show warranty" for details.
3498− This GDB was configured as "i386-redhat-linux"...
3499− (gdb) att 4127
3500− Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127
3501− 0x10075891 in __libc_nanosleep ()
3311+ ~/linux/2.3.26/um 1034: gdb linux
3312+ GNU gdb 4.17.0.11 with Linux support
3313+ Copyright 1998 Free Software Foundation, Inc.
3314+ GDB is free software, covered by the GNU General Public License, and you are
3315+ welcome to change it and/or distribute copies of it under certain conditions.
3316+ Type "show copying" to see the conditions.
3317+ There is absolutely no warranty for GDB. Type "show warranty" for details.
3318+ This GDB was configured as "i386-redhat-linux"...
3319+ (gdb) att 4127
3320+ Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127
3321+ 0x10075891 in __libc_nanosleep ()
35023322
35033323
35043324
@@ -3506,7 +3326,7 @@ · 1 unmodified line
35063326
35073327 The backtrace shows that it was in a write and that the fault address
35083328 (address in frame 3) is 0x50000800, which is right in the middle of
3509− the signal thread's stack page:
3329+ the signal thread's stack page::
35103330
35113331
35123332 (gdb) bt
@@ -3540,58 +3360,48 @@ · 27 unmodified lines
35403360
35413361
35423362
3543−
3544−
35453363 Going up the stack to the segv_handler frame and looking at where in
35463364 the code the access happened shows that it happened near line 110 of
3547− block_dev.c:
3548−
3549−
3550−
3551−
3552−
3553−
3554−
3555−
3556−
3557− (gdb) up
3558− #1 0x1007584d in __sleep (seconds=1000000)
3559− at ../sysdeps/unix/sysv/linux/sleep.c:78
3560− ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory.
3561− (gdb)
3562− #2 0x1006ce9a in stop () at user_util.c:191
3563− 191 while(1) sleep(1000000);
3564− (gdb)
3565− #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31
3566− 31 KERN_UNTESTED();
3567− (gdb)
3568− #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174
3569− 174 segv(sc->cr2, sc->err & 2);
3570− (gdb) p *sc
3571− $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43,
3572− __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484,
3573− esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14,
3574− err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070,
3575− esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0,
3576− cr2 = 1342179328}
3577− (gdb) p (void *)268550834
3578− $2 = (void *) 0x1001c2b2
3579− (gdb) i sym $2
3580− block_write + 1090 in section .text
3581− (gdb) i line *$2
3582− Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h"
3583− starts at address 0x1001c2a1 <block_write+1073>
3584− and ends at 0x1001c2bf <block_write+1103>.
3585− (gdb) i line *0x1001c2c0
3586− Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103>
3587− and ends at 0x1001c2e3 <block_write+1139>.
3588−
3589−
3365+ block_dev.c::
3366+
3367+
3368+
3369+ (gdb) up
3370+ #1 0x1007584d in __sleep (seconds=1000000)
3371+ at ../sysdeps/unix/sysv/linux/sleep.c:78
3372+ ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory.
3373+ (gdb)
3374+ #2 0x1006ce9a in stop () at user_util.c:191
3375+ 191 while(1) sleep(1000000);
3376+ (gdb)
3377+ #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31
3378+ 31 KERN_UNTESTED();
3379+ (gdb)
3380+ #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174
3381+ 174 segv(sc->cr2, sc->err & 2);
3382+ (gdb) p *sc
3383+ $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43,
3384+ __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484,
3385+ esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14,
3386+ err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070,
3387+ esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0,
3388+ cr2 = 1342179328}
3389+ (gdb) p (void *)268550834
3390+ $2 = (void *) 0x1001c2b2
3391+ (gdb) i sym $2
3392+ block_write + 1090 in section .text
3393+ (gdb) i line *$2
3394+ Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h"
3395+ starts at address 0x1001c2a1 <block_write+1073>
3396+ and ends at 0x1001c2bf <block_write+1103>.
3397+ (gdb) i line *0x1001c2c0
3398+ Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103>
3399+ and ends at 0x1001c2e3 <block_write+1139>.
35903400
35913401
35923402
35933403 Looking at the source shows that the fault happened during a call to
3594− copy_from_user to copy the data into the kernel:
3404+ copy_from_user to copy the data into the kernel::
35953405
35963406
35973407 107 count -= chars;
@@ -3601,10 +3411,8 @@ · 3 unmodified lines
36013411
36023412
36033413
3604−
3605−
36063414 p is the pointer which must contain 0x50000800, since buf contains
3607− 0x80b8800 (frame 8 above). It is defined as:
3415+ 0x80b8800 (frame 8 above). It is defined as::
36083416
36093417
36103418 p = offset + bh->b_data;
@@ -3615,24 +3423,22 @@ · 4 unmodified lines
36153423
36163424 I need to figure out what bh is, and it just so happens that bh is
36173425 passed as an argument to mark_buffer_uptodate and mark_buffer_dirty a
3618− few lines later, so I do a little disassembly:
3619−
3620−
3426+ few lines later, so I do a little disassembly::
36213427
36223428
3623− (gdb) disas 0x1001c2bf 0x1001c2e0
3624− Dump of assembler code from 0x1001c2bf to 0x1001c2d0:
3625− 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp)
3626− 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx
3627− 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx)
3628− 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx)
3629− 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx
3630− 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx
3631− 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139>
3632− 0x1001c2d8 <block_write+1128>: pushl $0x0
3633− 0x1001c2da <block_write+1130>: pushl %edx
3634− 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty>
3635− End of assembler dump.
3429+ (gdb) disas 0x1001c2bf 0x1001c2e0
3430+ Dump of assembler code from 0x1001c2bf to 0x1001c2d0:
3431+ 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp)
3432+ 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx
3433+ 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx)
3434+ 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx)
3435+ 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx
3436+ 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx
3437+ 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139>
3438+ 0x1001c2d8 <block_write+1128>: pushl $0x0
3439+ 0x1001c2da <block_write+1130>: pushl %edx
3440+ 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty>
3441+ End of assembler dump.
36363442
36373443
36383444
@@ -3640,7 +3446,7 @@ · 1 unmodified line
36403446
36413447 At that point, bh is in %edx (address 0x1001c2da), which is calculated
36423448 at 0x1001c2c2 as %ebp + 0xfffffdd4, so I figure exactly what that is,
3643− taking %ebp from the sigcontext_struct above:
3449+ taking %ebp from the sigcontext_struct above::
36443450
36453451
36463452 (gdb) p (void *)1342631484
@@ -3657,7 +3463,7 @@ · 10 unmodified lines
36573463
36583464
36593465 Now, I look at the structure to see what's in it, and particularly,
3660− what its b_data field contains:
3466+ what its b_data field contains::
36613467
36623468
36633469 (gdb) p *((struct buffer_head *)0x50100200)
@@ -3682,18 +3488,18 @@ · 18 unmodified lines
36823488
36833489 The b_page field is a pointer to the page_struct representing the
36843490 0x50000000 page. Looking at it shows the kernel's idea of the state
3685− of that page:
3491+ of that page::
36863492
36873493
36883494
3689− (gdb) p *$13.b_page
3690− $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0,
3691− index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = {
3692− next = 0x50008460, prev = 0x50019350}, wait = {
3693− lock = <optimized out or zero length>, task_list = {next = 0x50004024,
3694− prev = 0x50004024}, __magic = 1342193708, __creator = 0},
3695− pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280,
3696− zone = 0x100c5160}
3495+ (gdb) p *$13.b_page
3496+ $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0,
3497+ index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = {
3498+ next = 0x50008460, prev = 0x50019350}, wait = {
3499+ lock = <optimized out or zero length>, task_list = {next = 0x50004024,
3500+ prev = 0x50004024}, __magic = 1342193708, __creator = 0},
3501+ pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280,
3502+ zone = 0x100c5160}
36973503
36983504
36993505
@@ -3702,7 +3508,7 @@ · 2 unmodified lines
37023508 Some sanity-checking: the virtual field shows the "virtual" address of
37033509 this page, which in this kernel is the same as its "physical" address,
37043510 and the page_struct itself should be mem_map[0], since it represents
3705− the first page of memory:
3511+ the first page of memory::
37063512
37073513
37083514
@@ -3719,7 +3525,7 @@ · 10 unmodified lines
37193525
37203526
37213527 Now to check out the page_struct itself. In particular, the flags
3722− field shows whether the page is considered free or not:
3528+ field shows whether the page is considered free or not::
37233529
37243530
37253531 (gdb) p (void *)132
@@ -3739,7 +3545,7 @@ · 13 unmodified lines
37393545
37403546
37413547 In my setup_arch procedure, I have the following code which looks just
3742− fine:
3548+ fine::
37433549
37443550
37453551
@@ -3762,7 +3568,7 @@ · 16 unmodified lines
37623568
37633569
37643570 Stepping into init_bootmem, and looking at bootmem_map before looking
3765− at what it contains shows the following:
3571+ at what it contains shows the following::
37663572
37673573
37683574
@@ -3788,18 +3594,20 @@ · 19 unmodified lines
37883594
37893595
37903596
3791− 13. What to do when UML doesn't work
3597+13. What to do when UML doesn't work
3598+=====================================
37923599
37933600
37943601
37953602
3796− 13.1. Strange compilation errors when you build from source
3603+13.1. Strange compilation errors when you build from source
3604+------------------------------------------------------------
37973605
37983606 As of test11, it is necessary to have "ARCH=um" in the environment or
37993607 on the make command line for all steps in building UML, including
38003608 clean, distclean, or mrproper, config, menuconfig, or xconfig, dep,
38013609 and linux. If you forget for any of them, the i386 build seems to
3802− contaminate the UML build. If this happens, start from scratch with
3610+ contaminate the UML build. If this happens, start from scratch with::
38033611
38043612
38053613 host%
@@ -3811,7 +3619,7 @@ · 5 unmodified lines
38113619 and repeat the build process with ARCH=um on all the steps.
38123620
38133621
3814− See ``Compiling the kernel and modules'' for more details.
3622+ See :ref:`Compiling_the_kernel_and_modules` for more details.
38153623
38163624
38173625 Another cause of strange compilation errors is building UML in
@@ -3824,11 +3632,11 @@ · 6 unmodified lines
38243632
38253633
38263634
3827− 13.3. A variety of panics and hangs with /tmp on a reiserfs filesys-
3828− tem
3635+13.3. A variety of panics and hangs with /tmp on a reiserfs filesystem
3636+-----------------------------------------------------------------------
38293637
38303638 I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27.
3831− Panics preceded by
3639+ Panics preceded by::
38323640
38333641
38343642 Detaching pid nnnn
@@ -3854,17 +3662,19 @@ · 19 unmodified lines
38543662
38553663
38563664
3857− 13.5. UML doesn't work when /tmp is an NFS filesystem
3665+13.5. UML doesn't work when /tmp is an NFS filesystem
3666+------------------------------------------------------
38583667
38593668 This seems to be a similar situation with the ReiserFS problem above.
38603669 Some versions of NFS seems not to handle mmap correctly, which UML
38613670 depends on. The workaround is have /tmp be a non-NFS directory.
38623671
38633672
3864− 13.6. UML hangs on boot when compiled with gprof support
3673+13.6. UML hangs on boot when compiled with gprof support
3674+---------------------------------------------------------
38653675
38663676 If you build UML with gprof support and, early in the boot, it does
3867− this
3677+ this::
38683678
38693679
38703680 kernel BUG at page_alloc.c:100!
@@ -3878,10 +3688,11 @@ · 7 unmodified lines
38783688
38793689
38803690
3881− 13.7. syslogd dies with a SIGTERM on startup
3691+13.7. syslogd dies with a SIGTERM on startup
3692+---------------------------------------------
38823693
38833694 The exact boot error depends on the distribution that you're booting,
3884− but Debian produces this:
3695+ but Debian produces this::
38853696
38863697
38873698 /etc/rc2.d/S10sysklogd: line 49: 93 Terminated
@@ -3891,23 +3702,21 @@ · 3 unmodified lines
38913702
38923703
38933704 This is a syslogd bug. There's a race between a parent process
3894− installing a signal handler and its child sending the signal. See
3895− this uml-devel post <http://www.geocrawler.com/lists/3/Source-
3896− Forge/709/0/6612801> for the details.
3705+ installing a signal handler and its child sending the signal.
38973706
38983707
38993708
3900− 13.8. TUN/TAP networking doesn't work on a 2.4 host
3709+13.8. TUN/TAP networking doesn't work on a 2.4 host
3710+----------------------------------------------------
39013711
3902− There are a couple of problems which were
3903− <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed
3904− out"> by Tim Robinson <timro at trkr dot net>
3712+ There are a couple of problems which were reported by
3713+ Tim Robinson <timro at trkr dot net>
39053714
3906− o It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier.
3715+ - It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier.
39073716 The fix is to upgrade to something more recent and then read the
39083717 next item.
39093718
3910− o If you see
3719+ - If you see::
39113720
39123721
39133722 File descriptor in bad state
@@ -3921,8 +3730,8 @@ · 7 unmodified lines
39213730
39223731
39233732
3924− 13.9. You can network to the host but not to other machines on the
3925− net
3733+13.9. You can network to the host but not to other machines on the net
3734+=======================================================================
39263735
39273736 If you can connect to the host, and the host can connect to UML, but
39283737 you cannot connect to any other machines, then you may need to enable
@@ -3930,7 +3739,7 @@ · 1 unmodified line
39303739 using private IP addresses (192.168.x.x or 10.x.x.x) for host/UML
39313740 networking, rather than the public address space that your host is
39323741 connected to. UML does not enable IP Masquerading, so you will need
3933− to create a static rule to enable it:
3742+ to create a static rule to enable it::
39343743
39353744
39363745 host%
@@ -3944,11 +3753,11 @@ · 7 unmodified lines
39443753
39453754
39463755 Documentation on IP Masquerading, and SNAT, can be found at
3947− www.netfilter.org <http://www.netfilter.org> .
3756+ http://www.netfilter.org.
39483757
39493758
39503759 If you can reach the local net, but not the outside Internet, then
3951− that is usually a routing problem. The UML needs a default route:
3760+ that is usually a routing problem. The UML needs a default route::
39523761
39533762
39543763 UML#
@@ -3972,7 +3781,8 @@ · 17 unmodified lines
39723781
39733782
39743783
3975− 13.10. I have no root and I want to scream
3784+13.10. I have no root and I want to scream
3785+===========================================
39763786
39773787 Thanks to Birgit Wahlich for telling me about this strange one. It
39783788 turns out that there's a limit of six environment variables on the
@@ -3987,14 +3797,16 @@ · 8 unmodified lines
39873797
39883798
39893799
3990− 13.11. UML build conflict between ptrace.h and ucontext.h
3800+13.11. UML build conflict between ptrace.h and ucontext.h
3801+==========================================================
39913802
39923803 On some older systems, /usr/include/asm/ptrace.h and
39933804 /usr/include/sys/ucontext.h define the same names. So, when they're
39943805 included together, the defines from one completely mess up the parsing
3995− of the other, producing errors like:
3806+ of the other, producing errors like::
3807+
39963808 /usr/include/sys/ucontext.h:47: parse error before
3997− `10'
3809+ `10`
39983810
39993811
40003812
@@ -4007,7 +3819,8 @@ · 6 unmodified lines
40073819
40083820
40093821
4010− 13.12. The UML BogoMips is exactly half the host's BogoMips
3822+13.12. The UML BogoMips is exactly half the host's BogoMips
3823+------------------------------------------------------------
40113824
40123825 On i386 kernels, there are two ways of running the loop that is used
40133826 to calculate the BogoMips rating, using the TSC if it's there or using
@@ -4019,15 +3832,17 @@ · 5 unmodified lines
40193832
40203833
40213834
4022− 13.13. When you run UML, it immediately segfaults
3835+13.13. When you run UML, it immediately segfaults
3836+--------------------------------------------------
40233837
40243838 If the host is configured with the 2G/2G address space split, that's
4025− why. See ``UML on 2G/2G hosts'' for the details on getting UML to
3839+ why. See ref:`UML_on_2G/2G_hosts` for the details on getting UML to
40263840 run on your host.
40273841
40283842
40293843
4030− 13.14. xterms appear, then immediately disappear
3844+13.14. xterms appear, then immediately disappear
3845+-------------------------------------------------
40313846
40323847 If you're running an up to date kernel with an old release of
40333848 uml_utilities, the port-helper program will not work properly, so
@@ -4039,7 +3854,8 @@ · 5 unmodified lines
40393854
40403855
40413856
4042− 13.15. Any other panic, hang, or strange behavior
3857+13.15. Any other panic, hang, or strange behavior
3858+--------------------------------------------------
40433859
40443860 If you're seeing truly strange behavior, such as hangs or panics that
40453861 happen in random places, or you try running the debugger to see what's
@@ -4057,9 +3873,13 @@ · 11 unmodified lines
40573873 it and that a fix is imminent.
40583874
40593875
4060− If you want to be super-helpful, read ``Diagnosing Problems'' and
3876+ If you want to be super-helpful, read :ref:`Diagnosing_Problems` and
40613877 follow the instructions contained therein.
4062− 14. Diagnosing Problems
3878+
3879+.. _Diagnosing_Problems:
3880+
3881+14. Diagnosing Problems
3882+========================
40633883
40643884
40653885 If you get UML to crash, hang, or otherwise misbehave, you should
@@ -4074,21 +3894,22 @@ · 8 unmodified lines
40743894
40753895 For any diagnosis, you're going to need to build a debugging kernel.
40763896 The binaries from this site aren't debuggable. If you haven't done
4077− this before, read about ``Compiling the kernel and modules'' and
4078− ``Kernel debugging'' UML first.
3897+ this before, read about :ref:`Compiling_the_kernel_and_modules` and
3898+ :ref:`Kernel_debugging` UML first.
40793899
40803900
4081− 14.1. Case 1 : Normal kernel panics
3901+14.1. Case 1 : Normal kernel panics
3902+------------------------------------
40823903
40833904 The most common case is for a normal thread to panic. To debug this,
40843905 you will need to run it under the debugger (add 'debug' to the command
40853906 line). An xterm will start up with gdb running inside it. Continue
4086− it when it stops in start_kernel and make it crash. Now ^C gdb and
3907+ it when it stops in start_kernel and make it crash. Now ``^C gdb`` and
40873908
40883909
40893910 If the panic was a "Kernel mode fault", then there will be a segv
40903911 frame on the stack and I'm going to want some more information. The
4091− stack might look something like this:
3912+ stack might look something like this::
40923913
40933914
40943915 (UML gdb) backtrace
@@ -4107,7 +3928,7 @@ · 12 unmodified lines
41073928
41083929
41093930 I'm going to want to see the symbol and line information for the value
4110− of ip in the segv frame. In this case, you would do the following:
3931+ of ip in the segv frame. In this case, you would do the following::
41113932
41123933
41133934 (UML gdb) i sym 268849158
@@ -4115,7 +3936,7 @@ · 1 unmodified line
41153936
41163937
41173938
4118− and
3939+ and::
41193940
41203941
41213942 (UML gdb) i line *268849158
@@ -4128,7 +3949,8 @@ · 6 unmodified lines
41283949 to get that information from the faulting ip.
41293950
41303951
4131− 14.2. Case 2 : Tracing thread panics
3952+14.2. Case 2 : Tracing thread panics
3953+-------------------------------------
41323954
41333955 The less common and more painful case is when the tracing thread
41343956 panics. In this case, the kernel debugger will be useless because it
@@ -4136,7 +3958,7 @@ · 1 unmodified line
41363958 do is get a backtrace from the tracing thread. This is done by
41373959 figuring out what its pid is, firing up gdb, and attaching it to that
41383960 pid. You can figure out the tracing thread pid by looking at the
4139− first line of the console output, which will look like this:
3961+ first line of the console output, which will look like this::
41403962
41413963
41423964 tracing thread pid = 15851
@@ -4145,7 +3967,7 @@ · 2 unmodified lines
41453967
41463968
41473969 or by running ps on the host and finding the line that looks like
4148− this:
3970+ this::
41493971
41503972
41513973 jdike 15851 4.5 0.4 132568 1104 pts/0 S 21:34 0:05 ./linux [(tracing thread)]
@@ -4164,7 +3986,7 @@ · 12 unmodified lines
41643986 14.3. Case 3 : Tracing thread panics caused by other threads
41653987
41663988 However, there are cases where the misbehavior of another thread
4167− caused the problem. The most common panic of this type is:
3989+ caused the problem. The most common panic of this type is::
41683990
41693991
41703992 wait_for_stop failed to wait for <pid> to stop with <signal number>
@@ -4177,7 +3999,7 @@ · 6 unmodified lines
41773999 debugger is defunct and without some fancy footwork, another gdb can't
41784000 attach to it. So, this is how the fancy footwork goes:
41794001
4180− In a shell:
4002+ In a shell::
41814003
41824004
41834005 host% kill -STOP pid
@@ -4185,7 +4007,7 @@ · 1 unmodified line
41854007
41864008
41874009
4188− Run gdb on the tracing thread as described in case 2 and do:
4010+ Run gdb on the tracing thread as described in case 2 and do::
41894011
41904012
41914013 (host gdb) call detach(pid)
@@ -4193,7 +4015,7 @@ · 1 unmodified line
41934015
41944016 If you get a segfault, do it again. It always works the second time.
41954017
4196− Detach from the tracing thread and attach to that other thread:
4018+ Detach from the tracing thread and attach to that other thread::
41974019
41984020
41994021 (host gdb) detach
@@ -4209,7 +4031,7 @@ · 9 unmodified lines
42094031
42104032
42114033 If gdb hangs when attaching to that process, go back to a shell and
4212− do:
4034+ do::
42134035
42144036
42154037 host%
@@ -4218,7 +4040,7 @@ · 2 unmodified lines
42184040
42194041
42204042
4221− And then get the backtrace:
4043+ And then get the backtrace::
42224044
42234045
42244046 (host gdb) backtrace
@@ -4227,13 +4049,14 @@ · 2 unmodified lines
42274049
42284050
42294051
4230− 14.4. Case 4 : Hangs
4052+14.4. Case 4 : Hangs
4053+---------------------
42314054
42324055 Hangs seem to be fairly rare, but they sometimes happen. When a hang
42334056 happens, we need a backtrace from the offending process. Run the
42344057 kernel debugger as described in case 1 and get a backtrace. If the
42354058 current process is not the idle thread, then send in the backtrace.
4236− You can tell that it's the idle thread if the stack looks like this:
4059+ You can tell that it's the idle thread if the stack looks like this::
42374060
42384061
42394062 #0 0x100b1401 in __libc_nanosleep ()
@@ -4257,7 +4080,8 @@ · 17 unmodified lines
42574080
42584081
42594082
4260− 15. Thanks
4083+15. Thanks
4084+===========
42614085
42624086
42634087 A number of people have helped this project in various ways, and this
@@ -4274,20 +4098,21 @@ · 10 unmodified lines
42744098 bookkeeping lapses and I forget about contributions.
42754099
42764100
4277− 15.1. Code and Documentation
4101+15.1. Code and Documentation
4102+-----------------------------
42784103
42794104 Rusty Russell <rusty at linuxcare.com.au> -
42804105
4281− o wrote the HOWTO <http://user-mode-
4282− linux.sourceforge.net/UserModeLinux-HOWTO.html>
4106+ - wrote the HOWTO
4107+ http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO.html
42834108
4284− o prodded me into making this project official and putting it on
4109+ - prodded me into making this project official and putting it on
42854110 SourceForge
42864111
4287− o came up with the way cool UML logo <http://user-mode-
4288− linux.sourceforge.net/uml-small.png>
4112+ - came up with the way cool UML logo
4113+ http://user-mode-linux.sourceforge.net/uml-small.png
42894114
4290− o redid the config process
4115+ - redid the config process
42914116
42924117
42934118 Peter Moulder <reiter at netspace.net.au> - Fixed my config and build
@@ -4296,34 +4121,32 @@ · 2 unmodified lines
42964121
42974122 Bill Stearns <wstearns at pobox.com> -
42984123
4299− o HOWTO updates
4124+ - HOWTO updates
43004125
4301− o lots of bug reports
4126+ - lots of bug reports
43024127
4303− o lots of testing
4128+ - lots of testing
43044129
4305− o dedicated a box (uml.ists.dartmouth.edu) to support UML development
4130+ - dedicated a box (uml.ists.dartmouth.edu) to support UML development
43064131
4307− o wrote the mkrootfs script, which allows bootable filesystems of
4132+ - wrote the mkrootfs script, which allows bootable filesystems of
43084133 RPM-based distributions to be cranked out
43094134
4310− o cranked out a large number of filesystems with said script
4135+ - cranked out a large number of filesystems with said script
43114136
43124137
43134138 Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver
43144139 and associated usermode tools
43154140
4316− Lars Brinkhoff <http://lars.nocrew.org/> - Contributed the ptrace
4317− proxy from his own project <http://a386.nocrew.org/> to allow easier
4318− kernel debugging
4141+ Lars Brinkhoff http://lars.nocrew.org/ - Contributed the ptrace
4142+ proxy from his own project to allow easier kernel debugging
43194143
43204144
43214145 Andrea Arcangeli <andrea at suse.de> - Redid some of the early boot
43224146 code so that it would work on machines with Large File Support
43234147
43244148
4325− Chris Emerson <http://www.chiark.greenend.org.uk/~cemerson/> - Did
4326− the first UML port to Linux/ppc
4149+ Chris Emerson - Did the first UML port to Linux/ppc
43274150
43284151
43294152 Harald Welte <laforge at gnumonks.org> - Wrote the multicast
@@ -4338,7 +4161,7 @@ · 8 unmodified lines
43384161 wrote the iomem emulation support
43394162
43404163
4341− Henrik Nordstrom <http://hem.passagen.se/hno/> - Provided a variety
4164+ Henrik Nordstrom http://hem.passagen.se/hno/ - Provided a variety
43424165 of patches, fixes, and clues
43434166
43444167
@@ -4373,190 +4196,193 @@ · 28 unmodified lines
43734196 submitted patches for the slip transport and lots of other things.
43744197
43754198
4376− David Coulson <http://davidcoulson.net> -
4199+ David Coulson http://davidcoulson.net -
43774200
4378− o Set up the usermodelinux.org <http://usermodelinux.org> site,
4201+ - Set up the http://usermodelinux.org site,
43794202 which is a great way of keeping the UML user community on top of
43804203 UML goings-on.
43814204
4382− o Site documentation and updates
4205+ - Site documentation and updates
43834206
4384− o Nifty little UML management daemon UMLd
4385− <http://uml.openconsultancy.com/umld/>
4207+ - Nifty little UML management daemon UMLd
43864208
4387− o Lots of testing and bug reports
4209+ - Lots of testing and bug reports
43884210
43894211
43904212
43914213
4392− 15.2. Flushing out bugs
4214+15.2. Flushing out bugs
4215+------------------------
43934216
43944217
43954218
4396− o Yuri Pudgorodsky
4219+ - Yuri Pudgorodsky
43974220
4398− o Gerald Britton
4221+ - Gerald Britton
43994222
4400− o Ian Wehrman
4223+ - Ian Wehrman
44014224
4402− o Gord Lamb
4225+ - Gord Lamb
44034226
4404− o Eugene Koontz
4227+ - Eugene Koontz
44054228
4406− o John H. Hartman
4229+ - John H. Hartman
44074230
4408− o Anders Karlsson
4231+ - Anders Karlsson
44094232
4410− o Daniel Phillips
4233+ - Daniel Phillips
44114234
4412− o John Fremlin
4235+ - John Fremlin
44134236
4414− o Rainer Burgstaller
4237+ - Rainer Burgstaller
44154238
4416− o James Stevenson
4239+ - James Stevenson
44174240
4418− o Matt Clay
4241+ - Matt Clay
44194242
4420− o Cliff Jefferies
4243+ - Cliff Jefferies
44214244
4422− o Geoff Hoff
4245+ - Geoff Hoff
44234246
4424− o Lennert Buytenhek
4247+ - Lennert Buytenhek
44254248
4426− o Al Viro
4249+ - Al Viro
44274250
4428− o Frank Klingenhoefer
4251+ - Frank Klingenhoefer
44294252
4430− o Livio Baldini Soares
4253+ - Livio Baldini Soares
44314254
4432− o Jon Burgess
4255+ - Jon Burgess
44334256
4434− o Petru Paler
4257+ - Petru Paler
44354258
4436− o Paul
4259+ - Paul
44374260
4438− o Chris Reahard
4261+ - Chris Reahard
44394262
4440− o Sverker Nilsson
4263+ - Sverker Nilsson
44414264
4442− o Gong Su
4265+ - Gong Su
44434266
4444− o johan verrept
4267+ - johan verrept
44454268
4446− o Bjorn Eriksson
4269+ - Bjorn Eriksson
44474270
4448− o Lorenzo Allegrucci
4271+ - Lorenzo Allegrucci
44494272
4450− o Muli Ben-Yehuda
4273+ - Muli Ben-Yehuda
44514274
4452− o David Mansfield
4275+ - David Mansfield
44534276
4454− o Howard Goff
4277+ - Howard Goff
44554278
4456− o Mike Anderson
4279+ - Mike Anderson
44574280
4458− o John Byrne
4281+ - John Byrne
44594282
4460− o Sapan J. Batia
4283+ - Sapan J. Batia
44614284
4462− o Iris Huang
4285+ - Iris Huang
44634286
4464− o Jan Hudec
4287+ - Jan Hudec
44654288
4466− o Voluspa
4289+ - Voluspa
44674290
44684291
44694292
44704293
4471− 15.3. Buglets and clean-ups
4294+15.3. Buglets and clean-ups
4295+----------------------------
44724296
44734297
44744298
4475− o Dave Zarzycki
4299+ - Dave Zarzycki
44764300
4477− o Adam Lazur
4301+ - Adam Lazur
44784302
4479− o Boria Feigin
4303+ - Boria Feigin
44804304
4481− o Brian J. Murrell
4305+ - Brian J. Murrell
44824306
4483− o JS
4307+ - JS
44844308
4485− o Roman Zippel
4309+ - Roman Zippel
44864310
4487− o Wil Cooley
4311+ - Wil Cooley
44884312
4489− o Ayelet Shemesh
4313+ - Ayelet Shemesh
44904314
4491− o Will Dyson
4315+ - Will Dyson
44924316
4493− o Sverker Nilsson
4317+ - Sverker Nilsson
44944318
4495− o dvorak
4319+ - dvorak
44964320
4497− o v.naga srinivas
4321+ - v.naga srinivas
44984322
4499− o Shlomi Fish
4323+ - Shlomi Fish
45004324
4501− o Roger Binns
4325+ - Roger Binns
45024326
4503− o johan verrept
4327+ - johan verrept
45044328
4505− o MrChuoi
4329+ - MrChuoi
45064330
4507− o Peter Cleve
4331+ - Peter Cleve
45084332
4509− o Vincent Guffens
4333+ - Vincent Guffens
45104334
4511− o Nathan Scott
4335+ - Nathan Scott
45124336
4513− o Patrick Caulfield
4337+ - Patrick Caulfield
45144338
4515− o jbearce
4339+ - jbearce
45164340
4517− o Catalin Marinas
4341+ - Catalin Marinas
45184342
4519− o Shane Spencer
4343+ - Shane Spencer
45204344
4521− o Zou Min
4345+ - Zou Min
45224346
45234347
4524− o Ryan Boder
4348+ - Ryan Boder
45254349
4526− o Lorenzo Colitti
4350+ - Lorenzo Colitti
45274351
4528− o Gwendal Grignou
4352+ - Gwendal Grignou
45294353
4530− o Andre' Breiler
4354+ - Andre' Breiler
45314355
4532− o Tsutomu Yasuda
4356+ - Tsutomu Yasuda
45334357
45344358
45354359
4536− 15.4. Case Studies
4360+15.4. Case Studies
4361+-------------------
45374362
45384363
4539− o Jon Wright
4364+ - Jon Wright
45404365
4541− o William McEwan
4366+ - William McEwan
45424367
4543− o Michael Richardson
4368+ - Michael Richardson
45444369
45454370
45464371
4547− 15.5. Other contributions
4372+15.5. Other contributions
4373+--------------------------
45484374
45494375
45504376 Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script
45514377 work with RH 6.2.
45524378
45534379 Michael Jennings <mikejen at hevanet.com> sent in some material which
4554− is now gracing the top of the index page <http://user-mode-
4555− linux.sourceforge.net/> of this site.
4380+ is now gracing the top of the index page
4381+ http://user-mode-linux.sourceforge.net/ of this site.
45564382
4557− SGI <http://www.sgi.com> (and more specifically Ralf Baechle <ralf at
4558− uni-koblenz.de> ) gave me an account on oss.sgi.com
4559− <http://www.oss.sgi.com> . The bandwidth there made it possible to
4383+ SGI (and more specifically Ralf Baechle <ralf at
4384+ uni-koblenz.de> ) gave me an account on oss.sgi.com.
4385+ The bandwidth there made it possible to
45604386 produce most of the filesystems available on the project download
45614387 page.
45624388
@@ -4573,17 +4399,5 @@ · 10 unmodified lines
45734399
45744400 Chris Reahard built a specialized root filesystem for running a DNS
45754401 server jailed inside UML. It's available from the download
4576− <http://user-mode-linux.sourceforge.net/dl-sf.html> page in the Jail
4402+ http://user-mode-linux.sourceforge.net/old/dl-sf.html page in the Jail
45774403 Filesystems section.
4578−
4579−
4580−
4581−
4582−
4583−
4584−
4585−
4586−
4587−
4588−
4589−
Documentation/x86/index.rst+0−1
@@ -19,7 +19,6 @@ x86-specific Documentation · 18 unmodified lines
1919 tlb
2020 mtrr
2121 pat
22− intel_mpx
2322 intel-iommu
2423 intel_txt
2524 amd-memory-encryption
MAINTAINERS+46−47
@@ -2796,11 +2796,11 @@ F: drivers/block/aoe/ · 2795 unmodified lines
27962796
27972797 ATHEROS 71XX/9XXX GPIO DRIVER
27982798 M: Alban Bedel <albeu@free.fr>
2799+S: Maintained
27992800 W: https://github.com/AlbanBedel/linux
28002801 T: git git://github.com/AlbanBedel/linux
2801−S: Maintained
2802−F: drivers/gpio/gpio-ath79.c
28032802 F: Documentation/devicetree/bindings/gpio/gpio-ath79.txt
2803+F: drivers/gpio/gpio-ath79.c
28042804
28052805 ATHEROS 71XX/9XXX USB PHY DRIVER
28062806 M: Alban Bedel <albeu@free.fr>
@@ -3422,8 +3422,8 @@ BROADCOM BRCMSTB GPIO DRIVER · 615 unmodified lines
34223422 M: Gregory Fong <gregory.0xf0@gmail.com>
34233423 L: bcm-kernel-feedback-list@broadcom.com
34243424 S: Supported
3425−F: drivers/gpio/gpio-brcmstb.c
34263425 F: Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
3426+F: drivers/gpio/gpio-brcmstb.c
34273427
34283428 BROADCOM BRCMSTB I2C DRIVER
34293429 M: Kamal Dasu <kdasu.kdev@gmail.com>
@@ -3481,8 +3481,8 @@ BROADCOM KONA GPIO DRIVER · 51 unmodified lines
34813481 M: Ray Jui <rjui@broadcom.com>
34823482 L: bcm-kernel-feedback-list@broadcom.com
34833483 S: Supported
3484−F: drivers/gpio/gpio-bcm-kona.c
34853484 F: Documentation/devicetree/bindings/gpio/brcm,kona-gpio.txt
3485+F: drivers/gpio/gpio-bcm-kona.c
34863486
34873487 BROADCOM NETXTREME-E ROCE DRIVER
34883488 M: Selvin Xavier <selvin.xavier@broadcom.com>
@@ -3597,8 +3597,8 @@ F: sound/pci/bt87x.c · 108 unmodified lines
35973597
35983598 BT8XXGPIO DRIVER
35993599 M: Michael Buesch <m@bues.ch>
3600−W: http://bu3sch.de/btgpio.php
36013600 S: Maintained
3601+W: http://bu3sch.de/btgpio.php
36023602 F: drivers/gpio/gpio-bt8xx.c
36033603
36043604 BTRFS FILE SYSTEM
@@ -3649,6 +3649,7 @@ F: sound/pci/oxygen/ · 44 unmodified lines
36493649
36503650 C-SKY ARCHITECTURE
36513651 M: Guo Ren <guoren@kernel.org>
3652+L: linux-csky@vger.kernel.org
36523653 T: git https://github.com/c-sky/csky-linux.git
36533654 S: Supported
36543655 F: arch/csky/
@@ -3909,7 +3910,7 @@ S: Supported · 254 unmodified lines
39093910 F: Documentation/filesystems/ceph.txt
39103911 F: fs/ceph/
39113912
3912−CERTIFICATE HANDLING:
3913+CERTIFICATE HANDLING
39133914 M: David Howells <dhowells@redhat.com>
39143915 M: David Woodhouse <dwmw2@infradead.org>
39153916 L: keyrings@vger.kernel.org
@@ -3919,7 +3920,7 @@ F: certs/ · 3 unmodified lines
39193920 F: scripts/sign-file.c
39203921 F: scripts/extract-cert.c
39213922
3922−CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
3923+CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM
39233924 L: devel@driverdev.osuosl.org
39243925 S: Obsolete
39253926 F: drivers/staging/wusbcore/
@@ -5932,12 +5933,12 @@ S: Maintained · 2006 unmodified lines
59325933 F: drivers/media/dvb-frontends/ec100*
59335934
59345935 ECRYPT FILE SYSTEM
5935−M: Tyler Hicks <tyhicks@canonical.com>
5936+M: Tyler Hicks <code@tyhicks.com>
59365937 L: ecryptfs@vger.kernel.org
59375938 W: http://ecryptfs.org
59385939 W: https://launchpad.net/ecryptfs
59395940 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git
5940−S: Supported
5941+S: Odd Fixes
59415942 F: Documentation/filesystems/ecryptfs.txt
59425943 F: fs/ecryptfs/
59435944
@@ -7047,7 +7048,7 @@ L: kvm@vger.kernel.org · 1103 unmodified lines
70477048 S: Supported
70487049 F: drivers/uio/uio_pci_generic.c
70497050
7050−GENERIC VDSO LIBRARY:
7051+GENERIC VDSO LIBRARY
70517052 M: Andy Lutomirski <luto@kernel.org>
70527053 M: Thomas Gleixner <tglx@linutronix.de>
70537054 M: Vincenzo Frascino <vincenzo.frascino@arm.com>
@@ -7143,18 +7144,18 @@ GPIO SUBSYSTEM · 89 unmodified lines
71437144 M: Linus Walleij <linus.walleij@linaro.org>
71447145 M: Bartosz Golaszewski <bgolaszewski@baylibre.com>
71457146 L: linux-gpio@vger.kernel.org
7146−T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
71477147 S: Maintained
7148+T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
7149+F: Documentation/ABI/obsolete/sysfs-gpio
7150+F: Documentation/ABI/testing/gpio-cdev
7151+F: Documentation/admin-guide/gpio/
71487152 F: Documentation/devicetree/bindings/gpio/
71497153 F: Documentation/driver-api/gpio/
7150−F: Documentation/admin-guide/gpio/
7151−F: Documentation/ABI/testing/gpio-cdev
7152−F: Documentation/ABI/obsolete/sysfs-gpio
71537154 F: drivers/gpio/
7155+F: include/asm-generic/gpio.h
71547156 F: include/linux/gpio/
71557157 F: include/linux/gpio.h
71567158 F: include/linux/of_gpio.h
7157−F: include/asm-generic/gpio.h
71587159 F: include/uapi/linux/gpio.h
71597160 F: tools/gpio/
71607161
@@ -8055,8 +8056,8 @@ F: drivers/scsi/ips.* · 894 unmodified lines
80558056 ICH LPC AND GPIO DRIVER
80568057 M: Peter Tyser <ptyser@xes-inc.com>
80578058 S: Maintained
8058−F: drivers/mfd/lpc_ich.c
80598059 F: drivers/gpio/gpio-ich.c
8060+F: drivers/mfd/lpc_ich.c
80608061
80618062 ICY I2C DRIVER
80628063 M: Max Staudt <max@enpas.org>
@@ -8392,7 +8393,7 @@ M: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> · 329 unmodified lines
83928393 M: Rodrigo Vivi <rodrigo.vivi@intel.com>
83938394 L: intel-gfx@lists.freedesktop.org
83948395 W: https://01.org/linuxgraphics/
8395−B: https://01.org/linuxgraphics/documentation/how-report-bugs
8396+B: https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs
83968397 C: irc://chat.freenode.net/intel-gfx
83978398 Q: http://patchwork.freedesktop.org/project/intel-gfx/
83988399 T: git git://anongit.freedesktop.org/drm-intel
@@ -9278,7 +9279,7 @@ F: include/keys/trusted-type.h · 879 unmodified lines
92789279 F: security/keys/trusted.c
92799280 F: include/keys/trusted.h
92809281
9281−KEYS/KEYRINGS:
9282+KEYS/KEYRINGS
92829283 M: David Howells <dhowells@redhat.com>
92839284 M: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
92849285 L: keyrings@vger.kernel.org
@@ -11114,14 +11115,12 @@ S: Maintained · 1829 unmodified lines
1111411115 F: drivers/usb/image/microtek.*
1111511116
1111611117 MIPS
11117−M: Ralf Baechle <ralf@linux-mips.org>
11118−M: Paul Burton <paulburton@kernel.org>
11118+M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1111911119 L: linux-mips@vger.kernel.org
1112011120 W: http://www.linux-mips.org/
11121−T: git git://git.linux-mips.org/pub/scm/ralf/linux.git
1112211121 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git
1112311122 Q: http://patchwork.linux-mips.org/project/linux-mips/list/
11124−S: Supported
11123+S: Maintained
1112511124 F: Documentation/devicetree/bindings/mips/
1112611125 F: Documentation/mips/
1112711126 F: arch/mips/
@@ -11485,7 +11484,7 @@ F: drivers/scsi/mac_scsi.* · 357 unmodified lines
1148511484 F: drivers/scsi/sun3_scsi.*
1148611485 F: drivers/scsi/sun3_scsi_vme.c
1148711486
11488−NCSI LIBRARY:
11487+NCSI LIBRARY
1148911488 M: Samuel Mendoza-Jonas <sam@mendozajonas.com>
1149011489 S: Maintained
1149111490 F: net/ncsi/
@@ -12741,7 +12740,7 @@ M: Tom Joseph <tjoseph@cadence.com> · 1249 unmodified lines
1274112740 L: linux-pci@vger.kernel.org
1274212741 S: Maintained
1274312742 F: Documentation/devicetree/bindings/pci/cdns,*.txt
12744−F: drivers/pci/controller/pcie-cadence*
12743+F: drivers/pci/controller/cadence/
1274512744
1274612745 PCI DRIVER FOR FREESCALE LAYERSCAPE
1274712746 M: Minghuan Lian <minghuan.Lian@nxp.com>
@@ -13513,7 +13512,7 @@ L: linuxppc-dev@lists.ozlabs.org · 765 unmodified lines
1351313512 S: Maintained
1351413513 F: drivers/block/ps3vram.c
1351513514
13516−PSAMPLE PACKET SAMPLING SUPPORT:
13515+PSAMPLE PACKET SAMPLING SUPPORT
1351713516 M: Yotam Gigi <yotam.gi@gmail.com>
1351813517 S: Maintained
1351913518 F: net/psample
@@ -14583,10 +14582,10 @@ F: drivers/media/pci/saa7146/ · 1063 unmodified lines
1458314582 F: include/media/drv-intf/saa7146*
1458414583
1458514584 SAFESETID SECURITY MODULE
14586−M: Micah Morton <mortonm@chromium.org>
14587−S: Supported
14588−F: security/safesetid/
14589−F: Documentation/admin-guide/LSM/SafeSetID.rst
14585+M: Micah Morton <mortonm@chromium.org>
14586+S: Supported
14587+F: security/safesetid/
14588+F: Documentation/admin-guide/LSM/SafeSetID.rst
1459014589
1459114590 SAMSUNG AUDIO (ASoC) DRIVERS
1459214591 M: Krzysztof Kozlowski <krzk@kernel.org>
@@ -16076,8 +16075,8 @@ F: Documentation/devicetree/bindings/reset/snps,axs10x-reset.txt · 1483 unmodified lines
1607616075 SYNOPSYS CREG GPIO DRIVER
1607716076 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
1607816077 S: Maintained
16079−F: drivers/gpio/gpio-creg-snps.c
1608016078 F: Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt
16079+F: drivers/gpio/gpio-creg-snps.c
1608116080
1608216081 SYNOPSYS DESIGNWARE 8250 UART DRIVER
1608316082 R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
@@ -16088,8 +16087,8 @@ SYNOPSYS DESIGNWARE APB GPIO DRIVER · 4 unmodified lines
1608816087 M: Hoan Tran <hoan@os.amperecomputing.com>
1608916088 L: linux-gpio@vger.kernel.org
1609016089 S: Maintained
16091−F: drivers/gpio/gpio-dwapb.c
1609216090 F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
16091+F: drivers/gpio/gpio-dwapb.c
1609316092
1609416093 SYNOPSYS DESIGNWARE AXI DMAC DRIVER
1609516094 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
@@ -16553,8 +16552,8 @@ M: Michael Jamet <michael.jamet@intel.com> · 457 unmodified lines
1655316552 M: Mika Westerberg <mika.westerberg@linux.intel.com>
1655416553 M: Yehezkel Bernat <YehezkelShB@gmail.com>
1655516554 L: linux-usb@vger.kernel.org
16556−T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git
1655716555 S: Maintained
16556+T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git
1655816557 F: Documentation/admin-guide/thunderbolt.rst
1655916558 F: drivers/thunderbolt/
1656016559 F: include/linux/thunderbolt.h
@@ -17081,7 +17080,7 @@ S: Maintained · 520 unmodified lines
1708117080 F: Documentation/admin-guide/ufs.rst
1708217081 F: fs/ufs/
1708317082
17084−UHID USERSPACE HID IO DRIVER:
17083+UHID USERSPACE HID IO DRIVER
1708517084 M: David Herrmann <dh.herrmann@googlemail.com>
1708617085 L: linux-input@vger.kernel.org
1708717086 S: Maintained
@@ -17095,18 +17094,18 @@ S: Maintained · 7 unmodified lines
1709517094 F: drivers/usb/common/ulpi.c
1709617095 F: include/linux/ulpi/
1709717096
17098−ULTRA-WIDEBAND (UWB) SUBSYSTEM:
17097+ULTRA-WIDEBAND (UWB) SUBSYSTEM
1709917098 L: devel@driverdev.osuosl.org
1710017099 S: Obsolete
1710117100 F: drivers/staging/uwb/
1710217101
17103−UNICODE SUBSYSTEM:
17102+UNICODE SUBSYSTEM
1710417103 M: Gabriel Krisman Bertazi <krisman@collabora.com>
1710517104 L: linux-fsdevel@vger.kernel.org
1710617105 S: Supported
1710717106 F: fs/unicode/
1710817107
17109−UNICORE32 ARCHITECTURE:
17108+UNICORE32 ARCHITECTURE
1711017109 M: Guan Xuetao <gxt@pku.edu.cn>
1711117110 W: http://mprc.pku.edu.cn/~guanxuetao/linux
1711217111 S: Maintained
@@ -17393,11 +17392,14 @@ F: drivers/usb/ · 280 unmodified lines
1739317392 F: include/linux/usb.h
1739417393 F: include/linux/usb/
1739517394
17396−USB TYPEC PI3USB30532 MUX DRIVER
17397−M: Hans de Goede <hdegoede@redhat.com>
17395+USB TYPEC BUS FOR ALTERNATE MODES
17396+M: Heikki Krogerus <heikki.krogerus@linux.intel.com>
1739817397 L: linux-usb@vger.kernel.org
1739917398 S: Maintained
17400−F: drivers/usb/typec/mux/pi3usb30532.c
17399+F: Documentation/ABI/testing/sysfs-bus-typec
17400+F: Documentation/driver-api/usb/typec_bus.rst
17401+F: drivers/usb/typec/altmodes/
17402+F: include/linux/usb/typec_altmode.h
1740117403
1740217404 USB TYPEC CLASS
1740317405 M: Heikki Krogerus <heikki.krogerus@linux.intel.com>
@@ -17408,14 +17410,11 @@ F: Documentation/driver-api/usb/typec.rst · 4 unmodified lines
1740817410 F: drivers/usb/typec/
1740917411 F: include/linux/usb/typec.h
1741017412
17411−USB TYPEC BUS FOR ALTERNATE MODES
17412−M: Heikki Krogerus <heikki.krogerus@linux.intel.com>
17413+USB TYPEC PI3USB30532 MUX DRIVER
17414+M: Hans de Goede <hdegoede@redhat.com>
1741317415 L: linux-usb@vger.kernel.org
1741417416 S: Maintained
17415−F: Documentation/ABI/testing/sysfs-bus-typec
17416−F: Documentation/driver-api/usb/typec_bus.rst
17417−F: drivers/usb/typec/altmodes/
17418−F: include/linux/usb/typec_altmode.h
17417+F: drivers/usb/typec/mux/pi3usb30532.c
1741917418
1742017419 USB TYPEC PORT CONTROLLER DRIVERS
1742117420 M: Guenter Roeck <linux@roeck-us.net>
@@ -17792,7 +17791,7 @@ F: include/linux/vbox_utils.h · 370 unmodified lines
1779217791 F: include/uapi/linux/vbox*.h
1779317792 F: drivers/virt/vboxguest/
1779417793
17795−VIRTUAL BOX SHARED FOLDER VFS DRIVER:
17794+VIRTUAL BOX SHARED FOLDER VFS DRIVER
1779617795 M: Hans de Goede <hdegoede@redhat.com>
1779717796 L: linux-fsdevel@vger.kernel.org
1779817797 S: Maintained
@@ -18415,8 +18414,8 @@ M: Nandor Han <nandor.han@ge.com> · 616 unmodified lines
1841518414 M: Semi Malinen <semi.malinen@ge.com>
1841618415 L: linux-gpio@vger.kernel.org
1841718416 S: Maintained
18418−F: drivers/gpio/gpio-xra1403.c
1841918417 F: Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
18418+F: drivers/gpio/gpio-xra1403.c
1842018419
1842118420 XTENSA XTFPGA PLATFORM SUPPORT
1842218421 M: Max Filippov <jcmvbkbc@gmail.com>
Makefile+4−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 6
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc4
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
@@ -68,6 +68,7 @@ unexport GREP_OPTIONS · 59 unmodified lines
6868 #
6969 # If KBUILD_VERBOSE equals 0 then the above command will be hidden.
7070 # If KBUILD_VERBOSE equals 1 then the above command is displayed.
71+# If KBUILD_VERBOSE equals 2 then give the reason why each target is rebuilt.
7172 #
7273 # To put more focus on warnings, be less verbose as default
7374 # Use 'make V=1' to see the full commands
@@ -1238,7 +1239,7 @@ ifneq ($(dtstree),) · 1164 unmodified lines
12381239 %.dtb: include/config/kernel.release scripts_dtc
12391240 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
12401241
1241−PHONY += dtbs dtbs_install dt_binding_check
1242+PHONY += dtbs dtbs_install dtbs_check
12421243 dtbs dtbs_check: include/config/kernel.release scripts_dtc
12431244 $(Q)$(MAKE) $(build)=$(dtstree)
12441245
@@ -1258,6 +1259,7 @@ PHONY += scripts_dtc · 13 unmodified lines
12581259 scripts_dtc: scripts_basic
12591260 $(Q)$(MAKE) $(build)=scripts/dtc
12601261
1262+PHONY += dt_binding_check
12611263 dt_binding_check: scripts_dtc
12621264 $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
12631265
arch/arm/boot/dts/stih410-b2260.dts+0−3
@@ -178,9 +178,6 @@ · 177 unmodified lines
178178 phy-mode = "rgmii";
179179 pinctrl-0 = <&pinctrl_rgmii1 &pinctrl_rgmii1_mdio_1>;
180180
181− snps,phy-bus-name = "stmmac";
182− snps,phy-bus-id = <0>;
183− snps,phy-addr = <0>;
184181 snps,reset-gpio = <&pio0 7 0>;
185182 snps,reset-active-low;
186183 snps,reset-delays-us = <0 10000 1000000>;
arch/arm/boot/dts/stihxxx-b2120.dtsi+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 /* DAC */
4747 format = "i2s";
4848 mclk-fs = <256>;
49− frame-inversion = <1>;
49+ frame-inversion;
5050 cpu {
5151 sound-dai = <&sti_uni_player2>;
5252 };
arch/arm/configs/am200epdkit_defconfig+0−2
@@ -11,8 +11,6 @@ CONFIG_SLAB=y · 10 unmodified lines
1111 CONFIG_MODULES=y
1212 CONFIG_MODULE_UNLOAD=y
1313 # CONFIG_BLK_DEV_BSG is not set
14−# CONFIG_IOSCHED_DEADLINE is not set
15−# CONFIG_IOSCHED_CFQ is not set
1614 CONFIG_ARCH_PXA=y
1715 CONFIG_ARCH_GUMSTIX=y
1816 CONFIG_PCCARD=y
arch/arm/configs/axm55xx_defconfig+0−1
@@ -25,7 +25,6 @@ CONFIG_EMBEDDED=y · 24 unmodified lines
2525 CONFIG_PROFILING=y
2626 CONFIG_MODULES=y
2727 CONFIG_MODULE_UNLOAD=y
28−# CONFIG_IOSCHED_DEADLINE is not set
2928 CONFIG_ARCH_AXXIA=y
3029 CONFIG_GPIO_PCA953X=y
3130 CONFIG_ARM_LPAE=y
arch/arm/configs/clps711x_defconfig+0−1
@@ -7,7 +7,6 @@ CONFIG_EMBEDDED=y · 6 unmodified lines
77 CONFIG_SLOB=y
88 CONFIG_JUMP_LABEL=y
99 CONFIG_PARTITION_ADVANCED=y
10−# CONFIG_IOSCHED_CFQ is not set
1110 CONFIG_ARCH_CLPS711X=y
1211 CONFIG_ARCH_AUTCPU12=y
1312 CONFIG_ARCH_CDB89712=y
arch/arm/configs/cns3420vb_defconfig+1−1
@@ -17,7 +17,7 @@ CONFIG_MODULE_UNLOAD=y · 16 unmodified lines
1717 CONFIG_MODULE_FORCE_UNLOAD=y
1818 CONFIG_MODVERSIONS=y
1919 # CONFIG_BLK_DEV_BSG is not set
20−CONFIG_IOSCHED_CFQ=m
20+CONFIG_IOSCHED_BFQ=m
2121 CONFIG_ARCH_MULTI_V6=y
2222 #CONFIG_ARCH_MULTI_V7 is not set
2323 CONFIG_ARCH_CNS3XXX=y
arch/arm/configs/colibri_pxa300_defconfig+0−1
@@ -43,7 +43,6 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y · 42 unmodified lines
4343 CONFIG_USB_MON=y
4444 CONFIG_USB_STORAGE=y
4545 CONFIG_MMC=y
46−# CONFIG_MMC_BLOCK_BOUNCE is not set
4746 CONFIG_MMC_PXA=y
4847 CONFIG_EXT3_FS=y
4948 CONFIG_NFS_FS=y
arch/arm/configs/collie_defconfig+0−2
@@ -7,8 +7,6 @@ CONFIG_EXPERT=y · 6 unmodified lines
77 # CONFIG_BASE_FULL is not set
88 # CONFIG_EPOLL is not set
99 CONFIG_SLOB=y
10−# CONFIG_IOSCHED_DEADLINE is not set
11−# CONFIG_IOSCHED_CFQ is not set
1210 CONFIG_ARCH_SA1100=y
1311 CONFIG_SA1100_COLLIE=y
1412 CONFIG_PCCARD=y
arch/arm/configs/davinci_all_defconfig+0−2
@@ -15,8 +15,6 @@ CONFIG_MODULE_UNLOAD=y · 14 unmodified lines
1515 CONFIG_MODULE_FORCE_UNLOAD=y
1616 CONFIG_MODVERSIONS=y
1717 CONFIG_PARTITION_ADVANCED=y
18−# CONFIG_IOSCHED_DEADLINE is not set
19−# CONFIG_IOSCHED_CFQ is not set
2018 CONFIG_ARCH_MULTIPLATFORM=y
2119 CONFIG_ARCH_MULTI_V7=n
2220 CONFIG_ARCH_MULTI_V5=y
arch/arm/configs/efm32_defconfig+0−2
@@ -12,8 +12,6 @@ CONFIG_EMBEDDED=y · 11 unmodified lines
1212 # CONFIG_VM_EVENT_COUNTERS is not set
1313 # CONFIG_SLUB_DEBUG is not set
1414 # CONFIG_BLK_DEV_BSG is not set
15−# CONFIG_IOSCHED_DEADLINE is not set
16−# CONFIG_IOSCHED_CFQ is not set
1715 # CONFIG_MMU is not set
1816 CONFIG_ARM_SINGLE_ARMV7M=y
1917 CONFIG_ARCH_EFM32=y
arch/arm/configs/ep93xx_defconfig+0−1
@@ -11,7 +11,6 @@ CONFIG_MODULE_UNLOAD=y · 10 unmodified lines
1111 CONFIG_MODULE_FORCE_UNLOAD=y
1212 # CONFIG_BLK_DEV_BSG is not set
1313 CONFIG_PARTITION_ADVANCED=y
14−# CONFIG_IOSCHED_CFQ is not set
1514 CONFIG_ARCH_EP93XX=y
1615 CONFIG_CRUNCH=y
1716 CONFIG_MACH_ADSSPHERE=y
arch/arm/configs/eseries_pxa_defconfig+0−2
@@ -9,8 +9,6 @@ CONFIG_MODULES=y · 8 unmodified lines
99 CONFIG_MODULE_UNLOAD=y
1010 CONFIG_MODULE_FORCE_UNLOAD=y
1111 # CONFIG_BLK_DEV_BSG is not set
12−# CONFIG_IOSCHED_DEADLINE is not set
13−# CONFIG_IOSCHED_CFQ is not set
1412 CONFIG_ARCH_PXA=y
1513 CONFIG_ARCH_PXA_ESERIES=y
1614 # CONFIG_ARM_THUMB is not set
arch/arm/configs/ezx_defconfig+0−1
@@ -14,7 +14,6 @@ CONFIG_MODULE_UNLOAD=y · 13 unmodified lines
1414 CONFIG_MODULE_FORCE_UNLOAD=y
1515 CONFIG_MODVERSIONS=y
1616 # CONFIG_BLK_DEV_BSG is not set
17−# CONFIG_IOSCHED_CFQ is not set
1817 CONFIG_ARCH_PXA=y
1918 CONFIG_PXA_EZX=y
2019 CONFIG_NO_HZ=y
arch/arm/configs/h3600_defconfig+0−2
@@ -5,8 +5,6 @@ CONFIG_LOG_BUF_SHIFT=14 · 4 unmodified lines
55 CONFIG_BLK_DEV_INITRD=y
66 CONFIG_MODULES=y
77 # CONFIG_BLK_DEV_BSG is not set
8−# CONFIG_IOSCHED_DEADLINE is not set
9−# CONFIG_IOSCHED_CFQ is not set
108 CONFIG_ARCH_SA1100=y
119 CONFIG_SA1100_H3600=y
1210 CONFIG_PCCARD=y
arch/arm/configs/h5000_defconfig+0−1
@@ -10,7 +10,6 @@ CONFIG_MODULES=y · 9 unmodified lines
1010 CONFIG_MODULE_UNLOAD=y
1111 CONFIG_MODULE_FORCE_UNLOAD=y
1212 # CONFIG_BLK_DEV_BSG is not set
13−# CONFIG_IOSCHED_CFQ is not set
1413 CONFIG_ARCH_PXA=y
1514 CONFIG_MACH_H5000=y
1615 CONFIG_AEABI=y
arch/arm/configs/imote2_defconfig+0−1
@@ -13,7 +13,6 @@ CONFIG_MODULE_UNLOAD=y · 12 unmodified lines
1313 CONFIG_MODULE_FORCE_UNLOAD=y
1414 CONFIG_MODVERSIONS=y
1515 # CONFIG_BLK_DEV_BSG is not set
16−# CONFIG_IOSCHED_CFQ is not set
1716 CONFIG_ARCH_PXA=y
1817 CONFIG_MACH_INTELMOTE2=y
1918 CONFIG_NO_HZ=y
arch/arm/configs/imx_v4_v5_defconfig+0−2
@@ -32,8 +32,6 @@ CONFIG_KPROBES=y · 31 unmodified lines
3232 CONFIG_MODULES=y
3333 CONFIG_MODULE_UNLOAD=y
3434 # CONFIG_BLK_DEV_BSG is not set
35−# CONFIG_IOSCHED_DEADLINE is not set
36−# CONFIG_IOSCHED_CFQ is not set
3735 CONFIG_NET=y
3836 CONFIG_PACKET=y
3937 CONFIG_UNIX=y
arch/arm/configs/lpc18xx_defconfig+0−4
@@ -1,4 +1,3 @@
1−CONFIG_CROSS_COMPILE="arm-linux-gnueabihf-"
21 CONFIG_HIGH_RES_TIMERS=y
32 CONFIG_PREEMPT=y
43 CONFIG_BLK_DEV_INITRD=y
@@ -28,10 +27,7 @@ CONFIG_FLASH_SIZE=0x00080000 · 23 unmodified lines
2827 CONFIG_ZBOOT_ROM_TEXT=0x0
2928 CONFIG_ZBOOT_ROM_BSS=0x0
3029 CONFIG_ARM_APPENDED_DTB=y
31−# CONFIG_LBDAF is not set
3230 # CONFIG_BLK_DEV_BSG is not set
33−# CONFIG_IOSCHED_DEADLINE is not set
34−# CONFIG_IOSCHED_CFQ is not set
3531 CONFIG_BINFMT_FLAT=y
3632 CONFIG_BINFMT_ZFLAT=y
3733 CONFIG_BINFMT_SHARED_FLAT=y
arch/arm/configs/magician_defconfig+0−2
@@ -9,8 +9,6 @@ CONFIG_SLAB=y · 8 unmodified lines
99 CONFIG_MODULES=y
1010 CONFIG_MODULE_UNLOAD=y
1111 # CONFIG_BLK_DEV_BSG is not set
12−# CONFIG_IOSCHED_DEADLINE is not set
13−# CONFIG_IOSCHED_CFQ is not set
1412 CONFIG_ARCH_PXA=y
1513 CONFIG_MACH_H4700=y
1614 CONFIG_MACH_MAGICIAN=y
arch/arm/configs/moxart_defconfig+0−1
@@ -15,7 +15,6 @@ CONFIG_EMBEDDED=y · 14 unmodified lines
1515 # CONFIG_SLUB_DEBUG is not set
1616 # CONFIG_COMPAT_BRK is not set
1717 # CONFIG_BLK_DEV_BSG is not set
18−# CONFIG_IOSCHED_DEADLINE is not set
1918 CONFIG_ARCH_MULTI_V4=y
2019 # CONFIG_ARCH_MULTI_V7 is not set
2120 CONFIG_ARCH_MOXART=y
arch/arm/configs/mxs_defconfig+0−2
@@ -25,8 +25,6 @@ CONFIG_MODULE_UNLOAD=y · 24 unmodified lines
2525 CONFIG_MODULE_FORCE_UNLOAD=y
2626 CONFIG_MODVERSIONS=y
2727 CONFIG_BLK_DEV_INTEGRITY=y
28−# CONFIG_IOSCHED_DEADLINE is not set
29−# CONFIG_IOSCHED_CFQ is not set
3028 CONFIG_NET=y
3129 CONFIG_PACKET=y
3230 CONFIG_UNIX=y
arch/arm/configs/omap1_defconfig+0−2
@@ -18,8 +18,6 @@ CONFIG_MODULES=y · 17 unmodified lines
1818 CONFIG_MODULE_UNLOAD=y
1919 CONFIG_MODULE_FORCE_UNLOAD=y
2020 # CONFIG_BLK_DEV_BSG is not set
21−# CONFIG_IOSCHED_DEADLINE is not set
22−# CONFIG_IOSCHED_CFQ is not set
2321 CONFIG_ARCH_OMAP=y
2422 CONFIG_ARCH_OMAP1=y
2523 CONFIG_OMAP_RESET_CLOCKS=y
arch/arm/configs/palmz72_defconfig+0−2
@@ -7,8 +7,6 @@ CONFIG_SLAB=y · 6 unmodified lines
77 CONFIG_MODULES=y
88 CONFIG_MODULE_UNLOAD=y
99 # CONFIG_BLK_DEV_BSG is not set
10−# CONFIG_IOSCHED_DEADLINE is not set
11−# CONFIG_IOSCHED_CFQ is not set
1210 CONFIG_ARCH_PXA=y
1311 CONFIG_ARCH_PXA_PALM=y
1412 # CONFIG_MACH_PALMTX is not set
arch/arm/configs/pcm027_defconfig+0−2
@@ -13,8 +13,6 @@ CONFIG_MODULES=y · 12 unmodified lines
1313 CONFIG_MODULE_UNLOAD=y
1414 CONFIG_MODULE_FORCE_UNLOAD=y
1515 # CONFIG_BLK_DEV_BSG is not set
16−# CONFIG_IOSCHED_DEADLINE is not set
17−# CONFIG_IOSCHED_CFQ is not set
1816 CONFIG_ARCH_PXA=y
1917 CONFIG_MACH_PCM027=y
2018 CONFIG_MACH_PCM990_BASEBOARD=y
arch/arm/configs/pleb_defconfig+0−2
@@ -6,8 +6,6 @@ CONFIG_EXPERT=y · 5 unmodified lines
66 # CONFIG_HOTPLUG is not set
77 # CONFIG_SHMEM is not set
88 CONFIG_MODULES=y
9−# CONFIG_IOSCHED_DEADLINE is not set
10−# CONFIG_IOSCHED_CFQ is not set
119 CONFIG_ARCH_SA1100=y
1210 CONFIG_SA1100_PLEB=y
1311 CONFIG_ZBOOT_ROM_TEXT=0x0
arch/arm/configs/realview_defconfig+0−1
@@ -8,7 +8,6 @@ CONFIG_SLAB=y · 7 unmodified lines
88 CONFIG_MODULES=y
99 CONFIG_MODULE_UNLOAD=y
1010 # CONFIG_BLK_DEV_BSG is not set
11−# CONFIG_IOSCHED_CFQ is not set
1211 CONFIG_ARCH_MULTI_V6=y
1312 CONFIG_ARCH_REALVIEW=y
1413 CONFIG_MACH_REALVIEW_EB=y
arch/arm/configs/sama5_defconfig+0−3
@@ -14,8 +14,6 @@ CONFIG_MODULE_FORCE_LOAD=y · 13 unmodified lines
1414 CONFIG_MODULE_UNLOAD=y
1515 CONFIG_MODULE_FORCE_UNLOAD=y
1616 # CONFIG_BLK_DEV_BSG is not set
17−# CONFIG_IOSCHED_DEADLINE is not set
18−# CONFIG_IOSCHED_CFQ is not set
1917 CONFIG_ARCH_AT91=y
2018 CONFIG_SOC_SAMA5D2=y
2119 CONFIG_SOC_SAMA5D3=y
@@ -182,7 +180,6 @@ CONFIG_USB_GADGET=y · 160 unmodified lines
182180 CONFIG_USB_ATMEL_USBA=y
183181 CONFIG_USB_G_SERIAL=y
184182 CONFIG_MMC=y
185−# CONFIG_MMC_BLOCK_BOUNCE is not set
186183 CONFIG_MMC_SDHCI=y
187184 CONFIG_MMC_SDHCI_PLTFM=y
188185 CONFIG_MMC_SDHCI_OF_AT91=y
arch/arm/configs/stm32_defconfig+0−2
@@ -14,8 +14,6 @@ CONFIG_EMBEDDED=y · 13 unmodified lines
1414 # CONFIG_VM_EVENT_COUNTERS is not set
1515 # CONFIG_SLUB_DEBUG is not set
1616 # CONFIG_BLK_DEV_BSG is not set
17−# CONFIG_IOSCHED_DEADLINE is not set
18−# CONFIG_IOSCHED_CFQ is not set
1917 # CONFIG_MMU is not set
2018 CONFIG_ARCH_STM32=y
2119 CONFIG_CPU_V7M_NUM_IRQ=240
arch/arm/configs/sunxi_defconfig+1−0
@@ -85,6 +85,7 @@ CONFIG_BATTERY_AXP20X=y · 84 unmodified lines
8585 CONFIG_AXP20X_POWER=y
8686 CONFIG_THERMAL=y
8787 CONFIG_CPU_THERMAL=y
88+CONFIG_SUN8I_THERMAL=y
8889 CONFIG_WATCHDOG=y
8990 CONFIG_SUNXI_WATCHDOG=y
9091 CONFIG_MFD_AC100=y
arch/arm/configs/u300_defconfig+0−2
@@ -11,7 +11,6 @@ CONFIG_MODULES=y · 10 unmodified lines
1111 CONFIG_MODULE_UNLOAD=y
1212 # CONFIG_BLK_DEV_BSG is not set
1313 CONFIG_PARTITION_ADVANCED=y
14−# CONFIG_IOSCHED_CFQ is not set
1514 # CONFIG_ARCH_MULTI_V7 is not set
1615 CONFIG_ARCH_U300=y
1716 CONFIG_MACH_U300_SPIDUMMY=y
@@ -46,7 +45,6 @@ CONFIG_FB=y · 28 unmodified lines
4645 CONFIG_BACKLIGHT_CLASS_DEVICE=y
4746 # CONFIG_USB_SUPPORT is not set
4847 CONFIG_MMC=y
49−# CONFIG_MMC_BLOCK_BOUNCE is not set
5048 CONFIG_MMC_ARMMMCI=y
5149 CONFIG_RTC_CLASS=y
5250 # CONFIG_RTC_HCTOSYS is not set
arch/arm/configs/vexpress_defconfig+0−2
@@ -15,8 +15,6 @@ CONFIG_OPROFILE=y · 14 unmodified lines
1515 CONFIG_MODULES=y
1616 CONFIG_MODULE_UNLOAD=y
1717 # CONFIG_BLK_DEV_BSG is not set
18−# CONFIG_IOSCHED_DEADLINE is not set
19−# CONFIG_IOSCHED_CFQ is not set
2018 CONFIG_ARCH_VEXPRESS=y
2119 CONFIG_ARCH_VEXPRESS_DCSCB=y
2220 CONFIG_ARCH_VEXPRESS_TC2_PM=y
arch/arm/configs/viper_defconfig+0−1
@@ -9,7 +9,6 @@ CONFIG_SLAB=y · 8 unmodified lines
99 CONFIG_MODULES=y
1010 CONFIG_MODULE_UNLOAD=y
1111 # CONFIG_BLK_DEV_BSG is not set
12−# CONFIG_IOSCHED_CFQ is not set
1312 CONFIG_ARCH_PXA=y
1413 CONFIG_ARCH_VIPER=y
1514 CONFIG_IWMMXT=y
arch/arm/configs/zeus_defconfig+0−2
@@ -4,7 +4,6 @@ CONFIG_LOG_BUF_SHIFT=13 · 3 unmodified lines
44 CONFIG_MODULES=y
55 CONFIG_MODULE_UNLOAD=y
66 # CONFIG_BLK_DEV_BSG is not set
7−# CONFIG_IOSCHED_CFQ is not set
87 CONFIG_ARCH_PXA=y
98 CONFIG_MACH_ARCOM_ZEUS=y
109 CONFIG_PCCARD=m
@@ -137,7 +136,6 @@ CONFIG_USB_MASS_STORAGE=m · 126 unmodified lines
137136 CONFIG_USB_G_SERIAL=m
138137 CONFIG_USB_G_PRINTER=m
139138 CONFIG_MMC=y
140−# CONFIG_MMC_BLOCK_BOUNCE is not set
141139 CONFIG_MMC_PXA=y
142140 CONFIG_NEW_LEDS=y
143141 CONFIG_LEDS_CLASS=m
arch/arm/configs/zx_defconfig+0−1
@@ -16,7 +16,6 @@ CONFIG_EMBEDDED=y · 15 unmodified lines
1616 CONFIG_PERF_EVENTS=y
1717 CONFIG_SLAB=y
1818 # CONFIG_BLK_DEV_BSG is not set
19−# CONFIG_IOSCHED_CFQ is not set
2019 CONFIG_ARCH_ZX=y
2120 CONFIG_SOC_ZX296702=y
2221 # CONFIG_SWP_EMULATE is not set
arch/arm/include/asm/kvm_host.h+0−3
@@ -392,9 +392,6 @@ static inline void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu) {} · 391 unmodified lines
392392 static inline void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) {}
393393 static inline void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu) {}
394394
395−static inline void kvm_arm_vhe_guest_enter(void) {}
396−static inline void kvm_arm_vhe_guest_exit(void) {}
397−
398395 #define KVM_BP_HARDEN_UNKNOWN -1
399396 #define KVM_BP_HARDEN_WA_NEEDED 0
400397 #define KVM_BP_HARDEN_NOT_REQUIRED 1
arch/arm/kernel/ftrace.c+2−5
@@ -78,13 +78,10 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old, · 77 unmodified lines
7878 {
7979 unsigned long replaced;
8080
81− if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) {
81+ if (IS_ENABLED(CONFIG_THUMB2_KERNEL))
8282 old = __opcode_to_mem_thumb32(old);
83− new = __opcode_to_mem_thumb32(new);
84− } else {
83+ else
8584 old = __opcode_to_mem_arm(old);
86− new = __opcode_to_mem_arm(new);
87− }
8885
8986 if (validate) {
9087 if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))
arch/arm/kernel/patch.c+9−10
@@ -16,10 +16,10 @@ struct patch { · 15 unmodified lines
1616 unsigned int insn;
1717 };
1818
19+#ifdef CONFIG_MMU
1920 static DEFINE_RAW_SPINLOCK(patch_lock);
2021
2122 static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
22− __acquires(&patch_lock)
2323 {
2424 unsigned int uintaddr = (uintptr_t) addr;
2525 bool module = !core_kernel_text(uintaddr);
@@ -34,8 +34,6 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) · 8 unmodified lines
3434
3535 if (flags)
3636 raw_spin_lock_irqsave(&patch_lock, *flags);
37− else
38− __acquire(&patch_lock);
3937
4038 set_fixmap(fixmap, page_to_phys(page));
4139
@@ -43,15 +41,19 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) · 1 unmodified line
4341 }
4442
4543 static void __kprobes patch_unmap(int fixmap, unsigned long *flags)
46− __releases(&patch_lock)
4744 {
4845 clear_fixmap(fixmap);
4946
5047 if (flags)
5148 raw_spin_unlock_irqrestore(&patch_lock, *flags);
52− else
53− __release(&patch_lock);
5449 }
50+#else
51+static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
52+{
53+ return addr;
54+}
55+static void __kprobes patch_unmap(int fixmap, unsigned long *flags) { }
56+#endif
5557
5658 void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap)
5759 {
@@ -64,8 +66,6 @@ void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap) · 6 unmodified lines
6466
6567 if (remap)
6668 waddr = patch_map(addr, FIX_TEXT_POKE0, &flags);
67− else
68− __acquire(&patch_lock);
6969
7070 if (thumb2 && __opcode_is_thumb16(insn)) {
7171 *(u16 *)waddr = __opcode_to_mem_thumb16(insn);
@@ -102,8 +102,7 @@ void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap) · 30 unmodified lines
102102 if (waddr != addr) {
103103 flush_kernel_vmap_range(waddr, twopage ? size / 2 : size);
104104 patch_unmap(FIX_TEXT_POKE0, &flags);
105− } else
106− __release(&patch_lock);
105+ }
107106
108107 flush_icache_range((uintptr_t)(addr),
109108 (uintptr_t)(addr) + size);
arch/arm/mach-npcm/Kconfig+1−1
@@ -11,7 +11,7 @@ config ARCH_NPCM7XX · 10 unmodified lines
1111 depends on ARCH_MULTI_V7
1212 select PINCTRL_NPCM7XX
1313 select NPCM7XX_TIMER
14− select ARCH_REQUIRE_GPIOLIB
14+ select GPIOLIB
1515 select CACHE_L2X0
1616 select ARM_GIC
1717 select HAVE_ARM_TWD if SMP
arch/arm64/boot/dts/arm/fvp-base-revc.dts+4−4
@@ -161,10 +161,10 @@ · 160 unmodified lines
161161 bus-range = <0x0 0x1>;
162162 reg = <0x0 0x40000000 0x0 0x10000000>;
163163 ranges = <0x2000000 0x0 0x50000000 0x0 0x50000000 0x0 0x10000000>;
164− interrupt-map = <0 0 0 1 &gic GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>,
165− <0 0 0 2 &gic GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>,
166− <0 0 0 3 &gic GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
167− <0 0 0 4 &gic GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;
164+ interrupt-map = <0 0 0 1 &gic 0 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>,
165+ <0 0 0 2 &gic 0 0 GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>,
166+ <0 0 0 3 &gic 0 0 GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>,
167+ <0 0 0 4 &gic 0 0 GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;
168168 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
169169 msi-map = <0x0 &its 0x0 0x10000>;
170170 iommu-map = <0x0 &smmu 0x0 0x10000>;
arch/arm64/configs/defconfig+3−1
@@ -452,6 +452,7 @@ CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y · 451 unmodified lines
452452 CONFIG_CPU_THERMAL=y
453453 CONFIG_THERMAL_EMULATION=y
454454 CONFIG_QORIQ_THERMAL=m
455+CONFIG_SUN8I_THERMAL=y
455456 CONFIG_ROCKCHIP_THERMAL=m
456457 CONFIG_RCAR_THERMAL=y
457458 CONFIG_RCAR_GEN3_THERMAL=y
@@ -547,6 +548,7 @@ CONFIG_ROCKCHIP_DW_MIPI_DSI=y · 89 unmodified lines
547548 CONFIG_ROCKCHIP_INNO_HDMI=y
548549 CONFIG_DRM_RCAR_DU=m
549550 CONFIG_DRM_SUN4I=m
551+CONFIG_DRM_SUN6I_DSI=m
550552 CONFIG_DRM_SUN8I_DW_HDMI=m
551553 CONFIG_DRM_SUN8I_MIXER=m
552554 CONFIG_DRM_MSM=m
@@ -681,7 +683,7 @@ CONFIG_RTC_DRV_SNVS=m · 128 unmodified lines
681683 CONFIG_RTC_DRV_IMX_SC=m
682684 CONFIG_RTC_DRV_XGENE=y
683685 CONFIG_DMADEVICES=y
684−CONFIG_DMA_BCM2835=m
686+CONFIG_DMA_BCM2835=y
685687 CONFIG_DMA_SUN6I=m
686688 CONFIG_FSL_EDMA=y
687689 CONFIG_IMX_SDMA=y
arch/arm64/include/asm/arch_gicv3.h+1−1
@@ -32,7 +32,7 @@ static inline void gic_write_eoir(u32 irq) · 31 unmodified lines
3232 isb();
3333 }
3434
35−static inline void gic_write_dir(u32 irq)
35+static __always_inline void gic_write_dir(u32 irq)
3636 {
3737 write_sysreg_s(irq, SYS_ICC_DIR_EL1);
3838 isb();
arch/arm64/include/asm/cache.h+1−1
@@ -69,7 +69,7 @@ static inline int icache_is_aliasing(void) · 68 unmodified lines
6969 return test_bit(ICACHEF_ALIASING, &__icache_flags);
7070 }
7171
72−static inline int icache_is_vpipt(void)
72+static __always_inline int icache_is_vpipt(void)
7373 {
7474 return test_bit(ICACHEF_VPIPT, &__icache_flags);
7575 }
arch/arm64/include/asm/cacheflush.h+1−1
@@ -145,7 +145,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *, · 144 unmodified lines
145145 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
146146 extern void flush_dcache_page(struct page *);
147147
148−static inline void __flush_icache_all(void)
148+static __always_inline void __flush_icache_all(void)
149149 {
150150 if (cpus_have_const_cap(ARM64_HAS_CACHE_DIC))
151151 return;
arch/arm64/include/asm/cpufeature.h+5−5
@@ -435,13 +435,13 @@ cpuid_feature_extract_signed_field(u64 features, int field) · 434 unmodified lines
435435 return cpuid_feature_extract_signed_field_width(features, field, 4);
436436 }
437437
438−static inline unsigned int __attribute_const__
438+static __always_inline unsigned int __attribute_const__
439439 cpuid_feature_extract_unsigned_field_width(u64 features, int field, int width)
440440 {
441441 return (u64)(features << (64 - width - field)) >> (64 - width);
442442 }
443443
444−static inline unsigned int __attribute_const__
444+static __always_inline unsigned int __attribute_const__
445445 cpuid_feature_extract_unsigned_field(u64 features, int field)
446446 {
447447 return cpuid_feature_extract_unsigned_field_width(features, field, 4);
@@ -564,7 +564,7 @@ static inline bool system_supports_mixed_endian(void) · 116 unmodified lines
564564 return val == 0x1;
565565 }
566566
567−static inline bool system_supports_fpsimd(void)
567+static __always_inline bool system_supports_fpsimd(void)
568568 {
569569 return !cpus_have_const_cap(ARM64_HAS_NO_FPSIMD);
570570 }
@@ -575,13 +575,13 @@ static inline bool system_uses_ttbr0_pan(void) · 4 unmodified lines
575575 !cpus_have_const_cap(ARM64_HAS_PAN);
576576 }
577577
578−static inline bool system_supports_sve(void)
578+static __always_inline bool system_supports_sve(void)
579579 {
580580 return IS_ENABLED(CONFIG_ARM64_SVE) &&
581581 cpus_have_const_cap(ARM64_SVE);
582582 }
583583
584−static inline bool system_supports_cnp(void)
584+static __always_inline bool system_supports_cnp(void)
585585 {
586586 return IS_ENABLED(CONFIG_ARM64_CNP) &&
587587 cpus_have_const_cap(ARM64_HAS_CNP);
arch/arm64/include/asm/exception.h+0−4
@@ -33,7 +33,6 @@ static inline u32 disr_to_esr(u64 disr) · 32 unmodified lines
3333
3434 asmlinkage void enter_from_user_mode(void);
3535 void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
36−void do_sp_pc_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
3736 void do_undefinstr(struct pt_regs *regs);
3837 asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr);
3938 void do_debug_exception(unsigned long addr_if_watchpoint, unsigned int esr,
@@ -47,7 +46,4 @@ void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr); · 7 unmodified lines
4746 void do_cp15instr(unsigned int esr, struct pt_regs *regs);
4847 void do_el0_svc(struct pt_regs *regs);
4948 void do_el0_svc_compat(struct pt_regs *regs);
50−void do_el0_ia_bp_hardening(unsigned long addr, unsigned int esr,
51− struct pt_regs *regs);
52−
5349 #endif /* __ASM_EXCEPTION_H */
arch/arm64/include/asm/io.h+2−2
@@ -34,7 +34,7 @@ static inline void __raw_writew(u16 val, volatile void __iomem *addr) · 33 unmodified lines
3434 }
3535
3636 #define __raw_writel __raw_writel
37−static inline void __raw_writel(u32 val, volatile void __iomem *addr)
37+static __always_inline void __raw_writel(u32 val, volatile void __iomem *addr)
3838 {
3939 asm volatile("str %w0, [%1]" : : "rZ" (val), "r" (addr));
4040 }
@@ -69,7 +69,7 @@ static inline u16 __raw_readw(const volatile void __iomem *addr) · 28 unmodified lines
6969 }
7070
7171 #define __raw_readl __raw_readl
72−static inline u32 __raw_readl(const volatile void __iomem *addr)
72+static __always_inline u32 __raw_readl(const volatile void __iomem *addr)
7373 {
7474 u32 val;
7575 asm volatile(ALTERNATIVE("ldr %w0, [%1]",
arch/arm64/include/asm/kvm_emulate.h+24−24
@@ -36,7 +36,7 @@ void kvm_inject_undef32(struct kvm_vcpu *vcpu); · 35 unmodified lines
3636 void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr);
3737 void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr);
3838
39−static inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu)
39+static __always_inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu)
4040 {
4141 return !(vcpu->arch.hcr_el2 & HCR_RW);
4242 }
@@ -127,7 +127,7 @@ static inline void vcpu_set_vsesr(struct kvm_vcpu *vcpu, u64 vsesr) · 84 unmodified lines
127127 vcpu->arch.vsesr_el2 = vsesr;
128128 }
129129
130−static inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu)
130+static __always_inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu)
131131 {
132132 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pc;
133133 }
@@ -153,17 +153,17 @@ static inline void vcpu_write_elr_el1(const struct kvm_vcpu *vcpu, unsigned long · 19 unmodified lines
153153 *__vcpu_elr_el1(vcpu) = v;
154154 }
155155
156−static inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu)
156+static __always_inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu)
157157 {
158158 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pstate;
159159 }
160160
161−static inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu)
161+static __always_inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu)
162162 {
163163 return !!(*vcpu_cpsr(vcpu) & PSR_MODE32_BIT);
164164 }
165165
166−static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu)
166+static __always_inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu)
167167 {
168168 if (vcpu_mode_is_32bit(vcpu))
169169 return kvm_condition_valid32(vcpu);
@@ -181,13 +181,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu) · 11 unmodified lines
181181 * coming from a read of ESR_EL2. Otherwise, it may give the wrong result on
182182 * AArch32 with banked registers.
183183 */
184−static inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu,
184+static __always_inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu,
185185 u8 reg_num)
186186 {
187187 return (reg_num == 31) ? 0 : vcpu_gp_regs(vcpu)->regs.regs[reg_num];
188188 }
189189
190−static inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num,
190+static __always_inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num,
191191 unsigned long val)
192192 {
193193 if (reg_num != 31)
@@ -264,12 +264,12 @@ static inline bool vcpu_mode_priv(const struct kvm_vcpu *vcpu) · 70 unmodified lines
264264 return mode != PSR_MODE_EL0t;
265265 }
266266
267−static inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu)
267+static __always_inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu)
268268 {
269269 return vcpu->arch.fault.esr_el2;
270270 }
271271
272−static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu)
272+static __always_inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu)
273273 {
274274 u32 esr = kvm_vcpu_get_hsr(vcpu);
275275
@@ -279,12 +279,12 @@ static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) · 3 unmodified lines
279279 return -1;
280280 }
281281
282−static inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu)
282+static __always_inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu)
283283 {
284284 return vcpu->arch.fault.far_el2;
285285 }
286286
287−static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
287+static __always_inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
288288 {
289289 return ((phys_addr_t)vcpu->arch.fault.hpfar_el2 & HPFAR_MASK) << 8;
290290 }
@@ -299,7 +299,7 @@ static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu) · 8 unmodified lines
299299 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
300300 }
301301
302−static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
302+static __always_inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
303303 {
304304 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
305305 }
@@ -319,17 +319,17 @@ static inline bool kvm_vcpu_dabt_issf(const struct kvm_vcpu *vcpu) · 13 unmodified lines
319319 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SF);
320320 }
321321
322−static inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
322+static __always_inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
323323 {
324324 return (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT;
325325 }
326326
327−static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
327+static __always_inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
328328 {
329329 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
330330 }
331331
332−static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
332+static __always_inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
333333 {
334334 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||
335335 kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */
@@ -340,18 +340,18 @@ static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu) · 4 unmodified lines
340340 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);
341341 }
342342
343−static inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)
343+static __always_inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)
344344 {
345345 return 1 << ((kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SAS) >> ESR_ELx_SAS_SHIFT);
346346 }
347347
348348 /* This one is not specific to Data Abort */
349−static inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu)
349+static __always_inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu)
350350 {
351351 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_IL);
352352 }
353353
354−static inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu)
354+static __always_inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu)
355355 {
356356 return ESR_ELx_EC(kvm_vcpu_get_hsr(vcpu));
357357 }
@@ -361,17 +361,17 @@ static inline bool kvm_vcpu_trap_is_iabt(const struct kvm_vcpu *vcpu) · 3 unmodified lines
361361 return kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_IABT_LOW;
362362 }
363363
364−static inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)
364+static __always_inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)
365365 {
366366 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC;
367367 }
368368
369−static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
369+static __always_inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
370370 {
371371 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC_TYPE;
372372 }
373373
374−static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
374+static __always_inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
375375 {
376376 switch (kvm_vcpu_trap_get_fault(vcpu)) {
377377 case FSC_SEA:
@@ -390,7 +390,7 @@ static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) · 12 unmodified lines
390390 }
391391 }
392392
393−static inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)
393+static __always_inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)
394394 {
395395 u32 esr = kvm_vcpu_get_hsr(vcpu);
396396 return ESR_ELx_SYS64_ISS_RT(esr);
@@ -504,7 +504,7 @@ static inline unsigned long vcpu_data_host_to_guest(struct kvm_vcpu *vcpu, · 107 unmodified lines
504504 return data; /* Leave LE untouched */
505505 }
506506
507−static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)
507+static __always_inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)
508508 {
509509 if (vcpu_mode_is_32bit(vcpu))
510510 kvm_skip_instr32(vcpu, is_wide_instr);
@@ -519,7 +519,7 @@ static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr) · 8 unmodified lines
519519 * Skip an instruction which has been emulated at hyp while most guest sysregs
520520 * are live.
521521 */
522−static inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu)
522+static __always_inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu)
523523 {
524524 *vcpu_pc(vcpu) = read_sysreg_el2(SYS_ELR);
525525 vcpu->arch.ctxt.gp_regs.regs.pstate = read_sysreg_el2(SYS_SPSR);
arch/arm64/include/asm/kvm_host.h+0−32
@@ -626,38 +626,6 @@ static inline void kvm_set_pmu_events(u32 set, struct perf_event_attr *attr) {} · 625 unmodified lines
626626 static inline void kvm_clr_pmu_events(u32 clr) {}
627627 #endif
628628
629−static inline void kvm_arm_vhe_guest_enter(void)
630−{
631− local_daif_mask();
632−
633− /*
634− * Having IRQs masked via PMR when entering the guest means the GIC
635− * will not signal the CPU of interrupts of lower priority, and the
636− * only way to get out will be via guest exceptions.
637− * Naturally, we want to avoid this.
638− *
639− * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a
640− * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU.
641− */
642− pmr_sync();
643−}
644−
645−static inline void kvm_arm_vhe_guest_exit(void)
646−{
647− /*
648− * local_daif_restore() takes care to properly restore PSTATE.DAIF
649− * and the GIC PMR if the host is using IRQ priorities.
650− */
651− local_daif_restore(DAIF_PROCCTX_NOIRQ);
652−
653− /*
654− * When we exit from the guest we change a number of CPU configuration
655− * parameters, such as traps. Make sure these changes take effect
656− * before running the host or additional guests.
657− */
658− isb();
659−}
660−
661629 #define KVM_BP_HARDEN_UNKNOWN -1
662630 #define KVM_BP_HARDEN_WA_NEEDED 0
663631 #define KVM_BP_HARDEN_NOT_REQUIRED 1
arch/arm64/include/asm/kvm_hyp.h+7−0
@@ -47,6 +47,13 @@ · 46 unmodified lines
4747 #define read_sysreg_el2(r) read_sysreg_elx(r, _EL2, _EL1)
4848 #define write_sysreg_el2(v,r) write_sysreg_elx(v, r, _EL2, _EL1)
4949
50+/*
51+ * Without an __arch_swab32(), we fall back to ___constant_swab32(), but the
52+ * static inline can allow the compiler to out-of-line this. KVM always wants
53+ * the macro version as its always inlined.
54+ */
55+#define __kvm_swab32(x) ___constant_swab32(x)
56+
5057 int __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu);
5158
5259 void __vgic_v3_save_state(struct kvm_vcpu *vcpu);
arch/arm64/include/asm/kvm_mmu.h+2−1
@@ -93,7 +93,7 @@ void kvm_update_va_mask(struct alt_instr *alt, · 92 unmodified lines
9393 __le32 *origptr, __le32 *updptr, int nr_inst);
9494 void kvm_compute_layout(void);
9595
96−static inline unsigned long __kern_hyp_va(unsigned long v)
96+static __always_inline unsigned long __kern_hyp_va(unsigned long v)
9797 {
9898 asm volatile(ALTERNATIVE_CB("and %0, %0, #1\n"
9999 "ror %0, %0, #1\n"
@@ -473,6 +473,7 @@ static inline int kvm_write_guest_lock(struct kvm *kvm, gpa_t gpa, · 373 unmodified lines
473473 extern void *__kvm_bp_vect_base;
474474 extern int __kvm_harden_el2_vector_slot;
475475
476+/* This is only called on a VHE system */
476477 static inline void *kvm_get_hyp_vector(void)
477478 {
478479 struct bp_hardening_data *data = arm64_get_bp_hardening_data();
arch/arm64/include/asm/lse.h+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66
77 #ifdef CONFIG_ARM64_LSE_ATOMICS
88
9−#define __LSE_PREAMBLE ".arch armv8-a+lse\n"
9+#define __LSE_PREAMBLE ".arch_extension lse\n"
1010
1111 #include <linux/compiler_types.h>
1212 #include <linux/export.h>
arch/arm64/include/asm/memory.h+1−1
@@ -213,7 +213,7 @@ static inline unsigned long kaslr_offset(void) · 212 unmodified lines
213213 ((__force __typeof__(addr))sign_extend64((__force u64)(addr), 55))
214214
215215 #define untagged_addr(addr) ({ \
216− u64 __addr = (__force u64)addr; \
216+ u64 __addr = (__force u64)(addr); \
217217 __addr &= __untagged_addr(__addr); \
218218 (__force __typeof__(addr))__addr; \
219219 })
arch/arm64/include/asm/spinlock.h+5−1
@@ -18,6 +18,10 @@ · 17 unmodified lines
1818 * See:
1919 * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net
2020 */
21−#define vcpu_is_preempted(cpu) false
21+#define vcpu_is_preempted vcpu_is_preempted
22+static inline bool vcpu_is_preempted(int cpu)
23+{
24+ return false;
25+}
2226
2327 #endif /* __ASM_SPINLOCK_H */
arch/arm64/include/asm/virt.h+1−1
@@ -83,7 +83,7 @@ static inline bool is_kernel_in_hyp_mode(void) · 82 unmodified lines
8383 return read_sysreg(CurrentEL) == CurrentEL_EL2;
8484 }
8585
86−static inline bool has_vhe(void)
86+static __always_inline bool has_vhe(void)
8787 {
8888 if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
8989 return true;
arch/arm64/kernel/kaslr.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/sched.h>
1212 #include <linux/types.h>
1313
14+#include <asm/archrandom.h>
1415 #include <asm/cacheflush.h>
1516 #include <asm/fixmap.h>
1617 #include <asm/kernel-pgtable.h>
arch/arm64/kernel/process.c+9−4
@@ -466,6 +466,13 @@ static void ssbs_thread_switch(struct task_struct *next) · 465 unmodified lines
466466 if (unlikely(next->flags & PF_KTHREAD))
467467 return;
468468
469+ /*
470+ * If all CPUs implement the SSBS extension, then we just need to
471+ * context-switch the PSTATE field.
472+ */
473+ if (cpu_have_feature(cpu_feature(SSBS)))
474+ return;
475+
469476 /* If the mitigation is enabled, then we leave SSBS clear. */
470477 if ((arm64_get_ssbd_state() == ARM64_SSBD_FORCE_ENABLE) ||
471478 test_tsk_thread_flag(next, TIF_SSBD))
@@ -608,8 +615,6 @@ long get_tagged_addr_ctrl(void) · 136 unmodified lines
608615 * only prevents the tagged address ABI enabling via prctl() and does not
609616 * disable it for tasks that already opted in to the relaxed ABI.
610617 */
611−static int zero;
612−static int one = 1;
613618
614619 static struct ctl_table tagged_addr_sysctl_table[] = {
615620 {
@@ -618,8 +623,8 @@ static struct ctl_table tagged_addr_sysctl_table[] = { · 2 unmodified lines
618623 .data = &tagged_addr_disabled,
619624 .maxlen = sizeof(int),
620625 .proc_handler = proc_dointvec_minmax,
621− .extra1 = &zero,
622− .extra2 = &one,
626+ .extra1 = SYSCTL_ZERO,
627+ .extra2 = SYSCTL_ONE,
623628 },
624629 { }
625630 };
arch/arm64/kernel/time.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include <linux/irq.h>
2424 #include <linux/delay.h>
2525 #include <linux/clocksource.h>
26−#include <linux/clk-provider.h>
26+#include <linux/of_clk.h>
2727 #include <linux/acpi.h>
2828
2929 #include <clocksource/arm_arch_timer.h>
arch/arm64/kvm/hyp/switch.c+37−2
@@ -625,7 +625,7 @@ static void __hyp_text __pmu_switch_to_host(struct kvm_cpu_context *host_ctxt) · 624 unmodified lines
625625 }
626626
627627 /* Switch to the guest for VHE systems running in EL2 */
628−int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
628+static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
629629 {
630630 struct kvm_cpu_context *host_ctxt;
631631 struct kvm_cpu_context *guest_ctxt;
@@ -678,7 +678,42 @@ int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) · 46 unmodified lines
678678
679679 return exit_code;
680680 }
681−NOKPROBE_SYMBOL(kvm_vcpu_run_vhe);
681+NOKPROBE_SYMBOL(__kvm_vcpu_run_vhe);
682+
683+int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
684+{
685+ int ret;
686+
687+ local_daif_mask();
688+
689+ /*
690+ * Having IRQs masked via PMR when entering the guest means the GIC
691+ * will not signal the CPU of interrupts of lower priority, and the
692+ * only way to get out will be via guest exceptions.
693+ * Naturally, we want to avoid this.
694+ *
695+ * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a
696+ * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU.
697+ */
698+ pmr_sync();
699+
700+ ret = __kvm_vcpu_run_vhe(vcpu);
701+
702+ /*
703+ * local_daif_restore() takes care to properly restore PSTATE.DAIF
704+ * and the GIC PMR if the host is using IRQ priorities.
705+ */
706+ local_daif_restore(DAIF_PROCCTX_NOIRQ);
707+
708+ /*
709+ * When we exit from the guest we change a number of CPU configuration
710+ * parameters, such as traps. Make sure these changes take effect
711+ * before running the host or additional guests.
712+ */
713+ isb();
714+
715+ return ret;
716+}
682717
683718 /* Switch to the guest for legacy non-VHE systems */
684719 int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)
arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c+2−2
@@ -69,14 +69,14 @@ int __hyp_text __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu) · 68 unmodified lines
6969 u32 data = vcpu_get_reg(vcpu, rd);
7070 if (__is_be(vcpu)) {
7171 /* guest pre-swabbed data, undo this for writel() */
72− data = swab32(data);
72+ data = __kvm_swab32(data);
7373 }
7474 writel_relaxed(data, addr);
7575 } else {
7676 u32 data = readl_relaxed(addr);
7777 if (__is_be(vcpu)) {
7878 /* guest expects swabbed data */
79− data = swab32(data);
79+ data = __kvm_swab32(data);
8080 }
8181 vcpu_set_reg(vcpu, rd, data);
8282 }
arch/csky/Kconfig+48−3
@@ -9,7 +9,6 @@ config CSKY · 8 unmodified lines
99 select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2
1010 select COMMON_CLK
1111 select CLKSRC_MMIO
12− select CLKSRC_OF
1312 select CSKY_MPINTC if CPU_CK860
1413 select CSKY_MP_TIMER if CPU_CK860
1514 select CSKY_APB_INTC
@@ -37,6 +36,7 @@ config CSKY · 21 unmodified lines
3736 select GX6605S_TIMER if CPU_CK610
3837 select HAVE_ARCH_TRACEHOOK
3938 select HAVE_ARCH_AUDITSYSCALL
39+ select HAVE_COPY_THREAD_TLS
4040 select HAVE_DYNAMIC_FTRACE
4141 select HAVE_FUNCTION_TRACER
4242 select HAVE_FUNCTION_GRAPH_TRACER
@@ -47,8 +47,8 @@ config CSKY · 4 unmodified lines
4747 select HAVE_PERF_EVENTS
4848 select HAVE_PERF_REGS
4949 select HAVE_PERF_USER_STACK_DUMP
50− select HAVE_DMA_API_DEBUG
5150 select HAVE_DMA_CONTIGUOUS
51+ select HAVE_STACKPROTECTOR
5252 select HAVE_SYSCALL_TRACEPOINTS
5353 select MAY_HAVE_SPARSE_IRQ
5454 select MODULES_USE_ELF_RELA if MODULES
@@ -59,6 +59,11 @@ config CSKY · 4 unmodified lines
5959 select TIMER_OF
6060 select USB_ARCH_HAS_EHCI
6161 select USB_ARCH_HAS_OHCI
62+ select GENERIC_PCI_IOMAP
63+ select HAVE_PCI
64+ select PCI_DOMAINS_GENERIC if PCI
65+ select PCI_SYSCALL if PCI
66+ select PCI_MSI if PCI
6267
6368 config CPU_HAS_CACHEV2
6469 bool
@@ -75,7 +80,7 @@ config CPU_HAS_TLBI · 10 unmodified lines
7580 config CPU_HAS_LDSTEX
7681 bool
7782 help
78− For SMP, CPU needs "ldex&stex" instrcutions to atomic operations.
83+ For SMP, CPU needs "ldex&stex" instructions for atomic operations.
7984
8085 config CPU_NEED_TLBSYNC
8186 bool
@@ -188,6 +193,40 @@ config CPU_PM_STOP · 106 unmodified lines
188193 bool "stop"
189194 endchoice
190195
196+menuconfig HAVE_TCM
197+ bool "Tightly-Coupled/Sram Memory"
198+ select GENERIC_ALLOCATOR
199+ help
200+ The implementation are not only used by TCM (Tightly-Coupled Meory)
201+ but also used by sram on SOC bus. It follow existed linux tcm
202+ software interface, so that old tcm application codes could be
203+ re-used directly.
204+
205+if HAVE_TCM
206+config ITCM_RAM_BASE
207+ hex "ITCM ram base"
208+ default 0xffffffff
209+
210+config ITCM_NR_PAGES
211+ int "Page count of ITCM size: NR*4KB"
212+ range 1 256
213+ default 32
214+
215+config HAVE_DTCM
216+ bool "DTCM Support"
217+
218+config DTCM_RAM_BASE
219+ hex "DTCM ram base"
220+ depends on HAVE_DTCM
221+ default 0xffffffff
222+
223+config DTCM_NR_PAGES
224+ int "Page count of DTCM size: NR*4KB"
225+ depends on HAVE_DTCM
226+ range 1 256
227+ default 32
228+endif
229+
191230 config CPU_HAS_VDSP
192231 bool "CPU has VDSP coprocessor"
193232 depends on CPU_HAS_FPU && CPU_HAS_FPUV2
@@ -196,6 +235,10 @@ config CPU_HAS_FPU · 2 unmodified lines
196235 bool "CPU has FPU coprocessor"
197236 depends on CPU_CK807 || CPU_CK810 || CPU_CK860
198237
238+config CPU_HAS_ICACHE_INS
239+ bool "CPU has Icache invalidate instructions"
240+ depends on CPU_HAS_CACHEV2
241+
199242 config CPU_HAS_TEE
200243 bool "CPU has Trusted Execution Environment"
201244 depends on CPU_CK810
@@ -235,4 +278,6 @@ config HOTPLUG_CPU · 33 unmodified lines
235278 Say N if you want to disable CPU hotplug.
236279 endmenu
237280
281+source "arch/csky/Kconfig.platforms"
282+
238283 source "kernel/Kconfig.hz"
arch/csky/Kconfig.platforms+9−0
@@ -0,0 +1,9 @@
1+menu "Platform drivers selection"
2+
3+config ARCH_CSKY_DW_APB_ICTL
4+ bool "Select dw-apb interrupt controller"
5+ select DW_APB_ICTL
6+ default y
7+ help
8+ This enables support for snps dw-apb-ictl
9+endmenu
arch/csky/abiv1/inc/abi/cacheflush.h+2−3
@@ -48,9 +48,8 @@ extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, u · 47 unmodified lines
4848
4949 #define flush_icache_page(vma, page) do {} while (0);
5050 #define flush_icache_range(start, end) cache_wbinv_range(start, end)
51−
52−#define flush_icache_user_range(vma,page,addr,len) \
53− flush_dcache_page(page)
51+#define flush_icache_mm_range(mm, start, end) cache_wbinv_range(start, end)
52+#define flush_icache_deferred(mm) do {} while (0);
5453
5554 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
5655 do { \
arch/csky/abiv1/inc/abi/entry.h+14−5
@@ -16,14 +16,16 @@ · 15 unmodified lines
1616 #define LSAVE_A4 40
1717 #define LSAVE_A5 44
1818
19+#define usp ss1
20+
1921 .macro USPTOKSP
20− mtcr sp, ss1
22+ mtcr sp, usp
2123 mfcr sp, ss0
2224 .endm
2325
2426 .macro KSPTOUSP
2527 mtcr sp, ss0
26− mfcr sp, ss1
28+ mfcr sp, usp
2729 .endm
2830
2931 .macro SAVE_ALL epc_inc
@@ -45,7 +47,13 @@ · 15 unmodified lines
4547 add lr, r13
4648 stw lr, (sp, 8)
4749
50+ mov lr, sp
51+ addi lr, 32
52+ addi lr, 32
53+ addi lr, 16
54+ bt 2f
4855 mfcr lr, ss1
56+2:
4957 stw lr, (sp, 16)
5058
5159 stw a0, (sp, 20)
@@ -79,9 +87,10 @@ · 27 unmodified lines
7987 ldw a0, (sp, 12)
8088 mtcr a0, epsr
8189 btsti a0, 31
90+ bt 1f
8291 ldw a0, (sp, 16)
8392 mtcr a0, ss1
84−
93+1:
8594 ldw a0, (sp, 24)
8695 ldw a1, (sp, 28)
8796 ldw a2, (sp, 32)
@@ -102,9 +111,9 @@ · 14 unmodified lines
102111 addi sp, 32
103112 addi sp, 8
104113
105− bt 1f
114+ bt 2f
106115 KSPTOUSP
107−1:
116+2:
108117 rte
109118 .endm
110119
arch/csky/abiv2/cacheflush.c+59−25
@@ -6,46 +6,80 @@ · 5 unmodified lines
66 #include <linux/mm.h>
77 #include <asm/cache.h>
88
9−void flush_icache_page(struct vm_area_struct *vma, struct page *page)
9+void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
10+ pte_t *pte)
1011 {
11− unsigned long start;
12+ unsigned long addr;
13+ struct page *page;
1214
13− start = (unsigned long) kmap_atomic(page);
15+ page = pfn_to_page(pte_pfn(*pte));
16+ if (page == ZERO_PAGE(0))
17+ return;
1418
15− cache_wbinv_range(start, start + PAGE_SIZE);
19+ if (test_and_set_bit(PG_dcache_clean, &page->flags))
20+ return;
1621
17− kunmap_atomic((void *)start);
18−}
22+ addr = (unsigned long) kmap_atomic(page);
1923
20−void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
21− unsigned long vaddr, int len)
22−{
23− unsigned long kaddr;
24+ dcache_wb_range(addr, addr + PAGE_SIZE);
2425
25− kaddr = (unsigned long) kmap_atomic(page) + (vaddr & ~PAGE_MASK);
26+ if (vma->vm_flags & VM_EXEC)
27+ icache_inv_range(addr, addr + PAGE_SIZE);
28+
29+ kunmap_atomic((void *) addr);
30+}
2631
27− cache_wbinv_range(kaddr, kaddr + len);
32+void flush_icache_deferred(struct mm_struct *mm)
33+{
34+ unsigned int cpu = smp_processor_id();
35+ cpumask_t *mask = &mm->context.icache_stale_mask;
2836
29− kunmap_atomic((void *)kaddr);
37+ if (cpumask_test_cpu(cpu, mask)) {
38+ cpumask_clear_cpu(cpu, mask);
39+ /*
40+ * Ensure the remote hart's writes are visible to this hart.
41+ * This pairs with a barrier in flush_icache_mm.
42+ */
43+ smp_mb();
44+ local_icache_inv_all(NULL);
45+ }
3046 }
3147
32−void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
33− pte_t *pte)
48+void flush_icache_mm_range(struct mm_struct *mm,
49+ unsigned long start, unsigned long end)
3450 {
35− unsigned long addr, pfn;
36− struct page *page;
51+ unsigned int cpu;
52+ cpumask_t others, *mask;
3753
38− pfn = pte_pfn(*pte);
39− if (unlikely(!pfn_valid(pfn)))
40− return;
54+ preempt_disable();
4155
42− page = pfn_to_page(pfn);
43− if (page == ZERO_PAGE(0))
56+#ifdef CONFIG_CPU_HAS_ICACHE_INS
57+ if (mm == current->mm) {
58+ icache_inv_range(start, end);
59+ preempt_enable();
4460 return;
61+ }
62+#endif
4563
46− addr = (unsigned long) kmap_atomic(page);
64+ /* Mark every hart's icache as needing a flush for this MM. */
65+ mask = &mm->context.icache_stale_mask;
66+ cpumask_setall(mask);
4767
48− cache_wbinv_range(addr, addr + PAGE_SIZE);
68+ /* Flush this hart's I$ now, and mark it as flushed. */
69+ cpu = smp_processor_id();
70+ cpumask_clear_cpu(cpu, mask);
71+ local_icache_inv_all(NULL);
4972
50− kunmap_atomic((void *) addr);
73+ /*
74+ * Flush the I$ of other harts concurrently executing, and mark them as
75+ * flushed.
76+ */
77+ cpumask_andnot(&others, mm_cpumask(mm), cpumask_of(cpu));
78+
79+ if (mm != current->active_mm || !cpumask_empty(&others)) {
80+ on_each_cpu_mask(&others, local_icache_inv_all, NULL, 1);
81+ cpumask_clear(mask);
82+ }
83+
84+ preempt_enable();
5185 }
arch/csky/abiv2/inc/abi/cacheflush.h+21−12
@@ -13,24 +13,27 @@ · 12 unmodified lines
1313 #define flush_cache_all() do { } while (0)
1414 #define flush_cache_mm(mm) do { } while (0)
1515 #define flush_cache_dup_mm(mm) do { } while (0)
16+#define flush_cache_range(vma, start, end) do { } while (0)
17+#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
1618
17−#define flush_cache_range(vma, start, end) \
18− do { \
19− if (vma->vm_flags & VM_EXEC) \
20− icache_inv_all(); \
21− } while (0)
19+#define PG_dcache_clean PG_arch_1
20+
21+#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
22+static inline void flush_dcache_page(struct page *page)
23+{
24+ if (test_bit(PG_dcache_clean, &page->flags))
25+ clear_bit(PG_dcache_clean, &page->flags);
26+}
2227
23−#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
24−#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
25−#define flush_dcache_page(page) do { } while (0)
2628 #define flush_dcache_mmap_lock(mapping) do { } while (0)
2729 #define flush_dcache_mmap_unlock(mapping) do { } while (0)
30+#define flush_icache_page(vma, page) do { } while (0)
2831
2932 #define flush_icache_range(start, end) cache_wbinv_range(start, end)
3033
31−void flush_icache_page(struct vm_area_struct *vma, struct page *page);
32−void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
33− unsigned long vaddr, int len);
34+void flush_icache_mm_range(struct mm_struct *mm,
35+ unsigned long start, unsigned long end);
36+void flush_icache_deferred(struct mm_struct *mm);
3437
3538 #define flush_cache_vmap(start, end) do { } while (0)
3639 #define flush_cache_vunmap(start, end) do { } while (0)
@@ -38,7 +41,13 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, · 1 unmodified line
3841 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
3942 do { \
4043 memcpy(dst, src, len); \
41− cache_wbinv_range((unsigned long)dst, (unsigned long)dst + len); \
44+ if (vma->vm_flags & VM_EXEC) { \
45+ dcache_wb_range((unsigned long)dst, \
46+ (unsigned long)dst + len); \
47+ flush_icache_mm_range(current->mm, \
48+ (unsigned long)dst, \
49+ (unsigned long)dst + len); \
50+ } \
4251 } while (0)
4352 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
4453 memcpy(dst, src, len)
arch/csky/abiv2/inc/abi/entry.h+11−0
@@ -31,7 +31,13 @@ · 30 unmodified lines
3131
3232 mfcr lr, epsr
3333 stw lr, (sp, 12)
34+ btsti lr, 31
35+ bf 1f
36+ addi lr, sp, 152
37+ br 2f
38+1:
3439 mfcr lr, usp
40+2:
3541 stw lr, (sp, 16)
3642
3743 stw a0, (sp, 20)
@@ -64,8 +70,10 @@ · 26 unmodified lines
6470 mtcr a0, epc
6571 ldw a0, (sp, 12)
6672 mtcr a0, epsr
73+ btsti a0, 31
6774 ldw a0, (sp, 16)
6875 mtcr a0, usp
76+ mtcr a0, ss0
6977
7078 #ifdef CONFIG_CPU_HAS_HILO
7179 ldw a0, (sp, 140)
@@ -86,6 +94,9 @@ · 14 unmodified lines
8694 addi sp, 40
8795 ldm r16-r30, (sp)
8896 addi sp, 72
97+ bf 1f
98+ mfcr sp, ss0
99+1:
89100 rte
90101 .endm
91102
arch/csky/configs/defconfig+0−8
@@ -10,9 +10,6 @@ CONFIG_BSD_PROCESS_ACCT=y · 9 unmodified lines
1010 CONFIG_BSD_PROCESS_ACCT_V3=y
1111 CONFIG_MODULES=y
1212 CONFIG_MODULE_UNLOAD=y
13−CONFIG_DEFAULT_DEADLINE=y
14−CONFIG_CPU_CK807=y
15−CONFIG_CPU_HAS_FPU=y
1613 CONFIG_NET=y
1714 CONFIG_PACKET=y
1815 CONFIG_UNIX=y
@@ -27,10 +24,7 @@ CONFIG_SERIAL_NONSTANDARD=y · 8 unmodified lines
2724 CONFIG_SERIAL_8250=y
2825 CONFIG_SERIAL_8250_CONSOLE=y
2926 CONFIG_SERIAL_OF_PLATFORM=y
30−CONFIG_TTY_PRINTK=y
3127 # CONFIG_VGA_CONSOLE is not set
32−CONFIG_CSKY_MPTIMER=y
33−CONFIG_GX6605S_TIMER=y
3428 CONFIG_PM_DEVFREQ=y
3529 CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
3630 CONFIG_DEVFREQ_GOV_PERFORMANCE=y
@@ -56,6 +50,4 @@ CONFIG_CRAMFS=y · 19 unmodified lines
5650 CONFIG_ROMFS_FS=y
5751 CONFIG_NFS_FS=y
5852 CONFIG_PRINTK_TIME=y
59−CONFIG_DEBUG_INFO=y
60−CONFIG_DEBUG_FS=y
6153 CONFIG_MAGIC_SYSRQ=y
arch/csky/include/asm/Kbuild+0−1
@@ -28,7 +28,6 @@ generic-y += local64.h · 27 unmodified lines
2828 generic-y += mm-arch-hooks.h
2929 generic-y += mmiowb.h
3030 generic-y += module.h
31−generic-y += pci.h
3231 generic-y += percpu.h
3332 generic-y += preempt.h
3433 generic-y += qrwlock.h
arch/csky/include/asm/cache.h+1−0
@@ -16,6 +16,7 @@ void dcache_wb_line(unsigned long start); · 15 unmodified lines
1616
1717 void icache_inv_range(unsigned long start, unsigned long end);
1818 void icache_inv_all(void);
19+void local_icache_inv_all(void *priv);
1920
2021 void dcache_wb_range(unsigned long start, unsigned long end);
2122 void dcache_wbinv_all(void);
arch/csky/include/asm/cacheflush.h+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 #ifndef __ASM_CSKY_CACHEFLUSH_H
55 #define __ASM_CSKY_CACHEFLUSH_H
66
7+#include <linux/mm.h>
78 #include <abi/cacheflush.h>
89
910 #endif /* __ASM_CSKY_CACHEFLUSH_H */
arch/csky/include/asm/fixmap.h+8−1
@@ -5,12 +5,16 @@ · 4 unmodified lines
55 #define __ASM_CSKY_FIXMAP_H
66
77 #include <asm/page.h>
8+#include <asm/memory.h>
89 #ifdef CONFIG_HIGHMEM
910 #include <linux/threads.h>
1011 #include <asm/kmap_types.h>
1112 #endif
1213
1314 enum fixed_addresses {
15+#ifdef CONFIG_HAVE_TCM
16+ FIX_TCM = TCM_NR_PAGES,
17+#endif
1418 #ifdef CONFIG_HIGHMEM
1519 FIX_KMAP_BEGIN,
1620 FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
@@ -18,10 +22,13 @@ enum fixed_addresses { · 1 unmodified line
1822 __end_of_fixed_addresses
1923 };
2024
21−#define FIXADDR_TOP 0xffffc000
2225 #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
2326 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
2427
2528 #include <asm-generic/fixmap.h>
2629
30+extern void fixrange_init(unsigned long start, unsigned long end,
31+ pgd_t *pgd_base);
32+extern void __init fixaddr_init(void);
33+
2734 #endif /* __ASM_CSKY_FIXMAP_H */
arch/csky/include/asm/memory.h+25−0
@@ -0,0 +1,25 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef __ASM_CSKY_MEMORY_H
4+#define __ASM_CSKY_MEMORY_H
5+
6+#include <linux/compiler.h>
7+#include <linux/const.h>
8+#include <linux/types.h>
9+#include <linux/sizes.h>
10+
11+#define FIXADDR_TOP _AC(0xffffc000, UL)
12+#define PKMAP_BASE _AC(0xff800000, UL)
13+#define VMALLOC_START _AC(0xc0008000, UL)
14+#define VMALLOC_END (PKMAP_BASE - (PAGE_SIZE * 2))
15+
16+#ifdef CONFIG_HAVE_TCM
17+#ifdef CONFIG_HAVE_DTCM
18+#define TCM_NR_PAGES (CONFIG_ITCM_NR_PAGES + CONFIG_DTCM_NR_PAGES)
19+#else
20+#define TCM_NR_PAGES (CONFIG_ITCM_NR_PAGES)
21+#endif
22+#define FIXADDR_TCM _AC(FIXADDR_TOP - (TCM_NR_PAGES * PAGE_SIZE), UL)
23+#endif
24+
25+#endif
arch/csky/include/asm/mmu.h+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 typedef struct {
88 atomic64_t asid;
99 void *vdso;
10+ cpumask_t icache_stale_mask;
1011 } mm_context_t;
1112
1213 #endif /* __ASM_CSKY_MMU_H */
arch/csky/include/asm/mmu_context.h+2−0
@@ -43,5 +43,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, · 42 unmodified lines
4343
4444 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
4545 write_mmu_entryhi(next->context.asid.counter);
46+
47+ flush_icache_deferred(next);
4648 }
4749 #endif /* __ASM_CSKY_MMU_CONTEXT_H */
arch/csky/include/asm/pci.h+34−0
@@ -0,0 +1,34 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+
3+#ifndef __ASM_CSKY_PCI_H
4+#define __ASM_CSKY_PCI_H
5+
6+#include <linux/types.h>
7+#include <linux/slab.h>
8+#include <linux/dma-mapping.h>
9+
10+#include <asm/io.h>
11+
12+#define PCIBIOS_MIN_IO 0
13+#define PCIBIOS_MIN_MEM 0
14+
15+/* C-SKY shim does not initialize PCI bus */
16+#define pcibios_assign_all_busses() 1
17+
18+extern int isa_dma_bridge_buggy;
19+
20+#ifdef CONFIG_PCI
21+static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
22+{
23+ /* no legacy IRQ on csky */
24+ return -ENODEV;
25+}
26+
27+static inline int pci_proc_domain(struct pci_bus *bus)
28+{
29+ /* always show the domain in /proc */
30+ return 1;
31+}
32+#endif /* CONFIG_PCI */
33+
34+#endif /* __ASM_CSKY_PCI_H */
arch/csky/include/asm/pgtable.h+1−5
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #define __ASM_CSKY_PGTABLE_H
66
77 #include <asm/fixmap.h>
8+#include <asm/memory.h>
89 #include <asm/addrspace.h>
910 #include <abi/pgtable-bits.h>
1011 #include <asm-generic/pgtable-nopmd.h>
@@ -16,11 +17,6 @@ · 5 unmodified lines
1617 #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
1718 #define FIRST_USER_ADDRESS 0UL
1819
19−#define PKMAP_BASE (0xff800000)
20−
21−#define VMALLOC_START (0xc0008000)
22−#define VMALLOC_END (PKMAP_BASE - 2*PAGE_SIZE)
23−
2420 /*
2521 * C-SKY is two-level paging structure:
2622 */
arch/csky/include/asm/stackprotector.h+29−0
@@ -0,0 +1,29 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_STACKPROTECTOR_H
3+#define _ASM_STACKPROTECTOR_H 1
4+
5+#include <linux/random.h>
6+#include <linux/version.h>
7+
8+extern unsigned long __stack_chk_guard;
9+
10+/*
11+ * Initialize the stackprotector canary value.
12+ *
13+ * NOTE: this must only be called from functions that never return,
14+ * and it must always be inlined.
15+ */
16+static __always_inline void boot_init_stack_canary(void)
17+{
18+ unsigned long canary;
19+
20+ /* Try to get a semi random initial value. */
21+ get_random_bytes(&canary, sizeof(canary));
22+ canary ^= LINUX_VERSION_CODE;
23+ canary &= CANARY_MASK;
24+
25+ current->stack_canary = canary;
26+ __stack_chk_guard = current->stack_canary;
27+}
28+
29+#endif /* __ASM_SH_STACKPROTECTOR_H */
arch/csky/include/asm/tcm.h+24−0
@@ -0,0 +1,24 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef __ASM_CSKY_TCM_H
4+#define __ASM_CSKY_TCM_H
5+
6+#ifndef CONFIG_HAVE_TCM
7+#error "You should not be including tcm.h unless you have a TCM!"
8+#endif
9+
10+#include <linux/compiler.h>
11+
12+/* Tag variables with this */
13+#define __tcmdata __section(.tcm.data)
14+/* Tag constants with this */
15+#define __tcmconst __section(.tcm.rodata)
16+/* Tag functions inside TCM called from outside TCM with this */
17+#define __tcmfunc __section(.tcm.text) noinline
18+/* Tag function inside TCM called from inside TCM with this */
19+#define __tcmlocalfunc __section(.tcm.text)
20+
21+void *tcm_alloc(size_t len);
22+void tcm_free(void *addr, size_t len);
23+
24+#endif
arch/csky/include/uapi/asm/unistd.h+3−0
@@ -1,7 +1,10 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
33
4+#define __ARCH_WANT_STAT64
5+#define __ARCH_WANT_NEW_STAT
46 #define __ARCH_WANT_SYS_CLONE
7+#define __ARCH_WANT_SYS_CLONE3
58 #define __ARCH_WANT_SET_GET_RLIMIT
69 #define __ARCH_WANT_TIME32_SYSCALLS
710 #include <asm-generic/unistd.h>
arch/csky/kernel/atomic.S+6−2
@@ -17,10 +17,12 @@ ENTRY(csky_cmpxchg) · 16 unmodified lines
1717 mfcr a3, epc
1818 addi a3, TRAP0_SIZE
1919
20− subi sp, 8
20+ subi sp, 16
2121 stw a3, (sp, 0)
2222 mfcr a3, epsr
2323 stw a3, (sp, 4)
24+ mfcr a3, usp
25+ stw a3, (sp, 8)
2426
2527 psrset ee
2628 #ifdef CONFIG_CPU_HAS_LDSTEX
@@ -47,7 +49,9 @@ ENTRY(csky_cmpxchg) · 20 unmodified lines
4749 mtcr a3, epc
4850 ldw a3, (sp, 4)
4951 mtcr a3, epsr
50− addi sp, 8
52+ ldw a3, (sp, 8)
53+ mtcr a3, usp
54+ addi sp, 16
5155 KSPTOUSP
5256 rte
5357 END(csky_cmpxchg)
arch/csky/kernel/process.c+10−3
@@ -16,6 +16,12 @@ · 15 unmodified lines
1616
1717 struct cpuinfo_csky cpu_data[NR_CPUS];
1818
19+#ifdef CONFIG_STACKPROTECTOR
20+#include <linux/stackprotector.h>
21+unsigned long __stack_chk_guard __read_mostly;
22+EXPORT_SYMBOL(__stack_chk_guard);
23+#endif
24+
1925 asmlinkage void ret_from_fork(void);
2026 asmlinkage void ret_from_kernel_thread(void);
2127
@@ -34,10 +40,11 @@ unsigned long thread_saved_pc(struct task_struct *tsk) · 12 unmodified lines
3440 return sw->r15;
3541 }
3642
37−int copy_thread(unsigned long clone_flags,
43+int copy_thread_tls(unsigned long clone_flags,
3844 unsigned long usp,
3945 unsigned long kthread_arg,
40− struct task_struct *p)
46+ struct task_struct *p,
47+ unsigned long tls)
4148 {
4249 struct switch_stack *childstack;
4350 struct pt_regs *childregs = task_pt_regs(p);
@@ -64,7 +71,7 @@ int copy_thread(unsigned long clone_flags, · 20 unmodified lines
6471 childregs->usp = usp;
6572 if (clone_flags & CLONE_SETTLS)
6673 task_thread_info(p)->tp_value = childregs->tls
67− = childregs->regs[0];
74+ = tls;
6875
6976 childregs->a0 = 0;
7077 childstack->r15 = (unsigned long) ret_from_fork;
arch/csky/kernel/setup.c+2−3
@@ -47,9 +47,6 @@ static void __init csky_memblock_init(void) · 46 unmodified lines
4747 signed long size;
4848
4949 memblock_reserve(__pa(_stext), _end - _stext);
50−#ifdef CONFIG_BLK_DEV_INITRD
51− memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
52−#endif
5350
5451 early_init_fdt_reserve_self();
5552 early_init_fdt_scan_reserved_mem();
@@ -133,6 +130,8 @@ void __init setup_arch(char **cmdline_p) · 77 unmodified lines
133130
134131 sparse_init();
135132
133+ fixaddr_init();
134+
136135 #ifdef CONFIG_HIGHMEM
137136 kmap_init();
138137 #endif
arch/csky/kernel/smp.c+1−1
@@ -120,7 +120,7 @@ void __init setup_smp_ipi(void) · 119 unmodified lines
120120 int rc;
121121
122122 if (ipi_irq == 0)
123− panic("%s IRQ mapping failed\n", __func__);
123+ return;
124124
125125 rc = request_percpu_irq(ipi_irq, handle_ipi, "IPI Interrupt",
126126 &ipi_dummy_dev);
arch/csky/kernel/time.c+1−1
@@ -1,8 +1,8 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
33
4−#include <linux/clk-provider.h>
54 #include <linux/clocksource.h>
5+#include <linux/of_clk.h>
66
77 void __init time_init(void)
88 {
arch/csky/kernel/vmlinux.lds.S+49−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22
33 #include <asm/vmlinux.lds.h>
44 #include <asm/page.h>
5+#include <asm/memory.h>
56
67 OUTPUT_ARCH(csky)
78 ENTRY(_start)
@@ -53,6 +54,54 @@ SECTIONS · 45 unmodified lines
5354 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
5455 _edata = .;
5556
57+#ifdef CONFIG_HAVE_TCM
58+ .tcm_start : {
59+ . = ALIGN(PAGE_SIZE);
60+ __tcm_start = .;
61+ }
62+
63+ .text_data_tcm FIXADDR_TCM : AT(__tcm_start)
64+ {
65+ . = ALIGN(4);
66+ __stcm_text_data = .;
67+ *(.tcm.text)
68+ *(.tcm.rodata)
69+#ifndef CONFIG_HAVE_DTCM
70+ *(.tcm.data)
71+#endif
72+ . = ALIGN(4);
73+ __etcm_text_data = .;
74+ }
75+
76+ . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_data_tcm);
77+
78+#ifdef CONFIG_HAVE_DTCM
79+ #define ITCM_SIZE CONFIG_ITCM_NR_PAGES * PAGE_SIZE
80+
81+ .dtcm_start : {
82+ __dtcm_start = .;
83+ }
84+
85+ .data_tcm FIXADDR_TCM + ITCM_SIZE : AT(__dtcm_start)
86+ {
87+ . = ALIGN(4);
88+ __stcm_data = .;
89+ *(.tcm.data)
90+ . = ALIGN(4);
91+ __etcm_data = .;
92+ }
93+
94+ . = ADDR(.dtcm_start) + SIZEOF(.data_tcm);
95+
96+ .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_tcm)) {
97+#else
98+ .tcm_end : AT(ADDR(.tcm_start) + SIZEOF(.text_data_tcm)) {
99+#endif
100+ . = ALIGN(PAGE_SIZE);
101+ __tcm_end = .;
102+ }
103+#endif
104+
56105 EXCEPTION_TABLE(L1_CACHE_BYTES)
57106 BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
58107 VBR_BASE
arch/csky/mm/Makefile+3−0
@@ -1,8 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 ifeq ($(CONFIG_CPU_HAS_CACHEV2),y)
33 obj-y += cachev2.o
4+CFLAGS_REMOVE_cachev2.o = $(CC_FLAGS_FTRACE)
45 else
56 obj-y += cachev1.o
7+CFLAGS_REMOVE_cachev1.o = $(CC_FLAGS_FTRACE)
68 endif
79
810 obj-y += dma-mapping.o
@@ -14,3 +16,4 @@ obj-y += syscache.o · 5 unmodified lines
1416 obj-y += tlb.o
1517 obj-y += asid.o
1618 obj-y += context.o
19+obj-$(CONFIG_HAVE_TCM) += tcm.o
arch/csky/mm/cachev1.c+5−0
@@ -94,6 +94,11 @@ void icache_inv_all(void) · 93 unmodified lines
9494 cache_op_all(INS_CACHE|CACHE_INV, 0);
9595 }
9696
97+void local_icache_inv_all(void *priv)
98+{
99+ cache_op_all(INS_CACHE|CACHE_INV, 0);
100+}
101+
97102 void dcache_wb_range(unsigned long start, unsigned long end)
98103 {
99104 cache_op_range(start, end, DATA_CACHE|CACHE_CLR, 0);
arch/csky/mm/cachev2.c+22−23
@@ -3,15 +3,25 @@ · 2 unmodified lines
33
44 #include <linux/spinlock.h>
55 #include <linux/smp.h>
6+#include <linux/mm.h>
67 #include <asm/cache.h>
78 #include <asm/barrier.h>
89
9−inline void dcache_wb_line(unsigned long start)
10+#define INS_CACHE (1 << 0)
11+#define CACHE_INV (1 << 4)
12+
13+void local_icache_inv_all(void *priv)
1014 {
11− asm volatile("dcache.cval1 %0\n"::"r"(start):"memory");
15+ mtcr("cr17", INS_CACHE|CACHE_INV);
1216 sync_is();
1317 }
1418
19+void icache_inv_all(void)
20+{
21+ on_each_cpu(local_icache_inv_all, NULL, 1);
22+}
23+
24+#ifdef CONFIG_CPU_HAS_ICACHE_INS
1525 void icache_inv_range(unsigned long start, unsigned long end)
1626 {
1727 unsigned long i = start & ~(L1_CACHE_BYTES - 1);
@@ -20,43 +30,32 @@ void icache_inv_range(unsigned long start, unsigned long end) · 2 unmodified lines
2030 asm volatile("icache.iva %0\n"::"r"(i):"memory");
2131 sync_is();
2232 }
23−
24−void icache_inv_all(void)
33+#else
34+void icache_inv_range(unsigned long start, unsigned long end)
2535 {
26− asm volatile("icache.ialls\n":::"memory");
27− sync_is();
36+ icache_inv_all();
2837 }
38+#endif
2939
30−void dcache_wb_range(unsigned long start, unsigned long end)
40+inline void dcache_wb_line(unsigned long start)
3141 {
32− unsigned long i = start & ~(L1_CACHE_BYTES - 1);
33−
34− for (; i < end; i += L1_CACHE_BYTES)
35− asm volatile("dcache.cval1 %0\n"::"r"(i):"memory");
42+ asm volatile("dcache.cval1 %0\n"::"r"(start):"memory");
3643 sync_is();
3744 }
3845
39−void dcache_inv_range(unsigned long start, unsigned long end)
46+void dcache_wb_range(unsigned long start, unsigned long end)
4047 {
4148 unsigned long i = start & ~(L1_CACHE_BYTES - 1);
4249
4350 for (; i < end; i += L1_CACHE_BYTES)
44− asm volatile("dcache.civa %0\n"::"r"(i):"memory");
51+ asm volatile("dcache.cval1 %0\n"::"r"(i):"memory");
4552 sync_is();
4653 }
4754
4855 void cache_wbinv_range(unsigned long start, unsigned long end)
4956 {
50− unsigned long i = start & ~(L1_CACHE_BYTES - 1);
51−
52− for (; i < end; i += L1_CACHE_BYTES)
53− asm volatile("dcache.cval1 %0\n"::"r"(i):"memory");
54− sync_is();
55−
56− i = start & ~(L1_CACHE_BYTES - 1);
57− for (; i < end; i += L1_CACHE_BYTES)
58− asm volatile("icache.iva %0\n"::"r"(i):"memory");
59− sync_is();
57+ dcache_wb_range(start, end);
58+ icache_inv_range(start, end);
6059 }
6160 EXPORT_SYMBOL(cache_wbinv_range);
6261
arch/csky/mm/highmem.c+4−60
@@ -117,85 +117,29 @@ struct page *kmap_atomic_to_page(void *ptr) · 116 unmodified lines
117117 return pte_page(*pte);
118118 }
119119
120−static void __init fixrange_init(unsigned long start, unsigned long end,
121− pgd_t *pgd_base)
120+static void __init kmap_pages_init(void)
122121 {
123−#ifdef CONFIG_HIGHMEM
124− pgd_t *pgd;
125− pud_t *pud;
126− pmd_t *pmd;
127− pte_t *pte;
128− int i, j, k;
129122 unsigned long vaddr;
130−
131− vaddr = start;
132− i = __pgd_offset(vaddr);
133− j = __pud_offset(vaddr);
134− k = __pmd_offset(vaddr);
135− pgd = pgd_base + i;
136−
137− for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
138− pud = (pud_t *)pgd;
139− for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) {
140− pmd = (pmd_t *)pud;
141− for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
142− if (pmd_none(*pmd)) {
143− pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
144− if (!pte)
145− panic("%s: Failed to allocate %lu bytes align=%lx\n",
146− __func__, PAGE_SIZE,
147− PAGE_SIZE);
148−
149− set_pmd(pmd, __pmd(__pa(pte)));
150− BUG_ON(pte != pte_offset_kernel(pmd, 0));
151− }
152− vaddr += PMD_SIZE;
153− }
154− k = 0;
155− }
156− j = 0;
157− }
158−#endif
159−}
160−
161−void __init fixaddr_kmap_pages_init(void)
162−{
163− unsigned long vaddr;
164− pgd_t *pgd_base;
165−#ifdef CONFIG_HIGHMEM
166123 pgd_t *pgd;
167124 pmd_t *pmd;
168125 pud_t *pud;
169126 pte_t *pte;
170−#endif
171− pgd_base = swapper_pg_dir;
172−
173− /*
174− * Fixed mappings:
175− */
176− vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
177− fixrange_init(vaddr, 0, pgd_base);
178−
179−#ifdef CONFIG_HIGHMEM
180− /*
181− * Permanent kmaps:
182− */
127+
183128 vaddr = PKMAP_BASE;
184− fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
129+ fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, swapper_pg_dir);
185130
186131 pgd = swapper_pg_dir + __pgd_offset(vaddr);
187132 pud = (pud_t *)pgd;
188133 pmd = pmd_offset(pud, vaddr);
189134 pte = pte_offset_kernel(pmd, vaddr);
190135 pkmap_page_table = pte;
191−#endif
192136 }
193137
194138 void __init kmap_init(void)
195139 {
196140 unsigned long vaddr;
197141
198− fixaddr_kmap_pages_init();
142+ kmap_pages_init();
199143
200144 vaddr = __fix_to_virt(FIX_KMAP_BEGIN);
201145
arch/csky/mm/init.c+92−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/swap.h>
2020 #include <linux/proc_fs.h>
2121 #include <linux/pfn.h>
22+#include <linux/initrd.h>
2223
2324 #include <asm/setup.h>
2425 #include <asm/cachectl.h>
@@ -31,10 +32,50 @@ · 6 unmodified lines
3132
3233 pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
3334 pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;
35+EXPORT_SYMBOL(invalid_pte_table);
3436 unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
3537 __page_aligned_bss;
3638 EXPORT_SYMBOL(empty_zero_page);
3739
40+#ifdef CONFIG_BLK_DEV_INITRD
41+static void __init setup_initrd(void)
42+{
43+ unsigned long size;
44+
45+ if (initrd_start >= initrd_end) {
46+ pr_err("initrd not found or empty");
47+ goto disable;
48+ }
49+
50+ if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) {
51+ pr_err("initrd extends beyond end of memory");
52+ goto disable;
53+ }
54+
55+ size = initrd_end - initrd_start;
56+
57+ if (memblock_is_region_reserved(__pa(initrd_start), size)) {
58+ pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region",
59+ __pa(initrd_start), size);
60+ goto disable;
61+ }
62+
63+ memblock_reserve(__pa(initrd_start), size);
64+
65+ pr_info("Initial ramdisk at: 0x%p (%lu bytes)\n",
66+ (void *)(initrd_start), size);
67+
68+ initrd_below_start_ok = 1;
69+
70+ return;
71+
72+disable:
73+ initrd_start = initrd_end = 0;
74+
75+ pr_err(" - disabling initrd\n");
76+}
77+#endif
78+
3879 void __init mem_init(void)
3980 {
4081 #ifdef CONFIG_HIGHMEM
@@ -46,6 +87,10 @@ void __init mem_init(void) · 5 unmodified lines
4687 #endif
4788 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
4889
90+#ifdef CONFIG_BLK_DEV_INITRD
91+ setup_initrd();
92+#endif
93+
4994 memblock_free_all();
5095
5196 #ifdef CONFIG_HIGHMEM
@@ -101,3 +146,50 @@ void __init pre_mmu_init(void) · 49 unmodified lines
101146 /* Setup page mask to 4k */
102147 write_mmu_pagemask(0);
103148 }
149+
150+void __init fixrange_init(unsigned long start, unsigned long end,
151+ pgd_t *pgd_base)
152+{
153+ pgd_t *pgd;
154+ pud_t *pud;
155+ pmd_t *pmd;
156+ pte_t *pte;
157+ int i, j, k;
158+ unsigned long vaddr;
159+
160+ vaddr = start;
161+ i = __pgd_offset(vaddr);
162+ j = __pud_offset(vaddr);
163+ k = __pmd_offset(vaddr);
164+ pgd = pgd_base + i;
165+
166+ for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
167+ pud = (pud_t *)pgd;
168+ for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) {
169+ pmd = (pmd_t *)pud;
170+ for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
171+ if (pmd_none(*pmd)) {
172+ pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
173+ if (!pte)
174+ panic("%s: Failed to allocate %lu bytes align=%lx\n",
175+ __func__, PAGE_SIZE,
176+ PAGE_SIZE);
177+
178+ set_pmd(pmd, __pmd(__pa(pte)));
179+ BUG_ON(pte != pte_offset_kernel(pmd, 0));
180+ }
181+ vaddr += PMD_SIZE;
182+ }
183+ k = 0;
184+ }
185+ j = 0;
186+ }
187+}
188+
189+void __init fixaddr_init(void)
190+{
191+ unsigned long vaddr;
192+
193+ vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
194+ fixrange_init(vaddr, vaddr + PMD_SIZE, swapper_pg_dir);
195+}
arch/csky/mm/syscache.c+5−8
@@ -3,7 +3,7 @@ · 2 unmodified lines
33
44 #include <linux/syscalls.h>
55 #include <asm/page.h>
6−#include <asm/cache.h>
6+#include <asm/cacheflush.h>
77 #include <asm/cachectl.h>
88
99 SYSCALL_DEFINE3(cacheflush,
@@ -13,17 +13,14 @@ SYSCALL_DEFINE3(cacheflush, · 3 unmodified lines
1313 {
1414 switch (cache) {
1515 case ICACHE:
16− icache_inv_range((unsigned long)addr,
17− (unsigned long)addr + bytes);
18− break;
16+ case BCACHE:
17+ flush_icache_mm_range(current->mm,
18+ (unsigned long)addr,
19+ (unsigned long)addr + bytes);
1920 case DCACHE:
2021 dcache_wb_range((unsigned long)addr,
2122 (unsigned long)addr + bytes);
2223 break;
23− case BCACHE:
24− cache_wbinv_range((unsigned long)addr,
25− (unsigned long)addr + bytes);
26− break;
2724 default:
2825 return -EINVAL;
2926 }
arch/csky/mm/tcm.c+169−0
@@ -0,0 +1,169 @@
1+// SPDX-License-Identifier: GPL-2.0
2+
3+#include <linux/highmem.h>
4+#include <linux/genalloc.h>
5+#include <asm/tlbflush.h>
6+#include <asm/fixmap.h>
7+
8+#if (CONFIG_ITCM_RAM_BASE == 0xffffffff)
9+#error "You should define ITCM_RAM_BASE"
10+#endif
11+
12+#ifdef CONFIG_HAVE_DTCM
13+#if (CONFIG_DTCM_RAM_BASE == 0xffffffff)
14+#error "You should define DTCM_RAM_BASE"
15+#endif
16+
17+#if (CONFIG_DTCM_RAM_BASE == CONFIG_ITCM_RAM_BASE)
18+#error "You should define correct DTCM_RAM_BASE"
19+#endif
20+#endif
21+
22+extern char __tcm_start, __tcm_end, __dtcm_start;
23+
24+static struct gen_pool *tcm_pool;
25+
26+static void __init tcm_mapping_init(void)
27+{
28+ pte_t *tcm_pte;
29+ unsigned long vaddr, paddr;
30+ int i;
31+
32+ paddr = CONFIG_ITCM_RAM_BASE;
33+
34+ if (pfn_valid(PFN_DOWN(CONFIG_ITCM_RAM_BASE)))
35+ goto panic;
36+
37+#ifndef CONFIG_HAVE_DTCM
38+ for (i = 0; i < TCM_NR_PAGES; i++) {
39+#else
40+ for (i = 0; i < CONFIG_ITCM_NR_PAGES; i++) {
41+#endif
42+ vaddr = __fix_to_virt(FIX_TCM - i);
43+
44+ tcm_pte =
45+ pte_offset_kernel((pmd_t *)pgd_offset_k(vaddr), vaddr);
46+
47+ set_pte(tcm_pte, pfn_pte(__phys_to_pfn(paddr), PAGE_KERNEL));
48+
49+ flush_tlb_one(vaddr);
50+
51+ paddr = paddr + PAGE_SIZE;
52+ }
53+
54+#ifdef CONFIG_HAVE_DTCM
55+ if (pfn_valid(PFN_DOWN(CONFIG_DTCM_RAM_BASE)))
56+ goto panic;
57+
58+ paddr = CONFIG_DTCM_RAM_BASE;
59+
60+ for (i = 0; i < CONFIG_DTCM_NR_PAGES; i++) {
61+ vaddr = __fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES - i);
62+
63+ tcm_pte =
64+ pte_offset_kernel((pmd_t *) pgd_offset_k(vaddr), vaddr);
65+
66+ set_pte(tcm_pte, pfn_pte(__phys_to_pfn(paddr), PAGE_KERNEL));
67+
68+ flush_tlb_one(vaddr);
69+
70+ paddr = paddr + PAGE_SIZE;
71+ }
72+#endif
73+
74+#ifndef CONFIG_HAVE_DTCM
75+ memcpy((void *)__fix_to_virt(FIX_TCM),
76+ &__tcm_start, &__tcm_end - &__tcm_start);
77+
78+ pr_info("%s: mapping tcm va:0x%08lx to pa:0x%08x\n",
79+ __func__, __fix_to_virt(FIX_TCM), CONFIG_ITCM_RAM_BASE);
80+
81+ pr_info("%s: __tcm_start va:0x%08lx size:%d\n",
82+ __func__, (unsigned long)&__tcm_start, &__tcm_end - &__tcm_start);
83+#else
84+ memcpy((void *)__fix_to_virt(FIX_TCM),
85+ &__tcm_start, &__dtcm_start - &__tcm_start);
86+
87+ pr_info("%s: mapping itcm va:0x%08lx to pa:0x%08x\n",
88+ __func__, __fix_to_virt(FIX_TCM), CONFIG_ITCM_RAM_BASE);
89+
90+ pr_info("%s: __itcm_start va:0x%08lx size:%d\n",
91+ __func__, (unsigned long)&__tcm_start, &__dtcm_start - &__tcm_start);
92+
93+ memcpy((void *)__fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES),
94+ &__dtcm_start, &__tcm_end - &__dtcm_start);
95+
96+ pr_info("%s: mapping dtcm va:0x%08lx to pa:0x%08x\n",
97+ __func__, __fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES),
98+ CONFIG_DTCM_RAM_BASE);
99+
100+ pr_info("%s: __dtcm_start va:0x%08lx size:%d\n",
101+ __func__, (unsigned long)&__dtcm_start, &__tcm_end - &__dtcm_start);
102+
103+#endif
104+ return;
105+panic:
106+ panic("TCM init error");
107+}
108+
109+void *tcm_alloc(size_t len)
110+{
111+ unsigned long vaddr;
112+
113+ if (!tcm_pool)
114+ return NULL;
115+
116+ vaddr = gen_pool_alloc(tcm_pool, len);
117+ if (!vaddr)
118+ return NULL;
119+
120+ return (void *) vaddr;
121+}
122+EXPORT_SYMBOL(tcm_alloc);
123+
124+void tcm_free(void *addr, size_t len)
125+{
126+ gen_pool_free(tcm_pool, (unsigned long) addr, len);
127+}
128+EXPORT_SYMBOL(tcm_free);
129+
130+static int __init tcm_setup_pool(void)
131+{
132+#ifndef CONFIG_HAVE_DTCM
133+ u32 pool_size = (u32) (TCM_NR_PAGES * PAGE_SIZE)
134+ - (u32) (&__tcm_end - &__tcm_start);
135+
136+ u32 tcm_pool_start = __fix_to_virt(FIX_TCM)
137+ + (u32) (&__tcm_end - &__tcm_start);
138+#else
139+ u32 pool_size = (u32) (CONFIG_DTCM_NR_PAGES * PAGE_SIZE)
140+ - (u32) (&__tcm_end - &__dtcm_start);
141+
142+ u32 tcm_pool_start = __fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES)
143+ + (u32) (&__tcm_end - &__dtcm_start);
144+#endif
145+ int ret;
146+
147+ tcm_pool = gen_pool_create(2, -1);
148+
149+ ret = gen_pool_add(tcm_pool, tcm_pool_start, pool_size, -1);
150+ if (ret) {
151+ pr_err("%s: gen_pool add failed!\n", __func__);
152+ return ret;
153+ }
154+
155+ pr_info("%s: Added %d bytes @ 0x%08x to memory pool\n",
156+ __func__, pool_size, tcm_pool_start);
157+
158+ return 0;
159+}
160+
161+static int __init tcm_init(void)
162+{
163+ tcm_mapping_init();
164+
165+ tcm_setup_pool();
166+
167+ return 0;
168+}
169+arch_initcall(tcm_init);
arch/mips/boot/dts/ingenic/jz4740.dtsi+9−8
@@ -1,5 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <dt-bindings/clock/jz4740-cgu.h>
3+#include <dt-bindings/clock/ingenic,tcu.h>
34
45 / {
56 #address-cells = <1>;
@@ -45,14 +46,6 @@ · 39 unmodified lines
4546 #clock-cells = <1>;
4647 };
4748
48− watchdog: watchdog@10002000 {
49− compatible = "ingenic,jz4740-watchdog";
50− reg = <0x10002000 0x10>;
51−
52− clocks = <&cgu JZ4740_CLK_RTC>;
53− clock-names = "rtc";
54− };
55−
5649 tcu: timer@10002000 {
5750 compatible = "ingenic,jz4740-tcu", "simple-mfd";
5851 reg = <0x10002000 0x1000>;
@@ -73,6 +66,14 @@ · 14 unmodified lines
7366
7467 interrupt-parent = <&intc>;
7568 interrupts = <23 22 21>;
69+
70+ watchdog: watchdog@0 {
71+ compatible = "ingenic,jz4740-watchdog";
72+ reg = <0x0 0xc>;
73+
74+ clocks = <&tcu TCU_CLK_WDT>;
75+ clock-names = "wdt";
76+ };
7677 };
7778
7879 rtc_dev: rtc@10003000 {
arch/mips/boot/dts/ingenic/jz4780.dtsi+9−8
@@ -1,5 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <dt-bindings/clock/jz4780-cgu.h>
3+#include <dt-bindings/clock/ingenic,tcu.h>
34 #include <dt-bindings/dma/jz4780-dma.h>
45
56 / {
@@ -67,6 +68,14 @@ · 61 unmodified lines
6768
6869 interrupt-parent = <&intc>;
6970 interrupts = <27 26 25>;
71+
72+ watchdog: watchdog@0 {
73+ compatible = "ingenic,jz4780-watchdog";
74+ reg = <0x0 0xc>;
75+
76+ clocks = <&tcu TCU_CLK_WDT>;
77+ clock-names = "wdt";
78+ };
7079 };
7180
7281 rtc_dev: rtc@10003000 {
@@ -348,14 +357,6 @@ · 275 unmodified lines
348357 status = "disabled";
349358 };
350359
351− watchdog: watchdog@10002000 {
352− compatible = "ingenic,jz4780-watchdog";
353− reg = <0x10002000 0x10>;
354−
355− clocks = <&cgu JZ4780_CLK_RTCLK>;
356− clock-names = "rtc";
357− };
358−
359360 nemc: nemc@13410000 {
360361 compatible = "ingenic,jz4780-nemc";
361362 reg = <0x13410000 0x10000>;
arch/mips/boot/dts/ingenic/x1000.dtsi+2−4
@@ -1,4 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2+#include <dt-bindings/clock/ingenic,tcu.h>
23 #include <dt-bindings/clock/x1000-cgu.h>
34 #include <dt-bindings/dma/x1000-dma.h>
45
@@ -72,7 +73,7 @@ · 67 unmodified lines
7273 compatible = "ingenic,x1000-watchdog", "ingenic,jz4780-watchdog";
7374 reg = <0x0 0x10>;
7475
75− clocks = <&cgu X1000_CLK_RTCLK>;
76+ clocks = <&tcu TCU_CLK_WDT>;
7677 clock-names = "wdt";
7778 };
7879 };
@@ -158,7 +159,6 @@ · 79 unmodified lines
158159 i2c0: i2c-controller@10050000 {
159160 compatible = "ingenic,x1000-i2c";
160161 reg = <0x10050000 0x1000>;
161−
162162 #address-cells = <1>;
163163 #size-cells = <0>;
164164
@@ -173,7 +173,6 @@ · 8 unmodified lines
173173 i2c1: i2c-controller@10051000 {
174174 compatible = "ingenic,x1000-i2c";
175175 reg = <0x10051000 0x1000>;
176−
177176 #address-cells = <1>;
178177 #size-cells = <0>;
179178
@@ -188,7 +187,6 @@ · 8 unmodified lines
188187 i2c2: i2c-controller@10052000 {
189188 compatible = "ingenic,x1000-i2c";
190189 reg = <0x10052000 0x1000>;
191−
192190 #address-cells = <1>;
193191 #size-cells = <0>;
194192
arch/mips/include/asm/sync.h+3−1
@@ -155,9 +155,11 @@ · 154 unmodified lines
155155 * effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use
156156 * optimized memory barrier primitives."). Here we specify that the affected
157157 * sync instructions should be emitted twice.
158+ * Note that this expression is evaluated by the assembler (not the compiler),
159+ * and that the assembler evaluates '==' as 0 or -1, not 0 or 1.
158160 */
159161 #ifdef CONFIG_CPU_CAVIUM_OCTEON
160−# define __SYNC_rpt(type) (1 + (type == __SYNC_wmb))
162+# define __SYNC_rpt(type) (1 - (type == __SYNC_wmb))
161163 #else
162164 # define __SYNC_rpt(type) 1
163165 #endif
arch/mips/kernel/vpe.c+1−1
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v) · 133 unmodified lines
134134 {
135135 list_del(&v->list);
136136 if (v->load_addr)
137− release_progmem(v);
137+ release_progmem(v->load_addr);
138138 kfree(v);
139139 }
140140
arch/mips/vdso/Makefile+25−3
@@ -33,6 +33,7 @@ endif · 32 unmodified lines
3333 cflags-vdso := $(ccflags-vdso) \
3434 $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
3535 -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
36+ -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
3637 -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
3738 $(call cc-option, -fno-asynchronous-unwind-tables) \
3839 $(call cc-option, -fno-stack-protector)
@@ -51,6 +52,8 @@ endif · 12 unmodified lines
5152
5253 CFLAGS_REMOVE_vgettimeofday.o = -pg
5354
55+DISABLE_VDSO := n
56+
5457 #
5558 # For the pre-R6 code in arch/mips/vdso/vdso.h for locating
5659 # the base address of VDSO, the linker will emit a R_MIPS_PC32
@@ -64,11 +67,24 @@ CFLAGS_REMOVE_vgettimeofday.o = -pg · 7 unmodified lines
6467 ifndef CONFIG_CPU_MIPSR6
6568 ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
6669 $(warning MIPS VDSO requires binutils >= 2.25)
67− obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
68− ccflags-vdso += -DDISABLE_MIPS_VDSO
70+ DISABLE_VDSO := y
6971 endif
7072 endif
7173
74+#
75+# GCC (at least up to version 9.2) appears to emit function calls that make use
76+# of the GOT when targeting microMIPS, which we can't use in the VDSO due to
77+# the lack of relocations. As such, we disable the VDSO for microMIPS builds.
78+#
79+ifdef CONFIG_CPU_MICROMIPS
80+ DISABLE_VDSO := y
81+endif
82+
83+ifeq ($(DISABLE_VDSO),y)
84+ obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
85+ ccflags-vdso += -DDISABLE_MIPS_VDSO
86+endif
87+
7288 # VDSO linker flags.
7389 VDSO_LDFLAGS := \
7490 -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \
@@ -81,12 +97,18 @@ GCOV_PROFILE := n · 6 unmodified lines
8197 UBSAN_SANITIZE := n
8298 KCOV_INSTRUMENT := n
8399
100+# Check that we don't have PIC 'jalr t9' calls left
101+quiet_cmd_vdso_mips_check = VDSOCHK $@
102+ cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | egrep -h "jalr.*t9" > /dev/null; \
103+ then (echo >&2 "$@: PIC 'jalr t9' calls are not supported"; \
104+ rm -f $@; /bin/false); fi
105+
84106 #
85107 # Shared build commands.
86108 #
87109
88110 quiet_cmd_vdsold_and_vdso_check = LD $@
89− cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
111+ cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check); $(cmd_vdso_mips_check)
90112
91113 quiet_cmd_vdsold = VDSO $@
92114 cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \
arch/powerpc/include/asm/page.h+5−0
@@ -295,8 +295,13 @@ static inline bool pfn_valid(unsigned long pfn) · 294 unmodified lines
295295 /*
296296 * Some number of bits at the level of the page table that points to
297297 * a hugepte are used to encode the size. This masks those bits.
298+ * On 8xx, HW assistance requires 4k alignment for the hugepte.
298299 */
300+#ifdef CONFIG_PPC_8xx
301+#define HUGEPD_SHIFT_MASK 0xfff
302+#else
299303 #define HUGEPD_SHIFT_MASK 0x3f
304+#endif
300305
301306 #ifndef __ASSEMBLY__
302307
arch/powerpc/include/asm/processor.h+4−0
@@ -168,6 +168,10 @@ struct thread_struct { · 167 unmodified lines
168168 unsigned long srr1;
169169 unsigned long dar;
170170 unsigned long dsisr;
171+#ifdef CONFIG_PPC_BOOK3S_32
172+ unsigned long r0, r3, r4, r5, r6, r8, r9, r11;
173+ unsigned long lr, ctr;
174+#endif
171175 #endif
172176 /* Debug Registers */
173177 struct debug_reg debug;
arch/powerpc/kernel/asm-offsets.c+12−0
@@ -132,6 +132,18 @@ int main(void) · 131 unmodified lines
132132 OFFSET(SRR1, thread_struct, srr1);
133133 OFFSET(DAR, thread_struct, dar);
134134 OFFSET(DSISR, thread_struct, dsisr);
135+#ifdef CONFIG_PPC_BOOK3S_32
136+ OFFSET(THR0, thread_struct, r0);
137+ OFFSET(THR3, thread_struct, r3);
138+ OFFSET(THR4, thread_struct, r4);
139+ OFFSET(THR5, thread_struct, r5);
140+ OFFSET(THR6, thread_struct, r6);
141+ OFFSET(THR8, thread_struct, r8);
142+ OFFSET(THR9, thread_struct, r9);
143+ OFFSET(THR11, thread_struct, r11);
144+ OFFSET(THLR, thread_struct, lr);
145+ OFFSET(THCTR, thread_struct, ctr);
146+#endif
135147 #endif
136148 #ifdef CONFIG_SPE
137149 OFFSET(THREAD_EVR0, thread_struct, evr[0]);
arch/powerpc/kernel/eeh_driver.c+11−10
@@ -1184,6 +1184,17 @@ void eeh_handle_special_event(void) · 1183 unmodified lines
11841184 eeh_pe_state_mark(pe, EEH_PE_RECOVERING);
11851185 eeh_handle_normal_event(pe);
11861186 } else {
1187+ eeh_for_each_pe(pe, tmp_pe)
1188+ eeh_pe_for_each_dev(tmp_pe, edev, tmp_edev)
1189+ edev->mode &= ~EEH_DEV_NO_HANDLER;
1190+
1191+ /* Notify all devices to be down */
1192+ eeh_pe_state_clear(pe, EEH_PE_PRI_BUS, true);
1193+ eeh_set_channel_state(pe, pci_channel_io_perm_failure);
1194+ eeh_pe_report(
1195+ "error_detected(permanent failure)", pe,
1196+ eeh_report_failure, NULL);
1197+
11871198 pci_lock_rescan_remove();
11881199 list_for_each_entry(hose, &hose_list, list_node) {
11891200 phb_pe = eeh_phb_pe_get(hose);
@@ -1192,16 +1203,6 @@ void eeh_handle_special_event(void) · 2 unmodified lines
11921203 (phb_pe->state & EEH_PE_RECOVERING))
11931204 continue;
11941205
1195− eeh_for_each_pe(pe, tmp_pe)
1196− eeh_pe_for_each_dev(tmp_pe, edev, tmp_edev)
1197− edev->mode &= ~EEH_DEV_NO_HANDLER;
1198−
1199− /* Notify all devices to be down */
1200− eeh_pe_state_clear(pe, EEH_PE_PRI_BUS, true);
1201− eeh_set_channel_state(pe, pci_channel_io_perm_failure);
1202− eeh_pe_report(
1203− "error_detected(permanent failure)", pe,
1204− eeh_report_failure, NULL);
12051206 bus = eeh_pe_bus_get(phb_pe);
12061207 if (!bus) {
12071208 pr_err("%s: Cannot find PCI bus for "
arch/powerpc/kernel/entry_32.S+9−4
@@ -783,7 +783,7 @@ fast_exception_return: · 782 unmodified lines
783783 1: lis r3,exc_exit_restart_end@ha
784784 addi r3,r3,exc_exit_restart_end@l
785785 cmplw r12,r3
786−#if CONFIG_PPC_BOOK3S_601
786+#ifdef CONFIG_PPC_BOOK3S_601
787787 bge 2b
788788 #else
789789 bge 3f
@@ -791,7 +791,7 @@ fast_exception_return: · 1 unmodified line
791791 lis r4,exc_exit_restart@ha
792792 addi r4,r4,exc_exit_restart@l
793793 cmplw r12,r4
794−#if CONFIG_PPC_BOOK3S_601
794+#ifdef CONFIG_PPC_BOOK3S_601
795795 blt 2b
796796 #else
797797 blt 3f
@@ -1354,12 +1354,17 @@ _GLOBAL(enter_rtas) · 556 unmodified lines
13541354 mtspr SPRN_SRR0,r8
13551355 mtspr SPRN_SRR1,r9
13561356 RFI
1357−1: tophys(r9,r1)
1357+1: tophys_novmstack r9, r1
1358+#ifdef CONFIG_VMAP_STACK
1359+ li r0, MSR_KERNEL & ~MSR_IR /* can take DTLB miss */
1360+ mtmsr r0
1361+ isync
1362+#endif
13581363 lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */
13591364 lwz r9,8(r9) /* original msr value */
13601365 addi r1,r1,INT_FRAME_SIZE
13611366 li r0,0
1362− tophys(r7, r2)
1367+ tophys_novmstack r7, r2
13631368 stw r0, THREAD + RTAS_SP(r7)
13641369 mtspr SPRN_SRR0,r8
13651370 mtspr SPRN_SRR1,r9
arch/powerpc/kernel/head_32.S+150−5
@@ -290,17 +290,55 @@ MachineCheck: · 289 unmodified lines
290290 7: EXCEPTION_PROLOG_2
291291 addi r3,r1,STACK_FRAME_OVERHEAD
292292 #ifdef CONFIG_PPC_CHRP
293− bne cr1,1f
293+#ifdef CONFIG_VMAP_STACK
294+ mfspr r4, SPRN_SPRG_THREAD
295+ tovirt(r4, r4)
296+ lwz r4, RTAS_SP(r4)
297+ cmpwi cr1, r4, 0
294298 #endif
295− EXC_XFER_STD(0x200, machine_check_exception)
296−#ifdef CONFIG_PPC_CHRP
297−1: b machine_check_in_rtas
299+ beq cr1, machine_check_tramp
300+ b machine_check_in_rtas
301+#else
302+ b machine_check_tramp
298303 #endif
299304
300305 /* Data access exception. */
301306 . = 0x300
302307 DO_KVM 0x300
303308 DataAccess:
309+#ifdef CONFIG_VMAP_STACK
310+ mtspr SPRN_SPRG_SCRATCH0,r10
311+ mfspr r10, SPRN_SPRG_THREAD
312+BEGIN_MMU_FTR_SECTION
313+ stw r11, THR11(r10)
314+ mfspr r10, SPRN_DSISR
315+ mfcr r11
316+#ifdef CONFIG_PPC_KUAP
317+ andis. r10, r10, (DSISR_BAD_FAULT_32S | DSISR_DABRMATCH | DSISR_PROTFAULT)@h
318+#else
319+ andis. r10, r10, (DSISR_BAD_FAULT_32S | DSISR_DABRMATCH)@h
320+#endif
321+ mfspr r10, SPRN_SPRG_THREAD
322+ beq hash_page_dsi
323+.Lhash_page_dsi_cont:
324+ mtcr r11
325+ lwz r11, THR11(r10)
326+END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
327+ mtspr SPRN_SPRG_SCRATCH1,r11
328+ mfspr r11, SPRN_DAR
329+ stw r11, DAR(r10)
330+ mfspr r11, SPRN_DSISR
331+ stw r11, DSISR(r10)
332+ mfspr r11, SPRN_SRR0
333+ stw r11, SRR0(r10)
334+ mfspr r11, SPRN_SRR1 /* check whether user or kernel */
335+ stw r11, SRR1(r10)
336+ mfcr r10
337+ andi. r11, r11, MSR_PR
338+
339+ EXCEPTION_PROLOG_1
340+ b handle_page_fault_tramp_1
341+#else /* CONFIG_VMAP_STACK */
304342 EXCEPTION_PROLOG handle_dar_dsisr=1
305343 get_and_save_dar_dsisr_on_stack r4, r5, r11
306344 BEGIN_MMU_FTR_SECTION
@@ -316,11 +354,32 @@ BEGIN_MMU_FTR_SECTION · 9 unmodified lines
316354 FTR_SECTION_ELSE
317355 b handle_page_fault_tramp_2
318356 ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE)
357+#endif /* CONFIG_VMAP_STACK */
319358
320359 /* Instruction access exception. */
321360 . = 0x400
322361 DO_KVM 0x400
323362 InstructionAccess:
363+#ifdef CONFIG_VMAP_STACK
364+ mtspr SPRN_SPRG_SCRATCH0,r10
365+ mtspr SPRN_SPRG_SCRATCH1,r11
366+ mfspr r10, SPRN_SPRG_THREAD
367+ mfspr r11, SPRN_SRR0
368+ stw r11, SRR0(r10)
369+ mfspr r11, SPRN_SRR1 /* check whether user or kernel */
370+ stw r11, SRR1(r10)
371+ mfcr r10
372+BEGIN_MMU_FTR_SECTION
373+ andis. r11, r11, SRR1_ISI_NOPT@h /* no pte found? */
374+ bne hash_page_isi
375+.Lhash_page_isi_cont:
376+ mfspr r11, SPRN_SRR1 /* check whether user or kernel */
377+END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
378+ andi. r11, r11, MSR_PR
379+
380+ EXCEPTION_PROLOG_1
381+ EXCEPTION_PROLOG_2
382+#else /* CONFIG_VMAP_STACK */
324383 EXCEPTION_PROLOG
325384 andis. r0,r9,SRR1_ISI_NOPT@h /* no pte found? */
326385 beq 1f /* if so, try to put a PTE */
@@ -329,6 +388,7 @@ InstructionAccess: · 2 unmodified lines
329388 BEGIN_MMU_FTR_SECTION
330389 bl hash_page
331390 END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
391+#endif /* CONFIG_VMAP_STACK */
332392 1: mr r4,r12
333393 andis. r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */
334394 stw r4, _DAR(r11)
@@ -344,7 +404,7 @@ Alignment: · 9 unmodified lines
344404 EXCEPTION_PROLOG handle_dar_dsisr=1
345405 save_dar_dsisr_on_stack r4, r5, r11
346406 addi r3,r1,STACK_FRAME_OVERHEAD
347− EXC_XFER_STD(0x600, alignment_exception)
407+ b alignment_exception_tramp
348408
349409 /* Program check exception */
350410 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
@@ -645,15 +705,100 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU) · 294 unmodified lines
645705
646706 . = 0x3000
647707
708+machine_check_tramp:
709+ EXC_XFER_STD(0x200, machine_check_exception)
710+
711+alignment_exception_tramp:
712+ EXC_XFER_STD(0x600, alignment_exception)
713+
648714 handle_page_fault_tramp_1:
715+#ifdef CONFIG_VMAP_STACK
716+ EXCEPTION_PROLOG_2 handle_dar_dsisr=1
717+#endif
649718 lwz r4, _DAR(r11)
650719 lwz r5, _DSISR(r11)
651720 /* fall through */
652721 handle_page_fault_tramp_2:
653722 EXC_XFER_LITE(0x300, handle_page_fault)
654723
724+#ifdef CONFIG_VMAP_STACK
725+.macro save_regs_thread thread
726+ stw r0, THR0(\thread)
727+ stw r3, THR3(\thread)
728+ stw r4, THR4(\thread)
729+ stw r5, THR5(\thread)
730+ stw r6, THR6(\thread)
731+ stw r8, THR8(\thread)
732+ stw r9, THR9(\thread)
733+ mflr r0
734+ stw r0, THLR(\thread)
735+ mfctr r0
736+ stw r0, THCTR(\thread)
737+.endm
738+
739+.macro restore_regs_thread thread
740+ lwz r0, THLR(\thread)
741+ mtlr r0
742+ lwz r0, THCTR(\thread)
743+ mtctr r0
744+ lwz r0, THR0(\thread)
745+ lwz r3, THR3(\thread)
746+ lwz r4, THR4(\thread)
747+ lwz r5, THR5(\thread)
748+ lwz r6, THR6(\thread)
749+ lwz r8, THR8(\thread)
750+ lwz r9, THR9(\thread)
751+.endm
752+
753+hash_page_dsi:
754+ save_regs_thread r10
755+ mfdsisr r3
756+ mfdar r4
757+ mfsrr0 r5
758+ mfsrr1 r9
759+ rlwinm r3, r3, 32 - 15, _PAGE_RW /* DSISR_STORE -> _PAGE_RW */
760+ bl hash_page
761+ mfspr r10, SPRN_SPRG_THREAD
762+ restore_regs_thread r10
763+ b .Lhash_page_dsi_cont
764+
765+hash_page_isi:
766+ mr r11, r10
767+ mfspr r10, SPRN_SPRG_THREAD
768+ save_regs_thread r10
769+ li r3, 0
770+ lwz r4, SRR0(r10)
771+ lwz r9, SRR1(r10)
772+ bl hash_page
773+ mfspr r10, SPRN_SPRG_THREAD
774+ restore_regs_thread r10
775+ mr r10, r11
776+ b .Lhash_page_isi_cont
777+
778+ .globl fast_hash_page_return
779+fast_hash_page_return:
780+ andis. r10, r9, SRR1_ISI_NOPT@h /* Set on ISI, cleared on DSI */
781+ mfspr r10, SPRN_SPRG_THREAD
782+ restore_regs_thread r10
783+ bne 1f
784+
785+ /* DSI */
786+ mtcr r11
787+ lwz r11, THR11(r10)
788+ mfspr r10, SPRN_SPRG_SCRATCH0
789+ SYNC
790+ RFI
791+
792+1: /* ISI */
793+ mtcr r11
794+ mfspr r11, SPRN_SPRG_SCRATCH1
795+ mfspr r10, SPRN_SPRG_SCRATCH0
796+ SYNC
797+ RFI
798+
655799 stack_overflow:
656800 vmap_stack_overflow_exception
801+#endif
657802
658803 AltiVecUnavailable:
659804 EXCEPTION_PROLOG
arch/powerpc/kernel/head_32.h+20−1
@@ -64,11 +64,25 @@ · 63 unmodified lines
6464 .endm
6565
6666 .macro EXCEPTION_PROLOG_2 handle_dar_dsisr=0
67+#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S)
68+BEGIN_MMU_FTR_SECTION
69+ mtcr r10
70+FTR_SECTION_ELSE
71+ stw r10, _CCR(r11)
72+ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE)
73+#else
6774 stw r10,_CCR(r11) /* save registers */
75+#endif
76+ mfspr r10, SPRN_SPRG_SCRATCH0
6877 stw r12,GPR12(r11)
6978 stw r9,GPR9(r11)
70− mfspr r10,SPRN_SPRG_SCRATCH0
7179 stw r10,GPR10(r11)
80+#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S)
81+BEGIN_MMU_FTR_SECTION
82+ mfcr r10
83+ stw r10, _CCR(r11)
84+END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
85+#endif
7286 mfspr r12,SPRN_SPRG_SCRATCH1
7387 stw r12,GPR11(r11)
7488 mflr r10
@@ -83,6 +97,11 @@ · 8 unmodified lines
8397 stw r10, _DSISR(r11)
8498 .endif
8599 lwz r9, SRR1(r12)
100+#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S)
101+BEGIN_MMU_FTR_SECTION
102+ andi. r10, r9, MSR_PR
103+END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
104+#endif
86105 lwz r12, SRR0(r12)
87106 #else
88107 mfspr r12,SPRN_SRR0
arch/powerpc/kernel/head_8xx.S+1−1
@@ -256,7 +256,7 @@ InstructionTLBMiss: · 255 unmodified lines
256256 * set. All other Linux PTE bits control the behavior
257257 * of the MMU.
258258 */
259− rlwimi r10, r10, 0, 0x0f00 /* Clear bits 20-23 */
259+ rlwinm r10, r10, 0, ~0x0f00 /* Clear bits 20-23 */
260260 rlwimi r10, r10, 4, 0x0400 /* Copy _PAGE_EXEC into bit 21 */
261261 ori r10, r10, RPN_PATTERN | 0x200 /* Set 22 and 24-27 */
262262 mtspr SPRN_MI_RPN, r10 /* Update TLB entry */
arch/powerpc/kernel/idle_6xx.S+8−0
@@ -166,7 +166,11 @@ BEGIN_FTR_SECTION · 165 unmodified lines
166166 mfspr r9,SPRN_HID0
167167 andis. r9,r9,HID0_NAP@h
168168 beq 1f
169+#ifdef CONFIG_VMAP_STACK
170+ addis r9, r11, nap_save_msscr0@ha
171+#else
169172 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha
173+#endif
170174 lwz r9,nap_save_msscr0@l(r9)
171175 mtspr SPRN_MSSCR0, r9
172176 sync
@@ -174,7 +178,11 @@ BEGIN_FTR_SECTION · 1 unmodified line
174178 1:
175179 END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
176180 BEGIN_FTR_SECTION
181+#ifdef CONFIG_VMAP_STACK
182+ addis r9, r11, nap_save_hid1@ha
183+#else
177184 addis r9,r11,(nap_save_hid1-KERNELBASE)@ha
185+#endif
178186 lwz r9,nap_save_hid1@l(r9)
179187 mtspr SPRN_HID1, r9
180188 END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
arch/powerpc/kernel/signal.c+15−2
@@ -200,14 +200,27 @@ unsigned long get_tm_stackpointer(struct task_struct *tsk) · 199 unmodified lines
200200 * normal/non-checkpointed stack pointer.
201201 */
202202
203+ unsigned long ret = tsk->thread.regs->gpr[1];
204+
203205 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
204206 BUG_ON(tsk != current);
205207
206208 if (MSR_TM_ACTIVE(tsk->thread.regs->msr)) {
209+ preempt_disable();
207210 tm_reclaim_current(TM_CAUSE_SIGNAL);
208211 if (MSR_TM_TRANSACTIONAL(tsk->thread.regs->msr))
209− return tsk->thread.ckpt_regs.gpr[1];
212+ ret = tsk->thread.ckpt_regs.gpr[1];
213+
214+ /*
215+ * If we treclaim, we must clear the current thread's TM bits
216+ * before re-enabling preemption. Otherwise we might be
217+ * preempted and have the live MSR[TS] changed behind our back
218+ * (tm_recheckpoint_new_task() would recheckpoint). Besides, we
219+ * enter the signal handler in non-transactional state.
220+ */
221+ tsk->thread.regs->msr &= ~MSR_TS_MASK;
222+ preempt_enable();
210223 }
211224 #endif
212− return tsk->thread.regs->gpr[1];
225+ return ret;
213226 }
arch/powerpc/kernel/signal_32.c+14−14
@@ -489,19 +489,11 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, · 488 unmodified lines
489489 */
490490 static int save_tm_user_regs(struct pt_regs *regs,
491491 struct mcontext __user *frame,
492− struct mcontext __user *tm_frame, int sigret)
492+ struct mcontext __user *tm_frame, int sigret,
493+ unsigned long msr)
493494 {
494− unsigned long msr = regs->msr;
495−
496495 WARN_ON(tm_suspend_disabled);
497496
498− /* Remove TM bits from thread's MSR. The MSR in the sigcontext
499− * just indicates to userland that we were doing a transaction, but we
500− * don't want to return in transactional state. This also ensures
501− * that flush_fp_to_thread won't set TIF_RESTORE_TM again.
502− */
503− regs->msr &= ~MSR_TS_MASK;
504−
505497 /* Save both sets of general registers */
506498 if (save_general_regs(&current->thread.ckpt_regs, frame)
507499 || save_general_regs(regs, tm_frame))
@@ -912,6 +904,10 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 404 unmodified lines
912904 int sigret;
913905 unsigned long tramp;
914906 struct pt_regs *regs = tsk->thread.regs;
907+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
908+ /* Save the thread's msr before get_tm_stackpointer() changes it */
909+ unsigned long msr = regs->msr;
910+#endif
915911
916912 BUG_ON(tsk != current);
917913
@@ -944,13 +940,13 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 26 unmodified lines
944940
945941 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
946942 tm_frame = &rt_sf->uc_transact.uc_mcontext;
947− if (MSR_TM_ACTIVE(regs->msr)) {
943+ if (MSR_TM_ACTIVE(msr)) {
948944 if (__put_user((unsigned long)&rt_sf->uc_transact,
949945 &rt_sf->uc.uc_link) ||
950946 __put_user((unsigned long)tm_frame,
951947 &rt_sf->uc_transact.uc_regs))
952948 goto badframe;
953− if (save_tm_user_regs(regs, frame, tm_frame, sigret))
949+ if (save_tm_user_regs(regs, frame, tm_frame, sigret, msr))
954950 goto badframe;
955951 }
956952 else
@@ -1369,6 +1365,10 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 412 unmodified lines
13691365 int sigret;
13701366 unsigned long tramp;
13711367 struct pt_regs *regs = tsk->thread.regs;
1368+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1369+ /* Save the thread's msr before get_tm_stackpointer() changes it */
1370+ unsigned long msr = regs->msr;
1371+#endif
13721372
13731373 BUG_ON(tsk != current);
13741374
@@ -1402,9 +1402,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 27 unmodified lines
14021402
14031403 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
14041404 tm_mctx = &frame->mctx_transact;
1405− if (MSR_TM_ACTIVE(regs->msr)) {
1405+ if (MSR_TM_ACTIVE(msr)) {
14061406 if (save_tm_user_regs(regs, &frame->mctx, &frame->mctx_transact,
1407− sigret))
1407+ sigret, msr))
14081408 goto badframe;
14091409 }
14101410 else
arch/powerpc/kernel/signal_64.c+10−12
@@ -192,7 +192,8 @@ static long setup_sigcontext(struct sigcontext __user *sc, · 191 unmodified lines
192192 static long setup_tm_sigcontexts(struct sigcontext __user *sc,
193193 struct sigcontext __user *tm_sc,
194194 struct task_struct *tsk,
195− int signr, sigset_t *set, unsigned long handler)
195+ int signr, sigset_t *set, unsigned long handler,
196+ unsigned long msr)
196197 {
197198 /* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
198199 * process never used altivec yet (MSR_VEC is zero in pt_regs of
@@ -207,12 +208,11 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc, · 8 unmodified lines
207208 elf_vrreg_t __user *tm_v_regs = sigcontext_vmx_regs(tm_sc);
208209 #endif
209210 struct pt_regs *regs = tsk->thread.regs;
210− unsigned long msr = tsk->thread.regs->msr;
211211 long err = 0;
212212
213213 BUG_ON(tsk != current);
214214
215− BUG_ON(!MSR_TM_ACTIVE(regs->msr));
215+ BUG_ON(!MSR_TM_ACTIVE(msr));
216216
217217 WARN_ON(tm_suspend_disabled);
218218
@@ -222,13 +222,6 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc, · 3 unmodified lines
222222 */
223223 msr |= tsk->thread.ckpt_regs.msr & (MSR_FP | MSR_VEC | MSR_VSX);
224224
225− /* Remove TM bits from thread's MSR. The MSR in the sigcontext
226− * just indicates to userland that we were doing a transaction, but we
227− * don't want to return in transactional state. This also ensures
228− * that flush_fp_to_thread won't set TIF_RESTORE_TM again.
229− */
230− regs->msr &= ~MSR_TS_MASK;
231−
232225 #ifdef CONFIG_ALTIVEC
233226 err |= __put_user(v_regs, &sc->v_regs);
234227 err |= __put_user(tm_v_regs, &tm_sc->v_regs);
@@ -824,6 +817,10 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, · 589 unmodified lines
824817 unsigned long newsp = 0;
825818 long err = 0;
826819 struct pt_regs *regs = tsk->thread.regs;
820+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
821+ /* Save the thread's msr before get_tm_stackpointer() changes it */
822+ unsigned long msr = regs->msr;
823+#endif
827824
828825 BUG_ON(tsk != current);
829826
@@ -841,7 +838,7 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, · 11 unmodified lines
841838 err |= __put_user(0, &frame->uc.uc_flags);
842839 err |= __save_altstack(&frame->uc.uc_stack, regs->gpr[1]);
843840 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
844− if (MSR_TM_ACTIVE(regs->msr)) {
841+ if (MSR_TM_ACTIVE(msr)) {
845842 /* The ucontext_t passed to userland points to the second
846843 * ucontext_t (for transactional state) with its uc_link ptr.
847844 */
@@ -849,7 +846,8 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, · 1 unmodified line
849846 err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext,
850847 &frame->uc_transact.uc_mcontext,
851848 tsk, ksig->sig, NULL,
852− (unsigned long)ksig->ka.sa.sa_handler);
849+ (unsigned long)ksig->ka.sa.sa_handler,
850+ msr);
853851 } else
854852 #endif
855853 {
arch/powerpc/mm/book3s32/hash_low.S+23−29
@@ -25,12 +25,6 @@ · 24 unmodified lines
2525 #include <asm/feature-fixups.h>
2626 #include <asm/code-patching-asm.h>
2727
28−#ifdef CONFIG_VMAP_STACK
29−#define ADDR_OFFSET 0
30−#else
31−#define ADDR_OFFSET PAGE_OFFSET
32−#endif
33−
3428 #ifdef CONFIG_SMP
3529 .section .bss
3630 .align 2
@@ -53,8 +47,8 @@ mmu_hash_lock: · 16 unmodified lines
5347 .text
5448 _GLOBAL(hash_page)
5549 #ifdef CONFIG_SMP
56− lis r8, (mmu_hash_lock - ADDR_OFFSET)@h
57− ori r8, r8, (mmu_hash_lock - ADDR_OFFSET)@l
50+ lis r8, (mmu_hash_lock - PAGE_OFFSET)@h
51+ ori r8, r8, (mmu_hash_lock - PAGE_OFFSET)@l
5852 lis r0,0x0fff
5953 b 10f
6054 11: lwz r6,0(r8)
@@ -72,12 +66,9 @@ _GLOBAL(hash_page) · 11 unmodified lines
7266 cmplw 0,r4,r0
7367 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */
7468 mfspr r5, SPRN_SPRG_PGDIR /* phys page-table root */
75−#ifdef CONFIG_VMAP_STACK
76− tovirt(r5, r5)
77−#endif
7869 blt+ 112f /* assume user more likely */
79− lis r5, (swapper_pg_dir - ADDR_OFFSET)@ha /* if kernel address, use */
80− addi r5 ,r5 ,(swapper_pg_dir - ADDR_OFFSET)@l /* kernel page table */
70+ lis r5, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
71+ addi r5 ,r5 ,(swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */
8172 rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */
8273 112:
8374 #ifndef CONFIG_PTE_64BIT
@@ -89,9 +80,6 @@ _GLOBAL(hash_page) · 5 unmodified lines
8980 lwzx r8,r8,r5 /* Get L1 entry */
9081 rlwinm. r8,r8,0,0,20 /* extract pt base address */
9182 #endif
92−#ifdef CONFIG_VMAP_STACK
93− tovirt(r8, r8)
94−#endif
9583 #ifdef CONFIG_SMP
9684 beq- hash_page_out /* return if no mapping */
9785 #else
@@ -143,30 +131,36 @@ retry: · 45 unmodified lines
143131 bne- retry /* retry if someone got there first */
144132
145133 mfsrin r3,r4 /* get segment reg for segment */
134+#ifndef CONFIG_VMAP_STACK
146135 mfctr r0
147136 stw r0,_CTR(r11)
137+#endif
148138 bl create_hpte /* add the hash table entry */
149139
150140 #ifdef CONFIG_SMP
151141 eieio
152− lis r8, (mmu_hash_lock - ADDR_OFFSET)@ha
142+ lis r8, (mmu_hash_lock - PAGE_OFFSET)@ha
153143 li r0,0
154− stw r0, (mmu_hash_lock - ADDR_OFFSET)@l(r8)
144+ stw r0, (mmu_hash_lock - PAGE_OFFSET)@l(r8)
155145 #endif
156146
147+#ifdef CONFIG_VMAP_STACK
148+ b fast_hash_page_return
149+#else
157150 /* Return from the exception */
158151 lwz r5,_CTR(r11)
159152 mtctr r5
160153 lwz r0,GPR0(r11)
161154 lwz r8,GPR8(r11)
162155 b fast_exception_return
156+#endif
163157
164158 #ifdef CONFIG_SMP
165159 hash_page_out:
166160 eieio
167− lis r8, (mmu_hash_lock - ADDR_OFFSET)@ha
161+ lis r8, (mmu_hash_lock - PAGE_OFFSET)@ha
168162 li r0,0
169− stw r0, (mmu_hash_lock - ADDR_OFFSET)@l(r8)
163+ stw r0, (mmu_hash_lock - PAGE_OFFSET)@l(r8)
170164 blr
171165 #endif /* CONFIG_SMP */
172166
@@ -341,7 +335,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 168 unmodified lines
341335 patch_site 1f, patch__hash_page_A1
342336 patch_site 2f, patch__hash_page_A2
343337 /* Get the address of the primary PTE group in the hash table (r3) */
344−0: lis r0, (Hash_base - ADDR_OFFSET)@h /* base address of hash table */
338+0: lis r0, (Hash_base - PAGE_OFFSET)@h /* base address of hash table */
345339 1: rlwimi r0,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */
346340 2: rlwinm r3,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */
347341 xor r3,r3,r0 /* make primary hash */
@@ -355,10 +349,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 7 unmodified lines
355349 beq+ 10f /* no PTE: go look for an empty slot */
356350 tlbie r4
357351
358− lis r4, (htab_hash_searches - ADDR_OFFSET)@ha
359− lwz r6, (htab_hash_searches - ADDR_OFFSET)@l(r4)
352+ lis r4, (htab_hash_searches - PAGE_OFFSET)@ha
353+ lwz r6, (htab_hash_searches - PAGE_OFFSET)@l(r4)
360354 addi r6,r6,1 /* count how many searches we do */
361− stw r6, (htab_hash_searches - ADDR_OFFSET)@l(r4)
355+ stw r6, (htab_hash_searches - PAGE_OFFSET)@l(r4)
362356
363357 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */
364358 mtctr r0
@@ -390,10 +384,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 25 unmodified lines
390384 beq+ found_empty
391385
392386 /* update counter of times that the primary PTEG is full */
393− lis r4, (primary_pteg_full - ADDR_OFFSET)@ha
394− lwz r6, (primary_pteg_full - ADDR_OFFSET)@l(r4)
387+ lis r4, (primary_pteg_full - PAGE_OFFSET)@ha
388+ lwz r6, (primary_pteg_full - PAGE_OFFSET)@l(r4)
395389 addi r6,r6,1
396− stw r6, (primary_pteg_full - ADDR_OFFSET)@l(r4)
390+ stw r6, (primary_pteg_full - PAGE_OFFSET)@l(r4)
397391
398392 patch_site 0f, patch__hash_page_C
399393 /* Search the secondary PTEG for an empty slot */
@@ -427,8 +421,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 27 unmodified lines
427421 * lockup here but that shouldn't happen
428422 */
429423
430−1: lis r4, (next_slot - ADDR_OFFSET)@ha /* get next evict slot */
431− lwz r6, (next_slot - ADDR_OFFSET)@l(r4)
424+1: lis r4, (next_slot - PAGE_OFFSET)@ha /* get next evict slot */
425+ lwz r6, (next_slot - PAGE_OFFSET)@l(r4)
432426 addi r6,r6,HPTE_SIZE /* search for candidate */
433427 andi. r6,r6,7*HPTE_SIZE
434428 stw r6,next_slot@l(r4)
arch/powerpc/mm/book3s32/mmu.c+2−8
@@ -413,7 +413,7 @@ void __init MMU_init_hw(void) · 412 unmodified lines
413413 void __init MMU_init_hw_patch(void)
414414 {
415415 unsigned int hmask = Hash_mask >> (16 - LG_HPTEG_SIZE);
416− unsigned int hash;
416+ unsigned int hash = (unsigned int)Hash - PAGE_OFFSET;
417417
418418 if (ppc_md.progress)
419419 ppc_md.progress("hash:patch", 0x345);
@@ -425,11 +425,6 @@ void __init MMU_init_hw_patch(void) · 5 unmodified lines
425425 /*
426426 * Patch up the instructions in hashtable.S:create_hpte
427427 */
428− if (IS_ENABLED(CONFIG_VMAP_STACK))
429− hash = (unsigned int)Hash;
430− else
431− hash = (unsigned int)Hash - PAGE_OFFSET;
432−
433428 modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16);
434429 modify_instruction_site(&patch__hash_page_A1, 0x7c0, hash_mb << 6);
435430 modify_instruction_site(&patch__hash_page_A2, 0x7c0, hash_mb2 << 6);
@@ -439,8 +434,7 @@ void __init MMU_init_hw_patch(void) · 3 unmodified lines
439434 /*
440435 * Patch up the instructions in hashtable.S:flush_hash_page
441436 */
442− modify_instruction_site(&patch__flush_hash_A0, 0xffff,
443− ((unsigned int)Hash - PAGE_OFFSET) >> 16);
437+ modify_instruction_site(&patch__flush_hash_A0, 0xffff, hash >> 16);
444438 modify_instruction_site(&patch__flush_hash_A1, 0x7c0, hash_mb << 6);
445439 modify_instruction_site(&patch__flush_hash_A2, 0x7c0, hash_mb2 << 6);
446440 modify_instruction_site(&patch__flush_hash_B, 0xffff, hmask);
arch/powerpc/mm/hugetlbpage.c+18−11
@@ -53,20 +53,24 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, · 52 unmodified lines
5353 if (pshift >= pdshift) {
5454 cachep = PGT_CACHE(PTE_T_ORDER);
5555 num_hugepd = 1 << (pshift - pdshift);
56+ new = NULL;
5657 } else if (IS_ENABLED(CONFIG_PPC_8xx)) {
57− cachep = PGT_CACHE(PTE_INDEX_SIZE);
58+ cachep = NULL;
5859 num_hugepd = 1;
60+ new = pte_alloc_one(mm);
5961 } else {
6062 cachep = PGT_CACHE(pdshift - pshift);
6163 num_hugepd = 1;
64+ new = NULL;
6265 }
6366
64− if (!cachep) {
67+ if (!cachep && !new) {
6568 WARN_ONCE(1, "No page table cache created for hugetlb tables");
6669 return -ENOMEM;
6770 }
6871
69− new = kmem_cache_alloc(cachep, pgtable_gfp_flags(mm, GFP_KERNEL));
72+ if (cachep)
73+ new = kmem_cache_alloc(cachep, pgtable_gfp_flags(mm, GFP_KERNEL));
7074
7175 BUG_ON(pshift > HUGEPD_SHIFT_MASK);
7276 BUG_ON((unsigned long)new & HUGEPD_SHIFT_MASK);
@@ -97,7 +101,10 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, · 24 unmodified lines
97101 if (i < num_hugepd) {
98102 for (i = i - 1 ; i >= 0; i--, hpdp--)
99103 *hpdp = __hugepd(0);
100− kmem_cache_free(cachep, new);
104+ if (cachep)
105+ kmem_cache_free(cachep, new);
106+ else
107+ pte_free(mm, new);
101108 } else {
102109 kmemleak_ignore(new);
103110 }
@@ -324,8 +331,7 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif · 220 unmodified lines
324331 if (shift >= pdshift)
325332 hugepd_free(tlb, hugepte);
326333 else if (IS_ENABLED(CONFIG_PPC_8xx))
327− pgtable_free_tlb(tlb, hugepte,
328− get_hugepd_cache_index(PTE_INDEX_SIZE));
334+ pgtable_free_tlb(tlb, hugepte, 0);
329335 else
330336 pgtable_free_tlb(tlb, hugepte,
331337 get_hugepd_cache_index(pdshift - shift));
@@ -639,12 +645,13 @@ static int __init hugetlbpage_init(void) · 307 unmodified lines
639645 * if we have pdshift and shift value same, we don't
640646 * use pgt cache for hugepd.
641647 */
642− if (pdshift > shift && IS_ENABLED(CONFIG_PPC_8xx))
643− pgtable_cache_add(PTE_INDEX_SIZE);
644− else if (pdshift > shift)
645− pgtable_cache_add(pdshift - shift);
646− else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || IS_ENABLED(CONFIG_PPC_8xx))
648+ if (pdshift > shift) {
649+ if (!IS_ENABLED(CONFIG_PPC_8xx))
650+ pgtable_cache_add(pdshift - shift);
651+ } else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) ||
652+ IS_ENABLED(CONFIG_PPC_8xx)) {
647653 pgtable_cache_add(PTE_T_ORDER);
654+ }
648655
649656 configured = true;
650657 }
arch/powerpc/mm/kasan/kasan_init_32.c+1−2
@@ -185,8 +185,7 @@ u8 __initdata early_hash[256 << 10] __aligned(256 << 10) = {0}; · 184 unmodified lines
185185
186186 static void __init kasan_early_hash_table(void)
187187 {
188− unsigned int hash = IS_ENABLED(CONFIG_VMAP_STACK) ? (unsigned int)early_hash :
189− __pa(early_hash);
188+ unsigned int hash = __pa(early_hash);
190189
191190 modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16);
192191 modify_instruction_site(&patch__flush_hash_A0, 0xffff, hash >> 16);
arch/powerpc/xmon/xmon.c+5−0
@@ -3435,6 +3435,11 @@ getstring(char *s, int size) · 3434 unmodified lines
34353435 int c;
34363436
34373437 c = skipbl();
3438+ if (c == '\n') {
3439+ *s = 0;
3440+ return;
3441+ }
3442+
34383443 do {
34393444 if( size > 1 ){
34403445 *s++ = c;
arch/riscv/boot/.gitignore+2−0
@@ -1,2 +1,4 @@
11 Image
22 Image.gz
3+loader
4+loader.lds
arch/riscv/include/asm/csr.h+12−0
@@ -72,6 +72,16 @@ · 71 unmodified lines
7272 #define EXC_LOAD_PAGE_FAULT 13
7373 #define EXC_STORE_PAGE_FAULT 15
7474
75+/* PMP configuration */
76+#define PMP_R 0x01
77+#define PMP_W 0x02
78+#define PMP_X 0x04
79+#define PMP_A 0x18
80+#define PMP_A_TOR 0x08
81+#define PMP_A_NA4 0x10
82+#define PMP_A_NAPOT 0x18
83+#define PMP_L 0x80
84+
7585 /* symbolic CSR names: */
7686 #define CSR_CYCLE 0xc00
7787 #define CSR_TIME 0xc01
@@ -100,6 +110,8 @@ · 22 unmodified lines
100110 #define CSR_MCAUSE 0x342
101111 #define CSR_MTVAL 0x343
102112 #define CSR_MIP 0x344
113+#define CSR_PMPCFG0 0x3a0
114+#define CSR_PMPADDR0 0x3b0
103115 #define CSR_MHARTID 0xf14
104116
105117 #ifdef CONFIG_RISCV_M_MODE
arch/riscv/kernel/head.S+6−0
@@ -58,6 +58,12 @@ _start_kernel: · 57 unmodified lines
5858 /* Reset all registers except ra, a0, a1 */
5959 call reset_regs
6060
61+ /* Setup a PMP to permit access to all of memory. */
62+ li a0, -1
63+ csrw CSR_PMPADDR0, a0
64+ li a0, (PMP_A_NAPOT | PMP_R | PMP_W | PMP_X)
65+ csrw CSR_PMPCFG0, a0
66+
6167 /*
6268 * The hartid in a0 is expected later on, and we have no firmware
6369 * to hand it to us.
arch/riscv/kernel/traps.c+2−2
@@ -156,6 +156,6 @@ void __init trap_init(void) · 155 unmodified lines
156156 csr_write(CSR_SCRATCH, 0);
157157 /* Set the exception vector address */
158158 csr_write(CSR_TVEC, &handle_exception);
159− /* Enable all interrupts */
160− csr_write(CSR_IE, -1);
159+ /* Enable interrupts */
160+ csr_write(CSR_IE, IE_SIE | IE_EIE);
161161 }
arch/riscv/mm/kasan_init.c+31−22
@@ -19,18 +19,20 @@ asmlinkage void __init kasan_early_init(void) · 18 unmodified lines
1919 for (i = 0; i < PTRS_PER_PTE; ++i)
2020 set_pte(kasan_early_shadow_pte + i,
2121 mk_pte(virt_to_page(kasan_early_shadow_page),
22− PAGE_KERNEL));
22+ PAGE_KERNEL));
2323
2424 for (i = 0; i < PTRS_PER_PMD; ++i)
2525 set_pmd(kasan_early_shadow_pmd + i,
26− pfn_pmd(PFN_DOWN(__pa((uintptr_t)kasan_early_shadow_pte)),
27− __pgprot(_PAGE_TABLE)));
26+ pfn_pmd(PFN_DOWN
27+ (__pa((uintptr_t) kasan_early_shadow_pte)),
28+ __pgprot(_PAGE_TABLE)));
2829
2930 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;
3031 i += PGDIR_SIZE, ++pgd)
3132 set_pgd(pgd,
32− pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))),
33− __pgprot(_PAGE_TABLE)));
33+ pfn_pgd(PFN_DOWN
34+ (__pa(((uintptr_t) kasan_early_shadow_pmd))),
35+ __pgprot(_PAGE_TABLE)));
3436
3537 /* init for swapper_pg_dir */
3638 pgd = pgd_offset_k(KASAN_SHADOW_START);
@@ -38,37 +40,43 @@ asmlinkage void __init kasan_early_init(void) · 1 unmodified line
3840 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;
3941 i += PGDIR_SIZE, ++pgd)
4042 set_pgd(pgd,
41− pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))),
42− __pgprot(_PAGE_TABLE)));
43+ pfn_pgd(PFN_DOWN
44+ (__pa(((uintptr_t) kasan_early_shadow_pmd))),
45+ __pgprot(_PAGE_TABLE)));
4346
4447 flush_tlb_all();
4548 }
4649
4750 static void __init populate(void *start, void *end)
4851 {
49− unsigned long i;
52+ unsigned long i, offset;
5053 unsigned long vaddr = (unsigned long)start & PAGE_MASK;
5154 unsigned long vend = PAGE_ALIGN((unsigned long)end);
5255 unsigned long n_pages = (vend - vaddr) / PAGE_SIZE;
56+ unsigned long n_ptes =
57+ ((n_pages + PTRS_PER_PTE) & -PTRS_PER_PTE) / PTRS_PER_PTE;
5358 unsigned long n_pmds =
54− (n_pages % PTRS_PER_PTE) ? n_pages / PTRS_PER_PTE + 1 :
55− n_pages / PTRS_PER_PTE;
59+ ((n_ptes + PTRS_PER_PMD) & -PTRS_PER_PMD) / PTRS_PER_PMD;
60+
61+ pte_t *pte =
62+ memblock_alloc(n_ptes * PTRS_PER_PTE * sizeof(pte_t), PAGE_SIZE);
63+ pmd_t *pmd =
64+ memblock_alloc(n_pmds * PTRS_PER_PMD * sizeof(pmd_t), PAGE_SIZE);
5665 pgd_t *pgd = pgd_offset_k(vaddr);
57− pmd_t *pmd = memblock_alloc(n_pmds * sizeof(pmd_t), PAGE_SIZE);
58− pte_t *pte = memblock_alloc(n_pages * sizeof(pte_t), PAGE_SIZE);
5966
6067 for (i = 0; i < n_pages; i++) {
6168 phys_addr_t phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
62−
63− set_pte(pte + i, pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
69+ set_pte(&pte[i], pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
6470 }
6571
66− for (i = 0; i < n_pmds; ++pgd, i += PTRS_PER_PMD)
67− set_pgd(pgd, pfn_pgd(PFN_DOWN(__pa(((uintptr_t)(pmd + i)))),
72+ for (i = 0, offset = 0; i < n_ptes; i++, offset += PTRS_PER_PTE)
73+ set_pmd(&pmd[i],
74+ pfn_pmd(PFN_DOWN(__pa(&pte[offset])),
6875 __pgprot(_PAGE_TABLE)));
6976
70− for (i = 0; i < n_pages; ++pmd, i += PTRS_PER_PTE)
71− set_pmd(pmd, pfn_pmd(PFN_DOWN(__pa((uintptr_t)(pte + i))),
77+ for (i = 0, offset = 0; i < n_pmds; i++, offset += PTRS_PER_PMD)
78+ set_pgd(&pgd[i],
79+ pfn_pgd(PFN_DOWN(__pa(&pmd[offset])),
7280 __pgprot(_PAGE_TABLE)));
7381
7482 flush_tlb_all();
@@ -81,7 +89,8 @@ void __init kasan_init(void) · 6 unmodified lines
8189 unsigned long i;
8290
8391 kasan_populate_early_shadow((void *)KASAN_SHADOW_START,
84− (void *)kasan_mem_to_shadow((void *)VMALLOC_END));
92+ (void *)kasan_mem_to_shadow((void *)
93+ VMALLOC_END));
8594
8695 for_each_memblock(memory, reg) {
8796 void *start = (void *)__va(reg->base);
@@ -90,14 +99,14 @@ void __init kasan_init(void) · 2 unmodified lines
9099 if (start >= end)
91100 break;
92101
93− populate(kasan_mem_to_shadow(start),
94− kasan_mem_to_shadow(end));
102+ populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end));
95103 };
96104
97105 for (i = 0; i < PTRS_PER_PTE; i++)
98106 set_pte(&kasan_early_shadow_pte[i],
99107 mk_pte(virt_to_page(kasan_early_shadow_page),
100− __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_ACCESSED)));
108+ __pgprot(_PAGE_PRESENT | _PAGE_READ |
109+ _PAGE_ACCESSED)));
101110
102111 memset(kasan_early_shadow_page, 0, PAGE_SIZE);
103112 init_task.kasan_depth = 0;
arch/s390/Makefile+1−1
@@ -146,7 +146,7 @@ all: bzImage · 145 unmodified lines
146146 #KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg...
147147 KBUILD_IMAGE := $(boot)/bzImage
148148
149−install: vmlinux
149+install:
150150 $(Q)$(MAKE) $(build)=$(boot) $@
151151
152152 bzImage: vmlinux
arch/s390/boot/Makefile+1−1
@@ -70,7 +70,7 @@ $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE · 69 unmodified lines
7070 $(obj)/startup.a: $(OBJECTS) FORCE
7171 $(call if_changed,ar)
7272
73−install: $(CONFIGURE) $(obj)/bzImage
73+install:
7474 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
7575 System.map "$(INSTALL_PATH)"
7676
arch/s390/boot/kaslr.c+1−1
@@ -75,7 +75,7 @@ static unsigned long get_random(unsigned long limit) · 74 unmodified lines
7575 *(unsigned long *) prng.parm_block ^= seed;
7676 for (i = 0; i < 16; i++) {
7777 cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block,
78− (char *) entropy, (char *) entropy,
78+ (u8 *) entropy, (u8 *) entropy,
7979 sizeof(entropy));
8080 memcpy(prng.parm_block, entropy, sizeof(entropy));
8181 }
arch/s390/boot/uv.c+2−1
@@ -15,7 +15,8 @@ void uv_query_info(void) · 14 unmodified lines
1515 if (!test_facility(158))
1616 return;
1717
18− if (uv_call(0, (uint64_t)&uvcb))
18+ /* rc==0x100 means that there is additional data we do not process */
19+ if (uv_call(0, (uint64_t)&uvcb) && uvcb.header.rc != 0x100)
1920 return;
2021
2122 if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
arch/s390/configs/debug_defconfig+13−15
@@ -53,6 +53,7 @@ CONFIG_VFIO_AP=m · 52 unmodified lines
5353 CONFIG_CRASH_DUMP=y
5454 CONFIG_HIBERNATION=y
5555 CONFIG_PM_DEBUG=y
56+CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
5657 CONFIG_CMM=m
5758 CONFIG_APPLDATA_BASE=y
5859 CONFIG_KVM=m
@@ -474,7 +475,6 @@ CONFIG_NLMON=m · 415 unmodified lines
474475 # CONFIG_NET_VENDOR_EMULEX is not set
475476 # CONFIG_NET_VENDOR_EZCHIP is not set
476477 # CONFIG_NET_VENDOR_GOOGLE is not set
477−# CONFIG_NET_VENDOR_HP is not set
478478 # CONFIG_NET_VENDOR_HUAWEI is not set
479479 # CONFIG_NET_VENDOR_INTEL is not set
480480 # CONFIG_NET_VENDOR_MARVELL is not set
@@ -684,7 +684,6 @@ CONFIG_CRYPTO_ADIANTUM=m · 203 unmodified lines
684684 CONFIG_CRYPTO_XCBC=m
685685 CONFIG_CRYPTO_VMAC=m
686686 CONFIG_CRYPTO_CRC32=m
687−CONFIG_CRYPTO_XXHASH=m
688687 CONFIG_CRYPTO_MICHAEL_MIC=m
689688 CONFIG_CRYPTO_RMD128=m
690689 CONFIG_CRYPTO_RMD160=m
@@ -748,7 +747,6 @@ CONFIG_DEBUG_INFO_DWARF4=y · 57 unmodified lines
748747 CONFIG_GDB_SCRIPTS=y
749748 CONFIG_FRAME_WARN=1024
750749 CONFIG_HEADERS_INSTALL=y
751−CONFIG_HEADERS_CHECK=y
752750 CONFIG_DEBUG_SECTION_MISMATCH=y
753751 CONFIG_MAGIC_SYSRQ=y
754752 CONFIG_DEBUG_PAGEALLOC=y
@@ -772,9 +770,9 @@ CONFIG_DEBUG_MEMORY_INIT=y · 17 unmodified lines
772770 CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
773771 CONFIG_DEBUG_PER_CPU_MAPS=y
774772 CONFIG_DEBUG_SHIRQ=y
773+CONFIG_PANIC_ON_OOPS=y
775774 CONFIG_DETECT_HUNG_TASK=y
776775 CONFIG_WQ_WATCHDOG=y
777−CONFIG_PANIC_ON_OOPS=y
778776 CONFIG_DEBUG_TIMEKEEPING=y
779777 CONFIG_PROVE_LOCKING=y
780778 CONFIG_LOCK_STAT=y
@@ -783,9 +781,20 @@ CONFIG_DEBUG_ATOMIC_SLEEP=y · 2 unmodified lines
783781 CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
784782 CONFIG_DEBUG_SG=y
785783 CONFIG_DEBUG_NOTIFIERS=y
784+CONFIG_BUG_ON_DATA_CORRUPTION=y
786785 CONFIG_DEBUG_CREDENTIALS=y
787786 CONFIG_RCU_TORTURE_TEST=m
788787 CONFIG_RCU_CPU_STALL_TIMEOUT=300
788+CONFIG_LATENCYTOP=y
789+CONFIG_FUNCTION_PROFILER=y
790+CONFIG_STACK_TRACER=y
791+CONFIG_IRQSOFF_TRACER=y
792+CONFIG_PREEMPT_TRACER=y
793+CONFIG_SCHED_TRACER=y
794+CONFIG_FTRACE_SYSCALLS=y
795+CONFIG_BLK_DEV_IO_TRACE=y
796+CONFIG_HIST_TRIGGERS=y
797+CONFIG_S390_PTDUMP=y
789798 CONFIG_NOTIFIER_ERROR_INJECTION=m
790799 CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m
791800 CONFIG_FAULT_INJECTION=y
@@ -796,15 +805,6 @@ CONFIG_FAIL_IO_TIMEOUT=y · 4 unmodified lines
796805 CONFIG_FAIL_FUTEX=y
797806 CONFIG_FAULT_INJECTION_DEBUG_FS=y
798807 CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
799−CONFIG_LATENCYTOP=y
800−CONFIG_IRQSOFF_TRACER=y
801−CONFIG_PREEMPT_TRACER=y
802−CONFIG_SCHED_TRACER=y
803−CONFIG_FTRACE_SYSCALLS=y
804−CONFIG_STACK_TRACER=y
805−CONFIG_BLK_DEV_IO_TRACE=y
806−CONFIG_FUNCTION_PROFILER=y
807−CONFIG_HIST_TRIGGERS=y
808808 CONFIG_LKDTM=m
809809 CONFIG_TEST_LIST_SORT=y
810810 CONFIG_TEST_SORT=y
@@ -814,5 +814,3 @@ CONFIG_INTERVAL_TREE_TEST=m · 3 unmodified lines
814814 CONFIG_PERCPU_TEST=m
815815 CONFIG_ATOMIC64_SELFTEST=y
816816 CONFIG_TEST_BPF=m
817−CONFIG_BUG_ON_DATA_CORRUPTION=y
818−CONFIG_S390_PTDUMP=y
arch/s390/configs/defconfig+5−6
@@ -53,6 +53,7 @@ CONFIG_VFIO_AP=m · 52 unmodified lines
5353 CONFIG_CRASH_DUMP=y
5454 CONFIG_HIBERNATION=y
5555 CONFIG_PM_DEBUG=y
56+CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
5657 CONFIG_CMM=m
5758 CONFIG_APPLDATA_BASE=y
5859 CONFIG_KVM=m
@@ -470,7 +471,6 @@ CONFIG_NLMON=m · 411 unmodified lines
470471 # CONFIG_NET_VENDOR_EMULEX is not set
471472 # CONFIG_NET_VENDOR_EZCHIP is not set
472473 # CONFIG_NET_VENDOR_GOOGLE is not set
473−# CONFIG_NET_VENDOR_HP is not set
474474 # CONFIG_NET_VENDOR_HUAWEI is not set
475475 # CONFIG_NET_VENDOR_INTEL is not set
476476 # CONFIG_NET_VENDOR_MARVELL is not set
@@ -677,7 +677,6 @@ CONFIG_CRYPTO_ADIANTUM=m · 200 unmodified lines
677677 CONFIG_CRYPTO_XCBC=m
678678 CONFIG_CRYPTO_VMAC=m
679679 CONFIG_CRYPTO_CRC32=m
680−CONFIG_CRYPTO_XXHASH=m
681680 CONFIG_CRYPTO_MICHAEL_MIC=m
682681 CONFIG_CRYPTO_RMD128=m
683682 CONFIG_CRYPTO_RMD160=m
@@ -739,18 +738,18 @@ CONFIG_DEBUG_SECTION_MISMATCH=y · 55 unmodified lines
739738 CONFIG_MAGIC_SYSRQ=y
740739 CONFIG_DEBUG_MEMORY_INIT=y
741740 CONFIG_PANIC_ON_OOPS=y
741+CONFIG_BUG_ON_DATA_CORRUPTION=y
742742 CONFIG_RCU_TORTURE_TEST=m
743743 CONFIG_RCU_CPU_STALL_TIMEOUT=60
744744 CONFIG_LATENCYTOP=y
745+CONFIG_FUNCTION_PROFILER=y
746+CONFIG_STACK_TRACER=y
745747 CONFIG_SCHED_TRACER=y
746748 CONFIG_FTRACE_SYSCALLS=y
747−CONFIG_STACK_TRACER=y
748749 CONFIG_BLK_DEV_IO_TRACE=y
749−CONFIG_FUNCTION_PROFILER=y
750750 CONFIG_HIST_TRIGGERS=y
751+CONFIG_S390_PTDUMP=y
751752 CONFIG_LKDTM=m
752753 CONFIG_PERCPU_TEST=m
753754 CONFIG_ATOMIC64_SELFTEST=y
754755 CONFIG_TEST_BPF=m
755−CONFIG_BUG_ON_DATA_CORRUPTION=y
756−CONFIG_S390_PTDUMP=y
arch/s390/include/asm/page.h+1−1
@@ -42,7 +42,7 @@ void __storage_key_init_range(unsigned long start, unsigned long end); · 41 unmodified lines
4242
4343 static inline void storage_key_init_range(unsigned long start, unsigned long end)
4444 {
45− if (PAGE_DEFAULT_KEY)
45+ if (PAGE_DEFAULT_KEY != 0)
4646 __storage_key_init_range(start, end);
4747 }
4848
arch/s390/include/asm/processor.h+0−1
@@ -84,7 +84,6 @@ void s390_update_cpu_mhz(void); · 83 unmodified lines
8484 void cpu_detect_mhz_feature(void);
8585
8686 extern const struct seq_operations cpuinfo_op;
87−extern int sysctl_ieee_emulation_warnings;
8887 extern void execve_tail(void);
8988 extern void __bpon(void);
9089
arch/s390/include/asm/qdio.h+3−3
@@ -201,7 +201,7 @@ struct slib { · 200 unmodified lines
201201 * @scount: SBAL count
202202 * @sflags: whole SBAL flags
203203 * @length: length
204− * @addr: address
204+ * @addr: absolute data address
205205 */
206206 struct qdio_buffer_element {
207207 u8 eflags;
@@ -211,7 +211,7 @@ struct qdio_buffer_element { · 3 unmodified lines
211211 u8 scount;
212212 u8 sflags;
213213 u32 length;
214− void *addr;
214+ u64 addr;
215215 } __attribute__ ((packed, aligned(16)));
216216
217217 /**
@@ -227,7 +227,7 @@ struct qdio_buffer { · 9 unmodified lines
227227 * @sbal: absolute SBAL address
228228 */
229229 struct sl_element {
230− unsigned long sbal;
230+ u64 sbal;
231231 } __attribute__ ((packed));
232232
233233 /**
arch/s390/include/asm/timex.h+1−1
@@ -155,7 +155,7 @@ static inline void get_tod_clock_ext(char *clk) · 154 unmodified lines
155155
156156 static inline unsigned long long get_tod_clock(void)
157157 {
158− unsigned char clk[STORE_CLOCK_EXT_SIZE];
158+ char clk[STORE_CLOCK_EXT_SIZE];
159159
160160 get_tod_clock_ext(clk);
161161 return *((unsigned long long *)&clk[1]);
arch/x86/boot/compressed/kaslr_64.c+0−3
@@ -29,9 +29,6 @@ · 28 unmodified lines
2929 #define __PAGE_OFFSET __PAGE_OFFSET_BASE
3030 #include "../../mm/ident_map.c"
3131
32−/* Used by pgtable.h asm code to force instruction serialization. */
33−unsigned long __force_order;
34−
3532 /* Used to track our page table allocation area. */
3633 struct alloc_pgt_data {
3734 unsigned char *pgt_buf;
arch/x86/events/amd/core.c+1−0
@@ -250,6 +250,7 @@ static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] = · 249 unmodified lines
250250 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
251251 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
252252 [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
253+ [PERF_COUNT_HW_CACHE_MISSES] = 0x0964,
253254 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
254255 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
255256 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x0287,
arch/x86/events/intel/core.c+1−0
@@ -4765,6 +4765,7 @@ __init int intel_pmu_init(void) · 4764 unmodified lines
47654765 break;
47664766
47674767 case INTEL_FAM6_ATOM_TREMONT_D:
4768+ case INTEL_FAM6_ATOM_TREMONT:
47684769 x86_pmu.late_ack = true;
47694770 memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
47704771 sizeof(hw_cache_event_ids));
arch/x86/events/intel/cstate.c+13−9
@@ -40,17 +40,18 @@ · 39 unmodified lines
4040 * Model specific counters:
4141 * MSR_CORE_C1_RES: CORE C1 Residency Counter
4242 * perf code: 0x00
43− * Available model: SLM,AMT,GLM,CNL
43+ * Available model: SLM,AMT,GLM,CNL,TNT
4444 * Scope: Core (each processor core has a MSR)
4545 * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter
4646 * perf code: 0x01
4747 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM,
48− * CNL,KBL,CML
48+ * CNL,KBL,CML,TNT
4949 * Scope: Core
5050 * MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter
5151 * perf code: 0x02
5252 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
53− * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL
53+ * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
54+ * TNT
5455 * Scope: Core
5556 * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter
5657 * perf code: 0x03
@@ -60,17 +61,18 @@ · 3 unmodified lines
6061 * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter.
6162 * perf code: 0x00
6263 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL,
63− * KBL,CML,ICL,TGL
64+ * KBL,CML,ICL,TGL,TNT
6465 * Scope: Package (physical package)
6566 * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter.
6667 * perf code: 0x01
6768 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL,
68− * GLM,CNL,KBL,CML,ICL,TGL
69+ * GLM,CNL,KBL,CML,ICL,TGL,TNT
6970 * Scope: Package (physical package)
7071 * MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter.
7172 * perf code: 0x02
72− * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW
73− * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL
73+ * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
74+ * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
75+ * TNT
7476 * Scope: Package (physical package)
7577 * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter.
7678 * perf code: 0x03
@@ -87,7 +89,8 @@ · 10 unmodified lines
8789 * Scope: Package (physical package)
8890 * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter.
8991 * perf code: 0x06
90− * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL
92+ * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL,
93+ * TNT
9194 * Scope: Package (physical package)
9295 *
9396 */
@@ -640,8 +643,9 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { · 546 unmodified lines
640643
641644 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT, glm_cstates),
642645 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_D, glm_cstates),
643−
644646 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_PLUS, glm_cstates),
647+ X86_CSTATES_MODEL(INTEL_FAM6_ATOM_TREMONT_D, glm_cstates),
648+ X86_CSTATES_MODEL(INTEL_FAM6_ATOM_TREMONT, glm_cstates),
645649
646650 X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_L, icl_cstates),
647651 X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE, icl_cstates),
arch/x86/events/intel/ds.c+2−0
@@ -1714,6 +1714,8 @@ intel_pmu_save_and_restart_reload(struct perf_event *event, int count) · 1713 unmodified lines
17141714 old = ((s64)(prev_raw_count << shift) >> shift);
17151715 local64_add(new - old + count * period, &event->count);
17161716
1717+ local64_set(&hwc->period_left, -new);
1718+
17171719 perf_event_update_userpage(event);
17181720
17191721 return 0;
arch/x86/events/msr.c+2−1
@@ -75,8 +75,9 @@ static bool test_intel(int idx, void *data) · 74 unmodified lines
7575
7676 case INTEL_FAM6_ATOM_GOLDMONT:
7777 case INTEL_FAM6_ATOM_GOLDMONT_D:
78−
7978 case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
79+ case INTEL_FAM6_ATOM_TREMONT_D:
80+ case INTEL_FAM6_ATOM_TREMONT:
8081
8182 case INTEL_FAM6_XEON_PHI_KNL:
8283 case INTEL_FAM6_XEON_PHI_KNM:
arch/x86/include/asm/io_bitmap.h+8−1
@@ -19,7 +19,14 @@ struct task_struct; · 18 unmodified lines
1919 void io_bitmap_share(struct task_struct *tsk);
2020 void io_bitmap_exit(void);
2121
22−void tss_update_io_bitmap(void);
22+void native_tss_update_io_bitmap(void);
23+
24+#ifdef CONFIG_PARAVIRT_XXL
25+#include <asm/paravirt.h>
26+#else
27+#define tss_update_io_bitmap native_tss_update_io_bitmap
28+#endif
29+
2330 #else
2431 static inline void io_bitmap_share(struct task_struct *tsk) { }
2532 static inline void io_bitmap_exit(void) { }
arch/x86/include/asm/kvm_emulate.h+12−1
@@ -292,6 +292,14 @@ enum x86emul_mode { · 291 unmodified lines
292292 #define X86EMUL_SMM_MASK (1 << 6)
293293 #define X86EMUL_SMM_INSIDE_NMI_MASK (1 << 7)
294294
295+/*
296+ * fastop functions are declared as taking a never-defined fastop parameter,
297+ * so they can't be called from C directly.
298+ */
299+struct fastop;
300+
301+typedef void (*fastop_t)(struct fastop *);
302+
295303 struct x86_emulate_ctxt {
296304 const struct x86_emulate_ops *ops;
297305
@@ -324,7 +332,10 @@ struct x86_emulate_ctxt { · 26 unmodified lines
324332 struct operand src;
325333 struct operand src2;
326334 struct operand dst;
327− int (*execute)(struct x86_emulate_ctxt *ctxt);
335+ union {
336+ int (*execute)(struct x86_emulate_ctxt *ctxt);
337+ fastop_t fop;
338+ };
328339 int (*check_perm)(struct x86_emulate_ctxt *ctxt);
329340 /*
330341 * The following six fields are cleared together,
arch/x86/include/asm/kvm_host.h+15−4
@@ -781,9 +781,19 @@ struct kvm_vcpu_arch { · 780 unmodified lines
781781 u64 msr_kvm_poll_control;
782782
783783 /*
784− * Indicate whether the access faults on its page table in guest
785− * which is set when fix page fault and used to detect unhandeable
786− * instruction.
784+ * Indicates the guest is trying to write a gfn that contains one or
785+ * more of the PTEs used to translate the write itself, i.e. the access
786+ * is changing its own translation in the guest page tables. KVM exits
787+ * to userspace if emulation of the faulting instruction fails and this
788+ * flag is set, as KVM cannot make forward progress.
789+ *
790+ * If emulation fails for a write to guest page tables, KVM unprotects
791+ * (zaps) the shadow page for the target gfn and resumes the guest to
792+ * retry the non-emulatable instruction (on hardware). Unprotecting the
793+ * gfn doesn't allow forward progress for a self-changing access because
794+ * doing so also zaps the translation for the gfn, i.e. retrying the
795+ * instruction will hit a !PRESENT fault, which results in a new shadow
796+ * page and sends KVM back to square one.
787797 */
788798 bool write_fault_to_shadow_pgtable;
789799
@@ -1112,6 +1122,7 @@ struct kvm_x86_ops { · 322 unmodified lines
11121122 int (*handle_exit)(struct kvm_vcpu *vcpu,
11131123 enum exit_fastpath_completion exit_fastpath);
11141124 int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);
1125+ void (*update_emulated_instruction)(struct kvm_vcpu *vcpu);
11151126 void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
11161127 u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu);
11171128 void (*patch_hypercall)(struct kvm_vcpu *vcpu,
@@ -1136,7 +1147,7 @@ struct kvm_x86_ops { · 18 unmodified lines
11361147 void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
11371148 void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);
11381149 void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu, hpa_t hpa);
1139− void (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
1150+ int (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
11401151 int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);
11411152 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
11421153 int (*set_identity_map_addr)(struct kvm *kvm, u64 ident_addr);
arch/x86/include/asm/msr-index.h+2−0
@@ -512,6 +512,8 @@ · 511 unmodified lines
512512 #define MSR_K7_HWCR 0xc0010015
513513 #define MSR_K7_HWCR_SMMLOCK_BIT 0
514514 #define MSR_K7_HWCR_SMMLOCK BIT_ULL(MSR_K7_HWCR_SMMLOCK_BIT)
515+#define MSR_K7_HWCR_IRPERF_EN_BIT 30
516+#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT)
515517 #define MSR_K7_FID_VID_CTL 0xc0010041
516518 #define MSR_K7_FID_VID_STATUS 0xc0010042
517519
arch/x86/include/asm/paravirt.h+7−0
@@ -295,6 +295,13 @@ static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) · 294 unmodified lines
295295 PVOP_VCALL3(cpu.write_idt_entry, dt, entry, g);
296296 }
297297
298+#ifdef CONFIG_X86_IOPL_IOPERM
299+static inline void tss_update_io_bitmap(void)
300+{
301+ PVOP_VCALL0(cpu.update_io_bitmap);
302+}
303+#endif
304+
298305 static inline void paravirt_activate_mm(struct mm_struct *prev,
299306 struct mm_struct *next)
300307 {
arch/x86/include/asm/paravirt_types.h+4−0
@@ -140,6 +140,10 @@ struct pv_cpu_ops { · 139 unmodified lines
140140
141141 void (*load_sp0)(unsigned long sp0);
142142
143+#ifdef CONFIG_X86_IOPL_IOPERM
144+ void (*update_io_bitmap)(void);
145+#endif
146+
143147 void (*wbinvd)(void);
144148
145149 /* cpuid emulation, mostly so that caps bits can be disabled */
arch/x86/include/asm/vmx.h+1−1
@@ -72,7 +72,7 @@ · 71 unmodified lines
7272 #define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC)
7373 #define SECONDARY_EXEC_PT_USE_GPA VMCS_CONTROL_BIT(PT_USE_GPA)
7474 #define SECONDARY_EXEC_TSC_SCALING VMCS_CONTROL_BIT(TSC_SCALING)
75−#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE 0x04000000
75+#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE VMCS_CONTROL_BIT(USR_WAIT_PAUSE)
7676
7777 #define PIN_BASED_EXT_INTR_MASK VMCS_CONTROL_BIT(INTR_EXITING)
7878 #define PIN_BASED_NMI_EXITING VMCS_CONTROL_BIT(NMI_EXITING)
arch/x86/include/asm/vmxfeatures.h+1−0
@@ -81,6 +81,7 @@ · 80 unmodified lines
8181 #define VMX_FEATURE_MODE_BASED_EPT_EXEC ( 2*32+ 22) /* "ept_mode_based_exec" Enable separate EPT EXEC bits for supervisor vs. user */
8282 #define VMX_FEATURE_PT_USE_GPA ( 2*32+ 24) /* "" Processor Trace logs GPAs */
8383 #define VMX_FEATURE_TSC_SCALING ( 2*32+ 25) /* Scale hardware TSC when read in guest */
84+#define VMX_FEATURE_USR_WAIT_PAUSE ( 2*32+ 26) /* Enable TPAUSE, UMONITOR, UMWAIT in guest */
8485 #define VMX_FEATURE_ENCLV_EXITING ( 2*32+ 28) /* "" VM-Exit on ENCLV (leaf dependent) */
8586
8687 #endif /* _ASM_X86_VMXFEATURES_H */
arch/x86/include/uapi/asm/kvm.h+1−0
@@ -390,6 +390,7 @@ struct kvm_sync_regs { · 389 unmodified lines
390390 #define KVM_STATE_NESTED_GUEST_MODE 0x00000001
391391 #define KVM_STATE_NESTED_RUN_PENDING 0x00000002
392392 #define KVM_STATE_NESTED_EVMCS 0x00000004
393+#define KVM_STATE_NESTED_MTF_PENDING 0x00000008
393394
394395 #define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
395396 #define KVM_STATE_NESTED_SMM_VMXON 0x00000002
arch/x86/kernel/cpu/amd.c+14−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828
2929 static const int amd_erratum_383[];
3030 static const int amd_erratum_400[];
31+static const int amd_erratum_1054[];
3132 static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);
3233
3334 /*
@@ -972,6 +973,15 @@ static void init_amd(struct cpuinfo_x86 *c) · 938 unmodified lines
972973 /* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */
973974 if (!cpu_has(c, X86_FEATURE_XENPV))
974975 set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
976+
977+ /*
978+ * Turn on the Instructions Retired free counter on machines not
979+ * susceptible to erratum #1054 "Instructions Retired Performance
980+ * Counter May Be Inaccurate".
981+ */
982+ if (cpu_has(c, X86_FEATURE_IRPERF) &&
983+ !cpu_has_amd_erratum(c, amd_erratum_1054))
984+ msr_set_bit(MSR_K7_HWCR, MSR_K7_HWCR_IRPERF_EN_BIT);
975985 }
976986
977987 #ifdef CONFIG_X86_32
@@ -1099,6 +1109,10 @@ static const int amd_erratum_400[] = · 121 unmodified lines
10991109 static const int amd_erratum_383[] =
11001110 AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf));
11011111
1112+/* #1054: Instructions Retired Performance Counter May Be Inaccurate */
1113+static const int amd_erratum_1054[] =
1114+ AMD_OSVW_ERRATUM(0, AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf));
1115+
11021116
11031117 static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
11041118 {
arch/x86/kernel/cpu/common.c+1−1
@@ -445,7 +445,7 @@ static __always_inline void setup_pku(struct cpuinfo_x86 *c) · 444 unmodified lines
445445 * cpuid bit to be set. We need to ensure that we
446446 * update that bit in this CPU's "cpu_info".
447447 */
448− get_cpu_cap(c);
448+ set_cpu_cap(c, X86_FEATURE_OSPKE);
449449 }
450450
451451 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
arch/x86/kernel/cpu/mce/amd.c+27−23
@@ -1163,9 +1163,12 @@ static const struct sysfs_ops threshold_ops = { · 1162 unmodified lines
11631163 .store = store,
11641164 };
11651165
1166+static void threshold_block_release(struct kobject *kobj);
1167+
11661168 static struct kobj_type threshold_ktype = {
11671169 .sysfs_ops = &threshold_ops,
11681170 .default_attrs = default_attrs,
1171+ .release = threshold_block_release,
11691172 };
11701173
11711174 static const char *get_name(unsigned int bank, struct threshold_block *b)
@@ -1198,8 +1201,9 @@ static const char *get_name(unsigned int bank, struct threshold_block *b) · 26 unmodified lines
11981201 return buf_mcatype;
11991202 }
12001203
1201−static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank,
1202− unsigned int block, u32 address)
1204+static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb,
1205+ unsigned int bank, unsigned int block,
1206+ u32 address)
12031207 {
12041208 struct threshold_block *b = NULL;
12051209 u32 low, high;
@@ -1243,16 +1247,12 @@ static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, · 37 unmodified lines
12431247
12441248 INIT_LIST_HEAD(&b->miscj);
12451249
1246− if (per_cpu(threshold_banks, cpu)[bank]->blocks) {
1247− list_add(&b->miscj,
1248− &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj);
1249− } else {
1250− per_cpu(threshold_banks, cpu)[bank]->blocks = b;
1251− }
1250+ if (tb->blocks)
1251+ list_add(&b->miscj, &tb->blocks->miscj);
1252+ else
1253+ tb->blocks = b;
12521254
1253− err = kobject_init_and_add(&b->kobj, &threshold_ktype,
1254− per_cpu(threshold_banks, cpu)[bank]->kobj,
1255− get_name(bank, b));
1255+ err = kobject_init_and_add(&b->kobj, &threshold_ktype, tb->kobj, get_name(bank, b));
12561256 if (err)
12571257 goto out_free;
12581258 recurse:
@@ -1260,7 +1260,7 @@ recurse: · 1 unmodified line
12601260 if (!address)
12611261 return 0;
12621262
1263− err = allocate_threshold_blocks(cpu, bank, block, address);
1263+ err = allocate_threshold_blocks(cpu, tb, bank, block, address);
12641264 if (err)
12651265 goto out_free;
12661266
@@ -1345,8 +1345,6 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 78 unmodified lines
13451345 goto out_free;
13461346 }
13471347
1348− per_cpu(threshold_banks, cpu)[bank] = b;
1349−
13501348 if (is_shared_bank(bank)) {
13511349 refcount_set(&b->cpus, 1);
13521350
@@ -1357,9 +1355,13 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 4 unmodified lines
13571355 }
13581356 }
13591357
1360− err = allocate_threshold_blocks(cpu, bank, 0, msr_ops.misc(bank));
1361− if (!err)
1362− goto out;
1358+ err = allocate_threshold_blocks(cpu, b, bank, 0, msr_ops.misc(bank));
1359+ if (err)
1360+ goto out_free;
1361+
1362+ per_cpu(threshold_banks, cpu)[bank] = b;
1363+
1364+ return 0;
13631365
13641366 out_free:
13651367 kfree(b);
@@ -1368,8 +1370,12 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 2 unmodified lines
13681370 return err;
13691371 }
13701372
1371−static void deallocate_threshold_block(unsigned int cpu,
1372− unsigned int bank)
1373+static void threshold_block_release(struct kobject *kobj)
1374+{
1375+ kfree(to_block(kobj));
1376+}
1377+
1378+static void deallocate_threshold_block(unsigned int cpu, unsigned int bank)
13731379 {
13741380 struct threshold_block *pos = NULL;
13751381 struct threshold_block *tmp = NULL;
@@ -1379,13 +1385,11 @@ static void deallocate_threshold_block(unsigned int cpu, · 3 unmodified lines
13791385 return;
13801386
13811387 list_for_each_entry_safe(pos, tmp, &head->blocks->miscj, miscj) {
1382− kobject_put(&pos->kobj);
13831388 list_del(&pos->miscj);
1384− kfree(pos);
1389+ kobject_put(&pos->kobj);
13851390 }
13861391
1387− kfree(per_cpu(threshold_banks, cpu)[bank]->blocks);
1388− per_cpu(threshold_banks, cpu)[bank]->blocks = NULL;
1392+ kobject_put(&head->blocks->kobj);
13891393 }
13901394
13911395 static void __threshold_remove_blocks(struct threshold_bank *b)
arch/x86/kernel/ima_arch.c+2−4
@@ -10,8 +10,6 @@ extern struct boot_params boot_params; · 9 unmodified lines
1010
1111 static enum efi_secureboot_mode get_sb_mode(void)
1212 {
13− efi_char16_t efi_SecureBoot_name[] = L"SecureBoot";
14− efi_char16_t efi_SetupMode_name[] = L"SecureBoot";
1513 efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
1614 efi_status_t status;
1715 unsigned long size;
@@ -25,7 +23,7 @@ static enum efi_secureboot_mode get_sb_mode(void) · 7 unmodified lines
2523 }
2624
2725 /* Get variable contents into buffer */
28− status = efi.get_variable(efi_SecureBoot_name, &efi_variable_guid,
26+ status = efi.get_variable(L"SecureBoot", &efi_variable_guid,
2927 NULL, &size, &secboot);
3028 if (status == EFI_NOT_FOUND) {
3129 pr_info("ima: secureboot mode disabled\n");
@@ -38,7 +36,7 @@ static enum efi_secureboot_mode get_sb_mode(void) · 6 unmodified lines
3836 }
3937
4038 size = sizeof(setupmode);
41− status = efi.get_variable(efi_SetupMode_name, &efi_variable_guid,
39+ status = efi.get_variable(L"SetupMode", &efi_variable_guid,
4240 NULL, &size, &setupmode);
4341
4442 if (status != EFI_SUCCESS) /* ignore unknown SetupMode */
arch/x86/kernel/kvm.c+44−21
@@ -425,7 +425,29 @@ static void __init sev_map_percpu_data(void) · 424 unmodified lines
425425 }
426426 }
427427
428+static bool pv_tlb_flush_supported(void)
429+{
430+ return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
431+ !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
432+ kvm_para_has_feature(KVM_FEATURE_STEAL_TIME));
433+}
434+
435+static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask);
436+
428437 #ifdef CONFIG_SMP
438+
439+static bool pv_ipi_supported(void)
440+{
441+ return kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI);
442+}
443+
444+static bool pv_sched_yield_supported(void)
445+{
446+ return (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
447+ !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
448+ kvm_para_has_feature(KVM_FEATURE_STEAL_TIME));
449+}
450+
429451 #define KVM_IPI_CLUSTER_SIZE (2 * BITS_PER_LONG)
430452
431453 static void __send_ipi_mask(const struct cpumask *mask, int vector)
@@ -490,12 +512,12 @@ static void kvm_send_ipi_mask(const struct cpumask *mask, int vector) · 58 unmodified lines
490512 static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector)
491513 {
492514 unsigned int this_cpu = smp_processor_id();
493− struct cpumask new_mask;
515+ struct cpumask *new_mask = this_cpu_cpumask_var_ptr(__pv_cpu_mask);
494516 const struct cpumask *local_mask;
495517
496− cpumask_copy(&new_mask, mask);
497− cpumask_clear_cpu(this_cpu, &new_mask);
498− local_mask = &new_mask;
518+ cpumask_copy(new_mask, mask);
519+ cpumask_clear_cpu(this_cpu, new_mask);
520+ local_mask = new_mask;
499521 __send_ipi_mask(local_mask, vector);
500522 }
501523
@@ -575,7 +597,6 @@ static void __init kvm_apf_trap_init(void) · 73 unmodified lines
575597 update_intr_gate(X86_TRAP_PF, async_page_fault);
576598 }
577599
578−static DEFINE_PER_CPU(cpumask_var_t, __pv_tlb_mask);
579600
580601 static void kvm_flush_tlb_others(const struct cpumask *cpumask,
581602 const struct flush_tlb_info *info)
@@ -583,7 +604,7 @@ static void kvm_flush_tlb_others(const struct cpumask *cpumask, · 1 unmodified line
583604 u8 state;
584605 int cpu;
585606 struct kvm_steal_time *src;
586− struct cpumask *flushmask = this_cpu_cpumask_var_ptr(__pv_tlb_mask);
607+ struct cpumask *flushmask = this_cpu_cpumask_var_ptr(__pv_cpu_mask);
587608
588609 cpumask_copy(flushmask, cpumask);
589610 /*
@@ -619,11 +640,10 @@ static void __init kvm_guest_init(void) · 29 unmodified lines
619640 pv_ops.time.steal_clock = kvm_steal_clock;
620641 }
621642
622− if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
623− !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
624− kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
643+ if (pv_tlb_flush_supported()) {
625644 pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
626645 pv_ops.mmu.tlb_remove_table = tlb_remove_table;
646+ pr_info("KVM setup pv remote TLB flush\n");
627647 }
628648
629649 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
@@ -632,9 +652,7 @@ static void __init kvm_guest_init(void) · 2 unmodified lines
632652 #ifdef CONFIG_SMP
633653 smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus;
634654 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;
635− if (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
636− !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
637− kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
655+ if (pv_sched_yield_supported()) {
638656 smp_ops.send_call_func_ipi = kvm_smp_send_call_func_ipi;
639657 pr_info("KVM setup pv sched yield\n");
640658 }
@@ -700,7 +718,7 @@ static uint32_t __init kvm_detect(void) · 59 unmodified lines
700718 static void __init kvm_apic_init(void)
701719 {
702720 #if defined(CONFIG_SMP)
703− if (kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI))
721+ if (pv_ipi_supported())
704722 kvm_setup_pv_ipi();
705723 #endif
706724 }
@@ -732,26 +750,31 @@ static __init int activate_jump_labels(void) · 25 unmodified lines
732750 }
733751 arch_initcall(activate_jump_labels);
734752
735−static __init int kvm_setup_pv_tlb_flush(void)
753+static __init int kvm_alloc_cpumask(void)
736754 {
737755 int cpu;
756+ bool alloc = false;
738757
739758 if (!kvm_para_available() || nopv)
740759 return 0;
741760
742− if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
743− !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
744− kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
761+ if (pv_tlb_flush_supported())
762+ alloc = true;
763+
764+#if defined(CONFIG_SMP)
765+ if (pv_ipi_supported())
766+ alloc = true;
767+#endif
768+
769+ if (alloc)
745770 for_each_possible_cpu(cpu) {
746− zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu),
771+ zalloc_cpumask_var_node(per_cpu_ptr(&__pv_cpu_mask, cpu),
747772 GFP_KERNEL, cpu_to_node(cpu));
748773 }
749− pr_info("KVM setup pv remote TLB flush\n");
750− }
751774
752775 return 0;
753776 }
754−arch_initcall(kvm_setup_pv_tlb_flush);
777+arch_initcall(kvm_alloc_cpumask);
755778
756779 #ifdef CONFIG_PARAVIRT_SPINLOCKS
757780
arch/x86/kernel/paravirt.c+5−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <asm/timer.h>
3131 #include <asm/special_insns.h>
3232 #include <asm/tlb.h>
33+#include <asm/io_bitmap.h>
3334
3435 /*
3536 * nop stub, which must not clobber anything *including the stack* to
@@ -341,6 +342,10 @@ struct paravirt_patch_template pv_ops = { · 305 unmodified lines
341342 .cpu.iret = native_iret,
342343 .cpu.swapgs = native_swapgs,
343344
345+#ifdef CONFIG_X86_IOPL_IOPERM
346+ .cpu.update_io_bitmap = native_tss_update_io_bitmap,
347+#endif
348+
344349 .cpu.start_context_switch = paravirt_nop,
345350 .cpu.end_context_switch = paravirt_nop,
346351
arch/x86/kernel/process.c+1−1
@@ -374,7 +374,7 @@ static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm) · 373 unmodified lines
374374 /**
375375 * tss_update_io_bitmap - Update I/O bitmap before exiting to usermode
376376 */
377−void tss_update_io_bitmap(void)
377+void native_tss_update_io_bitmap(void)
378378 {
379379 struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw);
380380 struct thread_struct *t = &current->thread;
arch/x86/kvm/Kconfig+13−0
@@ -59,6 +59,19 @@ config KVM · 58 unmodified lines
5959
6060 If unsure, say N.
6161
62+config KVM_WERROR
63+ bool "Compile KVM with -Werror"
64+ # KASAN may cause the build to fail due to larger frames
65+ default y if X86_64 && !KASAN
66+ # We use the dependency on !COMPILE_TEST to not be enabled
67+ # blindly in allmodconfig or allyesconfig configurations
68+ depends on (X86_64 && !KASAN) || !COMPILE_TEST
69+ depends on EXPERT
70+ help
71+ Add -Werror to the build flags for (and only for) i915.ko.
72+
73+ If in doubt, say "N".
74+
6275 config KVM_INTEL
6376 tristate "KVM for Intel (and compatible) processors support"
6477 depends on KVM && IA32_FEAT_CTL
arch/x86/kvm/Makefile+1−0
@@ -1,6 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
22
33 ccflags-y += -Iarch/x86/kvm
4+ccflags-$(CONFIG_KVM_WERROR) += -Werror
45
56 KVM := ../../../virt/kvm
67
arch/x86/kvm/emulate.c+14−22
@@ -191,25 +191,6 @@ · 190 unmodified lines
191191 #define NR_FASTOP (ilog2(sizeof(ulong)) + 1)
192192 #define FASTOP_SIZE 8
193193
194−/*
195− * fastop functions have a special calling convention:
196− *
197− * dst: rax (in/out)
198− * src: rdx (in/out)
199− * src2: rcx (in)
200− * flags: rflags (in/out)
201− * ex: rsi (in:fastop pointer, out:zero if exception)
202− *
203− * Moreover, they are all exactly FASTOP_SIZE bytes long, so functions for
204− * different operand sizes can be reached by calculation, rather than a jump
205− * table (which would be bigger than the code).
206− *
207− * fastop functions are declared as taking a never-defined fastop parameter,
208− * so they can't be called from C directly.
209− */
210−
211−struct fastop;
212−
213194 struct opcode {
214195 u64 flags : 56;
215196 u64 intercept : 8;
@@ -311,8 +292,19 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) · 95 unmodified lines
311292 #define ON64(x)
312293 #endif
313294
314−typedef void (*fastop_t)(struct fastop *);
315−
295+/*
296+ * fastop functions have a special calling convention:
297+ *
298+ * dst: rax (in/out)
299+ * src: rdx (in/out)
300+ * src2: rcx (in)
301+ * flags: rflags (in/out)
302+ * ex: rsi (in:fastop pointer, out:zero if exception)
303+ *
304+ * Moreover, they are all exactly FASTOP_SIZE bytes long, so functions for
305+ * different operand sizes can be reached by calculation, rather than a jump
306+ * table (which would be bigger than the code).
307+ */
316308 static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
317309
318310 #define __FOP_FUNC(name) \
@@ -5683,7 +5675,7 @@ special_insn: · 5364 unmodified lines
56835675
56845676 if (ctxt->execute) {
56855677 if (ctxt->d & Fastop)
5686− rc = fastop(ctxt, (fastop_t)ctxt->execute);
5678+ rc = fastop(ctxt, ctxt->fop);
56875679 else
56885680 rc = ctxt->execute(ctxt);
56895681 if (rc != X86EMUL_CONTINUE)
arch/x86/kvm/irq_comm.c+1−1
@@ -417,7 +417,7 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, · 416 unmodified lines
417417
418418 kvm_set_msi_irq(vcpu->kvm, entry, &irq);
419419
420− if (irq.level &&
420+ if (irq.trig_mode &&
421421 kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,
422422 irq.dest_id, irq.dest_mode))
423423 __set_bit(irq.vector, ioapic_handled_vectors);
arch/x86/kvm/lapic.c+4−8
@@ -627,9 +627,11 @@ static inline bool pv_eoi_enabled(struct kvm_vcpu *vcpu) · 626 unmodified lines
627627 static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu)
628628 {
629629 u8 val;
630− if (pv_eoi_get_user(vcpu, &val) < 0)
630+ if (pv_eoi_get_user(vcpu, &val) < 0) {
631631 printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n",
632632 (unsigned long long)vcpu->arch.pv_eoi.msr_val);
633+ return false;
634+ }
633635 return val & 0x1;
634636 }
635637
@@ -1046,11 +1048,8 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 410 unmodified lines
10461048 apic->regs + APIC_TMR);
10471049 }
10481050
1049− if (vcpu->arch.apicv_active)
1050− kvm_x86_ops->deliver_posted_interrupt(vcpu, vector);
1051− else {
1051+ if (kvm_x86_ops->deliver_posted_interrupt(vcpu, vector)) {
10521052 kvm_lapic_set_irr(vector, apic);
1053−
10541053 kvm_make_request(KVM_REQ_EVENT, vcpu);
10551054 kvm_vcpu_kick(vcpu);
10561055 }
@@ -1080,9 +1079,6 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 23 unmodified lines
10801079 result = 1;
10811080 /* assumes that there are only KVM_APIC_INIT/SIPI */
10821081 apic->pending_events = (1UL << KVM_APIC_INIT);
1083− /* make sure pending_events is visible before sending
1084− * the request */
1085− smp_wmb();
10861082 kvm_make_request(KVM_REQ_EVENT, vcpu);
10871083 kvm_vcpu_kick(vcpu);
10881084 }
arch/x86/kvm/mmu.h+13−0
@@ -102,6 +102,19 @@ static inline void kvm_mmu_load_cr3(struct kvm_vcpu *vcpu) · 101 unmodified lines
102102 kvm_get_active_pcid(vcpu));
103103 }
104104
105+int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
106+ bool prefault);
107+
108+static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
109+ u32 err, bool prefault)
110+{
111+#ifdef CONFIG_RETPOLINE
112+ if (likely(vcpu->arch.mmu->page_fault == kvm_tdp_page_fault))
113+ return kvm_tdp_page_fault(vcpu, cr2_or_gpa, err, prefault);
114+#endif
115+ return vcpu->arch.mmu->page_fault(vcpu, cr2_or_gpa, err, prefault);
116+}
117+
105118 /*
106119 * Currently, we have two sorts of write-protection, a) the first one
107120 * write-protects guest page to sync the guest modification, b) another one is
arch/x86/kvm/mmu/mmu.c+5−6
@@ -4219,8 +4219,8 @@ int kvm_handle_page_fault(struct kvm_vcpu *vcpu, u64 error_code, · 4218 unmodified lines
42194219 }
42204220 EXPORT_SYMBOL_GPL(kvm_handle_page_fault);
42214221
4222−static int tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
4223− bool prefault)
4222+int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
4223+ bool prefault)
42244224 {
42254225 int max_level;
42264226
@@ -4925,7 +4925,7 @@ static void init_kvm_tdp_mmu(struct kvm_vcpu *vcpu) · 698 unmodified lines
49254925 return;
49264926
49274927 context->mmu_role.as_u64 = new_role.as_u64;
4928− context->page_fault = tdp_page_fault;
4928+ context->page_fault = kvm_tdp_page_fault;
49294929 context->sync_page = nonpaging_sync_page;
49304930 context->invlpg = nonpaging_invlpg;
49314931 context->update_pte = nonpaging_update_pte;
@@ -5436,9 +5436,8 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 error_code, · 504 unmodified lines
54365436 }
54375437
54385438 if (r == RET_PF_INVALID) {
5439− r = vcpu->arch.mmu->page_fault(vcpu, cr2_or_gpa,
5440− lower_32_bits(error_code),
5441− false);
5439+ r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa,
5440+ lower_32_bits(error_code), false);
54425441 WARN_ON(r == RET_PF_INVALID);
54435442 }
54445443
arch/x86/kvm/mmu/paging_tmpl.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
3434 #define PT_HAVE_ACCESSED_DIRTY(mmu) true
3535 #ifdef CONFIG_X86_64
36− #define PT_MAX_FULL_LEVELS 4
36+ #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
3737 #define CMPXCHG cmpxchg
3838 #else
3939 #define CMPXCHG cmpxchg64
arch/x86/kvm/mmutrace.h+1−1
@@ -339,7 +339,7 @@ TRACE_EVENT( · 338 unmodified lines
339339 /* These depend on page entry type, so compute them now. */
340340 __field(bool, r)
341341 __field(bool, x)
342− __field(u8, u)
342+ __field(signed char, u)
343343 ),
344344
345345 TP_fast_assign(
arch/x86/kvm/svm.c+41−31
@@ -57,11 +57,13 @@ · 56 unmodified lines
5757 MODULE_AUTHOR("Qumranet");
5858 MODULE_LICENSE("GPL");
5959
60+#ifdef MODULE
6061 static const struct x86_cpu_id svm_cpu_id[] = {
6162 X86_FEATURE_MATCH(X86_FEATURE_SVM),
6263 {}
6364 };
6465 MODULE_DEVICE_TABLE(x86cpu, svm_cpu_id);
66+#endif
6567
6668 #define IOPM_ALLOC_ORDER 2
6769 #define MSRPM_ALLOC_ORDER 1
@@ -1005,33 +1007,32 @@ static void svm_cpu_uninit(int cpu) · 937 unmodified lines
10051007 static int svm_cpu_init(int cpu)
10061008 {
10071009 struct svm_cpu_data *sd;
1008− int r;
10091010
10101011 sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL);
10111012 if (!sd)
10121013 return -ENOMEM;
10131014 sd->cpu = cpu;
1014− r = -ENOMEM;
10151015 sd->save_area = alloc_page(GFP_KERNEL);
10161016 if (!sd->save_area)
1017− goto err_1;
1017+ goto free_cpu_data;
10181018
10191019 if (svm_sev_enabled()) {
1020− r = -ENOMEM;
10211020 sd->sev_vmcbs = kmalloc_array(max_sev_asid + 1,
10221021 sizeof(void *),
10231022 GFP_KERNEL);
10241023 if (!sd->sev_vmcbs)
1025− goto err_1;
1024+ goto free_save_area;
10261025 }
10271026
10281027 per_cpu(svm_data, cpu) = sd;
10291028
10301029 return 0;
10311030
1032−err_1:
1031+free_save_area:
1032+ __free_page(sd->save_area);
1033+free_cpu_data:
10331034 kfree(sd);
1034− return r;
1035+ return -ENOMEM;
10351036
10361037 }
10371038
@@ -1350,6 +1351,24 @@ static __init void svm_adjust_mmio_mask(void) · 312 unmodified lines
13501351 kvm_mmu_set_mmio_spte_mask(mask, mask, PT_WRITABLE_MASK | PT_USER_MASK);
13511352 }
13521353
1354+static void svm_hardware_teardown(void)
1355+{
1356+ int cpu;
1357+
1358+ if (svm_sev_enabled()) {
1359+ bitmap_free(sev_asid_bitmap);
1360+ bitmap_free(sev_reclaim_asid_bitmap);
1361+
1362+ sev_flush_asids();
1363+ }
1364+
1365+ for_each_possible_cpu(cpu)
1366+ svm_cpu_uninit(cpu);
1367+
1368+ __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
1369+ iopm_base = 0;
1370+}
1371+
13531372 static __init int svm_hardware_setup(void)
13541373 {
13551374 int cpu;
@@ -1463,29 +1482,10 @@ static __init int svm_hardware_setup(void) · 107 unmodified lines
14631482 return 0;
14641483
14651484 err:
1466− __free_pages(iopm_pages, IOPM_ALLOC_ORDER);
1467− iopm_base = 0;
1485+ svm_hardware_teardown();
14681486 return r;
14691487 }
14701488
1471−static __exit void svm_hardware_unsetup(void)
1472−{
1473− int cpu;
1474−
1475− if (svm_sev_enabled()) {
1476− bitmap_free(sev_asid_bitmap);
1477− bitmap_free(sev_reclaim_asid_bitmap);
1478−
1479− sev_flush_asids();
1480− }
1481−
1482− for_each_possible_cpu(cpu)
1483− svm_cpu_uninit(cpu);
1484−
1485− __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
1486− iopm_base = 0;
1487−}
1488−
14891489 static void init_seg(struct vmcb_seg *seg)
14901490 {
14911491 seg->selector = 0;
@@ -2175,7 +2175,6 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 683 unmodified lines
21752175 u32 dummy;
21762176 u32 eax = 1;
21772177
2178− vcpu->arch.microcode_version = 0x01000065;
21792178 svm->spec_ctrl = 0;
21802179 svm->virt_spec_ctrl = 0;
21812180
@@ -2197,8 +2196,9 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 15 unmodified lines
21972196 static int avic_init_vcpu(struct vcpu_svm *svm)
21982197 {
21992198 int ret;
2199+ struct kvm_vcpu *vcpu = &svm->vcpu;
22002200
2201− if (!kvm_vcpu_apicv_active(&svm->vcpu))
2201+ if (!avic || !irqchip_in_kernel(vcpu->kvm))
22022202 return 0;
22032203
22042204 ret = avic_init_backing_page(&svm->vcpu);
@@ -2266,6 +2266,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu) · 61 unmodified lines
22662266 init_vmcb(svm);
22672267
22682268 svm_init_osvw(vcpu);
2269+ vcpu->arch.microcode_version = 0x01000065;
22692270
22702271 return 0;
22712272
@@ -5232,6 +5233,9 @@ static void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) · 2960 unmodified lines
52325233 struct vmcb *vmcb = svm->vmcb;
52335234 bool activated = kvm_vcpu_apicv_active(vcpu);
52345235
5236+ if (!avic)
5237+ return;
5238+
52355239 if (activated) {
52365240 /**
52375241 * During AVIC temporary deactivation, guest could update
@@ -5255,8 +5259,11 @@ static void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) · 17 unmodified lines
52555259 return;
52565260 }
52575261
5258−static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
5262+static int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
52595263 {
5264+ if (!vcpu->arch.apicv_active)
5265+ return -1;
5266+
52605267 kvm_lapic_set_irr(vec, vcpu->arch.apic);
52615268 smp_mb__after_atomic();
52625269
@@ -5268,6 +5275,8 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) · 5 unmodified lines
52685275 put_cpu();
52695276 } else
52705277 kvm_vcpu_wake_up(vcpu);
5278+
5279+ return 0;
52715280 }
52725281
52735282 static bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
@@ -7378,7 +7387,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 2104 unmodified lines
73787387 .cpu_has_kvm_support = has_svm,
73797388 .disabled_by_bios = is_disabled,
73807389 .hardware_setup = svm_hardware_setup,
7381− .hardware_unsetup = svm_hardware_unsetup,
7390+ .hardware_unsetup = svm_hardware_teardown,
73827391 .check_processor_compatibility = svm_check_processor_compat,
73837392 .hardware_enable = svm_hardware_enable,
73847393 .hardware_disable = svm_hardware_disable,
@@ -7433,6 +7442,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 48 unmodified lines
74337442 .run = svm_vcpu_run,
74347443 .handle_exit = handle_exit,
74357444 .skip_emulated_instruction = skip_emulated_instruction,
7445+ .update_emulated_instruction = NULL,
74367446 .set_interrupt_shadow = svm_set_interrupt_shadow,
74377447 .get_interrupt_shadow = svm_get_interrupt_shadow,
74387448 .patch_hypercall = svm_patch_hypercall,
arch/x86/kvm/vmx/capabilities.h+1−0
@@ -12,6 +12,7 @@ extern bool __read_mostly enable_ept; · 11 unmodified lines
1212 extern bool __read_mostly enable_unrestricted_guest;
1313 extern bool __read_mostly enable_ept_ad_bits;
1414 extern bool __read_mostly enable_pml;
15+extern bool __read_mostly enable_apicv;
1516 extern int __read_mostly pt_mode;
1617
1718 #define PT_MODE_SYSTEM 0
arch/x86/kvm/vmx/nested.c+97−25
@@ -544,7 +544,8 @@ static void nested_vmx_disable_intercept_for_msr(unsigned long *msr_bitmap_l1, · 543 unmodified lines
544544 }
545545 }
546546
547−static inline void enable_x2apic_msr_intercepts(unsigned long *msr_bitmap) {
547+static inline void enable_x2apic_msr_intercepts(unsigned long *msr_bitmap)
548+{
548549 int msr;
549550
550551 for (msr = 0x800; msr <= 0x8ff; msr += BITS_PER_LONG) {
@@ -1981,7 +1982,7 @@ static int nested_vmx_handle_enlightened_vmptrld(struct kvm_vcpu *vcpu, · 1430 unmodified lines
19811982 }
19821983
19831984 /*
1984− * Clean fields data can't de used on VMLAUNCH and when we switch
1985+ * Clean fields data can't be used on VMLAUNCH and when we switch
19851986 * between different L2 guests as KVM keeps a single VMCS12 per L1.
19861987 */
19871988 if (from_launch || evmcs_gpa_changed)
@@ -3160,10 +3161,10 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, · 1172 unmodified lines
31603161 * or KVM_SET_NESTED_STATE). Otherwise it's called from vmlaunch/vmresume.
31613162 *
31623163 * Returns:
3163− * NVMX_ENTRY_SUCCESS: Entered VMX non-root mode
3164− * NVMX_ENTRY_VMFAIL: Consistency check VMFail
3165− * NVMX_ENTRY_VMEXIT: Consistency check VMExit
3166− * NVMX_ENTRY_KVM_INTERNAL_ERROR: KVM internal error
3164+ * NVMX_VMENTRY_SUCCESS: Entered VMX non-root mode
3165+ * NVMX_VMENTRY_VMFAIL: Consistency check VMFail
3166+ * NVMX_VMENTRY_VMEXIT: Consistency check VMExit
3167+ * NVMX_VMENTRY_KVM_INTERNAL_ERROR: KVM internal error
31673168 */
31683169 enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
31693170 bool from_vmentry)
@@ -3575,25 +3576,80 @@ static void nested_vmx_inject_exception_vmexit(struct kvm_vcpu *vcpu, · 405 unmodified lines
35753576 nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI, intr_info, exit_qual);
35763577 }
35773578
3579+/*
3580+ * Returns true if a debug trap is pending delivery.
3581+ *
3582+ * In KVM, debug traps bear an exception payload. As such, the class of a #DB
3583+ * exception may be inferred from the presence of an exception payload.
3584+ */
3585+static inline bool vmx_pending_dbg_trap(struct kvm_vcpu *vcpu)
3586+{
3587+ return vcpu->arch.exception.pending &&
3588+ vcpu->arch.exception.nr == DB_VECTOR &&
3589+ vcpu->arch.exception.payload;
3590+}
3591+
3592+/*
3593+ * Certain VM-exits set the 'pending debug exceptions' field to indicate a
3594+ * recognized #DB (data or single-step) that has yet to be delivered. Since KVM
3595+ * represents these debug traps with a payload that is said to be compatible
3596+ * with the 'pending debug exceptions' field, write the payload to the VMCS
3597+ * field if a VM-exit is delivered before the debug trap.
3598+ */
3599+static void nested_vmx_update_pending_dbg(struct kvm_vcpu *vcpu)
3600+{
3601+ if (vmx_pending_dbg_trap(vcpu))
3602+ vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS,
3603+ vcpu->arch.exception.payload);
3604+}
3605+
35783606 static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)
35793607 {
35803608 struct vcpu_vmx *vmx = to_vmx(vcpu);
35813609 unsigned long exit_qual;
35823610 bool block_nested_events =
35833611 vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);
3612+ bool mtf_pending = vmx->nested.mtf_pending;
35843613 struct kvm_lapic *apic = vcpu->arch.apic;
35853614
3615+ /*
3616+ * Clear the MTF state. If a higher priority VM-exit is delivered first,
3617+ * this state is discarded.
3618+ */
3619+ vmx->nested.mtf_pending = false;
3620+
35863621 if (lapic_in_kernel(vcpu) &&
35873622 test_bit(KVM_APIC_INIT, &apic->pending_events)) {
35883623 if (block_nested_events)
35893624 return -EBUSY;
3625+ nested_vmx_update_pending_dbg(vcpu);
35903626 clear_bit(KVM_APIC_INIT, &apic->pending_events);
35913627 nested_vmx_vmexit(vcpu, EXIT_REASON_INIT_SIGNAL, 0, 0);
35923628 return 0;
35933629 }
35943630
3631+ /*
3632+ * Process any exceptions that are not debug traps before MTF.
3633+ */
3634+ if (vcpu->arch.exception.pending &&
3635+ !vmx_pending_dbg_trap(vcpu) &&
3636+ nested_vmx_check_exception(vcpu, &exit_qual)) {
3637+ if (block_nested_events)
3638+ return -EBUSY;
3639+ nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
3640+ return 0;
3641+ }
3642+
3643+ if (mtf_pending) {
3644+ if (block_nested_events)
3645+ return -EBUSY;
3646+ nested_vmx_update_pending_dbg(vcpu);
3647+ nested_vmx_vmexit(vcpu, EXIT_REASON_MONITOR_TRAP_FLAG, 0, 0);
3648+ return 0;
3649+ }
3650+
35953651 if (vcpu->arch.exception.pending &&
3596− nested_vmx_check_exception(vcpu, &exit_qual)) {
3652+ nested_vmx_check_exception(vcpu, &exit_qual)) {
35973653 if (block_nested_events)
35983654 return -EBUSY;
35993655 nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
@@ -5256,24 +5312,17 @@ fail: · 1656 unmodified lines
52565312 return 1;
52575313 }
52585314
5259−
5260−static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
5261− struct vmcs12 *vmcs12)
5315+/*
5316+ * Return true if an IO instruction with the specified port and size should cause
5317+ * a VM-exit into L1.
5318+ */
5319+bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port,
5320+ int size)
52625321 {
5263− unsigned long exit_qualification;
5322+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
52645323 gpa_t bitmap, last_bitmap;
5265− unsigned int port;
5266− int size;
52675324 u8 b;
52685325
5269− if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
5270− return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING);
5271−
5272− exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
5273−
5274− port = exit_qualification >> 16;
5275− size = (exit_qualification & 7) + 1;
5276−
52775326 last_bitmap = (gpa_t)-1;
52785327 b = -1;
52795328
@@ -5300,8 +5349,26 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, · 20 unmodified lines
53005349 return false;
53015350 }
53025351
5352+static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,
5353+ struct vmcs12 *vmcs12)
5354+{
5355+ unsigned long exit_qualification;
5356+ unsigned short port;
5357+ int size;
5358+
5359+ if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
5360+ return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING);
5361+
5362+ exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
5363+
5364+ port = exit_qualification >> 16;
5365+ size = (exit_qualification & 7) + 1;
5366+
5367+ return nested_vmx_check_io_bitmaps(vcpu, port, size);
5368+}
5369+
53035370 /*
5304− * Return 1 if we should exit from L2 to L1 to handle an MSR access access,
5371+ * Return 1 if we should exit from L2 to L1 to handle an MSR access,
53055372 * rather than handle it ourselves in L0. I.e., check whether L1 expressed
53065373 * disinterest in the current event (read or write a specific MSR) by using an
53075374 * MSR bitmap. This may be the case even when L0 doesn't use MSR bitmaps.
@@ -5683,6 +5750,9 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, · 375 unmodified lines
56835750
56845751 if (vmx->nested.nested_run_pending)
56855752 kvm_state.flags |= KVM_STATE_NESTED_RUN_PENDING;
5753+
5754+ if (vmx->nested.mtf_pending)
5755+ kvm_state.flags |= KVM_STATE_NESTED_MTF_PENDING;
56865756 }
56875757 }
56885758
@@ -5863,6 +5933,9 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 174 unmodified lines
58635933 vmx->nested.nested_run_pending =
58645934 !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
58655935
5936+ vmx->nested.mtf_pending =
5937+ !!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING);
5938+
58665939 ret = -EINVAL;
58675940 if (nested_cpu_has_shadow_vmcs(vmcs12) &&
58685941 vmcs12->vmcs_link_pointer != -1ull) {
@@ -5920,8 +5993,7 @@ void nested_vmx_set_vmcs_shadowing_bitmap(void) · 51 unmodified lines
59205993 * bit in the high half is on if the corresponding bit in the control field
59215994 * may be on. See also vmx_control_verify().
59225995 */
5923−void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
5924− bool apicv)
5996+void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
59255997 {
59265998 /*
59275999 * Note that as a general rule, the high half of the MSRs (bits in
@@ -5948,7 +6020,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps, · 20 unmodified lines
59486020 PIN_BASED_EXT_INTR_MASK |
59496021 PIN_BASED_NMI_EXITING |
59506022 PIN_BASED_VIRTUAL_NMIS |
5951− (apicv ? PIN_BASED_POSTED_INTR : 0);
6023+ (enable_apicv ? PIN_BASED_POSTED_INTR : 0);
59526024 msrs->pinbased_ctls_high |=
59536025 PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR |
59546026 PIN_BASED_VMX_PREEMPTION_TIMER;
arch/x86/kvm/vmx/nested.h+8−2
@@ -17,8 +17,7 @@ enum nvmx_vmentry_status { · 16 unmodified lines
1717 };
1818
1919 void vmx_leave_nested(struct kvm_vcpu *vcpu);
20−void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
21− bool apicv);
20+void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps);
2221 void nested_vmx_hardware_unsetup(void);
2322 __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));
2423 void nested_vmx_set_vmcs_shadowing_bitmap(void);
@@ -34,6 +33,8 @@ int vmx_get_vmx_msr(struct nested_vmx_msrs *msrs, u32 msr_index, u64 *pdata); · 9 unmodified lines
3433 int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,
3534 u32 vmx_instruction_info, bool wr, int len, gva_t *ret);
3635 void nested_vmx_pmu_entry_exit_ctls_update(struct kvm_vcpu *vcpu);
36+bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port,
37+ int size);
3738
3839 static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)
3940 {
@@ -175,6 +176,11 @@ static inline bool nested_cpu_has_virtual_nmis(struct vmcs12 *vmcs12) · 135 unmodified lines
175176 return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;
176177 }
177178
179+static inline int nested_cpu_has_mtf(struct vmcs12 *vmcs12)
180+{
181+ return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
182+}
183+
178184 static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
179185 {
180186 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);
arch/x86/kvm/vmx/vmx.c+131−21
@@ -64,11 +64,13 @@ · 63 unmodified lines
6464 MODULE_AUTHOR("Qumranet");
6565 MODULE_LICENSE("GPL");
6666
67+#ifdef MODULE
6768 static const struct x86_cpu_id vmx_cpu_id[] = {
6869 X86_FEATURE_MATCH(X86_FEATURE_VMX),
6970 {}
7071 };
7172 MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id);
73+#endif
7274
7375 bool __read_mostly enable_vpid = 1;
7476 module_param_named(vpid, enable_vpid, bool, 0444);
@@ -95,7 +97,7 @@ module_param(emulate_invalid_guest_state, bool, S_IRUGO); · 20 unmodified lines
9597 static bool __read_mostly fasteoi = 1;
9698 module_param(fasteoi, bool, S_IRUGO);
9799
98−static bool __read_mostly enable_apicv = 1;
100+bool __read_mostly enable_apicv = 1;
99101 module_param(enable_apicv, bool, S_IRUGO);
100102
101103 /*
@@ -1175,6 +1177,10 @@ void vmx_prepare_switch_to_guest(struct kvm_vcpu *vcpu) · 1073 unmodified lines
11751177 vmx->guest_msrs[i].mask);
11761178
11771179 }
1180+
1181+ if (vmx->nested.need_vmcs12_to_shadow_sync)
1182+ nested_sync_vmcs12_to_shadow(vcpu);
1183+
11781184 if (vmx->guest_state_loaded)
11791185 return;
11801186
@@ -1599,6 +1605,40 @@ static int skip_emulated_instruction(struct kvm_vcpu *vcpu) · 418 unmodified lines
15991605 return 1;
16001606 }
16011607
1608+
1609+/*
1610+ * Recognizes a pending MTF VM-exit and records the nested state for later
1611+ * delivery.
1612+ */
1613+static void vmx_update_emulated_instruction(struct kvm_vcpu *vcpu)
1614+{
1615+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
1616+ struct vcpu_vmx *vmx = to_vmx(vcpu);
1617+
1618+ if (!is_guest_mode(vcpu))
1619+ return;
1620+
1621+ /*
1622+ * Per the SDM, MTF takes priority over debug-trap exceptions besides
1623+ * T-bit traps. As instruction emulation is completed (i.e. at the
1624+ * instruction boundary), any #DB exception pending delivery must be a
1625+ * debug-trap. Record the pending MTF state to be delivered in
1626+ * vmx_check_nested_events().
1627+ */
1628+ if (nested_cpu_has_mtf(vmcs12) &&
1629+ (!vcpu->arch.exception.pending ||
1630+ vcpu->arch.exception.nr == DB_VECTOR))
1631+ vmx->nested.mtf_pending = true;
1632+ else
1633+ vmx->nested.mtf_pending = false;
1634+}
1635+
1636+static int vmx_skip_emulated_instruction(struct kvm_vcpu *vcpu)
1637+{
1638+ vmx_update_emulated_instruction(vcpu);
1639+ return skip_emulated_instruction(vcpu);
1640+}
1641+
16021642 static void vmx_clear_hlt(struct kvm_vcpu *vcpu)
16031643 {
16041644 /*
@@ -2947,6 +2987,9 @@ void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 1342 unmodified lines
29472987
29482988 static int get_ept_level(struct kvm_vcpu *vcpu)
29492989 {
2990+ /* Nested EPT currently only supports 4-level walks. */
2991+ if (is_guest_mode(vcpu) && nested_cpu_has_ept(get_vmcs12(vcpu)))
2992+ return 4;
29502993 if (cpu_has_vmx_ept_5levels() && (cpuid_maxphyaddr(vcpu) > 48))
29512994 return 5;
29522995 return 4;
@@ -3815,24 +3858,29 @@ static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, · 862 unmodified lines
38153858 * 2. If target vcpu isn't running(root mode), kick it to pick up the
38163859 * interrupt from PIR in next vmentry.
38173860 */
3818−static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
3861+static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
38193862 {
38203863 struct vcpu_vmx *vmx = to_vmx(vcpu);
38213864 int r;
38223865
38233866 r = vmx_deliver_nested_posted_interrupt(vcpu, vector);
38243867 if (!r)
3825− return;
3868+ return 0;
3869+
3870+ if (!vcpu->arch.apicv_active)
3871+ return -1;
38263872
38273873 if (pi_test_and_set_pir(vector, &vmx->pi_desc))
3828− return;
3874+ return 0;
38293875
38303876 /* If a previous notification has sent the IPI, nothing to do. */
38313877 if (pi_test_and_set_on(&vmx->pi_desc))
3832− return;
3878+ return 0;
38333879
38343880 if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false))
38353881 kvm_vcpu_kick(vcpu);
3882+
3883+ return 0;
38363884 }
38373885
38383886 /*
@@ -4238,7 +4286,6 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 399 unmodified lines
42384286
42394287 vmx->msr_ia32_umwait_control = 0;
42404288
4241− vcpu->arch.microcode_version = 0x100000000ULL;
42424289 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
42434290 vmx->hv_deadline_tsc = -1;
42444291 kvm_set_cr8(vcpu, 0);
@@ -6480,8 +6527,11 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 2235 unmodified lines
64806527 vmcs_write32(PLE_WINDOW, vmx->ple_window);
64816528 }
64826529
6483− if (vmx->nested.need_vmcs12_to_shadow_sync)
6484− nested_sync_vmcs12_to_shadow(vcpu);
6530+ /*
6531+ * We did this in prepare_switch_to_guest, because it needs to
6532+ * be within srcu_read_lock.
6533+ */
6534+ WARN_ON_ONCE(vmx->nested.need_vmcs12_to_shadow_sync);
64856535
64866536 if (kvm_register_is_dirty(vcpu, VCPU_REGS_RSP))
64876537 vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
@@ -6755,14 +6805,14 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 267 unmodified lines
67556805
67566806 if (nested)
67576807 nested_vmx_setup_ctls_msrs(&vmx->nested.msrs,
6758− vmx_capability.ept,
6759− kvm_vcpu_apicv_active(vcpu));
6808+ vmx_capability.ept);
67606809 else
67616810 memset(&vmx->nested.msrs, 0, sizeof(vmx->nested.msrs));
67626811
67636812 vmx->nested.posted_intr_nv = -1;
67646813 vmx->nested.current_vmptr = -1ull;
67656814
6815+ vcpu->arch.microcode_version = 0x100000000ULL;
67666816 vmx->msr_ia32_feature_control_valid_bits = FEAT_CTL_LOCKED;
67676817
67686818 /*
@@ -6836,8 +6886,7 @@ static int __init vmx_check_processor_compat(void) · 67 unmodified lines
68366886 if (setup_vmcs_config(&vmcs_conf, &vmx_cap) < 0)
68376887 return -EIO;
68386888 if (nested)
6839− nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept,
6840− enable_apicv);
6889+ nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept);
68416890 if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {
68426891 printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
68436892 smp_processor_id());
@@ -7098,6 +7147,40 @@ static void vmx_request_immediate_exit(struct kvm_vcpu *vcpu) · 254 unmodified lines
70987147 to_vmx(vcpu)->req_immediate_exit = true;
70997148 }
71007149
7150+static int vmx_check_intercept_io(struct kvm_vcpu *vcpu,
7151+ struct x86_instruction_info *info)
7152+{
7153+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
7154+ unsigned short port;
7155+ bool intercept;
7156+ int size;
7157+
7158+ if (info->intercept == x86_intercept_in ||
7159+ info->intercept == x86_intercept_ins) {
7160+ port = info->src_val;
7161+ size = info->dst_bytes;
7162+ } else {
7163+ port = info->dst_val;
7164+ size = info->src_bytes;
7165+ }
7166+
7167+ /*
7168+ * If the 'use IO bitmaps' VM-execution control is 0, IO instruction
7169+ * VM-exits depend on the 'unconditional IO exiting' VM-execution
7170+ * control.
7171+ *
7172+ * Otherwise, IO instruction VM-exits are controlled by the IO bitmaps.
7173+ */
7174+ if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS))
7175+ intercept = nested_cpu_has(vmcs12,
7176+ CPU_BASED_UNCOND_IO_EXITING);
7177+ else
7178+ intercept = nested_vmx_check_io_bitmaps(vcpu, port, size);
7179+
7180+ /* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */
7181+ return intercept ? X86EMUL_UNHANDLEABLE : X86EMUL_CONTINUE;
7182+}
7183+
71017184 static int vmx_check_intercept(struct kvm_vcpu *vcpu,
71027185 struct x86_instruction_info *info,
71037186 enum x86_intercept_stage stage)
@@ -7105,19 +7188,45 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu, · 1 unmodified line
71057188 struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
71067189 struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt;
71077190
7191+ switch (info->intercept) {
71087192 /*
71097193 * RDPID causes #UD if disabled through secondary execution controls.
71107194 * Because it is marked as EmulateOnUD, we need to intercept it here.
71117195 */
7112− if (info->intercept == x86_intercept_rdtscp &&
7113− !nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) {
7114− ctxt->exception.vector = UD_VECTOR;
7115− ctxt->exception.error_code_valid = false;
7116− return X86EMUL_PROPAGATE_FAULT;
7117− }
7196+ case x86_intercept_rdtscp:
7197+ if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) {
7198+ ctxt->exception.vector = UD_VECTOR;
7199+ ctxt->exception.error_code_valid = false;
7200+ return X86EMUL_PROPAGATE_FAULT;
7201+ }
7202+ break;
7203+
7204+ case x86_intercept_in:
7205+ case x86_intercept_ins:
7206+ case x86_intercept_out:
7207+ case x86_intercept_outs:
7208+ return vmx_check_intercept_io(vcpu, info);
7209+
7210+ case x86_intercept_lgdt:
7211+ case x86_intercept_lidt:
7212+ case x86_intercept_lldt:
7213+ case x86_intercept_ltr:
7214+ case x86_intercept_sgdt:
7215+ case x86_intercept_sidt:
7216+ case x86_intercept_sldt:
7217+ case x86_intercept_str:
7218+ if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_DESC))
7219+ return X86EMUL_CONTINUE;
7220+
7221+ /* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */
7222+ break;
71187223
71197224 /* TODO: check more intercepts... */
7120− return X86EMUL_CONTINUE;
7225+ default:
7226+ break;
7227+ }
7228+
7229+ return X86EMUL_UNHANDLEABLE;
71217230 }
71227231
71237232 #ifdef CONFIG_X86_64
@@ -7699,7 +7808,7 @@ static __init int hardware_setup(void) · 575 unmodified lines
76997808
77007809 if (nested) {
77017810 nested_vmx_setup_ctls_msrs(&vmcs_config.nested,
7702− vmx_capability.ept, enable_apicv);
7811+ vmx_capability.ept);
77037812
77047813 r = nested_vmx_hardware_setup(kvm_vmx_exit_handlers);
77057814 if (r)
@@ -7783,7 +7892,8 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 77 unmodified lines
77837892
77847893 .run = vmx_vcpu_run,
77857894 .handle_exit = vmx_handle_exit,
7786− .skip_emulated_instruction = skip_emulated_instruction,
7895+ .skip_emulated_instruction = vmx_skip_emulated_instruction,
7896+ .update_emulated_instruction = vmx_update_emulated_instruction,
77877897 .set_interrupt_shadow = vmx_set_interrupt_shadow,
77887898 .get_interrupt_shadow = vmx_get_interrupt_shadow,
77897899 .patch_hypercall = vmx_patch_hypercall,
arch/x86/kvm/vmx/vmx.h+3−0
@@ -150,6 +150,9 @@ struct nested_vmx { · 149 unmodified lines
150150 /* L2 must run next, and mustn't decide to exit to L1. */
151151 bool nested_run_pending;
152152
153+ /* Pending MTF VM-exit into L1. */
154+ bool mtf_pending;
155+
153156 struct loaded_vmcs vmcs02;
154157
155158 /*
arch/x86/kvm/x86.c+35−23
@@ -438,6 +438,14 @@ void kvm_deliver_exception_payload(struct kvm_vcpu *vcpu) · 437 unmodified lines
438438 * for #DB exceptions under VMX.
439439 */
440440 vcpu->arch.dr6 ^= payload & DR6_RTM;
441+
442+ /*
443+ * The #DB payload is defined as compatible with the 'pending
444+ * debug exceptions' field under VMX, not DR6. While bit 12 is
445+ * defined in the 'pending debug exceptions' field (enabled
446+ * breakpoint), it is reserved and must be zero in DR6.
447+ */
448+ vcpu->arch.dr6 &= ~BIT(12);
441449 break;
442450 case PF_VECTOR:
443451 vcpu->arch.cr2 = payload;
@@ -490,19 +498,7 @@ static void kvm_multiple_exception(struct kvm_vcpu *vcpu, · 46 unmodified lines
490498 vcpu->arch.exception.error_code = error_code;
491499 vcpu->arch.exception.has_payload = has_payload;
492500 vcpu->arch.exception.payload = payload;
493− /*
494− * In guest mode, payload delivery should be deferred,
495− * so that the L1 hypervisor can intercept #PF before
496− * CR2 is modified (or intercept #DB before DR6 is
497− * modified under nVMX). However, for ABI
498− * compatibility with KVM_GET_VCPU_EVENTS and
499− * KVM_SET_VCPU_EVENTS, we can't delay payload
500− * delivery unless userspace has enabled this
501− * functionality via the per-VM capability,
502− * KVM_CAP_EXCEPTION_PAYLOAD.
503− */
504− if (!vcpu->kvm->arch.exception_payload_enabled ||
505− !is_guest_mode(vcpu))
501+ if (!is_guest_mode(vcpu))
506502 kvm_deliver_exception_payload(vcpu);
507503 return;
508504 }
@@ -2448,7 +2444,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 1939 unmodified lines
24482444 vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
24492445 vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
24502446 vcpu->last_guest_tsc = tsc_timestamp;
2451− WARN_ON(vcpu->hv_clock.system_time < 0);
2447+ WARN_ON((s64)vcpu->hv_clock.system_time < 0);
24522448
24532449 /* If the host uses TSC clocksource, then it is stable */
24542450 pvclock_flags = 0;
@@ -3795,6 +3791,21 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, · 1340 unmodified lines
37953791 {
37963792 process_nmi(vcpu);
37973793
3794+ /*
3795+ * In guest mode, payload delivery should be deferred,
3796+ * so that the L1 hypervisor can intercept #PF before
3797+ * CR2 is modified (or intercept #DB before DR6 is
3798+ * modified under nVMX). Unless the per-VM capability,
3799+ * KVM_CAP_EXCEPTION_PAYLOAD, is set, we may not defer the delivery of
3800+ * an exception payload and handle after a KVM_GET_VCPU_EVENTS. Since we
3801+ * opportunistically defer the exception payload, deliver it if the
3802+ * capability hasn't been requested before processing a
3803+ * KVM_GET_VCPU_EVENTS.
3804+ */
3805+ if (!vcpu->kvm->arch.exception_payload_enabled &&
3806+ vcpu->arch.exception.pending && vcpu->arch.exception.has_payload)
3807+ kvm_deliver_exception_payload(vcpu);
3808+
37983809 /*
37993810 * The API doesn't provide the instruction length for software
38003811 * exceptions, so don't report them. As long as the guest RIP
@@ -6880,6 +6891,8 @@ restart: · 3079 unmodified lines
68806891 kvm_rip_write(vcpu, ctxt->eip);
68816892 if (r && ctxt->tf)
68826893 r = kvm_vcpu_do_singlestep(vcpu);
6894+ if (kvm_x86_ops->update_emulated_instruction)
6895+ kvm_x86_ops->update_emulated_instruction(vcpu);
68836896 __kvm_set_rflags(vcpu, ctxt->eflags);
68846897 }
68856898
@@ -7177,15 +7190,15 @@ static void kvm_timer_init(void) · 291 unmodified lines
71777190
71787191 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
71797192 #ifdef CONFIG_CPU_FREQ
7180− struct cpufreq_policy policy;
7193+ struct cpufreq_policy *policy;
71817194 int cpu;
71827195
7183− memset(&policy, 0, sizeof(policy));
71847196 cpu = get_cpu();
7185− cpufreq_get_policy(&policy, cpu);
7186− if (policy.cpuinfo.max_freq)
7187− max_tsc_khz = policy.cpuinfo.max_freq;
7197+ policy = cpufreq_cpu_get(cpu);
7198+ if (policy && policy->cpuinfo.max_freq)
7199+ max_tsc_khz = policy->cpuinfo.max_freq;
71887200 put_cpu();
7201+ cpufreq_cpu_put(policy);
71897202 #endif
71907203 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
71917204 CPUFREQ_TRANSITION_NOTIFIER);
@@ -7295,12 +7308,12 @@ int kvm_arch_init(void *opaque) · 103 unmodified lines
72957308 }
72967309
72977310 if (!ops->cpu_has_kvm_support()) {
7298− printk(KERN_ERR "kvm: no hardware support\n");
7311+ pr_err_ratelimited("kvm: no hardware support\n");
72997312 r = -EOPNOTSUPP;
73007313 goto out;
73017314 }
73027315 if (ops->disabled_by_bios()) {
7303− printk(KERN_ERR "kvm: disabled by bios\n");
7316+ pr_err_ratelimited("kvm: disabled by bios\n");
73047317 r = -EOPNOTSUPP;
73057318 goto out;
73067319 }
@@ -8942,7 +8955,6 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int idt_index, · 1635 unmodified lines
89428955
89438956 kvm_rip_write(vcpu, ctxt->eip);
89448957 kvm_set_rflags(vcpu, ctxt->eflags);
8945− kvm_make_request(KVM_REQ_EVENT, vcpu);
89468958 return 1;
89478959 }
89488960 EXPORT_SYMBOL_GPL(kvm_task_switch);
@@ -10182,7 +10194,7 @@ void kvm_arch_async_page_ready(struct kvm_vcpu *vcpu, struct kvm_async_pf *work) · 1233 unmodified lines
1018210194 work->arch.cr3 != vcpu->arch.mmu->get_cr3(vcpu))
1018310195 return;
1018410196
10185− vcpu->arch.mmu->page_fault(vcpu, work->cr2_or_gpa, 0, true);
10197+ kvm_mmu_do_page_fault(vcpu, work->cr2_or_gpa, 0, true);
1018610198 }
1018710199
1018810200 static inline u32 kvm_async_pf_hash_fn(gfn_t gfn)
arch/x86/mm/dump_pagetables.c+1−6
@@ -363,13 +363,8 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m, · 362 unmodified lines
363363 {
364364 const struct ptdump_range ptdump_ranges[] = {
365365 #ifdef CONFIG_X86_64
366−
367−#define normalize_addr_shift (64 - (__VIRTUAL_MASK_SHIFT + 1))
368−#define normalize_addr(u) ((signed long)((u) << normalize_addr_shift) >> \
369− normalize_addr_shift)
370−
371366 {0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},
372− {normalize_addr(PTRS_PER_PGD * PGD_LEVEL_MULT / 2), ~0UL},
367+ {GUARD_HOLE_END_ADDR, ~0UL},
373368 #else
374369 {0, ~0UL},
375370 #endif
arch/x86/platform/efi/efi_64.c+52−99
@@ -180,7 +180,7 @@ void efi_sync_low_kernel_mappings(void) · 179 unmodified lines
180180 static inline phys_addr_t
181181 virt_to_phys_or_null_size(void *va, unsigned long size)
182182 {
183− bool bad_size;
183+ phys_addr_t pa;
184184
185185 if (!va)
186186 return 0;
@@ -188,16 +188,13 @@ virt_to_phys_or_null_size(void *va, unsigned long size) · 1 unmodified line
188188 if (virt_addr_valid(va))
189189 return virt_to_phys(va);
190190
191− /*
192− * A fully aligned variable on the stack is guaranteed not to
193− * cross a page bounary. Try to catch strings on the stack by
194− * checking that 'size' is a power of two.
195− */
196− bad_size = size > PAGE_SIZE || !is_power_of_2(size);
191+ pa = slow_virt_to_phys(va);
197192
198− WARN_ON(!IS_ALIGNED((unsigned long)va, size) || bad_size);
193+ /* check if the object crosses a page boundary */
194+ if (WARN_ON((pa ^ (pa + size - 1)) & PAGE_MASK))
195+ return 0;
199196
200− return slow_virt_to_phys(va);
197+ return pa;
201198 }
202199
203200 #define virt_to_phys_or_null(addr) \
@@ -568,85 +565,25 @@ efi_thunk_set_virtual_address_map(unsigned long memory_map_size, · 364 unmodified lines
568565
569566 static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)
570567 {
571− efi_status_t status;
572− u32 phys_tm, phys_tc;
573− unsigned long flags;
574−
575− spin_lock(&rtc_lock);
576− spin_lock_irqsave(&efi_runtime_lock, flags);
577−
578− phys_tm = virt_to_phys_or_null(tm);
579− phys_tc = virt_to_phys_or_null(tc);
580−
581− status = efi_thunk(get_time, phys_tm, phys_tc);
582−
583− spin_unlock_irqrestore(&efi_runtime_lock, flags);
584− spin_unlock(&rtc_lock);
585−
586− return status;
568+ return EFI_UNSUPPORTED;
587569 }
588570
589571 static efi_status_t efi_thunk_set_time(efi_time_t *tm)
590572 {
591− efi_status_t status;
592− u32 phys_tm;
593− unsigned long flags;
594−
595− spin_lock(&rtc_lock);
596− spin_lock_irqsave(&efi_runtime_lock, flags);
597−
598− phys_tm = virt_to_phys_or_null(tm);
599−
600− status = efi_thunk(set_time, phys_tm);
601−
602− spin_unlock_irqrestore(&efi_runtime_lock, flags);
603− spin_unlock(&rtc_lock);
604−
605− return status;
573+ return EFI_UNSUPPORTED;
606574 }
607575
608576 static efi_status_t
609577 efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
610578 efi_time_t *tm)
611579 {
612− efi_status_t status;
613− u32 phys_enabled, phys_pending, phys_tm;
614− unsigned long flags;
615−
616− spin_lock(&rtc_lock);
617− spin_lock_irqsave(&efi_runtime_lock, flags);
618−
619− phys_enabled = virt_to_phys_or_null(enabled);
620− phys_pending = virt_to_phys_or_null(pending);
621− phys_tm = virt_to_phys_or_null(tm);
622−
623− status = efi_thunk(get_wakeup_time, phys_enabled,
624− phys_pending, phys_tm);
625−
626− spin_unlock_irqrestore(&efi_runtime_lock, flags);
627− spin_unlock(&rtc_lock);
628−
629− return status;
580+ return EFI_UNSUPPORTED;
630581 }
631582
632583 static efi_status_t
633584 efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
634585 {
635− efi_status_t status;
636− u32 phys_tm;
637− unsigned long flags;
638−
639− spin_lock(&rtc_lock);
640− spin_lock_irqsave(&efi_runtime_lock, flags);
641−
642− phys_tm = virt_to_phys_or_null(tm);
643−
644− status = efi_thunk(set_wakeup_time, enabled, phys_tm);
645−
646− spin_unlock_irqrestore(&efi_runtime_lock, flags);
647− spin_unlock(&rtc_lock);
648−
649− return status;
586+ return EFI_UNSUPPORTED;
650587 }
651588
652589 static unsigned long efi_name_size(efi_char16_t *name)
@@ -658,6 +595,8 @@ static efi_status_t · 5 unmodified lines
658595 efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
659596 u32 *attr, unsigned long *data_size, void *data)
660597 {
598+ u8 buf[24] __aligned(8);
599+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
661600 efi_status_t status;
662601 u32 phys_name, phys_vendor, phys_attr;
663602 u32 phys_data_size, phys_data;
@@ -665,14 +604,19 @@ efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor, · 1 unmodified line
665604
666605 spin_lock_irqsave(&efi_runtime_lock, flags);
667606
607+ *vnd = *vendor;
608+
668609 phys_data_size = virt_to_phys_or_null(data_size);
669− phys_vendor = virt_to_phys_or_null(vendor);
610+ phys_vendor = virt_to_phys_or_null(vnd);
670611 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
671612 phys_attr = virt_to_phys_or_null(attr);
672613 phys_data = virt_to_phys_or_null_size(data, *data_size);
673614
674− status = efi_thunk(get_variable, phys_name, phys_vendor,
675− phys_attr, phys_data_size, phys_data);
615+ if (!phys_name || (data && !phys_data))
616+ status = EFI_INVALID_PARAMETER;
617+ else
618+ status = efi_thunk(get_variable, phys_name, phys_vendor,
619+ phys_attr, phys_data_size, phys_data);
676620
677621 spin_unlock_irqrestore(&efi_runtime_lock, flags);
678622
@@ -683,19 +627,25 @@ static efi_status_t · 4 unmodified lines
683627 efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
684628 u32 attr, unsigned long data_size, void *data)
685629 {
630+ u8 buf[24] __aligned(8);
631+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
686632 u32 phys_name, phys_vendor, phys_data;
687633 efi_status_t status;
688634 unsigned long flags;
689635
690636 spin_lock_irqsave(&efi_runtime_lock, flags);
691637
638+ *vnd = *vendor;
639+
692640 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
693− phys_vendor = virt_to_phys_or_null(vendor);
641+ phys_vendor = virt_to_phys_or_null(vnd);
694642 phys_data = virt_to_phys_or_null_size(data, data_size);
695643
696− /* If data_size is > sizeof(u32) we've got problems */
697− status = efi_thunk(set_variable, phys_name, phys_vendor,
698− attr, data_size, phys_data);
644+ if (!phys_name || !phys_data)
645+ status = EFI_INVALID_PARAMETER;
646+ else
647+ status = efi_thunk(set_variable, phys_name, phys_vendor,
648+ attr, data_size, phys_data);
699649
700650 spin_unlock_irqrestore(&efi_runtime_lock, flags);
701651
@@ -707,6 +657,8 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 5 unmodified lines
707657 u32 attr, unsigned long data_size,
708658 void *data)
709659 {
660+ u8 buf[24] __aligned(8);
661+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
710662 u32 phys_name, phys_vendor, phys_data;
711663 efi_status_t status;
712664 unsigned long flags;
@@ -714,13 +666,17 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 1 unmodified line
714666 if (!spin_trylock_irqsave(&efi_runtime_lock, flags))
715667 return EFI_NOT_READY;
716668
669+ *vnd = *vendor;
670+
717671 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
718− phys_vendor = virt_to_phys_or_null(vendor);
672+ phys_vendor = virt_to_phys_or_null(vnd);
719673 phys_data = virt_to_phys_or_null_size(data, data_size);
720674
721− /* If data_size is > sizeof(u32) we've got problems */
722− status = efi_thunk(set_variable, phys_name, phys_vendor,
723− attr, data_size, phys_data);
675+ if (!phys_name || !phys_data)
676+ status = EFI_INVALID_PARAMETER;
677+ else
678+ status = efi_thunk(set_variable, phys_name, phys_vendor,
679+ attr, data_size, phys_data);
724680
725681 spin_unlock_irqrestore(&efi_runtime_lock, flags);
726682
@@ -732,39 +688,36 @@ efi_thunk_get_next_variable(unsigned long *name_size, · 5 unmodified lines
732688 efi_char16_t *name,
733689 efi_guid_t *vendor)
734690 {
691+ u8 buf[24] __aligned(8);
692+ efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
735693 efi_status_t status;
736694 u32 phys_name_size, phys_name, phys_vendor;
737695 unsigned long flags;
738696
739697 spin_lock_irqsave(&efi_runtime_lock, flags);
740698
699+ *vnd = *vendor;
700+
741701 phys_name_size = virt_to_phys_or_null(name_size);
742− phys_vendor = virt_to_phys_or_null(vendor);
702+ phys_vendor = virt_to_phys_or_null(vnd);
743703 phys_name = virt_to_phys_or_null_size(name, *name_size);
744704
745− status = efi_thunk(get_next_variable, phys_name_size,
746− phys_name, phys_vendor);
705+ if (!phys_name)
706+ status = EFI_INVALID_PARAMETER;
707+ else
708+ status = efi_thunk(get_next_variable, phys_name_size,
709+ phys_name, phys_vendor);
747710
748711 spin_unlock_irqrestore(&efi_runtime_lock, flags);
749712
713+ *vendor = *vnd;
750714 return status;
751715 }
752716
753717 static efi_status_t
754718 efi_thunk_get_next_high_mono_count(u32 *count)
755719 {
756− efi_status_t status;
757− u32 phys_count;
758− unsigned long flags;
759−
760− spin_lock_irqsave(&efi_runtime_lock, flags);
761−
762− phys_count = virt_to_phys_or_null(count);
763− status = efi_thunk(get_next_high_mono_count, phys_count);
764−
765− spin_unlock_irqrestore(&efi_runtime_lock, flags);
766−
767− return status;
720+ return EFI_UNSUPPORTED;
768721 }
769722
770723 static void
arch/x86/xen/enlighten_pv.c+29−3
@@ -72,6 +72,9 @@ · 71 unmodified lines
7272 #include <asm/mwait.h>
7373 #include <asm/pci_x86.h>
7474 #include <asm/cpu.h>
75+#ifdef CONFIG_X86_IOPL_IOPERM
76+#include <asm/io_bitmap.h>
77+#endif
7578
7679 #ifdef CONFIG_ACPI
7780 #include <linux/acpi.h>
@@ -837,6 +840,25 @@ static void xen_load_sp0(unsigned long sp0) · 759 unmodified lines
837840 this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0);
838841 }
839842
843+#ifdef CONFIG_X86_IOPL_IOPERM
844+static void xen_update_io_bitmap(void)
845+{
846+ struct physdev_set_iobitmap iobitmap;
847+ struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw);
848+
849+ native_tss_update_io_bitmap();
850+
851+ iobitmap.bitmap = (uint8_t *)(&tss->x86_tss) +
852+ tss->x86_tss.io_bitmap_base;
853+ if (tss->x86_tss.io_bitmap_base == IO_BITMAP_OFFSET_INVALID)
854+ iobitmap.nr_ports = 0;
855+ else
856+ iobitmap.nr_ports = IO_BITMAP_BITS;
857+
858+ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap);
859+}
860+#endif
861+
840862 static void xen_io_delay(void)
841863 {
842864 }
@@ -896,14 +918,15 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err) · 53 unmodified lines
896918 static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
897919 {
898920 int ret;
921+#ifdef CONFIG_X86_64
922+ unsigned int which;
923+ u64 base;
924+#endif
899925
900926 ret = 0;
901927
902928 switch (msr) {
903929 #ifdef CONFIG_X86_64
904− unsigned which;
905− u64 base;
906−
907930 case MSR_FS_BASE: which = SEGBASE_FS; goto set;
908931 case MSR_KERNEL_GS_BASE: which = SEGBASE_GS_USER; goto set;
909932 case MSR_GS_BASE: which = SEGBASE_GS_KERNEL; goto set;
@@ -1046,6 +1069,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { · 136 unmodified lines
10461069 .write_idt_entry = xen_write_idt_entry,
10471070 .load_sp0 = xen_load_sp0,
10481071
1072+#ifdef CONFIG_X86_IOPL_IOPERM
1073+ .update_io_bitmap = xen_update_io_bitmap,
1074+#endif
10491075 .io_delay = xen_io_delay,
10501076
10511077 /* Xen takes care of %gs when switching to usermode for us */
block/blk-flush.c+1−1
@@ -412,7 +412,7 @@ void blk_insert_flush(struct request *rq) · 411 unmodified lines
412412 */
413413 if ((policy & REQ_FSEQ_DATA) &&
414414 !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
415− blk_mq_request_bypass_insert(rq, false);
415+ blk_mq_request_bypass_insert(rq, false, false);
416416 return;
417417 }
418418
block/blk-mq-sched.c+15−7
@@ -361,13 +361,19 @@ static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx, · 360 unmodified lines
361361 bool has_sched,
362362 struct request *rq)
363363 {
364− /* dispatch flush rq directly */
365− if (rq->rq_flags & RQF_FLUSH_SEQ) {
366− spin_lock(&hctx->lock);
367− list_add(&rq->queuelist, &hctx->dispatch);
368− spin_unlock(&hctx->lock);
364+ /*
365+ * dispatch flush and passthrough rq directly
366+ *
367+ * passthrough request has to be added to hctx->dispatch directly.
368+ * For some reason, device may be in one situation which can't
369+ * handle FS request, so STS_RESOURCE is always returned and the
370+ * FS request will be added to hctx->dispatch. However passthrough
371+ * request may be required at that time for fixing the problem. If
372+ * passthrough request is added to scheduler queue, there isn't any
373+ * chance to dispatch it given we prioritize requests in hctx->dispatch.
374+ */
375+ if ((rq->rq_flags & RQF_FLUSH_SEQ) || blk_rq_is_passthrough(rq))
369376 return true;
370− }
371377
372378 if (has_sched)
373379 rq->rq_flags |= RQF_SORTED;
@@ -391,8 +397,10 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head, · 17 unmodified lines
391397
392398 WARN_ON(e && (rq->tag != -1));
393399
394− if (blk_mq_sched_bypass_insert(hctx, !!e, rq))
400+ if (blk_mq_sched_bypass_insert(hctx, !!e, rq)) {
401+ blk_mq_request_bypass_insert(rq, at_head, false);
395402 goto run;
403+ }
396404
397405 if (e && e->type->ops.insert_requests) {
398406 LIST_HEAD(list);
block/blk-mq-tag.c+2−2
@@ -183,8 +183,8 @@ found_tag: · 182 unmodified lines
183183 return tag + tag_offset;
184184 }
185185
186−void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,
187− struct blk_mq_ctx *ctx, unsigned int tag)
186+void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
187+ unsigned int tag)
188188 {
189189 if (!blk_mq_tag_is_reserved(tags, tag)) {
190190 const int real_tag = tag - tags->nr_reserved_tags;
block/blk-mq-tag.h+2−2
@@ -26,8 +26,8 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int r · 25 unmodified lines
2626 extern void blk_mq_free_tags(struct blk_mq_tags *tags);
2727
2828 extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);
29−extern void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,
30− struct blk_mq_ctx *ctx, unsigned int tag);
29+extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
30+ unsigned int tag);
3131 extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
3232 struct blk_mq_tags **tags,
3333 unsigned int depth, bool can_grow);
block/blk-mq.c+15−13
@@ -477,9 +477,9 @@ static void __blk_mq_free_request(struct request *rq) · 476 unmodified lines
477477 blk_pm_mark_last_busy(rq);
478478 rq->mq_hctx = NULL;
479479 if (rq->tag != -1)
480− blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
480+ blk_mq_put_tag(hctx->tags, ctx, rq->tag);
481481 if (sched_tag != -1)
482− blk_mq_put_tag(hctx, hctx->sched_tags, ctx, sched_tag);
482+ blk_mq_put_tag(hctx->sched_tags, ctx, sched_tag);
483483 blk_mq_sched_restart(hctx);
484484 blk_queue_exit(q);
485485 }
@@ -735,7 +735,7 @@ static void blk_mq_requeue_work(struct work_struct *work) · 249 unmodified lines
735735 * merge.
736736 */
737737 if (rq->rq_flags & RQF_DONTPREP)
738− blk_mq_request_bypass_insert(rq, false);
738+ blk_mq_request_bypass_insert(rq, false, false);
739739 else
740740 blk_mq_sched_insert_request(rq, true, false, false);
741741 }
@@ -1286,7 +1286,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 544 unmodified lines
12861286 q->mq_ops->commit_rqs(hctx);
12871287
12881288 spin_lock(&hctx->lock);
1289− list_splice_init(list, &hctx->dispatch);
1289+ list_splice_tail_init(list, &hctx->dispatch);
12901290 spin_unlock(&hctx->lock);
12911291
12921292 /*
@@ -1677,12 +1677,16 @@ void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, · 384 unmodified lines
16771677 * Should only be used carefully, when the caller knows we want to
16781678 * bypass a potential IO scheduler on the target device.
16791679 */
1680−void blk_mq_request_bypass_insert(struct request *rq, bool run_queue)
1680+void blk_mq_request_bypass_insert(struct request *rq, bool at_head,
1681+ bool run_queue)
16811682 {
16821683 struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
16831684
16841685 spin_lock(&hctx->lock);
1685− list_add_tail(&rq->queuelist, &hctx->dispatch);
1686+ if (at_head)
1687+ list_add(&rq->queuelist, &hctx->dispatch);
1688+ else
1689+ list_add_tail(&rq->queuelist, &hctx->dispatch);
16861690 spin_unlock(&hctx->lock);
16871691
16881692 if (run_queue)
@@ -1849,7 +1853,7 @@ insert: · 160 unmodified lines
18491853 if (bypass_insert)
18501854 return BLK_STS_RESOURCE;
18511855
1852− blk_mq_request_bypass_insert(rq, run_queue);
1856+ blk_mq_request_bypass_insert(rq, false, run_queue);
18531857 return BLK_STS_OK;
18541858 }
18551859
@@ -1876,7 +1880,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, · 20 unmodified lines
18761880
18771881 ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false, true);
18781882 if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
1879− blk_mq_request_bypass_insert(rq, true);
1883+ blk_mq_request_bypass_insert(rq, false, true);
18801884 else if (ret != BLK_STS_OK)
18811885 blk_mq_end_request(rq, ret);
18821886
@@ -1910,7 +1914,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx, · 27 unmodified lines
19101914 if (ret != BLK_STS_OK) {
19111915 if (ret == BLK_STS_RESOURCE ||
19121916 ret == BLK_STS_DEV_RESOURCE) {
1913− blk_mq_request_bypass_insert(rq,
1917+ blk_mq_request_bypass_insert(rq, false,
19141918 list_empty(list));
19151919 break;
19161920 }
@@ -3398,7 +3402,6 @@ static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb) · 1481 unmodified lines
33983402 }
33993403
34003404 static unsigned long blk_mq_poll_nsecs(struct request_queue *q,
3401− struct blk_mq_hw_ctx *hctx,
34023405 struct request *rq)
34033406 {
34043407 unsigned long ret = 0;
@@ -3431,7 +3434,6 @@ static unsigned long blk_mq_poll_nsecs(struct request_queue *q, · 26 unmodified lines
34313434 }
34323435
34333436 static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
3434− struct blk_mq_hw_ctx *hctx,
34353437 struct request *rq)
34363438 {
34373439 struct hrtimer_sleeper hs;
@@ -3451,7 +3453,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, · 13 unmodified lines
34513453 if (q->poll_nsec > 0)
34523454 nsecs = q->poll_nsec;
34533455 else
3454− nsecs = blk_mq_poll_nsecs(q, hctx, rq);
3456+ nsecs = blk_mq_poll_nsecs(q, rq);
34553457
34563458 if (!nsecs)
34573459 return false;
@@ -3506,7 +3508,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q, · 48 unmodified lines
35063508 return false;
35073509 }
35083510
3509− return blk_mq_poll_hybrid_sleep(q, hctx, rq);
3511+ return blk_mq_poll_hybrid_sleep(q, rq);
35103512 }
35113513
35123514 /**
block/blk-mq.h+3−2
@@ -66,7 +66,8 @@ int blk_mq_alloc_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, · 65 unmodified lines
6666 */
6767 void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
6868 bool at_head);
69−void blk_mq_request_bypass_insert(struct request *rq, bool run_queue);
69+void blk_mq_request_bypass_insert(struct request *rq, bool at_head,
70+ bool run_queue);
7071 void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
7172 struct list_head *list);
7273
@@ -199,7 +200,7 @@ static inline bool blk_mq_get_dispatch_budget(struct blk_mq_hw_ctx *hctx) · 126 unmodified lines
199200 static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
200201 struct request *rq)
201202 {
202− blk_mq_put_tag(hctx, hctx->tags, rq->mq_ctx, rq->tag);
203+ blk_mq_put_tag(hctx->tags, rq->mq_ctx, rq->tag);
203204 rq->tag = -1;
204205
205206 if (rq->rq_flags & RQF_MQ_INFLIGHT) {
crypto/Kconfig+0−4
@@ -136,8 +136,6 @@ config CRYPTO_USER · 135 unmodified lines
136136 Userspace configuration for cryptographic instantiations such as
137137 cbc(aes).
138138
139−if CRYPTO_MANAGER2
140−
141139 config CRYPTO_MANAGER_DISABLE_TESTS
142140 bool "Disable run-time self tests"
143141 default y
@@ -155,8 +153,6 @@ config CRYPTO_MANAGER_EXTRA_TESTS · 11 unmodified lines
155153 This is intended for developer use only, as these tests take much
156154 longer to run than the normal self tests.
157155
158−endif # if CRYPTO_MANAGER2
159−
160156 config CRYPTO_GF128MUL
161157 tristate
162158
crypto/hash_info.c+1−1
@@ -26,7 +26,7 @@ const char *const hash_algo_name[HASH_ALGO__LAST] = { · 25 unmodified lines
2626 [HASH_ALGO_TGR_128] = "tgr128",
2727 [HASH_ALGO_TGR_160] = "tgr160",
2828 [HASH_ALGO_TGR_192] = "tgr192",
29− [HASH_ALGO_SM3_256] = "sm3-256",
29+ [HASH_ALGO_SM3_256] = "sm3",
3030 [HASH_ALGO_STREEBOG_256] = "streebog256",
3131 [HASH_ALGO_STREEBOG_512] = "streebog512",
3232 };
crypto/testmgr.c+36−0
@@ -4436,6 +4436,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 4435 unmodified lines
44364436 .cipher = __VECS(tf_cbc_tv_template)
44374437 },
44384438 }, {
4439+#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
4440+ .alg = "cbc-paes-s390",
4441+ .fips_allowed = 1,
4442+ .test = alg_test_skcipher,
4443+ .suite = {
4444+ .cipher = __VECS(aes_cbc_tv_template)
4445+ }
4446+ }, {
4447+#endif
44394448 .alg = "cbcmac(aes)",
44404449 .fips_allowed = 1,
44414450 .test = alg_test_hash,
@@ -4587,6 +4596,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 145 unmodified lines
45874596 .cipher = __VECS(tf_ctr_tv_template)
45884597 }
45894598 }, {
4599+#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
4600+ .alg = "ctr-paes-s390",
4601+ .fips_allowed = 1,
4602+ .test = alg_test_skcipher,
4603+ .suite = {
4604+ .cipher = __VECS(aes_ctr_tv_template)
4605+ }
4606+ }, {
4607+#endif
45904608 .alg = "cts(cbc(aes))",
45914609 .test = alg_test_skcipher,
45924610 .fips_allowed = 1,
@@ -4879,6 +4897,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 286 unmodified lines
48794897 .cipher = __VECS(xtea_tv_template)
48804898 }
48814899 }, {
4900+#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
4901+ .alg = "ecb-paes-s390",
4902+ .fips_allowed = 1,
4903+ .test = alg_test_skcipher,
4904+ .suite = {
4905+ .cipher = __VECS(aes_tv_template)
4906+ }
4907+ }, {
4908+#endif
48824909 .alg = "ecdh",
48834910 .test = alg_test_kpp,
48844911 .fips_allowed = 1,
@@ -5465,6 +5492,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 580 unmodified lines
54655492 .cipher = __VECS(tf_xts_tv_template)
54665493 }
54675494 }, {
5495+#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
5496+ .alg = "xts-paes-s390",
5497+ .fips_allowed = 1,
5498+ .test = alg_test_skcipher,
5499+ .suite = {
5500+ .cipher = __VECS(aes_xts_tv_template)
5501+ }
5502+ }, {
5503+#endif
54685504 .alg = "xts4096(paes)",
54695505 .test = alg_test_null,
54705506 .fips_allowed = 1,
drivers/acpi/acpi_watchdog.c+12−3
@@ -55,12 +55,14 @@ static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat) · 54 unmodified lines
5555 }
5656 #endif
5757
58+static bool acpi_no_watchdog;
59+
5860 static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
5961 {
6062 const struct acpi_table_wdat *wdat = NULL;
6163 acpi_status status;
6264
63− if (acpi_disabled)
65+ if (acpi_disabled || acpi_no_watchdog)
6466 return NULL;
6567
6668 status = acpi_get_table(ACPI_SIG_WDAT, 0,
@@ -88,6 +90,14 @@ bool acpi_has_watchdog(void) · 21 unmodified lines
8890 }
8991 EXPORT_SYMBOL_GPL(acpi_has_watchdog);
9092
93+/* ACPI watchdog can be disabled on boot command line */
94+static int __init disable_acpi_watchdog(char *str)
95+{
96+ acpi_no_watchdog = true;
97+ return 1;
98+}
99+__setup("acpi_no_watchdog", disable_acpi_watchdog);
100+
91101 void __init acpi_watchdog_init(void)
92102 {
93103 const struct acpi_wdat_entry *entries;
@@ -126,12 +136,11 @@ void __init acpi_watchdog_init(void) · 32 unmodified lines
126136 gas = &entries[i].register_region;
127137
128138 res.start = gas->address;
139+ res.end = res.start + ACPI_ACCESS_BYTE_WIDTH(gas->access_width) - 1;
129140 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
130141 res.flags = IORESOURCE_MEM;
131− res.end = res.start + ALIGN(gas->access_width, 4) - 1;
132142 } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
133143 res.flags = IORESOURCE_IO;
134− res.end = res.start + gas->access_width - 1;
135144 } else {
136145 pr_warn("Unsupported address space: %u\n",
137146 gas->space_id);
drivers/acpi/acpica/achware.h+2−0
@@ -101,6 +101,8 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void); · 100 unmodified lines
101101
102102 acpi_status acpi_hw_enable_all_wakeup_gpes(void);
103103
104+u8 acpi_hw_check_all_gpes(void);
105+
104106 acpi_status
105107 acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
106108 struct acpi_gpe_block_info *gpe_block,
drivers/acpi/acpica/evevent.c+45−0
@@ -265,4 +265,49 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) · 264 unmodified lines
265265 handler) (acpi_gbl_fixed_event_handlers[event].context));
266266 }
267267
268+/*******************************************************************************
269+ *
270+ * FUNCTION: acpi_any_fixed_event_status_set
271+ *
272+ * PARAMETERS: None
273+ *
274+ * RETURN: TRUE or FALSE
275+ *
276+ * DESCRIPTION: Checks the PM status register for active fixed events
277+ *
278+ ******************************************************************************/
279+
280+u32 acpi_any_fixed_event_status_set(void)
281+{
282+ acpi_status status;
283+ u32 in_status;
284+ u32 in_enable;
285+ u32 i;
286+
287+ status = acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &in_enable);
288+ if (ACPI_FAILURE(status)) {
289+ return (FALSE);
290+ }
291+
292+ status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &in_status);
293+ if (ACPI_FAILURE(status)) {
294+ return (FALSE);
295+ }
296+
297+ /*
298+ * Check for all possible Fixed Events and dispatch those that are active
299+ */
300+ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
301+
302+ /* Both the status and enable bits must be on for this event */
303+
304+ if ((in_status & acpi_gbl_fixed_event_info[i].status_bit_mask) &&
305+ (in_enable & acpi_gbl_fixed_event_info[i].enable_bit_mask)) {
306+ return (TRUE);
307+ }
308+ }
309+
310+ return (FALSE);
311+}
312+
268313 #endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evxfgpe.c+32−0
@@ -795,6 +795,38 @@ acpi_status acpi_enable_all_wakeup_gpes(void) · 794 unmodified lines
795795
796796 ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
797797
798+/******************************************************************************
799+ *
800+ * FUNCTION: acpi_any_gpe_status_set
801+ *
802+ * PARAMETERS: None
803+ *
804+ * RETURN: Whether or not the status bit is set for any GPE
805+ *
806+ * DESCRIPTION: Check the status bits of all enabled GPEs and return TRUE if any
807+ * of them is set or FALSE otherwise.
808+ *
809+ ******************************************************************************/
810+u32 acpi_any_gpe_status_set(void)
811+{
812+ acpi_status status;
813+ u8 ret;
814+
815+ ACPI_FUNCTION_TRACE(acpi_any_gpe_status_set);
816+
817+ status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
818+ if (ACPI_FAILURE(status)) {
819+ return (FALSE);
820+ }
821+
822+ ret = acpi_hw_check_all_gpes();
823+ (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
824+
825+ return (ret);
826+}
827+
828+ACPI_EXPORT_SYMBOL(acpi_any_gpe_status_set)
829+
798830 /*******************************************************************************
799831 *
800832 * FUNCTION: acpi_install_gpe_block
drivers/acpi/acpica/hwgpe.c+71−0
@@ -444,6 +444,53 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, · 443 unmodified lines
444444 return (AE_OK);
445445 }
446446
447+/******************************************************************************
448+ *
449+ * FUNCTION: acpi_hw_get_gpe_block_status
450+ *
451+ * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
452+ * gpe_block - Gpe Block info
453+ *
454+ * RETURN: Success
455+ *
456+ * DESCRIPTION: Produce a combined GPE status bits mask for the given block.
457+ *
458+ ******************************************************************************/
459+
460+static acpi_status
461+acpi_hw_get_gpe_block_status(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
462+ struct acpi_gpe_block_info *gpe_block,
463+ void *ret_ptr)
464+{
465+ struct acpi_gpe_register_info *gpe_register_info;
466+ u64 in_enable, in_status;
467+ acpi_status status;
468+ u8 *ret = ret_ptr;
469+ u32 i;
470+
471+ /* Examine each GPE Register within the block */
472+
473+ for (i = 0; i < gpe_block->register_count; i++) {
474+ gpe_register_info = &gpe_block->register_info[i];
475+
476+ status = acpi_hw_read(&in_enable,
477+ &gpe_register_info->enable_address);
478+ if (ACPI_FAILURE(status)) {
479+ continue;
480+ }
481+
482+ status = acpi_hw_read(&in_status,
483+ &gpe_register_info->status_address);
484+ if (ACPI_FAILURE(status)) {
485+ continue;
486+ }
487+
488+ *ret |= in_enable & in_status;
489+ }
490+
491+ return (AE_OK);
492+}
493+
447494 /******************************************************************************
448495 *
449496 * FUNCTION: acpi_hw_disable_all_gpes
@@ -510,4 +557,28 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void) · 60 unmodified lines
510557 return_ACPI_STATUS(status);
511558 }
512559
560+/******************************************************************************
561+ *
562+ * FUNCTION: acpi_hw_check_all_gpes
563+ *
564+ * PARAMETERS: None
565+ *
566+ * RETURN: Combined status of all GPEs
567+ *
568+ * DESCRIPTION: Check all enabled GPEs in all GPE blocks and return TRUE if the
569+ * status bit is set for at least one of them of FALSE otherwise.
570+ *
571+ ******************************************************************************/
572+
573+u8 acpi_hw_check_all_gpes(void)
574+{
575+ u8 ret = 0;
576+
577+ ACPI_FUNCTION_TRACE(acpi_hw_check_all_gpes);
578+
579+ (void)acpi_ev_walk_gpe_list(acpi_hw_get_gpe_block_status, &ret);
580+
581+ return (ret != 0);
582+}
583+
513584 #endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/ec.c+26−18
@@ -179,6 +179,7 @@ EXPORT_SYMBOL(first_ec); · 178 unmodified lines
179179
180180 static struct acpi_ec *boot_ec;
181181 static bool boot_ec_is_ecdt = false;
182+static struct workqueue_struct *ec_wq;
182183 static struct workqueue_struct *ec_query_wq;
183184
184185 static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
@@ -469,7 +470,7 @@ static void acpi_ec_submit_query(struct acpi_ec *ec) · 284 unmodified lines
469470 ec_dbg_evt("Command(%s) submitted/blocked",
470471 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));
471472 ec->nr_pending_queries++;
472− schedule_work(&ec->work);
473+ queue_work(ec_wq, &ec->work);
473474 }
474475 }
475476
@@ -535,7 +536,7 @@ static void acpi_ec_enable_event(struct acpi_ec *ec) · 59 unmodified lines
535536 #ifdef CONFIG_PM_SLEEP
536537 static void __acpi_ec_flush_work(void)
537538 {
538− flush_scheduled_work(); /* flush ec->work */
539+ drain_workqueue(ec_wq); /* flush ec->work */
539540 flush_workqueue(ec_query_wq); /* flush queries */
540541 }
541542
@@ -556,8 +557,8 @@ static void acpi_ec_disable_event(struct acpi_ec *ec) · 14 unmodified lines
556557
557558 void acpi_ec_flush_work(void)
558559 {
559− /* Without ec_query_wq there is nothing to flush. */
560− if (!ec_query_wq)
560+ /* Without ec_wq there is nothing to flush. */
561+ if (!ec_wq)
561562 return;
562563
563564 __acpi_ec_flush_work();
@@ -2107,25 +2108,33 @@ static struct acpi_driver acpi_ec_driver = { · 1543 unmodified lines
21072108 .drv.pm = &acpi_ec_pm,
21082109 };
21092110
2110−static inline int acpi_ec_query_init(void)
2111+static void acpi_ec_destroy_workqueues(void)
21112112 {
2112− if (!ec_query_wq) {
2113− ec_query_wq = alloc_workqueue("kec_query", 0,
2114− ec_max_queries);
2115− if (!ec_query_wq)
2116− return -ENODEV;
2113+ if (ec_wq) {
2114+ destroy_workqueue(ec_wq);
2115+ ec_wq = NULL;
21172116 }
2118− return 0;
2119−}
2120−
2121−static inline void acpi_ec_query_exit(void)
2122−{
21232117 if (ec_query_wq) {
21242118 destroy_workqueue(ec_query_wq);
21252119 ec_query_wq = NULL;
21262120 }
21272121 }
21282122
2123+static int acpi_ec_init_workqueues(void)
2124+{
2125+ if (!ec_wq)
2126+ ec_wq = alloc_ordered_workqueue("kec", 0);
2127+
2128+ if (!ec_query_wq)
2129+ ec_query_wq = alloc_workqueue("kec_query", 0, ec_max_queries);
2130+
2131+ if (!ec_wq || !ec_query_wq) {
2132+ acpi_ec_destroy_workqueues();
2133+ return -ENODEV;
2134+ }
2135+ return 0;
2136+}
2137+
21292138 static const struct dmi_system_id acpi_ec_no_wakeup[] = {
21302139 {
21312140 .ident = "Thinkpad X1 Carbon 6th",
@@ -2156,8 +2165,7 @@ int __init acpi_ec_init(void) · 24 unmodified lines
21562165 int result;
21572166 int ecdt_fail, dsdt_fail;
21582167
2159− /* register workqueue for _Qxx evaluations */
2160− result = acpi_ec_query_init();
2168+ result = acpi_ec_init_workqueues();
21612169 if (result)
21622170 return result;
21632171
@@ -2188,6 +2196,6 @@ static void __exit acpi_ec_exit(void) · 24 unmodified lines
21882196 {
21892197
21902198 acpi_bus_unregister_driver(&acpi_ec_driver);
2191− acpi_ec_query_exit();
2199+ acpi_ec_destroy_workqueues();
21922200 }
21932201 #endif /* 0 */
drivers/acpi/sleep.c+44−13
@@ -990,21 +990,41 @@ static void acpi_s2idle_sync(void) · 989 unmodified lines
990990 acpi_os_wait_events_complete(); /* synchronize Notify handling */
991991 }
992992
993−static void acpi_s2idle_wake(void)
993+static bool acpi_s2idle_wake(void)
994994 {
995− /*
996− * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the SCI has
997− * not triggered while suspended, so bail out.
998− */
999− if (!acpi_sci_irq_valid() ||
1000− irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))
1001− return;
995+ if (!acpi_sci_irq_valid())
996+ return pm_wakeup_pending();
997+
998+ while (pm_wakeup_pending()) {
999+ /*
1000+ * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the
1001+ * SCI has not triggered while suspended, so bail out (the
1002+ * wakeup is pending anyway and the SCI is not the source of
1003+ * it).
1004+ */
1005+ if (irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))
1006+ return true;

49 more lines aren’t shown here.

drivers/block/floppy.c+5−2

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

drivers/block/null_blk.h+0−3

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

drivers/block/null_blk_main.c+0−2

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

drivers/block/paride/pcd.c+1−1

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

drivers/bus/moxtet.c+1−1

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

drivers/cdrom/gdrom.c+1−1

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

drivers/char/ipmi/ipmb_dev_int.c+31−2

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

drivers/char/ipmi/ipmi_ssif.c+7−3

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

drivers/char/tpm/Makefile+5−3

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

drivers/char/tpm/tpm2-cmd.c+2−0

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

drivers/char/tpm/tpm_tis_spi_main.crenamed from drivers/char/tpm/tpm_tis_spi.c+0−0

File renamed without changes.

drivers/cpufreq/cpufreq.c+12−5

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

drivers/dax/super.c+1−1

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

drivers/devfreq/devfreq.c+1−3

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

drivers/edac/edac_mc.c+3−9

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

drivers/edac/edac_mc_sysfs.c+4−14

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

drivers/firmware/efi/efi.c+2−2

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

drivers/fsi/Kconfig+1−0

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

drivers/gpio/gpio-bd71828.c+0−10

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

drivers/gpio/gpio-sifive.c+3−3

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

drivers/gpio/gpio-xilinx.c+3−2

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

drivers/gpio/gpiolib.c+25−5

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

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

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

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h+1−0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c+8−7

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

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+25−1

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h+1−2

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

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+2−0

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

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+22−5

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

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c+36−1

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

drivers/gpu/drm/amd/amdgpu/soc15.c+6−1

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

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c+8−6

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

drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c+3−3

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

drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c+4−4

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

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+9−6

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

drivers/gpu/drm/amd/display/dc/bios/command_table2.c+0−4

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

drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile+6−0

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

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c+1−1

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

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c+13−7

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

drivers/gpu/drm/amd/display/dc/dce/dce_aux.c+1−1

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

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c+0−1

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

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c+6−0

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

drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c+2−2

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

drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_offset.h+2−0

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

drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h+32−14

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

drivers/gpu/drm/amd/powerplay/navi10_ppt.c+11−11

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

drivers/gpu/drm/amd/powerplay/smu_v11_0.c+8−4

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

drivers/gpu/drm/bridge/tc358767.c+4−4

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

drivers/gpu/drm/bridge/ti-tfp410.c+2−1

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

drivers/gpu/drm/drm_client_modeset.c+2−1

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

drivers/gpu/drm/drm_dp_mst_topology.c+2−1

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

drivers/gpu/drm/drm_edid.c+1−1

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

drivers/gpu/drm/drm_modes.c+7−0

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

drivers/gpu/drm/i915/Kconfig+2−3

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

drivers/gpu/drm/i915/Makefile+1−1

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

drivers/gpu/drm/i915/display/intel_bios.c+4−2

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

drivers/gpu/drm/i915/display/intel_ddi.c+3−1

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

drivers/gpu/drm/i915/display/intel_display.c+37−27

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

drivers/gpu/drm/i915/display/intel_dsi_vbt.c+32−18

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

drivers/gpu/drm/i915/gem/i915_gem_context.c+16−0

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

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+36−1

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

drivers/gpu/drm/i915/gem/i915_gem_mman.c+87−42

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

drivers/gpu/drm/i915/gem/i915_gem_object.c+7−11

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

drivers/gpu/drm/i915/gem/i915_gem_object.h+10−2

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

drivers/gpu/drm/i915/gem/i915_gem_object_types.h+2−7

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

drivers/gpu/drm/i915/gem/i915_gem_phys.c+50−48

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

drivers/gpu/drm/i915/gem/i915_gem_shrinker.c+1−3

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

drivers/gpu/drm/i915/gt/intel_breadcrumbs.c+3−0

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

drivers/gpu/drm/i915/gt/intel_context.c+25−21

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

drivers/gpu/drm/i915/gt/intel_engine_cs.c+13−0

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

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

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

drivers/gpu/drm/i915/gt/intel_gt_requests.c+3−0

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

drivers/gpu/drm/i915/gt/intel_lrc.c+372−43

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

drivers/gpu/drm/i915/gt/intel_ring.c+1−0

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

drivers/gpu/drm/i915/gt/intel_ring.h+8−0

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

drivers/gpu/drm/i915/gt/intel_ring_types.h+4−3

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

drivers/gpu/drm/i915/gt/mock_engine.c+16−1

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

drivers/gpu/drm/i915/gt/selftest_lrc.c+259−1

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

drivers/gpu/drm/i915/gvt/dmabuf.c+1−1

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

drivers/gpu/drm/i915/gvt/firmware.c+2−2

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

drivers/gpu/drm/i915/gvt/gtt.c+4−0

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

drivers/gpu/drm/i915/gvt/vgpu.c+1−1

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

drivers/gpu/drm/i915/i915_active.c+19−16

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

drivers/gpu/drm/i915/i915_active.h+6−0

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

drivers/gpu/drm/i915/i915_gem.c+8−5

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

drivers/gpu/drm/i915/i915_gpu_error.c+3−2

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

drivers/gpu/drm/i915/i915_gpu_error.h+5−2

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

drivers/gpu/drm/i915/i915_pci.c+2−2

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

drivers/gpu/drm/i915/i915_pmu.c+43−28

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

drivers/gpu/drm/i915/i915_pmu.h+9−2

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

drivers/gpu/drm/i915/i915_request.c+19−8

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

drivers/gpu/drm/i915/i915_request.h+60−0

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

drivers/gpu/drm/i915/i915_scheduler.c+14−14

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

drivers/gpu/drm/i915/i915_utils.c+2−3

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

drivers/gpu/drm/i915/i915_vma.c+12−2

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

drivers/gpu/drm/msm/adreno/a6xx_gmu.c+31−6

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

drivers/gpu/drm/msm/adreno/a6xx_gpu.c+6−59

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

drivers/gpu/drm/msm/adreno/a6xx_hfi.c+60−25

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

drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c+2−2

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

drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c+57−1

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

drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c+2−2

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

drivers/gpu/drm/msm/dsi/dsi_manager.c+6−1

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

drivers/gpu/drm/msm/dsi/phy/dsi_phy.c+0−4

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

drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c+6−0

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

drivers/gpu/drm/msm/msm_drv.c+8−0

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

drivers/gpu/drm/nouveau/dispnv50/wndw.c+2−0

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

drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+4−0

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

drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c+26−0

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

drivers/gpu/drm/nouveau/nvkm/subdev/acr/tu102.c+14−0

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

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c+2−0

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

drivers/gpu/drm/panfrost/panfrost_drv.c+1−0

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

drivers/gpu/drm/panfrost/panfrost_gem.h+6−0

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

drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c+3−0

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

drivers/gpu/drm/panfrost/panfrost_job.c+7−6

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

drivers/gpu/drm/panfrost/panfrost_mmu.c+6−1

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

drivers/gpu/drm/panfrost/panfrost_perfcnt.c+4−7

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

drivers/gpu/drm/radeon/radeon_drv.c+41−2

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

drivers/gpu/drm/radeon/radeon_kms.c+6−0

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

drivers/gpu/drm/selftests/drm_cmdline_selftests.h+1−0

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

drivers/gpu/drm/selftests/test-drm_cmdline_parser.c+13−2

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

drivers/gpu/drm/sun4i/sun4i_drv.c+0−1

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

drivers/gpu/drm/vgem/vgem_drv.c+6−3

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

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

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

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

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

drivers/hid/hid-bigbenff.c+24−7

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

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

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

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

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

drivers/hid/hid-logitech-hidpp.c+21−22

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

drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c+8−0

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

drivers/hid/usbhid/hiddev.c+1−1

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

drivers/hwmon/acpi_power_meter.c+8−8

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

drivers/hwmon/pmbus/ltc2978.c+2−2

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

drivers/hwmon/pmbus/xdpe12284.c+2−2

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

drivers/hwmon/w83627ehf.c+6−1

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

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

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

drivers/i2c/busses/i2c-jz4780.c+2−34

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

drivers/ide/ide-gd.c+1−1

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

drivers/infiniband/core/security.c+9−15

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

drivers/infiniband/core/user_mad.c+3−2

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

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

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

drivers/infiniband/core/uverbs_std_types.c+1−0

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

drivers/infiniband/hw/cxgb4/cm.c+4−0

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

drivers/infiniband/hw/cxgb4/qp.c+2−2

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

drivers/infiniband/hw/hfi1/affinity.c+2−0

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

drivers/infiniband/hw/hfi1/file_ops.c+32−20

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

drivers/infiniband/hw/hfi1/hfi.h+4−1

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

drivers/infiniband/hw/hfi1/user_exp_rcv.c+2−3

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

drivers/infiniband/hw/hfi1/user_sdma.c+12−5

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

drivers/infiniband/hw/mlx5/devx.c+28−23

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

drivers/infiniband/hw/mlx5/main.c+3−3

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

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

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

drivers/infiniband/sw/rdmavt/qp.c+51−33

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

drivers/infiniband/sw/rxe/rxe_comp.c+4−4

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

drivers/infiniband/sw/siw/siw_cm.c+2−3

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

drivers/infiniband/ulp/isert/ib_isert.c+12−0

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

drivers/input/keyboard/goldfish_events.c+1−1

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

drivers/input/keyboard/gpio_keys.c+1−1

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

drivers/input/keyboard/gpio_keys_polled.c+1−1

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

drivers/input/keyboard/tca6416-keypad.c+2−2

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

drivers/input/mouse/cyapa_gen5.c+4−4

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

drivers/input/mouse/psmouse-smbus.c+5−3

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

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

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

drivers/input/touchscreen/ili210x.c+33−1

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

drivers/iommu/Makefile+2−2

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

drivers/iommu/amd_iommu_init.c+12−1

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

drivers/iommu/intel-iommu.c+24−17

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

drivers/iommu/qcom_iommu.c+12−16

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

drivers/macintosh/therm_windtunnel.c+31−21

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

drivers/md/bcache/alloc.c+16−2

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

drivers/md/bcache/btree.c+13−0

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

drivers/md/bcache/journal.c+2−5

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

drivers/md/bcache/super.c+0−17

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

drivers/misc/habanalabs/device.c+4−1

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

drivers/misc/habanalabs/goya/goya.c+42−2

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

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

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

drivers/net/bonding/bond_options.c+2−0

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

drivers/net/dsa/b53/b53_common.c+3−0

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

drivers/net/dsa/bcm_sf2.c+1−2

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

drivers/net/dsa/mv88e6xxx/chip.h+6−6

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

drivers/net/dsa/mv88e6xxx/global1.c+2−2

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

drivers/net/ethernet/amazon/ena/ena_com.c+58−38

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

drivers/net/ethernet/amazon/ena/ena_com.h+9−0

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

drivers/net/ethernet/amazon/ena/ena_ethtool.c+43−3

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

drivers/net/ethernet/amazon/ena/ena_netdev.c+3−3

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

drivers/net/ethernet/amazon/ena/ena_netdev.h+2−0

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

drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c+5−0

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

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

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

drivers/net/ethernet/aquantia/atlantic/aq_hw.h+2−0

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

drivers/net/ethernet/aquantia/atlantic/aq_nic.c+3−5

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

drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c+8−5

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

drivers/net/ethernet/aquantia/atlantic/aq_ring.c+7−3

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

drivers/net/ethernet/aquantia/atlantic/aq_ring.h+2−1

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

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c+14−8

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

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c+17−2

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

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c+12−0

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

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

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

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c+5−5

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

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+2−2

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

drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c+24−24

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

drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c+5−5

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

drivers/net/ethernet/broadcom/cnic_defs.h+2−2

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

drivers/net/ethernet/broadcom/genet/bcmmii.c+1−0

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

drivers/net/ethernet/cadence/macb.h+1−0

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

drivers/net/ethernet/cadence/macb_main.c+37−29

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

drivers/net/ethernet/cavium/thunder/thunder_bgx.c+59−3

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

drivers/net/ethernet/cavium/thunder/thunder_bgx.h+9−0

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

drivers/net/ethernet/cisco/enic/enic_main.c+1−1

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

drivers/net/ethernet/davicom/dm9000.c+2−0

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+16−6

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c+1−1

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

drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c+1−0

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

drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h+1−1

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

drivers/net/ethernet/huawei/hinic/hinic_hw_if.h+1−0

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

drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h+1−0

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

drivers/net/ethernet/huawei/hinic/hinic_main.c+2−1

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

drivers/net/ethernet/huawei/hinic/hinic_rx.c+2−3

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

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+2−2

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

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h+1−0

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

drivers/net/ethernet/intel/ice/ice_base.c+12−23

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

drivers/net/ethernet/intel/ice/ice_common.c+14−23

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

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

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

drivers/net/ethernet/intel/ice/ice_dcb.c+4−4

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

drivers/net/ethernet/intel/ice/ice_dcb_lib.c+40−59

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

drivers/net/ethernet/intel/ice/ice_dcb_nl.c+9−11

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

drivers/net/ethernet/intel/ice/ice_ethtool.c+74−335

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

drivers/net/ethernet/intel/ice/ice_hw_autogen.h+6−1

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

drivers/net/ethernet/intel/ice/ice_lib.c+20−51

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

drivers/net/ethernet/intel/ice/ice_lib.h+0−2

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

drivers/net/ethernet/intel/ice/ice_main.c+71−124

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

drivers/net/ethernet/intel/ice/ice_txrx.c+4−7

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

drivers/net/ethernet/intel/ice/ice_txrx.h+3−3

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

drivers/net/ethernet/intel/ice/ice_txrx_lib.c+1−1

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

drivers/net/ethernet/intel/ice/ice_type.h+1−1

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

drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c+97−104

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

drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h+2−1

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

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

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

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

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+4−2

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+8−12

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

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

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/lag.c+3−8

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

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

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

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

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c+7−2

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

drivers/net/ethernet/mellanox/mlx5/core/wq.c+30−9

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

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

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

drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+1−1

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

drivers/net/ethernet/micrel/ks8851_mll.c+17−50

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

drivers/net/ethernet/mscc/ocelot_board.c+8−0

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

drivers/net/ethernet/pensando/ionic/ionic_dev.c+7−4

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

drivers/net/ethernet/pensando/ionic/ionic_if.h+1−0

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

drivers/net/ethernet/qlogic/qede/qede.h+2−0

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

drivers/net/ethernet/qlogic/qede/qede_rdma.c+28−1

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

drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c+91−95

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

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

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

drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c+5−2

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

drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c+0−8

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

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

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

drivers/net/ethernet/sfc/ptp.c+35−3

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

drivers/net/ethernet/socionext/sni_ave.c+9−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+8−5

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

drivers/net/ethernet/sun/sunvnet_common.c+4−19

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

drivers/net/ethernet/xilinx/ll_temac.h+4−0

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

drivers/net/ethernet/xilinx/ll_temac_main.c+171−38

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

drivers/net/gtp.c+2−2

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

drivers/net/hyperv/netvsc.c+1−1

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

drivers/net/hyperv/netvsc_drv.c+3−0

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

drivers/net/phy/broadcom.c+2−2

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

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

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

drivers/net/phy/mdio-bcm-iproc.c+20−0

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

drivers/net/phy/mscc.c+2−2

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

drivers/net/phy/phy-c45.c+3−3

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

drivers/net/phy/phy_device.c+6−5

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

drivers/net/slip/slip.c+3−0

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

drivers/net/usb/qmi_wwan.c+19−27

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

drivers/net/wireguard/device.c+6−5

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

drivers/net/wireguard/receive.c+5−2

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

drivers/net/wireguard/send.c+11−5

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

drivers/net/wireguard/socket.c+0−1

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

drivers/nfc/pn544/i2c.c+1−0

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

drivers/nfc/pn544/pn544.c+1−1

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

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

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

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

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

drivers/nvme/host/pci.c+33−7

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

drivers/nvme/host/rdma.c+1−1

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

drivers/nvme/host/tcp.c+7−2

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

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

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

drivers/perf/arm_smmuv3_pmu.c+1−1

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

drivers/platform/chrome/wilco_ec/properties.c+1−1

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

drivers/s390/cio/blacklist.c+3−2

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

drivers/s390/cio/chp.c+2−2

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

drivers/s390/cio/qdio.h+1−3

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

drivers/s390/cio/qdio_debug.c+2−3

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

drivers/s390/cio/qdio_main.c+11−18

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

drivers/s390/cio/qdio_setup.c+3−2

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

drivers/s390/cio/vfio_ccw_trace.h+2−2

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

drivers/s390/crypto/ap_bus.h+2−2

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

drivers/s390/crypto/ap_card.c+4−4

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

drivers/s390/crypto/ap_queue.c+3−3

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

drivers/s390/crypto/pkey_api.c+1−1

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

drivers/s390/crypto/zcrypt_api.c+9−7

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

drivers/s390/crypto/zcrypt_ep11misc.c+2−2

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

drivers/s390/net/qeth_core_main.c+24−25

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

drivers/s390/net/qeth_l2_main.c+13−16

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

drivers/s390/scsi/zfcp_fsf.c+1−1

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

drivers/s390/scsi/zfcp_fsf.h+1−1

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

drivers/s390/scsi/zfcp_qdio.c+3−3

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

drivers/s390/scsi/zfcp_qdio.h+3−3

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

drivers/s390/scsi/zfcp_sysfs.c+1−1

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

drivers/scsi/libfc/fc_disc.c+2−0

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

drivers/scsi/megaraid/megaraid_sas_fusion.c+3−2

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

drivers/scsi/sd_zbc.c+6−1

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

drivers/scsi/sr.c+1−1

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

drivers/soc/tegra/fuse/fuse-tegra30.c+2−1

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

drivers/spi/spi-fsl-dspi.c+117−45

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

drivers/spmi/spmi-pmic-arb.c+4−0

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

drivers/staging/android/Kconfig+0−8

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

drivers/staging/android/Makefile+0−1

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

drivers/staging/android/TODO+0−9

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

drivers/staging/android/ashmem.c+28−0

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

drivers/staging/android/uapi/vsoc_shm.h+0−295

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

drivers/staging/android/vsoc.c+0−1149

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

drivers/staging/greybus/audio_manager.c+1−1

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

drivers/staging/rtl8188eu/os_dep/ioctl_linux.c+12−28

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

drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c+2−3

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

drivers/staging/rtl8723bs/os_dep/ioctl_linux.c+12−35

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

drivers/staging/vt6656/dpc.c+1−1

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

drivers/target/iscsi/iscsi_target.c+5−11

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

drivers/target/target_core_transport.c+28−3

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

drivers/tee/amdtee/Kconfig+1−1

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

drivers/thunderbolt/switch.c+7−0

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

drivers/tty/serdev/serdev-ttyport.c+2−4

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

drivers/tty/serial/8250/8250_aspeed_vuart.c+0−1

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

drivers/tty/serial/8250/8250_core.c+2−3

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

drivers/tty/serial/8250/8250_of.c+0−1

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

drivers/tty/serial/8250/8250_port.c+4−0

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

drivers/tty/serial/ar933x_uart.c+8−0

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

drivers/tty/serial/atmel_serial.c+2−1

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

drivers/tty/serial/cpm_uart/cpm_uart_core.c+1−0

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

drivers/tty/serial/imx.c+1−1

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

drivers/tty/serial/qcom_geni_serial.c+14−4

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

drivers/tty/serial/serial-tegra.c+16−19

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

drivers/tty/tty_port.c+3−2

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

drivers/tty/vt/selection.c+25−7

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

drivers/tty/vt/vt.c+13−2

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

drivers/tty/vt/vt_ioctl.c+11−6

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

drivers/usb/core/config.c+19−12

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

drivers/usb/core/hub.c+15−5

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

drivers/usb/core/hub.h+1−0

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

drivers/usb/core/quirks.c+40−0

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

drivers/usb/core/usb.h+3−0

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

drivers/usb/dwc2/gadget.c+23−17

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

drivers/usb/dwc3/debug.h+15−24

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

drivers/usb/dwc3/gadget.c+2−1

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

drivers/usb/gadget/composite.c+20−10

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

drivers/usb/gadget/function/f_fs.c+3−2

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

drivers/usb/gadget/function/u_audio.c+5−5

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

drivers/usb/gadget/function/u_serial.c+3−1

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

drivers/usb/gadget/udc/udc-xilinx.c+0−1

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

drivers/usb/host/xhci-hub.c+17−8

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

drivers/usb/host/xhci-mem.c+46−25

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

drivers/usb/host/xhci-pci.c+6−4

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

drivers/usb/host/xhci.h+11−3

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

drivers/usb/misc/iowarrior.c+29−2

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

drivers/usb/phy/phy-tegra-usb.c+8−0

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

drivers/usb/serial/ch341.c+10−0

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

drivers/usb/serial/ir-usb.c+1−1

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

drivers/usb/storage/uas.c+22−1

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

drivers/vhost/net.c+1−9

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

drivers/watchdog/Kconfig+2−0

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

drivers/watchdog/da9062_wdt.c+12−7

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

drivers/watchdog/wdat_wdt.c+24−1

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

drivers/xen/preempt.c+3−1

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

fs/btrfs/disk-io.c+3−1

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

fs/btrfs/extent-tree.c+2−0

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

fs/btrfs/extent_map.c+11−0

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

fs/btrfs/inode.c+21−5

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

fs/btrfs/ordered-data.c+6−1

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

fs/btrfs/qgroup.c+13−0

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

fs/btrfs/qgroup.h+1−0

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

fs/btrfs/ref-verify.c+5−0

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

fs/btrfs/super.c+2−0

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

fs/btrfs/sysfs.c+16−1

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

fs/btrfs/transaction.c+2−0

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

fs/btrfs/volumes.h+1−0

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

fs/ceph/file.c+11−6

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

fs/ceph/super.c+32−97

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

fs/ceph/super.h+1−1

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

fs/cifs/cifs_dfs_ref.c+2−0

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

fs/cifs/cifsacl.c+2−2

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

fs/cifs/cifsfs.c+7−1

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

fs/cifs/cifsglob.h+7−0

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

fs/cifs/cifsproto.h+3−2

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

fs/cifs/cifssmb.c+2−1

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

fs/cifs/connect.c+1−1

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

fs/cifs/file.c+12−7

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

fs/cifs/inode.c+11−7

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

fs/cifs/smb1ops.c+1−1

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

fs/cifs/smb2inode.c+2−2

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

fs/cifs/smb2ops.c+37−2

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

fs/cifs/smb2pdu.c+1−0

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

fs/dax.c+4−7

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

fs/ecryptfs/crypto.c+4−2

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

fs/ecryptfs/ecryptfs_kernel.h+1−1

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

fs/ecryptfs/keystore.c+1−1

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

fs/ecryptfs/main.c+1−1

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

fs/ecryptfs/messaging.c+2−1

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

fs/ext2/inode.c+3−2

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

fs/ext4/balloc.c+11−3

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

fs/ext4/block_validity.c+1−0

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

fs/ext4/dir.c+8−6

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

fs/ext4/ext4.h+34−10

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

fs/ext4/ialloc.c+14−9

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

fs/ext4/inode.c+21−9

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

fs/ext4/mballoc.c+41−20

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

fs/ext4/migrate.c+19−8

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

fs/ext4/mmp.c+7−5

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

fs/ext4/namei.c+8−0

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

fs/ext4/resize.c+49−13

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

fs/ext4/super.c+92−61

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

fs/io-wq.c+77−34

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

fs/io-wq.h+7−9

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

fs/io_uring.c+295−187

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

fs/jbd2/commit.c+25−21

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

fs/jbd2/transaction.c+16−10

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

fs/nfs/delegation.c+40−10

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

fs/nfs/delegation.h+1−0

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

fs/nfs/dir.c+116−10

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

fs/nfs/inode.c+1−0

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

fs/nfs/nfs4file.c+0−1

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

fs/nfs/nfs4proc.c+17−3

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

fs/pipe.c+10−8

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

fs/xfs/xfs_aops.c+1−1

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

fs/zonefs/Kconfig+1−0

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

fs/zonefs/super.c+4−4

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

include/acpi/acpixf.h+2−0

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

include/acpi/actypes.h+2−1

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

include/linux/blkdev.h+1−1

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

include/linux/blktrace_api.h+13−5

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

include/linux/bootconfig.h+3−0

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

include/linux/compat.h+0−29

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

include/linux/cpufreq.h+0−3

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

include/linux/dax.h+2−12

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

include/linux/hid.h+1−1

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

include/linux/icmpv6.h+10−0

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

include/linux/intel-svm.h+1−1

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

include/linux/irqdomain.h+1−1

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

include/linux/ktime.h+0−37

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

include/linux/kvm_host.h+3−1

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

include/linux/mlx5/mlx5_ifc.h+4−1

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

include/linux/netdevice.h+18−5

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

include/linux/netfilter/ipset/ip_set.h+10−1

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

include/linux/nfs_fs.h+6−20

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

include/linux/pipe_fs_i.h+2−1

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

include/linux/rculist_nulls.h+7−0

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

include/linux/sched/nohz.h+2−0

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

include/linux/skbuff.h+30−0

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

include/linux/suspend.h+1−1

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

include/linux/swiotlb.h+3−8

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

include/linux/time32.h+1−153

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

include/linux/timekeeping32.h+0−32

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

include/linux/trace_events.h+1−1

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

include/linux/tty.h+2−0

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

include/linux/types.h+0−5

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

include/linux/usb/quirks.h+3−0

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

include/net/flow_dissector.h+9−1

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

include/net/icmp.h+6−0

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

include/net/mac80211.h+5−6

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

include/net/sock.h+33−5

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

include/scsi/iscsi_proto.h+0−1

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

include/sound/rawmidi.h+3−3

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

include/sound/soc-dapm.h+0−2

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

include/uapi/asm-generic/posix_types.h+2−0

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

include/uapi/linux/bpf.h+7−9

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

include/uapi/linux/netfilter/nf_conntrack_common.h+11−1

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

include/uapi/linux/swab.h+2−2

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

include/uapi/linux/time.h+12−10

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

include/uapi/linux/usb/charger.h+8−8

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

init/Kconfig+2−4

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

init/main.c+52−23

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

ipc/sem.c+2−4

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

kernel/audit.c+21−19

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

kernel/auditfilter.c+39−32

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

kernel/bpf/btf.c+3−3

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

kernel/bpf/hashtab.c+53−5

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

kernel/bpf/offload.c+1−1

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

kernel/cgroup/cgroup.c+8−5

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

kernel/compat.c+0−64

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

kernel/dma/contiguous.c+8−1

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

kernel/dma/direct.c+25−36

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

kernel/dma/swiotlb.c+23−19

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

kernel/irq/internals.h+0−2

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

kernel/irq/manage.c+2−16

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

kernel/irq/proc.c+22−0

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

kernel/power/snapshot.c+1−1

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

kernel/power/suspend.c+5−4

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

kernel/sched/core.c+34−29

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

kernel/sched/fair.c+45−13

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

kernel/sched/loadavg.c+23−10

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

kernel/sched/psi.c+3−0

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

kernel/sched/sched.h+14−1

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

kernel/signal.c+14−9

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

kernel/sysctl.c+0−9

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

kernel/time/time.c+0−43

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

kernel/trace/Kconfig+2−2

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

kernel/trace/blktrace.c+83−31

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

kernel/trace/synth_event_gen_test.c+22−22

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

kernel/trace/trace.c+2−0

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

kernel/trace/trace_events_hist.c+177−142

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

kernel/trace/trace_kprobe.c+1−1

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

lib/Kconfig+0−3

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

lib/Makefile+1−1

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

lib/bootconfig.c+39−12

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

lib/crypto/chacha20poly1305.c+3−0

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

lib/stackdepot.c+6−2

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

lib/string.c+16−0

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

mm/memcontrol.c+3−1

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

mm/mmap.c+0−4

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

mm/mremap.c+0−1

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

mm/shmem.c+0−2

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

mm/sparse.c+1−1

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

mm/swapfile.c+1−1

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

mm/vmscan.c+6−3

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

net/Kconfig+0−1

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

net/bridge/br_device.c+2−4

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

net/bridge/br_stp.c+2−1

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

net/core/dev.c+15−25

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

net/core/devlink.c+23−15

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

net/core/fib_rules.c+1−1

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

net/core/page_pool.c+8−14

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

net/core/rtnetlink.c+12−14

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

net/core/skbuff.c+2−4

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

net/dsa/tag_ar9331.c+1−1

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

net/dsa/tag_qca.c+1−1

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

net/ethtool/bitset.c+5−1

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

net/ethtool/bitset.h+2−0

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

net/hsr/hsr_framereg.c+2−1

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

net/ipv4/cipso_ipv4.c+6−1

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

net/ipv4/icmp.c+33−0

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

net/ipv4/tcp_input.c+5−1

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

net/ipv4/udp.c+5−1

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

net/ipv6/ip6_fib.c+4−3

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

net/ipv6/ip6_gre.c+5−3

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

net/ipv6/ip6_icmp.c+34−0

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

net/ipv6/ip6_tunnel.c+56−25

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

net/ipv6/ipv6_sockglue.c+8−2

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

net/ipv6/route.c+1−0

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

net/mac80211/cfg.c+1−1

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

net/mac80211/mlme.c+5−9

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

net/mac80211/rx.c+1−1

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

net/mac80211/tx.c+1−1

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

net/mac80211/util.c+26−8

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

net/mptcp/Kconfig+1−0

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

net/mptcp/protocol.c+26−30

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

net/mptcp/protocol.h+2−2

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

net/netfilter/ipset/ip_set_core.c+24−10

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

net/netfilter/ipset/ip_set_hash_gen.h+440−195

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

net/netfilter/nf_conntrack_core.c+164−28

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

net/netfilter/nf_conntrack_proto_udp.c+16−4

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

net/netfilter/nf_flow_table_offload.c+3−3

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

net/netfilter/nft_set_pipapo.c+7−5

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

net/netfilter/xt_hashlimit.c+22−16

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

net/netlabel/netlabel_domainhash.c+2−1

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

net/netlabel/netlabel_unlabeled.c+2−1

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

net/netlink/af_netlink.c+3−2

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

net/netlink/genetlink.c+3−2

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

net/openvswitch/datapath.c+6−3

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

net/openvswitch/flow_netlink.c+10−8

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

net/openvswitch/flow_table.c+4−2

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

net/openvswitch/meter.c+2−1

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

net/openvswitch/vport.c+2−1

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

net/rds/rdma.c+12−12

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

net/sched/act_api.c+1−0

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

net/sched/cls_flower.c+2−0

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

net/sched/cls_matchall.c+1−0

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

net/sctp/sm_statefuns.c+20−9

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

net/smc/af_smc.c+17−10

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

net/smc/smc_clc.c+3−1

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

net/smc/smc_core.c+12−0

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

net/smc/smc_core.h+1−1

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

net/smc/smc_diag.c+2−3

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

net/smc/smc_ib.c+2−0

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

net/sunrpc/xprtrdma/frwr_ops.c+7−6

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

net/tipc/node.c+4−3

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

net/tipc/socket.c+2−0

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

net/tls/tls_device.c+19−1

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

net/unix/af_unix.c+4−0

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

net/vmw_vsock/af_vsock.c+12−8

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

net/vmw_vsock/hyperv_transport.c+0−3

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

net/vmw_vsock/virtio_transport_common.c+0−2

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

net/wireless/ethtool.c+6−2

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

net/wireless/nl80211.c+4−2

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

net/wireless/reg.c+1−1

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

net/xdp/xsk.c+2−0

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

net/xdp/xsk_queue.h+2−1

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

net/xfrm/xfrm_interface.c+3−3

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

scripts/Makefile.lib+3−3

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

scripts/get_maintainer.pl+4−28

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

scripts/kallsyms.c+2−2

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

scripts/link-vmlinux.sh+1−1

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

security/integrity/ima/Kconfig+5−0

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

security/integrity/platform_certs/load_uefi.c+26−14

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

security/selinux/hooks.c+1−1

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

security/selinux/ss/sidtab.c+3−9

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

sound/core/pcm_native.c+2−1

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

sound/core/seq/seq_clientmgr.c+2−2

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

sound/core/seq/seq_queue.c+22−7

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

sound/core/seq/seq_timer.c+10−3

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

sound/core/seq/seq_timer.h+2−1

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

sound/hda/ext/hdac_ext_controller.c+6−3

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

sound/hda/hdmi_chmap.c+1−1

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

sound/pci/hda/hda_codec.c+1−1

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

sound/pci/hda/hda_eld.c+1−1

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

sound/pci/hda/hda_sysfs.c+2−2

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

sound/pci/hda/patch_realtek.c+6−0

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

sound/soc/amd/raven/acp3x-i2s.c+8−0

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

sound/soc/amd/raven/acp3x-pcm-dma.c+1−6

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

sound/soc/amd/raven/pci-acp3x.c+0−23

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

sound/soc/atmel/Kconfig+2−2

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

sound/soc/atmel/Makefile+8−2

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

sound/soc/codecs/hdmi-codec.c+10−0

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

sound/soc/codecs/max98090.c+123−311

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

sound/soc/codecs/max98090.h+1−2

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

sound/soc/fsl/fsl_sai.c+17−5

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

sound/soc/soc-dapm.c+13−44

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

sound/soc/sof/intel/hda-codec.c+8−4

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

sound/soc/sof/intel/hda-dsp.c+11−0

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

sound/soc/sof/intel/hda.c+9−10

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

sound/soc/sunxi/sun8i-codec.c+2−1

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

sound/usb/clock.c+63−28

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

sound/usb/clock.h+2−2

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

sound/usb/format.c+23−13

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

sound/usb/mixer.c+10−2

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

sound/usb/quirks.c+1−0

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

tools/arch/arm64/include/uapi/asm/kvm.h+10−2

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

tools/arch/arm64/include/uapi/asm/unistd.h+1−0

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

tools/arch/x86/include/asm/cpufeatures.h+2−0

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

tools/arch/x86/include/asm/disabled-features.h+1−7

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

tools/arch/x86/include/asm/msr-index.h+2−0

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

tools/arch/x86/include/uapi/asm/kvm.h+1−0

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

tools/bootconfig/include/linux/memblock.h+12−0

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

tools/bootconfig/include/linux/printk.h+1−4

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

tools/bootconfig/main.c+46−33

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

tools/bootconfig/samples/bad-mixed-kv1.bconf+3−0

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

tools/bootconfig/samples/bad-mixed-kv2.bconf+3−0

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

tools/bootconfig/samples/bad-samekey.bconf+6−0

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

tools/bootconfig/test-bootconfig.sh+23−2

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

tools/include/uapi/asm-generic/mman-common.h+2−0

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

tools/include/uapi/asm-generic/unistd.h+6−1

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

tools/include/uapi/drm/i915_drm.h+32−0

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

tools/include/uapi/linux/bpf.h+7−9

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

tools/include/uapi/linux/fcntl.h+1−1

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

tools/include/uapi/linux/fscrypt.h+13−1

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

tools/include/uapi/linux/kvm.h+5−0

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

tools/include/uapi/linux/openat2.h+39−0

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

tools/include/uapi/linux/prctl.h+4−0

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

tools/include/uapi/linux/sched.h+6−0

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

tools/include/uapi/sound/asound.h+132−23

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

tools/lib/bpf/libbpf.c+7−1

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

tools/perf/Documentation/perf-config.txt+73−1

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

tools/perf/arch/arm/util/cs-etm.c+2−16

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

tools/perf/arch/arm64/util/arm-spe.c+2−15

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

tools/perf/arch/arm64/util/header.c+48−15

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

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl+2−0

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

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+2−0

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

tools/perf/arch/x86/util/intel-bts.c+2−15

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

tools/perf/arch/x86/util/intel-pt.c+2−15

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

tools/perf/builtin-annotate.c+2−2

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

tools/perf/builtin-probe.c+4−2

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

tools/perf/builtin-report.c+1−1

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

tools/perf/builtin-top.c+2−2

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

tools/perf/builtin-trace.c+3−1

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

tools/perf/check-headers.sh+1−0

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

tools/perf/include/bpf/pid_filter.h+1−1

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

tools/perf/include/bpf/stdio.h+1−1

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

tools/perf/include/bpf/unistd.h+1−1

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

tools/perf/tests/shell/lib/probe_vfs_getname.sh+1−1

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

tools/perf/trace/beauty/beauty.h+2−0

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

tools/perf/trace/beauty/prctl.c+2−1

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

tools/perf/ui/browsers/annotate.c+9−10

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

tools/perf/ui/gtk/annotate.c+1−1

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

tools/perf/util/annotate.c+75−119

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

tools/perf/util/annotate.h+3−6

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

tools/perf/util/auxtrace.c+21−1

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

tools/perf/util/auxtrace.h+6−0

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

tools/perf/util/config.c+12−0

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

tools/perf/util/config.h+1−0

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

tools/perf/util/llvm-utils.c+1−0

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

tools/perf/util/machine.c+12−14

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

tools/perf/util/map.c+16−1

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

tools/perf/util/probe-file.c+24−4

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

tools/perf/util/stat-shadow.c+0−6

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

tools/perf/util/symbol.c+12−5

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

tools/testing/kunit/kunit.py+12−0

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

tools/testing/kunit/kunit_kernel.py+16−12

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

tools/testing/selftests/Makefile+10−2

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

tools/testing/selftests/bpf/prog_tests/select_reuseport.c+6−2

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

tools/testing/selftests/bpf/prog_tests/sockmap_basic.c+5−0

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

tools/testing/selftests/ftrace/Makefile+1−1

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

tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc+1−7

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

tools/testing/selftests/futex/functional/Makefile+1−1

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

tools/testing/selftests/kvm/Makefile+2−1

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

tools/testing/selftests/kvm/include/x86_64/processor.h+22−22

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

tools/testing/selftests/kvm/include/x86_64/svm.h+297−0

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

tools/testing/selftests/kvm/include/x86_64/svm_util.h+38−0

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

tools/testing/selftests/kvm/lib/x86_64/svm.c+161−0

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

tools/testing/selftests/kvm/lib/x86_64/vmx.c+3−3

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

tools/testing/selftests/kvm/x86_64/svm_vmcall_test.c+79−0

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

tools/testing/selftests/lib.mk+13−10

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

tools/testing/selftests/livepatch/Makefile+2−0

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

tools/testing/selftests/net/Makefile+2−2

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

tools/testing/selftests/net/fib_tests.sh+6−0

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

tools/testing/selftests/net/forwarding/mirror_gre.sh+13−12

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

tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh+3−3

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

tools/testing/selftests/net/mptcp/Makefile+2−0

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

tools/testing/selftests/netfilter/nft_concat_range.sh+45−10

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

tools/testing/selftests/openat2/helpers.c+1−1

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

tools/testing/selftests/openat2/resolve_test.c+1−1

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

tools/testing/selftests/rseq/Makefile+3−1

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

tools/testing/selftests/rtc/Makefile+3−1

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

tools/testing/selftests/timens/Makefile+1−1

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

tools/testing/selftests/tpm2/test_smoke.sh+11−2

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

tools/testing/selftests/tpm2/test_space.sh+8−1

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

tools/testing/selftests/vm/run_vmtests+33−0

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

tools/testing/selftests/wireguard/netns.sh+11−0

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

tools/testing/selftests/wireguard/qemu/Makefile+14−24

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

virt/kvm/arm/arm.c+0−2

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

virt/kvm/arm/trace.h+1−0

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

virt/kvm/arm/vgic/vgic-mmio.c+0−12

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

virt/kvm/kvm_main.c+13−3

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