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
100/include/ksym/100/include/ksym/
101/arch/*/include/generated/101/arch/*/include/generated/
102 102
103# Generated lkdtm tests
104/tools/testing/selftests/lkdtm/*.sh
105!/tools/testing/selftests/lkdtm/run.sh
106
103# stgit generated dirs107# stgit generated dirs
104patches-*108patches-*
105 109
COPYING+2−0
@@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see: · 15 unmodified lines
16 Documentation/process/license-rules.rst16 Documentation/process/license-rules.rst
17 17
18for more details.18for more details.
19
20All 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
567S: Orlando, Florida567S: Orlando, Florida
568S: USA568S: USA
569 569
570N: Paul Burton
571E: paulburton@kernel.org
572W: https://pburton.com
573D: MIPS maintainer 2018-2020
574
570N: Lennert Buytenhek575N: Lennert Buytenhek
571E: kernel@wantstofly.org576E: kernel@wantstofly.org
572D: Original (2.4) rewrite of the ethernet bridging code577D: 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
62In both styles, same key words are automatically merged when parsing it62In both styles, same key words are automatically merged when parsing it
63at boot time. So you can append similar trees or key-values.63at boot time. So you can append similar trees or key-values.
64 64
65Same-key Values
66---------------
67
68It is prohibited that two or more values or arrays share a same-key.
69For example,::
70
71 foo = bar, baz
72 foo = qux # !ERROR! we can not re-define same key
73
74If you want to append the value to existing key as an array member,
75you can use ``+=`` operator. For example::
76
77 foo = bar, baz
78 foo += qux
79
80In this case, the key ``foo`` has ``bar``, ``baz`` and ``qux``.
81
82However, a sub-key and a value can not co-exist under a parent key.
83For 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
65Comments89Comments
66--------90--------
67 91
@@ -102,9 +126,13 @@ Boot Kernel With a Boot Config · 34 unmodified lines
102==============================126==============================
103 127
104Since the boot configuration file is loaded with initrd, it will be added128Since the boot configuration file is loaded with initrd, it will be added
105to the end of the initrd (initramfs) image file. The Linux kernel decodes129to the end of the initrd (initramfs) image file with size, checksum and
106the last part of the initrd image in memory to get the boot configuration13012-byte magic word as below.
107data.131
132[initrd][bootconfig][size(u32)][checksum(u32)][#BOOTCONFIG\n]
133
134The Linux kernel decodes the last part of the initrd image in memory to
135get the boot configuration data.
108Because of this "piggyback" method, there is no need to change or136Because of this "piggyback" method, there is no need to change or
109update the boot loader and the kernel image itself.137update the boot loader and the kernel image itself.
110 138
Documentation/admin-guide/kernel-parameters.txt+4−0
@@ -136,6 +136,10 @@ · 135 unmodified lines
136 dynamic table installation which will install SSDT136 dynamic table installation which will install SSDT
137 tables to /sys/firmware/acpi/tables/dynamic.137 tables to /sys/firmware/acpi/tables/dynamic.
138 138
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
139 acpi_rsdp= [ACPI,EFI,KEXEC]143 acpi_rsdp= [ACPI,EFI,KEXEC]
140 Pass the RSDP address to the kernel, mostly used144 Pass the RSDP address to the kernel, mostly used
141 on machines running EFI runtime service to boot the145 on machines running EFI runtime service to boot the
Documentation/arm64/memory.rst+1−1
@@ -129,7 +129,7 @@ this logic. · 128 unmodified lines
129 129
130As a single binary will need to support both 48-bit and 52-bit VA130As a single binary will need to support both 48-bit and 52-bit VA
131spaces, the VMEMMAP must be sized large enough for 52-bit VAs and131spaces, the VMEMMAP must be sized large enough for 52-bit VAs and
132also must be sized large enought to accommodate a fixed PAGE_OFFSET.132also must be sized large enough to accommodate a fixed PAGE_OFFSET.
133 133
134Most code in the kernel should not need to consider the VA_BITS, for134Most code in the kernel should not need to consider the VA_BITS, for
135code that does need to know the VA size the variables are135code 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
44how the user addresses are used by the kernel:44how the user addresses are used by the kernel:
45 45
461. User addresses not accessed by the kernel but used for address space461. User addresses not accessed by the kernel but used for address space
47 management (e.g. ``mmap()``, ``mprotect()``, ``madvise()``). The use47 management (e.g. ``mprotect()``, ``madvise()``). The use of valid
48 of valid tagged pointers in this context is always allowed.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.
49 56
502. User addresses accessed by the kernel (e.g. ``write()``). This ABI572. User addresses accessed by the kernel (e.g. ``write()``). This ABI
51 relaxation is disabled by default and the application thread needs to58 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
551Once the kernel is built and installed, a simple551Once the kernel is built and installed, a simple
552 552
553.. code-block:: bash553.. code-block:: bash
554
554 modprobe example-test555 modprobe example-test
555 556
556...will run the tests.557...will run the tests.
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml+5−1
@@ -43,9 +43,13 @@ properties: · 42 unmodified lines
43 - enum:43 - enum:
44 - allwinner,sun8i-h3-tcon-tv44 - allwinner,sun8i-h3-tcon-tv
45 - allwinner,sun50i-a64-tcon-tv45 - allwinner,sun50i-a64-tcon-tv
46 - allwinner,sun50i-h6-tcon-tv
47 - const: allwinner,sun8i-a83t-tcon-tv46 - const: allwinner,sun8i-a83t-tcon-tv
48 47
48 - items:
49 - enum:
50 - allwinner,sun50i-h6-tcon-tv
51 - const: allwinner,sun8i-r40-tcon-tv
52
49 reg:53 reg:
50 maxItems: 154 maxItems: 1
51 55
Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt+2−1
@@ -1,9 +1,10 @@
1Ilitek ILI210x/ILI2117/ILI251x touchscreen controller1Ilitek ILI210x/ILI2117/ILI2120/ILI251x touchscreen controller
2 2
3Required properties:3Required properties:
4- compatible:4- compatible:
5 ilitek,ili210x for ILI210x5 ilitek,ili210x for ILI210x
6 ilitek,ili2117 for ILI21176 ilitek,ili2117 for ILI2117
7 ilitek,ili2120 for ILI2120
7 ilitek,ili251x for ILI251x8 ilitek,ili251x for ILI251x
8 9
9- reg: The I2C address of the device10- 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
33 maxItems: 133 maxItems: 1
34 34
35 clocks:35 clocks:
36 minItems: 236 oneOf:
37 maxItems: 337 - items:
38 items:38 - description: The CSI interface clock
39 - description: The CSI interface clock39 - description: The CSI DRAM clock
40 - description: The CSI ISP clock40
41 - description: The CSI DRAM clock41 - items:
42 - description: The CSI interface clock
43 - description: The CSI ISP clock
44 - description: The CSI DRAM clock
42 45
43 clock-names:46 clock-names:
44 minItems: 247 oneOf:
45 maxItems: 348 - items:
46 items:49 - const: bus
47 - const: bus50 - const: ram
48 - const: isp51
49 - const: ram52 - items:
53 - const: bus
54 - const: isp
55 - const: ram
50 56
51 resets:57 resets:
52 maxItems: 158 maxItems: 1
53 59
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
54 # See ./video-interfaces.txt for details70 # See ./video-interfaces.txt for details
55 port:71 port:
56 type: object72 type: object
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.yaml+12−8
@@ -347,6 +347,7 @@ examples: · 346 unmodified lines
347 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;347 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
348 348
349 #iommu-cells = <1>;349 #iommu-cells = <1>;
350 #reset-cells = <1>;
350 };351 };
351 352
352 external-memory-controller@7001b000 {353 external-memory-controller@7001b000 {
@@ -363,20 +364,23 @@ examples: · 10 unmodified lines
363 timing-0 {364 timing-0 {
364 clock-frequency = <12750000>;365 clock-frequency = <12750000>;
365 366
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>;
373 nvidia,emc-auto-cal-config = <0xa1430000>;367 nvidia,emc-auto-cal-config = <0xa1430000>;
374 nvidia,emc-auto-cal-config2 = <0x00000000>;368 nvidia,emc-auto-cal-config2 = <0x00000000>;
375 nvidia,emc-auto-cal-config3 = <0x00000000>;369 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>;
377 nvidia,emc-mode-1 = <0x80100003>;375 nvidia,emc-mode-1 = <0x80100003>;
378 nvidia,emc-mode-2 = <0x80200008>;376 nvidia,emc-mode-2 = <0x80200008>;
379 nvidia,emc-mode-4 = <0x00000000>;377 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>;
380 384
381 nvidia,emc-configuration = <385 nvidia,emc-configuration = <
382 0x00000000 /* EMC_RC */386 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
124 pinctrl-1 = <&mmc1_idle>;124 pinctrl-1 = <&mmc1_idle>;
125 pinctrl-2 = <&mmc1_sleep>;125 pinctrl-2 = <&mmc1_sleep>;
126 ...126 ...
127 interrupts-extended = <&intc 64 &gpio2 28 GPIO_ACTIVE_LOW>;127 interrupts-extended = <&intc 64 &gpio2 28 IRQ_TYPE_LEVEL_LOW>;
128 };128 };
129 129
130 mmc1_idle : pinmux_cirq_pin {130 mmc1_idle : pinmux_cirq_pin {
Documentation/devicetree/bindings/net/mdio.yaml+0−1
@@ -56,7 +56,6 @@ patternProperties: · 55 unmodified lines
56examples:56examples:
57 - |57 - |
58 davinci_mdio: mdio@5c030000 {58 davinci_mdio: mdio@5c030000 {
59 compatible = "ti,davinci_mdio";
60 reg = <0x5c030000 0x1000>;59 reg = <0x5c030000 0x1000>;
61 #address-cells = <1>;60 #address-cells = <1>;
62 #size-cells = <0>;61 #size-cells = <0>;
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt+11−6
@@ -1,12 +1,17 @@
1ARM Freescale DSPI controller1ARM Freescale DSPI controller
2 2
3Required properties:3Required properties:
4- compatible : "fsl,vf610-dspi", "fsl,ls1021a-v1.0-dspi",4- compatible : must be one of:
5 "fsl,ls2085a-dspi"5 "fsl,vf610-dspi",
6 or6 "fsl,ls1021a-v1.0-dspi",
7 "fsl,ls2080a-dspi" followed by "fsl,ls2085a-dspi"7 "fsl,ls1012a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
8 "fsl,ls1012a-dspi" followed by "fsl,ls1021a-v1.0-dspi"8 "fsl,ls1028a-dspi",
9 "fsl,ls1088a-dspi" followed by "fsl,ls1021a-v1.0-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",
10- reg : Offset and length of the register set for the device15- reg : Offset and length of the register set for the device
11- interrupts : Should contain SPI controller interrupt16- interrupts : Should contain SPI controller interrupt
12- clocks: from common clock binding: handle to dspi clock.17- 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
71 ipmb@10 {71 ipmb@10 {
72 compatible = "ipmb-dev";72 compatible = "ipmb-dev";
73 reg = <0x10>;73 reg = <0x10>;
74 i2c-protocol;
74 };75 };
75 };76 };
76 77
78If xmit of data to be done using raw i2c block vs smbus
79then "i2c-protocol" needs to be defined as above.
80
772) Manually from Linux::812) Manually from Linux::
78 82
79 modprobe ipmb-dev-int83 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
134end, that is, write operations can only be append writes. Zonefs makes no134end, that is, write operations can only be append writes. Zonefs makes no
135attempt at accepting random writes and will fail any write request that has a135attempt at accepting random writes and will fail any write request that has a
136start offset not corresponding to the end of the file, or to the end of the last136start offset not corresponding to the end of the file, or to the end of the last
137write issued and still in-flight (for asynchrnous I/O operations).137write issued and still in-flight (for asynchronous I/O operations).
138 138
139Since dirty page writeback by the page cache does not guarantee a sequential139Since dirty page writeback by the page cache does not guarantee a sequential
140write pattern, zonefs prevents buffered writes and writeable shared mappings140write 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
142zonefs relies on the sequential delivery of write I/O requests to the device142zonefs relies on the sequential delivery of write I/O requests to the device
143implemented by the block layer elevator. An elevator implementing the sequential143implemented by the block layer elevator. An elevator implementing the sequential
144write feature for zoned block device (ELEVATOR_F_ZBD_SEQ_WRITE elevator feature)144write feature for zoned block device (ELEVATOR_F_ZBD_SEQ_WRITE elevator feature)
145must be used. This type of elevator (e.g. mq-deadline) is the set by default145must be used. This type of elevator (e.g. mq-deadline) is set by default
146for zoned block devices on device initialization.146for zoned block devices on device initialization.
147 147
148There are no restrictions on the type of I/O used for read operations in148There 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
196 may still happen in the case of a partial failure of a very large direct I/O196 may still happen in the case of a partial failure of a very large direct I/O
197 operation split into multiple BIOs/requests or asynchronous I/O operations.197 operation split into multiple BIOs/requests or asynchronous I/O operations.
198 If one of the write request within the set of sequential write requests198 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 will199 issued to the device fails, all write requests queued after it will
200 become unaligned and fail.200 become unaligned and fail.
201 201
202* Delayed write errors: similarly to regular block devices, if the device side202* 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
207 causing all data to be dropped after the sector that caused the error.207 causing all data to be dropped after the sector that caused the error.
208 208
209All I/O errors detected by zonefs are notified to the user with an error code209All I/O errors detected by zonefs are notified to the user with an error code
210return for the system call that trigered or detected the error. The recovery210return for the system call that triggered or detected the error. The recovery
211actions taken by zonefs in response to I/O errors depend on the I/O type (read211actions taken by zonefs in response to I/O errors depend on the I/O type (read
212vs write) and on the reason for the error (bad sector, unaligned writes or zone212vs write) and on the reason for the error (bad sector, unaligned writes or zone
213condition change).213condition change).
@@ -222,7 +222,7 @@ condition change). · 8 unmodified lines
222* A zone condition change to read-only or offline also always triggers zonefs222* A zone condition change to read-only or offline also always triggers zonefs
223 I/O error recovery.223 I/O error recovery.
224 224
225Zonefs minimal I/O error recovery may change a file size and a file access225Zonefs minimal I/O error recovery may change a file size and file access
226permissions.226permissions.
227 227
228* File size changes:228* File size changes:
@@ -237,7 +237,7 @@ permissions. · 8 unmodified lines
237 A file size may also be reduced to reflect a delayed write error detected on237 A file size may also be reduced to reflect a delayed write error detected on
238 fsync(): in this case, the amount of data effectively written in the zone may238 fsync(): in this case, the amount of data effectively written in the zone may
239 be less than originally indicated by the file inode size. After such I/O239 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 data240 error, zonefs always fixes the file inode size to reflect the amount of data
241 persistently stored in the file zone.241 persistently stored in the file zone.
242 242
243* Access permission changes:243* Access permission changes:
@@ -281,11 +281,11 @@ Further notes: · 37 unmodified lines
281 permissions to read-only applies to all files. The file system is remounted281 permissions to read-only applies to all files. The file system is remounted
282 read-only.282 read-only.
283* Access permission and file size changes due to the device transitioning zones283* Access permission and file size changes due to the device transitioning zones
284 to the offline condition are permanent. Remounting or reformating the device284 to the offline condition are permanent. Remounting or reformatting the device
285 with mkfs.zonefs (mkzonefs) will not change back offline zone files to a good285 with mkfs.zonefs (mkzonefs) will not change back offline zone files to a good
286 state.286 state.
287* File access permission changes to read-only due to the device transitioning287* File access permission changes to read-only due to the device transitioning
288 zones to the read-only condition are permanent. Remounting or reformating288 zones to the read-only condition are permanent. Remounting or reformatting
289 the device will not re-enable file write access.289 the device will not re-enable file write access.
290* File access permission changes implied by the remount-ro, zone-ro and290* File access permission changes implied by the remount-ro, zone-ro and
291 zone-offline mount options are temporary for zones in a good condition.291 zone-offline mount options are temporary for zones in a good condition.
@@ -301,13 +301,13 @@ Mount options · 9 unmodified lines
301 301
302zonefs define the "errors=<behavior>" mount option to allow the user to specify302zonefs define the "errors=<behavior>" mount option to allow the user to specify
303zonefs behavior in response to I/O errors, inode size inconsistencies or zone303zonefs behavior in response to I/O errors, inode size inconsistencies or zone
304condition chages. The defined behaviors are as follow:304condition changes. The defined behaviors are as follow:
305* remount-ro (default)305* remount-ro (default)
306* zone-ro306* zone-ro
307* zone-offline307* zone-offline
308* repair308* repair
309 309
310The I/O error actions defined for each behavior is detailed in the previous310The I/O error actions defined for each behavior are detailed in the previous
311section.311section.
312 312
313Zonefs User Space Tools313Zonefs 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
24dual loop voltage regulators.24dual loop voltage regulators.
25The family includes XDPE12284 and XDPE12254 devices.25The family includes XDPE12284 and XDPE12254 devices.
26The devices from this family complaint with:26The devices from this family complaint with:
27
27- Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC28- Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC
28 converter specification.29 converter specification.
29- Intel SVID rev 1.9. protocol.30- 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
765 Example::765 Example::
766 766
767 #arch/x86/boot/Makefile767 #arch/x86/boot/Makefile
768 subdir- := compressed/768 subdir- := compressed
769 769
770The above assignment instructs kbuild to descend down in the770The above assignment instructs kbuild to descend down in the
771directory compressed/ when "make clean" is executed.771directory compressed/ when "make clean" is executed.
@@ -1379,9 +1379,6 @@ See subsequent chapter for the syntax of the Kbuild file. · 607 unmodified lines
1379 in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate1379 in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
1380 a wrapper of the asm-generic one.1380 a wrapper of the asm-generic one.
1381 1381
1382 The convention is to list one subdir per line and
1383 preferably in alphabetic order.
1384
13858 Kbuild Variables13828 Kbuild Variables
1386==================1383==================
1387 1384
Documentation/networking/phy.rst+3−2
@@ -487,8 +487,9 @@ phy_register_fixup_for_id():: · 486 unmodified lines
487The stubs set one of the two matching criteria, and set the other one to487The stubs set one of the two matching criteria, and set the other one to
488match anything.488match anything.
489 489
490When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module,490When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module load
491unregister fixup and free allocate memory are required.491time, the module needs to unregister the fixup and free allocated memory when
492it's unloaded.
492 493
493Call one of following function before unloading module::494Call one of following function before unloading module::
494 495
Documentation/power/index.rst+0−1
@@ -13,7 +13,6 @@ Power Management · 12 unmodified lines
13 drivers-testing13 drivers-testing
14 energy-model14 energy-model
15 freezing-of-tasks15 freezing-of-tasks
16 interface
17 opp16 opp
18 pci17 pci
19 pm_qos_interface18 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
244an involved disclosed party. The current ambassadors list:244an involved disclosed party. The current ambassadors list:
245 245
246 ============= ========================================================246 ============= ========================================================
247 ARM247 ARM Grant Likely <grant.likely@arm.com>
248 AMD Tom Lendacky <tom.lendacky@amd.com>248 AMD Tom Lendacky <tom.lendacky@amd.com>
249 IBM249 IBM
250 Intel Tony Luck <tony.luck@intel.com>250 Intel Tony Luck <tony.luck@intel.com>
251 Qualcomm Trilok Soni <tsoni@codeaurora.org>251 Qualcomm Trilok Soni <tsoni@codeaurora.org>
252 252
253 Microsoft Sasha Levin <sashal@kernel.org>253 Microsoft James Morris <jamorris@linux.microsoft.com>
254 VMware254 VMware
255 Xen Andrew Cooper <andrew.cooper3@citrix.com>255 Xen Andrew Cooper <andrew.cooper3@citrix.com>
256 256
257 Canonical Tyler Hicks <tyhicks@canonical.com>257 Canonical John Johansen <john.johansen@canonical.com>
258 Debian Ben Hutchings <ben@decadent.org.uk>258 Debian Ben Hutchings <ben@decadent.org.uk>
259 Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>259 Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
260 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>260 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>
261 SUSE Jiri Kosina <jkosina@suse.cz>261 SUSE Jiri Kosina <jkosina@suse.cz>
262 262
263 Amazon Peter Bowen <pzb@amzn.com>263 Amazon
264 Google Kees Cook <keescook@chromium.org>264 Google Kees Cook <keescook@chromium.org>
265 ============= ========================================================265 ============= ========================================================
266 266
Documentation/sphinx/parallel-wrapper.sh+1−1
@@ -30,4 +30,4 @@ if [ -n "$parallel" ] ; then · 29 unmodified lines
30 parallel="-j$parallel"30 parallel="-j$parallel"
31fi31fi
32 32
33exec "$sphinx" "$parallel" "$@"33exec "$sphinx" $parallel "$@"
Documentation/translations/zh_CN/process/embargoed-hardware-issues.rst+1−1
@@ -183,7 +183,7 @@ CVE分配 · 182 unmodified lines
183 VMware183 VMware
184 Xen Andrew Cooper <andrew.cooper3@citrix.com>184 Xen Andrew Cooper <andrew.cooper3@citrix.com>
185 185
186 Canonical Tyler Hicks <tyhicks@canonical.com>186 Canonical John Johansen <john.johansen@canonical.com>
187 Debian Ben Hutchings <ben@decadent.org.uk>187 Debian Ben Hutchings <ben@decadent.org.uk>
188 Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>188 Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
189 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>189 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==================
1Guest halt polling2Guest halt polling
2==================3==================
3 4
4The cpuidle_haltpoll driver, with the haltpoll governor, allows5The cpuidle_haltpoll driver, with the haltpoll governor, allows
5the guest vcpus to poll for a specified amount of time before6the guest vcpus to poll for a specified amount of time before
6halting.7halting.
8
7This provides the following benefits to host side polling:9This provides the following benefits to host side polling:
8 10
9 1) The POLL flag is set while polling is performed, which allows11 1) The POLL flag is set while polling is performed, which allows
@@ -29,18 +31,21 @@ Module Parameters · 19 unmodified lines
29The haltpoll governor has 5 tunable module parameters:31The haltpoll governor has 5 tunable module parameters:
30 32
311) guest_halt_poll_ns:331) guest_halt_poll_ns:
34
32Maximum amount of time, in nanoseconds, that polling is35Maximum amount of time, in nanoseconds, that polling is
33performed before halting.36performed before halting.
34 37
35Default: 20000038Default: 200000
36 39
372) guest_halt_poll_shrink:402) guest_halt_poll_shrink:
41
38Division factor used to shrink per-cpu guest_halt_poll_ns when42Division factor used to shrink per-cpu guest_halt_poll_ns when
39wakeup event occurs after the global guest_halt_poll_ns.43wakeup event occurs after the global guest_halt_poll_ns.
40 44
41Default: 245Default: 2
42 46
433) guest_halt_poll_grow:473) guest_halt_poll_grow:
48
44Multiplication factor used to grow per-cpu guest_halt_poll_ns49Multiplication factor used to grow per-cpu guest_halt_poll_ns
45when event occurs after per-cpu guest_halt_poll_ns50when event occurs after per-cpu guest_halt_poll_ns
46but before global guest_halt_poll_ns.51but before global guest_halt_poll_ns.
@@ -48,6 +53,7 @@ but before global guest_halt_poll_ns. · 1 unmodified line
48Default: 253Default: 2
49 54
504) guest_halt_poll_grow_start:554) guest_halt_poll_grow_start:
56
51The per-cpu guest_halt_poll_ns eventually reaches zero57The per-cpu guest_halt_poll_ns eventually reaches zero
52in case of an idle system. This value sets the initial58in case of an idle system. This value sets the initial
53per-cpu guest_halt_poll_ns when growing. This can59per-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
66 72
67Default: Y73Default: Y
68 74
69The module parameters can be set from the debugfs files in:75The module parameters can be set from the debugfs files in::
70 76
71 /sys/module/haltpoll/parameters/77 /sys/module/haltpoll/parameters/
72 78
@@ -74,5 +80,5 @@ Further Notes · 1 unmodified line
74=============80=============
75 81
76- Care should be taken when setting the guest_halt_poll_ns parameter as a82- Care should be taken when setting the guest_halt_poll_ns parameter as a
77large value has the potential to drive the cpu usage to 100% on a machine which83 large value has the potential to drive the cpu usage to 100% on a machine
78would be almost entirely idle otherwise.84 which would be almost entirely idle otherwise.
Documentation/virt/index.rst+2−0
@@ -8,7 +8,9 @@ Linux Virtualization Support · 7 unmodified lines
8 :maxdepth: 28 :maxdepth: 2
9 9
10 kvm/index10 kvm/index
11 uml/user_mode_linux
11 paravirt_ops12 paravirt_ops
13 guest-halt-polling
12 14
13.. only:: html and subproject15.. only:: html and subproject
14 16
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===================================================================
1The Definitive KVM (Kernel-based Virtual Machine) API Documentation4The Definitive KVM (Kernel-based Virtual Machine) API Documentation
2===================================================================5===================================================================
3 6
41. General description71. General description
5----------------------8======================
6 9
7The kvm API is a set of ioctls that are issued to control various aspects10The kvm API is a set of ioctls that are issued to control various aspects
8of a virtual machine. The ioctls belong to the following classes:11of 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
33 was used to create the VM.36 was used to create the VM.
34 37
352. File descriptors382. File descriptors
36-------------------39===================
37 40
38The kvm API is centered around file descriptors. An initial41The kvm API is centered around file descriptors. An initial
39open("/dev/kvm") obtains a handle to the kvm subsystem; this handle42open("/dev/kvm") obtains a handle to the kvm subsystem; this handle
@@ -70,7 +73,7 @@ the VM is shut down. · 30 unmodified lines
70 73
71 74
723. Extensions753. Extensions
73-------------76=============
74 77
75As of Linux 2.6.22, the KVM ABI has been stabilized: no backward78As of Linux 2.6.22, the KVM ABI has been stabilized: no backward
76incompatible change are allowed. However, there is an extension79incompatible change are allowed. However, there is an extension
@@ -84,13 +87,14 @@ set of ioctls is available for application use. · 7 unmodified lines
84 87
85 88
864. API description894. API description
87------------------90==================
88 91
89This section describes ioctls that can be used to control kvm guests.92This section describes ioctls that can be used to control kvm guests.
90For each ioctl, the following information is provided along with a93For each ioctl, the following information is provided along with a
91description:94description:
92 95
93 Capability: which KVM extension provides this ioctl. Can be 'basic',96 Capability:
97 which KVM extension provides this ioctl. Can be 'basic',
94 which means that is will be provided by any kernel that supports98 which means that is will be provided by any kernel that supports
95 API version 12 (see section 4.1), a KVM_CAP_xyz constant, which99 API version 12 (see section 4.1), a KVM_CAP_xyz constant, which
96 means availability needs to be checked with KVM_CHECK_EXTENSION100 means availability needs to be checked with KVM_CHECK_EXTENSION
@@ -99,24 +103,29 @@ description: · 2 unmodified lines
99 availability: for kernels that don't support the ioctl,103 availability: for kernels that don't support the ioctl,
100 the ioctl returns -ENOTTY.104 the ioctl returns -ENOTTY.
101 105
102 Architectures: which instruction set architectures provide this ioctl.106 Architectures:
107 which instruction set architectures provide this ioctl.
103 x86 includes both i386 and x86_64.108 x86 includes both i386 and x86_64.
104 109
105 Type: system, vm, or vcpu.110 Type:
111 system, vm, or vcpu.
106 112
107 Parameters: what parameters are accepted by the ioctl.113 Parameters:
114 what parameters are accepted by the ioctl.
108 115
109 Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL)116 Returns:
117 the return value. General error numbers (EBADF, ENOMEM, EINVAL)
110 are not detailed, but errors with specific meanings are.118 are not detailed, but errors with specific meanings are.
111 119
112 120
1134.1 KVM_GET_API_VERSION1214.1 KVM_GET_API_VERSION
122-----------------------
114 123
115Capability: basic124:Capability: basic
116Architectures: all125:Architectures: all
117Type: system ioctl126:Type: system ioctl
118Parameters: none127:Parameters: none
119Returns: the constant KVM_API_VERSION (=12)128:Returns: the constant KVM_API_VERSION (=12)
120 129
121This identifies the API version as the stable kvm API. It is not130This identifies the API version as the stable kvm API. It is not
122expected that this number will change. However, Linux 2.6.20 and131expected that this number will change. However, Linux 2.6.20 and
@@ -127,12 +136,13 @@ described as 'basic' will be available. · 4 unmodified lines
127 136
128 137
1294.2 KVM_CREATE_VM1384.2 KVM_CREATE_VM
139-----------------
130 140
131Capability: basic141:Capability: basic
132Architectures: all142:Architectures: all
133Type: system ioctl143:Type: system ioctl
134Parameters: machine type identifier (KVM_VM_*)144:Parameters: machine type identifier (KVM_VM_*)
135Returns: a VM fd that can be used to control the new virtual machine.145:Returns: a VM fd that can be used to control the new virtual machine.
136 146
137The new VM has no virtual cpus and no memory.147The new VM has no virtual cpus and no memory.
138You probably want to use 0 as machine type.148You 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
155address used by the VM. The IPA_Bits is encoded in bits[7-0] of the165address used by the VM. The IPA_Bits is encoded in bits[7-0] of the
156machine type identifier.166machine type identifier.
157 167
158e.g, to configure a guest to use 48bit physical address size :168e.g, to configure a guest to use 48bit physical address size::
159 169
160 vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48));170 vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48));
161 171
162The requested size (IPA_Bits) must be :172The requested size (IPA_Bits) must be:
163 0 - Implies default size, 40bits (for backward compatibility)
164 173
165 or174 == =========================================================
166 175 0 Implies default size, 40bits (for backward compatibility)
167 N - Implies N bits, where N is a positive integer such that,176 N Implies N bits, where N is a positive integer such that,
168 32 <= N <= Host_IPA_Limit177 32 <= N <= Host_IPA_Limit
178 == =========================================================
169 179
170Host_IPA_Limit is the maximum possible value for IPA_Bits on the host and180Host_IPA_Limit is the maximum possible value for IPA_Bits on the host and
171is dependent on the CPU capability and the kernel configuration. The limit can181is dependent on the CPU capability and the kernel configuration. The limit can
@@ -179,21 +189,28 @@ host physical address translations). · 7 unmodified lines
179 189
180 190
1814.3 KVM_GET_MSR_INDEX_LIST, KVM_GET_MSR_FEATURE_INDEX_LIST1914.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
182 199
183Capability: basic, KVM_CAP_GET_MSR_FEATURES for KVM_GET_MSR_FEATURE_INDEX_LIST
184Architectures: x86
185Type: system ioctl
186Parameters: struct kvm_msr_list (in/out)
187Returns: 0 on success; -1 on error
188Errors:200Errors:
189 EFAULT: the msr index list cannot be read from or written to201
190 E2BIG: the msr index list is to be to fit in the array specified by202 ====== ============================================================
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
191 the user.205 the user.
206 ====== ============================================================
192 207
193struct kvm_msr_list {208::
209
210 struct kvm_msr_list {
194 __u32 nmsrs; /* number of msrs in entries */211 __u32 nmsrs; /* number of msrs in entries */
195 __u32 indices[0];212 __u32 indices[0];
196};213 };
197 214
198The user fills in the size of the indices array in nmsrs, and in return215The user fills in the size of the indices array in nmsrs, and in return
199kvm adjusts nmsrs to reflect the actual number of msrs and fills in the216kvm adjusts nmsrs to reflect the actual number of msrs and fills in the
@@ -214,12 +231,13 @@ otherwise. · 14 unmodified lines
214 231
215 232
2164.4 KVM_CHECK_EXTENSION2334.4 KVM_CHECK_EXTENSION
234-----------------------
217 235
218Capability: basic, KVM_CAP_CHECK_EXTENSION_VM for vm ioctl236:Capability: basic, KVM_CAP_CHECK_EXTENSION_VM for vm ioctl
219Architectures: all237:Architectures: all
220Type: system ioctl, vm ioctl238:Type: system ioctl, vm ioctl
221Parameters: extension identifier (KVM_CAP_*)239:Parameters: extension identifier (KVM_CAP_*)
222Returns: 0 if unsupported; 1 (or some other positive integer) if supported240:Returns: 0 if unsupported; 1 (or some other positive integer) if supported
223 241
224The API allows the application to query about extensions to the core242The API allows the application to query about extensions to the core
225kvm API. Userspace passes an extension identifier (an integer) and243kvm 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
232with KVM_CAP_CHECK_EXTENSION_VM on the vm fd)250with KVM_CAP_CHECK_EXTENSION_VM on the vm fd)
233 251
2344.5 KVM_GET_VCPU_MMAP_SIZE2524.5 KVM_GET_VCPU_MMAP_SIZE
253--------------------------
235 254
236Capability: basic255:Capability: basic
237Architectures: all256:Architectures: all
238Type: system ioctl257:Type: system ioctl
239Parameters: none258:Parameters: none
240Returns: size of vcpu mmap area, in bytes259:Returns: size of vcpu mmap area, in bytes
241 260
242The KVM_RUN ioctl (cf.) communicates with userspace via a shared261The KVM_RUN ioctl (cf.) communicates with userspace via a shared
243memory region. This ioctl returns the size of that region. See the262memory region. This ioctl returns the size of that region. See the
@@ -245,23 +264,25 @@ KVM_RUN documentation for details. · 1 unmodified line
245 264
246 265
2474.6 KVM_SET_MEMORY_REGION2664.6 KVM_SET_MEMORY_REGION
267-------------------------
248 268
249Capability: basic269:Capability: basic
250Architectures: all270:Architectures: all
251Type: vm ioctl271:Type: vm ioctl
252Parameters: struct kvm_memory_region (in)272:Parameters: struct kvm_memory_region (in)
253Returns: 0 on success, -1 on error273:Returns: 0 on success, -1 on error
254 274
255This ioctl is obsolete and has been removed.275This ioctl is obsolete and has been removed.
256 276
257 277
2584.7 KVM_CREATE_VCPU2784.7 KVM_CREATE_VCPU
279-------------------
259 280
260Capability: basic281:Capability: basic
261Architectures: all282:Architectures: all
262Type: vm ioctl283:Type: vm ioctl
263Parameters: vcpu id (apic id on x86)284:Parameters: vcpu id (apic id on x86)
264Returns: vcpu fd on success, -1 on error285:Returns: vcpu fd on success, -1 on error
265 286
266This API adds a vcpu to a virtual machine. No more than max_vcpus may be added.287This API adds a vcpu to a virtual machine. No more than max_vcpus may be added.
267The vcpu id is an integer in the range [0, max_vcpu_id).288The vcpu id is an integer in the range [0, max_vcpu_id).
@@ -302,22 +323,25 @@ cpu's hardware control block. · 34 unmodified lines
302 323
303 324
3044.8 KVM_GET_DIRTY_LOG (vm ioctl)3254.8 KVM_GET_DIRTY_LOG (vm ioctl)
326--------------------------------
305 327
306Capability: basic328:Capability: basic
307Architectures: all329:Architectures: all
308Type: vm ioctl330:Type: vm ioctl
309Parameters: struct kvm_dirty_log (in/out)331:Parameters: struct kvm_dirty_log (in/out)
310Returns: 0 on success, -1 on error332:Returns: 0 on success, -1 on error
311 333
312/* for KVM_GET_DIRTY_LOG */334::
313struct kvm_dirty_log {335
336 /* for KVM_GET_DIRTY_LOG */
337 struct kvm_dirty_log {
314 __u32 slot;338 __u32 slot;
315 __u32 padding;339 __u32 padding;
316 union {340 union {
317 void __user *dirty_bitmap; /* one bit per page */341 void __user *dirty_bitmap; /* one bit per page */
318 __u64 padding;342 __u64 padding;
319 };343 };
320};344 };
321 345
322Given a memory slot, return a bitmap containing any pages dirtied346Given a memory slot, return a bitmap containing any pages dirtied
323since the last call to this ioctl. Bit 0 is the first page in the347since 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
334see the description of the capability.358see the description of the capability.
335 359
3364.9 KVM_SET_MEMORY_ALIAS3604.9 KVM_SET_MEMORY_ALIAS
361------------------------
337 362
338Capability: basic363:Capability: basic
339Architectures: x86364:Architectures: x86
340Type: vm ioctl365:Type: vm ioctl
341Parameters: struct kvm_memory_alias (in)366:Parameters: struct kvm_memory_alias (in)
342Returns: 0 (success), -1 (error)367:Returns: 0 (success), -1 (error)
343 368
344This ioctl is obsolete and has been removed.369This ioctl is obsolete and has been removed.
345 370
346 371
3474.10 KVM_RUN3724.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
348 380
349Capability: basic
350Architectures: all
351Type: vcpu ioctl
352Parameters: none
353Returns: 0 on success, -1 on error
354Errors:381Errors:
355 EINTR: an unmasked signal is pending382
383 ===== =============================
384 EINTR an unmasked signal is pending
385 ===== =============================
356 386
357This ioctl is used to run a guest virtual cpu. While there are no387This ioctl is used to run a guest virtual cpu. While there are no
358explicit parameters, there is an implicit parameter block that can be388explicit parameters, there is an implicit parameter block that can be
@@ -362,42 +392,46 @@ kvm_run' (see below). · 3 unmodified lines
362 392
363 393
3644.11 KVM_GET_REGS3944.11 KVM_GET_REGS
395-----------------
365 396
366Capability: basic397:Capability: basic
367Architectures: all except ARM, arm64398:Architectures: all except ARM, arm64
368Type: vcpu ioctl399:Type: vcpu ioctl
369Parameters: struct kvm_regs (out)400:Parameters: struct kvm_regs (out)
370Returns: 0 on success, -1 on error401:Returns: 0 on success, -1 on error
371 402
372Reads the general purpose registers from the vcpu.403Reads the general purpose registers from the vcpu.
373 404
374/* x86 */405::
375struct kvm_regs {406
407 /* x86 */
408 struct kvm_regs {
376 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */409 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
377 __u64 rax, rbx, rcx, rdx;410 __u64 rax, rbx, rcx, rdx;
378 __u64 rsi, rdi, rsp, rbp;411 __u64 rsi, rdi, rsp, rbp;
379 __u64 r8, r9, r10, r11;412 __u64 r8, r9, r10, r11;
380 __u64 r12, r13, r14, r15;413 __u64 r12, r13, r14, r15;
381 __u64 rip, rflags;414 __u64 rip, rflags;
382};415 };
383 416
384/* mips */417 /* mips */
385struct kvm_regs {418 struct kvm_regs {
386 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */419 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
387 __u64 gpr[32];420 __u64 gpr[32];
388 __u64 hi;421 __u64 hi;
389 __u64 lo;422 __u64 lo;
390 __u64 pc;423 __u64 pc;
391};424 };
392 425
393 426
3944.12 KVM_SET_REGS4274.12 KVM_SET_REGS
428-----------------
395 429
396Capability: basic430:Capability: basic
397Architectures: all except ARM, arm64431:Architectures: all except ARM, arm64
398Type: vcpu ioctl432:Type: vcpu ioctl
399Parameters: struct kvm_regs (in)433:Parameters: struct kvm_regs (in)
400Returns: 0 on success, -1 on error434:Returns: 0 on success, -1 on error
401 435
402Writes the general purpose registers into the vcpu.436Writes the general purpose registers into the vcpu.
403 437
@@ -405,17 +439,20 @@ See KVM_GET_REGS for the data structure. · 1 unmodified line
405 439
406 440
4074.13 KVM_GET_SREGS4414.13 KVM_GET_SREGS
442------------------
408 443
409Capability: basic444:Capability: basic
410Architectures: x86, ppc445:Architectures: x86, ppc
411Type: vcpu ioctl446:Type: vcpu ioctl
412Parameters: struct kvm_sregs (out)447:Parameters: struct kvm_sregs (out)
413Returns: 0 on success, -1 on error448:Returns: 0 on success, -1 on error
414 449
415Reads special registers from the vcpu.450Reads special registers from the vcpu.
416 451
417/* x86 */452::
418struct kvm_sregs {453
454 /* x86 */
455 struct kvm_sregs {
419 struct kvm_segment cs, ds, es, fs, gs, ss;456 struct kvm_segment cs, ds, es, fs, gs, ss;
420 struct kvm_segment tr, ldt;457 struct kvm_segment tr, ldt;
421 struct kvm_dtable gdt, idt;458 struct kvm_dtable gdt, idt;
@@ -423,9 +460,9 @@ struct kvm_sregs { · 1 unmodified line
423 __u64 efer;460 __u64 efer;
424 __u64 apic_base;461 __u64 apic_base;
425 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];462 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
426};463 };
427 464
428/* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */465 /* ppc -- see arch/powerpc/include/uapi/asm/kvm.h */
429 466
430interrupt_bitmap is a bitmap of pending external interrupts. At most467interrupt_bitmap is a bitmap of pending external interrupts. At most
431one bit may be set. This interrupt has been acknowledged by the APIC468one 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
433 470
434 471
4354.14 KVM_SET_SREGS4724.14 KVM_SET_SREGS
473------------------
436 474
437Capability: basic475:Capability: basic
438Architectures: x86, ppc476:Architectures: x86, ppc
439Type: vcpu ioctl477:Type: vcpu ioctl
440Parameters: struct kvm_sregs (in)478:Parameters: struct kvm_sregs (in)
441Returns: 0 on success, -1 on error479:Returns: 0 on success, -1 on error
442 480
443Writes special registers into the vcpu. See KVM_GET_SREGS for the481Writes special registers into the vcpu. See KVM_GET_SREGS for the
444data structures.482data structures.
445 483
446 484
4474.15 KVM_TRANSLATE4854.15 KVM_TRANSLATE
486------------------
448 487
449Capability: basic488:Capability: basic
450Architectures: x86489:Architectures: x86
451Type: vcpu ioctl490:Type: vcpu ioctl
452Parameters: struct kvm_translation (in/out)491:Parameters: struct kvm_translation (in/out)
453Returns: 0 on success, -1 on error492:Returns: 0 on success, -1 on error
454 493
455Translates a virtual address according to the vcpu's current address494Translates a virtual address according to the vcpu's current address
456translation mode.495translation mode.
457 496
458struct kvm_translation {497::
498
499 struct kvm_translation {
459 /* in */500 /* in */
460 __u64 linear_address;501 __u64 linear_address;
461 502
@@ -465,59 +506,68 @@ struct kvm_translation { · 3 unmodified lines
465 __u8 writeable;506 __u8 writeable;
466 __u8 usermode;507 __u8 usermode;
467 __u8 pad[5];508 __u8 pad[5];
468};509 };
469 510
470 511
4714.16 KVM_INTERRUPT5124.16 KVM_INTERRUPT
513------------------
472 514
473Capability: basic515:Capability: basic
474Architectures: x86, ppc, mips516:Architectures: x86, ppc, mips
475Type: vcpu ioctl517:Type: vcpu ioctl
476Parameters: struct kvm_interrupt (in)518:Parameters: struct kvm_interrupt (in)
477Returns: 0 on success, negative on failure.519:Returns: 0 on success, negative on failure.
478 520
479Queues a hardware interrupt vector to be injected.521Queues a hardware interrupt vector to be injected.
480 522
481/* for KVM_INTERRUPT */523::
482struct kvm_interrupt {524
525 /* for KVM_INTERRUPT */
526 struct kvm_interrupt {
483 /* in */527 /* in */
484 __u32 irq;528 __u32 irq;
485};529 };
486 530
487X86:531X86:
532^^^^
533
534:Returns:
488 535
489Returns: 0 on success,536 ========= ===================================
490 -EEXIST if an interrupt is already enqueued537 0 on success,
491 -EINVAL the the irq number is invalid538 -EEXIST if an interrupt is already enqueued
492 -ENXIO if the PIC is in the kernel539 -EINVAL the the irq number is invalid
493 -EFAULT if the pointer is invalid540 -ENXIO if the PIC is in the kernel
541 -EFAULT if the pointer is invalid
542 ========= ===================================
494 543
495Note 'irq' is an interrupt vector, not an interrupt pin or line. This544Note 'irq' is an interrupt vector, not an interrupt pin or line. This
496ioctl is useful if the in-kernel PIC is not used.545ioctl is useful if the in-kernel PIC is not used.
497 546
498PPC:547PPC:
548^^^^
499 549
500Queues an external interrupt to be injected. This ioctl is overleaded550Queues an external interrupt to be injected. This ioctl is overleaded
501with 3 different irq values:551with 3 different irq values:
502 552
503a) KVM_INTERRUPT_SET553a) KVM_INTERRUPT_SET
504 554
505 This injects an edge type external interrupt into the guest once it's ready555 This injects an edge type external interrupt into the guest once it's ready
506 to receive interrupts. When injected, the interrupt is done.556 to receive interrupts. When injected, the interrupt is done.
507 557
508b) KVM_INTERRUPT_UNSET558b) KVM_INTERRUPT_UNSET
509 559
510 This unsets any pending interrupt.560 This unsets any pending interrupt.
511 561
512 Only available with KVM_CAP_PPC_UNSET_IRQ.562 Only available with KVM_CAP_PPC_UNSET_IRQ.
513 563
514c) KVM_INTERRUPT_SET_LEVEL564c) KVM_INTERRUPT_SET_LEVEL
515 565
516 This injects a level type external interrupt into the guest context. The566 This injects a level type external interrupt into the guest context. The
517 interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET567 interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET
518 is triggered.568 is triggered.
519 569
520 Only available with KVM_CAP_PPC_IRQ_LEVEL.570 Only available with KVM_CAP_PPC_IRQ_LEVEL.
521 571
522Note that any value for 'irq' other than the ones stated above is invalid572Note that any value for 'irq' other than the ones stated above is invalid
523and incurs unexpected behavior.573and incurs unexpected behavior.
@@ -525,6 +575,7 @@ and incurs unexpected behavior. · 1 unmodified line
525This is an asynchronous vcpu ioctl and can be invoked from any thread.575This is an asynchronous vcpu ioctl and can be invoked from any thread.
526 576
527MIPS:577MIPS:
578^^^^^
528 579
529Queues an external interrupt to be injected into the virtual CPU. A negative580Queues an external interrupt to be injected into the virtual CPU. A negative
530interrupt number dequeues the interrupt.581interrupt number dequeues the interrupt.
@@ -533,24 +584,26 @@ This is an asynchronous vcpu ioctl and can be invoked from any thread. · 2 unmodified lines
533 584
534 585
5354.17 KVM_DEBUG_GUEST5864.17 KVM_DEBUG_GUEST
587--------------------
536 588
537Capability: basic589:Capability: basic
538Architectures: none590:Architectures: none
539Type: vcpu ioctl591:Type: vcpu ioctl
540Parameters: none)592:Parameters: none)
541Returns: -1 on error593:Returns: -1 on error
542 594
543Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead.595Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead.
544 596
545 597
5464.18 KVM_GET_MSRS5984.18 KVM_GET_MSRS
599-----------------
547 600
548Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system)601:Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system)
549Architectures: x86602:Architectures: x86
550Type: system ioctl, vcpu ioctl603:Type: system ioctl, vcpu ioctl
551Parameters: struct kvm_msrs (in/out)604:Parameters: struct kvm_msrs (in/out)
552Returns: number of msrs successfully returned;605:Returns: number of msrs successfully returned;
553 -1 on error606 -1 on error
554 607
555When used as a system ioctl:608When used as a system ioctl:
556Reads the values of MSR-based features that are available for the VM. This609Reads 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
562Reads model-specific registers from the vcpu. Supported msr indices can615Reads model-specific registers from the vcpu. Supported msr indices can
563be obtained using KVM_GET_MSR_INDEX_LIST in a system ioctl.616be obtained using KVM_GET_MSR_INDEX_LIST in a system ioctl.
564 617
565struct kvm_msrs {618::
619
620 struct kvm_msrs {
566 __u32 nmsrs; /* number of msrs in entries */621 __u32 nmsrs; /* number of msrs in entries */
567 __u32 pad;622 __u32 pad;
568 623
569 struct kvm_msr_entry entries[0];624 struct kvm_msr_entry entries[0];
570};625 };
571 626
572struct kvm_msr_entry {627 struct kvm_msr_entry {
573 __u32 index;628 __u32 index;
574 __u32 reserved;629 __u32 reserved;
575 __u64 data;630 __u64 data;
576};631 };
577 632
578Application code should set the 'nmsrs' member (which indicates the633Application code should set the 'nmsrs' member (which indicates the
579size of the entries array) and the 'index' member of each array entry.634size 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
581 636
582 637
5834.19 KVM_SET_MSRS6384.19 KVM_SET_MSRS
639-----------------
584 640
585Capability: basic641:Capability: basic
586Architectures: x86642:Architectures: x86
587Type: vcpu ioctl643:Type: vcpu ioctl
588Parameters: struct kvm_msrs (in)644:Parameters: struct kvm_msrs (in)
589Returns: number of msrs successfully set (see below), -1 on error645:Returns: number of msrs successfully set (see below), -1 on error
590 646
591Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the647Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the
592data structures.648data structures.
@@ -602,41 +658,44 @@ MSRs that have been set successfully. · 9 unmodified lines
602 658
603 659
6044.20 KVM_SET_CPUID6604.20 KVM_SET_CPUID
661------------------
605 662
606Capability: basic663:Capability: basic
607Architectures: x86664:Architectures: x86
608Type: vcpu ioctl665:Type: vcpu ioctl
609Parameters: struct kvm_cpuid (in)666:Parameters: struct kvm_cpuid (in)
610Returns: 0 on success, -1 on error667:Returns: 0 on success, -1 on error
611 668
612Defines the vcpu responses to the cpuid instruction. Applications669Defines the vcpu responses to the cpuid instruction. Applications
613should use the KVM_SET_CPUID2 ioctl if available.670should use the KVM_SET_CPUID2 ioctl if available.
614 671
672::
615 673
616struct kvm_cpuid_entry {674 struct kvm_cpuid_entry {
617 __u32 function;675 __u32 function;
618 __u32 eax;676 __u32 eax;
619 __u32 ebx;677 __u32 ebx;
620 __u32 ecx;678 __u32 ecx;
621 __u32 edx;679 __u32 edx;
622 __u32 padding;680 __u32 padding;
623};681 };
624 682
625/* for KVM_SET_CPUID */683 /* for KVM_SET_CPUID */
626struct kvm_cpuid {684 struct kvm_cpuid {
627 __u32 nent;685 __u32 nent;
628 __u32 padding;686 __u32 padding;
629 struct kvm_cpuid_entry entries[0];687 struct kvm_cpuid_entry entries[0];
630};688 };
631 689
632 690
6334.21 KVM_SET_SIGNAL_MASK6914.21 KVM_SET_SIGNAL_MASK
692------------------------
634 693
635Capability: basic694:Capability: basic
636Architectures: all695:Architectures: all
637Type: vcpu ioctl696:Type: vcpu ioctl
638Parameters: struct kvm_signal_mask (in)697:Parameters: struct kvm_signal_mask (in)
639Returns: 0 on success, -1 on error698:Returns: 0 on success, -1 on error
640 699
641Defines which signals are blocked during execution of KVM_RUN. This700Defines which signals are blocked during execution of KVM_RUN. This
642signal mask temporarily overrides the threads signal mask. Any701signal 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
646Note the signal will only be delivered if not blocked by the original705Note the signal will only be delivered if not blocked by the original
647signal mask.706signal mask.
648 707
649/* for KVM_SET_SIGNAL_MASK */708::
650struct kvm_signal_mask {709
710 /* for KVM_SET_SIGNAL_MASK */
711 struct kvm_signal_mask {
651 __u32 len;712 __u32 len;
652 __u8 sigset[0];713 __u8 sigset[0];
653};714 };
654 715
655 716
6564.22 KVM_GET_FPU7174.22 KVM_GET_FPU
718----------------
657 719
658Capability: basic720:Capability: basic
659Architectures: x86721:Architectures: x86
660Type: vcpu ioctl722:Type: vcpu ioctl
661Parameters: struct kvm_fpu (out)723:Parameters: struct kvm_fpu (out)
662Returns: 0 on success, -1 on error724:Returns: 0 on success, -1 on error
663 725
664Reads the floating point state from the vcpu.726Reads the floating point state from the vcpu.
665 727
666/* for KVM_GET_FPU and KVM_SET_FPU */728::
667struct kvm_fpu {729
730 /* for KVM_GET_FPU and KVM_SET_FPU */
731 struct kvm_fpu {
668 __u8 fpr[8][16];732 __u8 fpr[8][16];
669 __u16 fcw;733 __u16 fcw;
670 __u16 fsw;734 __u16 fsw;
@@ -676,21 +740,24 @@ struct kvm_fpu { · 5 unmodified lines
676 __u8 xmm[16][16];740 __u8 xmm[16][16];
677 __u32 mxcsr;741 __u32 mxcsr;
678 __u32 pad2;742 __u32 pad2;
679};743 };
680 744
681 745
6824.23 KVM_SET_FPU7464.23 KVM_SET_FPU
747----------------
683 748
684Capability: basic749:Capability: basic
685Architectures: x86750:Architectures: x86
686Type: vcpu ioctl751:Type: vcpu ioctl
687Parameters: struct kvm_fpu (in)752:Parameters: struct kvm_fpu (in)
688Returns: 0 on success, -1 on error753:Returns: 0 on success, -1 on error
689 754
690Writes the floating point state to the vcpu.755Writes the floating point state to the vcpu.
691 756
692/* for KVM_GET_FPU and KVM_SET_FPU */757::
693struct kvm_fpu {758
759 /* for KVM_GET_FPU and KVM_SET_FPU */
760 struct kvm_fpu {
694 __u8 fpr[8][16];761 __u8 fpr[8][16];
695 __u16 fcw;762 __u16 fcw;
696 __u16 fsw;763 __u16 fsw;
@@ -702,16 +769,17 @@ struct kvm_fpu { · 5 unmodified lines
702 __u8 xmm[16][16];769 __u8 xmm[16][16];
703 __u32 mxcsr;770 __u32 mxcsr;
704 __u32 pad2;771 __u32 pad2;
705};772 };
706 773
707 774
7084.24 KVM_CREATE_IRQCHIP7754.24 KVM_CREATE_IRQCHIP
776-----------------------
709 777
710Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390)778:Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390)
711Architectures: x86, ARM, arm64, s390779:Architectures: x86, ARM, arm64, s390
712Type: vm ioctl780:Type: vm ioctl
713Parameters: none781:Parameters: none
714Returns: 0 on success, -1 on error782:Returns: 0 on success, -1 on error
715 783
716Creates an interrupt controller model in the kernel.784Creates an interrupt controller model in the kernel.
717On x86, creates a virtual ioapic, a virtual PIC (two PICs, nested), and sets up785On 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
727 795
728 796
7294.25 KVM_IRQ_LINE7974.25 KVM_IRQ_LINE
798-----------------
730 799
731Capability: KVM_CAP_IRQCHIP800:Capability: KVM_CAP_IRQCHIP
732Architectures: x86, arm, arm64801:Architectures: x86, arm, arm64
733Type: vm ioctl802:Type: vm ioctl
734Parameters: struct kvm_irq_level803:Parameters: struct kvm_irq_level
735Returns: 0 on success, -1 on error804:Returns: 0 on success, -1 on error
736 805
737Sets the level of a GSI input to the interrupt controller model in the kernel.806Sets the level of a GSI input to the interrupt controller model in the kernel.
738On some architectures it is required that an interrupt controller model has807On some architectures it is required that an interrupt controller model has
@@ -756,16 +825,20 @@ of course). · 17 unmodified lines
756ARM/arm64 can signal an interrupt either at the CPU level, or at the825ARM/arm64 can signal an interrupt either at the CPU level, or at the
757in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to826in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to
758use PPIs designated for specific cpus. The irq field is interpreted827use PPIs designated for specific cpus. The irq field is interpreted
759like this:828like this::
760 829
761  bits: | 31 ... 28 | 27 ... 24 | 23 ... 16 | 15 ... 0 |830  bits: | 31 ... 28 | 27 ... 24 | 23 ... 16 | 15 ... 0 |
762 field: | vcpu2_index | irq_type | vcpu_index | irq_id |831 field: | vcpu2_index | irq_type | vcpu_index | irq_id |
763 832
764The irq_type field has the following values:833The irq_type field has the following values:
765- irq_type[0]: out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ834
766- irq_type[1]: in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.)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.)
767 (the vcpu_index field is ignored)839 (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.)
769 842
770(The irq_id field thus corresponds nicely to the IRQ ID in the ARM GIC specs)843(The irq_id field thus corresponds nicely to the IRQ ID in the ARM GIC specs)
771 844
@@ -779,27 +852,32 @@ Note that on arm/arm64, the KVM_CAP_IRQCHIP capability only conditions · 7 unmodified lines
779injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always852injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always
780be used for a userspace interrupt controller.853be used for a userspace interrupt controller.
781 854
782struct kvm_irq_level {855::
856
857 struct kvm_irq_level {
783 union {858 union {
784 __u32 irq; /* GSI */859 __u32 irq; /* GSI */
785 __s32 status; /* not used for KVM_IRQ_LEVEL */860 __s32 status; /* not used for KVM_IRQ_LEVEL */
786 };861 };
787 __u32 level; /* 0 or 1 */862 __u32 level; /* 0 or 1 */
788};863 };
789 864
790 865
7914.26 KVM_GET_IRQCHIP8664.26 KVM_GET_IRQCHIP
867--------------------
792 868
793Capability: KVM_CAP_IRQCHIP869:Capability: KVM_CAP_IRQCHIP
794Architectures: x86870:Architectures: x86
795Type: vm ioctl871:Type: vm ioctl
796Parameters: struct kvm_irqchip (in/out)872:Parameters: struct kvm_irqchip (in/out)
797Returns: 0 on success, -1 on error873:Returns: 0 on success, -1 on error
798 874
799Reads the state of a kernel interrupt controller created with875Reads the state of a kernel interrupt controller created with
800KVM_CREATE_IRQCHIP into a buffer provided by the caller.876KVM_CREATE_IRQCHIP into a buffer provided by the caller.
801 877
802struct kvm_irqchip {878::
879
880 struct kvm_irqchip {
803 __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */881 __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */
804 __u32 pad;882 __u32 pad;
805 union {883 union {
@@ -807,21 +885,24 @@ struct kvm_irqchip { · 1 unmodified line
807 struct kvm_pic_state pic;885 struct kvm_pic_state pic;
808 struct kvm_ioapic_state ioapic;886 struct kvm_ioapic_state ioapic;
809 } chip;887 } chip;
810};888 };
811 889
812 890
8134.27 KVM_SET_IRQCHIP8914.27 KVM_SET_IRQCHIP
892--------------------
814 893
815Capability: KVM_CAP_IRQCHIP894:Capability: KVM_CAP_IRQCHIP
816Architectures: x86895:Architectures: x86
817Type: vm ioctl896:Type: vm ioctl
818Parameters: struct kvm_irqchip (in)897:Parameters: struct kvm_irqchip (in)
819Returns: 0 on success, -1 on error898:Returns: 0 on success, -1 on error
820 899
821Sets the state of a kernel interrupt controller created with900Sets the state of a kernel interrupt controller created with
822KVM_CREATE_IRQCHIP from a buffer provided by the caller.901KVM_CREATE_IRQCHIP from a buffer provided by the caller.
823 902
824struct kvm_irqchip {903::
904
905 struct kvm_irqchip {
825 __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */906 __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */
826 __u32 pad;907 __u32 pad;
827 union {908 union {
@@ -829,16 +910,17 @@ struct kvm_irqchip { · 1 unmodified line
829 struct kvm_pic_state pic;910 struct kvm_pic_state pic;
830 struct kvm_ioapic_state ioapic;911 struct kvm_ioapic_state ioapic;
831 } chip;912 } chip;
832};913 };
833 914
834 915
8354.28 KVM_XEN_HVM_CONFIG9164.28 KVM_XEN_HVM_CONFIG
917-----------------------
836 918
837Capability: KVM_CAP_XEN_HVM919:Capability: KVM_CAP_XEN_HVM
838Architectures: x86920:Architectures: x86
839Type: vm ioctl921:Type: vm ioctl
840Parameters: struct kvm_xen_hvm_config (in)922:Parameters: struct kvm_xen_hvm_config (in)
841Returns: 0 on success, -1 on error923:Returns: 0 on success, -1 on error
842 924
843Sets the MSR that the Xen HVM guest uses to initialize its hypercall925Sets the MSR that the Xen HVM guest uses to initialize its hypercall
844page, and provides the starting address and size of the hypercall926page, 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
846page of a blob (32- or 64-bit, depending on the vcpu mode) to guest928page of a blob (32- or 64-bit, depending on the vcpu mode) to guest
847memory.929memory.
848 930
849struct kvm_xen_hvm_config {931::
932
933 struct kvm_xen_hvm_config {
850 __u32 flags;934 __u32 flags;
851 __u32 msr;935 __u32 msr;
852 __u64 blob_addr_32;936 __u64 blob_addr_32;
@@ -854,16 +938,17 @@ struct kvm_xen_hvm_config { · 1 unmodified line
854 __u8 blob_size_32;938 __u8 blob_size_32;
855 __u8 blob_size_64;939 __u8 blob_size_64;
856 __u8 pad2[30];940 __u8 pad2[30];
857};941 };
858 942
859 943
8604.29 KVM_GET_CLOCK9444.29 KVM_GET_CLOCK
945------------------
861 946
862Capability: KVM_CAP_ADJUST_CLOCK947:Capability: KVM_CAP_ADJUST_CLOCK
863Architectures: x86948:Architectures: x86
864Type: vm ioctl949:Type: vm ioctl
865Parameters: struct kvm_clock_data (out)950:Parameters: struct kvm_clock_data (out)
866Returns: 0 on success, -1 on error951:Returns: 0 on success, -1 on error
867 952
868Gets the current timestamp of kvmclock as seen by the current guest. In953Gets the current timestamp of kvmclock as seen by the current guest. In
869conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios954conjunction 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
880but the exact value read by each VCPU could differ, because the host965but the exact value read by each VCPU could differ, because the host
881TSC is not stable.966TSC is not stable.
882 967
883struct kvm_clock_data {968::
969
970 struct kvm_clock_data {
884 __u64 clock; /* kvmclock current value */971 __u64 clock; /* kvmclock current value */
885 __u32 flags;972 __u32 flags;
886 __u32 pad[9];973 __u32 pad[9];
887};974 };
888 975
889 976
8904.30 KVM_SET_CLOCK9774.30 KVM_SET_CLOCK
978------------------
891 979
892Capability: KVM_CAP_ADJUST_CLOCK980:Capability: KVM_CAP_ADJUST_CLOCK
893Architectures: x86981:Architectures: x86
894Type: vm ioctl982:Type: vm ioctl
895Parameters: struct kvm_clock_data (in)983:Parameters: struct kvm_clock_data (in)
896Returns: 0 on success, -1 on error984:Returns: 0 on success, -1 on error
897 985
898Sets the current timestamp of kvmclock to the value specified in its parameter.986Sets the current timestamp of kvmclock to the value specified in its parameter.
899In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios987In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios
900such as migration.988such as migration.
901 989
902struct kvm_clock_data {990::
991
992 struct kvm_clock_data {
903 __u64 clock; /* kvmclock current value */993 __u64 clock; /* kvmclock current value */
904 __u32 flags;994 __u32 flags;
905 __u32 pad[9];995 __u32 pad[9];
906};996 };
907 997
908 998
9094.31 KVM_GET_VCPU_EVENTS9994.31 KVM_GET_VCPU_EVENTS
1000------------------------
910 1001
911Capability: KVM_CAP_VCPU_EVENTS1002:Capability: KVM_CAP_VCPU_EVENTS
912Extended by: KVM_CAP_INTR_SHADOW1003:Extended by: KVM_CAP_INTR_SHADOW
913Architectures: x86, arm, arm641004:Architectures: x86, arm, arm64
914Type: vcpu ioctl1005:Type: vcpu ioctl
915Parameters: struct kvm_vcpu_event (out)1006:Parameters: struct kvm_vcpu_event (out)
916Returns: 0 on success, -1 on error1007:Returns: 0 on success, -1 on error
917 1008
918X86:1009X86:
1010^^^^
919 1011
920Gets currently pending exceptions, interrupts, and NMIs as well as related1012Gets currently pending exceptions, interrupts, and NMIs as well as related
921states of the vcpu.1013states of the vcpu.
922 1014
923struct kvm_vcpu_events {1015::
1016
1017 struct kvm_vcpu_events {
924 struct {1018 struct {
925 __u8 injected;1019 __u8 injected;
926 __u8 nr;1020 __u8 nr;
@@ -951,7 +1045,7 @@ struct kvm_vcpu_events { · 24 unmodified lines
951 __u8 reserved[27];1045 __u8 reserved[27];
952 __u8 exception_has_payload;1046 __u8 exception_has_payload;
953 __u64 exception_payload;1047 __u64 exception_payload;
954};1048 };
955 1049
956The following bits are defined in the flags field:1050The following bits are defined in the flags field:
957 1051
@@ -967,6 +1061,7 @@ The following bits are defined in the flags field: · 9 unmodified lines
967 KVM_CAP_EXCEPTION_PAYLOAD is enabled.1061 KVM_CAP_EXCEPTION_PAYLOAD is enabled.
968 1062
969ARM/ARM64:1063ARM/ARM64:
1064^^^^^^^^^^
970 1065
971If the guest accesses a device that is being emulated by the host kernel in1066If the guest accesses a device that is being emulated by the host kernel in
972such a way that a real device would generate a physical SError, KVM may make1067such 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
1006KVM_SET_VCPU_EVENTS or otherwise) because such an exception is always delivered1101KVM_SET_VCPU_EVENTS or otherwise) because such an exception is always delivered
1007directly to the virtual CPU).1102directly to the virtual CPU).
1008 1103
1104::
1009 1105
1010struct kvm_vcpu_events {1106 struct kvm_vcpu_events {
1011 struct {1107 struct {
1012 __u8 serror_pending;1108 __u8 serror_pending;
1013 __u8 serror_has_esr;1109 __u8 serror_has_esr;
@@ -1017,18 +1113,20 @@ struct kvm_vcpu_events { · 3 unmodified lines
1017 __u64 serror_esr;1113 __u64 serror_esr;
1018 } exception;1114 } exception;
1019 __u32 reserved[12];1115 __u32 reserved[12];
1020};1116 };
1021 1117
10224.32 KVM_SET_VCPU_EVENTS11184.32 KVM_SET_VCPU_EVENTS
1119------------------------
1023 1120
1024Capability: KVM_CAP_VCPU_EVENTS1121:Capability: KVM_CAP_VCPU_EVENTS
1025Extended by: KVM_CAP_INTR_SHADOW1122:Extended by: KVM_CAP_INTR_SHADOW
1026Architectures: x86, arm, arm641123:Architectures: x86, arm, arm64
1027Type: vcpu ioctl1124:Type: vcpu ioctl
1028Parameters: struct kvm_vcpu_event (in)1125:Parameters: struct kvm_vcpu_event (in)
1029Returns: 0 on success, -1 on error1126:Returns: 0 on success, -1 on error
1030 1127
1031X86:1128X86:
1129^^^^
1032 1130
1033Set pending exceptions, interrupts, and NMIs as well as related states of the1131Set pending exceptions, interrupts, and NMIs as well as related states of the
1034vcpu.1132vcpu.
@@ -1040,9 +1138,11 @@ from the update. These fields are nmi.pending, sipi_vector, smi.smm, · 5 unmodified lines
1040smi.pending. Keep the corresponding bits in the flags field cleared to1138smi.pending. Keep the corresponding bits in the flags field cleared to
1041suppress overwriting the current in-kernel state. The bits are:1139suppress overwriting the current in-kernel state. The bits are:
1042 1140
1043KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel1141=============================== ==================================
1044KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector1142KVM_VCPUEVENT_VALID_NMI_PENDING transfer nmi.pending to the kernel
1045KVM_VCPUEVENT_VALID_SMM - transfer the smi sub-struct.1143KVM_VCPUEVENT_VALID_SIPI_VECTOR transfer sipi_vector
1144KVM_VCPUEVENT_VALID_SMM transfer the smi sub-struct.
1145=============================== ==================================
1046 1146
1047If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in1147If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in
1048the flags field to signal that interrupt.shadow contains a valid state and1148the 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
1056contain a valid state and shall be written into the VCPU.1156contain a valid state and shall be written into the VCPU.
1057 1157
1058ARM/ARM64:1158ARM/ARM64:
1159^^^^^^^^^^
1059 1160
1060User space may need to inject several types of events to the guest.1161User space may need to inject several types of events to the guest.
1061 1162
@@ -1078,31 +1179,35 @@ See KVM_GET_VCPU_EVENTS for the data structure. · 16 unmodified lines
1078 1179
1079 1180
10804.33 KVM_GET_DEBUGREGS11814.33 KVM_GET_DEBUGREGS
1182----------------------
1081 1183
1082Capability: KVM_CAP_DEBUGREGS1184:Capability: KVM_CAP_DEBUGREGS
1083Architectures: x861185:Architectures: x86
1084Type: vm ioctl1186:Type: vm ioctl
1085Parameters: struct kvm_debugregs (out)1187:Parameters: struct kvm_debugregs (out)
1086Returns: 0 on success, -1 on error1188:Returns: 0 on success, -1 on error
1087 1189
1088Reads debug registers from the vcpu.1190Reads debug registers from the vcpu.
1089 1191
1090struct kvm_debugregs {1192::
1193
1194 struct kvm_debugregs {
1091 __u64 db[4];1195 __u64 db[4];
1092 __u64 dr6;1196 __u64 dr6;
1093 __u64 dr7;1197 __u64 dr7;
1094 __u64 flags;1198 __u64 flags;
1095 __u64 reserved[9];1199 __u64 reserved[9];
1096};1200 };
1097 1201
1098 1202
10994.34 KVM_SET_DEBUGREGS12034.34 KVM_SET_DEBUGREGS
1204----------------------
1100 1205
1101Capability: KVM_CAP_DEBUGREGS1206:Capability: KVM_CAP_DEBUGREGS
1102Architectures: x861207:Architectures: x86
1103Type: vm ioctl1208:Type: vm ioctl
1104Parameters: struct kvm_debugregs (in)1209:Parameters: struct kvm_debugregs (in)
1105Returns: 0 on success, -1 on error1210:Returns: 0 on success, -1 on error
1106 1211
1107Writes debug registers into the vcpu.1212Writes debug registers into the vcpu.
1108 1213
@@ -1111,24 +1216,27 @@ yet and must be cleared on entry. · 2 unmodified lines
1111 1216
1112 1217
11134.35 KVM_SET_USER_MEMORY_REGION12184.35 KVM_SET_USER_MEMORY_REGION
1219-------------------------------
1114 1220
1115Capability: KVM_CAP_USER_MEMORY1221:Capability: KVM_CAP_USER_MEMORY
1116Architectures: all1222:Architectures: all
1117Type: vm ioctl1223:Type: vm ioctl
1118Parameters: struct kvm_userspace_memory_region (in)1224:Parameters: struct kvm_userspace_memory_region (in)
1119Returns: 0 on success, -1 on error1225:Returns: 0 on success, -1 on error
1120 1226
1121struct kvm_userspace_memory_region {1227::
1228
1229 struct kvm_userspace_memory_region {
1122 __u32 slot;1230 __u32 slot;
1123 __u32 flags;1231 __u32 flags;
1124 __u64 guest_phys_addr;1232 __u64 guest_phys_addr;
1125 __u64 memory_size; /* bytes */1233 __u64 memory_size; /* bytes */
1126 __u64 userspace_addr; /* start of the userspace allocated memory */1234 __u64 userspace_addr; /* start of the userspace allocated memory */
1127};1235 };
1128 1236
1129/* for kvm_memory_region::flags */1237 /* for kvm_memory_region::flags */
1130#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)1238 #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
1131#define KVM_MEM_READONLY (1UL << 1)1239 #define KVM_MEM_READONLY (1UL << 1)
1132 1240
1133This ioctl allows the user to create, modify or delete a guest physical1241This ioctl allows the user to create, modify or delete a guest physical
1134memory slot. Bits 0-15 of "slot" specify the slot id and this value1242memory slot. Bits 0-15 of "slot" specify the slot id and this value
@@ -1174,12 +1282,13 @@ allocation and is deprecated. · 39 unmodified lines
1174 1282
1175 1283
11764.36 KVM_SET_TSS_ADDR12844.36 KVM_SET_TSS_ADDR
1285---------------------
1177 1286
1178Capability: KVM_CAP_SET_TSS_ADDR1287:Capability: KVM_CAP_SET_TSS_ADDR
1179Architectures: x861288:Architectures: x86
1180Type: vm ioctl1289:Type: vm ioctl
1181Parameters: unsigned long tss_address (in)1290:Parameters: unsigned long tss_address (in)
1182Returns: 0 on success, -1 on error1291:Returns: 0 on success, -1 on error
1183 1292
1184This ioctl defines the physical address of a three-page region in the guest1293This ioctl defines the physical address of a three-page region in the guest
1185physical address space. The region must be within the first 4GB of the1294physical 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
1193 1302
1194 1303
11954.37 KVM_ENABLE_CAP13044.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
1196 1312
1197Capability: KVM_CAP_ENABLE_CAP1313:Capability: KVM_CAP_ENABLE_CAP_VM
1198Architectures: mips, ppc, s3901314:Architectures: all
1199Type: vcpu ioctl1315:Type: vcpu ioctl
1200Parameters: struct kvm_enable_cap (in)1316:Parameters: struct kvm_enable_cap (in)
1201Returns: 0 on success; -1 on error1317:Returns: 0 on success; -1 on error
1202 1318
1203Capability: KVM_CAP_ENABLE_CAP_VM1319.. note::
1204Architectures: all
1205Type: vcpu ioctl
1206Parameters: struct kvm_enable_cap (in)
1207Returns: 0 on success; -1 on error
1208 1320
1209+Not all extensions are enabled by default. Using this ioctl the application1321 Not all extensions are enabled by default. Using this ioctl the application
1210can enable an extension, making it available to the guest.1322 can enable an extension, making it available to the guest.
1211 1323
1212On systems that do not support this ioctl, it always fails. On systems that1324On systems that do not support this ioctl, it always fails. On systems that
1213do support it, it only works for extensions that are supported for enablement.1325do 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
1215To check if a capability can be enabled, the KVM_CHECK_EXTENSION ioctl should1327To check if a capability can be enabled, the KVM_CHECK_EXTENSION ioctl should
1216be used.1328be used.
1217 1329
1218struct kvm_enable_cap {1330::
1331
1332 struct kvm_enable_cap {
1219 /* in */1333 /* in */
1220 __u32 cap;1334 __u32 cap;
1221 1335
1222The capability that is supposed to get enabled.1336The capability that is supposed to get enabled.
1223 1337
1338::
1339
1224 __u32 flags;1340 __u32 flags;
1225 1341
1226A bitfield indicating future enhancements. Has to be 0 for now.1342A bitfield indicating future enhancements. Has to be 0 for now.
1227 1343
1344::
1345
1228 __u64 args[4];1346 __u64 args[4];
1229 1347
1230Arguments for enabling a feature. If a feature needs initial values to1348Arguments for enabling a feature. If a feature needs initial values to
1231function properly, this is the place to put them.1349function properly, this is the place to put them.
1232 1350
1351::
1352
1233 __u8 pad[64];1353 __u8 pad[64];
1234};1354 };
1235 1355
1236The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl1356The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl
1237for vm-wide capabilities.1357for vm-wide capabilities.
1238 1358
12394.38 KVM_GET_MP_STATE13594.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
1240 1367
1241Capability: KVM_CAP_MP_STATE1368::
1242Architectures: x86, s390, arm, arm64
1243Type: vcpu ioctl
1244Parameters: struct kvm_mp_state (out)
1245Returns: 0 on success; -1 on error
1246 1369
1247struct kvm_mp_state {1370 struct kvm_mp_state {
1248 __u32 mp_state;1371 __u32 mp_state;
1249};1372 };
1250 1373
1251Returns the vcpu's current "multiprocessing state" (though also valid on1374Returns the vcpu's current "multiprocessing state" (though also valid on
1252uniprocessor guests).1375uniprocessor guests).
1253 1376
1254Possible values are:1377Possible values are:
1255 1378
1256 - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86,arm/arm64]1379 ========================== ===============================================
1257 - KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP)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)
1258 which has not yet received an INIT signal [x86]1382 which has not yet received an INIT signal [x86]
1259 - KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is1383 KVM_MP_STATE_INIT_RECEIVED the vcpu has received an INIT signal, and is
1260 now ready for a SIPI [x86]1384 now ready for a SIPI [x86]
1261 - KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and1385 KVM_MP_STATE_HALTED the vcpu has executed a HLT instruction and
1262 is waiting for an interrupt [x86]1386 is waiting for an interrupt [x86]
1263 - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector1387 KVM_MP_STATE_SIPI_RECEIVED the vcpu has just received a SIPI (vector
1264 accessible via KVM_GET_VCPU_EVENTS) [x86]1388 accessible via KVM_GET_VCPU_EVENTS) [x86]
1265 - KVM_MP_STATE_STOPPED: the vcpu is stopped [s390,arm/arm64]1389 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]1390 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)1391 KVM_MP_STATE_OPERATING the vcpu is operating (running or halted)
1268 [s390]1392 [s390]
1269 - KVM_MP_STATE_LOAD: the vcpu is in a special load/startup state1393 KVM_MP_STATE_LOAD the vcpu is in a special load/startup state
1270 [s390]1394 [s390]
1395 ========================== ===============================================
1271 1396
1272On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an1397On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
1273in-kernel irqchip, the multiprocessing state must be maintained by userspace on1398in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1274these architectures.1399these architectures.
1275 1400
1276For arm/arm64:1401For arm/arm64:
1402^^^^^^^^^^^^^^
1277 1403
1278The only states that are valid are KVM_MP_STATE_STOPPED and1404The only states that are valid are KVM_MP_STATE_STOPPED and
1279KVM_MP_STATE_RUNNABLE which reflect if the vcpu is paused or not.1405KVM_MP_STATE_RUNNABLE which reflect if the vcpu is paused or not.
1280 1406
12814.39 KVM_SET_MP_STATE14074.39 KVM_SET_MP_STATE
1408---------------------
1282 1409
1283Capability: KVM_CAP_MP_STATE1410:Capability: KVM_CAP_MP_STATE
1284Architectures: x86, s390, arm, arm641411:Architectures: x86, s390, arm, arm64
1285Type: vcpu ioctl1412:Type: vcpu ioctl
1286Parameters: struct kvm_mp_state (in)1413:Parameters: struct kvm_mp_state (in)
1287Returns: 0 on success; -1 on error1414:Returns: 0 on success; -1 on error
1288 1415
1289Sets the vcpu's current "multiprocessing state"; see KVM_GET_MP_STATE for1416Sets the vcpu's current "multiprocessing state"; see KVM_GET_MP_STATE for
1290arguments.1417arguments.
@@ -1294,17 +1421,19 @@ in-kernel irqchip, the multiprocessing state must be maintained by userspace on · 3 unmodified lines
1294these architectures.1421these architectures.
1295 1422
1296For arm/arm64:1423For arm/arm64:
1424^^^^^^^^^^^^^^
1297 1425
1298The only states that are valid are KVM_MP_STATE_STOPPED and1426The only states that are valid are KVM_MP_STATE_STOPPED and
1299KVM_MP_STATE_RUNNABLE which reflect if the vcpu should be paused or not.1427KVM_MP_STATE_RUNNABLE which reflect if the vcpu should be paused or not.
1300 1428
13014.40 KVM_SET_IDENTITY_MAP_ADDR14294.40 KVM_SET_IDENTITY_MAP_ADDR
1430------------------------------
1302 1431
1303Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR1432:Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR
1304Architectures: x861433:Architectures: x86
1305Type: vm ioctl1434:Type: vm ioctl
1306Parameters: unsigned long identity (in)1435:Parameters: unsigned long identity (in)
1307Returns: 0 on success, -1 on error1436:Returns: 0 on success, -1 on error
1308 1437
1309This ioctl defines the physical address of a one-page region in the guest1438This ioctl defines the physical address of a one-page region in the guest
1310physical address space. The region must be within the first 4GB of the1439physical 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
1322Fails if any VCPU has already been created.1451Fails if any VCPU has already been created.
1323 1452
13244.41 KVM_SET_BOOT_CPU_ID14534.41 KVM_SET_BOOT_CPU_ID
1454------------------------
1325 1455
1326Capability: KVM_CAP_SET_BOOT_CPU_ID1456:Capability: KVM_CAP_SET_BOOT_CPU_ID
1327Architectures: x861457:Architectures: x86
1328Type: vm ioctl1458:Type: vm ioctl
1329Parameters: unsigned long vcpu_id1459:Parameters: unsigned long vcpu_id
1330Returns: 0 on success, -1 on error1460:Returns: 0 on success, -1 on error
1331 1461
1332Define which vcpu is the Bootstrap Processor (BSP). Values are the same1462Define which vcpu is the Bootstrap Processor (BSP). Values are the same
1333as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default1463as 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
1335 1465
1336 1466
13374.42 KVM_GET_XSAVE14674.42 KVM_GET_XSAVE
1468------------------
1338 1469
1339Capability: KVM_CAP_XSAVE1470:Capability: KVM_CAP_XSAVE
1340Architectures: x861471:Architectures: x86
1341Type: vcpu ioctl1472:Type: vcpu ioctl
1342Parameters: struct kvm_xsave (out)1473:Parameters: struct kvm_xsave (out)
1343Returns: 0 on success, -1 on error1474:Returns: 0 on success, -1 on error
1344 1475
1345struct kvm_xsave {1476
1477::
1478
1479 struct kvm_xsave {
1346 __u32 region[1024];1480 __u32 region[1024];
1347};1481 };
1348 1482
1349This ioctl would copy current vcpu's xsave struct to the userspace.1483This ioctl would copy current vcpu's xsave struct to the userspace.
1350 1484
1351 1485
13524.43 KVM_SET_XSAVE14864.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
1353 1494
1354Capability: KVM_CAP_XSAVE1495::
1355Architectures: x86
1356Type: vcpu ioctl
1357Parameters: struct kvm_xsave (in)
1358Returns: 0 on success, -1 on error
1359 1496
1360struct kvm_xsave {1497
1498 struct kvm_xsave {
1361 __u32 region[1024];1499 __u32 region[1024];
1362};1500 };
1363 1501
1364This ioctl would copy userspace's xsave struct to the kernel.1502This ioctl would copy userspace's xsave struct to the kernel.
1365 1503
1366 1504
13674.44 KVM_GET_XCRS15054.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
1368 1513
1369Capability: KVM_CAP_XCRS1514::
1370Architectures: x86
1371Type: vcpu ioctl
1372Parameters: struct kvm_xcrs (out)
1373Returns: 0 on success, -1 on error
1374 1515
1375struct kvm_xcr {1516 struct kvm_xcr {
1376 __u32 xcr;1517 __u32 xcr;
1377 __u32 reserved;1518 __u32 reserved;
1378 __u64 value;1519 __u64 value;
1379};1520 };
1380 1521
1381struct kvm_xcrs {1522 struct kvm_xcrs {
1382 __u32 nr_xcrs;1523 __u32 nr_xcrs;
1383 __u32 flags;1524 __u32 flags;
1384 struct kvm_xcr xcrs[KVM_MAX_XCRS];1525 struct kvm_xcr xcrs[KVM_MAX_XCRS];
1385 __u64 padding[16];1526 __u64 padding[16];
1386};1527 };
1387 1528
1388This ioctl would copy current vcpu's xcrs to the userspace.1529This ioctl would copy current vcpu's xcrs to the userspace.
1389 1530
1390 1531
13914.45 KVM_SET_XCRS15324.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
1392 1540
1393Capability: KVM_CAP_XCRS1541::
1394Architectures: x86
1395Type: vcpu ioctl
1396Parameters: struct kvm_xcrs (in)
1397Returns: 0 on success, -1 on error
1398 1542
1399struct kvm_xcr {1543 struct kvm_xcr {
1400 __u32 xcr;1544 __u32 xcr;
1401 __u32 reserved;1545 __u32 reserved;
1402 __u64 value;1546 __u64 value;
1403};1547 };
1404 1548
1405struct kvm_xcrs {1549 struct kvm_xcrs {
1406 __u32 nr_xcrs;1550 __u32 nr_xcrs;
1407 __u32 flags;1551 __u32 flags;
1408 struct kvm_xcr xcrs[KVM_MAX_XCRS];1552 struct kvm_xcr xcrs[KVM_MAX_XCRS];
1409 __u64 padding[16];1553 __u64 padding[16];
1410};1554 };
1411 1555
1412This ioctl would set vcpu's xcr to the value userspace specified.1556This ioctl would set vcpu's xcr to the value userspace specified.
1413 1557
1414 1558
14154.46 KVM_GET_SUPPORTED_CPUID15594.46 KVM_GET_SUPPORTED_CPUID
1560----------------------------
1416 1561
1417Capability: KVM_CAP_EXT_CPUID1562:Capability: KVM_CAP_EXT_CPUID
1418Architectures: x861563:Architectures: x86
1419Type: system ioctl1564:Type: system ioctl
1420Parameters: struct kvm_cpuid2 (in/out)1565:Parameters: struct kvm_cpuid2 (in/out)
1421Returns: 0 on success, -1 on error1566:Returns: 0 on success, -1 on error
1422 1567
1423struct kvm_cpuid2 {1568::
1569
1570 struct kvm_cpuid2 {
1424 __u32 nent;1571 __u32 nent;
1425 __u32 padding;1572 __u32 padding;
1426 struct kvm_cpuid_entry2 entries[0];1573 struct kvm_cpuid_entry2 entries[0];
1427};1574 };
1428 1575
1429#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)1576 #define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
1430#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)1577 #define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
1431#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)1578 #define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
1432 1579
1433struct kvm_cpuid_entry2 {1580 struct kvm_cpuid_entry2 {
1434 __u32 function;1581 __u32 function;
1435 __u32 index;1582 __u32 index;
1436 __u32 flags;1583 __u32 flags;
@@ -1439,7 +1586,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines
1439 __u32 ecx;1586 __u32 ecx;
1440 __u32 edx;1587 __u32 edx;
1441 __u32 padding[3];1588 __u32 padding[3];
1442};1589 };
1443 1590
1444This ioctl returns x86 cpuid features which are supported by both the1591This ioctl returns x86 cpuid features which are supported by both the
1445hardware and kvm in its default configuration. Userspace can use the1592hardware 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
1467x2apic), may not be present in the host cpu, but are exposed by kvm if it can1614x2apic), may not be present in the host cpu, but are exposed by kvm if it can
1468emulate them efficiently. The fields in each entry are defined as follows:1615emulate them efficiently. The fields in each entry are defined as follows:
1469 1616
1470 function: the eax value used to obtain the entry1617 function:
1471 index: the ecx value used to obtain the entry (for entries that are1618 the eax value used to obtain the entry
1619
1620 index:
1621 the ecx value used to obtain the entry (for entries that are
1472 affected by ecx)1622 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
1474 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:1627 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
1475 if the index field is valid1628 if the index field is valid
1476 KVM_CPUID_FLAG_STATEFUL_FUNC:1629 KVM_CPUID_FLAG_STATEFUL_FUNC:
@@ -1480,12 +1633,14 @@ emulate them efficiently. The fields in each entry are defined as follows: · 3 unmodified lines
1480 KVM_CPUID_FLAG_STATE_READ_NEXT:1633 KVM_CPUID_FLAG_STATE_READ_NEXT:
1481 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is1634 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
1482 the first entry to be read by a cpu1635 the first entry to be read by a cpu
1483 eax, ebx, ecx, edx: the values returned by the cpuid instruction for1636
1637 eax, ebx, ecx, edx:
1638 the values returned by the cpuid instruction for
1484 this function/index combination1639 this function/index combination
1485 1640
1486The TSC deadline timer feature (CPUID leaf 1, ecx[24]) is always returned1641The TSC deadline timer feature (CPUID leaf 1, ecx[24]) is always returned
1487as false, since the feature depends on KVM_CREATE_IRQCHIP for local APIC1642as false, since the feature depends on KVM_CREATE_IRQCHIP for local APIC
1488support. Instead it is reported via1643support. Instead it is reported via::
1489 1644
1490 ioctl(KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER)1645 ioctl(KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER)
1491 1646
@@ -1494,18 +1649,21 @@ feature in userspace, then you can enable the feature for KVM_SET_CPUID2. · 2 unmodified lines
1494 1649
1495 1650
14964.47 KVM_PPC_GET_PVINFO16514.47 KVM_PPC_GET_PVINFO
1652-----------------------
1497 1653
1498Capability: KVM_CAP_PPC_GET_PVINFO1654:Capability: KVM_CAP_PPC_GET_PVINFO
1499Architectures: ppc1655:Architectures: ppc
1500Type: vm ioctl1656:Type: vm ioctl
1501Parameters: struct kvm_ppc_pvinfo (out)1657:Parameters: struct kvm_ppc_pvinfo (out)
1502Returns: 0 on success, !0 on error1658:Returns: 0 on success, !0 on error
1503 1659
1504struct kvm_ppc_pvinfo {1660::
1661
1662 struct kvm_ppc_pvinfo {
1505 __u32 flags;1663 __u32 flags;
1506 __u32 hcall[4];1664 __u32 hcall[4];
1507 __u8 pad[108];1665 __u8 pad[108];
1508};1666 };
1509 1667
1510This ioctl fetches PV specific information that need to be passed to the guest1668This ioctl fetches PV specific information that need to be passed to the guest
1511using the device tree or other means from vm context.1669using 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
1515If any additional field gets added to this structure later on, a bit for that1673If any additional field gets added to this structure later on, a bit for that
1516additional piece of information will be set in the flags bitmap.1674additional piece of information will be set in the flags bitmap.
1517 1675
1518The flags bitmap is defined as:1676The flags bitmap is defined as::
1519 1677
1520 /* the host supports the ePAPR idle hcall1678 /* the host supports the ePAPR idle hcall
1521 #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)1679 #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
1522 1680
15234.52 KVM_SET_GSI_ROUTING16814.52 KVM_SET_GSI_ROUTING
1682------------------------
1524 1683
1525Capability: KVM_CAP_IRQ_ROUTING1684:Capability: KVM_CAP_IRQ_ROUTING
1526Architectures: x86 s390 arm arm641685:Architectures: x86 s390 arm arm64
1527Type: vm ioctl1686:Type: vm ioctl
1528Parameters: struct kvm_irq_routing (in)1687:Parameters: struct kvm_irq_routing (in)
1529Returns: 0 on success, -1 on error1688:Returns: 0 on success, -1 on error
1530 1689
1531Sets the GSI routing table entries, overwriting any previously set entries.1690Sets the GSI routing table entries, overwriting any previously set entries.
1532 1691
1533On arm/arm64, GSI routing has the following limitation:1692On arm/arm64, GSI routing has the following limitation:
1693
1534- GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.1694- GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.
1535 1695
1536struct kvm_irq_routing {1696::
1697
1698 struct kvm_irq_routing {
1537 __u32 nr;1699 __u32 nr;
1538 __u32 flags;1700 __u32 flags;
1539 struct kvm_irq_routing_entry entries[0];1701 struct kvm_irq_routing_entry entries[0];
1540};1702 };
1541 1703
1542No flags are specified so far, the corresponding field must be set to zero.1704No flags are specified so far, the corresponding field must be set to zero.
1543 1705
1544struct kvm_irq_routing_entry {1706::
1707
1708 struct kvm_irq_routing_entry {
1545 __u32 gsi;1709 __u32 gsi;
1546 __u32 type;1710 __u32 type;
1547 __u32 flags;1711 __u32 flags;
@@ -1553,15 +1717,16 @@ struct kvm_irq_routing_entry { · 5 unmodified lines
1553 struct kvm_irq_routing_hv_sint hv_sint;1717 struct kvm_irq_routing_hv_sint hv_sint;
1554 __u32 pad[8];1718 __u32 pad[8];
1555 } u;1719 } u;
1556};1720 };
1557 1721
1558/* gsi routing entry types */1722 /* gsi routing entry types */
1559#define KVM_IRQ_ROUTING_IRQCHIP 11723 #define KVM_IRQ_ROUTING_IRQCHIP 1
1560#define KVM_IRQ_ROUTING_MSI 21724 #define KVM_IRQ_ROUTING_MSI 2
1561#define KVM_IRQ_ROUTING_S390_ADAPTER 31725 #define KVM_IRQ_ROUTING_S390_ADAPTER 3
1562#define KVM_IRQ_ROUTING_HV_SINT 41726 #define KVM_IRQ_ROUTING_HV_SINT 4
1563 1727
1564flags:1728flags:
1729
1565- KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry1730- KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
1566 type, specifies that the devid field contains a valid value. The per-VM1731 type, specifies that the devid field contains a valid value. The per-VM
1567 KVM_CAP_MSI_DEVID capability advertises the requirement to provide1732 KVM_CAP_MSI_DEVID capability advertises the requirement to provide
@@ -1569,12 +1734,14 @@ flags: · 1 unmodified line
1569 never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.1734 never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.
1570- zero otherwise1735- zero otherwise
1571 1736
1572struct kvm_irq_routing_irqchip {1737::
1738
1739 struct kvm_irq_routing_irqchip {
1573 __u32 irqchip;1740 __u32 irqchip;
1574 __u32 pin;1741 __u32 pin;
1575};1742 };
1576 1743
1577struct kvm_irq_routing_msi {1744 struct kvm_irq_routing_msi {
1578 __u32 address_lo;1745 __u32 address_lo;
1579 __u32 address_hi;1746 __u32 address_hi;
1580 __u32 data;1747 __u32 data;
@@ -1582,7 +1749,7 @@ struct kvm_irq_routing_msi { · 1 unmodified line
1582 __u32 pad;1749 __u32 pad;
1583 __u32 devid;1750 __u32 devid;
1584 };1751 };
1585};1752 };
1586 1753
1587If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier1754If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier
1588for the device that wrote the MSI message. For PCI, this is usually a1755for 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
1593address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of1760address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
1594address_hi must be zero.1761address_hi must be zero.
1595 1762
1596struct kvm_irq_routing_s390_adapter {1763::
1764
1765 struct kvm_irq_routing_s390_adapter {
1597 __u64 ind_addr;1766 __u64 ind_addr;
1598 __u64 summary_addr;1767 __u64 summary_addr;
1599 __u64 ind_offset;1768 __u64 ind_offset;
1600 __u32 summary_offset;1769 __u32 summary_offset;
1601 __u32 adapter_id;1770 __u32 adapter_id;
1602};1771 };
1603 1772
1604struct kvm_irq_routing_hv_sint {1773 struct kvm_irq_routing_hv_sint {
1605 __u32 vcpu;1774 __u32 vcpu;
1606 __u32 sint;1775 __u32 sint;
1607};1776 };
1608 1777
1609 1778
16104.55 KVM_SET_TSC_KHZ17794.55 KVM_SET_TSC_KHZ
1780--------------------
1611 1781
1612Capability: KVM_CAP_TSC_CONTROL1782:Capability: KVM_CAP_TSC_CONTROL
1613Architectures: x861783:Architectures: x86
1614Type: vcpu ioctl1784:Type: vcpu ioctl
1615Parameters: virtual tsc_khz1785:Parameters: virtual tsc_khz
1616Returns: 0 on success, -1 on error1786:Returns: 0 on success, -1 on error
1617 1787
1618Specifies the tsc frequency for the virtual machine. The unit of the1788Specifies the tsc frequency for the virtual machine. The unit of the
1619frequency is KHz.1789frequency is KHz.
1620 1790
1621 1791
16224.56 KVM_GET_TSC_KHZ17924.56 KVM_GET_TSC_KHZ
1793--------------------
1623 1794
1624Capability: KVM_CAP_GET_TSC_KHZ1795:Capability: KVM_CAP_GET_TSC_KHZ
1625Architectures: x861796:Architectures: x86
1626Type: vcpu ioctl1797:Type: vcpu ioctl
1627Parameters: none1798:Parameters: none
1628Returns: virtual tsc-khz on success, negative value on error1799:Returns: virtual tsc-khz on success, negative value on error
1629 1800
1630Returns the tsc frequency of the guest. The unit of the return value is1801Returns the tsc frequency of the guest. The unit of the return value is
1631KHz. If the host has unstable tsc this ioctl returns -EIO instead as an1802KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
@@ -1633,17 +1804,20 @@ error. · 1 unmodified line
1633 1804
1634 1805
16354.57 KVM_GET_LAPIC18064.57 KVM_GET_LAPIC
1807------------------
1636 1808
1637Capability: KVM_CAP_IRQCHIP1809:Capability: KVM_CAP_IRQCHIP
1638Architectures: x861810:Architectures: x86
1639Type: vcpu ioctl1811:Type: vcpu ioctl
1640Parameters: struct kvm_lapic_state (out)1812:Parameters: struct kvm_lapic_state (out)
1641Returns: 0 on success, -1 on error1813:Returns: 0 on success, -1 on error
1642 1814
1643#define KVM_APIC_REG_SIZE 0x4001815::
1644struct kvm_lapic_state {1816
1817 #define KVM_APIC_REG_SIZE 0x400
1818 struct kvm_lapic_state {
1645 char regs[KVM_APIC_REG_SIZE];1819 char regs[KVM_APIC_REG_SIZE];
1646};1820 };
1647 1821
1648Reads the Local APIC registers and copies them into the input argument. The1822Reads the Local APIC registers and copies them into the input argument. The
1649data format and layout are the same as documented in the architecture manual.1823data format and layout are the same as documented in the architecture manual.
@@ -1661,17 +1835,20 @@ always uses xAPIC format. · 11 unmodified lines
1661 1835
1662 1836
16634.58 KVM_SET_LAPIC18374.58 KVM_SET_LAPIC
1838------------------
1664 1839
1665Capability: KVM_CAP_IRQCHIP1840:Capability: KVM_CAP_IRQCHIP
1666Architectures: x861841:Architectures: x86
1667Type: vcpu ioctl1842:Type: vcpu ioctl
1668Parameters: struct kvm_lapic_state (in)1843:Parameters: struct kvm_lapic_state (in)
1669Returns: 0 on success, -1 on error1844:Returns: 0 on success, -1 on error
1670 1845
1671#define KVM_APIC_REG_SIZE 0x4001846::
1672struct kvm_lapic_state {1847
1848 #define KVM_APIC_REG_SIZE 0x400
1849 struct kvm_lapic_state {
1673 char regs[KVM_APIC_REG_SIZE];1850 char regs[KVM_APIC_REG_SIZE];
1674};1851 };
1675 1852
1676Copies the input argument into the Local APIC registers. The data format1853Copies the input argument into the Local APIC registers. The data format
1677and layout are the same as documented in the architecture manual.1854and layout are the same as documented in the architecture manual.
@@ -1682,35 +1859,38 @@ See the note in KVM_GET_LAPIC. · 4 unmodified lines
1682 1859
1683 1860
16844.59 KVM_IOEVENTFD18614.59 KVM_IOEVENTFD
1862------------------
1685 1863
1686Capability: KVM_CAP_IOEVENTFD1864:Capability: KVM_CAP_IOEVENTFD
1687Architectures: all1865:Architectures: all
1688Type: vm ioctl1866:Type: vm ioctl
1689Parameters: struct kvm_ioeventfd (in)1867:Parameters: struct kvm_ioeventfd (in)
1690Returns: 0 on success, !0 on error1868:Returns: 0 on success, !0 on error
1691 1869
1692This ioctl attaches or detaches an ioeventfd to a legal pio/mmio address1870This ioctl attaches or detaches an ioeventfd to a legal pio/mmio address
1693within the guest. A guest write in the registered address will signal the1871within the guest. A guest write in the registered address will signal the
1694provided event instead of triggering an exit.1872provided event instead of triggering an exit.
1695 1873
1696struct kvm_ioeventfd {1874::
1875
1876 struct kvm_ioeventfd {
1697 __u64 datamatch;1877 __u64 datamatch;
1698 __u64 addr; /* legal pio/mmio address */1878 __u64 addr; /* legal pio/mmio address */
1699 __u32 len; /* 0, 1, 2, 4, or 8 bytes */1879 __u32 len; /* 0, 1, 2, 4, or 8 bytes */
1700 __s32 fd;1880 __s32 fd;
1701 __u32 flags;1881 __u32 flags;
1702 __u8 pad[36];1882 __u8 pad[36];
1703};1883 };
1704 1884
1705For the special case of virtio-ccw devices on s390, the ioevent is matched1885For the special case of virtio-ccw devices on s390, the ioevent is matched
1706to a subchannel/virtqueue tuple instead.1886to a subchannel/virtqueue tuple instead.
1707 1887
1708The following flags are defined:1888The following flags are defined::
1709 1889
1710#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)1890 #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
1711#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)1891 #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
1712#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)1892 #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
1713#define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \1893 #define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \
1714 (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify)1894 (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify)
1715 1895
1716If datamatch flag is set, the event will be signaled only if the written value1896If 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
1725work anyway.1905work anyway.
1726 1906
17274.60 KVM_DIRTY_TLB19074.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
1728 1915
1729Capability: KVM_CAP_SW_TLB1916::
1730Architectures: ppc
1731Type: vcpu ioctl
1732Parameters: struct kvm_dirty_tlb (in)
1733Returns: 0 on success, -1 on error
1734 1917
1735struct kvm_dirty_tlb {1918 struct kvm_dirty_tlb {
1736 __u64 bitmap;1919 __u64 bitmap;
1737 __u32 num_dirty;1920 __u32 num_dirty;
1738};1921 };
1739 1922
1740This must be called whenever userspace has changed an entry in the shared1923This must be called whenever userspace has changed an entry in the shared
1741TLB, prior to calling KVM_RUN on the associated vcpu.1924TLB, 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
1758 1941
1759 1942
17604.62 KVM_CREATE_SPAPR_TCE19434.62 KVM_CREATE_SPAPR_TCE
1944-------------------------
1761 1945
1762Capability: KVM_CAP_SPAPR_TCE1946:Capability: KVM_CAP_SPAPR_TCE
1763Architectures: powerpc1947:Architectures: powerpc
1764Type: vm ioctl1948:Type: vm ioctl
1765Parameters: struct kvm_create_spapr_tce (in)1949:Parameters: struct kvm_create_spapr_tce (in)
1766Returns: file descriptor for manipulating the created TCE table1950:Returns: file descriptor for manipulating the created TCE table
1767 1951
1768This creates a virtual TCE (translation control entry) table, which1952This creates a virtual TCE (translation control entry) table, which
1769is an IOMMU for PAPR-style virtual I/O. It is used to translate1953is an IOMMU for PAPR-style virtual I/O. It is used to translate
1770logical addresses used in virtual I/O into guest physical addresses,1954logical addresses used in virtual I/O into guest physical addresses,
1771and provides a scatter/gather capability for PAPR virtual I/O.1955and provides a scatter/gather capability for PAPR virtual I/O.
1772 1956
1773/* for KVM_CAP_SPAPR_TCE */1957::
1774struct kvm_create_spapr_tce {1958
1959 /* for KVM_CAP_SPAPR_TCE */
1960 struct kvm_create_spapr_tce {
1775 __u64 liobn;1961 __u64 liobn;
1776 __u32 window_size;1962 __u32 window_size;
1777};1963 };
1778 1964
1779The liobn field gives the logical IO bus number for which to create a1965The liobn field gives the logical IO bus number for which to create a
1780TCE table. The window_size field specifies the size of the DMA window1966TCE table. The window_size field specifies the size of the DMA window
@@ -1794,12 +1980,13 @@ circumstances. · 13 unmodified lines
1794 1980
1795 1981
17964.63 KVM_ALLOCATE_RMA19824.63 KVM_ALLOCATE_RMA
1983---------------------
1797 1984
1798Capability: KVM_CAP_PPC_RMA1985:Capability: KVM_CAP_PPC_RMA
1799Architectures: powerpc1986:Architectures: powerpc
1800Type: vm ioctl1987:Type: vm ioctl
1801Parameters: struct kvm_allocate_rma (out)1988:Parameters: struct kvm_allocate_rma (out)
1802Returns: file descriptor for mapping the allocated RMA1989:Returns: file descriptor for mapping the allocated RMA
1803 1990
1804This allocates a Real Mode Area (RMA) from the pool allocated at boot1991This allocates a Real Mode Area (RMA) from the pool allocated at boot
1805time by the kernel. An RMA is a physically-contiguous, aligned region1992time 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
1808POWER processors support a set of sizes for the RMA that usually1995POWER processors support a set of sizes for the RMA that usually
1809includes 64MB, 128MB, 256MB and some larger powers of two.1996includes 64MB, 128MB, 256MB and some larger powers of two.
1810 1997
1811/* for KVM_ALLOCATE_RMA */1998::
1812struct kvm_allocate_rma {1999
2000 /* for KVM_ALLOCATE_RMA */
2001 struct kvm_allocate_rma {
1813 __u64 rma_size;2002 __u64 rma_size;
1814};2003 };
1815 2004
1816The return value is a file descriptor which can be passed to mmap(2)2005The return value is a file descriptor which can be passed to mmap(2)
1817to map the allocated RMA into userspace. The mapped area can then be2006to 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
1827 2016
1828 2017
18294.64 KVM_NMI20184.64 KVM_NMI
2019------------
1830 2020
1831Capability: KVM_CAP_USER_NMI2021:Capability: KVM_CAP_USER_NMI
1832Architectures: x862022:Architectures: x86
1833Type: vcpu ioctl2023:Type: vcpu ioctl
1834Parameters: none2024:Parameters: none
1835Returns: 0 on success, -1 on error2025:Returns: 0 on success, -1 on error
1836 2026
1837Queues an NMI on the thread's vcpu. Note this is well defined only2027Queues an NMI on the thread's vcpu. Note this is well defined only
1838when KVM_CREATE_IRQCHIP has not been called, since this is an interface2028when KVM_CREATE_IRQCHIP has not been called, since this is an interface
@@ -1853,14 +2043,16 @@ debugging. · 14 unmodified lines
1853 2043
1854 2044
18554.65 KVM_S390_UCAS_MAP20454.65 KVM_S390_UCAS_MAP
2046----------------------
1856 2047
1857Capability: KVM_CAP_S390_UCONTROL2048:Capability: KVM_CAP_S390_UCONTROL
1858Architectures: s3902049:Architectures: s390
1859Type: vcpu ioctl2050:Type: vcpu ioctl
1860Parameters: struct kvm_s390_ucas_mapping (in)2051:Parameters: struct kvm_s390_ucas_mapping (in)
1861Returns: 0 in case of success2052:Returns: 0 in case of success
2053
2054The parameter is defined like this::
1862 2055
1863The parameter is defined like this:
1864 struct kvm_s390_ucas_mapping {2056 struct kvm_s390_ucas_mapping {
1865 __u64 user_addr;2057 __u64 user_addr;
1866 __u64 vcpu_addr;2058 __u64 vcpu_addr;
@@ -1873,14 +2065,16 @@ be aligned by 1 megabyte. · 6 unmodified lines
1873 2065
1874 2066
18754.66 KVM_S390_UCAS_UNMAP20674.66 KVM_S390_UCAS_UNMAP
2068------------------------
1876 2069
1877Capability: KVM_CAP_S390_UCONTROL2070:Capability: KVM_CAP_S390_UCONTROL
1878Architectures: s3902071:Architectures: s390
1879Type: vcpu ioctl2072:Type: vcpu ioctl
1880Parameters: struct kvm_s390_ucas_mapping (in)2073:Parameters: struct kvm_s390_ucas_mapping (in)
1881Returns: 0 in case of success2074:Returns: 0 in case of success
2075
2076The parameter is defined like this::
1882 2077
1883The parameter is defined like this:
1884 struct kvm_s390_ucas_mapping {2078 struct kvm_s390_ucas_mapping {
1885 __u64 user_addr;2079 __u64 user_addr;
1886 __u64 vcpu_addr;2080 __u64 vcpu_addr;
@@ -1893,12 +2087,13 @@ All parameters need to be aligned by 1 megabyte. · 6 unmodified lines
1893 2087
1894 2088
18954.67 KVM_S390_VCPU_FAULT20894.67 KVM_S390_VCPU_FAULT
2090------------------------
1896 2091
1897Capability: KVM_CAP_S390_UCONTROL2092:Capability: KVM_CAP_S390_UCONTROL
1898Architectures: s3902093:Architectures: s390
1899Type: vcpu ioctl2094:Type: vcpu ioctl
1900Parameters: vcpu absolute address (in)2095:Parameters: vcpu absolute address (in)
1901Returns: 0 in case of success2096:Returns: 0 in case of success
1902 2097
1903This call creates a page table entry on the virtual cpu's address space2098This call creates a page table entry on the virtual cpu's address space
1904(for user controlled virtual machines) or the virtual machine's address2099(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
1910 2105
1911 2106
19124.68 KVM_SET_ONE_REG21074.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
1913 2115
1914Capability: KVM_CAP_ONE_REG
1915Architectures: all
1916Type: vcpu ioctl
1917Parameters: struct kvm_one_reg (in)
1918Returns: 0 on success, negative value on failure
1919Errors:2116Errors:
1920  ENOENT:   no such register2117
1921  EINVAL:   invalid register ID, or no such register2118 ====== ============================================================
1922  EPERM:    (arm64) register access not allowed before vcpu finalization2119  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
1923(These error codes are indicative only: do not rely on a specific error2124(These error codes are indicative only: do not rely on a specific error
1924code being returned in a specific situation.)2125code being returned in a specific situation.)
1925 2126
1926struct kvm_one_reg {2127::
2128
2129 struct kvm_one_reg {
1927 __u64 id;2130 __u64 id;
1928 __u64 addr;2131 __u64 addr;
1929};2132 };
1930 2133
1931Using this ioctl, a single vcpu register can be set to a specific value2134Using this ioctl, a single vcpu register can be set to a specific value
1932defined by user space with the passed in struct kvm_one_reg, where id2135defined 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
1936and their own constants and width. To keep track of the implemented2139and their own constants and width. To keep track of the implemented
1937registers, find a list below:2140registers, find a list below:
1938 2141
1939 Arch | Register | Width (bits)2142 ======= =============================== ============
1940 | |2143 Arch Register Width (bits)
1941 PPC | KVM_REG_PPC_HIOR | 642144 ======= =============================== ============
1942 PPC | KVM_REG_PPC_IAC1 | 642145 PPC KVM_REG_PPC_HIOR 64
1943 PPC | KVM_REG_PPC_IAC2 | 642146 PPC KVM_REG_PPC_IAC1 64
1944 PPC | KVM_REG_PPC_IAC3 | 642147 PPC KVM_REG_PPC_IAC2 64
1945 PPC | KVM_REG_PPC_IAC4 | 642148 PPC KVM_REG_PPC_IAC3 64
1946 PPC | KVM_REG_PPC_DAC1 | 642149 PPC KVM_REG_PPC_IAC4 64
1947 PPC | KVM_REG_PPC_DAC2 | 642150 PPC KVM_REG_PPC_DAC1 64
1948 PPC | KVM_REG_PPC_DABR | 642151 PPC KVM_REG_PPC_DAC2 64
1949 PPC | KVM_REG_PPC_DSCR | 642152 PPC KVM_REG_PPC_DABR 64
1950 PPC | KVM_REG_PPC_PURR | 642153 PPC KVM_REG_PPC_DSCR 64
1951 PPC | KVM_REG_PPC_SPURR | 642154 PPC KVM_REG_PPC_PURR 64
1952 PPC | KVM_REG_PPC_DAR | 642155 PPC KVM_REG_PPC_SPURR 64
1953 PPC | KVM_REG_PPC_DSISR | 322156 PPC KVM_REG_PPC_DAR 64
1954 PPC | KVM_REG_PPC_AMR | 642157 PPC KVM_REG_PPC_DSISR 32
1955 PPC | KVM_REG_PPC_UAMOR | 642158 PPC KVM_REG_PPC_AMR 64
1956 PPC | KVM_REG_PPC_MMCR0 | 642159 PPC KVM_REG_PPC_UAMOR 64
1957 PPC | KVM_REG_PPC_MMCR1 | 642160 PPC KVM_REG_PPC_MMCR0 64
1958 PPC | KVM_REG_PPC_MMCRA | 642161 PPC KVM_REG_PPC_MMCR1 64
1959 PPC | KVM_REG_PPC_MMCR2 | 642162 PPC KVM_REG_PPC_MMCRA 64
1960 PPC | KVM_REG_PPC_MMCRS | 642163 PPC KVM_REG_PPC_MMCR2 64
1961 PPC | KVM_REG_PPC_SIAR | 642164 PPC KVM_REG_PPC_MMCRS 64
1962 PPC | KVM_REG_PPC_SDAR | 642165 PPC KVM_REG_PPC_SIAR 64
1963 PPC | KVM_REG_PPC_SIER | 642166 PPC KVM_REG_PPC_SDAR 64
1964 PPC | KVM_REG_PPC_PMC1 | 322167 PPC KVM_REG_PPC_SIER 64
1965 PPC | KVM_REG_PPC_PMC2 | 322168 PPC KVM_REG_PPC_PMC1 32
1966 PPC | KVM_REG_PPC_PMC3 | 322169 PPC KVM_REG_PPC_PMC2 32
1967 PPC | KVM_REG_PPC_PMC4 | 322170 PPC KVM_REG_PPC_PMC3 32
1968 PPC | KVM_REG_PPC_PMC5 | 322171 PPC KVM_REG_PPC_PMC4 32
1969 PPC | KVM_REG_PPC_PMC6 | 322172 PPC KVM_REG_PPC_PMC5 32
1970 PPC | KVM_REG_PPC_PMC7 | 322173 PPC KVM_REG_PPC_PMC6 32
1971 PPC | KVM_REG_PPC_PMC8 | 322174 PPC KVM_REG_PPC_PMC7 32
1972 PPC | KVM_REG_PPC_FPR0 | 642175 PPC KVM_REG_PPC_PMC8 32
1973 ...2176 PPC KVM_REG_PPC_FPR0 64
1974 PPC | KVM_REG_PPC_FPR31 | 642177 ...
1975 PPC | KVM_REG_PPC_VR0 | 1282178 PPC KVM_REG_PPC_FPR31 64
1976 ...2179 PPC KVM_REG_PPC_VR0 128
1977 PPC | KVM_REG_PPC_VR31 | 1282180 ...
1978 PPC | KVM_REG_PPC_VSR0 | 1282181 PPC KVM_REG_PPC_VR31 128
1979 ...2182 PPC KVM_REG_PPC_VSR0 128
1980 PPC | KVM_REG_PPC_VSR31 | 1282183 ...
1981 PPC | KVM_REG_PPC_FPSCR | 642184 PPC KVM_REG_PPC_VSR31 128
1982 PPC | KVM_REG_PPC_VSCR | 322185 PPC KVM_REG_PPC_FPSCR 64
1983 PPC | KVM_REG_PPC_VPA_ADDR | 642186 PPC KVM_REG_PPC_VSCR 32
1984 PPC | KVM_REG_PPC_VPA_SLB | 1282187 PPC KVM_REG_PPC_VPA_ADDR 64
1985 PPC | KVM_REG_PPC_VPA_DTL | 1282188 PPC KVM_REG_PPC_VPA_SLB 128
1986 PPC | KVM_REG_PPC_EPCR | 322189 PPC KVM_REG_PPC_VPA_DTL 128
1987 PPC | KVM_REG_PPC_EPR | 322190 PPC KVM_REG_PPC_EPCR 32
1988 PPC | KVM_REG_PPC_TCR | 322191 PPC KVM_REG_PPC_EPR 32
1989 PPC | KVM_REG_PPC_TSR | 322192 PPC KVM_REG_PPC_TCR 32
1990 PPC | KVM_REG_PPC_OR_TSR | 322193 PPC KVM_REG_PPC_TSR 32
1991 PPC | KVM_REG_PPC_CLEAR_TSR | 322194 PPC KVM_REG_PPC_OR_TSR 32
1992 PPC | KVM_REG_PPC_MAS0 | 322195 PPC KVM_REG_PPC_CLEAR_TSR 32
1993 PPC | KVM_REG_PPC_MAS1 | 322196 PPC KVM_REG_PPC_MAS0 32
1994 PPC | KVM_REG_PPC_MAS2 | 642197 PPC KVM_REG_PPC_MAS1 32
1995 PPC | KVM_REG_PPC_MAS7_3 | 642198 PPC KVM_REG_PPC_MAS2 64
1996 PPC | KVM_REG_PPC_MAS4 | 322199 PPC KVM_REG_PPC_MAS7_3 64
1997 PPC | KVM_REG_PPC_MAS6 | 322200 PPC KVM_REG_PPC_MAS4 32
1998 PPC | KVM_REG_PPC_MMUCFG | 322201 PPC KVM_REG_PPC_MAS6 32
1999 PPC | KVM_REG_PPC_TLB0CFG | 322202 PPC KVM_REG_PPC_MMUCFG 32
2000 PPC | KVM_REG_PPC_TLB1CFG | 322203 PPC KVM_REG_PPC_TLB0CFG 32
2001 PPC | KVM_REG_PPC_TLB2CFG | 322204 PPC KVM_REG_PPC_TLB1CFG 32
2002 PPC | KVM_REG_PPC_TLB3CFG | 322205 PPC KVM_REG_PPC_TLB2CFG 32
2003 PPC | KVM_REG_PPC_TLB0PS | 322206 PPC KVM_REG_PPC_TLB3CFG 32
2004 PPC | KVM_REG_PPC_TLB1PS | 322207 PPC KVM_REG_PPC_TLB0PS 32
2005 PPC | KVM_REG_PPC_TLB2PS | 322208 PPC KVM_REG_PPC_TLB1PS 32
2006 PPC | KVM_REG_PPC_TLB3PS | 322209 PPC KVM_REG_PPC_TLB2PS 32
2007 PPC | KVM_REG_PPC_EPTCFG | 322210 PPC KVM_REG_PPC_TLB3PS 32
2008 PPC | KVM_REG_PPC_ICP_STATE | 642211 PPC KVM_REG_PPC_EPTCFG 32
2009 PPC | KVM_REG_PPC_VP_STATE | 1282212 PPC KVM_REG_PPC_ICP_STATE 64
2010 PPC | KVM_REG_PPC_TB_OFFSET | 642213 PPC KVM_REG_PPC_VP_STATE 128
2011 PPC | KVM_REG_PPC_SPMC1 | 322214 PPC KVM_REG_PPC_TB_OFFSET 64
2012 PPC | KVM_REG_PPC_SPMC2 | 322215 PPC KVM_REG_PPC_SPMC1 32
2013 PPC | KVM_REG_PPC_IAMR | 642216 PPC KVM_REG_PPC_SPMC2 32
2014 PPC | KVM_REG_PPC_TFHAR | 642217 PPC KVM_REG_PPC_IAMR 64
2015 PPC | KVM_REG_PPC_TFIAR | 642218 PPC KVM_REG_PPC_TFHAR 64
2016 PPC | KVM_REG_PPC_TEXASR | 642219 PPC KVM_REG_PPC_TFIAR 64
2017 PPC | KVM_REG_PPC_FSCR | 642220 PPC KVM_REG_PPC_TEXASR 64
2018 PPC | KVM_REG_PPC_PSPB | 322221 PPC KVM_REG_PPC_FSCR 64
2019 PPC | KVM_REG_PPC_EBBHR | 642222 PPC KVM_REG_PPC_PSPB 32
2020 PPC | KVM_REG_PPC_EBBRR | 642223 PPC KVM_REG_PPC_EBBHR 64
2021 PPC | KVM_REG_PPC_BESCR | 642224 PPC KVM_REG_PPC_EBBRR 64
2022 PPC | KVM_REG_PPC_TAR | 642225 PPC KVM_REG_PPC_BESCR 64
2023 PPC | KVM_REG_PPC_DPDES | 642226 PPC KVM_REG_PPC_TAR 64
2024 PPC | KVM_REG_PPC_DAWR | 642227 PPC KVM_REG_PPC_DPDES 64
2025 PPC | KVM_REG_PPC_DAWRX | 642228 PPC KVM_REG_PPC_DAWR 64
2026 PPC | KVM_REG_PPC_CIABR | 642229 PPC KVM_REG_PPC_DAWRX 64
2027 PPC | KVM_REG_PPC_IC | 642230 PPC KVM_REG_PPC_CIABR 64
2028 PPC | KVM_REG_PPC_VTB | 642231 PPC KVM_REG_PPC_IC 64
2029 PPC | KVM_REG_PPC_CSIGR | 642232 PPC KVM_REG_PPC_VTB 64
2030 PPC | KVM_REG_PPC_TACR | 642233 PPC KVM_REG_PPC_CSIGR 64
2031 PPC | KVM_REG_PPC_TCSCR | 642234 PPC KVM_REG_PPC_TACR 64
2032 PPC | KVM_REG_PPC_PID | 642235 PPC KVM_REG_PPC_TCSCR 64
2033 PPC | KVM_REG_PPC_ACOP | 642236 PPC KVM_REG_PPC_PID 64
2034 PPC | KVM_REG_PPC_VRSAVE | 322237 PPC KVM_REG_PPC_ACOP 64
2035 PPC | KVM_REG_PPC_LPCR | 322238 PPC KVM_REG_PPC_VRSAVE 32
2036 PPC | KVM_REG_PPC_LPCR_64 | 642239 PPC KVM_REG_PPC_LPCR 32
2037 PPC | KVM_REG_PPC_PPR | 642240 PPC KVM_REG_PPC_LPCR_64 64
2038 PPC | KVM_REG_PPC_ARCH_COMPAT | 322241 PPC KVM_REG_PPC_PPR 64
2039 PPC | KVM_REG_PPC_DABRX | 322242 PPC KVM_REG_PPC_ARCH_COMPAT 32
2040 PPC | KVM_REG_PPC_WORT | 642243 PPC KVM_REG_PPC_DABRX 32
2041 PPC | KVM_REG_PPC_SPRG9 | 642244 PPC KVM_REG_PPC_WORT 64
2042 PPC | KVM_REG_PPC_DBSR | 322245 PPC KVM_REG_PPC_SPRG9 64
2043 PPC | KVM_REG_PPC_TIDR | 642246 PPC KVM_REG_PPC_DBSR 32
2044 PPC | KVM_REG_PPC_PSSCR | 642247 PPC KVM_REG_PPC_TIDR 64
2045 PPC | KVM_REG_PPC_DEC_EXPIRY | 642248 PPC KVM_REG_PPC_PSSCR 64
2046 PPC | KVM_REG_PPC_PTCR | 642249 PPC KVM_REG_PPC_DEC_EXPIRY 64
2047 PPC | KVM_REG_PPC_TM_GPR0 | 642250 PPC KVM_REG_PPC_PTCR 64
2048 ...2251 PPC KVM_REG_PPC_TM_GPR0 64
2049 PPC | KVM_REG_PPC_TM_GPR31 | 642252 ...
2050 PPC | KVM_REG_PPC_TM_VSR0 | 1282253 PPC KVM_REG_PPC_TM_GPR31 64
2051 ...2254 PPC KVM_REG_PPC_TM_VSR0 128
2052 PPC | KVM_REG_PPC_TM_VSR63 | 1282255 ...
2053 PPC | KVM_REG_PPC_TM_CR | 642256 PPC KVM_REG_PPC_TM_VSR63 128
2054 PPC | KVM_REG_PPC_TM_LR | 642257 PPC KVM_REG_PPC_TM_CR 64
2055 PPC | KVM_REG_PPC_TM_CTR | 642258 PPC KVM_REG_PPC_TM_LR 64
2056 PPC | KVM_REG_PPC_TM_FPSCR | 642259 PPC KVM_REG_PPC_TM_CTR 64
2057 PPC | KVM_REG_PPC_TM_AMR | 642260 PPC KVM_REG_PPC_TM_FPSCR 64
2058 PPC | KVM_REG_PPC_TM_PPR | 642261 PPC KVM_REG_PPC_TM_AMR 64
2059 PPC | KVM_REG_PPC_TM_VRSAVE | 642262 PPC KVM_REG_PPC_TM_PPR 64
2060 PPC | KVM_REG_PPC_TM_VSCR | 322263 PPC KVM_REG_PPC_TM_VRSAVE 64
2061 PPC | KVM_REG_PPC_TM_DSCR | 642264 PPC KVM_REG_PPC_TM_VSCR 32
2062 PPC | KVM_REG_PPC_TM_TAR | 642265 PPC KVM_REG_PPC_TM_DSCR 64
2063 PPC | KVM_REG_PPC_TM_XER | 642266 PPC KVM_REG_PPC_TM_TAR 64
2064 | |2267 PPC KVM_REG_PPC_TM_XER 64
2065 MIPS | KVM_REG_MIPS_R0 | 642268
2066 ...2269 MIPS KVM_REG_MIPS_R0 64
2067 MIPS | KVM_REG_MIPS_R31 | 642270 ...
2068 MIPS | KVM_REG_MIPS_HI | 642271 MIPS KVM_REG_MIPS_R31 64
2069 MIPS | KVM_REG_MIPS_LO | 642272 MIPS KVM_REG_MIPS_HI 64
2070 MIPS | KVM_REG_MIPS_PC | 642273 MIPS KVM_REG_MIPS_LO 64
2071 MIPS | KVM_REG_MIPS_CP0_INDEX | 322274 MIPS KVM_REG_MIPS_PC 64
2072 MIPS | KVM_REG_MIPS_CP0_ENTRYLO0 | 642275 MIPS KVM_REG_MIPS_CP0_INDEX 32
2073 MIPS | KVM_REG_MIPS_CP0_ENTRYLO1 | 642276 MIPS KVM_REG_MIPS_CP0_ENTRYLO0 64
2074 MIPS | KVM_REG_MIPS_CP0_CONTEXT | 642277 MIPS KVM_REG_MIPS_CP0_ENTRYLO1 64
2075 MIPS | KVM_REG_MIPS_CP0_CONTEXTCONFIG| 322278 MIPS KVM_REG_MIPS_CP0_CONTEXT 64
2076 MIPS | KVM_REG_MIPS_CP0_USERLOCAL | 642279 MIPS KVM_REG_MIPS_CP0_CONTEXTCONFIG 32
2077 MIPS | KVM_REG_MIPS_CP0_XCONTEXTCONFIG| 642280 MIPS KVM_REG_MIPS_CP0_USERLOCAL 64
2078 MIPS | KVM_REG_MIPS_CP0_PAGEMASK | 322281 MIPS KVM_REG_MIPS_CP0_XCONTEXTCONFIG 64
2079 MIPS | KVM_REG_MIPS_CP0_PAGEGRAIN | 322282 MIPS KVM_REG_MIPS_CP0_PAGEMASK 32
2080 MIPS | KVM_REG_MIPS_CP0_SEGCTL0 | 642283 MIPS KVM_REG_MIPS_CP0_PAGEGRAIN 32
2081 MIPS | KVM_REG_MIPS_CP0_SEGCTL1 | 642284 MIPS KVM_REG_MIPS_CP0_SEGCTL0 64
2082 MIPS | KVM_REG_MIPS_CP0_SEGCTL2 | 642285 MIPS KVM_REG_MIPS_CP0_SEGCTL1 64
2083 MIPS | KVM_REG_MIPS_CP0_PWBASE | 642286 MIPS KVM_REG_MIPS_CP0_SEGCTL2 64
2084 MIPS | KVM_REG_MIPS_CP0_PWFIELD | 642287 MIPS KVM_REG_MIPS_CP0_PWBASE 64
2085 MIPS | KVM_REG_MIPS_CP0_PWSIZE | 642288 MIPS KVM_REG_MIPS_CP0_PWFIELD 64
2086 MIPS | KVM_REG_MIPS_CP0_WIRED | 322289 MIPS KVM_REG_MIPS_CP0_PWSIZE 64
2087 MIPS | KVM_REG_MIPS_CP0_PWCTL | 322290 MIPS KVM_REG_MIPS_CP0_WIRED 32
2088 MIPS | KVM_REG_MIPS_CP0_HWRENA | 322291 MIPS KVM_REG_MIPS_CP0_PWCTL 32
2089 MIPS | KVM_REG_MIPS_CP0_BADVADDR | 642292 MIPS KVM_REG_MIPS_CP0_HWRENA 32
2090 MIPS | KVM_REG_MIPS_CP0_BADINSTR | 322293 MIPS KVM_REG_MIPS_CP0_BADVADDR 64
2091 MIPS | KVM_REG_MIPS_CP0_BADINSTRP | 322294 MIPS KVM_REG_MIPS_CP0_BADINSTR 32
2092 MIPS | KVM_REG_MIPS_CP0_COUNT | 322295 MIPS KVM_REG_MIPS_CP0_BADINSTRP 32
2093 MIPS | KVM_REG_MIPS_CP0_ENTRYHI | 642296 MIPS KVM_REG_MIPS_CP0_COUNT 32
2094 MIPS | KVM_REG_MIPS_CP0_COMPARE | 322297 MIPS KVM_REG_MIPS_CP0_ENTRYHI 64
2095 MIPS | KVM_REG_MIPS_CP0_STATUS | 322298 MIPS KVM_REG_MIPS_CP0_COMPARE 32
2096 MIPS | KVM_REG_MIPS_CP0_INTCTL | 322299 MIPS KVM_REG_MIPS_CP0_STATUS 32
2097 MIPS | KVM_REG_MIPS_CP0_CAUSE | 322300 MIPS KVM_REG_MIPS_CP0_INTCTL 32
2098 MIPS | KVM_REG_MIPS_CP0_EPC | 642301 MIPS KVM_REG_MIPS_CP0_CAUSE 32
2099 MIPS | KVM_REG_MIPS_CP0_PRID | 322302 MIPS KVM_REG_MIPS_CP0_EPC 64
2100 MIPS | KVM_REG_MIPS_CP0_EBASE | 642303 MIPS KVM_REG_MIPS_CP0_PRID 32
2101 MIPS | KVM_REG_MIPS_CP0_CONFIG | 322304 MIPS KVM_REG_MIPS_CP0_EBASE 64
2102 MIPS | KVM_REG_MIPS_CP0_CONFIG1 | 322305 MIPS KVM_REG_MIPS_CP0_CONFIG 32
2103 MIPS | KVM_REG_MIPS_CP0_CONFIG2 | 322306 MIPS KVM_REG_MIPS_CP0_CONFIG1 32
2104 MIPS | KVM_REG_MIPS_CP0_CONFIG3 | 322307 MIPS KVM_REG_MIPS_CP0_CONFIG2 32
2105 MIPS | KVM_REG_MIPS_CP0_CONFIG4 | 322308 MIPS KVM_REG_MIPS_CP0_CONFIG3 32
2106 MIPS | KVM_REG_MIPS_CP0_CONFIG5 | 322309 MIPS KVM_REG_MIPS_CP0_CONFIG4 32
2107 MIPS | KVM_REG_MIPS_CP0_CONFIG7 | 322310 MIPS KVM_REG_MIPS_CP0_CONFIG5 32
2108 MIPS | KVM_REG_MIPS_CP0_XCONTEXT | 642311 MIPS KVM_REG_MIPS_CP0_CONFIG7 32
2109 MIPS | KVM_REG_MIPS_CP0_ERROREPC | 642312 MIPS KVM_REG_MIPS_CP0_XCONTEXT 64
2110 MIPS | KVM_REG_MIPS_CP0_KSCRATCH1 | 642313 MIPS KVM_REG_MIPS_CP0_ERROREPC 64
2111 MIPS | KVM_REG_MIPS_CP0_KSCRATCH2 | 642314 MIPS KVM_REG_MIPS_CP0_KSCRATCH1 64
2112 MIPS | KVM_REG_MIPS_CP0_KSCRATCH3 | 642315 MIPS KVM_REG_MIPS_CP0_KSCRATCH2 64
2113 MIPS | KVM_REG_MIPS_CP0_KSCRATCH4 | 642316 MIPS KVM_REG_MIPS_CP0_KSCRATCH3 64
2114 MIPS | KVM_REG_MIPS_CP0_KSCRATCH5 | 642317 MIPS KVM_REG_MIPS_CP0_KSCRATCH4 64
2115 MIPS | KVM_REG_MIPS_CP0_KSCRATCH6 | 642318 MIPS KVM_REG_MIPS_CP0_KSCRATCH5 64
2116 MIPS | KVM_REG_MIPS_CP0_MAAR(0..63) | 642319 MIPS KVM_REG_MIPS_CP0_KSCRATCH6 64
2117 MIPS | KVM_REG_MIPS_COUNT_CTL | 642320 MIPS KVM_REG_MIPS_CP0_MAAR(0..63) 64
2118 MIPS | KVM_REG_MIPS_COUNT_RESUME | 642321 MIPS KVM_REG_MIPS_COUNT_CTL 64
2119 MIPS | KVM_REG_MIPS_COUNT_HZ | 642322 MIPS KVM_REG_MIPS_COUNT_RESUME 64
2120 MIPS | KVM_REG_MIPS_FPR_32(0..31) | 322323 MIPS KVM_REG_MIPS_COUNT_HZ 64
2121 MIPS | KVM_REG_MIPS_FPR_64(0..31) | 642324 MIPS KVM_REG_MIPS_FPR_32(0..31) 32
2122 MIPS | KVM_REG_MIPS_VEC_128(0..31) | 1282325 MIPS KVM_REG_MIPS_FPR_64(0..31) 64
2123 MIPS | KVM_REG_MIPS_FCR_IR | 322326 MIPS KVM_REG_MIPS_VEC_128(0..31) 128
2124 MIPS | KVM_REG_MIPS_FCR_CSR | 322327 MIPS KVM_REG_MIPS_FCR_IR 32
2125 MIPS | KVM_REG_MIPS_MSA_IR | 322328 MIPS KVM_REG_MIPS_FCR_CSR 32
2126 MIPS | KVM_REG_MIPS_MSA_CSR | 322329 MIPS KVM_REG_MIPS_MSA_IR 32
2330 MIPS KVM_REG_MIPS_MSA_CSR 32
2331 ======= =============================== ============
2127 2332
2128ARM registers are mapped using the lower 32 bits. The upper 16 of that2333ARM registers are mapped using the lower 32 bits. The upper 16 of that
2129is the register group type, or coprocessor number:2334is the register group type, or coprocessor number:
2130 2335
2131ARM core registers have the following id bit patterns:2336ARM core registers have the following id bit patterns::
2337
2132 0x4020 0000 0010 <index into the kvm_regs struct:16>2338 0x4020 0000 0010 <index into the kvm_regs struct:16>
2133 2339
2134ARM 32-bit CP15 registers have the following id bit patterns:2340ARM 32-bit CP15 registers have the following id bit patterns::
2341
2135 0x4020 0000 000F <zero:1> <crn:4> <crm:4> <opc1:4> <opc2:3>2342 0x4020 0000 000F <zero:1> <crn:4> <crm:4> <opc1:4> <opc2:3>
2136 2343
2137ARM 64-bit CP15 registers have the following id bit patterns:2344ARM 64-bit CP15 registers have the following id bit patterns::
2345
2138 0x4030 0000 000F <zero:1> <zero:4> <crm:4> <opc1:4> <zero:3>2346 0x4030 0000 000F <zero:1> <zero:4> <crm:4> <opc1:4> <zero:3>
2139 2347
2140ARM CCSIDR registers are demultiplexed by CSSELR value:2348ARM CCSIDR registers are demultiplexed by CSSELR value::
2349
2141 0x4020 0000 0011 00 <csselr:8>2350 0x4020 0000 0011 00 <csselr:8>
2142 2351
2143ARM 32-bit VFP control registers have the following id bit patterns:2352ARM 32-bit VFP control registers have the following id bit patterns::
2353
2144 0x4020 0000 0012 1 <regno:12>2354 0x4020 0000 0012 1 <regno:12>
2145 2355
2146ARM 64-bit FP registers have the following id bit patterns:2356ARM 64-bit FP registers have the following id bit patterns::
2357
2147 0x4030 0000 0012 0 <regno:12>2358 0x4030 0000 0012 0 <regno:12>
2148 2359
2149ARM firmware pseudo-registers have the following bit pattern:2360ARM firmware pseudo-registers have the following bit pattern::
2361
2150 0x4030 0000 0014 <regno:16>2362 0x4030 0000 0014 <regno:16>
2151 2363
2152 2364
@@ -2156,15 +2368,18 @@ that is the register group type, or coprocessor number: · 3 unmodified lines
2156arm64 core/FP-SIMD registers have the following id bit patterns. Note2368arm64 core/FP-SIMD registers have the following id bit patterns. Note
2157that the size of the access is variable, as the kvm_regs structure2369that the size of the access is variable, as the kvm_regs structure
2158contains elements ranging from 32 to 128 bits. The index is a 32bit2370contains elements ranging from 32 to 128 bits. The index is a 32bit
2159value in the kvm_regs structure seen as a 32bit array.2371value in the kvm_regs structure seen as a 32bit array::
2372
2160 0x60x0 0000 0010 <index into the kvm_regs struct:16>2373 0x60x0 0000 0010 <index into the kvm_regs struct:16>
2161 2374
2162Specifically:2375Specifically:
2376
2377======================= ========= ===== =======================================
2163 Encoding Register Bits kvm_regs member2378 Encoding Register Bits kvm_regs member
2164----------------------------------------------------------------2379======================= ========= ===== =======================================
2165 0x6030 0000 0010 0000 X0 64 regs.regs[0]2380 0x6030 0000 0010 0000 X0 64 regs.regs[0]
2166 0x6030 0000 0010 0002 X1 64 regs.regs[1]2381 0x6030 0000 0010 0002 X1 64 regs.regs[1]
2167 ...2382 ...
2168 0x6030 0000 0010 003c X30 64 regs.regs[30]2383 0x6030 0000 0010 003c X30 64 regs.regs[30]
2169 0x6030 0000 0010 003e SP 64 regs.sp2384 0x6030 0000 0010 003e SP 64 regs.sp
2170 0x6030 0000 0010 0040 PC 64 regs.pc2385 0x6030 0000 0010 0040 PC 64 regs.pc
@@ -2176,27 +2391,31 @@ Specifically: · 5 unmodified lines
2176 0x6030 0000 0010 004c SPSR_UND 64 spsr[KVM_SPSR_UND]2391 0x6030 0000 0010 004c SPSR_UND 64 spsr[KVM_SPSR_UND]
2177 0x6030 0000 0010 004e SPSR_IRQ 64 spsr[KVM_SPSR_IRQ]2392 0x6030 0000 0010 004e SPSR_IRQ 64 spsr[KVM_SPSR_IRQ]
2178 0x6060 0000 0010 0050 SPSR_FIQ 64 spsr[KVM_SPSR_FIQ]2393 0x6060 0000 0010 0050 SPSR_FIQ 64 spsr[KVM_SPSR_FIQ]
2179 0x6040 0000 0010 0054 V0 128 fp_regs.vregs[0] (*)2394 0x6040 0000 0010 0054 V0 128 fp_regs.vregs[0] [1]_
2180 0x6040 0000 0010 0058 V1 128 fp_regs.vregs[1] (*)2395 0x6040 0000 0010 0058 V1 128 fp_regs.vregs[1] [1]_
2181 ...2396 ...
2182 0x6040 0000 0010 00d0 V31 128 fp_regs.vregs[31] (*)2397 0x6040 0000 0010 00d0 V31 128 fp_regs.vregs[31] [1]_
2183 0x6020 0000 0010 00d4 FPSR 32 fp_regs.fpsr2398 0x6020 0000 0010 00d4 FPSR 32 fp_regs.fpsr
2184 0x6020 0000 0010 00d5 FPCR 32 fp_regs.fpcr2399 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.
2185 2404
2186(*) These encodings are not accepted for SVE-enabled vcpus. See2405 The equivalent register content can be accessed via bits [127:0] of
2187 KVM_ARM_VCPU_INIT.2406 the corresponding SVE Zn registers instead for vcpus that have SVE
2407 enabled (see below).
2188 2408
2189 The equivalent register content can be accessed via bits [127:0] of2409arm64 CCSIDR registers are demultiplexed by CSSELR value::
2190 the corresponding SVE Zn registers instead for vcpus that have SVE
2191 enabled (see below).
2192 2410
2193arm64 CCSIDR registers are demultiplexed by CSSELR value:
2194 0x6020 0000 0011 00 <csselr:8>2411 0x6020 0000 0011 00 <csselr:8>
2195 2412
2196arm64 system registers have the following id bit patterns:2413arm64 system registers have the following id bit patterns::
2414
2197 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>2415 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>
2198 2416
2199WARNING:2417.. warning::
2418
2200 Two system register IDs do not follow the specified pattern. These2419 Two system register IDs do not follow the specified pattern. These
2201 are KVM_REG_ARM_TIMER_CVAL and KVM_REG_ARM_TIMER_CNT, which map to2420 are KVM_REG_ARM_TIMER_CVAL and KVM_REG_ARM_TIMER_CNT, which map to
2202 system registers CNTV_CVAL_EL0 and CNTVCT_EL0 respectively. These2421 system registers CNTV_CVAL_EL0 and CNTVCT_EL0 respectively. These
@@ -2205,10 +2424,12 @@ WARNING: · 2 unmodified lines
2205 derived from the register encoding for CNTV_CVAL_EL0. As this is2424 derived from the register encoding for CNTV_CVAL_EL0. As this is
2206 API, it must remain this way.2425 API, it must remain this way.
2207 2426
2208arm64 firmware pseudo-registers have the following bit pattern:2427arm64 firmware pseudo-registers have the following bit pattern::
2428
2209 0x6030 0000 0014 <regno:16>2429 0x6030 0000 0014 <regno:16>
2210 2430
2211arm64 SVE registers have the following bit patterns:2431arm64 SVE registers have the following bit patterns::
2432
2212 0x6080 0000 0015 00 <n:5> <slice:5> Zn bits[2048*slice + 2047 : 2048*slice]2433 0x6080 0000 0015 00 <n:5> <slice:5> Zn bits[2048*slice + 2047 : 2048*slice]
2213 0x6050 0000 0015 04 <n:4> <slice:5> Pn bits[256*slice + 255 : 256*slice]2434 0x6050 0000 0015 04 <n:4> <slice:5> Pn bits[256*slice + 255 : 256*slice]
2214 0x6050 0000 0015 060 <slice:5> FFR bits[256*slice + 255 : 256*slice]2435 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
2216 2437
2217Access to register IDs where 2048 * slice >= 128 * max_vq will fail with2438Access to register IDs where 2048 * slice >= 128 * max_vq will fail with
2218ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit2439ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit
2219quadwords: see (**) below.2440quadwords: see [2]_ below.
2220 2441
2221These registers are only accessible on vcpus for which SVE is enabled.2442These registers are only accessible on vcpus for which SVE is enabled.
2222See KVM_ARM_VCPU_INIT for details.2443See KVM_ARM_VCPU_INIT for details.
@@ -2231,21 +2452,21 @@ lengths supported by the vcpu to be discovered and configured by · 8 unmodified lines
2231userspace. When transferred to or from user memory via KVM_GET_ONE_REG2452userspace. When transferred to or from user memory via KVM_GET_ONE_REG
2232or KVM_SET_ONE_REG, the value of this register is of type2453or KVM_SET_ONE_REG, the value of this register is of type
2233__u64[KVM_ARM64_SVE_VLS_WORDS], and encodes the set of vector lengths as2454__u64[KVM_ARM64_SVE_VLS_WORDS], and encodes the set of vector lengths as
2234follows:2455follows::
2235 2456
2236__u64 vector_lengths[KVM_ARM64_SVE_VLS_WORDS];2457 __u64 vector_lengths[KVM_ARM64_SVE_VLS_WORDS];
2237 2458
2238if (vq >= SVE_VQ_MIN && vq <= SVE_VQ_MAX &&2459 if (vq >= SVE_VQ_MIN && vq <= SVE_VQ_MAX &&
2239 ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>2460 ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >>
2240 ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1))2461 ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1))
2241 /* Vector length vq * 16 bytes supported */2462 /* Vector length vq * 16 bytes supported */
2242else2463 else
2243 /* Vector length vq * 16 bytes not supported */2464 /* Vector length vq * 16 bytes not supported */
2244 2465
2245(**) The maximum value vq for which the above condition is true is2466.. [2] The maximum value vq for which the above condition is true is
2246max_vq. This is the maximum vector length available to the guest on2467 max_vq. This is the maximum vector length available to the guest on
2247this vcpu, and determines which register slices are visible through2468 this vcpu, and determines which register slices are visible through
2248this ioctl interface.2469 this ioctl interface.
2249 2470
2250(See Documentation/arm64/sve.rst for an explanation of the "vq"2471(See Documentation/arm64/sve.rst for an explanation of the "vq"
2251nomenclature.)2472nomenclature.)
@@ -2270,11 +2491,13 @@ write this register will fail with EPERM. · 18 unmodified lines
2270MIPS registers are mapped using the lower 32 bits. The upper 16 of that is2491MIPS registers are mapped using the lower 32 bits. The upper 16 of that is
2271the register group type:2492the register group type:
2272 2493
2273MIPS core registers (see above) have the following id bit patterns:2494MIPS core registers (see above) have the following id bit patterns::
2495
2274 0x7030 0000 0000 <reg:16>2496 0x7030 0000 0000 <reg:16>
2275 2497
2276MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit2498MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit
2277patterns depending on whether they're 32-bit or 64-bit registers:2499patterns depending on whether they're 32-bit or 64-bit registers::
2500
2278 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)2501 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit)
2279 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)2502 0x7030 0000 0001 00 <reg:5> <sel:3> (64-bit)
2280 2503
@@ -2285,10 +2508,12 @@ with the RI and XI bits (if they exist) in bits 63 and 62 respectively, and · 4 unmodified lines
2285the PFNX field starting at bit 30.2508the PFNX field starting at bit 30.
2286 2509
2287MIPS MAARs (see KVM_REG_MIPS_CP0_MAAR(*) above) have the following id bit2510MIPS MAARs (see KVM_REG_MIPS_CP0_MAAR(*) above) have the following id bit
2288patterns:2511patterns::
2512
2289 0x7030 0000 0001 01 <reg:8>2513 0x7030 0000 0001 01 <reg:8>
2290 2514
2291MIPS KVM control registers (see above) have the following id bit patterns:2515MIPS KVM control registers (see above) have the following id bit patterns::
2516
2292 0x7030 0000 0002 <reg:16>2517 0x7030 0000 0002 <reg:16>
2293 2518
2294MIPS FPU registers (see KVM_REG_MIPS_FPR_{32,64}() above) have the following2519MIPS 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
2297Config5.FRE), i.e. as the guest would see them, and they become unpredictable2522Config5.FRE), i.e. as the guest would see them, and they become unpredictable
2298if the guest FPU mode is changed. MIPS SIMD Architecture (MSA) vector2523if the guest FPU mode is changed. MIPS SIMD Architecture (MSA) vector
2299registers (see KVM_REG_MIPS_VEC_128() above) have similar patterns as they2524registers (see KVM_REG_MIPS_VEC_128() above) have similar patterns as they
2300overlap the FPU registers:2525overlap the FPU registers::
2526
2301 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers)2527 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers)
2302 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers)2528 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers)
2303 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers)2529 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers)
2304 2530
2305MIPS FPU control registers (see KVM_REG_MIPS_FCR_{IR,CSR} above) have the2531MIPS FPU control registers (see KVM_REG_MIPS_FCR_{IR,CSR} above) have the
2306following id bit patterns:2532following id bit patterns::
2533
2307 0x7020 0000 0003 01 <0:3> <reg:5>2534 0x7020 0000 0003 01 <0:3> <reg:5>
2308 2535
2309MIPS MSA control registers (see KVM_REG_MIPS_MSA_{IR,CSR} above) have the2536MIPS MSA control registers (see KVM_REG_MIPS_MSA_{IR,CSR} above) have the
2310following id bit patterns:2537following id bit patterns::
2538
2311 0x7020 0000 0003 02 <0:3> <reg:5>2539 0x7020 0000 0003 02 <0:3> <reg:5>
2312 2540
2313 2541
23144.69 KVM_GET_ONE_REG25424.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
2315 2550
2316Capability: KVM_CAP_ONE_REG
2317Architectures: all
2318Type: vcpu ioctl
2319Parameters: struct kvm_one_reg (in and out)
2320Returns: 0 on success, negative value on failure
2321Errors include:2551Errors include:
2322  ENOENT:   no such register2552
2323  EINVAL:   invalid register ID, or no such register2553 ======== ============================================================
2324  EPERM:    (arm64) register access not allowed before vcpu finalization2554  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
2325(These error codes are indicative only: do not rely on a specific error2559(These error codes are indicative only: do not rely on a specific error
2326code being returned in a specific situation.)2560code being returned in a specific situation.)
2327 2561
@@ -2335,12 +2569,13 @@ list in 4.68. · 7 unmodified lines
2335 2569
2336 2570
23374.70 KVM_KVMCLOCK_CTRL25714.70 KVM_KVMCLOCK_CTRL
2572----------------------
2338 2573
2339Capability: KVM_CAP_KVMCLOCK_CTRL2574:Capability: KVM_CAP_KVMCLOCK_CTRL
2340Architectures: Any that implement pvclocks (currently x86 only)2575:Architectures: Any that implement pvclocks (currently x86 only)
2341Type: vcpu ioctl2576:Type: vcpu ioctl
2342Parameters: None2577:Parameters: None
2343Returns: 0 on success, -1 on error2578:Returns: 0 on success, -1 on error
2344 2579
2345This signals to the host kernel that the specified guest is being paused by2580This signals to the host kernel that the specified guest is being paused by
2346userspace. The host will set a flag in the pvclock structure that is checked2581userspace. 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
2356 2591
2357 2592
23584.71 KVM_SIGNAL_MSI25934.71 KVM_SIGNAL_MSI
2594-------------------
2359 2595
2360Capability: KVM_CAP_SIGNAL_MSI2596:Capability: KVM_CAP_SIGNAL_MSI
2361Architectures: x86 arm arm642597:Architectures: x86 arm arm64
2362Type: vm ioctl2598:Type: vm ioctl
2363Parameters: struct kvm_msi (in)2599:Parameters: struct kvm_msi (in)
2364Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error2600:Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error
2365 2601
2366Directly inject a MSI message. Only valid with in-kernel irqchip that handles2602Directly inject a MSI message. Only valid with in-kernel irqchip that handles
2367MSI messages.2603MSI messages.
2368 2604
2369struct kvm_msi {2605::
2606
2607 struct kvm_msi {
2370 __u32 address_lo;2608 __u32 address_lo;
2371 __u32 address_hi;2609 __u32 address_hi;
2372 __u32 data;2610 __u32 data;
2373 __u32 flags;2611 __u32 flags;
2374 __u32 devid;2612 __u32 devid;
2375 __u8 pad[12];2613 __u8 pad[12];
2376};2614 };
2377 2615
2378flags: KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM2616flags:
2617 KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
2379 KVM_CAP_MSI_DEVID capability advertises the requirement to provide2618 KVM_CAP_MSI_DEVID capability advertises the requirement to provide
2380 the device ID. If this capability is not available, userspace2619 the device ID. If this capability is not available, userspace
2381 should never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail.2620 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
2391 2630
2392 2631
23934.71 KVM_CREATE_PIT226324.71 KVM_CREATE_PIT2
2633--------------------
2394 2634
2395Capability: KVM_CAP_PIT22635:Capability: KVM_CAP_PIT2
2396Architectures: x862636:Architectures: x86
2397Type: vm ioctl2637:Type: vm ioctl
2398Parameters: struct kvm_pit_config (in)2638:Parameters: struct kvm_pit_config (in)
2399Returns: 0 on success, -1 on error2639:Returns: 0 on success, -1 on error
2400 2640
2401Creates an in-kernel device model for the i8254 PIT. This call is only valid2641Creates an in-kernel device model for the i8254 PIT. This call is only valid
2402after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following2642after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following
2403parameters have to be passed:2643parameters have to be passed::
2404 2644
2405struct kvm_pit_config {2645 struct kvm_pit_config {
2406 __u32 flags;2646 __u32 flags;
2407 __u32 pad[15];2647 __u32 pad[15];
2408};2648 };
2409 2649
2410Valid flags are:2650Valid flags are::
2411 2651
2412#define KVM_PIT_SPEAKER_DUMMY 1 /* emulate speaker port stub */2652 #define KVM_PIT_SPEAKER_DUMMY 1 /* emulate speaker port stub */
2413 2653
2414PIT timer interrupts may use a per-VM kernel thread for injection. If it2654PIT timer interrupts may use a per-VM kernel thread for injection. If it
2415exists, this thread will have a name of the following pattern:2655exists, this thread will have a name of the following pattern::
2416 2656
2417kvm-pit/<owner-process-pid>2657 kvm-pit/<owner-process-pid>
2418 2658
2419When running a guest with elevated priorities, the scheduling parameters of2659When running a guest with elevated priorities, the scheduling parameters of
2420this thread may have to be adjusted accordingly.2660this thread may have to be adjusted accordingly.
@@ -2423,37 +2663,39 @@ This IOCTL replaces the obsolete KVM_CREATE_PIT. · 2 unmodified lines
2423 2663
2424 2664
24254.72 KVM_GET_PIT226654.72 KVM_GET_PIT2
2666-----------------
2426 2667
2427Capability: KVM_CAP_PIT_STATE22668:Capability: KVM_CAP_PIT_STATE2
2428Architectures: x862669:Architectures: x86
2429Type: vm ioctl2670:Type: vm ioctl
2430Parameters: struct kvm_pit_state2 (out)2671:Parameters: struct kvm_pit_state2 (out)
2431Returns: 0 on success, -1 on error2672:Returns: 0 on success, -1 on error
2432 2673
2433Retrieves the state of the in-kernel PIT model. Only valid after2674Retrieves the state of the in-kernel PIT model. Only valid after
2434KVM_CREATE_PIT2. The state is returned in the following structure:2675KVM_CREATE_PIT2. The state is returned in the following structure::
2435 2676
2436struct kvm_pit_state2 {2677 struct kvm_pit_state2 {
2437 struct kvm_pit_channel_state channels[3];2678 struct kvm_pit_channel_state channels[3];
2438 __u32 flags;2679 __u32 flags;
2439 __u32 reserved[9];2680 __u32 reserved[9];
2440};2681 };
2441 2682
2442Valid flags are:2683Valid flags are::
2443 2684
2444/* disable PIT in HPET legacy mode */2685 /* disable PIT in HPET legacy mode */
2445#define KVM_PIT_FLAGS_HPET_LEGACY 0x000000012686 #define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
2446 2687
2447This IOCTL replaces the obsolete KVM_GET_PIT.2688This IOCTL replaces the obsolete KVM_GET_PIT.
2448 2689
2449 2690
24504.73 KVM_SET_PIT226914.73 KVM_SET_PIT2
2692-----------------
2451 2693
2452Capability: KVM_CAP_PIT_STATE22694:Capability: KVM_CAP_PIT_STATE2
2453Architectures: x862695:Architectures: x86
2454Type: vm ioctl2696:Type: vm ioctl
2455Parameters: struct kvm_pit_state2 (in)2697:Parameters: struct kvm_pit_state2 (in)
2456Returns: 0 on success, -1 on error2698:Returns: 0 on success, -1 on error
2457 2699
2458Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2.2700Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2.
2459See KVM_GET_PIT2 for details on struct kvm_pit_state2.2701See 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
2462 2704
2463 2705
24644.74 KVM_PPC_GET_SMMU_INFO27064.74 KVM_PPC_GET_SMMU_INFO
2707--------------------------
2465 2708
2466Capability: KVM_CAP_PPC_GET_SMMU_INFO2709:Capability: KVM_CAP_PPC_GET_SMMU_INFO
2467Architectures: powerpc2710:Architectures: powerpc
2468Type: vm ioctl2711:Type: vm ioctl
2469Parameters: None2712:Parameters: None
2470Returns: 0 on success, -1 on error2713:Returns: 0 on success, -1 on error
2471 2714
2472This populates and returns a structure describing the features of2715This populates and returns a structure describing the features of
2473the "Server" class MMU emulation supported by KVM.2716the "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
2475device-tree properties for the guest operating system.2718device-tree properties for the guest operating system.
2476 2719
2477The structure contains some global information, followed by an2720The structure contains some global information, followed by an
2478array of supported segment page sizes:2721array of supported segment page sizes::
2479 2722
2480 struct kvm_ppc_smmu_info {2723 struct kvm_ppc_smmu_info {
2481 __u64 flags;2724 __u64 flags;
@@ -2503,7 +2746,7 @@ The "slb_size" field indicates how many SLB entries are supported · 21 unmodified lines
2503 2746
2504The "sps" array contains 8 entries indicating the supported base2747The "sps" array contains 8 entries indicating the supported base
2505page sizes for a segment in increasing order. Each entry is defined2748page sizes for a segment in increasing order. Each entry is defined
2506as follow:2749as follow::
2507 2750
2508 struct kvm_ppc_one_seg_page_size {2751 struct kvm_ppc_one_seg_page_size {
2509 __u32 page_shift; /* Base page shift of segment (or 0) */2752 __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
2524only larger or equal to the base page size), along with the2767only larger or equal to the base page size), along with the
2525corresponding encoding in the hash PTE. Similarly, the array is2768corresponding encoding in the hash PTE. Similarly, the array is
25268 entries sorted by increasing sizes and an entry with a "0" shift27698 entries sorted by increasing sizes and an entry with a "0" shift
2527is an empty entry and a terminator:2770is an empty entry and a terminator::
2528 2771
2529 struct kvm_ppc_one_page_size {2772 struct kvm_ppc_one_page_size {
2530 __u32 page_shift; /* Page shift (or 0) */2773 __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
2536into the hash PTE second double word).2779into the hash PTE second double word).
2537 2780
25384.75 KVM_IRQFD27814.75 KVM_IRQFD
2782--------------
2539 2783
2540Capability: KVM_CAP_IRQFD2784:Capability: KVM_CAP_IRQFD
2541Architectures: x86 s390 arm arm642785:Architectures: x86 s390 arm arm64
2542Type: vm ioctl2786:Type: vm ioctl
2543Parameters: struct kvm_irqfd (in)2787:Parameters: struct kvm_irqfd (in)
2544Returns: 0 on success, -1 on error2788:Returns: 0 on success, -1 on error
2545 2789
2546Allows setting an eventfd to directly trigger a guest interrupt.2790Allows setting an eventfd to directly trigger a guest interrupt.
2547kvm_irqfd.fd specifies the file descriptor to use as the eventfd and2791kvm_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
2565and need not be specified with KVM_IRQFD_FLAG_DEASSIGN.2809and need not be specified with KVM_IRQFD_FLAG_DEASSIGN.
2566 2810
2567On arm/arm64, gsi routing being supported, the following can happen:2811On arm/arm64, gsi routing being supported, the following can happen:
2812
2568- in case no routing entry is associated to this gsi, injection fails2813- in case no routing entry is associated to this gsi, injection fails
2569- in case the gsi is associated to an irqchip routing entry,2814- in case the gsi is associated to an irqchip routing entry,
2570 irqchip.pin + 32 corresponds to the injected SPI ID.2815 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
2573 to GICv3 ITS in-kernel emulation).2818 to GICv3 ITS in-kernel emulation).
2574 2819
25754.76 KVM_PPC_ALLOCATE_HTAB28204.76 KVM_PPC_ALLOCATE_HTAB
2821--------------------------
2576 2822
2577Capability: KVM_CAP_PPC_ALLOC_HTAB2823:Capability: KVM_CAP_PPC_ALLOC_HTAB
2578Architectures: powerpc2824:Architectures: powerpc
2579Type: vm ioctl2825:Type: vm ioctl
2580Parameters: Pointer to u32 containing hash table order (in/out)2826:Parameters: Pointer to u32 containing hash table order (in/out)
2581Returns: 0 on success, -1 on error2827:Returns: 0 on success, -1 on error
2582 2828
2583This requests the host kernel to allocate an MMU hash table for a2829This requests the host kernel to allocate an MMU hash table for a
2584guest using the PAPR paravirtualization interface. This only does2830guest 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
2609HPTEs on the next KVM_RUN of any vcpu.2855HPTEs on the next KVM_RUN of any vcpu.
2610 2856
26114.77 KVM_S390_INTERRUPT28574.77 KVM_S390_INTERRUPT
2858-----------------------
2612 2859
2613Capability: basic2860:Capability: basic
2614Architectures: s3902861:Architectures: s390
2615Type: vm ioctl, vcpu ioctl2862:Type: vm ioctl, vcpu ioctl
2616Parameters: struct kvm_s390_interrupt (in)2863:Parameters: struct kvm_s390_interrupt (in)
2617Returns: 0 on success, -1 on error2864:Returns: 0 on success, -1 on error
2618 2865
2619Allows to inject an interrupt to the guest. Interrupts can be floating2866Allows to inject an interrupt to the guest. Interrupts can be floating
2620(vm ioctl) or per cpu (vcpu ioctl), depending on the interrupt type.2867(vm ioctl) or per cpu (vcpu ioctl), depending on the interrupt type.
2621 2868
2622Interrupt parameters are passed via kvm_s390_interrupt:2869Interrupt parameters are passed via kvm_s390_interrupt::
2623 2870
2624struct kvm_s390_interrupt {2871 struct kvm_s390_interrupt {
2625 __u32 type;2872 __u32 type;
2626 __u32 parm;2873 __u32 parm;
2627 __u64 parm64;2874 __u64 parm64;
2628};2875 };
2629 2876
2630type can be one of the following:2877type can be one of the following:
2631 2878
2632KVM_S390_SIGP_STOP (vcpu) - sigp stop; optional flags in parm2879KVM_S390_SIGP_STOP (vcpu)
2633KVM_S390_PROGRAM_INT (vcpu) - program check; code in parm2880 - sigp stop; optional flags in parm
2634KVM_S390_SIGP_SET_PREFIX (vcpu) - sigp set prefix; prefix address in parm2881KVM_S390_PROGRAM_INT (vcpu)
2635KVM_S390_RESTART (vcpu) - restart2882 - program check; code in parm
2636KVM_S390_INT_CLOCK_COMP (vcpu) - clock comparator interrupt2883KVM_S390_SIGP_SET_PREFIX (vcpu)
2637KVM_S390_INT_CPU_TIMER (vcpu) - CPU timer interrupt2884 - sigp set prefix; prefix address in parm
2638KVM_S390_INT_VIRTIO (vm) - virtio external interrupt; external interrupt2885KVM_S390_RESTART (vcpu)
2639 parameters in parm and parm642886 - restart
2640KVM_S390_INT_SERVICE (vm) - sclp external interrupt; sclp parameter in parm2887KVM_S390_INT_CLOCK_COMP (vcpu)
2641KVM_S390_INT_EMERGENCY (vcpu) - sigp emergency; source cpu in parm2888 - clock comparator interrupt
2642KVM_S390_INT_EXTERNAL_CALL (vcpu) - sigp external call; source cpu in parm2889KVM_S390_INT_CPU_TIMER (vcpu)
2643KVM_S390_INT_IO(ai,cssid,ssid,schid) (vm) - compound value to indicate an2890 - CPU timer interrupt
2644 I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel);2891KVM_S390_INT_VIRTIO (vm)
2645 I/O interruption parameters in parm (subchannel) and parm64 (intparm,2892 - virtio external interrupt; external interrupt
2646 interruption subclass)2893 parameters in parm and parm64
2647KVM_S390_MCHK (vm, vcpu) - machine check interrupt; cr 14 bits in parm,2894KVM_S390_INT_SERVICE (vm)
2648 machine check interrupt code in parm64 (note that2895 - sclp external interrupt; sclp parameter in parm
2649 machine checks needing further payload are not2896KVM_S390_INT_EMERGENCY (vcpu)
2650 supported by this ioctl)2897 - sigp emergency; source cpu in parm
2898KVM_S390_INT_EXTERNAL_CALL (vcpu)
2899 - sigp external call; source cpu in parm
2900KVM_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)
2905KVM_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)
2651 2909
2652This is an asynchronous vcpu ioctl and can be invoked from any thread.2910This is an asynchronous vcpu ioctl and can be invoked from any thread.
2653 2911
26544.78 KVM_PPC_GET_HTAB_FD29124.78 KVM_PPC_GET_HTAB_FD
2913------------------------
2655 2914
2656Capability: KVM_CAP_PPC_HTAB_FD2915:Capability: KVM_CAP_PPC_HTAB_FD
2657Architectures: powerpc2916:Architectures: powerpc
2658Type: vm ioctl2917:Type: vm ioctl
2659Parameters: Pointer to struct kvm_get_htab_fd (in)2918:Parameters: Pointer to struct kvm_get_htab_fd (in)
2660Returns: file descriptor number (>= 0) on success, -1 on error2919:Returns: file descriptor number (>= 0) on success, -1 on error
2661 2920
2662This returns a file descriptor that can be used either to read out the2921This returns a file descriptor that can be used either to read out the
2663entries in the guest's hashed page table (HPT), or to write entries to2922entries in the guest's hashed page table (HPT), or to write entries to
2664initialize the HPT. The returned fd can only be written to if the2923initialize the HPT. The returned fd can only be written to if the
2665KVM_GET_HTAB_WRITE bit is set in the flags field of the argument, and2924KVM_GET_HTAB_WRITE bit is set in the flags field of the argument, and
2666can only be read if that bit is clear. The argument struct looks like2925can only be read if that bit is clear. The argument struct looks like
2667this:2926this::
2668 2927
2669/* For KVM_PPC_GET_HTAB_FD */2928 /* For KVM_PPC_GET_HTAB_FD */
2670struct kvm_get_htab_fd {2929 struct kvm_get_htab_fd {
2671 __u64 flags;2930 __u64 flags;
2672 __u64 start_index;2931 __u64 start_index;
2673 __u64 reserved[2];2932 __u64 reserved[2];
2674};2933 };
2675 2934
2676/* Values for kvm_get_htab_fd.flags */2935 /* Values for kvm_get_htab_fd.flags */
2677#define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1)2936 #define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1)
2678#define KVM_GET_HTAB_WRITE ((__u64)0x2)2937 #define KVM_GET_HTAB_WRITE ((__u64)0x2)
2679 2938
2680The `start_index' field gives the index in the HPT of the entry at2939The 'start_index' field gives the index in the HPT of the entry at
2681which to start reading. It is ignored when writing.2940which to start reading. It is ignored when writing.
2682 2941
2683Reads on the fd will initially supply information about all2942Reads 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
2692series of valid HPT entries (16 bytes) each. The header indicates how2951series of valid HPT entries (16 bytes) each. The header indicates how
2693many valid HPT entries there are and how many invalid entries follow2952many valid HPT entries there are and how many invalid entries follow
2694the valid entries. The invalid entries are not represented explicitly2953the valid entries. The invalid entries are not represented explicitly
2695in the stream. The header format is:2954in the stream. The header format is::
2696 2955
2697struct kvm_get_htab_header {2956 struct kvm_get_htab_header {
2698 __u32 index;2957 __u32 index;
2699 __u16 n_valid;2958 __u16 n_valid;
2700 __u16 n_invalid;2959 __u16 n_invalid;
2701};2960 };
2702 2961
2703Writes to the fd create HPT entries starting at the index given in the2962Writes to the fd create HPT entries starting at the index given in the
2704header; first `n_valid' valid entries with contents from the data2963header; first 'n_valid' valid entries with contents from the data
2705written, then `n_invalid' invalid entries, invalidating any previously2964written, then 'n_invalid' invalid entries, invalidating any previously
2706valid entries found.2965valid entries found.
2707 2966
27084.79 KVM_CREATE_DEVICE29674.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
2709 2974
2710Capability: KVM_CAP_DEVICE_CTRL
2711Type: vm ioctl
2712Parameters: struct kvm_create_device (in/out)
2713Returns: 0 on success, -1 on error
2714Errors:2975Errors:
2715 ENODEV: The device type is unknown or unsupported2976
2716 EEXIST: Device already created, and this type of device may not2977 ====== =======================================================
2978 ENODEV The device type is unknown or unsupported
2979 EEXIST Device already created, and this type of device may not
2717 be instantiated multiple times2980 be instantiated multiple times
2981 ====== =======================================================
2718 2982
2719 Other error conditions may be defined by individual device types or2983 Other error conditions may be defined by individual device types or
2720 have their standard meanings.2984 have their standard meanings.
@@ -2730,25 +2994,32 @@ Individual devices should not define flags. Attributes should be used · 9 unmodified lines
2730for specifying any behavior that is not implied by the device type2994for specifying any behavior that is not implied by the device type
2731number.2995number.
2732 2996
2733struct kvm_create_device {2997::
2998
2999 struct kvm_create_device {
2734 __u32 type; /* in: KVM_DEV_TYPE_xxx */3000 __u32 type; /* in: KVM_DEV_TYPE_xxx */
2735 __u32 fd; /* out: device handle */3001 __u32 fd; /* out: device handle */
2736 __u32 flags; /* in: KVM_CREATE_DEVICE_xxx */3002 __u32 flags; /* in: KVM_CREATE_DEVICE_xxx */
2737};3003 };
2738 3004
27394.80 KVM_SET_DEVICE_ATTR/KVM_GET_DEVICE_ATTR30054.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
2740 3013
2741Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
2742 KVM_CAP_VCPU_ATTRIBUTES for vcpu device
2743Type: device ioctl, vm ioctl, vcpu ioctl
2744Parameters: struct kvm_device_attr
2745Returns: 0 on success, -1 on error
2746Errors:3014Errors:
2747 ENXIO: The group or attribute is unknown/unsupported for this device3015
3016 ===== =============================================================
3017 ENXIO The group or attribute is unknown/unsupported for this device
2748 or hardware support is missing.3018 or hardware support is missing.
2749 EPERM: The attribute cannot (currently) be accessed this way3019 EPERM The attribute cannot (currently) be accessed this way
2750 (e.g. read-only attribute, or attribute that only makes3020 (e.g. read-only attribute, or attribute that only makes
2751 sense when the device is in a different state)3021 sense when the device is in a different state)
3022 ===== =============================================================
2752 3023
2753 Other error conditions may be defined by individual device types.3024 Other error conditions may be defined by individual device types.
2754 3025
@@ -2757,23 +3028,30 @@ semantics are device-specific. See individual device documentation in · 2 unmodified lines
2757the "devices" directory. As with ONE_REG, the size of the data3028the "devices" directory. As with ONE_REG, the size of the data
2758transferred is defined by the particular attribute.3029transferred is defined by the particular attribute.
2759 3030
2760struct kvm_device_attr {3031::
3032
3033 struct kvm_device_attr {
2761 __u32 flags; /* no flags currently defined */3034 __u32 flags; /* no flags currently defined */
2762 __u32 group; /* device-defined */3035 __u32 group; /* device-defined */
2763 __u64 attr; /* group-defined */3036 __u64 attr; /* group-defined */
2764 __u64 addr; /* userspace address of attr data */3037 __u64 addr; /* userspace address of attr data */
2765};3038 };
2766 3039
27674.81 KVM_HAS_DEVICE_ATTR30404.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
2768 3048
2769Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device,
2770 KVM_CAP_VCPU_ATTRIBUTES for vcpu device
2771Type: device ioctl, vm ioctl, vcpu ioctl
2772Parameters: struct kvm_device_attr
2773Returns: 0 on success, -1 on error
2774Errors:3049Errors:
2775 ENXIO: The group or attribute is unknown/unsupported for this device3050
3051 ===== =============================================================
3052 ENXIO The group or attribute is unknown/unsupported for this device
2776 or hardware support is missing.3053 or hardware support is missing.
3054 ===== =============================================================
2777 3055
2778Tests whether a device supports a particular attribute. A successful3056Tests whether a device supports a particular attribute. A successful
2779return indicates the attribute is implemented. It does not necessarily3057return 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
2781current state. "addr" is ignored.3059current state. "addr" is ignored.
2782 3060
27834.82 KVM_ARM_VCPU_INIT30614.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
2784 3069
2785Capability: basic
2786Architectures: arm, arm64
2787Type: vcpu ioctl
2788Parameters: struct kvm_vcpu_init (in)
2789Returns: 0 on success; -1 on error
2790Errors:3070Errors:
2791  EINVAL:    the target is unknown, or the combination of features is invalid.3071
2792  ENOENT:    a features bit specified is unknown.3072 ====== =================================================================
3073  EINVAL    the target is unknown, or the combination of features is invalid.
3074  ENOENT    a features bit specified is unknown.
3075 ====== =================================================================
2793 3076
2794This tells KVM what type of CPU to present to the guest, and what3077This tells KVM what type of CPU to present to the guest, and what
2795optional features it should have.  This will cause a reset of the cpu3078optional 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
2805target and same set of feature flags, otherwise EINVAL will be returned.3088target and same set of feature flags, otherwise EINVAL will be returned.
2806 3089
2807Possible features:3090Possible features:
3091
2808 - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.3092 - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
2809 Depends on KVM_CAP_ARM_PSCI. If not set, the CPU will be powered on3093 Depends on KVM_CAP_ARM_PSCI. If not set, the CPU will be powered on
2810 and execute guest code when KVM_RUN is called.3094 and execute guest code when KVM_RUN is called.
@@ -2861,14 +3145,19 @@ Possible features: · 50 unmodified lines
2861 no longer be written using KVM_SET_ONE_REG.3145 no longer be written using KVM_SET_ONE_REG.
2862 3146
28634.83 KVM_ARM_PREFERRED_TARGET31474.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
2864 3155
2865Capability: basic
2866Architectures: arm, arm64
2867Type: vm ioctl
2868Parameters: struct struct kvm_vcpu_init (out)
2869Returns: 0 on success; -1 on error
2870Errors:3156Errors:
2871 ENODEV: no preferred target available for the host3157
3158 ====== ==========================================
3159 ENODEV no preferred target available for the host
3160 ====== ==========================================
2872 3161
2873This queries KVM for preferred CPU target type which can be emulated3162This queries KVM for preferred CPU target type which can be emulated
2874by KVM on underlying host.3163by KVM on underlying host.
@@ -2885,43 +3174,57 @@ in VCPU matching underlying host. · 10 unmodified lines
2885 3174
2886 3175
28874.84 KVM_GET_REG_LIST31764.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
2888 3184
2889Capability: basic
2890Architectures: arm, arm64, mips
2891Type: vcpu ioctl
2892Parameters: struct kvm_reg_list (in/out)
2893Returns: 0 on success; -1 on error
2894Errors:3185Errors:
2895  E2BIG:     the reg index list is too big to fit in the array specified by3186
3187 ===== ==============================================================
3188  E2BIG     the reg index list is too big to fit in the array specified by
2896             the user (the number required will be written into n).3189             the user (the number required will be written into n).
3190 ===== ==============================================================
3191
3192::
2897 3193
2898struct kvm_reg_list {3194 struct kvm_reg_list {
2899 __u64 n; /* number of registers in reg[] */3195 __u64 n; /* number of registers in reg[] */
2900 __u64 reg[0];3196 __u64 reg[0];
2901};3197 };
2902 3198
2903This ioctl returns the guest registers that are supported for the3199This ioctl returns the guest registers that are supported for the
2904KVM_GET_ONE_REG/KVM_SET_ONE_REG calls.3200KVM_GET_ONE_REG/KVM_SET_ONE_REG calls.
2905 3201
2906 3202
29074.85 KVM_ARM_SET_DEVICE_ADDR (deprecated)32034.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
2908 3211
2909Capability: KVM_CAP_ARM_SET_DEVICE_ADDR
2910Architectures: arm, arm64
2911Type: vm ioctl
2912Parameters: struct kvm_arm_device_address (in)
2913Returns: 0 on success, -1 on error
2914Errors:3212Errors:
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
2920 3213
2921struct 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 {
2922 __u64 id;3225 __u64 id;
2923 __u64 addr;3226 __u64 addr;
2924};3227 };
2925 3228
2926Specify a device address in the guest's physical address space where guests3229Specify a device address in the guest's physical address space where guests
2927can access emulated or directly exposed devices, which the host kernel needs3230can 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
2929specific device.3232specific device.
2930 3233
2931ARM/arm64 divides the id field into two parts, a device id and an3234ARM/arm64 divides the id field into two parts, a device id and an
2932address type id specific to the individual device.3235address type id specific to the individual device::
2933 3236
2934  bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 |3237  bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 |
2935 field: | 0x00000000 | device id | addr type id |3238 field: | 0x00000000 | device id | addr type id |
@@ -2947,12 +3250,13 @@ should be used instead. · 11 unmodified lines
2947 3250
2948 3251
29494.86 KVM_PPC_RTAS_DEFINE_TOKEN32524.86 KVM_PPC_RTAS_DEFINE_TOKEN
3253------------------------------
2950 3254
2951Capability: KVM_CAP_PPC_RTAS3255:Capability: KVM_CAP_PPC_RTAS
2952Architectures: ppc3256:Architectures: ppc
2953Type: vm ioctl3257:Type: vm ioctl
2954Parameters: struct kvm_rtas_token_args3258:Parameters: struct kvm_rtas_token_args
2955Returns: 0 on success, -1 on error3259:Returns: 0 on success, -1 on error
2956 3260
2957Defines a token value for a RTAS (Run Time Abstraction Services)3261Defines a token value for a RTAS (Run Time Abstraction Services)
2958service in order to allow it to be handled in the kernel. The3262service 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
2966handled.3270handled.
2967 3271
29684.87 KVM_SET_GUEST_DEBUG32724.87 KVM_SET_GUEST_DEBUG
3273------------------------
2969 3274
2970Capability: KVM_CAP_SET_GUEST_DEBUG3275:Capability: KVM_CAP_SET_GUEST_DEBUG
2971Architectures: x86, s390, ppc, arm643276:Architectures: x86, s390, ppc, arm64
2972Type: vcpu ioctl3277:Type: vcpu ioctl
2973Parameters: struct kvm_guest_debug (in)3278:Parameters: struct kvm_guest_debug (in)
2974Returns: 0 on success; -1 on error3279:Returns: 0 on success; -1 on error
2975 3280
2976struct kvm_guest_debug {3281::
3282
3283 struct kvm_guest_debug {
2977 __u32 control;3284 __u32 control;
2978 __u32 pad;3285 __u32 pad;
2979 struct kvm_guest_debug_arch arch;3286 struct kvm_guest_debug_arch arch;
2980};3287 };
2981 3288
2982Set up the processor specific debug registers and configure vcpu for3289Set up the processor specific debug registers and configure vcpu for
2983handling guest debug events. There are two parts to the structure, the3290handling 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
3019structure containing architecture specific debug information.3326structure containing architecture specific debug information.
3020 3327
30214.88 KVM_GET_EMULATED_CPUID33284.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
3022 3336
3023Capability: KVM_CAP_EXT_EMUL_CPUID3337::
3024Architectures: x86
3025Type: system ioctl
3026Parameters: struct kvm_cpuid2 (in/out)
3027Returns: 0 on success, -1 on error
3028 3338
3029struct kvm_cpuid2 {3339 struct kvm_cpuid2 {
3030 __u32 nent;3340 __u32 nent;
3031 __u32 flags;3341 __u32 flags;
3032 struct kvm_cpuid_entry2 entries[0];3342 struct kvm_cpuid_entry2 entries[0];
3033};3343 };
3034 3344
3035The member 'flags' is used for passing flags from userspace.3345The member 'flags' is used for passing flags from userspace.
3036 3346
3037#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)3347::
3038#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
3039#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
3040 3348
3041struct 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 {
3042 __u32 function;3354 __u32 function;
3043 __u32 index;3355 __u32 index;
3044 __u32 flags;3356 __u32 flags;
@@ -3047,7 +3359,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines
3047 __u32 ecx;3359 __u32 ecx;
3048 __u32 edx;3360 __u32 edx;
3049 __u32 padding[3];3361 __u32 padding[3];
3050};3362 };
3051 3363
3052This ioctl returns x86 cpuid features which are emulated by3364This ioctl returns x86 cpuid features which are emulated by
3053kvm.Userspace can use the information returned by this ioctl to query3365kvm.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
3072 3384
3073The fields in each entry are defined as follows:3385The fields in each entry are defined as follows:
3074 3386
3075 function: the eax value used to obtain the entry3387 function:
3076 index: the ecx value used to obtain the entry (for entries that are3388 the eax value used to obtain the entry
3389 index:
3390 the ecx value used to obtain the entry (for entries that are
3077 affected by ecx)3391 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
3079 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:3395 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
3080 if the index field is valid3396 if the index field is valid
3081 KVM_CPUID_FLAG_STATEFUL_FUNC:3397 KVM_CPUID_FLAG_STATEFUL_FUNC:
@@ -3085,24 +3401,28 @@ The fields in each entry are defined as follows: · 3 unmodified lines
3085 KVM_CPUID_FLAG_STATE_READ_NEXT:3401 KVM_CPUID_FLAG_STATE_READ_NEXT:
3086 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is3402 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
3087 the first entry to be read by a cpu3403 the first entry to be read by a cpu
3088 eax, ebx, ecx, edx: the values returned by the cpuid instruction for3404
3405 eax, ebx, ecx, edx:
3406
3407 the values returned by the cpuid instruction for
3089 this function/index combination3408 this function/index combination
3090 3409
30914.89 KVM_S390_MEM_OP34104.89 KVM_S390_MEM_OP
3411--------------------
3092 3412
3093Capability: KVM_CAP_S390_MEM_OP3413:Capability: KVM_CAP_S390_MEM_OP
3094Architectures: s3903414:Architectures: s390
3095Type: vcpu ioctl3415:Type: vcpu ioctl
3096Parameters: struct kvm_s390_mem_op (in)3416:Parameters: struct kvm_s390_mem_op (in)
3097Returns: = 0 on success,3417:Returns: = 0 on success,
3098 < 0 on generic error (e.g. -EFAULT or -ENOMEM),3418 < 0 on generic error (e.g. -EFAULT or -ENOMEM),
3099 > 0 if an exception occurred while walking the page tables3419 > 0 if an exception occurred while walking the page tables
3100 3420
3101Read or write data from/to the logical (virtual) memory of a VCPU.3421Read or write data from/to the logical (virtual) memory of a VCPU.
3102 3422
3103Parameters are specified via the following structure:3423Parameters are specified via the following structure::
3104 3424
3105struct kvm_s390_mem_op {3425 struct kvm_s390_mem_op {
3106 __u64 gaddr; /* the guest address */3426 __u64 gaddr; /* the guest address */
3107 __u64 flags; /* flags */3427 __u64 flags; /* flags */
3108 __u32 size; /* amount of bytes */3428 __u32 size; /* amount of bytes */
@@ -3110,7 +3430,7 @@ struct kvm_s390_mem_op { · 1 unmodified line
3110 __u64 buf; /* buffer in userspace */3430 __u64 buf; /* buffer in userspace */
3111 __u8 ar; /* the access register number */3431 __u8 ar; /* the access register number */
3112 __u8 reserved[31]; /* should be set to 0 */3432 __u8 reserved[31]; /* should be set to 0 */
3113};3433 };
3114 3434
3115The type of operation is specified in the "op" field. It is either3435The type of operation is specified in the "op" field. It is either
3116KVM_S390_MEMOP_LOGICAL_READ for reading from logical memory space or3436KVM_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
3137KVM with the currently defined set of flags.3457KVM with the currently defined set of flags.
3138 3458
31394.90 KVM_S390_GET_SKEYS34594.90 KVM_S390_GET_SKEYS
3460-----------------------
3140 3461
3141Capability: KVM_CAP_S390_SKEYS3462:Capability: KVM_CAP_S390_SKEYS
3142Architectures: s3903463:Architectures: s390
3143Type: vm ioctl3464:Type: vm ioctl
3144Parameters: struct kvm_s390_skeys3465:Parameters: struct kvm_s390_skeys
3145Returns: 0 on success, KVM_S390_GET_KEYS_NONE if guest is not using storage3466:Returns: 0 on success, KVM_S390_GET_KEYS_NONE if guest is not using storage
3146 keys, negative value on error3467 keys, negative value on error
3147 3468
3148This ioctl is used to get guest storage key values on the s3903469This ioctl is used to get guest storage key values on the s390
3149architecture. The ioctl takes parameters via the kvm_s390_skeys struct.3470architecture. The ioctl takes parameters via the kvm_s390_skeys struct::
3150 3471
3151struct kvm_s390_skeys {3472 struct kvm_s390_skeys {
3152 __u64 start_gfn;3473 __u64 start_gfn;
3153 __u64 count;3474 __u64 count;
3154 __u64 skeydata_addr;3475 __u64 skeydata_addr;
3155 __u32 flags;3476 __u32 flags;
3156 __u32 reserved[9];3477 __u32 reserved[9];
3157};3478 };
3158 3479
3159The start_gfn field is the number of the first guest frame whose storage keys3480The start_gfn field is the number of the first guest frame whose storage keys
3160you want to get.3481you 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
3168bytes. This buffer will be filled with storage key data by the ioctl.3489bytes. This buffer will be filled with storage key data by the ioctl.
3169 3490
31704.91 KVM_S390_SET_SKEYS34914.91 KVM_S390_SET_SKEYS
3492-----------------------
3171 3493
3172Capability: KVM_CAP_S390_SKEYS3494:Capability: KVM_CAP_S390_SKEYS
3173Architectures: s3903495:Architectures: s390
3174Type: vm ioctl3496:Type: vm ioctl
3175Parameters: struct kvm_s390_skeys3497:Parameters: struct kvm_s390_skeys
3176Returns: 0 on success, negative value on error3498:Returns: 0 on success, negative value on error
3177 3499
3178This ioctl is used to set guest storage key values on the s3903500This ioctl is used to set guest storage key values on the s390
3179architecture. The ioctl takes parameters via the kvm_s390_skeys struct.3501architecture. 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
3195the ioctl will return -EINVAL.3517the ioctl will return -EINVAL.
3196 3518
31974.92 KVM_S390_IRQ35194.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
3198 3527
3199Capability: KVM_CAP_S390_INJECT_IRQ
3200Architectures: s390
3201Type: vcpu ioctl
3202Parameters: struct kvm_s390_irq (in)
3203Returns: 0 on success, -1 on error
3204Errors:3528Errors:
3205 EINVAL: interrupt type is invalid3529
3206 type is KVM_S390_SIGP_STOP and flag parameter is invalid value3530
3531 ====== =================================================================
3532 EINVAL interrupt type is invalid
3533 type is KVM_S390_SIGP_STOP and flag parameter is invalid value,
3207 type is KVM_S390_INT_EXTERNAL_CALL and code is bigger3534 type is KVM_S390_INT_EXTERNAL_CALL and code is bigger
3208 than the maximum of VCPUs3535 than the maximum of VCPUs
3209 EBUSY: type is KVM_S390_SIGP_SET_PREFIX and vcpu is not stopped3536 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 pending3537 type is KVM_S390_SIGP_STOP and a stop irq is already pending,
3211 type is KVM_S390_INT_EXTERNAL_CALL and an external call interrupt3538 type is KVM_S390_INT_EXTERNAL_CALL and an external call interrupt
3212 is already pending3539 is already pending
3540 ====== =================================================================
3213 3541
3214Allows to inject an interrupt to the guest.3542Allows to inject an interrupt to the guest.
3215 3543
@@ -3217,9 +3545,9 @@ Using struct kvm_s390_irq as a parameter allows · 1 unmodified line
3217to inject additional payload which is not3545to inject additional payload which is not
3218possible via KVM_S390_INTERRUPT.3546possible via KVM_S390_INTERRUPT.
3219 3547
3220Interrupt parameters are passed via kvm_s390_irq:3548Interrupt parameters are passed via kvm_s390_irq::
3221 3549
3222struct kvm_s390_irq {3550 struct kvm_s390_irq {
3223 __u64 type;3551 __u64 type;
3224 union {3552 union {
3225 struct kvm_s390_io_info io;3553 struct kvm_s390_io_info io;
@@ -3232,44 +3560,45 @@ struct kvm_s390_irq { · 6 unmodified lines
3232 struct kvm_s390_mchk_info mchk;3560 struct kvm_s390_mchk_info mchk;
3233 char reserved[64];3561 char reserved[64];
3234 } u;3562 } u;
3235};3563 };
3236 3564
3237type can be one of the following:3565type can be one of the following:
3238 3566
3239KVM_S390_SIGP_STOP - sigp stop; parameter in .stop3567- KVM_S390_SIGP_STOP - sigp stop; parameter in .stop
3240KVM_S390_PROGRAM_INT - program check; parameters in .pgm3568- KVM_S390_PROGRAM_INT - program check; parameters in .pgm
3241KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix3569- KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix
3242KVM_S390_RESTART - restart; no parameters3570- KVM_S390_RESTART - restart; no parameters
3243KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters3571- KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters
3244KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters3572- KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters
3245KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg3573- KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg
3246KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall3574- KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall
3247KVM_S390_MCHK - machine check interrupt; parameters in .mchk3575- KVM_S390_MCHK - machine check interrupt; parameters in .mchk
3248 3576
3249This is an asynchronous vcpu ioctl and can be invoked from any thread.3577This is an asynchronous vcpu ioctl and can be invoked from any thread.
3250 3578
32514.94 KVM_S390_GET_IRQ_STATE35794.94 KVM_S390_GET_IRQ_STATE
3580---------------------------
3252 3581
3253Capability: KVM_CAP_S390_IRQ_STATE3582:Capability: KVM_CAP_S390_IRQ_STATE
3254Architectures: s3903583:Architectures: s390
3255Type: vcpu ioctl3584:Type: vcpu ioctl
3256Parameters: struct kvm_s390_irq_state (out)3585:Parameters: struct kvm_s390_irq_state (out)
3257Returns: >= number of bytes copied into buffer,3586:Returns: >= number of bytes copied into buffer,
3258 -EINVAL if buffer size is 0,3587 -EINVAL if buffer size is 0,
3259 -ENOBUFS if buffer size is too small to fit all pending interrupts,3588 -ENOBUFS if buffer size is too small to fit all pending interrupts,
3260 -EFAULT if the buffer address was invalid3589 -EFAULT if the buffer address was invalid
3261 3590
3262This ioctl allows userspace to retrieve the complete state of all currently3591This ioctl allows userspace to retrieve the complete state of all currently
3263pending interrupts in a single buffer. Use cases include migration3592pending interrupts in a single buffer. Use cases include migration
3264and introspection. The parameter structure contains the address of a3593and introspection. The parameter structure contains the address of a
3265userspace buffer and its length:3594userspace buffer and its length::
3266 3595
3267struct kvm_s390_irq_state {3596 struct kvm_s390_irq_state {
3268 __u64 buf;3597 __u64 buf;
3269 __u32 flags; /* will stay unused for compatibility reasons */3598 __u32 flags; /* will stay unused for compatibility reasons */
3270 __u32 len;3599 __u32 len;
3271 __u32 reserved[4]; /* will stay unused for compatibility reasons */3600 __u32 reserved[4]; /* will stay unused for compatibility reasons */
3272};3601 };
3273 3602
3274Userspace passes in the above struct and for each pending interrupt a3603Userspace passes in the above struct and for each pending interrupt a
3275struct kvm_s390_irq is copied to the provided buffer.3604struct 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
3283may retry with a bigger buffer.3612may retry with a bigger buffer.
3284 3613
32854.95 KVM_S390_SET_IRQ_STATE36144.95 KVM_S390_SET_IRQ_STATE
3286 3615---------------------------
3287Capability: KVM_CAP_S390_IRQ_STATE3616
3288Architectures: s3903617:Capability: KVM_CAP_S390_IRQ_STATE
3289Type: vcpu ioctl3618:Architectures: s390
3290Parameters: struct kvm_s390_irq_state (in)3619:Type: vcpu ioctl
3291Returns: 0 on success,3620:Parameters: struct kvm_s390_irq_state (in)
3292 -EFAULT if the buffer address was invalid,3621:Returns: 0 on success,
3293 -EINVAL for an invalid buffer length (see below),3622 -EFAULT if the buffer address was invalid,
3294 -EBUSY if there were already interrupts pending,3623 -EINVAL for an invalid buffer length (see below),
3295 errors occurring when actually injecting the3624 -EBUSY if there were already interrupts pending,
3625 errors occurring when actually injecting the
3296 interrupt. See KVM_S390_IRQ.3626 interrupt. See KVM_S390_IRQ.
3297 3627
3298This ioctl allows userspace to set the complete state of all cpu-local3628This ioctl allows userspace to set the complete state of all cpu-local
3299interrupts currently pending for the vcpu. It is intended for restoring3629interrupts currently pending for the vcpu. It is intended for restoring
3300interrupt state after a migration. The input parameter is a userspace buffer3630interrupt state after a migration. The input parameter is a userspace buffer
3301containing a struct kvm_s390_irq_state:3631containing a struct kvm_s390_irq_state::
3302 3632
3303struct kvm_s390_irq_state {3633 struct kvm_s390_irq_state {
3304 __u64 buf;3634 __u64 buf;
3305 __u32 flags; /* will stay unused for compatibility reasons */3635 __u32 flags; /* will stay unused for compatibility reasons */
3306 __u32 len;3636 __u32 len;
3307 __u32 reserved[4]; /* will stay unused for compatibility reasons */3637 __u32 reserved[4]; /* will stay unused for compatibility reasons */
3308};3638 };
3309 3639
3310The restrictions for flags and reserved apply as well.3640The restrictions for flags and reserved apply as well.
3311(see KVM_S390_GET_IRQ_STATE)3641(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
3320which is the maximum number of possibly pending cpu-local interrupts.3650which is the maximum number of possibly pending cpu-local interrupts.
3321 3651
33224.96 KVM_SMI36524.96 KVM_SMI
3653------------
3323 3654
3324Capability: KVM_CAP_X86_SMM3655:Capability: KVM_CAP_X86_SMM
3325Architectures: x863656:Architectures: x86
3326Type: vcpu ioctl3657:Type: vcpu ioctl
3327Parameters: none3658:Parameters: none
3328Returns: 0 on success, -1 on error3659:Returns: 0 on success, -1 on error
3329 3660
3330Queues an SMI on the thread's vcpu.3661Queues an SMI on the thread's vcpu.
3331 3662
33324.97 KVM_CAP_PPC_MULTITCE36634.97 KVM_CAP_PPC_MULTITCE
3664-------------------------
3333 3665
3334Capability: KVM_CAP_PPC_MULTITCE3666:Capability: KVM_CAP_PPC_MULTITCE
3335Architectures: ppc3667:Architectures: ppc
3336Type: vm3668:Type: vm
3337 3669
3338This capability means the kernel is capable of handling hypercalls3670This capability means the kernel is capable of handling hypercalls
3339H_PUT_TCE_INDIRECT and H_STUFF_TCE without passing those into the user3671H_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
3355This capability is always enabled.3687This capability is always enabled.
3356 3688
33574.98 KVM_CREATE_SPAPR_TCE_6436894.98 KVM_CREATE_SPAPR_TCE_64
3690----------------------------
3358 3691
3359Capability: KVM_CAP_SPAPR_TCE_643692:Capability: KVM_CAP_SPAPR_TCE_64
3360Architectures: powerpc3693:Architectures: powerpc
3361Type: vm ioctl3694:Type: vm ioctl
3362Parameters: struct kvm_create_spapr_tce_64 (in)3695:Parameters: struct kvm_create_spapr_tce_64 (in)
3363Returns: file descriptor for manipulating the created TCE table3696:Returns: file descriptor for manipulating the created TCE table
3364 3697
3365This is an extension for KVM_CAP_SPAPR_TCE which only supports 32bit3698This is an extension for KVM_CAP_SPAPR_TCE which only supports 32bit
3366windows, described in 4.62 KVM_CREATE_SPAPR_TCE3699windows, described in 4.62 KVM_CREATE_SPAPR_TCE
3367 3700
3368This capability uses extended struct in ioctl interface:3701This capability uses extended struct in ioctl interface::
3369 3702
3370/* for KVM_CAP_SPAPR_TCE_64 */3703 /* for KVM_CAP_SPAPR_TCE_64 */
3371struct kvm_create_spapr_tce_64 {3704 struct kvm_create_spapr_tce_64 {
3372 __u64 liobn;3705 __u64 liobn;
3373 __u32 page_shift;3706 __u32 page_shift;
3374 __u32 flags;3707 __u32 flags;
3375 __u64 offset; /* in pages */3708 __u64 offset; /* in pages */
3376 __u64 size; /* in pages */3709 __u64 size; /* in pages */
3377};3710 };
3378 3711
3379The aim of extension is to support an additional bigger DMA window with3712The aim of extension is to support an additional bigger DMA window with
3380a variable page size.3713a variable page size.
@@ -3387,12 +3720,13 @@ of IOMMU pages. · 6 unmodified lines
3387The rest of functionality is identical to KVM_CREATE_SPAPR_TCE.3720The rest of functionality is identical to KVM_CREATE_SPAPR_TCE.
3388 3721
33894.99 KVM_REINJECT_CONTROL37224.99 KVM_REINJECT_CONTROL
3723-------------------------
3390 3724
3391Capability: KVM_CAP_REINJECT_CONTROL3725:Capability: KVM_CAP_REINJECT_CONTROL
3392Architectures: x863726:Architectures: x86
3393Type: vm ioctl3727:Type: vm ioctl
3394Parameters: struct kvm_reinject_control (in)3728:Parameters: struct kvm_reinject_control (in)
3395Returns: 0 on success,3729:Returns: 0 on success,
3396 -EFAULT if struct kvm_reinject_control cannot be read,3730 -EFAULT if struct kvm_reinject_control cannot be read,
3397 -ENXIO if KVM_CREATE_PIT or KVM_CREATE_PIT2 didn't succeed earlier.3731 -ENXIO if KVM_CREATE_PIT or KVM_CREATE_PIT2 didn't succeed earlier.
3398 3732
@@ -3402,21 +3736,24 @@ vector(s) that i8254 injects. Reinject mode dequeues a tick and injects its · 3 unmodified lines
3402interrupt whenever there isn't a pending interrupt from i8254.3736interrupt whenever there isn't a pending interrupt from i8254.
3403!reinject mode injects an interrupt as soon as a tick arrives.3737!reinject mode injects an interrupt as soon as a tick arrives.
3404 3738
3405struct kvm_reinject_control {3739::
3740
3741 struct kvm_reinject_control {
3406 __u8 pit_reinject;3742 __u8 pit_reinject;
3407 __u8 reserved[31];3743 __u8 reserved[31];
3408};3744 };
3409 3745
3410pit_reinject = 0 (!reinject mode) is recommended, unless running an old3746pit_reinject = 0 (!reinject mode) is recommended, unless running an old
3411operating system that uses the PIT for timing (e.g. Linux 2.4.x).3747operating system that uses the PIT for timing (e.g. Linux 2.4.x).
3412 3748
34134.100 KVM_PPC_CONFIGURE_V3_MMU37494.100 KVM_PPC_CONFIGURE_V3_MMU
3750------------------------------
3414 3751
3415Capability: KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V33752:Capability: KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3
3416Architectures: ppc3753:Architectures: ppc
3417Type: vm ioctl3754:Type: vm ioctl
3418Parameters: struct kvm_ppc_mmuv3_cfg (in)3755:Parameters: struct kvm_ppc_mmuv3_cfg (in)
3419Returns: 0 on success,3756:Returns: 0 on success,
3420 -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read,3757 -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read,
3421 -EINVAL if the configuration is invalid3758 -EINVAL if the configuration is invalid
3422 3759
@@ -3424,10 +3761,12 @@ This ioctl controls whether the guest will use radix or HPT (hashed · 1 unmodified line
3424page table) translation, and sets the pointer to the process table for3761page table) translation, and sets the pointer to the process table for
3425the guest.3762the guest.
3426 3763
3427struct kvm_ppc_mmuv3_cfg {3764::
3765
3766 struct kvm_ppc_mmuv3_cfg {
3428 __u64 flags;3767 __u64 flags;
3429 __u64 process_table;3768 __u64 process_table;
3430};3769 };
3431 3770
3432There are two bits that can be set in flags; KVM_PPC_MMUV3_RADIX and3771There are two bits that can be set in flags; KVM_PPC_MMUV3_RADIX and
3433KVM_PPC_MMUV3_GTSE. KVM_PPC_MMUV3_RADIX, if set, configures the guest3772KVM_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
3442the Power ISA V3.00, Book III section 5.7.6.1.3781the Power ISA V3.00, Book III section 5.7.6.1.
3443 3782
34444.101 KVM_PPC_GET_RMMU_INFO37834.101 KVM_PPC_GET_RMMU_INFO
3784---------------------------
3445 3785
3446Capability: KVM_CAP_PPC_RADIX_MMU3786:Capability: KVM_CAP_PPC_RADIX_MMU
3447Architectures: ppc3787:Architectures: ppc
3448Type: vm ioctl3788:Type: vm ioctl
3449Parameters: struct kvm_ppc_rmmu_info (out)3789:Parameters: struct kvm_ppc_rmmu_info (out)
3450Returns: 0 on success,3790:Returns: 0 on success,
3451 -EFAULT if struct kvm_ppc_rmmu_info cannot be written,3791 -EFAULT if struct kvm_ppc_rmmu_info cannot be written,
3452 -EINVAL if no useful information can be returned3792 -EINVAL if no useful information can be returned
3453 3793
@@ -3456,14 +3796,16 @@ containing supported radix tree geometries, and (b) a list that maps · 2 unmodified lines
3456page sizes to put in the "AP" (actual page size) field for the tlbie3796page sizes to put in the "AP" (actual page size) field for the tlbie
3457(TLB invalidate entry) instruction.3797(TLB invalidate entry) instruction.
3458 3798
3459struct kvm_ppc_rmmu_info {3799::
3800
3801 struct kvm_ppc_rmmu_info {
3460 struct kvm_ppc_radix_geom {3802 struct kvm_ppc_radix_geom {
3461 __u8 page_shift;3803 __u8 page_shift;
3462 __u8 level_bits[4];3804 __u8 level_bits[4];
3463 __u8 pad[3];3805 __u8 pad[3];
3464 } geometries[8];3806 } geometries[8];
3465 __u32 ap_encodings[8];3807 __u32 ap_encodings[8];
3466};3808 };
3467 3809
3468The geometries[] field gives up to 8 supported geometries for the3810The geometries[] field gives up to 8 supported geometries for the
3469radix page table, in terms of the log base 2 of the smallest page3811radix 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
3476base 2 of the page size in the bottom 6 bits.3818base 2 of the page size in the bottom 6 bits.
3477 3819
34784.102 KVM_PPC_RESIZE_HPT_PREPARE38204.102 KVM_PPC_RESIZE_HPT_PREPARE
3821--------------------------------
3479 3822
3480Capability: KVM_CAP_SPAPR_RESIZE_HPT3823:Capability: KVM_CAP_SPAPR_RESIZE_HPT
3481Architectures: powerpc3824:Architectures: powerpc
3482Type: vm ioctl3825:Type: vm ioctl
3483Parameters: struct kvm_ppc_resize_hpt (in)3826:Parameters: struct kvm_ppc_resize_hpt (in)
3484Returns: 0 on successful completion,3827:Returns: 0 on successful completion,
3485 >0 if a new HPT is being prepared, the value is an estimated3828 >0 if a new HPT is being prepared, the value is an estimated
3486 number of milliseconds until preparation is complete3829 number of milliseconds until preparation is complete,
3487 -EFAULT if struct kvm_reinject_control cannot be read,3830 -EFAULT if struct kvm_reinject_control cannot be read,
3488 -EINVAL if the supplied shift or flags are invalid3831 -EINVAL if the supplied shift or flags are invalid,
3489 -ENOMEM if unable to allocate the new HPT3832 -ENOMEM if unable to allocate the new HPT,
3490 -ENOSPC if there was a hash collision when moving existing3833 -ENOSPC if there was a hash collision
3491 HPT entries to the new HPT3834
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
3846The geometries[] field gives up to 8 supported geometries for the
3847radix page table, in terms of the log base 2 of the smallest page
3848size, and the number of bits indexed at each level of the tree, from
3849the PTE level up to the PGD level in that order. Any unused entries
3850will have 0 in the page_shift field.
3851
3852The ap_encodings gives the supported page sizes and their AP field
3853encodings, encoded with the AP value in the top 3 bits and the log
3854base 2 of the page size in the bottom 6 bits.
3855
38564.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,
3492 -EIO on other error conditions3869 -EIO on other error conditions
3493 3870
3494Used to implement the PAPR extension for runtime resizing of a guest's3871Used 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
3506creates a new one as above.3883creates a new one as above.
3507 3884
3508If called when there is a pending HPT of the size requested, will:3885If called when there is a pending HPT of the size requested, will:
3886
3509 * If preparation of the pending HPT is already complete, return 03887 * If preparation of the pending HPT is already complete, return 0
3510 * If preparation of the pending HPT has failed, return an error3888 * If preparation of the pending HPT has failed, return an error
3511 code, then discard the pending HPT.3889 code, then discard the pending HPT.
@@ -3522,26 +3900,29 @@ Normally this will be called repeatedly with the same parameters until · 10 unmodified lines
3522it returns <= 0. The first call will initiate preparation, subsequent3900it returns <= 0. The first call will initiate preparation, subsequent
3523ones will monitor preparation until it completes or fails.3901ones will monitor preparation until it completes or fails.
3524 3902
3525struct kvm_ppc_resize_hpt {3903::
3904
3905 struct kvm_ppc_resize_hpt {
3526 __u64 flags;3906 __u64 flags;
3527 __u32 shift;3907 __u32 shift;
3528 __u32 pad;3908 __u32 pad;
3529};3909 };
3530 3910
35314.103 KVM_PPC_RESIZE_HPT_COMMIT39114.103 KVM_PPC_RESIZE_HPT_COMMIT
3912-------------------------------
3532 3913
3533Capability: KVM_CAP_SPAPR_RESIZE_HPT3914:Capability: KVM_CAP_SPAPR_RESIZE_HPT
3534Architectures: powerpc3915:Architectures: powerpc
3535Type: vm ioctl3916:Type: vm ioctl
3536Parameters: struct kvm_ppc_resize_hpt (in)3917:Parameters: struct kvm_ppc_resize_hpt (in)
3537Returns: 0 on successful completion,3918:Returns: 0 on successful completion,
3538 -EFAULT if struct kvm_reinject_control cannot be read,3919 -EFAULT if struct kvm_reinject_control cannot be read,
3539 -EINVAL if the supplied shift or flags are invalid3920 -EINVAL if the supplied shift or flags are invalid,
3540 -ENXIO is there is no pending HPT, or the pending HPT doesn't3921 -ENXIO is there is no pending HPT, or the pending HPT doesn't
3541 have the requested size3922 have the requested size,
3542 -EBUSY if the pending HPT is not fully prepared3923 -EBUSY if the pending HPT is not fully prepared,
3543 -ENOSPC if there was a hash collision when moving existing3924 -ENOSPC if there was a hash collision when moving existing
3544 HPT entries to the new HPT3925 HPT entries to the new HPT,
3545 -EIO on other error conditions3926 -EIO on other error conditions
3546 3927
3547Used to implement the PAPR extension for runtime resizing of a guest's3928Used 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
3564 3945
3565On failure, the guest will still be operating on its previous HPT.3946On failure, the guest will still be operating on its previous HPT.
3566 3947
3567struct kvm_ppc_resize_hpt {3948::
3949
3950 struct kvm_ppc_resize_hpt {
3568 __u64 flags;3951 __u64 flags;
3569 __u32 shift;3952 __u32 shift;
3570 __u32 pad;3953 __u32 pad;
3571};3954 };
3572 3955
35734.104 KVM_X86_GET_MCE_CAP_SUPPORTED39564.104 KVM_X86_GET_MCE_CAP_SUPPORTED
3957-----------------------------------
3574 3958
3575Capability: KVM_CAP_MCE3959:Capability: KVM_CAP_MCE
3576Architectures: x863960:Architectures: x86
3577Type: system ioctl3961:Type: system ioctl
3578Parameters: u64 mce_cap (out)3962:Parameters: u64 mce_cap (out)
3579Returns: 0 on success, -1 on error3963:Returns: 0 on success, -1 on error
3580 3964
3581Returns supported MCE capabilities. The u64 mce_cap parameter3965Returns supported MCE capabilities. The u64 mce_cap parameter
3582has the same format as the MSR_IA32_MCG_CAP register. Supported3966has the same format as the MSR_IA32_MCG_CAP register. Supported
3583capabilities will have the corresponding bits set.3967capabilities will have the corresponding bits set.
3584 3968
35854.105 KVM_X86_SETUP_MCE39694.105 KVM_X86_SETUP_MCE
3970-----------------------
3586 3971
3587Capability: KVM_CAP_MCE3972:Capability: KVM_CAP_MCE
3588Architectures: x863973:Architectures: x86
3589Type: vcpu ioctl3974:Type: vcpu ioctl
3590Parameters: u64 mcg_cap (in)3975:Parameters: u64 mcg_cap (in)
3591Returns: 0 on success,3976:Returns: 0 on success,
3592 -EFAULT if u64 mcg_cap cannot be read,3977 -EFAULT if u64 mcg_cap cannot be read,
3593 -EINVAL if the requested number of banks is invalid,3978 -EINVAL if the requested number of banks is invalid,
3594 -EINVAL if requested MCE capability is not supported.3979 -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
3601retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED.3986retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED.
3602 3987
36034.106 KVM_X86_SET_MCE39884.106 KVM_X86_SET_MCE
3989---------------------
3604 3990
3605Capability: KVM_CAP_MCE3991:Capability: KVM_CAP_MCE
3606Architectures: x863992:Architectures: x86
3607Type: vcpu ioctl3993:Type: vcpu ioctl
3608Parameters: struct kvm_x86_mce (in)3994:Parameters: struct kvm_x86_mce (in)
3609Returns: 0 on success,3995:Returns: 0 on success,
3610 -EFAULT if struct kvm_x86_mce cannot be read,3996 -EFAULT if struct kvm_x86_mce cannot be read,
3611 -EINVAL if the bank number is invalid,3997 -EINVAL if the bank number is invalid,
3612 -EINVAL if VAL bit is not set in status field.3998 -EINVAL if VAL bit is not set in status field.
3613 3999
3614Inject a machine check error (MCE) into the guest. The input4000Inject a machine check error (MCE) into the guest. The input
3615parameter is:4001parameter is::
3616 4002
3617struct kvm_x86_mce {4003 struct kvm_x86_mce {
3618 __u64 status;4004 __u64 status;
3619 __u64 addr;4005 __u64 addr;
3620 __u64 misc;4006 __u64 misc;
@@ -3622,7 +4008,7 @@ struct kvm_x86_mce { · 1 unmodified line
3622 __u8 bank;4008 __u8 bank;
3623 __u8 pad1[7];4009 __u8 pad1[7];
3624 __u64 pad2[3];4010 __u64 pad2[3];
3625};4011 };
3626 4012
3627If the MCE being reported is an uncorrected error, KVM will4013If the MCE being reported is an uncorrected error, KVM will
3628inject it as an MCE exception into the guest. If the guest4014inject 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
3634not holding a previously reported uncorrected error).4020not holding a previously reported uncorrected error).
3635 4021
36364.107 KVM_S390_GET_CMMA_BITS40224.107 KVM_S390_GET_CMMA_BITS
4023----------------------------
3637 4024
3638Capability: KVM_CAP_S390_CMMA_MIGRATION4025:Capability: KVM_CAP_S390_CMMA_MIGRATION
3639Architectures: s3904026:Architectures: s390
3640Type: vm ioctl4027:Type: vm ioctl
3641Parameters: struct kvm_s390_cmma_log (in, out)4028:Parameters: struct kvm_s390_cmma_log (in, out)
3642Returns: 0 on success, a negative value on error4029:Returns: 0 on success, a negative value on error
3643 4030
3644This ioctl is used to get the values of the CMMA bits on the s3904031This ioctl is used to get the values of the CMMA bits on the s390
3645architecture. It is meant to be used in two scenarios:4032architecture. It is meant to be used in two scenarios:
4033
3646- During live migration to save the CMMA values. Live migration needs4034- During live migration to save the CMMA values. Live migration needs
3647 to be enabled via the KVM_REQ_START_MIGRATION VM property.4035 to be enabled via the KVM_REQ_START_MIGRATION VM property.
3648- To non-destructively peek at the CMMA values, with the flag4036- 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
3652values are written to a buffer whose location is indicated via the "values"4040values are written to a buffer whose location is indicated via the "values"
3653member in the kvm_s390_cmma_log struct. The values in the input struct are4041member in the kvm_s390_cmma_log struct. The values in the input struct are
3654also updated as needed.4042also updated as needed.
4043
3655Each CMMA value takes up one byte.4044Each CMMA value takes up one byte.
3656 4045
3657struct kvm_s390_cmma_log {4046::
4047
4048 struct kvm_s390_cmma_log {
3658 __u64 start_gfn;4049 __u64 start_gfn;
3659 __u32 count;4050 __u32 count;
3660 __u32 flags;4051 __u32 flags;
@@ -3663,7 +4054,7 @@ struct kvm_s390_cmma_log { · 2 unmodified lines
3663 __u64 mask;4054 __u64 mask;
3664 };4055 };
3665 __u64 values;4056 __u64 values;
3666};4057 };
3667 4058
3668start_gfn is the number of the first guest frame whose CMMA values are4059start_gfn is the number of the first guest frame whose CMMA values are
3669to be retrieved,4060to be retrieved,
@@ -3724,12 +4115,13 @@ KVM_S390_CMMA_PEEK is not set but migration mode was not enabled, with · 54 unmodified lines
3724present for the addresses (e.g. when using hugepages).4115present for the addresses (e.g. when using hugepages).
3725 4116
37264.108 KVM_S390_SET_CMMA_BITS41174.108 KVM_S390_SET_CMMA_BITS
4118----------------------------
3727 4119
3728Capability: KVM_CAP_S390_CMMA_MIGRATION4120:Capability: KVM_CAP_S390_CMMA_MIGRATION
3729Architectures: s3904121:Architectures: s390
3730Type: vm ioctl4122:Type: vm ioctl
3731Parameters: struct kvm_s390_cmma_log (in)4123:Parameters: struct kvm_s390_cmma_log (in)
3732Returns: 0 on success, a negative value on error4124:Returns: 0 on success, a negative value on error
3733 4125
3734This ioctl is used to set the values of the CMMA bits on the s3904126This ioctl is used to set the values of the CMMA bits on the s390
3735architecture. It is meant to be used during live migration to restore4127architecture. 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
3737The ioctl takes parameters via the kvm_s390_cmma_values struct.4129The ioctl takes parameters via the kvm_s390_cmma_values struct.
3738Each CMMA value takes up one byte.4130Each CMMA value takes up one byte.
3739 4131
3740struct kvm_s390_cmma_log {4132::
4133
4134 struct kvm_s390_cmma_log {
3741 __u64 start_gfn;4135 __u64 start_gfn;
3742 __u32 count;4136 __u32 count;
3743 __u32 flags;4137 __u32 flags;
3744 union {4138 union {
3745 __u64 remaining;4139 __u64 remaining;
3746 __u64 mask;4140 __u64 mask;
3747 };4141 };
3748 __u64 values;4142 __u64 values;
3749};4143 };
3750 4144
3751start_gfn indicates the starting guest frame number,4145start_gfn indicates the starting guest frame number,
3752 4146
@@ -3769,26 +4163,27 @@ or if no page table is present for the addresses (e.g. when using · 16 unmodified lines
3769hugepages).4163hugepages).
3770 4164
37714.109 KVM_PPC_GET_CPU_CHAR41654.109 KVM_PPC_GET_CPU_CHAR
4166--------------------------
3772 4167
3773Capability: KVM_CAP_PPC_GET_CPU_CHAR4168:Capability: KVM_CAP_PPC_GET_CPU_CHAR
3774Architectures: powerpc4169:Architectures: powerpc
3775Type: vm ioctl4170:Type: vm ioctl
3776Parameters: struct kvm_ppc_cpu_char (out)4171:Parameters: struct kvm_ppc_cpu_char (out)
3777Returns: 0 on successful completion4172:Returns: 0 on successful completion,
3778 -EFAULT if struct kvm_ppc_cpu_char cannot be written4173 -EFAULT if struct kvm_ppc_cpu_char cannot be written
3779 4174
3780This ioctl gives userspace information about certain characteristics4175This ioctl gives userspace information about certain characteristics
3781of the CPU relating to speculative execution of instructions and4176of the CPU relating to speculative execution of instructions and
3782possible information leakage resulting from speculative execution (see4177possible information leakage resulting from speculative execution (see
3783CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is4178CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is
3784returned in struct kvm_ppc_cpu_char, which looks like this:4179returned in struct kvm_ppc_cpu_char, which looks like this::
3785 4180
3786struct kvm_ppc_cpu_char {4181 struct kvm_ppc_cpu_char {
3787 __u64 character; /* characteristics of the CPU */4182 __u64 character; /* characteristics of the CPU */
3788 __u64 behaviour; /* recommended software behaviour */4183 __u64 behaviour; /* recommended software behaviour */
3789 __u64 character_mask; /* valid bits in character */4184 __u64 character_mask; /* valid bits in character */
3790 __u64 behaviour_mask; /* valid bits in behaviour */4185 __u64 behaviour_mask; /* valid bits in behaviour */
3791};4186 };
3792 4187
3793For extensibility, the character_mask and behaviour_mask fields4188For extensibility, the character_mask and behaviour_mask fields
3794indicate which bits of character and behaviour have been filled in by4189indicate 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
3815H_GET_CPU_CHARACTERISTICS hypercall.4210H_GET_CPU_CHARACTERISTICS hypercall.
3816 4211
38174.110 KVM_MEMORY_ENCRYPT_OP42124.110 KVM_MEMORY_ENCRYPT_OP
4213---------------------------
3818 4214
3819Capability: basic4215:Capability: basic
3820Architectures: x864216:Architectures: x86
3821Type: system4217:Type: system
3822Parameters: an opaque platform specific structure (in/out)4218:Parameters: an opaque platform specific structure (in/out)
3823Returns: 0 on success; -1 on error4219:Returns: 0 on success; -1 on error
3824 4220
3825If the platform supports creating encrypted VMs then this ioctl can be used4221If the platform supports creating encrypted VMs then this ioctl can be used
3826for issuing platform-specific memory encryption commands to manage those4222for 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
3831Documentation/virt/kvm/amd-memory-encryption.rst.4227Documentation/virt/kvm/amd-memory-encryption.rst.
3832 4228
38334.111 KVM_MEMORY_ENCRYPT_REG_REGION42294.111 KVM_MEMORY_ENCRYPT_REG_REGION
4230-----------------------------------
3834 4231
3835Capability: basic4232:Capability: basic
3836Architectures: x864233:Architectures: x86
3837Type: system4234:Type: system
3838Parameters: struct kvm_enc_region (in)4235:Parameters: struct kvm_enc_region (in)
3839Returns: 0 on success; -1 on error4236:Returns: 0 on success; -1 on error
3840 4237
3841This ioctl can be used to register a guest memory region which may4238This ioctl can be used to register a guest memory region which may
3842contain encrypted data (e.g. guest RAM, SMRAM etc).4239contain 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
3854memory region registered with the ioctl.4251memory region registered with the ioctl.
3855 4252
38564.112 KVM_MEMORY_ENCRYPT_UNREG_REGION42534.112 KVM_MEMORY_ENCRYPT_UNREG_REGION
4254-------------------------------------
3857 4255
3858Capability: basic4256:Capability: basic
3859Architectures: x864257:Architectures: x86
3860Type: system4258:Type: system
3861Parameters: struct kvm_enc_region (in)4259:Parameters: struct kvm_enc_region (in)
3862Returns: 0 on success; -1 on error4260:Returns: 0 on success; -1 on error
3863 4261
3864This ioctl can be used to unregister the guest memory region registered4262This ioctl can be used to unregister the guest memory region registered
3865with KVM_MEMORY_ENCRYPT_REG_REGION ioctl above.4263with KVM_MEMORY_ENCRYPT_REG_REGION ioctl above.
3866 4264
38674.113 KVM_HYPERV_EVENTFD42654.113 KVM_HYPERV_EVENTFD
4266------------------------
3868 4267
3869Capability: KVM_CAP_HYPERV_EVENTFD4268:Capability: KVM_CAP_HYPERV_EVENTFD
3870Architectures: x864269:Architectures: x86
3871Type: vm ioctl4270:Type: vm ioctl
3872Parameters: struct kvm_hyperv_eventfd (in)4271:Parameters: struct kvm_hyperv_eventfd (in)
3873 4272
3874This ioctl (un)registers an eventfd to receive notifications from the guest on4273This ioctl (un)registers an eventfd to receive notifications from the guest on
3875the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without4274the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without
3876causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number4275causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number
3877(bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit.4276(bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit.
3878 4277
3879struct kvm_hyperv_eventfd {4278::
4279
4280 struct kvm_hyperv_eventfd {
3880 __u32 conn_id;4281 __u32 conn_id;
3881 __s32 fd;4282 __s32 fd;
3882 __u32 flags;4283 __u32 flags;
3883 __u32 padding[3];4284 __u32 padding[3];
3884};4285 };
3885 4286
3886The conn_id field should fit within 24 bits:4287The conn_id field should fit within 24 bits::
3887 4288
3888#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff4289 #define KVM_HYPERV_CONN_ID_MASK 0x00ffffff
3889 4290
3890The acceptable values for the flags field are:4291The acceptable values for the flags field are::
3891 4292
3892#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)4293 #define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
3893 4294
3894Returns: 0 on success,4295:Returns: 0 on success,
3895 -EINVAL if conn_id or flags is outside the allowed range4296 -EINVAL if conn_id or flags is outside the allowed range,
3896 -ENOENT on deassign if the conn_id isn't registered4297 -ENOENT on deassign if the conn_id isn't registered,
3897 -EEXIST on assign if the conn_id is already registered4298 -EEXIST on assign if the conn_id is already registered
3898 4299
38994.114 KVM_GET_NESTED_STATE43004.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
3900 4308
3901Capability: KVM_CAP_NESTED_STATE
3902Architectures: x86
3903Type: vcpu ioctl
3904Parameters: struct kvm_nested_state (in/out)
3905Returns: 0 on success, -1 on error
3906Errors:4309Errors:
3907 E2BIG: the total state size exceeds the value of 'size' specified by4310
4311 ===== =============================================================
4312 E2BIG the total state size exceeds the value of 'size' specified by
3908 the user; the size required will be written into size.4313 the user; the size required will be written into size.
4314 ===== =============================================================
4315
4316::
3909 4317
3910struct kvm_nested_state {4318 struct kvm_nested_state {
3911 __u16 flags;4319 __u16 flags;
3912 __u16 format;4320 __u16 format;
3913 __u32 size;4321 __u32 size;
@@ -3924,33 +4332,33 @@ struct kvm_nested_state { · 10 unmodified lines
3924 struct kvm_vmx_nested_state_data vmx[0];4332 struct kvm_vmx_nested_state_data vmx[0];
3925 struct kvm_svm_nested_state_data svm[0];4333 struct kvm_svm_nested_state_data svm[0];
3926 } data;4334 } data;
3927};4335 };
3928 4336
3929#define KVM_STATE_NESTED_GUEST_MODE 0x000000014337 #define KVM_STATE_NESTED_GUEST_MODE 0x00000001
3930#define KVM_STATE_NESTED_RUN_PENDING 0x000000024338 #define KVM_STATE_NESTED_RUN_PENDING 0x00000002
3931#define KVM_STATE_NESTED_EVMCS 0x000000044339 #define KVM_STATE_NESTED_EVMCS 0x00000004
3932 4340
3933#define KVM_STATE_NESTED_FORMAT_VMX 04341 #define KVM_STATE_NESTED_FORMAT_VMX 0
3934#define KVM_STATE_NESTED_FORMAT_SVM 14342 #define KVM_STATE_NESTED_FORMAT_SVM 1
3935 4343
3936#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x10004344 #define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
3937 4345
3938#define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x000000014346 #define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001
3939#define KVM_STATE_NESTED_VMX_SMM_VMXON 0x000000024347 #define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002
3940 4348
3941struct kvm_vmx_nested_state_hdr {4349 struct kvm_vmx_nested_state_hdr {
3942 __u64 vmxon_pa;4350 __u64 vmxon_pa;
3943 __u64 vmcs12_pa;4351 __u64 vmcs12_pa;
3944 4352
3945 struct {4353 struct {
3946 __u16 flags;4354 __u16 flags;
3947 } smm;4355 } smm;
3948};4356 };
3949 4357
3950struct kvm_vmx_nested_state_data {4358 struct kvm_vmx_nested_state_data {
3951 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];4359 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
3952 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];4360 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
3953};4361 };
3954 4362
3955This ioctl copies the vcpu's nested virtualization state from the kernel to4363This ioctl copies the vcpu's nested virtualization state from the kernel to
3956userspace.4364userspace.
@@ -3959,24 +4367,26 @@ The maximum size of the state can be retrieved by passing KVM_CAP_NESTED_STATE · 2 unmodified lines
3959to the KVM_CHECK_EXTENSION ioctl().4367to the KVM_CHECK_EXTENSION ioctl().
3960 4368
39614.115 KVM_SET_NESTED_STATE43694.115 KVM_SET_NESTED_STATE
4370--------------------------
3962 4371
3963Capability: KVM_CAP_NESTED_STATE4372:Capability: KVM_CAP_NESTED_STATE
3964Architectures: x864373:Architectures: x86
3965Type: vcpu ioctl4374:Type: vcpu ioctl
3966Parameters: struct kvm_nested_state (in)4375:Parameters: struct kvm_nested_state (in)
3967Returns: 0 on success, -1 on error4376:Returns: 0 on success, -1 on error
3968 4377
3969This copies the vcpu's kvm_nested_state struct from userspace to the kernel.4378This copies the vcpu's kvm_nested_state struct from userspace to the kernel.
3970For the definition of struct kvm_nested_state, see KVM_GET_NESTED_STATE.4379For the definition of struct kvm_nested_state, see KVM_GET_NESTED_STATE.
3971 4380
39724.116 KVM_(UN)REGISTER_COALESCED_MMIO43814.116 KVM_(UN)REGISTER_COALESCED_MMIO
4382-------------------------------------
3973 4383
3974Capability: KVM_CAP_COALESCED_MMIO (for coalesced mmio)4384:Capability: KVM_CAP_COALESCED_MMIO (for coalesced mmio)
3975 KVM_CAP_COALESCED_PIO (for coalesced pio)4385 KVM_CAP_COALESCED_PIO (for coalesced pio)
3976Architectures: all4386:Architectures: all
3977Type: vm ioctl4387:Type: vm ioctl
3978Parameters: struct kvm_coalesced_mmio_zone4388:Parameters: struct kvm_coalesced_mmio_zone
3979Returns: 0 on success, < 0 on error4389:Returns: 0 on success, < 0 on error
3980 4390
3981Coalesced I/O is a performance optimization that defers hardware4391Coalesced I/O is a performance optimization that defers hardware
3982register write emulation so that userspace exits are avoided. It is4392register 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
3998to I/O ports.4408to I/O ports.
3999 4409
40004.117 KVM_CLEAR_DIRTY_LOG (vm ioctl)44104.117 KVM_CLEAR_DIRTY_LOG (vm ioctl)
4411------------------------------------
4001 4412
4002Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT24413:Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2
4003Architectures: x86, arm, arm64, mips4414:Architectures: x86, arm, arm64, mips
4004Type: vm ioctl4415:Type: vm ioctl
4005Parameters: struct kvm_dirty_log (in)4416:Parameters: struct kvm_dirty_log (in)
4006Returns: 0 on success, -1 on error4417:Returns: 0 on success, -1 on error
4007 4418
4008/* for KVM_CLEAR_DIRTY_LOG */4419::
4009struct kvm_clear_dirty_log {4420
4421 /* for KVM_CLEAR_DIRTY_LOG */
4422 struct kvm_clear_dirty_log {
4010 __u32 slot;4423 __u32 slot;
4011 __u32 num_pages;4424 __u32 num_pages;
4012 __u64 first_page;4425 __u64 first_page;
@@ -4014,7 +4427,7 @@ struct kvm_clear_dirty_log { · 1 unmodified line
4014 void __user *dirty_bitmap; /* one bit per page */4427 void __user *dirty_bitmap; /* one bit per page */
4015 __u64 padding;4428 __u64 padding;
4016 };4429 };
4017};4430 };
4018 4431
4019The ioctl clears the dirty status of pages in a memory slot, according to4432The ioctl clears the dirty status of pages in a memory slot, according to
4020the bitmap that is passed in struct kvm_clear_dirty_log's dirty_bitmap4433the 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
4038that KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is present.4451that KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is present.
4039 4452
40404.118 KVM_GET_SUPPORTED_HV_CPUID44534.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
4041 4461
4042Capability: KVM_CAP_HYPERV_CPUID4462::
4043Architectures: x86
4044Type: vcpu ioctl
4045Parameters: struct kvm_cpuid2 (in/out)
4046Returns: 0 on success, -1 on error
4047 4463
4048struct kvm_cpuid2 {4464 struct kvm_cpuid2 {
4049 __u32 nent;4465 __u32 nent;
4050 __u32 padding;4466 __u32 padding;
4051 struct kvm_cpuid_entry2 entries[0];4467 struct kvm_cpuid_entry2 entries[0];
4052};4468 };
4053 4469
4054struct kvm_cpuid_entry2 {4470 struct kvm_cpuid_entry2 {
4055 __u32 function;4471 __u32 function;
4056 __u32 index;4472 __u32 index;
4057 __u32 flags;4473 __u32 flags;
@@ -4060,7 +4476,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines
4060 __u32 ecx;4476 __u32 ecx;
4061 __u32 edx;4477 __u32 edx;
4062 __u32 padding[3];4478 __u32 padding[3];
4063};4479 };
4064 4480
4065This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in4481This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in
4066KVM. Userspace can use the information returned by this ioctl to construct4482KVM. 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
4073leaves (0x40000000, 0x40000001).4489leaves (0x40000000, 0x40000001).
4074 4490
4075Currently, the following list of CPUID leaves are returned:4491Currently, the following list of CPUID leaves are returned:
4076 HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS4492 - HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
4077 HYPERV_CPUID_INTERFACE4493 - HYPERV_CPUID_INTERFACE
4078 HYPERV_CPUID_VERSION4494 - HYPERV_CPUID_VERSION
4079 HYPERV_CPUID_FEATURES4495 - HYPERV_CPUID_FEATURES
4080 HYPERV_CPUID_ENLIGHTMENT_INFO4496 - HYPERV_CPUID_ENLIGHTMENT_INFO
4081 HYPERV_CPUID_IMPLEMENT_LIMITS4497 - HYPERV_CPUID_IMPLEMENT_LIMITS
4082 HYPERV_CPUID_NESTED_FEATURES4498 - HYPERV_CPUID_NESTED_FEATURES
4083 4499
4084HYPERV_CPUID_NESTED_FEATURES leaf is only exposed when Enlightened VMCS was4500HYPERV_CPUID_NESTED_FEATURES leaf is only exposed when Enlightened VMCS was
4085enabled on the corresponding vCPU (KVM_CAP_HYPERV_ENLIGHTENED_VMCS).4501enabled 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
4095userspace should not expect to get any particular value there.4511userspace should not expect to get any particular value there.
4096 4512
40974.119 KVM_ARM_VCPU_FINALIZE45134.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
4098 4520
4099Architectures: arm, arm64
4100Type: vcpu ioctl
4101Parameters: int feature (in)
4102Returns: 0 on success, -1 on error
4103Errors:4521Errors:
4104 EPERM: feature not enabled, needs configuration, or already finalized4522
4105 EINVAL: feature unknown or not present4523 ====== ==============================================================
4524 EPERM feature not enabled, needs configuration, or already finalized
4525 EINVAL feature unknown or not present
4526 ====== ==============================================================
4106 4527
4107Recognised values for feature:4528Recognised values for feature:
4529
4530 ===== ===========================================
4108 arm64 KVM_ARM_VCPU_SVE (requires KVM_CAP_ARM_SVE)4531 arm64 KVM_ARM_VCPU_SVE (requires KVM_CAP_ARM_SVE)
4532 ===== ===========================================
4109 4533
4110Finalizes the configuration of the specified vcpu feature.4534Finalizes the configuration of the specified vcpu feature.
4111 4535
@@ -4129,21 +4553,24 @@ See KVM_ARM_VCPU_INIT for details of vcpu features that require finalization · 17 unmodified lines
4129using this ioctl.4553using this ioctl.
4130 4554
41314.120 KVM_SET_PMU_EVENT_FILTER45554.120 KVM_SET_PMU_EVENT_FILTER
4556------------------------------
4132 4557
4133Capability: KVM_CAP_PMU_EVENT_FILTER4558:Capability: KVM_CAP_PMU_EVENT_FILTER
4134Architectures: x864559:Architectures: x86
4135Type: vm ioctl4560:Type: vm ioctl
4136Parameters: struct kvm_pmu_event_filter (in)4561:Parameters: struct kvm_pmu_event_filter (in)
4137Returns: 0 on success, -1 on error4562:Returns: 0 on success, -1 on error
4138 4563
4139struct kvm_pmu_event_filter {4564::
4565
4566 struct kvm_pmu_event_filter {
4140 __u32 action;4567 __u32 action;
4141 __u32 nevents;4568 __u32 nevents;
4142 __u32 fixed_counter_bitmap;4569 __u32 fixed_counter_bitmap;
4143 __u32 flags;4570 __u32 flags;
4144 __u32 pad[4];4571 __u32 pad[4];
4145 __u64 events[0];4572 __u64 events[0];
4146};4573 };
4147 4574
4148This ioctl restricts the set of PMU events that the guest can program.4575This ioctl restricts the set of PMU events that the guest can program.
4149The argument holds a list of events which will be allowed or denied.4576The 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
4154 4581
4155No flags are defined yet, the field must be zero.4582No flags are defined yet, the field must be zero.
4156 4583
4157Valid values for 'action':4584Valid values for 'action'::
4158#define KVM_PMU_EVENT_ALLOW 04585
4159#define KVM_PMU_EVENT_DENY 14586 #define KVM_PMU_EVENT_ALLOW 0
4587 #define KVM_PMU_EVENT_DENY 1
4160 4588
41614.121 KVM_PPC_SVM_OFF45894.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,
4162 4597
4163Capability: basic
4164Architectures: powerpc
4165Type: vm ioctl
4166Parameters: none
4167Returns: 0 on successful completion,
4168Errors:4598Errors:
4169 EINVAL: if ultravisor failed to terminate the secure guest4599
4170 ENOMEM: if hypervisor failed to allocate new radix page tables for guest4600 ====== ================================================================
4601 EINVAL if ultravisor failed to terminate the secure guest
4602 ENOMEM if hypervisor failed to allocate new radix page tables for guest
4603 ====== ================================================================
4171 4604
4172This ioctl is used to turn off the secure mode of the guest or transition4605This ioctl is used to turn off the secure mode of the guest or transition
4173the guest from secure mode to normal mode. This is invoked when the guest4606the 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
4178track the secure pages by hypervisor.4611track the secure pages by hypervisor.
4179 4612
41804.122 KVM_S390_NORMAL_RESET46134.122 KVM_S390_NORMAL_RESET
4614---------------------------
4181 4615
4182Capability: KVM_CAP_S390_VCPU_RESETS4616:Capability: KVM_CAP_S390_VCPU_RESETS
4183Architectures: s3904617:Architectures: s390
4184Type: vcpu ioctl4618:Type: vcpu ioctl
4185Parameters: none4619:Parameters: none
4186Returns: 04620:Returns: 0
4187 4621
4188This ioctl resets VCPU registers and control structures according to4622This ioctl resets VCPU registers and control structures according to
4189the cpu reset definition in the POP (Principles Of Operation).4623the cpu reset definition in the POP (Principles Of Operation).
4190 4624
41914.123 KVM_S390_INITIAL_RESET46254.123 KVM_S390_INITIAL_RESET
4626----------------------------
4192 4627
4193Capability: none4628:Capability: none
4194Architectures: s3904629:Architectures: s390
4195Type: vcpu ioctl4630:Type: vcpu ioctl
4196Parameters: none4631:Parameters: none
4197Returns: 04632:Returns: 0
4198 4633
4199This ioctl resets VCPU registers and control structures according to4634This ioctl resets VCPU registers and control structures according to
4200the initial cpu reset definition in the POP. However, the cpu is not4635the initial cpu reset definition in the POP. However, the cpu is not
4201put into ESA mode. This reset is a superset of the normal reset.4636put into ESA mode. This reset is a superset of the normal reset.
4202 4637
42034.124 KVM_S390_CLEAR_RESET46384.124 KVM_S390_CLEAR_RESET
4639--------------------------
4204 4640
4205Capability: KVM_CAP_S390_VCPU_RESETS4641:Capability: KVM_CAP_S390_VCPU_RESETS
4206Architectures: s3904642:Architectures: s390
4207Type: vcpu ioctl4643:Type: vcpu ioctl
4208Parameters: none4644:Parameters: none
4209Returns: 04645:Returns: 0
4210 4646
4211This ioctl resets VCPU registers and control structures according to4647This ioctl resets VCPU registers and control structures according to
4212the clear cpu reset definition in the POP. However, the cpu is not put4648the 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
4214 4650
4215 4651
42165. The kvm_run structure46525. The kvm_run structure
4217------------------------4653========================
4218 4654
4219Application code obtains a pointer to the kvm_run structure by4655Application code obtains a pointer to the kvm_run structure by
4220mmap()ing a vcpu fd. From that point, application code can control4656mmap()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
4222ioctl, and obtain information about the reason KVM_RUN returned by4658ioctl, and obtain information about the reason KVM_RUN returned by
4223looking up structure members.4659looking up structure members.
4224 4660
4225struct kvm_run {4661::
4662
4663 struct kvm_run {
4226 /* in */4664 /* in */
4227 __u8 request_interrupt_window;4665 __u8 request_interrupt_window;
4228 4666
4229Request that KVM_RUN return when it becomes possible to inject external4667Request that KVM_RUN return when it becomes possible to inject external
4230interrupts into the guest. Useful in conjunction with KVM_INTERRUPT.4668interrupts into the guest. Useful in conjunction with KVM_INTERRUPT.
4231 4669
4670::
4671
4232 __u8 immediate_exit;4672 __u8 immediate_exit;
4233 4673
4234This field is polled once when KVM_RUN starts; if non-zero, KVM_RUN4674This 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
4240 4680
4241This field is ignored if KVM_CAP_IMMEDIATE_EXIT is not available.4681This field is ignored if KVM_CAP_IMMEDIATE_EXIT is not available.
4242 4682
4683::
4684
4243 __u8 padding1[6];4685 __u8 padding1[6];
4244 4686
4245 /* out */4687 /* out */
@@ -4249,16 +4691,22 @@ When KVM_RUN has returned successfully (return value 0), this informs · 3 unmodified lines
4249application code why KVM_RUN has returned. Allowable values for this4691application code why KVM_RUN has returned. Allowable values for this
4250field are detailed below.4692field are detailed below.
4251 4693
4694::
4695
4252 __u8 ready_for_interrupt_injection;4696 __u8 ready_for_interrupt_injection;
4253 4697
4254If request_interrupt_window has been specified, this field indicates4698If request_interrupt_window has been specified, this field indicates
4255an interrupt can be injected now with KVM_INTERRUPT.4699an interrupt can be injected now with KVM_INTERRUPT.
4256 4700
4701::
4702
4257 __u8 if_flag;4703 __u8 if_flag;
4258 4704
4259The value of the current interrupt flag. Only valid if in-kernel4705The value of the current interrupt flag. Only valid if in-kernel
4260local APIC is not used.4706local APIC is not used.
4261 4707
4708::
4709
4262 __u16 flags;4710 __u16 flags;
4263 4711
4264More architecture-specific flags detailing state of the VCPU that may4712More 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
4266KVM_RUN_X86_SMM, which is valid on x86 machines and is set if the4714KVM_RUN_X86_SMM, which is valid on x86 machines and is set if the
4267VCPU is in system management mode.4715VCPU is in system management mode.
4268 4716
4717::
4718
4269 /* in (pre_kvm_run), out (post_kvm_run) */4719 /* in (pre_kvm_run), out (post_kvm_run) */
4270 __u64 cr8;4720 __u64 cr8;
4271 4721
4272The value of the cr8 register. Only valid if in-kernel local APIC is4722The value of the cr8 register. Only valid if in-kernel local APIC is
4273not used. Both input and output.4723not used. Both input and output.
4274 4724
4725::
4726
4275 __u64 apic_base;4727 __u64 apic_base;
4276 4728
4277The value of the APIC BASE msr. Only valid if in-kernel local4729The value of the APIC BASE msr. Only valid if in-kernel local
4278APIC is not used. Both input and output.4730APIC is not used. Both input and output.
4279 4731
4732::
4733
4280 union {4734 union {
4281 /* KVM_EXIT_UNKNOWN */4735 /* KVM_EXIT_UNKNOWN */
4282 struct {4736 struct {
@@ -4287,6 +4741,8 @@ If exit_reason is KVM_EXIT_UNKNOWN, the vcpu has exited due to unknown · 4 unmodified lines
4287reasons. Further architecture-specific information is available in4741reasons. Further architecture-specific information is available in
4288hardware_exit_reason.4742hardware_exit_reason.
4289 4743
4744::
4745
4290 /* KVM_EXIT_FAIL_ENTRY */4746 /* KVM_EXIT_FAIL_ENTRY */
4291 struct {4747 struct {
4292 __u64 hardware_entry_failure_reason;4748 __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
4296to unknown reasons. Further architecture-specific information is4752to unknown reasons. Further architecture-specific information is
4297available in hardware_entry_failure_reason.4753available in hardware_entry_failure_reason.
4298 4754
4755::
4756
4299 /* KVM_EXIT_EXCEPTION */4757 /* KVM_EXIT_EXCEPTION */
4300 struct {4758 struct {
4301 __u32 exception;4759 __u32 exception;
@@ -4304,10 +4762,12 @@ available in hardware_entry_failure_reason. · 2 unmodified lines
4304 4762
4305Unused.4763Unused.
4306 4764
4765::
4766
4307 /* KVM_EXIT_IO */4767 /* KVM_EXIT_IO */
4308 struct {4768 struct {
4309#define KVM_EXIT_IO_IN 04769 #define KVM_EXIT_IO_IN 0
4310#define KVM_EXIT_IO_OUT 14770 #define KVM_EXIT_IO_OUT 1
4311 __u8 direction;4771 __u8 direction;
4312 __u8 size; /* bytes */4772 __u8 size; /* bytes */
4313 __u16 port;4773 __u16 port;
@@ -4321,6 +4781,8 @@ data_offset describes where the data is located (KVM_EXIT_IO_OUT) or · 7 unmodified lines
4321where kvm expects application code to place the data for the next4781where kvm expects application code to place the data for the next
4322KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array.4782KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array.
4323 4783
4784::
4785
4324 /* KVM_EXIT_DEBUG */4786 /* KVM_EXIT_DEBUG */
4325 struct {4787 struct {
4326 struct kvm_debug_exit_arch arch;4788 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
4329If the exit_reason is KVM_EXIT_DEBUG, then a vcpu is processing a debug event4791If the exit_reason is KVM_EXIT_DEBUG, then a vcpu is processing a debug event
4330for which architecture specific information is returned.4792for which architecture specific information is returned.
4331 4793
4794::
4795
4332 /* KVM_EXIT_MMIO */4796 /* KVM_EXIT_MMIO */
4333 struct {4797 struct {
4334 __u64 phys_addr;4798 __u64 phys_addr;
@@ -4346,14 +4810,19 @@ The 'data' member contains, in its first 'len' bytes, the value as it would · 11 unmodified lines
4346appear if the VCPU performed a load or store of the appropriate width directly4810appear if the VCPU performed a load or store of the appropriate width directly
4347to the byte array.4811to the byte array.
4348 4812
4349NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR and4813.. note::
4814
4815 For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR and
4350 KVM_EXIT_EPR the corresponding4816 KVM_EXIT_EPR the corresponding
4817
4351operations are complete (and guest state is consistent) only after userspace4818operations are complete (and guest state is consistent) only after userspace
4352has re-entered the kernel with KVM_RUN. The kernel side will first finish4819has re-entered the kernel with KVM_RUN. The kernel side will first finish
4353incomplete operations and then check for pending signals. Userspace4820incomplete operations and then check for pending signals. Userspace
4354can re-enter the guest with an unmasked signal pending to complete4821can re-enter the guest with an unmasked signal pending to complete
4355pending operations.4822pending operations.
4356 4823
4824::
4825
4357 /* KVM_EXIT_HYPERCALL */4826 /* KVM_EXIT_HYPERCALL */
4358 struct {4827 struct {
4359 __u64 nr;4828 __u64 nr;
@@ -4365,7 +4834,10 @@ pending operations. · 5 unmodified lines
4365 4834
4366Unused. This was once used for 'hypercall to userspace'. To implement4835Unused. This was once used for 'hypercall to userspace'. To implement
4367such functionality, use KVM_EXIT_IO (x86) or KVM_EXIT_MMIO (all except s390).4836such functionality, use KVM_EXIT_IO (x86) or KVM_EXIT_MMIO (all except s390).
4368Note 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::
4369 4841
4370 /* KVM_EXIT_TPR_ACCESS */4842 /* KVM_EXIT_TPR_ACCESS */
4371 struct {4843 struct {
@@ -4376,6 +4848,8 @@ Note KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO. · 4 unmodified lines
4376 4848
4377To be documented (KVM_TPR_ACCESS_REPORTING).4849To be documented (KVM_TPR_ACCESS_REPORTING).
4378 4850
4851::
4852
4379 /* KVM_EXIT_S390_SIEIC */4853 /* KVM_EXIT_S390_SIEIC */
4380 struct {4854 struct {
4381 __u8 icptcode;4855 __u8 icptcode;
@@ -4387,16 +4861,20 @@ To be documented (KVM_TPR_ACCESS_REPORTING). · 5 unmodified lines
4387 4861
4388s390 specific.4862s390 specific.
4389 4863
4864::
4865
4390 /* KVM_EXIT_S390_RESET */4866 /* KVM_EXIT_S390_RESET */
4391#define KVM_S390_RESET_POR 14867 #define KVM_S390_RESET_POR 1
4392#define KVM_S390_RESET_CLEAR 24868 #define KVM_S390_RESET_CLEAR 2
4393#define KVM_S390_RESET_SUBSYSTEM 44869 #define KVM_S390_RESET_SUBSYSTEM 4
4394#define KVM_S390_RESET_CPU_INIT 84870 #define KVM_S390_RESET_CPU_INIT 8
4395#define KVM_S390_RESET_IPL 164871 #define KVM_S390_RESET_IPL 16
4396 __u64 s390_reset_flags;4872 __u64 s390_reset_flags;
4397 4873
4398s390 specific.4874s390 specific.
4399 4875
4876::
4877
4400 /* KVM_EXIT_S390_UCONTROL */4878 /* KVM_EXIT_S390_UCONTROL */
4401 struct {4879 struct {
4402 __u64 trans_exc_code;4880 __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
4411Principles of Operation Book in the Chapter for Dynamic Address Translation4889Principles of Operation Book in the Chapter for Dynamic Address Translation
4412(DAT)4890(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 HYP1.. SPDX-License-Identifier: GPL-2.0
2
3=======================================
4Internal ABI between the kernel and HYP
5=======================================
2 6
3This file documents the interaction between the Linux kernel and the7This file documents the interaction between the Linux kernel and the
4hypervisor layer when running Linux as a hypervisor (for example8hypervisor layer when running Linux as a hypervisor (for example
@@ -19,25 +23,31 @@ and only act on individual CPUs. · 14 unmodified lines
19Unless specified otherwise, any built-in hypervisor must implement23Unless specified otherwise, any built-in hypervisor must implement
20these functions (see arch/arm{,64}/include/asm/virt.h):24these functions (see arch/arm{,64}/include/asm/virt.h):
21 25
22* r0/x0 = HVC_SET_VECTORS26* ::
23 r1/x1 = vectors27
28 r0/x0 = HVC_SET_VECTORS
29 r1/x1 = vectors
24 30
25 Set HVBAR/VBAR_EL2 to 'vectors' to enable a hypervisor. 'vectors'31 Set HVBAR/VBAR_EL2 to 'vectors' to enable a hypervisor. 'vectors'
26 must be a physical address, and respect the alignment requirements32 must be a physical address, and respect the alignment requirements
27 of the architecture. Only implemented by the initial stubs, not by33 of the architecture. Only implemented by the initial stubs, not by
28 Linux hypervisors.34 Linux hypervisors.
29 35
30* r0/x0 = HVC_RESET_VECTORS36* ::
37
38 r0/x0 = HVC_RESET_VECTORS
31 39
32 Turn HYP/EL2 MMU off, and reset HVBAR/VBAR_EL2 to the initials40 Turn HYP/EL2 MMU off, and reset HVBAR/VBAR_EL2 to the initials
33 stubs' exception vector value. This effectively disables an existing41 stubs' exception vector value. This effectively disables an existing
34 hypervisor.42 hypervisor.
35 43
36* r0/x0 = HVC_SOFT_RESTART44* ::
37 r1/x1 = restart address45
38 x2 = x0's value when entering the next payload (arm64)46 r0/x0 = HVC_SOFT_RESTART
39 x3 = x1's value when entering the next payload (arm64)47 r1/x1 = restart address
40 x4 = x2's value when entering the next payload (arm64)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)
41 51
42 Mask all exceptions, disable the MMU, move the arguments into place52 Mask all exceptions, disable the MMU, move the arguments into place
43 (arm64 only), and jump to the restart address while at HYP/EL2. This53 (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===
4ARM
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=========================================
4Power State Coordination Interface (PSCI)
5=========================================
6
1KVM implements the PSCI (Power State Coordination Interface)7KVM implements the PSCI (Power State Coordination Interface)
2specification in order to provide services such as CPU on/off, reset8specification in order to provide services such as CPU on/off, reset
3and power-off to the guest.9and power-off to the guest.
@@ -30,32 +36,42 @@ The following register is defined: · 26 unmodified lines
30 - Affects the whole VM (even if the register view is per-vcpu)36 - Affects the whole VM (even if the register view is per-vcpu)
31 37
32* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1:38* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1:
33 Holds the state of the firmware support to mitigate CVE-2017-5715, as39 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 described40 offered by KVM to the guest via a HVC call. The workaround is described
35 under SMCCC_ARCH_WORKAROUND_1 in [1].41 under SMCCC_ARCH_WORKAROUND_1 in [1].
42
36 Accepted values are:43 Accepted values are:
37 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL: KVM does not offer44
45 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL:
46 KVM does not offer
38 firmware support for the workaround. The mitigation status for the47 firmware support for the workaround. The mitigation status for the
39 guest is unknown.48 guest is unknown.
40 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL: The workaround HVC call is49 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL:
50 The workaround HVC call is
41 available to the guest and required for the mitigation.51 available to the guest and required for the mitigation.
42 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED: The workaround HVC call52 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED:
53 The workaround HVC call
43 is available to the guest, but it is not needed on this VCPU.54 is available to the guest, but it is not needed on this VCPU.
44 55
45* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2:56* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2:
46 Holds the state of the firmware support to mitigate CVE-2018-3639, as57 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 described58 offered by KVM to the guest via a HVC call. The workaround is described
48 under SMCCC_ARCH_WORKAROUND_2 in [1].59 under SMCCC_ARCH_WORKAROUND_2 in [1]_.
60
49 Accepted values are:61 Accepted values are:
50 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL: A workaround is not62
63 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL:
64 A workaround is not
51 available. KVM does not offer firmware support for the workaround.65 available. KVM does not offer firmware support for the workaround.
52 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN: The workaround state is66 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN:
67 The workaround state is
53 unknown. KVM does not offer firmware support for the workaround.68 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,
55 and can be disabled by a vCPU. If71 and can be disabled by a vCPU. If
56 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED is set, it is active for72 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED is set, it is active for
57 this vCPU.73 this vCPU.
58 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED: The workaround is74 KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED:
59 always active on this vCPU or it is not needed.75 The workaround is always active on this vCPU or it is not needed.
60 76
61[1] https://developer.arm.com/-/media/developer/pdf/ARM_DEN_0070A_Firmware_interfaces_for_mitigating_CVE-2017-5715.pdf77.. [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===============================================
1ARM Virtual Interrupt Translation Service (ITS)4ARM Virtual Interrupt Translation Service (ITS)
2===============================================5===============================================
3 6
@@ -12,22 +15,32 @@ There can be multiple ITS controllers per guest, each of them has to have · 8 unmodified lines
12a separate, non-overlapping MMIO region.15a separate, non-overlapping MMIO region.
13 16
14 17
15Groups:18Groups
16 KVM_DEV_ARM_VGIC_GRP_ADDR19======
20
21KVM_DEV_ARM_VGIC_GRP_ADDR
22-------------------------
23
17 Attributes:24 Attributes:
18 KVM_VGIC_ITS_ADDR_TYPE (rw, 64-bit)25 KVM_VGIC_ITS_ADDR_TYPE (rw, 64-bit)
19 Base address in the guest physical address space of the GICv3 ITS26 Base address in the guest physical address space of the GICv3 ITS
20 control register frame.27 control register frame.
21 This address needs to be 64K aligned and the region covers 128K.28 This address needs to be 64K aligned and the region covers 128K.
29
22 Errors:30 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.
28 31
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
41KVM_DEV_ARM_VGIC_GRP_CTRL
42-------------------------
29 43
30 KVM_DEV_ARM_VGIC_GRP_CTRL
31 Attributes:44 Attributes:
32 KVM_DEV_ARM_VGIC_CTRL_INIT45 KVM_DEV_ARM_VGIC_CTRL_INIT
33 request the initialization of the ITS, no additional parameter in46 request the initialization of the ITS, no additional parameter in
@@ -58,16 +71,21 @@ Groups: · 24 unmodified lines
58 "ITS Restore Sequence".71 "ITS Restore Sequence".
59 72
60 Errors:73 Errors:
61 -ENXIO: ITS not properly configured as required prior to setting74
75 ======= ==========================================================
76 -ENXIO ITS not properly configured as required prior to setting
62 this attribute77 this attribute
63 -ENOMEM: Memory shortage when allocating ITS internal data78 -ENOMEM Memory shortage when allocating ITS internal data
64 -EINVAL: Inconsistent restored data79 -EINVAL Inconsistent restored data
65 -EFAULT: Invalid guest ram access80 -EFAULT Invalid guest ram access
66 -EBUSY: One or more VCPUS are running81 -EBUSY One or more VCPUS are running
67 -EACCES: The virtual ITS is backed by a physical GICv4 ITS, and the82 -EACCES The virtual ITS is backed by a physical GICv4 ITS, and the
68 state is not available83 state is not available
84 ======= ==========================================================
85
86KVM_DEV_ARM_VGIC_GRP_ITS_REGS
87-----------------------------
69 88
70 KVM_DEV_ARM_VGIC_GRP_ITS_REGS
71 Attributes:89 Attributes:
72 The attr field of kvm_device_attr encodes the offset of the90 The attr field of kvm_device_attr encodes the offset of the
73 ITS register, relative to the ITS control frame base address91 ITS register, relative to the ITS control frame base address
@@ -78,6 +96,7 @@ Groups: · 4 unmodified lines
78 be accessed with full length.96 be accessed with full length.
79 97
80 Writes to read-only registers are ignored by the kernel except for:98 Writes to read-only registers are ignored by the kernel except for:
99
81 - GITS_CREADR. It must be restored otherwise commands in the queue100 - GITS_CREADR. It must be restored otherwise commands in the queue
82 will be re-executed after restoring CWRITER. GITS_CREADR must be101 will be re-executed after restoring CWRITER. GITS_CREADR must be
83 restored before restoring the GITS_CTLR which is likely to enable the102 restored before restoring the GITS_CTLR which is likely to enable the
@@ -91,30 +110,36 @@ Groups: · 7 unmodified lines
91 110
92 For other registers, getting or setting a register has the same111 For other registers, getting or setting a register has the same
93 effect as reading/writing the register on real hardware.112 effect as reading/writing the register on real hardware.
113
94 Errors:114 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
99 115
100 ITS Restore Sequence:116 ======= ====================================================
101 -------------------------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
123ITS Restore Sequence:
124---------------------
102 125
103The following ordering must be followed when restoring the GIC and the ITS:126The following ordering must be followed when restoring the GIC and the ITS:
127
104a) restore all guest memory and create vcpus128a) restore all guest memory and create vcpus
105b) restore all redistributors129b) restore all redistributors
106c) provide the ITS base address130c) provide the ITS base address
107 (KVM_DEV_ARM_VGIC_GRP_ADDR)131 (KVM_DEV_ARM_VGIC_GRP_ADDR)
108d) restore the ITS in the following order:132d) restore the ITS in the following order:
109 1. Restore GITS_CBASER133
110 2. Restore all other GITS_ registers, except GITS_CTLR!134 1. Restore GITS_CBASER
111 3. Load the ITS table data (KVM_DEV_ARM_ITS_RESTORE_TABLES)135 2. Restore all other ``GITS_`` registers, except GITS_CTLR!
112 4. Restore GITS_CTLR136 3. Load the ITS table data (KVM_DEV_ARM_ITS_RESTORE_TABLES)
137 4. Restore GITS_CTLR
113 138
114Then vcpus can be started.139Then vcpus can be started.
115 140
116 ITS Table ABI REV0:141ITS Table ABI REV0:
117 -------------------142-------------------
118 143
119 Revision 0 of the ABI only supports the features of a virtual GICv3, and does144 Revision 0 of the ABI only supports the features of a virtual GICv3, and does
120 not support a virtual GICv4 with support for direct injection of virtual145 not support a virtual GICv4 with support for direct injection of virtual
@@ -125,12 +150,13 @@ Then vcpus can be started. · 4 unmodified lines
125 entries in the collection are listed in no particular order.150 entries in the collection are listed in no particular order.
126 All entries are 8 bytes.151 All entries are 8 bytes.
127 152
128 Device Table Entry (DTE):153 Device Table Entry (DTE)::
129 154
130 bits: | 63| 62 ... 49 | 48 ... 5 | 4 ... 0 |155 bits: | 63| 62 ... 49 | 48 ... 5 | 4 ... 0 |
131 values: | V | next | ITT_addr | Size |156 values: | V | next | ITT_addr | Size |
157
158 where:
132 159
133 where;
134 - V indicates whether the entry is valid. If not, other fields160 - V indicates whether the entry is valid. If not, other fields
135 are not meaningful.161 are not meaningful.
136 - next: equals to 0 if this entry is the last one; otherwise it162 - 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
140 - Size specifies the supported number of bits for the EventID,166 - Size specifies the supported number of bits for the EventID,
141 minus one167 minus one
142 168
143 Collection Table Entry (CTE):169 Collection Table Entry (CTE)::
144 170
145 bits: | 63| 62 .. 52 | 51 ... 16 | 15 ... 0 |171 bits: | 63| 62 .. 52 | 51 ... 16 | 15 ... 0 |
146 values: | V | RES0 | RDBase | ICID |172 values: | V | RES0 | RDBase | ICID |
147 173
148 where:174 where:
175
149 - V indicates whether the entry is valid. If not, other fields are176 - V indicates whether the entry is valid. If not, other fields are
150 not meaningful.177 not meaningful.
151 - RES0: reserved field with Should-Be-Zero-or-Preserved behavior.178 - RES0: reserved field with Should-Be-Zero-or-Preserved behavior.
152 - RDBase is the PE number (GICR_TYPER.Processor_Number semantic),179 - RDBase is the PE number (GICR_TYPER.Processor_Number semantic),
153 - ICID is the collection ID180 - ICID is the collection ID
154 181
155 Interrupt Translation Entry (ITE):182 Interrupt Translation Entry (ITE)::
156 183
157 bits: | 63 ... 48 | 47 ... 16 | 15 ... 0 |184 bits: | 63 ... 48 | 47 ... 16 | 15 ... 0 |
158 values: | next | pINTID | ICID |185 values: | next | pINTID | ICID |
159 186
160 where:187 where:
188
161 - next: equals to 0 if this entry is the last one; otherwise it corresponds189 - next: equals to 0 if this entry is the last one; otherwise it corresponds
162 to the EventID offset to the next ITE capped by 2^16 -1.190 to the EventID offset to the next ITE capped by 2^16 -1.
163 - pINTID is the physical LPI ID; if zero, it means the entry is not valid191 - pINTID is the physical LPI ID; if zero, it means the entry is not valid
164 and other fields are not meaningful.192 and other fields are not meaningful.
165 - ICID is the collection ID193 - ICID is the collection ID
166 194
167 ITS Reset State:195ITS Reset State:
168 ----------------196----------------
169 197
170RESET returns the ITS to the same state that it was when first created and198RESET returns the ITS to the same state that it was when first created and
171initialized. When the RESET command returns, the following things are199initialized. 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==============================================================
1ARM Virtual Generic Interrupt Controller v3 and later (VGICv3)4ARM Virtual Generic Interrupt Controller v3 and later (VGICv3)
2==============================================================5==============================================================
3 6
4 7
5Device types supported:8Device types supported:
6 KVM_DEV_TYPE_ARM_VGIC_V3 ARM Generic Interrupt Controller v3.09 - KVM_DEV_TYPE_ARM_VGIC_V3 ARM Generic Interrupt Controller v3.0
7 10
8Only one VGIC instance may be instantiated through this API. The created VGIC11Only one VGIC instance may be instantiated through this API. The created VGIC
9will act as the VM interrupt controller, requiring emulated user-space devices12will 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
15 18
16Groups:19Groups:
17 KVM_DEV_ARM_VGIC_GRP_ADDR20 KVM_DEV_ARM_VGIC_GRP_ADDR
18 Attributes:21 Attributes:
22
19 KVM_VGIC_V3_ADDR_TYPE_DIST (rw, 64-bit)23 KVM_VGIC_V3_ADDR_TYPE_DIST (rw, 64-bit)
20 Base address in the guest physical address space of the GICv3 distributor24 Base address in the guest physical address space of the GICv3 distributor
21 register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V3.25 register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V3.
@@ -29,21 +33,25 @@ Groups: · 7 unmodified lines
29 This address needs to be 64K aligned.33 This address needs to be 64K aligned.
30 34
31 KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION (rw, 64-bit)35 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:36 The attribute data pointed to by kvm_device_attr.addr is a __u64 value::
33 bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 037
34 values: | count | base | flags | index38 bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 0
39 values: | count | base | flags | index
40
35 - index encodes the unique redistributor region index41 - index encodes the unique redistributor region index
36 - flags: reserved for future use, currently 042 - flags: reserved for future use, currently 0
37 - base field encodes bits [51:16] of the guest physical base address43 - base field encodes bits [51:16] of the guest physical base address
38 of the first redistributor in the region.44 of the first redistributor in the region.
39 - count encodes the number of redistributors in the region. Must be45 - count encodes the number of redistributors in the region. Must be
40 greater than 0.46 greater than 0.
47
41 There are two 64K pages for each redistributor in the region and48 There are two 64K pages for each redistributor in the region and
42 redistributors are laid out contiguously within the region. Regions49 redistributors are laid out contiguously within the region. Regions
43 are filled with redistributors in the index order. The sum of all50 are filled with redistributors in the index order. The sum of all
44 region count fields must be greater than or equal to the number of51 region count fields must be greater than or equal to the number of
45 VCPUs. Redistributor regions must be registered in the incremental52 VCPUs. Redistributor regions must be registered in the incremental
46 index order, starting from index 0.53 index order, starting from index 0.
54
47 The characteristics of a specific redistributor region can be read55 The characteristics of a specific redistributor region can be read
48 by presetting the index field in the attr data.56 by presetting the index field in the attr data.
49 Only valid for KVM_DEV_TYPE_ARM_VGIC_V3.57 Only valid for KVM_DEV_TYPE_ARM_VGIC_V3.
@@ -52,23 +60,27 @@ Groups: · 2 unmodified lines
52 KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attributes.60 KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attributes.
53 61
54 Errors:62 Errors:
55 -E2BIG: Address outside of addressable IPA range63
56 -EINVAL: Incorrectly aligned address, bad redistributor region64 ======= =============================================================
65 -E2BIG Address outside of addressable IPA range
66 -EINVAL Incorrectly aligned address, bad redistributor region
57 count/index, mixed redistributor region attribute usage67 count/index, mixed redistributor region attribute usage
58 -EEXIST: Address already configured68 -EEXIST Address already configured
59 -ENOENT: Attempt to read the characteristics of a non existing69 -ENOENT Attempt to read the characteristics of a non existing
60 redistributor region70 redistributor region
61 -ENXIO: The group or attribute is unknown/unsupported for this device71 -ENXIO The group or attribute is unknown/unsupported for this device
62 or hardware support is missing.72 or hardware support is missing.
63 -EFAULT: Invalid user pointer for attr->addr.73 -EFAULT Invalid user pointer for attr->addr.
74 ======= =============================================================
75
64 76
77 KVM_DEV_ARM_VGIC_GRP_DIST_REGS, KVM_DEV_ARM_VGIC_GRP_REDIST_REGS
78 Attributes:
65 79
66 KVM_DEV_ARM_VGIC_GRP_DIST_REGS80 The attr field of kvm_device_attr encodes two values::
67 KVM_DEV_ARM_VGIC_GRP_REDIST_REGS81
68 Attributes:82 bits: | 63 .... 32 | 31 .... 0 |
69 The attr field of kvm_device_attr encodes two values:83 values: | mpidr | offset |
70 bits: | 63 .... 32 | 31 .... 0 |
71 values: | mpidr | offset |
72 84
73 All distributor regs are (rw, 32-bit) and kvm_device_attr.addr points to a85 All distributor regs are (rw, 32-bit) and kvm_device_attr.addr points to a
74 __u32 value. 64-bit registers must be accessed by separately accessing the86 __u32 value. 64-bit registers must be accessed by separately accessing the
@@ -93,7 +105,8 @@ Groups: · 18 unmodified lines
93 redistributor is accessed. The mpidr is ignored for the distributor.105 redistributor is accessed. The mpidr is ignored for the distributor.
94 106
95 The mpidr encoding is based on the affinity information in the107 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
97 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |110 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |
98 | Aff3 | Aff2 | Aff1 | Aff0 |111 | Aff3 | Aff2 | Aff1 | Aff0 |
99 112
@@ -148,24 +161,30 @@ Groups: · 48 unmodified lines
148 ignored.161 ignored.
149 162
150 Errors:163 Errors:
151 -ENXIO: Getting or setting this register is not yet supported164
152 -EBUSY: One or more VCPUs are running165 ====== =====================================================
166 -ENXIO Getting or setting this register is not yet supported
167 -EBUSY One or more VCPUs are running
168 ====== =====================================================
153 169
154 170
155 KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS171 KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS
156 Attributes:172 Attributes:
157 The attr field of kvm_device_attr encodes two values:173
158 bits: | 63 .... 32 | 31 .... 16 | 15 .... 0 |174 The attr field of kvm_device_attr encodes two values::
159 values: | mpidr | RES | instr |175
176 bits: | 63 .... 32 | 31 .... 16 | 15 .... 0 |
177 values: | mpidr | RES | instr |
160 178
161 The mpidr field encodes the CPU ID based on the affinity information in the179 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
163 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |182 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |
164 | Aff3 | Aff2 | Aff1 | Aff0 |183 | Aff3 | Aff2 | Aff1 | Aff0 |
165 184
166 The instr field encodes the system register to access based on the fields185 The instr field encodes the system register to access based on the fields
167 defined in the A64 instruction set encoding for system register access186 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)::
169 188
170 | 15 ... 14 | 13 ... 11 | 10 ... 7 | 6 ... 3 | 2 ... 0 |189 | 15 ... 14 | 13 ... 11 | 10 ... 7 | 6 ... 3 | 2 ... 0 |
171 | Op 0 | Op1 | CRn | CRm | Op2 |190 | Op 0 | Op1 | CRn | CRm | Op2 |
@@ -178,26 +197,35 @@ Groups: · 6 unmodified lines
178 197
179 CPU interface registers access is not implemented for AArch32 mode.198 CPU interface registers access is not implemented for AArch32 mode.
180 Error -ENXIO is returned when accessed in AArch32 mode.199 Error -ENXIO is returned when accessed in AArch32 mode.
200
181 Errors:201 Errors:
182 -ENXIO: Getting or setting this register is not yet supported202
183 -EBUSY: VCPU is running203 ======= =====================================================
184 -EINVAL: Invalid mpidr or register value supplied204 -ENXIO Getting or setting this register is not yet supported
205 -EBUSY VCPU is running
206 -EINVAL Invalid mpidr or register value supplied
207 ======= =====================================================
185 208
186 209
187 KVM_DEV_ARM_VGIC_GRP_NR_IRQS210 KVM_DEV_ARM_VGIC_GRP_NR_IRQS
188 Attributes:211 Attributes:
212
189 A value describing the number of interrupts (SGI, PPI and SPI) for213 A value describing the number of interrupts (SGI, PPI and SPI) for
190 this GIC instance, ranging from 64 to 1024, in increments of 32.214 this GIC instance, ranging from 64 to 1024, in increments of 32.
191 215
192 kvm_device_attr.addr points to a __u32 value.216 kvm_device_attr.addr points to a __u32 value.
193 217
194 Errors:218 Errors:
195 -EINVAL: Value set is out of the expected range219
196 -EBUSY: Value has already be set.220 ======= ======================================
221 -EINVAL Value set is out of the expected range
222 -EBUSY Value has already be set.
223 ======= ======================================
197 224
198 225
199 KVM_DEV_ARM_VGIC_GRP_CTRL226 KVM_DEV_ARM_VGIC_GRP_CTRL
200 Attributes:227 Attributes:
228
201 KVM_DEV_ARM_VGIC_CTRL_INIT229 KVM_DEV_ARM_VGIC_CTRL_INIT
202 request the initialization of the VGIC, no additional parameter in230 request the initialization of the VGIC, no additional parameter in
203 kvm_device_attr.addr.231 kvm_device_attr.addr.
@@ -205,20 +233,26 @@ Groups: · 1 unmodified line
205 save all LPI pending bits into guest RAM pending tables.233 save all LPI pending bits into guest RAM pending tables.
206 234
207 The first kB of the pending table is not altered by this operation.235 The first kB of the pending table is not altered by this operation.
236
208 Errors:237 Errors:
209 -ENXIO: VGIC not properly configured as required prior to calling238
210 this attribute239 ======= ========================================================
211 -ENODEV: no online VCPU240 -ENXIO VGIC not properly configured as required prior to calling
212 -ENOMEM: memory shortage when allocating vgic internal data241 this attribute
213 -EFAULT: Invalid guest ram access242 -ENODEV no online VCPU
214 -EBUSY: One or more VCPUS are running243 -ENOMEM memory shortage when allocating vgic internal data
244 -EFAULT Invalid guest ram access
245 -EBUSY One or more VCPUS are running
246 ======= ========================================================
215 247
216 248
217 KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO249 KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO
218 Attributes:250 Attributes:
219 The attr field of kvm_device_attr encodes the following values:251
220 bits: | 63 .... 32 | 31 .... 10 | 9 .... 0 |252 The attr field of kvm_device_attr encodes the following values::
221 values: | mpidr | info | vINTID |253
254 bits: | 63 .... 32 | 31 .... 10 | 9 .... 0 |
255 values: | mpidr | info | vINTID |
222 256
223 The vINTID specifies which set of IRQs is reported on.257 The vINTID specifies which set of IRQs is reported on.
224 258
@@ -228,6 +262,7 @@ Groups: · 3 unmodified lines
228 VGIC_LEVEL_INFO_LINE_LEVEL:262 VGIC_LEVEL_INFO_LINE_LEVEL:
229 Get/Set the input level of the IRQ line for a set of 32 contiguously263 Get/Set the input level of the IRQ line for a set of 32 contiguously
230 numbered interrupts.264 numbered interrupts.
265
231 vINTID must be a multiple of 32.266 vINTID must be a multiple of 32.
232 267
233 kvm_device_attr.addr points to a __u32 value which will contain a268 kvm_device_attr.addr points to a __u32 value which will contain a
@@ -243,9 +278,14 @@ Groups: · 9 unmodified lines
243 reported with the same value regardless of the mpidr specified.278 reported with the same value regardless of the mpidr specified.
244 279
245 The mpidr field encodes the CPU ID based on the affinity information in the280 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
247 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |283 | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 |
248 | Aff3 | Aff2 | Aff1 | Aff0 |284 | Aff3 | Aff2 | Aff1 | Aff0 |
285
249 Errors:286 Errors:
250 -EINVAL: vINTID is not multiple of 32 or287
251 info field is not VGIC_LEVEL_INFO_LINE_LEVEL288 ======= =============================================
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==================================================
1ARM Virtual Generic Interrupt Controller v2 (VGIC)4ARM Virtual Generic Interrupt Controller v2 (VGIC)
2==================================================5==================================================
3 6
4Device types supported:7Device types supported:
5 KVM_DEV_TYPE_ARM_VGIC_V2 ARM Generic Interrupt Controller v2.08
9 - KVM_DEV_TYPE_ARM_VGIC_V2 ARM Generic Interrupt Controller v2.0
6 10
7Only one VGIC instance may be instantiated through either this API or the11Only one VGIC instance may be instantiated through either this API or the
8legacy KVM_CREATE_IRQCHIP API. The created VGIC will act as the VM interrupt12legacy 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
17 21
18Groups:22Groups:
19 KVM_DEV_ARM_VGIC_GRP_ADDR23 KVM_DEV_ARM_VGIC_GRP_ADDR
20 Attributes:24 Attributes:
25
21 KVM_VGIC_V2_ADDR_TYPE_DIST (rw, 64-bit)26 KVM_VGIC_V2_ADDR_TYPE_DIST (rw, 64-bit)
22 Base address in the guest physical address space of the GIC distributor27 Base address in the guest physical address space of the GIC distributor
23 register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2.28 register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2.
@@ -27,19 +32,25 @@ Groups: · 3 unmodified lines
27 Base address in the guest physical address space of the GIC virtual cpu32 Base address in the guest physical address space of the GIC virtual cpu
28 interface register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2.33 interface register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2.
29 This address needs to be 4K aligned and the region covers 4 KByte.34 This address needs to be 4K aligned and the region covers 4 KByte.
35
30 Errors:36 Errors:
31 -E2BIG: Address outside of addressable IPA range37
32 -EINVAL: Incorrectly aligned address38 ======= =============================================================
33 -EEXIST: Address already configured39 -E2BIG Address outside of addressable IPA range
34 -ENXIO: The group or attribute is unknown/unsupported for this device40 -EINVAL Incorrectly aligned address
41 -EEXIST Address already configured
42 -ENXIO The group or attribute is unknown/unsupported for this device
35 or hardware support is missing.43 or hardware support is missing.
36 -EFAULT: Invalid user pointer for attr->addr.44 -EFAULT Invalid user pointer for attr->addr.
45 ======= =============================================================
37 46
38 KVM_DEV_ARM_VGIC_GRP_DIST_REGS47 KVM_DEV_ARM_VGIC_GRP_DIST_REGS
39 Attributes:48 Attributes:
40 The attr field of kvm_device_attr encodes two values:49
41 bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |50 The attr field of kvm_device_attr encodes two values::
42 values: | reserved | vcpu_index | offset |51
52 bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |
53 values: | reserved | vcpu_index | offset |
43 54
44 All distributor regs are (rw, 32-bit)55 All distributor regs are (rw, 32-bit)
45 56
@@ -58,16 +69,22 @@ Groups: · 12 unmodified lines
58 KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_CPU_REGS) to ensure69 KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_CPU_REGS) to ensure
59 the expected behavior. Unless GICD_IIDR has been set from userspace, writes70 the expected behavior. Unless GICD_IIDR has been set from userspace, writes
60 to the interrupt group registers (GICD_IGROUPR) are ignored.71 to the interrupt group registers (GICD_IGROUPR) are ignored.
72
61 Errors:73 Errors:
62 -ENXIO: Getting or setting this register is not yet supported74
63 -EBUSY: One or more VCPUs are running75 ======= =====================================================
64 -EINVAL: Invalid vcpu_index supplied76 -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 ======= =====================================================
65 80
66 KVM_DEV_ARM_VGIC_GRP_CPU_REGS81 KVM_DEV_ARM_VGIC_GRP_CPU_REGS
67 Attributes:82 Attributes:
68 The attr field of kvm_device_attr encodes two values:83
69 bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |84 The attr field of kvm_device_attr encodes two values::
70 values: | reserved | vcpu_index | offset |85
86 bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 |
87 values: | reserved | vcpu_index | offset |
71 88
72 All CPU interface regs are (rw, 32-bit)89 All CPU interface regs are (rw, 32-bit)
73 90
@@ -101,27 +118,39 @@ Groups: · 27 unmodified lines
101 value left by 3 places to obtain the actual priority mask level.118 value left by 3 places to obtain the actual priority mask level.
102 119
103 Errors:120 Errors:
104 -ENXIO: Getting or setting this register is not yet supported121
105 -EBUSY: One or more VCPUs are running122 ======= =====================================================
106 -EINVAL: Invalid vcpu_index supplied123 -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 ======= =====================================================
107 127
108 KVM_DEV_ARM_VGIC_GRP_NR_IRQS128 KVM_DEV_ARM_VGIC_GRP_NR_IRQS
109 Attributes:129 Attributes:
130
110 A value describing the number of interrupts (SGI, PPI and SPI) for131 A value describing the number of interrupts (SGI, PPI and SPI) for
111 this GIC instance, ranging from 64 to 1024, in increments of 32.132 this GIC instance, ranging from 64 to 1024, in increments of 32.
112 133
113 Errors:134 Errors:
114 -EINVAL: Value set is out of the expected range135
115 -EBUSY: Value has already be set, or GIC has already been initialized136 ======= =============================================================
116 with default values.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 ======= =============================================================
117 141
118 KVM_DEV_ARM_VGIC_GRP_CTRL142 KVM_DEV_ARM_VGIC_GRP_CTRL
119 Attributes:143 Attributes:
144
120 KVM_DEV_ARM_VGIC_CTRL_INIT145 KVM_DEV_ARM_VGIC_CTRL_INIT
121 request the initialization of the VGIC or ITS, no additional parameter146 request the initialization of the VGIC or ITS, no additional parameter
122 in kvm_device_attr.addr.147 in kvm_device_attr.addr.
148
123 Errors:149 Errors:
124 -ENXIO: VGIC not properly configured as required prior to calling150
125 this attribute151 ======= =========================================================
126 -ENODEV: no online VCPU152 -ENXIO VGIC not properly configured as required prior to calling
127 -ENOMEM: memory shortage when allocating vgic internal data153 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=======
4Devices
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=========================
1MPIC interrupt controller4MPIC interrupt controller
2=========================5=========================
3 6
4Device types supported:7Device types supported:
5 KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.08
6 KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.29 - KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.0
10 - KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.2
7 11
8Only one MPIC instance, of any type, may be instantiated. The created12Only one MPIC instance, of any type, may be instantiated. The created
9MPIC will act as the system interrupt controller, connecting to each13MPIC will act as the system interrupt controller, connecting to each
@@ -11,7 +15,8 @@ vcpu's interrupt inputs. · 1 unmodified line
11 15
12Groups:16Groups:
13 KVM_DEV_MPIC_GRP_MISC17 KVM_DEV_MPIC_GRP_MISC
14 Attributes:18 Attributes:
19
15 KVM_DEV_MPIC_BASE_ADDR (rw, 64-bit)20 KVM_DEV_MPIC_BASE_ADDR (rw, 64-bit)
16 Base address of the 256 KiB MPIC register space. Must be21 Base address of the 256 KiB MPIC register space. Must be
17 naturally aligned. A value of zero disables the mapping.22 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====================================
1FLIC (floating interrupt controller)4FLIC (floating interrupt controller)
2====================================5====================================
3 6
@@ -31,8 +34,10 @@ Groups: · 27 unmodified lines
31 Copies all floating interrupts into a buffer provided by userspace.34 Copies all floating interrupts into a buffer provided by userspace.
32 When the buffer is too small it returns -ENOMEM, which is the indication35 When the buffer is too small it returns -ENOMEM, which is the indication
33 for userspace to try again with a bigger buffer.36 for userspace to try again with a bigger buffer.
37
34 -ENOBUFS is returned when the allocation of a kernelspace buffer has38 -ENOBUFS is returned when the allocation of a kernelspace buffer has
35 failed.39 failed.
40
36 -EFAULT is returned when copying data to userspace failed.41 -EFAULT is returned when copying data to userspace failed.
37 All interrupts remain pending, i.e. are not deleted from the list of42 All interrupts remain pending, i.e. are not deleted from the list of
38 currently pending interrupts.43 currently pending interrupts.
@@ -60,38 +65,41 @@ Groups: · 21 unmodified lines
60 65
61 KVM_DEV_FLIC_ADAPTER_REGISTER66 KVM_DEV_FLIC_ADAPTER_REGISTER
62 Register an I/O adapter interrupt source. Takes a kvm_s390_io_adapter67 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::
64 69
65struct kvm_s390_io_adapter {70 struct kvm_s390_io_adapter {
66 __u32 id;71 __u32 id;
67 __u8 isc;72 __u8 isc;
68 __u8 maskable;73 __u8 maskable;
69 __u8 swap;74 __u8 swap;
70 __u8 flags;75 __u8 flags;
71};76 };
72 77
73 id contains the unique id for the adapter, isc the I/O interruption subclass78 id contains the unique id for the adapter, isc the I/O interruption subclass
74 to use, maskable whether this adapter may be masked (interrupts turned off),79 to use, maskable whether this adapter may be masked (interrupts turned off),
75 swap whether the indicators need to be byte swapped, and flags contains80 swap whether the indicators need to be byte swapped, and flags contains
76 further characteristics of the adapter.81 further characteristics of the adapter.
82
77 Currently defined values for 'flags' are:83 Currently defined values for 'flags' are:
84
78 - KVM_S390_ADAPTER_SUPPRESSIBLE: adapter is subject to AIS85 - KVM_S390_ADAPTER_SUPPRESSIBLE: adapter is subject to AIS
79 (adapter-interrupt-suppression) facility. This flag only has an effect if86 (adapter-interrupt-suppression) facility. This flag only has an effect if
80 the AIS capability is enabled.87 the AIS capability is enabled.
88
81 Unknown flag values are ignored.89 Unknown flag values are ignored.
82 90
83 91
84 KVM_DEV_FLIC_ADAPTER_MODIFY92 KVM_DEV_FLIC_ADAPTER_MODIFY
85 Modifies attributes of an existing I/O adapter interrupt source. Takes93 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::
87 95
88struct kvm_s390_io_adapter_req {96 struct kvm_s390_io_adapter_req {
89 __u32 id;97 __u32 id;
90 __u8 type;98 __u8 type;
91 __u8 mask;99 __u8 mask;
92 __u16 pad0;100 __u16 pad0;
93 __u64 addr;101 __u64 addr;
94};102 };
95 103
96 id specifies the adapter and type the operation. The supported operations104 id specifies the adapter and type the operation. The supported operations
97 are:105 are:
@@ -103,8 +111,9 @@ struct kvm_s390_io_adapter_req { · 5 unmodified lines
103 perform a gmap translation for the guest address provided in addr,111 perform a gmap translation for the guest address provided in addr,
104 pin a userspace page for the translated address and add it to the112 pin a userspace page for the translated address and add it to the
105 list of mappings113 list of mappings
106 Note: A new mapping will be created unconditionally; therefore,114
107 the calling code should avoid making duplicate mappings.115 .. note:: A new mapping will be created unconditionally; therefore,
116 the calling code should avoid making duplicate mappings.
108 117
109 KVM_S390_IO_ADAPTER_UNMAP118 KVM_S390_IO_ADAPTER_UNMAP
110 release a userspace page for the translated address specified in addr119 release a userspace page for the translated address specified in addr
@@ -112,16 +121,17 @@ struct kvm_s390_io_adapter_req { · 1 unmodified line
112 121
113 KVM_DEV_FLIC_AISM122 KVM_DEV_FLIC_AISM
114 modify the adapter-interruption-suppression mode for a given isc if the123 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::
116 125
117struct kvm_s390_ais_req {126 struct kvm_s390_ais_req {
118 __u8 isc;127 __u8 isc;
119 __u16 mode;128 __u16 mode;
120};129 };
121 130
122 isc contains the target I/O interruption subclass, mode the target131 isc contains the target I/O interruption subclass, mode the target
123 adapter-interruption-suppression mode. The following modes are132 adapter-interruption-suppression mode. The following modes are
124 currently supported:133 currently supported:
134
125 - KVM_S390_AIS_MODE_ALL: ALL-Interruptions Mode, i.e. airq injection135 - KVM_S390_AIS_MODE_ALL: ALL-Interruptions Mode, i.e. airq injection
126 is always allowed;136 is always allowed;
127 - KVM_S390_AIS_MODE_SINGLE: SINGLE-Interruption Mode, i.e. airq137 - KVM_S390_AIS_MODE_SINGLE: SINGLE-Interruption Mode, i.e. airq
@@ -139,12 +149,12 @@ struct kvm_s390_ais_req { · 11 unmodified lines
139 149
140 KVM_DEV_FLIC_AISM_ALL150 KVM_DEV_FLIC_AISM_ALL
141 Gets or sets the adapter-interruption-suppression mode for all ISCs. Takes151 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::
143 153
144struct kvm_s390_ais_all {154 struct kvm_s390_ais_all {
145 __u8 simm; /* Single-Interruption-Mode mask */155 __u8 simm; /* Single-Interruption-Mode mask */
146 __u8 nimm; /* No-Interruption-Mode mask *156 __u8 nimm; /* No-Interruption-Mode mask *
147};157 };
148 158
149 simm contains Single-Interruption-Mode mask for all ISCs, nimm contains159 simm contains Single-Interruption-Mode mask for all ISCs, nimm contains
150 No-Interruption-Mode mask for all ISCs. Each bit in simm and nimm corresponds160 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
159that a FLIC operation is unavailable based on the error code resulting from a169that a FLIC operation is unavailable based on the error code resulting from a
160usage attempt.170usage attempt.
161 171
162Note: The KVM_DEV_FLIC_CLEAR_IO_IRQ ioctl will return EINVAL in case a zero172.. note:: The KVM_DEV_FLIC_CLEAR_IO_IRQ ioctl will return EINVAL in case a
163schid is specified.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======================
4Generic vcpu interface
5======================
6
7The virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
8KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct
9kvm_device_attr as other devices, but targets VCPU-wide settings and controls.
10
11The groups and attributes per virtual cpu, if any, are architecture specific.
12
131. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL
14==================================
15
16:Architectures: ARM64
17
181.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
24Returns:
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
35A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt
36number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt
37type must be same for each vcpu. As a PPI, the interrupt number is the same for
38all vcpus, while as an SPI it must be a separate number per vcpu.
39
401.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT
41---------------------------------------
42
43:Parameters: no additional parameter in kvm_device_attr.addr
44
45Returns:
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
54Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel
55virtual GIC implementation, this must be done after initializing the in-kernel
56irqchip.
57
58
592. GROUP: KVM_ARM_VCPU_TIMER_CTRL
60=================================
61
62:Architectures: ARM, ARM64
63
642.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
70Returns:
71
72 ======= =================================
73 -EINVAL Invalid timer interrupt number
74 -EBUSY One or more VCPUs has already run
75 ======= =================================
76
77A value describing the architected timer interrupt number when connected to an
78in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the
79attribute overrides the default values (see below).
80
81============================= ==========================================
82KVM_ARM_VCPU_TIMER_IRQ_VTIMER The EL1 virtual timer intid (default: 27)
83KVM_ARM_VCPU_TIMER_IRQ_PTIMER The EL1 physical timer intid (default: 30)
84============================= ==========================================
85
86Setting the same PPI for different timers will prevent the VCPUs from running.
87Setting the interrupt number on a VCPU configures all VCPUs created at that
88time to use the number provided for a given timer, overwriting any previously
89configured values on other VCPUs. Userspace should configure the interrupt
90numbers on at least one VCPU after creating all VCPUs and before running any
91VCPUs.
92
933. GROUP: KVM_ARM_VCPU_PVTIME_CTRL
94==================================
95
96:Architectures: ARM64
97
983.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA
99--------------------------------------
100
101:Parameters: 64-bit base address
102
103Returns:
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
111Specifies the base address of the stolen time structure for this VCPU. The
112base address must be 64 byte aligned and exist within a valid guest memory
113region. See Documentation/virt/kvm/arm/pvtime.txt for more information
114including the layout of the stolen time structure.
Documentation/virt/kvm/devices/vcpu.txt+0−76
@@ -1,76 +0,0 @@
1Generic vcpu interface
2====================================
3
4The virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
5KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct
6kvm_device_attr as other devices, but targets VCPU-wide settings and controls.
7
8The groups and attributes per virtual cpu, if any, are architecture specific.
9
101. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL
11Architectures: ARM64
12
131.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ
14Parameters: in kvm_device_attr.addr the address for PMU overflow interrupt is a
15 pointer to an int
16Returns: -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
23A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt
24number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt
25type must be same for each vcpu. As a PPI, the interrupt number is the same for
26all vcpus, while as an SPI it must be a separate number per vcpu.
27
281.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT
29Parameters: no additional parameter in kvm_device_attr.addr
30Returns: -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
35Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel
36virtual GIC implementation, this must be done after initializing the in-kernel
37irqchip.
38
39
402. GROUP: KVM_ARM_VCPU_TIMER_CTRL
41Architectures: ARM,ARM64
42
432.1. ATTRIBUTE: KVM_ARM_VCPU_TIMER_IRQ_VTIMER
442.2. ATTRIBUTE: KVM_ARM_VCPU_TIMER_IRQ_PTIMER
45Parameters: in kvm_device_attr.addr the address for the timer interrupt is a
46 pointer to an int
47Returns: -EINVAL: Invalid timer interrupt number
48 -EBUSY: One or more VCPUs has already run
49
50A value describing the architected timer interrupt number when connected to an
51in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the
52attribute overrides the default values (see below).
53
54KVM_ARM_VCPU_TIMER_IRQ_VTIMER: The EL1 virtual timer intid (default: 27)
55KVM_ARM_VCPU_TIMER_IRQ_PTIMER: The EL1 physical timer intid (default: 30)
56
57Setting the same PPI for different timers will prevent the VCPUs from running.
58Setting the interrupt number on a VCPU configures all VCPUs created at that
59time to use the number provided for a given timer, overwriting any previously
60configured values on other VCPUs. Userspace should configure the interrupt
61numbers on at least one VCPU after creating all VCPUs and before running any
62VCPUs.
63
643. GROUP: KVM_ARM_VCPU_PVTIME_CTRL
65Architectures: ARM64
66
673.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA
68Parameters: 64-bit base address
69Returns: -ENXIO: Stolen time not implemented
70 -EEXIST: Base address already set for this VCPU
71 -EINVAL: Base address not 64 byte aligned
72
73Specifies the base address of the stolen time structure for this VCPU. The
74base address must be 64 byte aligned and exist within a valid guest memory
75region. See Documentation/virt/kvm/arm/pvtime.txt for more information
76including 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===================
1VFIO virtual device4VFIO virtual device
2===================5===================
3 6
4Device types supported:7Device types supported:
5 KVM_DEV_TYPE_VFIO8
9 - KVM_DEV_TYPE_VFIO
6 10
7Only one VFIO instance may be created per VM. The created device11Only one VFIO instance may be created per VM. The created device
8tracks VFIO groups in use by the VM and features of those groups12tracks VFIO groups in use by the VM and features of those groups
@@ -23,14 +27,15 @@ KVM_DEV_VFIO_GROUP attributes: · 14 unmodified lines
23 for the VFIO group.27 for the VFIO group.
24 KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table28 KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table
25 allocated by sPAPR KVM.29 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 };
27 36
28 struct kvm_vfio_spapr_tce {37 where:
29 __s32 groupfd;
30 __s32 tablefd;
31 };
32 38
33 where39 - @groupfd is a file descriptor for a VFIO group;
34 @groupfd is a file descriptor for a VFIO group;40 - @tablefd is a file descriptor for a TCE table allocated via
35 @tablefd is a file descriptor for a TCE table allocated via41 KVM_CREATE_SPAPR_TCE.
36 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====================
1Generic vm interface4Generic vm interface
2====================================5====================
3 6
4The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,7The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR,
5KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same8KVM_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
10specific.13specific.
11 14
121. GROUP: KVM_S390_VM_MEM_CTRL151. GROUP: KVM_S390_VM_MEM_CTRL
13Architectures: s39016==============================
17
18:Architectures: s390
14 19
151.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA201.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA
16Parameters: none21-------------------------------------------
17Returns: -EBUSY if a vcpu is already defined, otherwise 022
23:Parameters: none
24:Returns: -EBUSY if a vcpu is already defined, otherwise 0
18 25
19Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.26Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.
20 27
211.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA281.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA
22Parameters: none29----------------------------------------
23Returns: -EINVAL if CMMA was not enabled30
24 0 otherwise31:Parameters: none
32:Returns: -EINVAL if CMMA was not enabled;
33 0 otherwise
25 34
26Clear the CMMA status for all guest pages, so any pages the guest marked35Clear the CMMA status for all guest pages, so any pages the guest marked
27as unused are again used any may not be reclaimed by the host.36as unused are again used any may not be reclaimed by the host.
28 37
291.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE381.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE
30Parameters: in attr->addr the address for the new limit of guest memory39-----------------------------------------
31Returns: -EFAULT if the given address is not accessible40
32 -EINVAL if the virtual machine is of type UCONTROL41:Parameters: in attr->addr the address for the new limit of guest memory
33 -E2BIG if the given guest memory is to big for that machine42:Returns: -EFAULT if the given address is not accessible;
34 -EBUSY if a vcpu is already defined43 -EINVAL if the virtual machine is of type UCONTROL;
35 -ENOMEM if not enough memory is available for a new shadow guest mapping44 -E2BIG if the given guest memory is to big for that machine;
36 0 otherwise45 -EBUSY if a vcpu is already defined;
46 -ENOMEM if not enough memory is available for a new shadow guest mapping;
47 0 otherwise.
37 48
38Allows userspace to query the actual limit and set a new limit for49Allows userspace to query the actual limit and set a new limit for
39the maximum guest memory size. The limit will be rounded up to50the 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
42the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX).53the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX).
43 54
442. GROUP: KVM_S390_VM_CPU_MODEL552. GROUP: KVM_S390_VM_CPU_MODEL
45Architectures: s39056===============================
57
58:Architectures: s390
46 59
472.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o)602.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o)
61---------------------------------------------
48 62
49Allows user space to retrieve machine and kvm specific cpu related information:63Allows user space to retrieve machine and kvm specific cpu related information::
50 64
51struct kvm_s390_vm_cpu_machine {65 struct kvm_s390_vm_cpu_machine {
52 __u64 cpuid; # CPUID of host66 __u64 cpuid; # CPUID of host
53 __u32 ibc; # IBC level range offered by host67 __u32 ibc; # IBC level range offered by host
54 __u8 pad[4];68 __u8 pad[4];
55 __u64 fac_mask[256]; # set of cpu facilities enabled by KVM69 __u64 fac_mask[256]; # set of cpu facilities enabled by KVM
56 __u64 fac_list[256]; # set of cpu facilities offered by host70 __u64 fac_list[256]; # set of cpu facilities offered by host
57}71 }
58 72
59Parameters: address of buffer to store the machine related cpu data73:Parameters: address of buffer to store the machine related cpu data
60 of type struct kvm_s390_vm_cpu_machine*74 of type struct kvm_s390_vm_cpu_machine*
61Returns: -EFAULT if the given address is not accessible from kernel space75:Returns: -EFAULT if the given address is not accessible from kernel space;
62 -ENOMEM if not enough memory is available to process the ioctl76 -ENOMEM if not enough memory is available to process the ioctl;
63 0 in case of success77 0 in case of success.
64 78
652.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w)792.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w)
80===============================================
66 81
67Allows user space to retrieve or request to change cpu related information for a vcpu:82Allows user space to retrieve or request to change cpu related information for a vcpu::
68 83
69struct kvm_s390_vm_cpu_processor {84 struct kvm_s390_vm_cpu_processor {
70 __u64 cpuid; # CPUID currently (to be) used by this vcpu85 __u64 cpuid; # CPUID currently (to be) used by this vcpu
71 __u16 ibc; # IBC level currently (to be) used by this vcpu86 __u16 ibc; # IBC level currently (to be) used by this vcpu
72 __u8 pad[6];87 __u8 pad[6];
73 __u64 fac_list[256]; # set of cpu facilities currently (to be) used88 __u64 fac_list[256]; # set of cpu facilities currently (to be) used
74 # by this vcpu89 # by this vcpu
75}90 }
76 91
77KVM does not enforce or limit the cpu model data in any form. Take the information92KVM does not enforce or limit the cpu model data in any form. Take the information
78retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration93retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration
79setups. Instruction interceptions triggered by additionally set facility bits that94setups. Instruction interceptions triggered by additionally set facility bits that
80are not handled by KVM need to by imlemented in the VM driver code.95are not handled by KVM need to by imlemented in the VM driver code.
81 96
82Parameters: address of buffer to store/set the processor related cpu97:Parameters: address of buffer to store/set the processor related cpu
83 data of type struct kvm_s390_vm_cpu_processor*.98 data of type struct kvm_s390_vm_cpu_processor*.
84Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case)99: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 space100 -EFAULT if the given address is not accessible from kernel space;
86 -ENOMEM if not enough memory is available to process the ioctl101 -ENOMEM if not enough memory is available to process the ioctl;
87 0 in case of success102 0 in case of success.
103
104.. _KVM_S390_VM_CPU_MACHINE_FEAT:
88 105
892.3. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_FEAT (r/o)1062.3. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_FEAT (r/o)
107--------------------------------------------------
90 108
91Allows user space to retrieve available cpu features. A feature is available if109Allows user space to retrieve available cpu features. A feature is available if
92provided by the hardware and supported by kvm. In theory, cpu features could110provided by the hardware and supported by kvm. In theory, cpu features could
93even be completely emulated by kvm.111even be completely emulated by kvm.
94 112
95struct kvm_s390_vm_cpu_feat {113::
96 __u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering
97};
98 114
99Parameters: address of a buffer to load the feature list from.115 struct kvm_s390_vm_cpu_feat {
100Returns: -EFAULT if the given address is not accessible from kernel space.116 __u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering
101 0 in case of success.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.
102 122
1032.4. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_FEAT (r/w)1232.4. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_FEAT (r/w)
124----------------------------------------------------
104 125
105Allows user space to retrieve or change enabled cpu features for all VCPUs of a126Allows user space to retrieve or change enabled cpu features for all VCPUs of a
106VM. Features that are not available cannot be enabled.127VM. Features that are not available cannot be enabled.
107 128
108See 2.3. for a description of the parameter struct.129See :ref:`KVM_S390_VM_CPU_MACHINE_FEAT` for
130a description of the parameter struct.
109 131
110Parameters: address of a buffer to store/load the feature list from.132:Parameters: address of a buffer to store/load the feature list from.
111Returns: -EFAULT if the given address is not accessible from kernel space.133: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.134 -EINVAL if a cpu feature that is not available is to be enabled;
113 -EBUSY if at least one VCPU has already been defined.135 -EBUSY if at least one VCPU has already been defined;
114 0 in case of success.136 0 in case of success.
115 137
138.. _KVM_S390_VM_CPU_MACHINE_SUBFUNC:
139
1162.5. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_SUBFUNC (r/o)1402.5. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_SUBFUNC (r/o)
141-----------------------------------------------------
117 142
118Allows user space to retrieve available cpu subfunctions without any filtering143Allows user space to retrieve available cpu subfunctions without any filtering
119done by a set IBC. These subfunctions are indicated to the guest VCPU via144done 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
126indicates subfunctions via a "test bit" mechanism, the subfunction codes are151indicates subfunctions via a "test bit" mechanism, the subfunction codes are
127contained in the returned struct in MSB 0 bit numbering.152contained in the returned struct in MSB 0 bit numbering.
128 153
129struct kvm_s390_vm_cpu_subfunc {154::
155
156 struct kvm_s390_vm_cpu_subfunc {
130 u8 plo[32]; # always valid (ESA/390 feature)157 u8 plo[32]; # always valid (ESA/390 feature)
131 u8 ptff[16]; # valid with TOD-clock steering158 u8 ptff[16]; # valid with TOD-clock steering
132 u8 kmac[16]; # valid with Message-Security-Assist159 u8 kmac[16]; # valid with Message-Security-Assist
@@ -143,13 +170,14 @@ struct kvm_s390_vm_cpu_subfunc { · 10 unmodified lines
143 u8 kma[16]; # valid with Message-Security-Assist-Extension 8170 u8 kma[16]; # valid with Message-Security-Assist-Extension 8
144 u8 kdsa[16]; # valid with Message-Security-Assist-Extension 9171 u8 kdsa[16]; # valid with Message-Security-Assist-Extension 9
145 u8 reserved[1792]; # reserved for future instructions172 u8 reserved[1792]; # reserved for future instructions
146};173 };
147 174
148Parameters: address of a buffer to load the subfunction blocks from.175:Parameters: address of a buffer to load the subfunction blocks from.
149Returns: -EFAULT if the given address is not accessible from kernel space.176:Returns: -EFAULT if the given address is not accessible from kernel space;
150 0 in case of success.177 0 in case of success.
151 178
1522.6. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_SUBFUNC (r/w)1792.6. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_SUBFUNC (r/w)
180-------------------------------------------------------
153 181
154Allows user space to retrieve or change cpu subfunctions to be indicated for182Allows user space to retrieve or change cpu subfunctions to be indicated for
155all VCPUs of a VM. This attribute will only be available if kernel and183all 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
164to determine available subfunctions in this case, this will guarantee backward192to determine available subfunctions in this case, this will guarantee backward
165compatibility.193compatibility.
166 194
167See 2.5. for a description of the parameter struct.195See :ref:`KVM_S390_VM_CPU_MACHINE_SUBFUNC` for a
196description of the parameter struct.
168 197
169Parameters: address of a buffer to store/load the subfunction blocks from.198:Parameters: address of a buffer to store/load the subfunction blocks from.
170Returns: -EFAULT if the given address is not accessible from kernel space.199:Returns: -EFAULT if the given address is not accessible from kernel space;
171 -EINVAL when reading, if there was no write yet.200 -EINVAL when reading, if there was no write yet;
172 -EBUSY if at least one VCPU has already been defined.201 -EBUSY if at least one VCPU has already been defined;
173 0 in case of success.202 0 in case of success.
174 203
1753. GROUP: KVM_S390_VM_TOD2043. GROUP: KVM_S390_VM_TOD
176Architectures: s390205=========================
206
207:Architectures: s390
177 208
1783.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH2093.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH
210------------------------------------
179 211
180Allows user space to set/get the TOD clock extension (u8) (superseded by212Allows user space to set/get the TOD clock extension (u8) (superseded by
181KVM_S390_VM_TOD_EXT).213KVM_S390_VM_TOD_EXT).
182 214
183Parameters: address of a buffer in user space to store the data (u8) to215:Parameters: address of a buffer in user space to store the data (u8) to
184Returns: -EFAULT if the given address is not accessible from kernel space216:Returns: -EFAULT if the given address is not accessible from kernel space;
185 -EINVAL if setting the TOD clock extension to != 0 is not supported217 -EINVAL if setting the TOD clock extension to != 0 is not supported
186 218
1873.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW2193.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW
220-----------------------------------
188 221
189Allows user space to set/get bits 0-63 of the TOD clock register as defined in222Allows user space to set/get bits 0-63 of the TOD clock register as defined in
190the POP (u64).223the POP (u64).
191 224
192Parameters: address of a buffer in user space to store the data (u64) to225:Parameters: address of a buffer in user space to store the data (u64) to
193Returns: -EFAULT if the given address is not accessible from kernel space226:Returns: -EFAULT if the given address is not accessible from kernel space
194 227
1953.3. ATTRIBUTE: KVM_S390_VM_TOD_EXT2283.3. ATTRIBUTE: KVM_S390_VM_TOD_EXT
229-----------------------------------
230
196Allows user space to set/get bits 0-63 of the TOD clock register as defined in231Allows user space to set/get bits 0-63 of the TOD clock register as defined in
197the POP (u64). If the guest CPU model supports the TOD clock extension (u8), it232the POP (u64). If the guest CPU model supports the TOD clock extension (u8), it
198also allows user space to get/set it. If the guest CPU model does not support233also allows user space to get/set it. If the guest CPU model does not support
199it, it is stored as 0 and not allowed to be set to a value != 0.234it, it is stored as 0 and not allowed to be set to a value != 0.
200 235
201Parameters: address of a buffer in user space to store the data236:Parameters: address of a buffer in user space to store the data
202 (kvm_s390_vm_tod_clock) to237 (kvm_s390_vm_tod_clock) to
203Returns: -EFAULT if the given address is not accessible from kernel space238:Returns: -EFAULT if the given address is not accessible from kernel space;
204 -EINVAL if setting the TOD clock extension to != 0 is not supported239 -EINVAL if setting the TOD clock extension to != 0 is not supported
205 240
2064. GROUP: KVM_S390_VM_CRYPTO2414. GROUP: KVM_S390_VM_CRYPTO
207Architectures: s390242============================
243
244:Architectures: s390
208 245
2094.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o)2464.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o)
247------------------------------------------------------
210 248
211Allows user space to enable aes key wrapping, including generating a new249Allows user space to enable aes key wrapping, including generating a new
212wrapping key.250wrapping key.
213 251
214Parameters: none252:Parameters: none
215Returns: 0253:Returns: 0
216 254
2174.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o)2554.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o)
256------------------------------------------------------
218 257
219Allows user space to enable dea key wrapping, including generating a new258Allows user space to enable dea key wrapping, including generating a new
220wrapping key.259wrapping key.
221 260
222Parameters: none261:Parameters: none
223Returns: 0262:Returns: 0
224 263
2254.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o)2644.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o)
265-------------------------------------------------------
226 266
227Allows user space to disable aes key wrapping, clearing the wrapping key.267Allows user space to disable aes key wrapping, clearing the wrapping key.
228 268
229Parameters: none269:Parameters: none
230Returns: 0270:Returns: 0
231 271
2324.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o)2724.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o)
273-------------------------------------------------------
233 274
234Allows user space to disable dea key wrapping, clearing the wrapping key.275Allows user space to disable dea key wrapping, clearing the wrapping key.
235 276
236Parameters: none277:Parameters: none
237Returns: 0278:Returns: 0
238 279
2395. GROUP: KVM_S390_VM_MIGRATION2805. GROUP: KVM_S390_VM_MIGRATION
240Architectures: s390281===============================
282
283:Architectures: s390
241 284
2425.1. ATTRIBUTE: KVM_S390_VM_MIGRATION_STOP (w/o)2855.1. ATTRIBUTE: KVM_S390_VM_MIGRATION_STOP (w/o)
286------------------------------------------------
243 287
244Allows userspace to stop migration mode, needed for PGSTE migration.288Allows userspace to stop migration mode, needed for PGSTE migration.
245Setting this attribute when migration mode is not active will have no289Setting this attribute when migration mode is not active will have no
246effects.290effects.
247 291
248Parameters: none292:Parameters: none
249Returns: 0293:Returns: 0
250 294
2515.2. ATTRIBUTE: KVM_S390_VM_MIGRATION_START (w/o)2955.2. ATTRIBUTE: KVM_S390_VM_MIGRATION_START (w/o)
296-------------------------------------------------
252 297
253Allows userspace to start migration mode, needed for PGSTE migration.298Allows userspace to start migration mode, needed for PGSTE migration.
254Setting this attribute when migration mode is already active will have299Setting this attribute when migration mode is already active will have
255no effects.300no effects.
256 301
257Parameters: none302:Parameters: none
258Returns: -ENOMEM if there is not enough free memory to start migration mode303: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)304 -EINVAL if the state of the VM is invalid (e.g. no memory defined);
260 0 in case of success.305 0 in case of success.
261 306
2625.3. ATTRIBUTE: KVM_S390_VM_MIGRATION_STATUS (r/o)3075.3. ATTRIBUTE: KVM_S390_VM_MIGRATION_STATUS (r/o)
308--------------------------------------------------
263 309
264Allows userspace to query the status of migration mode.310Allows userspace to query the status of migration mode.
265 311
266Parameters: address of a buffer in user space to store the data (u64) to;312: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 1313 the data itself is either 0 if migration mode is disabled or 1
268 if it is enabled314 if it is enabled
269Returns: -EFAULT if the given address is not accessible from kernel space315:Returns: -EFAULT if the given address is not accessible from kernel space;
270 0 in case of success.316 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=========================
1XICS interrupt controller4XICS interrupt controller
5=========================
2 6
3Device type supported: KVM_DEV_TYPE_XICS7Device type supported: KVM_DEV_TYPE_XICS
4 8
5Groups:9Groups:
6 1. KVM_DEV_XICS_GRP_SOURCES10 1. KVM_DEV_XICS_GRP_SOURCES
7 Attributes: One per interrupt source, indexed by the source number.11 Attributes:
8 12
13 One per interrupt source, indexed by the source number.
9 2. KVM_DEV_XICS_GRP_CTRL14 2. KVM_DEV_XICS_GRP_CTRL
10 Attributes:15 Attributes:
11 2.1 KVM_DEV_XICS_NR_SERVERS (write only)16
17 2.1 KVM_DEV_XICS_NR_SERVERS (write only)
18
12 The kvm_device_attr.addr points to a __u32 value which is the number of19 The kvm_device_attr.addr points to a __u32 value which is the number of
13 interrupt server numbers (ie, highest possible vcpu id plus one).20 interrupt server numbers (ie, highest possible vcpu id plus one).
21
14 Errors:22 Errors:
15 -EINVAL: Value greater than KVM_MAX_VCPU_ID.23
16 -EFAULT: Invalid user pointer for attr->addr.24 ======= ==========================================
17 -EBUSY: A vcpu is already connected to the device.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 ======= ==========================================
18 29
19This device emulates the XICS (eXternal Interrupt Controller30This device emulates the XICS (eXternal Interrupt Controller
20Specification) defined in PAPR. The XICS has a set of interrupt31Specification) 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
53bitfields, starting from the least-significant end of the word:64bitfields, starting from the least-significant end of the word:
54 65
55* Destination (server number), 32 bits66* Destination (server number), 32 bits
67
56 This specifies where the interrupt should be sent, and is the68 This specifies where the interrupt should be sent, and is the
57 interrupt server number specified for the destination vcpu.69 interrupt server number specified for the destination vcpu.
58 70
59* Priority, 8 bits71* Priority, 8 bits
72
60 This is the priority specified for this interrupt source, where 0 is73 This is the priority specified for this interrupt source, where 0 is
61 the highest priority and 255 is the lowest. An interrupt with a74 the highest priority and 255 is the lowest. An interrupt with a
62 priority of 255 will never be delivered.75 priority of 255 will never be delivered.
63 76
64* Level sensitive flag, 1 bit77* Level sensitive flag, 1 bit
78
65 This bit is 1 for a level-sensitive interrupt source, or 0 for79 This bit is 1 for a level-sensitive interrupt source, or 0 for
66 edge-sensitive (or MSI).80 edge-sensitive (or MSI).
67 81
68* Masked flag, 1 bit82* Masked flag, 1 bit
83
69 This bit is set to 1 if the interrupt is masked (cannot be delivered84 This bit is set to 1 if the interrupt is masked (cannot be delivered
70 regardless of its priority), for example by the ibm,int-off RTAS85 regardless of its priority), for example by the ibm,int-off RTAS
71 call, or 0 if it is not masked.86 call, or 0 if it is not masked.
72 87
73* Pending flag, 1 bit88* Pending flag, 1 bit
89
74 This bit is 1 if the source has a pending interrupt, otherwise 0.90 This bit is 1 if the source has a pending interrupt, otherwise 0.
75 91
76Only one XICS instance may be created per VM.92Only 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===========================================================
1POWER9 eXternal Interrupt Virtualization Engine (XIVE Gen1)4POWER9 eXternal Interrupt Virtualization Engine (XIVE Gen1)
2==========================================================5===========================================================
3 6
4Device types supported:7Device types supported:
5 KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 18 - KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1
6 9
7This device acts as a VM interrupt controller. It provides the KVM10This device acts as a VM interrupt controller. It provides the KVM
8interface to configure the interrupt sources of a VM in the underlying11interface 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
64 67
65* Groups:68* Groups:
66 69
67 1. KVM_DEV_XIVE_GRP_CTRL701. KVM_DEV_XIVE_GRP_CTRL
68 Provides global controls on the device71 Provides global controls on the device
72
69 Attributes:73 Attributes:
70 1.1 KVM_DEV_XIVE_RESET (write only)74 1.1 KVM_DEV_XIVE_RESET (write only)
71 Resets the interrupt controller configuration for sources and event75 Resets the interrupt controller configuration for sources and event
72 queues. To be used by kexec and kdump.76 queues. To be used by kexec and kdump.
77
73 Errors: none78 Errors: none
74 79
75 1.2 KVM_DEV_XIVE_EQ_SYNC (write only)80 1.2 KVM_DEV_XIVE_EQ_SYNC (write only)
76 Sync all the sources and queues and mark the EQ pages dirty. This81 Sync all the sources and queues and mark the EQ pages dirty. This
77 to make sure that a consistent memory state is captured when82 to make sure that a consistent memory state is captured when
78 migrating the VM.83 migrating the VM.
84
79 Errors: none85 Errors: none
80 86
81 1.3 KVM_DEV_XIVE_NR_SERVERS (write only)87 1.3 KVM_DEV_XIVE_NR_SERVERS (write only)
82 The kvm_device_attr.addr points to a __u32 value which is the number of88 The kvm_device_attr.addr points to a __u32 value which is the number of
83 interrupt server numbers (ie, highest possible vcpu id plus one).89 interrupt server numbers (ie, highest possible vcpu id plus one).
90
84 Errors:91 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.
88 92
89 2. KVM_DEV_XIVE_GRP_SOURCE (write only)93 ======= ==========================================
90 Initializes a new source in the XIVE device and mask it.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
992. KVM_DEV_XIVE_GRP_SOURCE (write only)
100 Initializes a new source in the XIVE device and mask it.
101
91 Attributes:102 Attributes:
92 Interrupt source number (64-bit)103 Interrupt source number (64-bit)
93 The kvm_device_attr.addr points to a __u64 value:104
94 bits: | 63 .... 2 | 1 | 0105 The kvm_device_attr.addr points to a __u64 value::
95 values: | unused | level | type106
107 bits: | 63 .... 2 | 1 | 0
108 values: | unused | level | type
109
96 - type: 0:MSI 1:LSI110 - type: 0:MSI 1:LSI
97 - level: assertion level in case of an LSI.111 - level: assertion level in case of an LSI.
112
98 Errors:113 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
103 114
104 3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only)115 ======= ==========================================
105 Configures source targeting116 -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
1223. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only)
123 Configures source targeting
124
106 Attributes:125 Attributes:
107 Interrupt source number (64-bit)126 Interrupt source number (64-bit)
108 The kvm_device_attr.addr points to a __u64 value:127
109 bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0128 The kvm_device_attr.addr points to a __u64 value::
110 values: | eisn | mask | server | priority129
130 bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0
131 values: | eisn | mask | server | priority
132
111 - priority: 0-7 interrupt priority level133 - priority: 0-7 interrupt priority level
112 - server: CPU number chosen to handle the interrupt134 - server: CPU number chosen to handle the interrupt
113 - mask: mask flag (unused)135 - mask: mask flag (unused)
114 - eisn: Effective Interrupt Source Number136 - eisn: Effective Interrupt Source Number
137
115 Errors:138 Errors:
116 -ENOENT: Unknown source number139
117 -EINVAL: Not initialized source number140 ======= =======================================================
118 -EINVAL: Invalid priority141 -ENOENT Unknown source number
119 -EINVAL: Invalid CPU number.142 -EINVAL Not initialized source number
120 -EFAULT: Invalid user pointer for attr->addr.143 -EINVAL Invalid priority
121 -ENXIO: CPU event queues not configured or configuration of the144 -EINVAL Invalid CPU number.
122 underlying HW interrupt failed145 -EFAULT Invalid user pointer for attr->addr.
123 -EBUSY: No CPU available to serve interrupt146 -ENXIO CPU event queues not configured or configuration of the
124 147 underlying HW interrupt failed
125 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)148 -EBUSY No CPU available to serve interrupt
126 Configures an event queue of a CPU149 ======= =======================================================
150
1514. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
152 Configures an event queue of a CPU
153
127 Attributes:154 Attributes:
128 EQ descriptor identifier (64-bit)155 EQ descriptor identifier (64-bit)
129 The EQ descriptor identifier is a tuple (server, priority) :156
130 bits: | 63 .... 32 | 31 .. 3 | 2 .. 0157 The EQ descriptor identifier is a tuple (server, priority)::
131 values: | unused | server | priority158
132 The kvm_device_attr.addr points to :159 bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
160 values: | unused | server | priority
161
162 The kvm_device_attr.addr points to::
163
133 struct kvm_ppc_xive_eq {164 struct kvm_ppc_xive_eq {
134 __u32 flags;165 __u32 flags;
135 __u32 qshift;166 __u32 qshift;
@@ -138,8 +169,9 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 2 unmodified lines
138 __u32 qindex;169 __u32 qindex;
139 __u8 pad[40];170 __u8 pad[40];
140 };171 };
172
141 - flags: queue flags173 - flags: queue flags
142 KVM_XIVE_EQ_ALWAYS_NOTIFY (required)174 KVM_XIVE_EQ_ALWAYS_NOTIFY (required)
143 forces notification without using the coalescing mechanism175 forces notification without using the coalescing mechanism
144 provided by the XIVE END ESBs.176 provided by the XIVE END ESBs.
145 - qshift: queue size (power of 2)177 - qshift: queue size (power of 2)
@@ -147,22 +179,31 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 1 unmodified line
147 - qtoggle: current queue toggle bit179 - qtoggle: current queue toggle bit
148 - qindex: current queue index180 - qindex: current queue index
149 - pad: reserved for future use181 - pad: reserved for future use
182
150 Errors:183 Errors:
151 -ENOENT: Invalid CPU number184
152 -EINVAL: Invalid priority185 ======= =========================================
153 -EINVAL: Invalid flags186 -ENOENT Invalid CPU number
154 -EINVAL: Invalid queue size187 -EINVAL Invalid priority
155 -EINVAL: Invalid queue address188 -EINVAL Invalid flags
156 -EFAULT: Invalid user pointer for attr->addr.189 -EINVAL Invalid queue size
157 -EIO: Configuration of the underlying HW failed190 -EINVAL Invalid queue address
158 191 -EFAULT Invalid user pointer for attr->addr.
159 5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only)192 -EIO Configuration of the underlying HW failed
160 Synchronize the source to flush event notifications193 ======= =========================================
194
1955. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only)
196 Synchronize the source to flush event notifications
197
161 Attributes:198 Attributes:
162 Interrupt source number (64-bit)199 Interrupt source number (64-bit)
200
163 Errors:201 Errors:
164 -ENOENT: Unknown source number202
165 -EINVAL: Not initialized source number203 ======= =============================
204 -ENOENT Unknown source number
205 -EINVAL Not initialized source number
206 ======= =============================
166 207
167* VCPU state208* VCPU state
168 209
@@ -175,11 +216,12 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 6 unmodified lines
175 as it synthesizes the priorities of the pending interrupts. We216 as it synthesizes the priorities of the pending interrupts. We
176 capture a bit more to report debug information.217 capture a bit more to report debug information.
177 218
178 KVM_REG_PPC_VP_STATE (2 * 64bits)219 KVM_REG_PPC_VP_STATE (2 * 64bits)::
179 bits: | 63 .... 32 | 31 .... 0 |220
180 values: | TIMA word0 | TIMA word1 |221 bits: | 63 .... 32 | 31 .... 0 |
181 bits: | 127 .......... 64 |222 values: | TIMA word0 | TIMA word1 |
182 values: | unused |223 bits: | 127 .......... 64 |
224 values: | unused |
183 225
184* Migration:226* Migration:
185 227
@@ -196,7 +238,7 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 10 unmodified lines
196 3. Capture the state of the source targeting, the EQs configuration238 3. Capture the state of the source targeting, the EQs configuration
197 and the state of thread interrupt context registers.239 and the state of thread interrupt context registers.
198 240
199 Restore is similar :241 Restore is similar:
200 242
201 1. Restore the EQ configuration. As targeting depends on it.243 1. Restore the EQ configuration. As targeting depends on it.
202 2. Restore targeting244 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===========================
1The KVM halt polling system4The KVM halt polling system
2===========================5===========================
3 6
@@ -68,7 +71,8 @@ steady state polling interval but will only really do a good job for wakeups · 64 unmodified lines
68which come at an approximately constant rate, otherwise there will be constant71which come at an approximately constant rate, otherwise there will be constant
69adjustment of the polling interval.72adjustment of the polling interval.
70 73
71[0] total block time: the time between when the halt polling function is74[0] total block time:
75 the time between when the halt polling function is
72 invoked and a wakeup source received (irrespective of76 invoked and a wakeup source received (irrespective of
73 whether the scheduler is invoked within that function).77 whether the scheduler is invoked within that function).
74 78
@@ -81,31 +85,32 @@ shrunk. These variables are defined in include/linux/kvm_host.h and as module · 6 unmodified lines
81parameters in virt/kvm/kvm_main.c, or arch/powerpc/kvm/book3s_hv.c in the85parameters in virt/kvm/kvm_main.c, or arch/powerpc/kvm/book3s_hv.c in the
82powerpc kvm-hv case.86powerpc kvm-hv case.
83 87
84Module Parameter | Description | Default Value88+-----------------------+---------------------------+-------------------------+
85--------------------------------------------------------------------------------89|Module Parameter | Description | Default Value |
86halt_poll_ns | The global max polling | KVM_HALT_POLL_NS_DEFAULT90+-----------------------+---------------------------+-------------------------+
87 | interval which defines |91|halt_poll_ns | The global max polling | KVM_HALT_POLL_NS_DEFAULT|
88 | the ceiling value of the |92| | interval which defines | |
89 | polling interval for | (per arch value)93| | the ceiling value of the | |
90 | each vcpu. |94| | polling interval for | (per arch value) |
91--------------------------------------------------------------------------------95| | each vcpu. | |
92halt_poll_ns_grow | The value by which the | 296+-----------------------+---------------------------+-------------------------+
93 | halt polling interval is |97|halt_poll_ns_grow | The value by which the | 2 |
94 | multiplied in the |98| | halt polling interval is | |
95 | grow_halt_poll_ns() |99| | multiplied in the | |
96 | function. |100| | grow_halt_poll_ns() | |
97--------------------------------------------------------------------------------101| | function. | |
98halt_poll_ns_grow_start | The initial value to grow | 10000102+-----------------------+---------------------------+-------------------------+
99 | to from zero in the |103|halt_poll_ns_grow_start| The initial value to grow | 10000 |
100 | grow_halt_poll_ns() |104| | to from zero in the | |
101 | function. |105| | grow_halt_poll_ns() | |
102--------------------------------------------------------------------------------106| | function. | |
103halt_poll_ns_shrink | The value by which the | 0107+-----------------------+---------------------------+-------------------------+
104 | halt polling interval is |108|halt_poll_ns_shrink | The value by which the | 0 |
105 | divided in the |109| | halt polling interval is | |
106 | shrink_halt_poll_ns() |110| | divided in the | |
107 | function. |111| | shrink_halt_poll_ns() | |
108--------------------------------------------------------------------------------112| | function. | |
113+-----------------------+---------------------------+-------------------------+
109 114
110These module parameters can be set from the debugfs files in:115These module parameters can be set from the debugfs files in:
111 116
@@ -117,20 +122,19 @@ Note: that these module parameters are system wide values and are not able to · 5 unmodified lines
117Further Notes122Further Notes
118=============123=============
119 124
120- Care should be taken when setting the halt_poll_ns module parameter as a125- Care should be taken when setting the halt_poll_ns module parameter as a large value
121large value has the potential to drive the cpu usage to 100% on a machine which126 has the potential to drive the cpu usage to 100% on a machine which would be almost
122would be almost entirely idle otherwise. This is because even if a guest has127 entirely idle otherwise. This is because even if a guest has wakeups during which very
123wakeups during which very little work is done and which are quite far apart, if128 little work is done and which are quite far apart, if the period is shorter than the
124the period is shorter than the global max polling interval (halt_poll_ns) then129 global max polling interval (halt_poll_ns) then the host will always poll for the
125the host will always poll for the entire block time and thus cpu utilisation130 entire block time and thus cpu utilisation will go to 100%.
126will go to 100%.131
127 132- Halt polling essentially presents a trade off between power usage and latency and
128- Halt polling essentially presents a trade off between power usage and latency133 the module parameters should be used to tune the affinity for this. Idle cpu time is
129and the module parameters should be used to tune the affinity for this. Idle134 essentially converted to host kernel time with the aim of decreasing latency when
130cpu time is essentially converted to host kernel time with the aim of decreasing135 entering the guest.
131latency when entering the guest.136
132 137- Halt polling will only be conducted by the host when no other tasks are runnable on
133- Halt polling will only be conducted by the host when no other tasks are138 that cpu, otherwise the polling will cease immediately and schedule will be invoked to
134runnable on that cpu, otherwise the polling will cease immediately and139 allow that other task to run. Thus this doesn't allow a guest to denial of service the
135schedule will be invoked to allow that other task to run. Thus this doesn't140 cpu.
136allow a guest to denial of service the cpu.
Documentation/virt/kvm/hypercalls.rstrenamed from Documentation/virt/kvm/hypercalls.txt+73−56
@@ -1,5 +1,9 @@
1Linux KVM Hypercall:1.. SPDX-License-Identifier: GPL-2.0
2
3===================
4Linux KVM Hypercall
2===================5===================
6
3X86:7X86:
4 KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall8 KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall
5 instruction. The hypervisor can replace it with instructions that are9 instruction. The hypervisor can replace it with instructions that are
@@ -20,7 +24,7 @@ S390: · 14 unmodified lines
20 For further information on the S390 diagnose call as supported by KVM,24 For further information on the S390 diagnose call as supported by KVM,
21 refer to Documentation/virt/kvm/s390-diag.txt.25 refer to Documentation/virt/kvm/s390-diag.txt.
22 26
23 PowerPC:27PowerPC:
24 It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers.28 It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers.
25 Return value is placed in R3.29 Return value is placed in R3.
26 30
@@ -34,7 +38,8 @@ MIPS: · 7 unmodified lines
34 the return value is placed in $2 (v0).38 the return value is placed in $2 (v0).
35 39
36KVM Hypercalls Documentation40KVM Hypercalls Documentation
37===========================41============================
42
38The template for each hypercall is:43The template for each hypercall is:
391. Hypercall name.441. Hypercall name.
402. Architecture(s)452. Architecture(s)
@@ -43,56 +48,64 @@ The template for each hypercall is: · 2 unmodified lines
43 48
441. KVM_HC_VAPIC_POLL_IRQ491. KVM_HC_VAPIC_POLL_IRQ
45------------------------50------------------------
46Architecture: x8651
47Status: active52:Architecture: x86
48Purpose: Trigger guest exit so that the host can check for pending53:Status: active
49interrupts on reentry.54:Purpose: Trigger guest exit so that the host can check for pending
55 interrupts on reentry.
50 56
512. KVM_HC_MMU_OP572. KVM_HC_MMU_OP
52------------------------58----------------
53Architecture: x8659
54Status: deprecated.60:Architecture: x86
55Purpose: Support MMU operations such as writing to PTE,61:Status: deprecated.
56flushing TLB, release PT.62:Purpose: Support MMU operations such as writing to PTE,
63 flushing TLB, release PT.
57 64
583. KVM_HC_FEATURES653. KVM_HC_FEATURES
59------------------------66------------------
60Architecture: PPC67
61Status: active68:Architecture: PPC
62Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid69:Status: active
63used to enumerate which hypercalls are available. On PPC, either device tree70:Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid
64based lookup ( which is also what EPAPR dictates) OR KVM specific enumeration71 used to enumerate which hypercalls are available. On PPC, either
65mechanism (which is this hypercall) can be used.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.
66 75
674. KVM_HC_PPC_MAP_MAGIC_PAGE764. KVM_HC_PPC_MAP_MAGIC_PAGE
68------------------------77----------------------------
69Architecture: PPC78
70Status: active79:Architecture: PPC
71Purpose: To enable communication between the hypervisor and guest there is a80:Status: active
72shared page that contains parts of supervisor visible register state.81:Purpose: To enable communication between the hypervisor and guest there is a
73The guest can map this shared page to access its supervisor register through82 shared page that contains parts of supervisor visible register state.
74memory using this hypercall.83 The guest can map this shared page to access its supervisor register
84 through memory using this hypercall.
75 85
765. KVM_HC_KICK_CPU865. KVM_HC_KICK_CPU
77------------------------87------------------
78Architecture: x8688
79Status: active89:Architecture: x86
80Purpose: Hypercall used to wakeup a vcpu from HLT state90:Status: active
81Usage example : A vcpu of a paravirtualized guest that is busywaiting in guest91:Purpose: Hypercall used to wakeup a vcpu from HLT state
82kernel mode for an event to occur (ex: a spinlock to become available) can92:Usage example:
83execute HLT instruction once it has busy-waited for more than a threshold93 A vcpu of a paravirtualized guest that is busywaiting in guest
84time-interval. Execution of HLT instruction would cause the hypervisor to put94 kernel mode for an event to occur (ex: a spinlock to become available) can
85the vcpu to sleep until occurrence of an appropriate event. Another vcpu of the95 execute HLT instruction once it has busy-waited for more than a threshold
86same guest can wakeup the sleeping vcpu by issuing KVM_HC_KICK_CPU hypercall,96 time-interval. Execution of HLT instruction would cause the hypervisor to put
87specifying APIC ID (a1) of the vcpu to be woken up. An additional argument (a0)97 the vcpu to sleep until occurrence of an appropriate event. Another vcpu of the
88is used in the hypercall for future use.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.
89 101
90 102
916. KVM_HC_CLOCK_PAIRING1036. KVM_HC_CLOCK_PAIRING
92------------------------104-----------------------
93Architecture: x86105:Architecture: x86
94Status: active106:Status: active
95Purpose: Hypercall used to synchronize host and guest clocks.107:Purpose: Hypercall used to synchronize host and guest clocks.
108
96Usage:109Usage:
97 110
98a0: guest physical address where host copies111a0: guest physical address where host copies
@@ -101,6 +114,8 @@ a0: guest physical address where host copies · 2 unmodified lines
101a1: clock_type, ATM only KVM_CLOCK_PAIRING_WALLCLOCK (0)114a1: clock_type, ATM only KVM_CLOCK_PAIRING_WALLCLOCK (0)
102is supported (corresponding to the host's CLOCK_REALTIME clock).115is supported (corresponding to the host's CLOCK_REALTIME clock).
103 116
117 ::
118
104 struct kvm_clock_pairing {119 struct kvm_clock_pairing {
105 __s64 sec;120 __s64 sec;
106 __s64 nsec;121 __s64 nsec;
@@ -123,15 +138,16 @@ Returns KVM_EOPNOTSUPP if the host does not use TSC clocksource, · 16 unmodified lines
123or if clock type is different than KVM_CLOCK_PAIRING_WALLCLOCK.138or if clock type is different than KVM_CLOCK_PAIRING_WALLCLOCK.
124 139
1256. KVM_HC_SEND_IPI1406. KVM_HC_SEND_IPI
126------------------------141------------------
127Architecture: x86142
128Status: active143:Architecture: x86
129Purpose: Send IPIs to multiple vCPUs.144:Status: active
145:Purpose: Send IPIs to multiple vCPUs.
130 146
131a0: lower part of the bitmap of destination APIC IDs147- a0: lower part of the bitmap of destination APIC IDs
132a1: higher part of the bitmap of destination APIC IDs148- a1: higher part of the bitmap of destination APIC IDs
133a2: the lowest APIC ID in bitmap149- a2: the lowest APIC ID in bitmap
134a3: APIC ICR150- a3: APIC ICR
135 151
136The hypercall lets a guest send multicast IPIs, with at most 128152The hypercall lets a guest send multicast IPIs, with at most 128
137128 destinations per hypercall in 64-bit mode and 64 vCPUs per153128 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
143Returns the number of CPUs to which the IPIs were delivered successfully.159Returns the number of CPUs to which the IPIs were delivered successfully.
144 160
1457. KVM_HC_SCHED_YIELD1617. KVM_HC_SCHED_YIELD
146------------------------162---------------------
147Architecture: x86163
148Status: active164:Architecture: x86
149Purpose: Hypercall used to yield if the IPI target vCPU is preempted165:Status: active
166:Purpose: Hypercall used to yield if the IPI target vCPU is preempted
150 167
151a0: destination APIC ID168a0: destination APIC ID
152 169
153Usage example: When sending a call-function IPI-many to vCPUs, yield if170:Usage example: When sending a call-function IPI-many to vCPUs, yield if
154any of the IPI target vCPUs was preempted.171 any of the IPI target vCPUs was preempted.
Documentation/virt/kvm/index.rst+16−0
@@ -7,6 +7,22 @@ KVM · 6 unmodified lines
7.. toctree::7.. toctree::
8 :maxdepth: 28 :maxdepth: 2
9 9
10 api
10 amd-memory-encryption11 amd-memory-encryption
11 cpuid12 cpuid
13 halt-polling
14 hypercalls
15 locking
16 mmu
17 msr
18 nested-vmx
19 ppc-pv
20 s390-diag
21 timekeeping
12 vcpu-requests22 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=================
4KVM Lock Overview
5=================
6
71. Acquisition Orders
8---------------------
9
10The 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
19On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock.
20
21Everything else is a leaf: no other lock is taken inside the critical
22sections.
23
242. Exception
25------------
26
27Fast page fault:
28
29Fast page fault is the fast path which fixes the guest page fault out of
30the mmu-lock on x86. Currently, the page fault can be fast in one of the
31following two cases:
32
331. 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
372. 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
41What we use to avoid all the race is the SPTE_HOST_WRITEABLE bit and
42SPTE_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
49On fast page fault path, we will use cmpxchg to atomically set the spte W
50bit if spte.SPTE_HOST_WRITEABLE = 1 and spte.SPTE_WRITE_PROTECT = 1, or
51restore the saved R/X bits if VMX_EPT_TRACK_ACCESS mask is set, or both. This
52is safe because whenever changing these bits can be detected by cmpxchg.
53
54But we need carefully check these cases:
55
561) The mapping from gfn to pfn
57
58The mapping from gfn to pfn may be changed since we can only ensure the pfn
59is not changed during cmpxchg. This is a ABA problem, for example, below case
60will 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
96We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.
97
98For direct sp, we can easily avoid it since the spte of direct sp is fixed
99to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
100to 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
107Then, we can ensure the dirty bitmaps is correctly set for a gfn.
108
109Currently, to simplify the whole things, we disable fast page fault for
110indirect shadow page.
111
1122) Dirty bit tracking
113
114In the origin code, the spte can be fast updated (non-atomically) if the
115spte is read-only and the Accessed bit has already been set since the
116Accessed bit and Dirty bit can not be lost.
117
118But it is not true after fast page fault since the spte can be marked
119writable 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
158The Dirty bit is lost in this case.
159
160In order to avoid this kind of issue, we always treat the spte as "volatile"
161if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means,
162the spte is always atomically updated in this case.
163
1643) flush tlbs due to spte updated
165
166If the spte is updated from writable to readonly, we should flush all TLBs,
167otherwise rmap_write_protect will find a read-only spte, even though the
168writable spte might be cached on a CPU's TLB.
169
170As mentioned before, the spte can be updated to writable out of mmu-lock on
171fast page fault path, in order to easily audit the path, we see if TLBs need
172be flushed caused by this reason in mmu_spte_update() since this is a common
173function to update spte (present -> present).
174
175Since the spte is "volatile" if it can be updated out of mmu-lock, we always
176atomically update the spte, the race caused by fast page fault can be avoided,
177See the comments in spte_has_volatile_bits() and mmu_spte_update().
178
179Lockless Access Tracking:
180
181This is used for Intel CPUs that are using EPT but do not support the EPT A/D
182bits. In this case, when the KVM MMU notifier is called to track accesses to a
183page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present
184by clearing the RWX bits in the PTE and storing the original R & X bits in
185some unused/ignored bits. In addition, the SPTE_SPECIAL_MASK is also set on the
186PTE (using the ignored bit 62). When the VM tries to access the page later on,
187a fault is generated and the fast page fault mechanism described above is used
188to atomically restore the PTE to a Present state. The W bit is not saved when
189the PTE is marked for access tracking and during restoration to the Present
190state, the W bit is set depending on whether or not it was a write access. If
191it wasn't, then the W bit will remain clear until a write access happens, at
192which time it will be set using the Dirty tracking mechanism described above.
193
1943. 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 @@
1KVM Lock Overview
2=================
3
41. Acquisition Orders
5---------------------
6
7The 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
16On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock.
17
18Everything else is a leaf: no other lock is taken inside the critical
19sections.
20
212: Exception
22------------
23
24Fast page fault:
25
26Fast page fault is the fast path which fixes the guest page fault out of
27the mmu-lock on x86. Currently, the page fault can be fast in one of the
28following two cases:
29
301. Access Tracking: The SPTE is not present, but it is marked for access
31tracking i.e. the SPTE_SPECIAL_MASK is set. That means we need to
32restore the saved R/X bits. This is described in more detail later below.
33
342. Write-Protection: The SPTE is present and the fault is
35caused by write-protect. That means we just need to change the W bit of the
36spte.
37
38What we use to avoid all the race is the SPTE_HOST_WRITEABLE bit and
39SPTE_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
45On fast page fault path, we will use cmpxchg to atomically set the spte W
46bit if spte.SPTE_HOST_WRITEABLE = 1 and spte.SPTE_WRITE_PROTECT = 1, or
47restore the saved R/X bits if VMX_EPT_TRACK_ACCESS mask is set, or both. This
48is safe because whenever changing these bits can be detected by cmpxchg.
49
50But we need carefully check these cases:
511): The mapping from gfn to pfn
52The mapping from gfn to pfn may be changed since we can only ensure the pfn
53is not changed during cmpxchg. This is a ABA problem, for example, below case
54will happen:
55
56At the beginning:
57gpte = gfn1
58gfn1 is mapped to pfn1 on host
59spte is the shadow page table entry corresponding with gpte and
60spte = pfn1
61
62 VCPU 0 VCPU0
63on 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
79We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.
80
81For direct sp, we can easily avoid it since the spte of direct sp is fixed
82to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
83to 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
89Then, we can ensure the dirty bitmaps is correctly set for a gfn.
90
91Currently, to simplify the whole things, we disable fast page fault for
92indirect shadow page.
93
942): Dirty bit tracking
95In the origin code, the spte can be fast updated (non-atomically) if the
96spte is read-only and the Accessed bit has already been set since the
97Accessed bit and Dirty bit can not be lost.
98
99But it is not true after fast page fault since the spte can be marked
100writable between reading spte and updating spte. Like below case:
101
102At the beginning:
103spte.W = 0
104spte.Accessed = 1
105
106 VCPU 0 VCPU0
107In 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
131The Dirty bit is lost in this case.
132
133In order to avoid this kind of issue, we always treat the spte as "volatile"
134if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means,
135the spte is always atomically updated in this case.
136
1373): flush tlbs due to spte updated
138If the spte is updated from writable to readonly, we should flush all TLBs,
139otherwise rmap_write_protect will find a read-only spte, even though the
140writable spte might be cached on a CPU's TLB.
141
142As mentioned before, the spte can be updated to writable out of mmu-lock on
143fast page fault path, in order to easily audit the path, we see if TLBs need
144be flushed caused by this reason in mmu_spte_update() since this is a common
145function to update spte (present -> present).
146
147Since the spte is "volatile" if it can be updated out of mmu-lock, we always
148atomically update the spte, the race caused by fast page fault can be avoided,
149See the comments in spte_has_volatile_bits() and mmu_spte_update().
150
151Lockless Access Tracking:
152
153This is used for Intel CPUs that are using EPT but do not support the EPT A/D
154bits. In this case, when the KVM MMU notifier is called to track accesses to a
155page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present
156by clearing the RWX bits in the PTE and storing the original R & X bits in
157some unused/ignored bits. In addition, the SPTE_SPECIAL_MASK is also set on the
158PTE (using the ignored bit 62). When the VM tries to access the page later on,
159a fault is generated and the fast page fault mechanism described above is used
160to atomically restore the PTE to a Present state. The W bit is not saved when
161the PTE is marked for access tracking and during restoration to the Present
162state, the W bit is set depending on whether or not it was a write access. If
163it wasn't, then the W bit will remain clear until a write access happens, at
164which time it will be set using the Dirty tracking mechanism described above.
165
1663. Reference
167------------
168
169Name: kvm_lock
170Type: mutex
171Arch: any
172Protects: - vm_list
173
174Name: kvm_count_lock
175Type: raw_spinlock_t
176Arch: any
177Protects: - hardware virtualization enable/disable
178Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
179 migration.
180
181Name: kvm_arch::tsc_write_lock
182Type: raw_spinlock
183Arch: x86
184Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
185 - tsc offset in vmcb
186Comment: 'raw' because updating the tsc offsets must not be preempted.
187
188Name: kvm->mmu_lock
189Type: spinlock_t
190Arch: any
191Protects: -shadow page/shadow tlb entry
192Comment: it is a spinlock since it is used in mmu notifier.
193
194Name: kvm->srcu
195Type: srcu lock
196Arch: any
197Protects: - kvm->memslots
198 - kvm->buses
199Comment: 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
205Name: blocked_vcpu_on_cpu_lock
206Type: spinlock_t
207Arch: x86
208Protects: blocked_vcpu_on_cpu
209Comment: 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======================
1The x86 kvm shadow mmu4The x86 kvm shadow mmu
2======================5======================
3 6
@@ -7,27 +10,37 @@ physical addresses to host physical addresses. · 3 unmodified lines
7 10
8The mmu code attempts to satisfy the following requirements:11The mmu code attempts to satisfy the following requirements:
9 12
10- correctness: the guest should not be able to determine that it is running13- correctness:
14 the guest should not be able to determine that it is running
11 on an emulated mmu except for timing (we attempt to comply15 on an emulated mmu except for timing (we attempt to comply
12 with the specification, not emulate the characteristics of16 with the specification, not emulate the characteristics of
13 a particular implementation such as tlb size)17 a particular implementation such as tlb size)
14- security: the guest must not be able to touch host memory not assigned18- security:
19 the guest must not be able to touch host memory not assigned
15 to it20 to it
16- performance: minimize the performance penalty imposed by the mmu21- performance:
17- scaling: need to scale to large memory and large vcpu guests22 minimize the performance penalty imposed by the mmu
18- hardware: support the full range of x86 virtualization hardware23- scaling:
19- integration: Linux memory management code must be in control of guest memory24 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
20 so that swapping, page migration, page merging, transparent29 so that swapping, page migration, page merging, transparent
21 hugepages, and similar features work without change30 hugepages, and similar features work without change
22- dirty tracking: report writes to guest memory to enable live migration31- dirty tracking:
32 report writes to guest memory to enable live migration
23 and framebuffer-based displays33 and framebuffer-based displays
24- footprint: keep the amount of pinned kernel memory low (most memory34- footprint:
35 keep the amount of pinned kernel memory low (most memory
25 should be shrinkable)36 should be shrinkable)
26- reliability: avoid multipage or GFP_ATOMIC allocations37- reliability:
38 avoid multipage or GFP_ATOMIC allocations
27 39
28Acronyms40Acronyms
29========41========
30 42
43==== ====================================================================
31pfn host page frame number44pfn host page frame number
32hpa host physical address45hpa host physical address
33hva host virtual address46hva host virtual address
@@ -41,6 +54,7 @@ pte page table entry (used also to refer generically to paging structure · 7 unmodified lines
41gpte guest pte (referring to gfns)54gpte guest pte (referring to gfns)
42spte shadow pte (referring to pfns)55spte shadow pte (referring to pfns)
43tdp two dimensional paging (vendor neutral term for NPT and EPT)56tdp two dimensional paging (vendor neutral term for NPT and EPT)
57==== ====================================================================
44 58
45Virtual and real hardware supported59Virtual and real hardware supported
46===================================60===================================
@@ -90,11 +104,13 @@ Events · 43 unmodified lines
90The mmu is driven by events, some from the guest, some from the host.104The mmu is driven by events, some from the guest, some from the host.
91 105
92Guest generated events:106Guest generated events:
107
93- writes to control registers (especially cr3)108- writes to control registers (especially cr3)
94- invlpg/invlpga instruction execution109- invlpg/invlpga instruction execution
95- access to missing or protected translations110- access to missing or protected translations
96 111
97Host generated events:112Host generated events:
113
98- changes in the gpa->hpa translation (either through gpa->hva changes or114- changes in the gpa->hpa translation (either through gpa->hva changes or
99 through hva->hpa changes)115 through hva->hpa changes)
100- memory pressure (the shrinker)116- memory pressure (the shrinker)
@@ -117,16 +133,19 @@ Leaf ptes point at guest pages. · 16 unmodified lines
117The following table shows translations encoded by leaf ptes, with higher-level133The following table shows translations encoded by leaf ptes, with higher-level
118translations in parentheses:134translations in parentheses:
119 135
120 Non-nested guests:136 Non-nested guests::
137
121 nonpaging: gpa->hpa138 nonpaging: gpa->hpa
122 paging: gva->gpa->hpa139 paging: gva->gpa->hpa
123 paging, tdp: (gva->)gpa->hpa140 paging, tdp: (gva->)gpa->hpa
124 Nested guests:141
142 Nested guests::
143
125 non-tdp: ngva->gpa->hpa (*)144 non-tdp: ngva->gpa->hpa (*)
126 tdp: (ngva->)ngpa->gpa->hpa145 tdp: (ngva->)ngpa->gpa->hpa
127 146
128(*) the guest hypervisor will encode the ngva->gpa translation into its page147 (*) the guest hypervisor will encode the ngva->gpa translation into its page
129 tables if npt is not present148 tables if npt is not present
130 149
131Shadow pages contain the following information:150Shadow pages contain the following information:
132 role.level:151 role.level:
@@ -291,28 +310,41 @@ Handling a page fault is performed as follows: · 158 unmodified lines
291 310
292 - if the RSV bit of the error code is set, the page fault is caused by guest311 - if the RSV bit of the error code is set, the page fault is caused by guest
293 accessing MMIO and cached MMIO information is available.312 accessing MMIO and cached MMIO information is available.
313
294 - walk shadow page table314 - walk shadow page table
295 - check for valid generation number in the spte (see "Fast invalidation of315 - check for valid generation number in the spte (see "Fast invalidation of
296 MMIO sptes" below)316 MMIO sptes" below)
297 - cache the information to vcpu->arch.mmio_gva, vcpu->arch.mmio_access and317 - cache the information to vcpu->arch.mmio_gva, vcpu->arch.mmio_access and
298 vcpu->arch.mmio_gfn, and call the emulator318 vcpu->arch.mmio_gfn, and call the emulator
319
299 - If both P bit and R/W bit of error code are set, this could possibly320 - If both P bit and R/W bit of error code are set, this could possibly
300 be handled as a "fast page fault" (fixed without taking the MMU lock). See321 be handled as a "fast page fault" (fixed without taking the MMU lock). See
301 the description in Documentation/virt/kvm/locking.txt.322 the description in Documentation/virt/kvm/locking.txt.
323
302 - if needed, walk the guest page tables to determine the guest translation324 - if needed, walk the guest page tables to determine the guest translation
303 (gva->gpa or ngpa->gpa)325 (gva->gpa or ngpa->gpa)
326
304 - if permissions are insufficient, reflect the fault back to the guest327 - if permissions are insufficient, reflect the fault back to the guest
328
305 - determine the host page329 - determine the host page
330
306 - if this is an mmio request, there is no host page; cache the info to331 - if this is an mmio request, there is no host page; cache the info to
307 vcpu->arch.mmio_gva, vcpu->arch.mmio_access and vcpu->arch.mmio_gfn332 vcpu->arch.mmio_gva, vcpu->arch.mmio_access and vcpu->arch.mmio_gfn
333
308 - walk the shadow page table to find the spte for the translation,334 - walk the shadow page table to find the spte for the translation,
309 instantiating missing intermediate page tables as necessary335 instantiating missing intermediate page tables as necessary
336
310 - If this is an mmio request, cache the mmio info to the spte and set some337 - If this is an mmio request, cache the mmio info to the spte and set some
311 reserved bit on the spte (see callers of kvm_mmu_set_mmio_spte_mask)338 reserved bit on the spte (see callers of kvm_mmu_set_mmio_spte_mask)
339
312 - try to unsynchronize the page340 - try to unsynchronize the page
341
313 - if successful, we can let the guest continue and modify the gpte342 - if successful, we can let the guest continue and modify the gpte
343
314 - emulate the instruction344 - emulate the instruction
345
315 - if failed, unshadow the page and let the guest continue346 - if failed, unshadow the page and let the guest continue
347
316 - update any translations that were modified by the instruction348 - update any translations that were modified by the instruction
317 349
318invlpg handling:350invlpg handling:
@@ -324,10 +356,12 @@ invlpg handling: · 5 unmodified lines
324Guest control register updates:356Guest control register updates:
325 357
326- mov to cr3358- mov to cr3
359
327 - look up new shadow roots360 - look up new shadow roots
328 - synchronize newly reachable shadow pages361 - synchronize newly reachable shadow pages
329 362
330- mov to cr0/cr4/efer363- mov to cr0/cr4/efer
364
331 - set up mmu context for new paging mode365 - set up mmu context for new paging mode
332 - look up new shadow roots366 - look up new shadow roots
333 - synchronize newly reachable shadow pages367 - synchronize newly reachable shadow pages
@@ -358,6 +392,7 @@ on fault type: · 24 unmodified lines
358(user write faults generate a #PF)392(user write faults generate a #PF)
359 393
360In the first case there are two additional complications:394In the first case there are two additional complications:
395
361- if CR4.SMEP is enabled: since we've turned the page into a kernel page,396- if CR4.SMEP is enabled: since we've turned the page into a kernel page,
362 the kernel may now execute it. We handle this by also setting spte.nx.397 the kernel may now execute it. We handle this by also setting spte.nx.
363 If we get a user fetch or read fault, we'll change spte.u=1 and398 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
446 481
447- NPT presentation from KVM Forum 2008482- NPT presentation from KVM Forum 2008
448 http://www.linux-kvm.org/images/c/c8/KvmForum2008%24kdf2008_21.pdf483 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 @@
1KVM-specific MSRs.1.. SPDX-License-Identifier: GPL-2.0
2Glauber Costa <glommer@redhat.com>, Red Hat Inc, 20102
3=====================================================3=================
4KVM-specific MSRs
5=================
6
7:Author: Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010
4 8
5KVM makes use of some custom MSRs to service some requests.9KVM makes use of some custom MSRs to service some requests.
6 10
@@ -9,34 +13,39 @@ Custom MSRs have a range reserved for them, that goes from · 2 unmodified lines
9but they are deprecated and their use is discouraged.13but they are deprecated and their use is discouraged.
10 14
11Custom MSR list15Custom MSR list
12--------16---------------
13 17
14The current supported Custom MSR list is:18The current supported Custom MSR list is:
15 19
16MSR_KVM_WALL_CLOCK_NEW: 0x4b564d0020MSR_KVM_WALL_CLOCK_NEW:
21 0x4b564d00
17 22
18 data: 4-byte alignment physical address of a memory area which must be23data:
24 4-byte alignment physical address of a memory area which must be
19 in guest RAM. This memory is expected to hold a copy of the following25 in guest RAM. This memory is expected to hold a copy of the following
20 structure:26 structure::
21 27
22 struct pvclock_wall_clock {28 struct pvclock_wall_clock {
23 u32 version;29 u32 version;
24 u32 sec;30 u32 sec;
25 u32 nsec;31 u32 nsec;
26 } __attribute__((__packed__));32 } __attribute__((__packed__));
27 33
28 whose data will be filled in by the hypervisor. The hypervisor is only34 whose data will be filled in by the hypervisor. The hypervisor is only
29 guaranteed to update this data at the moment of MSR write.35 guaranteed to update this data at the moment of MSR write.
30 Users that want to reliably query this information more than once have36 Users that want to reliably query this information more than once have
31 to write more than once to this MSR. Fields have the following meanings:37 to write more than once to this MSR. Fields have the following meanings:
32 38
33 version: guest has to check version before and after grabbing39 version:
40 guest has to check version before and after grabbing
34 time information and check that they are both equal and even.41 time information and check that they are both equal and even.
35 An odd version indicates an in-progress update.42 An odd version indicates an in-progress update.
36 43
37 sec: number of seconds for wallclock at time of boot.44 sec:
45 number of seconds for wallclock at time of boot.
38 46
39 nsec: number of nanoseconds for wallclock at time of boot.47 nsec:
48 number of nanoseconds for wallclock at time of boot.
40 49
41 In order to get the current wallclock time, the system_time from50 In order to get the current wallclock time, the system_time from
42 MSR_KVM_SYSTEM_TIME_NEW needs to be added.51 MSR_KVM_SYSTEM_TIME_NEW needs to be added.
@@ -47,13 +56,15 @@ MSR_KVM_WALL_CLOCK_NEW: 0x4b564d00 · 4 unmodified lines
47 Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid56 Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid
48 leaf prior to usage.57 leaf prior to usage.
49 58
50MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d0159MSR_KVM_SYSTEM_TIME_NEW:
60 0x4b564d01
51 61
52 data: 4-byte aligned physical address of a memory area which must be in62data:
63 4-byte aligned physical address of a memory area which must be in
53 guest RAM, plus an enable bit in bit 0. This memory is expected to hold64 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::
55 66
56 struct pvclock_vcpu_time_info {67 struct pvclock_vcpu_time_info {
57 u32 version;68 u32 version;
58 u32 pad0;69 u32 pad0;
59 u64 tsc_timestamp;70 u64 tsc_timestamp;
@@ -62,7 +73,7 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 2 unmodified lines
62 s8 tsc_shift;73 s8 tsc_shift;
63 u8 flags;74 u8 flags;
64 u8 pad[2];75 u8 pad[2];
65 } __attribute__((__packed__)); /* 32 bytes */76 } __attribute__((__packed__)); /* 32 bytes */
66 77
67 whose data will be filled in by the hypervisor periodically. Only one78 whose data will be filled in by the hypervisor periodically. Only one
68 write, or registration, is needed for each VCPU. The interval between79 write, or registration, is needed for each VCPU. The interval between
@@ -72,23 +83,28 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 3 unmodified lines
72 83
73 Fields have the following meanings:84 Fields have the following meanings:
74 85
75 version: guest has to check version before and after grabbing86 version:
87 guest has to check version before and after grabbing
76 time information and check that they are both equal and even.88 time information and check that they are both equal and even.
77 An odd version indicates an in-progress update.89 An odd version indicates an in-progress update.
78 90
79 tsc_timestamp: the tsc value at the current VCPU at the time91 tsc_timestamp:
92 the tsc value at the current VCPU at the time
80 of the update of this structure. Guests can subtract this value93 of the update of this structure. Guests can subtract this value
81 from current tsc to derive a notion of elapsed time since the94 from current tsc to derive a notion of elapsed time since the
82 structure update.95 structure update.
83 96
84 system_time: a host notion of monotonic time, including sleep97 system_time:
98 a host notion of monotonic time, including sleep
85 time at the time this structure was last updated. Unit is99 time at the time this structure was last updated. Unit is
86 nanoseconds.100 nanoseconds.
87 101
88 tsc_to_system_mul: multiplier to be used when converting102 tsc_to_system_mul:
103 multiplier to be used when converting
89 tsc-related quantity to nanoseconds104 tsc-related quantity to nanoseconds
90 105
91 tsc_shift: shift to be used when converting tsc-related106 tsc_shift:
107 shift to be used when converting tsc-related
92 quantity to nanoseconds. This shift will ensure that108 quantity to nanoseconds. This shift will ensure that
93 multiplication with tsc_to_system_mul does not overflow.109 multiplication with tsc_to_system_mul does not overflow.
94 A positive value denotes a left shift, a negative value110 A positive value denotes a left shift, a negative value
@@ -96,7 +112,7 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 1 unmodified line
96 112
97 The conversion from tsc to nanoseconds involves an additional113 The conversion from tsc to nanoseconds involves an additional
98 right shift by 32 bits. With this information, guests can114 right shift by 32 bits. With this information, guests can
99 derive per-CPU time by doing:115 derive per-CPU time by doing::
100 116
101 time = (current_tsc - tsc_timestamp)117 time = (current_tsc - tsc_timestamp)
102 if (tsc_shift >= 0)118 if (tsc_shift >= 0)
@@ -106,29 +122,34 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 3 unmodified lines
106 time = (time * tsc_to_system_mul) >> 32122 time = (time * tsc_to_system_mul) >> 32
107 time = time + system_time123 time = time + system_time
108 124
109 flags: bits in this field indicate extended capabilities125 flags:
126 bits in this field indicate extended capabilities
110 coordinated between the guest and the hypervisor. Availability127 coordinated between the guest and the hypervisor. Availability
111 of specific flags has to be checked in 0x40000001 cpuid leaf.128 of specific flags has to be checked in 0x40000001 cpuid leaf.
112 Current flags are:129 Current flags are:
113 130
114 flag bit | cpuid bit | meaning131
115 -------------------------------------------------------------132 +-----------+--------------+----------------------------------+
116 | | time measures taken across133 | flag bit | cpuid bit | meaning |
117 0 | 24 | multiple cpus are guaranteed to134 +-----------+--------------+----------------------------------+
118 | | be monotonic135 | | | time measures taken across |
119 -------------------------------------------------------------136 | 0 | 24 | multiple cpus are guaranteed to |
120 | | guest vcpu has been paused by137 | | | be monotonic |
121 1 | N/A | the host138 +-----------+--------------+----------------------------------+
122 | | See 4.70 in api.txt139 | | | guest vcpu has been paused by |
123 -------------------------------------------------------------140 | 1 | N/A | the host |
141 | | | See 4.70 in api.txt |
142 +-----------+--------------+----------------------------------+
124 143
125 Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid144 Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid
126 leaf prior to usage.145 leaf prior to usage.
127 146
128 147
129MSR_KVM_WALL_CLOCK: 0x11148MSR_KVM_WALL_CLOCK:
149 0x11
130 150
131 data and functioning: same as MSR_KVM_WALL_CLOCK_NEW. Use that instead.151data and functioning:
152 same as MSR_KVM_WALL_CLOCK_NEW. Use that instead.
132 153
133 This MSR falls outside the reserved KVM range and may be removed in the154 This MSR falls outside the reserved KVM range and may be removed in the
134 future. Its usage is deprecated.155 future. Its usage is deprecated.
@@ -136,9 +157,11 @@ MSR_KVM_WALL_CLOCK: 0x11 · 1 unmodified line
136 Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid157 Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid
137 leaf prior to usage.158 leaf prior to usage.
138 159
139MSR_KVM_SYSTEM_TIME: 0x12160MSR_KVM_SYSTEM_TIME:
161 0x12
140 162
141 data and functioning: same as MSR_KVM_SYSTEM_TIME_NEW. Use that instead.163data and functioning:
164 same as MSR_KVM_SYSTEM_TIME_NEW. Use that instead.
142 165
143 This MSR falls outside the reserved KVM range and may be removed in the166 This MSR falls outside the reserved KVM range and may be removed in the
144 future. Its usage is deprecated.167 future. Its usage is deprecated.
@@ -146,7 +169,7 @@ MSR_KVM_SYSTEM_TIME: 0x12 · 1 unmodified line
146 Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid169 Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid
147 leaf prior to usage.170 leaf prior to usage.
148 171
149 The suggested algorithm for detecting kvmclock presence is then:172 The suggested algorithm for detecting kvmclock presence is then::
150 173
151 if (!kvm_para_available()) /* refer to cpuid.txt */174 if (!kvm_para_available()) /* refer to cpuid.txt */
152 return NON_PRESENT;175 return NON_PRESENT;
@@ -163,8 +186,11 @@ MSR_KVM_SYSTEM_TIME: 0x12 · 10 unmodified lines
163 } else186 } else
164 return NON_PRESENT;187 return NON_PRESENT;
165 188
166MSR_KVM_ASYNC_PF_EN: 0x4b564d02189MSR_KVM_ASYNC_PF_EN:
167 data: Bits 63-6 hold 64-byte aligned physical address of a190 0x4b564d02
191
192data:
193 Bits 63-6 hold 64-byte aligned physical address of a
168 64 byte memory area which must be in guest RAM and must be194 64 byte memory area which must be in guest RAM and must be
169 zeroed. Bits 5-3 are reserved and should be zero. Bit 0 is 1195 zeroed. Bits 5-3 are reserved and should be zero. Bit 0 is 1
170 when asynchronous page faults are enabled on the vcpu 0 when196 when asynchronous page faults are enabled on the vcpu 0 when
@@ -200,20 +226,22 @@ MSR_KVM_ASYNC_PF_EN: 0x4b564d02 · 29 unmodified lines
200 Currently type 2 APF will be always delivered on the same vcpu as226 Currently type 2 APF will be always delivered on the same vcpu as
201 type 1 was, but guest should not rely on that.227 type 1 was, but guest should not rely on that.
202 228
203MSR_KVM_STEAL_TIME: 0x4b564d03229MSR_KVM_STEAL_TIME:
230 0x4b564d03
204 231
205 data: 64-byte alignment physical address of a memory area which must be232data:
233 64-byte alignment physical address of a memory area which must be
206 in guest RAM, plus an enable bit in bit 0. This memory is expected to234 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::
208 236
209 struct kvm_steal_time {237 struct kvm_steal_time {
210 __u64 steal;238 __u64 steal;
211 __u32 version;239 __u32 version;
212 __u32 flags;240 __u32 flags;
213 __u8 preempted;241 __u8 preempted;
214 __u8 u8_pad[3];242 __u8 u8_pad[3];
215 __u32 pad[11];243 __u32 pad[11];
216 }244 }
217 245
218 whose data will be filled in by the hypervisor periodically. Only one246 whose data will be filled in by the hypervisor periodically. Only one
219 write, or registration, is needed for each VCPU. The interval between247 write, or registration, is needed for each VCPU. The interval between
@@ -224,25 +252,32 @@ MSR_KVM_STEAL_TIME: 0x4b564d03 · 4 unmodified lines
224 252
225 Fields have the following meanings:253 Fields have the following meanings:
226 254
227 version: a sequence counter. In other words, guest has to check255 version:
256 a sequence counter. In other words, guest has to check
228 this field before and after grabbing time information and make257 this field before and after grabbing time information and make
229 sure they are both equal and even. An odd version indicates an258 sure they are both equal and even. An odd version indicates an
230 in-progress update.259 in-progress update.
231 260
232 flags: At this point, always zero. May be used to indicate261 flags:
262 At this point, always zero. May be used to indicate
233 changes in this structure in the future.263 changes in this structure in the future.
234 264
235 steal: the amount of time in which this vCPU did not run, in265 steal:
266 the amount of time in which this vCPU did not run, in
236 nanoseconds. Time during which the vcpu is idle, will not be267 nanoseconds. Time during which the vcpu is idle, will not be
237 reported as steal time.268 reported as steal time.
238 269
239 preempted: indicate the vCPU who owns this struct is running or270 preempted:
271 indicate the vCPU who owns this struct is running or
240 not. Non-zero values mean the vCPU has been preempted. Zero272 not. Non-zero values mean the vCPU has been preempted. Zero
241 means the vCPU is not preempted. NOTE, it is always zero if the273 means the vCPU is not preempted. NOTE, it is always zero if the
242 the hypervisor doesn't support this field.274 the hypervisor doesn't support this field.
243 275
244MSR_KVM_EOI_EN: 0x4b564d04276MSR_KVM_EOI_EN:
245 data: Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0277 0x4b564d04
278
279data:
280 Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0
246 when disabled. Bit 1 is reserved and must be zero. When PV end of281 when disabled. Bit 1 is reserved and must be zero. When PV end of
247 interrupt is enabled (bit 0 set), bits 63-2 hold a 4-byte aligned282 interrupt is enabled (bit 0 set), bits 63-2 hold a 4-byte aligned
248 physical address of a 4 byte memory area which must be in guest RAM and283 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
274 clear it using a single CPU instruction, such as test and clear, or309 clear it using a single CPU instruction, such as test and clear, or
275 compare and exchange.310 compare and exchange.
276 311
277MSR_KVM_POLL_CONTROL: 0x4b564d05312MSR_KVM_POLL_CONTROL:
313 0x4b564d05
314
278 Control host-side polling.315 Control host-side polling.
279 316
280 data: Bit 0 enables (1) or disables (0) host-side HLT polling logic.317data:
318 Bit 0 enables (1) or disables (0) host-side HLT polling logic.
281 319
282 KVM guests can request the host not to poll on HLT, for example if320 KVM guests can request the host not to poll on HLT, for example if
283 they are performing polling themselves.321 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==========
1Nested VMX4Nested VMX
2==========5==========
3 6
@@ -41,9 +44,9 @@ No modifications are required to user space (qemu). However, qemu's default · 37 unmodified lines
41emulated CPU type (qemu64) does not list the "VMX" CPU feature, so it must be44emulated CPU type (qemu64) does not list the "VMX" CPU feature, so it must be
42explicitly enabled, by giving qemu one of the following options:45explicitly enabled, by giving qemu one of the following options:
43 46
44 -cpu host (emulated CPU has all features of the real CPU)47 - cpu host (emulated CPU has all features of the real CPU)
45 48
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)
47 50
48 51
49ABIs52ABIs
@@ -75,6 +78,8 @@ of this structure changes, this can break live migration across KVM versions. · 25 unmodified lines
75VMCS12_REVISION (from vmx.c) should be changed if struct vmcs12 or its inner78VMCS12_REVISION (from vmx.c) should be changed if struct vmcs12 or its inner
76struct shadow_vmcs is ever changed.79struct shadow_vmcs is ever changed.
77 80
81::
82
78 typedef u64 natural_width;83 typedef u64 natural_width;
79 struct __packed vmcs12 {84 struct __packed vmcs12 {
80 /* According to the Intel spec, a VMCS region must start with85 /* According to the Intel spec, a VMCS region must start with
@@ -220,21 +225,21 @@ Authors · 139 unmodified lines
220-------225-------
221 226
222These patches were written by:227These patches were written by:
223 Abel Gordon, abelg <at> il.ibm.com228 - Abel Gordon, abelg <at> il.ibm.com
224 Nadav Har'El, nyh <at> il.ibm.com229 - Nadav Har'El, nyh <at> il.ibm.com
225 Orit Wasserman, oritw <at> il.ibm.com230 - Orit Wasserman, oritw <at> il.ibm.com
226 Ben-Ami Yassor, benami <at> il.ibm.com231 - Ben-Ami Yassor, benami <at> il.ibm.com
227 Muli Ben-Yehuda, muli <at> il.ibm.com232 - Muli Ben-Yehuda, muli <at> il.ibm.com
228 233
229With contributions by:234With contributions by:
230 Anthony Liguori, aliguori <at> us.ibm.com235 - Anthony Liguori, aliguori <at> us.ibm.com
231 Mike Day, mdday <at> us.ibm.com236 - Mike Day, mdday <at> us.ibm.com
232 Michael Factor, factor <at> il.ibm.com237 - Michael Factor, factor <at> il.ibm.com
233 Zvi Dubitzky, dubi <at> il.ibm.com238 - Zvi Dubitzky, dubi <at> il.ibm.com
234 239
235And valuable reviews by:240And valuable reviews by:
236 Avi Kivity, avi <at> redhat.com241 - Avi Kivity, avi <at> redhat.com
237 Gleb Natapov, gleb <at> redhat.com242 - Gleb Natapov, gleb <at> redhat.com
238 Marcelo Tosatti, mtosatti <at> redhat.com243 - Marcelo Tosatti, mtosatti <at> redhat.com
239 Kevin Tian, kevin.tian <at> intel.com244 - Kevin Tian, kevin.tian <at> intel.com
240 and others.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=================================
1The PPC KVM paravirtual interface4The PPC KVM paravirtual interface
2=================================5=================================
3 6
@@ -34,8 +37,9 @@ up the hypercall. To call a hypercall, just call these instructions. · 30 unmodified lines
34 37
35The parameters are as follows:38The parameters are as follows:
36 39
40 ======== ================ ================
37 Register IN OUT41 Register IN OUT
38 42 ======== ================ ================
39 r0 - volatile43 r0 - volatile
40 r3 1st parameter Return code44 r3 1st parameter Return code
41 r4 2nd parameter 1st output value45 r4 2nd parameter 1st output value
@@ -47,6 +51,7 @@ The parameters are as follows: · 5 unmodified lines
47 r10 8th parameter 7th output value51 r10 8th parameter 7th output value
48 r11 hypercall number 8th output value52 r11 hypercall number 8th output value
49 r12 - volatile53 r12 - volatile
54 ======== ================ ================
50 55
51Hypercall definitions are shared in generic code, so the same hypercall numbers56Hypercall definitions are shared in generic code, so the same hypercall numbers
52apply for x86 and powerpc alike with the exception that each KVM hypercall57apply 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
54 59
55Return codes can be as follows:60Return codes can be as follows:
56 61
62 ==== =========================
57 Code Meaning63 Code Meaning
58 64 ==== =========================
59 0 Success65 0 Success
60 12 Hypercall not implemented66 12 Hypercall not implemented
61 <0 Error67 <0 Error
68 ==== =========================
62 69
63The magic page70The magic page
64==============71==============
@@ -72,7 +79,7 @@ desired location. The first parameter indicates the effective address when the · 7 unmodified lines
72MMU is enabled. The second parameter indicates the address in real mode, if79MMU is enabled. The second parameter indicates the address in real mode, if
73applicable to the target. For now, we always map the page to -4096. This way we80applicable to the target. For now, we always map the page to -4096. This way we
74can access it using absolute load and store functions. The following81can access it using absolute load and store functions. The following
75instruction reads the first field of the magic page:82instruction reads the first field of the magic page::
76 83
77 ld rX, -4096(0)84 ld rX, -4096(0)
78 85
@@ -93,8 +100,10 @@ a bitmap of available features inside the magic page. · 14 unmodified lines
93 100
94The following enhancements to the magic page are currently available:101The following enhancements to the magic page are currently available:
95 102
103 ============================ =======================================
96 KVM_MAGIC_FEAT_SR Maps SR registers r/w in the magic page104 KVM_MAGIC_FEAT_SR Maps SR registers r/w in the magic page
97 KVM_MAGIC_FEAT_MAS0_TO_SPRG7 Maps MASn, ESR, PIR and high SPRGs105 KVM_MAGIC_FEAT_MAS0_TO_SPRG7 Maps MASn, ESR, PIR and high SPRGs
106 ============================ =======================================
98 107
99For enhanced features in the magic page, please check for the existence of the108For enhanced features in the magic page, please check for the existence of the
100feature before using them!109feature 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
121 130
122The following bits are safe to be set inside the guest:131The following bits are safe to be set inside the guest:
123 132
124 MSR_EE133 - MSR_EE
125 MSR_RI134 - MSR_RI
126 135
127If any other bit changes in the MSR, please still use mtmsr(d).136If any other bit changes in the MSR, please still use mtmsr(d).
128 137
@@ -138,9 +147,9 @@ guest. Implementing any of those mappings is optional, as the instruction traps · 9 unmodified lines
138also act on the shared page. So calling privileged instructions still works as147also act on the shared page. So calling privileged instructions still works as
139before.148before.
140 149
150======================= ================================
141From To151From To
142==== ==152======================= ================================
143
144mfmsr rX ld rX, magic_page->msr153mfmsr rX ld rX, magic_page->msr
145mfsprg rX, 0 ld rX, magic_page->sprg0154mfsprg rX, 0 ld rX, magic_page->sprg0
146mfsprg rX, 1 ld rX, magic_page->sprg1155mfsprg rX, 1 ld rX, magic_page->sprg1
@@ -173,7 +182,7 @@ mtsrin rX, rY b <special mtsrin section> · 26 unmodified lines
173 182
174[BookE only]183[BookE only]
175wrteei [0|1] b <special wrteei section>184wrteei [0|1] b <special wrteei section>
176 185======================= ================================
177 186
178Some instructions require more logic to determine what's going on than a load187Some instructions require more logic to determine what's going on than a load
179or store instruction can deliver. To enable patching of those, we keep some188or store instruction can deliver. To enable patching of those, we keep some
@@ -191,6 +200,7 @@ for example. · 11 unmodified lines
191 200
192Hypercall ABIs in KVM on PowerPC201Hypercall ABIs in KVM on PowerPC
193=================================202=================================
203
1941) KVM hypercalls (ePAPR)2041) KVM hypercalls (ePAPR)
195 205
196These are ePAPR compliant hypercall implementation (mentioned above). Even206These 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================================
1Review checklist for kvm patches4Review checklist for kvm patches
2================================5================================
3 6
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=============================
1The s390 DIAGNOSE call on KVM4The s390 DIAGNOSE call on KVM
2=============================5=============================
3 6
@@ -16,12 +19,12 @@ DIAGNOSE calls by the guest cause a mandatory intercept. This implies · 12 unmodified lines
16all supported DIAGNOSE calls need to be handled by either KVM or its19all supported DIAGNOSE calls need to be handled by either KVM or its
17userspace.20userspace.
18 21
19All DIAGNOSE calls supported by KVM use the RS-a format:22All DIAGNOSE calls supported by KVM use the RS-a format::
20 23
21--------------------------------------24 --------------------------------------
22| '83' | R1 | R3 | B2 | D2 |25 | '83' | R1 | R3 | B2 | D2 |
23--------------------------------------26 --------------------------------------
240 8 12 16 20 3127 0 8 12 16 20 31
25 28
26The second-operand address (obtained by the base/displacement calculation)29The second-operand address (obtained by the base/displacement calculation)
27is not used to address data. Instead, bits 48-63 of this address specify30is 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
1 2
2 Timekeeping Virtualization for X86-Based Architectures3======================================================
4Timekeeping Virtualization for X86-Based Architectures
5======================================================
3 6
4 Zachary Amsden <zamsden@redhat.com>7:Author: Zachary Amsden <zamsden@redhat.com>
5 Copyright (c) 2010, Red Hat. All rights reserved.8:Copyright: (c) 2010, Red Hat. All rights reserved.
6 9
71) Overview10.. Contents
82) Timing Devices
93) TSC Hardware
104) Virtualization Problems
11 11
12=========================================================================12 1) Overview
13 2) Timing Devices
14 3) TSC Hardware
15 4) Virtualization Problems
13 16
141) Overview171. Overview
18===========
15 19
16One of the most complicated parts of the X86 platform, and specifically,20One of the most complicated parts of the X86 platform, and specifically,
17the virtualization of this platform is the plethora of timing devices available21the 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
27timekeeping which may be difficult to find elsewhere, specifically,31timekeeping which may be difficult to find elsewhere, specifically,
28information relevant to KVM and hardware-based virtualization.32information relevant to KVM and hardware-based virtualization.
29 33
30=========================================================================342. Timing Devices
31 35=================
322) Timing Devices
33 36
34First we discuss the basic hardware devices available. TSC and the related37First we discuss the basic hardware devices available. TSC and the related
35KVM clock are special enough to warrant a full exposition and are described in38KVM clock are special enough to warrant a full exposition and are described in
36the following section.39the following section.
37 40
382.1) i8254 - PIT412.1. i8254 - PIT
42----------------
39 43
40One of the first timer devices available is the programmable interrupt timer,44One of the first timer devices available is the programmable interrupt timer,
41or PIT. The PIT has a fixed frequency 1.193182 MHz base clock and three45or 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
50using single or multiple byte access to the I/O ports. There are 6 modes54using single or multiple byte access to the I/O ports. There are 6 modes
51available, but not all modes are available to all timers, as only timer 255available, but not all modes are available to all timers, as only timer 2
52has a connected gate input, required for modes 1 and 5. The gate line is56has a connected gate input, required for modes 1 and 5. The gate line is
53controlled by port 61h, bit 0, as illustrated in the following diagram.57controlled by port 61h, bit 0, as illustrated in the following diagram::
54 58
55 -------------- ----------------59 -------------- ----------------
56| | | |60 | | | |
57| 1.1932 MHz |---------->| CLOCK OUT | ---------> IRQ 061 | 1.1932 MHz|---------->| CLOCK OUT | ---------> IRQ 0
58| Clock | | | |62 | Clock | | | |
59 -------------- | +->| GATE TIMER 0 |63 -------------- | +->| GATE TIMER 0 |
60 | ----------------64 | ----------------
61 |65 |
62 | ----------------66 | ----------------
@@ -70,29 +74,33 @@ controlled by port 61h, bit 0, as illustrated in the following diagram. · 7 unmodified lines
70 | | |74 | | |
71 |------>| CLOCK OUT | ---------> Port 61h, bit 575 |------>| CLOCK OUT | ---------> Port 61h, bit 5
72 | | |76 | | |
73Port 61h, bit 0 ---------->| GATE TIMER 2 | \_.---- ____77 Port 61h, bit 0 -------->| GATE TIMER 2 | \_.---- ____
74 ---------------- _| )--|LPF|---Speaker78 ---------------- _| )--|LPF|---Speaker
75 / *---- \___/79 / *---- \___/
76Port 61h, bit 1 -----------------------------------/80 Port 61h, bit 1 ---------------------------------/
77 81
78The timer modes are now described.82The timer modes are now described.
79 83
80Mode 0: Single Timeout. This is a one-shot software timeout that counts down84Mode 0: Single Timeout.
85 This is a one-shot software timeout that counts down
81 when the gate is high (always true for timers 0 and 1). When the count86 when the gate is high (always true for timers 0 and 1). When the count
82 reaches zero, the output goes high.87 reaches zero, the output goes high.
83 88
84Mode 1: Triggered One-shot. The output is initially set high. When the gate89Mode 1: Triggered One-shot.
90 The output is initially set high. When the gate
85 line is set high, a countdown is initiated (which does not stop if the gate is91 line is set high, a countdown is initiated (which does not stop if the gate is
86 lowered), during which the output is set low. When the count reaches zero,92 lowered), during which the output is set low. When the count reaches zero,
87 the output goes high.93 the output goes high.
88 94
89Mode 2: Rate Generator. The output is initially set high. When the countdown95Mode 2: Rate Generator.
96 The output is initially set high. When the countdown
90 reaches 1, the output goes low for one count and then returns high. The value97 reaches 1, the output goes low for one count and then returns high. The value
91 is reloaded and the countdown automatically resumes. If the gate line goes98 is reloaded and the countdown automatically resumes. If the gate line goes
92 low, the count is halted. If the output is low when the gate is lowered, the99 low, the count is halted. If the output is low when the gate is lowered, the
93 output automatically goes high (this only affects timer 2).100 output automatically goes high (this only affects timer 2).
94 101
95Mode 3: Square Wave. This generates a high / low square wave. The count102Mode 3: Square Wave.
103 This generates a high / low square wave. The count
96 determines the length of the pulse, which alternates between high and low104 determines the length of the pulse, which alternates between high and low
97 when zero is reached. The count only proceeds when gate is high and is105 when zero is reached. The count only proceeds when gate is high and is
98 automatically reloaded on reaching zero. The count is decremented twice at106 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
103 values are not observed when reading. This is the intended mode for timer 2,111 values are not observed when reading. This is the intended mode for timer 2,
104 which generates sine-like tones by low-pass filtering the square wave output.112 which generates sine-like tones by low-pass filtering the square wave output.
105 113
106Mode 4: Software Strobe. After programming this mode and loading the counter,114Mode 4: Software Strobe.
115 After programming this mode and loading the counter,
107 the output remains high until the counter reaches zero. Then the output116 the output remains high until the counter reaches zero. Then the output
108 goes low for 1 clock cycle and returns high. The counter is not reloaded.117 goes low for 1 clock cycle and returns high. The counter is not reloaded.
109 Counting only occurs when gate is high.118 Counting only occurs when gate is high.
110 119
111Mode 5: Hardware Strobe. After programming and loading the counter, the120Mode 5: Hardware Strobe.
121 After programming and loading the counter, the
112 output remains high. When the gate is raised, a countdown is initiated122 output remains high. When the gate is raised, a countdown is initiated
113 (which does not stop if the gate is lowered). When the counter reaches zero,123 (which does not stop if the gate is lowered). When the counter reaches zero,
114 the output goes low for 1 clock cycle and then returns high. The counter is124 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
118command port, 0x43 is used to set the counter and mode for each of the three128command port, 0x43 is used to set the counter and mode for each of the three
119timers.129timers.
120 130
121PIT commands, issued to port 0x43, using the following bit encoding:131PIT commands, issued to port 0x43, using the following bit encoding::
122 132
123Bit 7-4: Command (See table below)133 Bit 7-4: Command (See table below)
124Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined)134 Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined)
125Bit 0 : Binary (0) / BCD (1)135 Bit 0 : Binary (0) / BCD (1)
126 136
127Command table:137Command table::
128 138
1290000 - Latch Timer 0 count for port 0x40139 0000 - Latch Timer 0 count for port 0x40
130 sample and hold the count to be read in port 0x40;140 sample and hold the count to be read in port 0x40;
131 additional commands ignored until counter is read;141 additional commands ignored until counter is read;
132 mode bits ignored.142 mode bits ignored.
133 143
1340001 - Set Timer 0 LSB mode for port 0x40144 0001 - Set Timer 0 LSB mode for port 0x40
135 set timer to read LSB only and force MSB to zero;145 set timer to read LSB only and force MSB to zero;
136 mode bits set timer mode146 mode bits set timer mode
137 147
1380010 - Set Timer 0 MSB mode for port 0x40148 0010 - Set Timer 0 MSB mode for port 0x40
139 set timer to read MSB only and force LSB to zero;149 set timer to read MSB only and force LSB to zero;
140 mode bits set timer mode150 mode bits set timer mode
141 151
1420011 - Set Timer 0 16-bit mode for port 0x40152 0011 - Set Timer 0 16-bit mode for port 0x40
143 set timer to read / write LSB first, then MSB;153 set timer to read / write LSB first, then MSB;
144 mode bits set timer mode154 mode bits set timer mode
145 155
1460100 - Latch Timer 1 count for port 0x41 - as described above156 0100 - Latch Timer 1 count for port 0x41 - as described above
1470101 - Set Timer 1 LSB mode for port 0x41 - as described above157 0101 - Set Timer 1 LSB mode for port 0x41 - as described above
1480110 - Set Timer 1 MSB mode for port 0x41 - as described above158 0110 - Set Timer 1 MSB mode for port 0x41 - as described above
1490111 - Set Timer 1 16-bit mode for port 0x41 - as described above159 0111 - Set Timer 1 16-bit mode for port 0x41 - as described above
150 160
1511000 - Latch Timer 2 count for port 0x42 - as described above161 1000 - Latch Timer 2 count for port 0x42 - as described above
1521001 - Set Timer 2 LSB mode for port 0x42 - as described above162 1001 - Set Timer 2 LSB mode for port 0x42 - as described above
1531010 - Set Timer 2 MSB mode for port 0x42 - as described above163 1010 - Set Timer 2 MSB mode for port 0x42 - as described above
1541011 - Set Timer 2 16-bit mode for port 0x42 as described above164 1011 - Set Timer 2 16-bit mode for port 0x42 as described above
155 165
1561101 - General counter latch166 1101 - General counter latch
157 Latch combination of counters into corresponding ports167 Latch combination of counters into corresponding ports
158 Bit 3 = Counter 2168 Bit 3 = Counter 2
159 Bit 2 = Counter 1169 Bit 2 = Counter 1
160 Bit 1 = Counter 0170 Bit 1 = Counter 0
161 Bit 0 = Unused171 Bit 0 = Unused
162 172
1631110 - Latch timer status173 1110 - Latch timer status
164 Latch combination of counter mode into corresponding ports174 Latch combination of counter mode into corresponding ports
165 Bit 3 = Counter 2175 Bit 3 = Counter 2
166 Bit 2 = Counter 1176 Bit 2 = Counter 1
@@ -177,7 +187,8 @@ Command table: · 10 unmodified lines
177 Bit 3-1 = Mode187 Bit 3-1 = Mode
178 Bit 0 = Binary (0) / BCD mode (1)188 Bit 0 = Binary (0) / BCD mode (1)
179 189
1802.2) RTC1902.2. RTC
191--------
181 192
182The second device which was available in the original PC was the MC146818 real193The second device which was available in the original PC was the MC146818 real
183time clock. The original device is now obsolete, and usually emulated by the194time 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
201The clock uses a 32.768kHz crystal, so bits 6-4 of register A should be212The clock uses a 32.768kHz crystal, so bits 6-4 of register A should be
202programmed to a 32kHz divider if the RTC is to count seconds.213programmed to a 32kHz divider if the RTC is to count seconds.
203 214
204This is the RAM map originally used for the RTC/CMOS:215This is the RAM map originally used for the RTC/CMOS::
205 216
206Location Size Description217 Location Size Description
207------------------------------------------218 ------------------------------------------
20800h byte Current second (BCD)219 00h byte Current second (BCD)
20901h byte Seconds alarm (BCD)220 01h byte Seconds alarm (BCD)
21002h byte Current minute (BCD)221 02h byte Current minute (BCD)
21103h byte Minutes alarm (BCD)222 03h byte Minutes alarm (BCD)
21204h byte Current hour (BCD)223 04h byte Current hour (BCD)
21305h byte Hours alarm (BCD)224 05h byte Hours alarm (BCD)
21406h byte Current day of week (BCD)225 06h byte Current day of week (BCD)
21507h byte Current day of month (BCD)226 07h byte Current day of month (BCD)
21608h byte Current month (BCD)227 08h byte Current month (BCD)
21709h byte Current year (BCD)228 09h byte Current year (BCD)
2180Ah byte Register A229 0Ah byte Register A
219 bit 7 = Update in progress230 bit 7 = Update in progress
220 bit 6-4 = Divider for clock231 bit 6-4 = Divider for clock
221 000 = 4.194 MHz232 000 = 4.194 MHz
@@ -234,7 +245,7 @@ Location Size Description · 12 unmodified lines
234 1101 = 125 mS245 1101 = 125 mS
235 1110 = 250 mS246 1110 = 250 mS
236 1111 = 500 mS247 1111 = 500 mS
2370Bh byte Register B248 0Bh byte Register B
238 bit 7 = Run (0) / Halt (1)249 bit 7 = Run (0) / Halt (1)
239 bit 6 = Periodic interrupt enable250 bit 6 = Periodic interrupt enable
240 bit 5 = Alarm interrupt enable251 bit 5 = Alarm interrupt enable
@@ -243,19 +254,20 @@ Location Size Description · 2 unmodified lines
243 bit 2 = BCD calendar (0) / Binary (1)254 bit 2 = BCD calendar (0) / Binary (1)
244 bit 1 = 12-hour mode (0) / 24-hour mode (1)255 bit 1 = 12-hour mode (0) / 24-hour mode (1)
245 bit 0 = 0 (DST off) / 1 (DST enabled)256 bit 0 = 0 (DST off) / 1 (DST enabled)
246OCh byte Register C (read only)257 OCh byte Register C (read only)
247 bit 7 = interrupt request flag (IRQF)258 bit 7 = interrupt request flag (IRQF)
248 bit 6 = periodic interrupt flag (PF)259 bit 6 = periodic interrupt flag (PF)
249 bit 5 = alarm interrupt flag (AF)260 bit 5 = alarm interrupt flag (AF)
250 bit 4 = update interrupt flag (UF)261 bit 4 = update interrupt flag (UF)
251 bit 3-0 = reserved262 bit 3-0 = reserved
252ODh byte Register D (read only)263 ODh byte Register D (read only)
253 bit 7 = RTC has power264 bit 7 = RTC has power
254 bit 6-0 = reserved265 bit 6-0 = reserved
25532h byte Current century BCD (*)266 32h byte Current century BCD (*)
256 (*) location vendor specific and now determined from ACPI global tables267 (*) location vendor specific and now determined from ACPI global tables
257 268
2582.3) APIC2692.3. APIC
270---------
259 271
260On Pentium and later processors, an on-board timer is available to each CPU272On Pentium and later processors, an on-board timer is available to each CPU
261as part of the Advanced Programmable Interrupt Controller. The APIC is273as 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
276of one-shot or periodic operation, and is based on the bus clock divided down288of one-shot or periodic operation, and is based on the bus clock divided down
277by the programmable divider register.289by the programmable divider register.
278 290
2792.4) HPET2912.4. HPET
292---------
280 293
281HPET is quite complex, and was originally intended to replace the PIT / RTC294HPET is quite complex, and was originally intended to replace the PIT / RTC
282support of the X86 PC. It remains to be seen whether that will be the case, as295support 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
297Detailed specification of the HPET is beyond the current scope of this310Detailed specification of the HPET is beyond the current scope of this
298document, as it is also very well documented elsewhere.311document, as it is also very well documented elsewhere.
299 312
3002.5) Offboard Timers3132.5. Offboard Timers
314--------------------
301 315
302Several cards, both proprietary (watchdog boards) and commonplace (e1000) have316Several cards, both proprietary (watchdog boards) and commonplace (e1000) have
303timing chips built into the cards which may have registers which are accessible317timing 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
307timer device would require additional support to be virtualized properly and is321timer device would require additional support to be virtualized properly and is
308not considered important at this time as no known operating system does this.322not considered important at this time as no known operating system does this.
309 323
310=========================================================================3243. TSC Hardware
311 325===============
3123) TSC Hardware
313 326
314The TSC or time stamp counter is relatively simple in theory; it counts327The TSC or time stamp counter is relatively simple in theory; it counts
315instruction cycles issued by the processor, which can be used as a measure of328instruction 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
340promise to allow the TSC to additionally be scaled, but this hardware is not353promise to allow the TSC to additionally be scaled, but this hardware is not
341yet widely available.354yet widely available.
342 355
3433.1) TSC synchronization3563.1. TSC synchronization
357------------------------
344 358
345The TSC is a CPU-local clock in most implementations. This means, on SMP359The TSC is a CPU-local clock in most implementations. This means, on SMP
346platforms, the TSCs of different CPUs may start at different times depending360platforms, 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
357values are read from the same clock, which generally only is possible on single371values are read from the same clock, which generally only is possible on single
358socket systems or those with special hardware support.372socket systems or those with special hardware support.
359 373
3603.2) TSC and CPU hotplug3743.2. TSC and CPU hotplug
375------------------------
361 376
362As touched on already, CPUs which arrive later than the boot time of the system377As touched on already, CPUs which arrive later than the boot time of the system
363may not have a TSC value that is synchronized with the rest of the system.378may 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
367TSC is synchronized back to a state where TSC synchronization flaws, however382TSC is synchronized back to a state where TSC synchronization flaws, however
368small, may be exposed to the OS and any virtualization environment.383small, may be exposed to the OS and any virtualization environment.
369 384
3703.3) TSC and multi-socket / NUMA3853.3. TSC and multi-socket / NUMA
386--------------------------------
371 387
372Multi-socket systems, especially large multi-socket systems are likely to have388Multi-socket systems, especially large multi-socket systems are likely to have
373individual clocksources rather than a single, universally distributed clock.389individual clocksources rather than a single, universally distributed clock.
@@ -385,7 +401,8 @@ standards for telecommunications and computer equipment. · 11 unmodified lines
385It is recommended not to trust the TSCs to remain synchronized on NUMA or401It is recommended not to trust the TSCs to remain synchronized on NUMA or
386multiple socket systems for these reasons.402multiple socket systems for these reasons.
387 403
3883.4) TSC and C-states4043.4. TSC and C-states
405---------------------
389 406
390C-states, or idling states of the processor, especially C1E and deeper sleep407C-states, or idling states of the processor, especially C1E and deeper sleep
391states may be problematic for TSC as well. The TSC may stop advancing in such408states 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
396The TSC in such a case may be corrected by catching it up to a known external413The TSC in such a case may be corrected by catching it up to a known external
397clocksource.414clocksource.
398 415
3993.5) TSC frequency change / P-states4163.5. TSC frequency change / P-states
417------------------------------------
400 418
401To make things slightly more interesting, some CPUs may change frequency. They419To make things slightly more interesting, some CPUs may change frequency. They
402may or may not run the TSC at the same rate, and because the frequency change420may 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
416than that of non-halted processors. AMD Turion processors are known to have434than that of non-halted processors. AMD Turion processors are known to have
417this problem.435this problem.
418 436
4193.6) TSC and STPCLK / T-states4373.6. TSC and STPCLK / T-states
438------------------------------
420 439
421External signals given to the processor may also have the effect of stopping440External signals given to the processor may also have the effect of stopping
422the TSC. This is typically done for thermal emergency power control to prevent441the TSC. This is typically done for thermal emergency power control to prevent
423an overheating condition, and typically, there is no way to detect that this442an overheating condition, and typically, there is no way to detect that this
424condition has happened.443condition has happened.
425 444
4263.7) TSC virtualization - VMX4453.7. TSC virtualization - VMX
446-----------------------------
427 447
428VMX provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP448VMX provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP
429instructions, which is enough for full virtualization of TSC in any manner. In449instructions, 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
431field specified in the VMCS. Special instructions must be used to read and451field specified in the VMCS. Special instructions must be used to read and
432write the VMCS field.452write the VMCS field.
433 453
4343.8) TSC virtualization - SVM4543.8. TSC virtualization - SVM
455-----------------------------
435 456
436SVM provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP457SVM provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP
437instructions, which is enough for full virtualization of TSC in any manner. In458instructions, which is enough for full virtualization of TSC in any manner. In
438addition, SVM allows passing through the host TSC plus an additional offset459addition, SVM allows passing through the host TSC plus an additional offset
439field specified in the SVM control block.460field specified in the SVM control block.
440 461
4413.9) TSC feature bits in Linux4623.9. TSC feature bits in Linux
463------------------------------
442 464
443In summary, there is no way to guarantee the TSC remains in perfect465In summary, there is no way to guarantee the TSC remains in perfect
444synchronization unless it is explicitly guaranteed by the architecture. Even466synchronization unless it is explicitly guaranteed by the architecture. Even
@@ -448,13 +470,16 @@ despite being locally consistent. · 3 unmodified lines
448The following feature bits are used by Linux to signal various TSC attributes,470The following feature bits are used by Linux to signal various TSC attributes,
449but they can only be taken to be meaningful for UP or single node systems.471but they can only be taken to be meaningful for UP or single node systems.
450 472
451X86_FEATURE_TSC : The TSC is available in hardware473========================= =======================================
452X86_FEATURE_RDTSCP : The RDTSCP instruction is available474X86_FEATURE_TSC The TSC is available in hardware
453X86_FEATURE_CONSTANT_TSC : The TSC rate is unchanged with P-states475X86_FEATURE_RDTSCP The RDTSCP instruction is available
454X86_FEATURE_NONSTOP_TSC : The TSC does not stop in C-states476X86_FEATURE_CONSTANT_TSC The TSC rate is unchanged with P-states
455X86_FEATURE_TSC_RELIABLE : TSC sync checks are skipped (VMware)477X86_FEATURE_NONSTOP_TSC The TSC does not stop in C-states
478X86_FEATURE_TSC_RELIABLE TSC sync checks are skipped (VMware)
479========================= =======================================
456 480
4574) Virtualization Problems4814. Virtualization Problems
482==========================
458 483
459Timekeeping is especially problematic for virtualization because a number of484Timekeeping is especially problematic for virtualization because a number of
460challenges arise. The most obvious problem is that time is now shared between485challenges 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
473cause similar problems to virtualization makes it a good justification for498cause similar problems to virtualization makes it a good justification for
474solving many of these problems on bare metal.499solving many of these problems on bare metal.
475 500
4764.1) Interrupt clocking5014.1. Interrupt clocking
502-----------------------
477 503
478One of the most immediate problems that occurs with legacy operating systems504One of the most immediate problems that occurs with legacy operating systems
479is that the system timekeeping routines are often designed to keep track of505is 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
502rate (ed: is it 18.2 Hz?) however that it has not yet been a problem in528rate (ed: is it 18.2 Hz?) however that it has not yet been a problem in
503practice.529practice.
504 530
5054.2) TSC sampling and serialization5314.2. TSC sampling and serialization
532-----------------------------------
506 533
507As the highest precision time source available, the cycle counter of the CPU534As the highest precision time source available, the cycle counter of the CPU
508has aroused much interest from developers. As explained above, this timer has535has 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
524the TSC as seen from other CPUs, even in an otherwise perfectly synchronized551the TSC as seen from other CPUs, even in an otherwise perfectly synchronized
525system.552system.
526 553
5274.3) Timespec aliasing5544.3. Timespec aliasing
555----------------------
528 556
529Additionally, this lack of serialization from the TSC poses another challenge557Additionally, this lack of serialization from the TSC poses another challenge
530when using results of the TSC when measured against another time source. As558when 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
548and any other values derived from TSC computation (such as TSC virtualization576and any other values derived from TSC computation (such as TSC virtualization
549itself).577itself).
550 578
5514.4) Migration5794.4. Migration
580--------------
552 581
553Migration of a virtual machine raises problems for timekeeping in two ways.582Migration of a virtual machine raises problems for timekeeping in two ways.
554First, the migration itself may take time, during which interrupts cannot be583First, 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
566simply storing multipliers and offsets against the TSC for the guest to convert595simply storing multipliers and offsets against the TSC for the guest to convert
567back into nanosecond resolution values.596back into nanosecond resolution values.
568 597
5694.5) Scheduling5984.5. Scheduling
599---------------
570 600
571Since scheduling may be based on precise timing and firing of interrupts, the601Since scheduling may be based on precise timing and firing of interrupts, the
572scheduling algorithms of an operating system may be adversely affected by602scheduling 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
579paravirtualized scheduler clock, which reveals the true amount of CPU time for609paravirtualized scheduler clock, which reveals the true amount of CPU time for
580which a virtual machine has been running.610which a virtual machine has been running.
581 611
5824.6) Watchdogs6124.6. Watchdogs
613--------------
583 614
584Watchdog timers, such as the lock detector in Linux may fire accidentally when615Watchdog timers, such as the lock detector in Linux may fire accidentally when
585running under hardware virtualization due to timer interrupts being delayed or616running 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
587spurious and can be ignored, but in some circumstances it may be necessary to618spurious and can be ignored, but in some circumstances it may be necessary to
588disable such detection.619disable such detection.
589 620
5904.7) Delays and precision timing6214.7. Delays and precision timing
622--------------------------------
591 623
592Precise timing and delays may not be possible in a virtualized system. This624Precise timing and delays may not be possible in a virtualized system. This
593can happen if the system is controlling physical hardware, or issues delays to625can 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
600significant issue. In many cases these delays may be eliminated through632significant issue. In many cases these delays may be eliminated through
601configuration or paravirtualization.633configuration or paravirtualization.
602 634
6034.8) Covert channels and leaks6354.8. Covert channels and leaks
636------------------------------
604 637
605In addition to the above problems, time information will inevitably leak to the638In addition to the above problems, time information will inevitably leak to the
606guest about the host in anything but a perfect implementation of virtualized639guest 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 HOWTO1.. SPDX-License-Identifier: GPL-2.0
2 User Mode Linux Core Team
3 Mon Nov 18 14:16:16 EST 2002
4 2
5 This document describes the use and abuse of Jeff Dike's User Mode3=====================
6 Linux: a port of the Linux kernel as a normal Intel Linux process.4User Mode Linux HOWTO
7 ______________________________________________________________________5=====================
8 6
9 Table of Contents7:Author: User Mode Linux Core Team
8:Last-updated: Sat Jan 25 16:07:55 CET 2020
9
10This document describes the use and abuse of Jeff Dike's User Mode
11Linux: a port of the Linux kernel as a normal Intel Linux process.
12
13
14.. Table of Contents
10 15
11 1. Introduction16 1. Introduction
12 17
@@ -132,19 +137,19 @@ · 119 unmodified lines
132 15.5 Other contributions137 15.5 Other contributions
133 138
134 139
135 ______________________________________________________________________1401. Introduction
136 141================
137 1. Introduction
138 142
139 Welcome to User Mode Linux. It's going to be fun.143 Welcome to User Mode Linux. It's going to be fun.
140 144
141 145
142 146
143 1.1. How is User Mode Linux Different?1471.1. How is User Mode Linux Different?
148---------------------------------------
144 149
145 Normally, the Linux Kernel talks straight to your hardware (video150 Normally, the Linux Kernel talks straight to your hardware (video
146 card, keyboard, hard drives, etc), and any programs which run ask the151 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::
148 153
149 154
150 155
@@ -160,10 +165,10 @@ · 9 unmodified lines
160 165
161 166
162 The User Mode Linux Kernel is different; instead of talking to the167 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`
164 from now on), like any other program. Programs can then run inside169 from now on), like any other program. Programs can then run inside
165 User-Mode Linux as if they were running under a normal kernel, like170 User-Mode Linux as if they were running under a normal kernel, like
166 so:171 so::
167 172
168 173
169 174
@@ -181,7 +186,8 @@ · 11 unmodified lines
181 186
182 187
183 188
184 1.2. Why Would I Want User Mode Linux?1891.2. Why Would I Want User Mode Linux?
190---------------------------------------
185 191
186 192
187 1. If User Mode Linux crashes, your host kernel is still fine.193 1. If User Mode Linux crashes, your host kernel is still fine.
@@ -204,83 +210,41 @@ · 16 unmodified lines
204 210
205 211
206 212
213.. _Compiling_the_kernel_and_modules:
207 214
208 2152. Compiling the kernel and modules
209 2. Compiling the kernel and modules216====================================
210 217
211 218
212 219
213 220
214 2.1. Compiling the kernel2212.1. Compiling the kernel
222--------------------------
215 223
216 224
217 Compiling the user mode kernel is just like compiling any other225 Compiling the user mode kernel is just like compiling any other
218 kernel. Let's go through the steps, using 2.4.0-prerelease (current226 kernel.
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.
227 227
228 228
229 2. Download the matching kernel from your favourite kernel mirror,229 1. Download the latest kernel from your favourite kernel mirror,
230 such as:230 such as:
231 231
232 ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2232 https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.14.tar.xz
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
239 233
234 2. Make a directory and unpack the kernel into it::
240 235
241 host%236 host%
242 mkdir ~/uml237 mkdir ~/uml
243 238
244
245
246
247
248
249 host%239 host%
250 cd ~/uml240 cd ~/uml
251 241
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
274 host%242 host%
275 bzcat uml-patch-2.4.0-prerelease.bz2 | patch -p1243 tar xvf linux-5.4.14.tar.xz
276 244
277 245
278 246 3. Run your favorite config; ``make xconfig ARCH=um`` is the most
279 247 convenient. ``make config ARCH=um`` and ``make menuconfig ARCH=um``
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'
284 will work as well. The defaults will give you a useful kernel. If248 will work as well. The defaults will give you a useful kernel. If
285 you want to change something, go ahead, it probably won't hurt249 you want to change something, go ahead, it probably won't hurt
286 anything.250 anything.
@@ -288,44 +252,20 @@ · 1 unmodified line
288 252
289 Note: If the host is configured with a 2G/2G address space split253 Note: If the host is configured with a 2G/2G address space split
290 rather than the usual 3G/1G split, then the packaged UML binaries254 rather than the usual 3G/1G split, then the packaged UML binaries
291 will not run. They will immediately segfault. See ``UML on 2G/2G255 will not run. They will immediately segfault. See
292 hosts'' for the scoop on running UML on your system.256 :ref:`UML_on_2G/2G_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.
307 257
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.
311 258
312 If you don't have the latest kernel pool, you can get the
313 corresponding user-mode sources with
314 259
260 4. Finish with ``make linux ARCH=um``: the result is a file called
261 ``linux`` in the top directory of your source tree.
315 262
316 host% cvs co -r v_2_3_x linux
317 263
318 2642.2. Compiling and installing kernel modules
319 265---------------------------------------------
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
326 266
327 UML modules are built in the same way as the native kernel (with the267 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)::
329 269
330 270
331 host% make modules ARCH=um271 host% make modules ARCH=um
@@ -337,12 +277,12 @@ · 5 unmodified lines
337 the user-mode pool. Modules from the native kernel won't work.277 the user-mode pool. Modules from the native kernel won't work.
338 278
339 You can install them by using ftp or something to copy them into the279 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)``.
341 281
342 You can also get the kernel build process to install them as follows:282 You can also get the kernel build process to install them as follows:
343 283
344 1. with the kernel not booted, mount the root filesystem in the top284 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::
346 286
347 287
348 host% mount root_fs mnt -o loop288 host% mount root_fs mnt -o loop
@@ -352,7 +292,7 @@ · 3 unmodified lines
352 292
353 293
354 294
355 2. run295 2. run::
356 296
357 297
358 host%298 host%
@@ -363,7 +303,7 @@ · 4 unmodified lines
363 303
364 304
365 305
366 3. unmount the filesystem306 3. unmount the filesystem::
367 307
368 308
369 host% umount mnt309 host% umount mnt
@@ -381,27 +321,28 @@ · 11 unmodified lines
381 as modules, especially filesystems and network protocols and filters,321 as modules, especially filesystems and network protocols and filters,
382 so most symbols which need to be exported probably already are.322 so most symbols which need to be exported probably already are.
383 However, if you do find symbols that need exporting, let us323 However, if you do find symbols that need exporting, let us
384 <http://user-mode-linux.sourceforge.net/> know, and324 know at http://user-mode-linux.sourceforge.net/, and
385 they'll be "taken care of".325 they'll be "taken care of".
386 326
387 327
388 328
389 2.3. Compiling and installing uml_utilities3292.3. Compiling and installing uml_utilities
330--------------------------------------------
390 331
391 Many features of the UML kernel require a user-space helper program,332 Many features of the UML kernel require a user-space helper program,
392 so a uml_utilities package is distributed separately from the kernel333 so a uml_utilities package is distributed separately from the kernel
393 patch which provides these helpers. Included within this is:334 patch which provides these helpers. Included within this is:
394 335
395 o port-helper - Used by consoles which connect to xterms or ports336 - port-helper - Used by consoles which connect to xterms or ports
396 337
397 o tunctl - Configuration tool to create and delete tap devices338 - tunctl - Configuration tool to create and delete tap devices
398 339
399 o uml_net - Setuid binary for automatic tap device configuration340 - uml_net - Setuid binary for automatic tap device configuration
400 341
401 o uml_switch - User-space virtual switch required for daemon342 - uml_switch - User-space virtual switch required for daemon
402 transport343 transport
403 344
404 The uml_utilities tree is compiled with:345 The uml_utilities tree is compiled with::
405 346
406 347
407 host#348 host#
@@ -423,38 +364,42 @@ · 15 unmodified lines
423 364
424 365
425 366
426 3. Running UML and logging in3673. Running UML and logging in
368==============================
427 369
428 370
429 371
430 3.1. Running UML3723.1. Running UML
373-----------------
431 374
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.
433 376
434 377
435 Booting UML is straightforward. Simply run 'linux': it will try to378 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 to379 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', then380 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 command381 you need to put a ``ubd0=root_fs_whatever`` switch on the linux command
439 line.382 line.
440 383
441 384
442 You will need a filesystem to boot UML from. There are a number385 You will need a filesystem to boot UML from. There are a number
443 available for download from here <http://user-mode-386 available for download from http://user-mode-linux.sourceforge.net.
444 linux.sourceforge.net/> . There are also several tools387 There are also several tools at
445 <http://user-mode-linux.sourceforge.net/> which can be388 http://user-mode-linux.sourceforge.net/ which can be
446 used to generate UML-compatible filesystem images from media.389 used to generate UML-compatible filesystem images from media.
447 The kernel will boot up and present you with a login prompt.390 The kernel will boot up and present you with a login prompt.
448 391
449 392
450 Note: If the host is configured with a 2G/2G address space split393Note:
394 If the host is configured with a 2G/2G address space split
451 rather than the usual 3G/1G split, then the packaged UML binaries will395 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`
453 for the scoop on running UML on your system.397 for the scoop on running UML on your system.
454 398
455 399
456 400
457 3.2. Logging in4013.2. Logging in
402----------------
458 403
459 404
460 405
@@ -468,22 +413,22 @@ · 7 unmodified lines
468 413
469 There are a couple of other ways to log in:414 There are a couple of other ways to log in:
470 415
471 o On a virtual console416 - On a virtual console
472 417
473 418
474 419
475 Each virtual console that is configured (i.e. the device exists in420 Each virtual console that is configured (i.e. the device exists in
476 /dev and /etc/inittab runs a getty on it) will come up in its own421 /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 serial422 xterm. If you get tired of the xterms, read
478 lines and consoles'' to see how to attach the consoles to423 :ref:`setting_up_serial_lines_and_consoles` to see how to attach
479 something else, like host ptys.424 the consoles to something else, like host ptys.
480 425
481 426
482 427
483 o Over the serial line428 - Over the serial line
484 429
485 430
486 In the boot output, find a line that looks like:431 In the boot output, find a line that looks like::
487 432
488 433
489 434
@@ -493,7 +438,7 @@ · 3 unmodified lines
493 438
494 439
495 Attach your favorite terminal program to the corresponding tty. I.e.440 Attach your favorite terminal program to the corresponding tty. I.e.
496 for minicom, the command would be441 for minicom, the command would be::
497 442
498 443
499 host% minicom -o -p /dev/ttyp1444 host% minicom -o -p /dev/ttyp1
@@ -503,37 +448,40 @@ · 3 unmodified lines
503 448
504 449
505 450
506 o Over the net451 - Over the net
507 452
508 453
509 If the network is running, then you can telnet to the virtual454 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 learn455 machine and log in to it. See :ref:`Setting_up_the_network` to learn
511 about setting up a virtual network.456 about setting up a virtual network.
512 457
513 When you're done using it, run halt, and the kernel will bring itself458 When you're done using it, run halt, and the kernel will bring itself
514 down and the process will exit.459 down and the process will exit.
515 460
516 461
517 3.3. Examples4623.3. Examples
463--------------
518 464
519 Here are some examples of UML in action:465 Here are some examples of UML in action:
520 466
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
522 468
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
524 470
525 471
526 472
527 473
528 474
475.. _UML_on_2G/2G_hosts:
529 476
4774. UML on 2G/2G hosts
478======================
530 479
531 4. UML on 2G/2G hosts
532 480
533 481
534 482
535 4834.1. Introduction
536 4.1. Introduction484------------------
537 485
538 486
539 Most Linux machines are configured so that the kernel occupies the487 Most Linux machines are configured so that the kernel occupies the
@@ -546,7 +494,8 @@ · 6 unmodified lines
546 494
547 495
548 496
549 4.2. The problem4974.2. The problem
498-----------------
550 499
551 500
552 The prebuilt UML binaries on this site will not run on 2G/2G hosts501 The prebuilt UML binaries on this site will not run on 2G/2G hosts
@@ -558,13 +507,14 @@ · 5 unmodified lines
558 507
559 508
560 509
561 4.3. The solution5104.3. The solution
511------------------
562 512
563 513
564 The fix for this is to rebuild UML from source after enabling514 The fix for this is to rebuild UML from source after enabling
565 CONFIG_HOST_2G_2G (under 'General Setup'). This will cause UML to515 CONFIG_HOST_2G_2G (under 'General Setup'). This will cause UML to
566 load itself in the top .5G of that smaller process address space,516 load itself in the top .5G of that smaller process address space,
567 where it will run fine. See ``Compiling the kernel and modules'' if517 where it will run fine. See :ref:`Compiling_the_kernel_and_modules` if
568 you need help building UML from source.518 you need help building UML from source.
569 519
570 520
@@ -573,10 +523,11 @@ · 2 unmodified lines
573 523
574 524
575 525
526.. _setting_up_serial_lines_and_consoles:
576 527
577 528
578 5295. Setting up serial lines and consoles
579 5. Setting up serial lines and consoles530========================================
580 531
581 532
582 It is possible to attach UML serial lines and consoles to many types533 It is possible to attach UML serial lines and consoles to many types
@@ -584,22 +535,23 @@ · 1 unmodified line
584 535
585 536
586 You can attach them to host ptys, ttys, file descriptors, and ports.537 You can attach them to host ptys, ttys, file descriptors, and ports.
587 This allows you to do things like538 This allows you to do things like:
588 539
589 o have a UML console appear on an unused host console,540 - have a UML console appear on an unused host console,
590 541
591 o hook two virtual machines together by having one attach to a pty542 - hook two virtual machines together by having one attach to a pty
592 and having the other attach to the corresponding tty543 and having the other attach to the corresponding tty
593 544
594 o make a virtual machine accessible from the net by attaching a545 - make a virtual machine accessible from the net by attaching a
595 console to a port on the host.546 console to a port on the host.
596 547
597 548
598 The general format of the command line option is device=channel.549 The general format of the command line option is ``device=channel``.
599 550
600 551
601 552
602 5.1. Specifying the device5535.1. Specifying the device
554---------------------------
603 555
604 Devices are specified with "con" or "ssl" (console or serial line,556 Devices are specified with "con" or "ssl" (console or serial line,
605 respectively), optionally with a device number if you are talking557 respectively), optionally with a device number if you are talking
@@ -613,7 +565,7 @@ · 7 unmodified lines
613 565
614 A specific device name will override a less general "con=" or "ssl=".566 A specific device name will override a less general "con=" or "ssl=".
615 So, for example, you can assign a pty to each of the serial lines567 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::
617 569
618 570
619 ssl=pty ssl0=tty:/dev/tty0 ssl1=tty:/dev/tty1571 ssl=pty ssl0=tty:/dev/tty0 ssl1=tty:/dev/tty1
@@ -626,13 +578,14 @@ · 6 unmodified lines
626 578
627 579
628 580
629 5.2. Specifying the channel5815.2. Specifying the channel
582----------------------------
630 583
631 There are a number of different types of channels to attach a UML584 There are a number of different types of channels to attach a UML
632 device to, each with a different way of specifying exactly what to585 device to, each with a different way of specifying exactly what to
633 attach to.586 attach to.
634 587
635 o pseudo-terminals - device=pty pts terminals - device=pts588 - pseudo-terminals - device=pty pts terminals - device=pts
636 589
637 590
638 This will cause UML to allocate a free host pseudo-terminal for the591 This will cause UML to allocate a free host pseudo-terminal for the
@@ -640,23 +593,23 @@ · 1 unmodified line
640 log. You access it by attaching a terminal program to the593 log. You access it by attaching a terminal program to the
641 corresponding tty:594 corresponding tty:
642 595
643 o screen /dev/pts/n596 - screen /dev/pts/n
644 597
645 o screen /dev/ttyxx598 - screen /dev/ttyxx
646 599
647 o minicom -o -p /dev/ttyxx - minicom seems not able to handle pts600 - minicom -o -p /dev/ttyxx - minicom seems not able to handle pts
648 devices601 devices
649 602
650 o kermit - start it up, 'open' the device, then 'connect'603 - kermit - start it up, 'open' the device, then 'connect'
651 604
652 605
653 606
654 607
655 608
656 o terminals - device=tty:tty device file609 - terminals - device=tty:tty device file
657 610
658 611
659 This will make UML attach the device to the specified tty (i.e612 This will make UML attach the device to the specified tty (i.e::
660 613
661 614
662 con1=tty:/dev/tty3615 con1=tty:/dev/tty3
@@ -672,7 +625,7 @@ · 9 unmodified lines
672 625
673 626
674 627
675 o xterms - device=xterm628 - xterms - device=xterm
676 629
677 630
678 UML will run an xterm and the device will be attached to it.631 UML will run an xterm and the device will be attached to it.
@@ -681,12 +634,12 @@ · 2 unmodified lines
681 634
682 635
683 636
684 o Port - device=port:port number637 - Port - device=port:port number
685 638
686 639
687 This will attach the UML devices to the specified host port.640 This will attach the UML devices to the specified host port.
688 Attaching console 1 to the host's port 9000 would be done like641 Attaching console 1 to the host's port 9000 would be done like
689 this:642 this::
690 643
691 644
692 con1=port:9000645 con1=port:9000
@@ -694,7 +647,7 @@ · 1 unmodified line
694 647
695 648
696 649
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::
698 651
699 652
700 ssl=port:9000653 ssl=port:9000
@@ -702,8 +655,8 @@ · 1 unmodified line
702 655
703 656
704 657
705 You access these devices by telnetting to that port. Each active tel-658 You access these devices by telnetting to that port. Each active
706 net session gets a different device. If there are more telnets to a659 telnet session gets a different device. If there are more telnets to a
707 port than UML devices attached to it, then the extra telnet sessions660 port than UML devices attached to it, then the extra telnet sessions
708 will block until an existing telnet detaches, or until another device661 will block until an existing telnet detaches, or until another device
709 becomes active (i.e. by being activated in /etc/inittab).662 becomes active (i.e. by being activated in /etc/inittab).
@@ -725,13 +678,13 @@ · 15 unmodified lines
725 678
726 679
727 680
728 o already-existing file descriptors - device=file descriptor681 - already-existing file descriptors - device=file descriptor
729 682
730 683
731 If you set up a file descriptor on the UML command line, you can684 If you set up a file descriptor on the UML command line, you can
732 attach a UML device to it. This is most commonly used to put the685 attach a UML device to it. This is most commonly used to put the
733 main console back on stdin and stdout after assigning all the other686 main console back on stdin and stdout after assigning all the other
734 consoles to something else:687 consoles to something else::
735 688
736 689
737 con0=fd:0,fd:1 con=pts690 con0=fd:0,fd:1 con=pts
@@ -743,7 +696,7 @@ · 5 unmodified lines
743 696
744 697
745 698
746 o Nothing - device=null699 - Nothing - device=null
747 700
748 701
749 This allows the device to be opened, in contrast to 'none', but702 This allows the device to be opened, in contrast to 'none', but
@@ -754,7 +707,7 @@ · 4 unmodified lines
754 707
755 708
756 709
757 o None - device=none710 - None - device=none
758 711
759 712
760 This causes the device to disappear.713 This causes the device to disappear.
@@ -762,7 +715,7 @@ · 1 unmodified line
762 715
763 716
764 You can also specify different input and output channels for a device717 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::
766 719
767 720
768 ssl3=tty:/dev/tty2,xterm721 ssl3=tty:/dev/tty2,xterm
@@ -785,14 +738,15 @@ · 16 unmodified lines
785 738
786 739
787 740
788 5.3. Examples7415.3. Examples
742--------------
789 743
790 There are a number of interesting things you can do with this744 There are a number of interesting things you can do with this
791 capability.745 capability.
792 746
793 747
794 First, this is how you get rid of those bleeding console xterms by748 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::
796 750
797 751
798 con=pty con0=fd:0,fd:1752 con=pty con0=fd:0,fd:1
@@ -802,7 +756,7 @@ · 3 unmodified lines
802 756
803 This will make a UML console take over an unused host virtual console,757 This will make a UML console take over an unused host virtual console,
804 so that when you switch to it, you will see the UML login prompt758 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::
806 760
807 761
808 con1=tty:/dev/tty6762 con1=tty:/dev/tty6
@@ -813,7 +767,7 @@ · 4 unmodified lines
813 You can attach two virtual machines together with what amounts to a767 You can attach two virtual machines together with what amounts to a
814 serial line as follows:768 serial line as follows:
815 769
816 Run one UML with a serial line attached to a pty -770 Run one UML with a serial line attached to a pty::
817 771
818 772
819 ssl1=pty773 ssl1=pty
@@ -825,7 +779,7 @@ · 5 unmodified lines
825 that it got /dev/ptyp1).779 that it got /dev/ptyp1).
826 780
827 Boot the other UML with a serial line attached to the corresponding781 Boot the other UML with a serial line attached to the corresponding
828 tty -782 tty::
829 783
830 784
831 ssl1=tty:/dev/ttyp1785 ssl1=tty:/dev/ttyp1
@@ -838,7 +792,10 @@ · 6 unmodified lines
838 prompt of the other virtual machine.792 prompt of the other virtual machine.
839 793
840 794
841 6. Setting up the network795.. _setting_up_the_network:
796
7976. Setting up the network
798==========================
842 799
843 800
844 801
@@ -858,19 +815,19 @@ · 13 unmodified lines
858 There are currently five transport types available for a UML virtual815 There are currently five transport types available for a UML virtual
859 machine to exchange packets with other hosts:816 machine to exchange packets with other hosts:
860 817
861 o ethertap818 - ethertap
862 819
863 o TUN/TAP820 - TUN/TAP
864 821
865 o Multicast822 - Multicast
866 823
867 o a switch daemon824 - a switch daemon
868 825
869 o slip826 - slip
870 827
871 o slirp828 - slirp
872 829
873 o pcap830 - pcap
874 831
875 The TUN/TAP, ethertap, slip, and slirp transports allow a UML832 The TUN/TAP, ethertap, slip, and slirp transports allow a UML
876 instance to exchange packets with the host. They may be directed833 instance to exchange packets with the host. They may be directed
@@ -893,28 +850,28 @@ · 16 unmodified lines
893 With so many host transports, which one should you use? Here's when850 With so many host transports, which one should you use? Here's when
894 you should use each one:851 you should use each one:
895 852
896 o ethertap - if you want access to the host networking and it is853 - ethertap - if you want access to the host networking and it is
897 running 2.2854 running 2.2
898 855
899 o TUN/TAP - if you want access to the host networking and it is856 - TUN/TAP - if you want access to the host networking and it is
900 running 2.4. Also, the TUN/TAP transport is able to use a857 running 2.4. Also, the TUN/TAP transport is able to use a
901 preconfigured device, allowing it to avoid using the setuid uml_net858 preconfigured device, allowing it to avoid using the setuid uml_net
902 helper, which is a security advantage.859 helper, which is a security advantage.
903 860
904 o Multicast - if you want a purely virtual network and you don't want861 - Multicast - if you want a purely virtual network and you don't want
905 to set up anything but the UML862 to set up anything but the UML
906 863
907 o a switch daemon - if you want a purely virtual network and you864 - a switch daemon - if you want a purely virtual network and you
908 don't mind running the daemon in order to get somewhat better865 don't mind running the daemon in order to get somewhat better
909 performance866 performance
910 867
911 o slip - there is no particular reason to run the slip backend unless868 - slip - there is no particular reason to run the slip backend unless
912 ethertap and TUN/TAP are just not available for some reason869 ethertap and TUN/TAP are just not available for some reason
913 870
914 o slirp - if you don't have root access on the host to setup871 - slirp - if you don't have root access on the host to setup
915 networking, or if you don't want to allocate an IP to your UML872 networking, or if you don't want to allocate an IP to your UML
916 873
917 o pcap - not much use for actual network connectivity, but great for874 - pcap - not much use for actual network connectivity, but great for
918 monitoring traffic on the host875 monitoring traffic on the host
919 876
920 Ethertap is available on 2.4 and works fine. TUN/TAP is preferred877 Ethertap is available on 2.4 and works fine. TUN/TAP is preferred
@@ -926,7 +883,8 @@ · 5 unmodified lines
926 exploit the helper's root privileges.883 exploit the helper's root privileges.
927 884
928 885
929 6.1. General setup8866.1. General setup
887-------------------
930 888
931 First, you must have the virtual network enabled in your UML. If are889 First, you must have the virtual network enabled in your UML. If are
932 running a prebuilt kernel from this site, everything is already890 running a prebuilt kernel from this site, everything is already
@@ -938,7 +896,7 @@ · 5 unmodified lines
938 The next step is to provide a network device to the virtual machine.896 The next step is to provide a network device to the virtual machine.
939 This is done by describing it on the kernel command line.897 This is done by describing it on the kernel command line.
940 898
941 The general format is899 The general format is::
942 900
943 901
944 eth <n> = <transport> , <transport args>902 eth <n> = <transport> , <transport args>
@@ -947,7 +905,7 @@ · 2 unmodified lines
947 905
948 906
949 For example, a virtual ethernet device may be attached to a host907 For example, a virtual ethernet device may be attached to a host
950 ethertap device as follows:908 ethertap device as follows::
951 909
952 910
953 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254911 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254
@@ -978,7 +936,7 @@ · 24 unmodified lines
978 936
979 937
980 You can also add devices to a UML and remove them at runtime. See the938 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.
982 940
983 941
984 The sections below describe this in more detail.942 The sections below describe this in more detail.
@@ -995,7 +953,8 @@ · 10 unmodified lines
995 953
996 954
997 955
998 6.2. Userspace daemons9566.2. Userspace daemons
957-----------------------
999 958
1000 You will likely need the setuid helper, or the switch daemon, or both.959 You will likely need the setuid helper, or the switch daemon, or both.
1001 They are both installed with the RPM and deb, so if you've installed960 They are both installed with the RPM and deb, so if you've installed
@@ -1011,7 +970,8 @@ · 9 unmodified lines
1011 970
1012 971
1013 972
1014 6.3. Specifying ethernet addresses9736.3. Specifying ethernet addresses
974-----------------------------------
1015 975
1016 Below, you will see that the TUN/TAP, ethertap, and daemon interfaces976 Below, you will see that the TUN/TAP, ethertap, and daemon interfaces
1017 allow you to specify hardware addresses for the virtual ethernet977 allow you to specify hardware addresses for the virtual ethernet
@@ -1023,21 +983,21 @@ · 5 unmodified lines
1023 sufficient to guarantee a unique hardware address for the device. A983 sufficient to guarantee a unique hardware address for the device. A
1024 couple of exceptions are:984 couple of exceptions are:
1025 985
1026 o Another set of virtual ethernet devices are on the same network and986 - Another set of virtual ethernet devices are on the same network and
1027 they are assigned hardware addresses using a different scheme which987 they are assigned hardware addresses using a different scheme which
1028 may conflict with the UML IP address-based scheme988 may conflict with the UML IP address-based scheme
1029 989
1030 o You aren't going to use the device for IP networking, so you don't990 - You aren't going to use the device for IP networking, so you don't
1031 assign the device an IP address991 assign the device an IP address
1032 992
1033 If you let the driver provide the hardware address, you should make993 If you let the driver provide the hardware address, you should make
1034 sure that the device IP address is known before the interface is994 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::
1036 996
1037 997
1038 998
1039 UML#999 UML#
1040 ifconfig eth0 192.168.0.250 up1000 ifconfig eth0 192.168.0.250 up
1041 1001
1042 1002
1043 1003
@@ -1049,13 +1009,14 @@ · 5 unmodified lines
1049 1009
1050 1010
1051 1011
1052 6.4. UML interface setup10126.4. UML interface setup
1013-------------------------
1053 1014
1054 Once the network devices have been described on the command line, you1015 Once the network devices have been described on the command line, you
1055 should boot UML and log in.1016 should boot UML and log in.
1056 1017
1057 1018
1058 The first thing to do is bring the interface up:1019 The first thing to do is bring the interface up::
1059 1020
1060 1021
1061 UML# ifconfig ethn ip-address up1022 UML# ifconfig ethn ip-address up
@@ -1067,7 +1028,7 @@ · 5 unmodified lines
1067 1028
1068 1029
1069 To reach the rest of the world, you should set a default route to the1030 To reach the rest of the world, you should set a default route to the
1070 host:1031 host::
1071 1032
1072 1033
1073 UML# route add default gw host ip1034 UML# route add default gw host ip
@@ -1075,7 +1036,7 @@ · 1 unmodified line
1075 1036
1076 1037
1077 1038
1078 Again, with host ip of 192.168.0.4:1039 Again, with host ip of 192.168.0.4::
1079 1040
1080 1041
1081 UML# route add default gw 192.168.0.41042 UML# route add default gw 192.168.0.4
@@ -1097,29 +1058,25 @@ · 15 unmodified lines
1097 Note: If you can't communicate with other hosts on your physical1058 Note: If you can't communicate with other hosts on your physical
1098 ethernet, it's probably because of a network route that's1059 ethernet, it's probably because of a network route that's
1099 automatically set up. If you run 'route -n' and see a route that1060 automatically set up. If you run 'route -n' and see a route that
1100 looks like this:1061 looks like this::
1101 1062
1102 1063
1103 1064
1104 1065
1105 Destination Gateway Genmask Flags Metric Ref Use Iface1066 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 eth01067 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
1107 1068
1108 1069
1109 1070
1110 1071
1111 with a mask that's not 255.255.255.255, then replace it with a route1072 with a mask that's not 255.255.255.255, then replace it with a route
1112 to your host:1073 to your host::
1113 1074
1114 1075
1115 UML#1076 UML#
1116 route del -net 192.168.0.0 dev eth0 netmask 255.255.255.01077 route del -net 192.168.0.0 dev eth0 netmask 255.255.255.0
1117 1078
1118 1079
1119
1120
1121
1122
1123 UML#1080 UML#
1124 route add -host 192.168.0.4 dev eth01081 route add -host 192.168.0.4 dev eth0
1125 1082
@@ -1131,7 +1088,8 @@ · 5 unmodified lines
1131 1088
1132 1089
1133 1090
1134 6.5. Multicast10916.5. Multicast
1092---------------
1135 1093
1136 The simplest way to set up a virtual network between multiple UMLs is1094 The simplest way to set up a virtual network between multiple UMLs is
1137 to use the mcast transport. This was written by Harald Welte and is1095 to use the mcast transport. This was written by Harald Welte and is
@@ -1142,7 +1100,7 @@ · 4 unmodified lines
1142 messages when you bring the device up inside UML.1100 messages when you bring the device up inside UML.
1143 1101
1144 1102
1145 To use it, run two UMLs with1103 To use it, run two UMLs with::
1146 1104
1147 1105
1148 eth0=mcast1106 eth0=mcast
@@ -1151,16 +1109,12 @@ · 2 unmodified lines
1151 1109
1152 1110
1153 on their command lines. Log in, configure the ethernet device in each1111 on their command lines. Log in, configure the ethernet device in each
1154 machine with different IP addresses:1112 machine with different IP addresses::
1155 1113
1156 1114
1157 UML1# ifconfig eth0 192.168.0.2541115 UML1# ifconfig eth0 192.168.0.254
1158 1116
1159 1117
1160
1161
1162
1163
1164 UML2# ifconfig eth0 192.168.0.2531118 UML2# ifconfig eth0 192.168.0.253
1165 1119
1166 1120
@@ -1168,7 +1122,7 @@ · 1 unmodified line
1168 1122
1169 and they should be able to talk to each other.1123 and they should be able to talk to each other.
1170 1124
1171 The full set of command line options for this transport are1125 The full set of command line options for this transport are::
1172 1126
1173 1127
1174 1128
@@ -1177,16 +1131,11 @@ · 2 unmodified lines
1177 1131
1178 1132
1179 1133
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
1185 There is also a related point-to-point only "ucast" transport.1134 There is also a related point-to-point only "ucast" transport.
1186 This is useful when your network does not support multicast, and1135 This is useful when your network does not support multicast, and
1187 all network connections are simple point to point links.1136 all network connections are simple point to point links.
1188 1137
1189 The full set of command line options for this transport are1138 The full set of command line options for this transport are::
1190 1139
1191 1140
1192 ethn=ucast,ethernet address,remote address,listen port,remote port1141 ethn=ucast,ethernet address,remote address,listen port,remote port
@@ -1194,7 +1143,8 @@ · 1 unmodified line
1194 1143
1195 1144
1196 1145
1197 6.6. TUN/TAP with the uml_net helper11466.6. TUN/TAP with the uml_net helper
1147-------------------------------------
1198 1148
1199 TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the1149 TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the
1200 host. The TUN/TAP backend has been in UML since 2.4.9-3um.1150 host. The TUN/TAP backend has been in UML since 2.4.9-3um.
@@ -1216,7 +1166,7 @@ · 15 unmodified lines
1216 kernel or as the tun.o module.1166 kernel or as the tun.o module.
1217 1167
1218 The format of the command line switch to attach a device to a TUN/TAP1168 The format of the command line switch to attach a device to a TUN/TAP
1219 device is1169 device is::
1220 1170
1221 1171
1222 eth <n> =tuntap,,, <IP address>1172 eth <n> =tuntap,,, <IP address>
@@ -1226,7 +1176,7 @@ · 3 unmodified lines
1226 1176
1227 For example, this argument will attach the UML's eth0 to the next1177 For example, this argument will attach the UML's eth0 to the next
1228 available tap device and assign an ethernet address to it based on its1178 available tap device and assign an ethernet address to it based on its
1229 IP address1179 IP address::
1230 1180
1231 1181
1232 eth0=tuntap,,,192.168.0.2541182 eth0=tuntap,,,192.168.0.254
@@ -1247,10 +1197,10 @@ · 14 unmodified lines
1247 There are a couple potential problems with running the TUN/TAP1197 There are a couple potential problems with running the TUN/TAP
1248 transport on a 2.4 host kernel1198 transport on a 2.4 host kernel
1249 1199
1250 o TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host1200 - TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host
1251 kernel or use the ethertap transport.1201 kernel or use the ethertap transport.
1252 1202
1253 o With an upgraded kernel, TUN/TAP may fail with1203 - With an upgraded kernel, TUN/TAP may fail with::
1254 1204
1255 1205
1256 File descriptor in bad state1206 File descriptor in bad state
@@ -1263,13 +1213,12 @@ · 6 unmodified lines
1263 make sure that /usr/src/linux points to the headers for the running1213 make sure that /usr/src/linux points to the headers for the running
1264 kernel.1214 kernel.
1265 1215
1266 These were pointed out by Tim Robinson <timro at trkr dot net> in1216 These were pointed out by Tim Robinson <timro at trkr dot net> in the past.
1267 <http://www.geocrawler.com/> name="this uml-
1268 user post"> .
1269 1217
1270 1218
1271 1219
1272 6.7. TUN/TAP with a preconfigured tap device12206.7. TUN/TAP with a preconfigured tap device
1221---------------------------------------------
1273 1222
1274 If you prefer not to have UML use uml_net (which is somewhat1223 If you prefer not to have UML use uml_net (which is somewhat
1275 insecure), with UML 2.4.17-11, you can set up a TUN/TAP device1224 insecure), with UML 2.4.17-11, you can set up a TUN/TAP device
@@ -1277,8 +1226,8 @@ · 1 unmodified line
1277 there is no need for root assistance. Setting up the device is done1226 there is no need for root assistance. Setting up the device is done
1278 as follows:1227 as follows:
1279 1228
1280 o Create the device with tunctl (available from the UML utilities1229 - Create the device with tunctl (available from the UML utilities
1281 tarball)1230 tarball)::
1282 1231
1283 1232
1284 1233
@@ -1291,8 +1240,8 @@ · 6 unmodified lines
1291 where uid is the user id or username that UML will be run as. This1240 where uid is the user id or username that UML will be run as. This
1292 will tell you what device was created.1241 will tell you what device was created.
1293 1242
1294 o Configure the device IP (change IP addresses and device name to1243 - Configure the device IP (change IP addresses and device name to
1295 suit)1244 suit)::
1296 1245
1297 1246
1298 1247
@@ -1303,8 +1252,8 @@ · 4 unmodified lines
1303 1252
1304 1253
1305 1254
1306 o Set up routing and arping if desired - this is my recipe, there are1255 - Set up routing and arping if desired - this is my recipe, there are
1307 other ways of doing the same thing1256 other ways of doing the same thing::
1308 1257
1309 1258
1310 host#1259 host#
@@ -1313,19 +1262,9 @@ · 2 unmodified lines
1313 host#1262 host#
1314 route add -host 192.168.0.253 dev tap01263 route add -host 192.168.0.253 dev tap0
1315 1264
1316
1317
1318
1319
1320
1321 host#1265 host#
1322 bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'1266 bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
1323 1267
1324
1325
1326
1327
1328
1329 host#1268 host#
1330 arp -Ds 192.168.0.253 eth0 pub1269 arp -Ds 192.168.0.253 eth0 pub
1331 1270
@@ -1338,76 +1277,43 @@ · 6 unmodified lines
1338 utility which reads the information from a config file and sets up1277 utility which reads the information from a config file and sets up
1339 devices at boot time.1278 devices at boot time.
1340 1279
1341 o Rather than using up two IPs and ARPing for one of them, you can1280 - Rather than using up two IPs and ARPing for one of them, you can
1342 also provide direct access to your LAN by the UML by using a1281 also provide direct access to your LAN by the UML by using a
1343 bridge.1282 bridge::
1344 1283
1345 1284
1346 host#1285 host#
1347 brctl addbr br01286 brctl addbr br0
1348 1287
1349 1288
1350
1351
1352
1353
1354 host#1289 host#
1355 ifconfig eth0 0.0.0.0 promisc up1290 ifconfig eth0 0.0.0.0 promisc up
1356 1291
1357 1292
1358
1359
1360
1361
1362 host#1293 host#
1363 ifconfig tap0 0.0.0.0 promisc up1294 ifconfig tap0 0.0.0.0 promisc up
1364 1295
1365 1296
1366
1367
1368
1369
1370 host#1297 host#
1371 ifconfig br0 192.168.0.1 netmask 255.255.255.0 up1298 ifconfig br0 192.168.0.1 netmask 255.255.255.0 up
1372 1299
1373 1300
1374 1301 host#
1375 1302 brctl stp br0 off
1376
1377
1378
1379 host#
1380 brctl stp br0 off
1381
1382
1383
1384
1385 1303
1386 1304
1387 host#1305 host#
1388 brctl setfd br0 11306 brctl setfd br0 1
1389 1307
1390 1308
1391
1392
1393
1394
1395 host#1309 host#
1396 brctl sethello br0 11310 brctl sethello br0 1
1397 1311
1398 1312
1399
1400
1401
1402
1403 host#1313 host#
1404 brctl addif br0 eth01314 brctl addif br0 eth0
1405 1315
1406 1316
1407
1408
1409
1410
1411 host#1317 host#
1412 brctl addif br0 tap01318 brctl addif br0 tap0
1413 1319
@@ -1417,12 +1323,12 @@ · 3 unmodified lines
1417 Note that 'br0' should be setup using ifconfig with the existing IP1323 Note that 'br0' should be setup using ifconfig with the existing IP
1418 address of eth0, as eth0 no longer has its own IP.1324 address of eth0, as eth0 no longer has its own IP.
1419 1325
1420 o1326 -
1421 1327
1422 1328
1423 Also, the /dev/net/tun device must be writable by the user running1329 Also, the /dev/net/tun device must be writable by the user running
1424 UML in order for the UML to use the device that's been configured1330 UML in order for the UML to use the device that's been configured
1425 for it. The simplest thing to do is1331 for it. The simplest thing to do is::
1426 1332
1427 1333
1428 host# chmod 666 /dev/net/tun1334 host# chmod 666 /dev/net/tun
@@ -1438,14 +1344,14 @@ · 9 unmodified lines
1438 devices and chgrp /dev/net/tun to that group with mode 664 or 660.1344 devices and chgrp /dev/net/tun to that group with mode 664 or 660.
1439 1345
1440 1346
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'
1442 (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the1348 (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the
1443 mconsole config command).1349 mconsole config command).
1444 1350
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.
1446 1352
1447 If you don't want that tap device any more, you can make it non-1353 If you don't want that tap device any more, you can make it non-
1448 persistent with1354 persistent with::
1449 1355
1450 1356
1451 host# tunctl -d tap device1357 host# tunctl -d tap device
@@ -1455,7 +1361,7 @@ · 3 unmodified lines
1455 1361
1456 Finally, tunctl has a -b (for brief mode) switch which causes it to1362 Finally, tunctl has a -b (for brief mode) switch which causes it to
1457 output only the name of the tap device it created. This makes it1363 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::
1459 1365
1460 1366
1461 host# TAP=`tunctl -u 1000 -b`1367 host# TAP=`tunctl -u 1000 -b`
@@ -1465,7 +1371,8 @@ · 3 unmodified lines
1465 1371
1466 1372
1467 1373
1468 6.8. Ethertap13746.8. Ethertap
1375--------------
1469 1376
1470 Ethertap is the general mechanism on 2.2 for userspace processes to1377 Ethertap is the general mechanism on 2.2 for userspace processes to
1471 exchange packets with the kernel.1378 exchange packets with the kernel.
@@ -1473,7 +1380,7 @@ · 1 unmodified line
1473 1380
1474 1381
1475 To use this transport, you need to describe the virtual network device1382 To use this transport, you need to describe the virtual network device
1476 on the UML command line. The general format for this is1383 on the UML command line. The general format for this is::
1477 1384
1478 1385
1479 eth <n> =ethertap, <device> , <ethernet address> , <tap IP address>1386 eth <n> =ethertap, <device> , <ethernet address> , <tap IP address>
@@ -1481,7 +1388,7 @@ · 1 unmodified line
1481 1388
1482 1389
1483 1390
1484 So, the previous example1391 So, the previous example::
1485 1392
1486 1393
1487 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.2541394 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254
@@ -1521,7 +1428,7 @@ · 33 unmodified lines
1521 1428
1522 If you want to set things up yourself, you need to make sure that the1429 If you want to set things up yourself, you need to make sure that the
1523 appropriate /dev entry exists. If it doesn't, become root and create1430 appropriate /dev entry exists. If it doesn't, become root and create
1524 it as follows:1431 it as follows::
1525 1432
1526 1433
1527 mknod /dev/tap <minor> c 36 <minor> + 161434 mknod /dev/tap <minor> c 36 <minor> + 16
@@ -1529,7 +1436,7 @@ · 1 unmodified line
1529 1436
1530 1437
1531 1438
1532 For example, this is how to create /dev/tap0:1439 For example, this is how to create /dev/tap0::
1533 1440
1534 1441
1535 mknod /dev/tap0 c 36 0 + 161442 mknod /dev/tap0 c 36 0 + 16
@@ -1539,7 +1446,7 @@ · 3 unmodified lines
1539 1446
1540 You also need to make sure that the host kernel has ethertap support.1447 You also need to make sure that the host kernel has ethertap support.
1541 If ethertap is enabled as a module, you apparently need to insmod1448 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,::
1543 1450
1544 1451
1545 host#1452 host#
@@ -1549,7 +1456,7 @@ · 3 unmodified lines
1549 1456
1550 1457
1551 will give you the tap0 interface. To get the tap1 interface, you need1458 will give you the tap0 interface. To get the tap1 interface, you need
1552 to run1459 to run::
1553 1460
1554 1461
1555 host#1462 host#
@@ -1561,7 +1468,8 @@ · 5 unmodified lines
1561 1468
1562 1469
1563 1470
1564 6.9. The switch daemon14716.9. The switch daemon
1472-----------------------
1565 1473
1566 Note: This is the daemon formerly known as uml_router, but which was1474 Note: This is the daemon formerly known as uml_router, but which was
1567 renamed so the network weenies of the world would stop growling at me.1475 renamed so the network weenies of the world would stop growling at me.
@@ -1577,7 +1485,7 @@ · 9 unmodified lines
1577 sockets.1485 sockets.
1578 1486
1579 1487
1580 If you want it to listen on a different pair of sockets, use1488 If you want it to listen on a different pair of sockets, use::
1581 1489
1582 1490
1583 -unix control socket data socket1491 -unix control socket data socket
@@ -1586,7 +1494,7 @@ · 2 unmodified lines
1586 1494
1587 1495
1588 1496
1589 If you want it to act as a hub rather than a switch, use1497 If you want it to act as a hub rather than a switch, use::
1590 1498
1591 1499
1592 -hub1500 -hub
@@ -1596,7 +1504,7 @@ · 3 unmodified lines
1596 1504
1597 1505
1598 If you want the switch to be connected to host networking (allowing1506 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), use1507 the umls to get access to the outside world through the host), use::
1600 1508
1601 1509
1602 -tap tap01510 -tap tap0
@@ -1610,7 +1518,7 @@ · 7 unmodified lines
1610 device than tap0, specify that instead of tap0.1518 device than tap0, specify that instead of tap0.
1611 1519
1612 1520
1613 uml_switch can be backgrounded as follows1521 uml_switch can be backgrounded as follows::
1614 1522
1615 1523
1616 host%1524 host%
@@ -1623,7 +1531,7 @@ · 6 unmodified lines
1623 stdin for EOF. When it sees that, it exits.1531 stdin for EOF. When it sees that, it exits.
1624 1532
1625 1533
1626 The general format of the kernel command line switch is1534 The general format of the kernel command line switch is::
1627 1535
1628 1536
1629 1537
@@ -1639,7 +1547,8 @@ · 9 unmodified lines
1639 how to communicate with the daemon. You should only specify them if1547 how to communicate with the daemon. You should only specify them if
1640 you told the daemon to use different sockets than the default. So, if1548 you told the daemon to use different sockets than the default. So, if
1641 you ran the daemon with no arguments, running the UML on the same1549 you ran the daemon with no arguments, running the UML on the same
1642 machine with1550 machine with::
1551
1643 eth0=daemon1552 eth0=daemon
1644 1553
1645 1554
@@ -1649,7 +1558,8 @@ · 3 unmodified lines
1649 1558
1650 1559
1651 1560
1652 6.10. Slip15616.10. Slip
1562-----------
1653 1563
1654 Slip is another, less general, mechanism for a process to communicate1564 Slip is another, less general, mechanism for a process to communicate
1655 with the host networking. In contrast to the ethertap interface,1565 with the host networking. In contrast to the ethertap interface,
@@ -1658,7 +1568,7 @@ · 2 unmodified lines
1658 IP.1568 IP.
1659 1569
1660 1570
1661 The general format of the command line switch is1571 The general format of the command line switch is::
1662 1572
1663 1573
1664 1574
@@ -1681,7 +1591,8 @@ · 16 unmodified lines
1681 1591
1682 1592
1683 1593
1684 6.11. Slirp15946.11. Slirp
1595------------
1685 1596
1686 slirp uses an external program, usually /usr/bin/slirp, to provide IP1597 slirp uses an external program, usually /usr/bin/slirp, to provide IP
1687 only networking connectivity through the host. This is similar to IP1598 only networking connectivity through the host. This is similar to IP
@@ -1691,7 +1602,7 @@ · 3 unmodified lines
1691 root access or setuid binaries on the host.1602 root access or setuid binaries on the host.
1692 1603
1693 1604
1694 The general format of the command line switch for slirp is:1605 The general format of the command line switch for slirp is::
1695 1606
1696 1607
1697 1608
@@ -1716,7 +1627,7 @@ · 18 unmodified lines
1716 The eth0 interface on UML should be set up with the IP 10.2.0.15,1627 The eth0 interface on UML should be set up with the IP 10.2.0.15,
1717 although you can use anything as long as it is not used by a network1628 although you can use anything as long as it is not used by a network
1718 you will be connecting to. The default route on UML should be set to1629 you will be connecting to. The default route on UML should be set to
1719 use1630 use::
1720 1631
1721 1632
1722 UML#1633 UML#
@@ -1737,10 +1648,11 @@ · 14 unmodified lines
1737 1648
1738 1649
1739 1650
1740 6.12. pcap16516.12. pcap
1652-----------
1741 1653
1742 The pcap transport is attached to a UML ethernet device on the command1654 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::
1744 1656
1745 1657
1746 1658
@@ -1762,7 +1674,7 @@ · 15 unmodified lines
1762 expression optimizer is used.1674 expression optimizer is used.
1763 1675
1764 1676
1765 Example:1677 Example::
1766 1678
1767 1679
1768 1680
@@ -1777,7 +1689,8 @@ · 8 unmodified lines
1777 1689
1778 1690
1779 1691
1780 6.13. Setting up the host yourself16926.13. Setting up the host yourself
1693-----------------------------------
1781 1694
1782 If you don't specify an address for the host side of the ethertap or1695 If you don't specify an address for the host side of the ethertap or
1783 slip device, UML won't do any setup on the host. So this is what is1696 slip device, UML won't do any setup on the host. So this is what is
@@ -1785,19 +1698,15 @@ · 1 unmodified line
1785 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your1698 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your
1786 own network):1699 own network):
1787 1700
1788 o The device needs to be configured with its IP address. Tap devices1701 - The device needs to be configured with its IP address. Tap devices
1789 are also configured with an mtu of 1484. Slip devices are1702 are also configured with an mtu of 1484. Slip devices are
1790 configured with a point-to-point address pointing at the UML ip1703 configured with a point-to-point address pointing at the UML ip
1791 address.1704 address::
1792 1705
1793 1706
1794 host# ifconfig tap0 arp mtu 1484 192.168.0.251 up1707 host# ifconfig tap0 arp mtu 1484 192.168.0.251 up
1795 1708
1796 1709
1797
1798
1799
1800
1801 host#1710 host#
1802 ifconfig sl0 192.168.0.251 pointopoint 192.168.0.250 up1711 ifconfig sl0 192.168.0.251 pointopoint 192.168.0.250 up
1803 1712
@@ -1805,7 +1714,7 @@ · 1 unmodified line
1805 1714
1806 1715
1807 1716
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::
1809 1718
1810 1719
1811 UML# route add -host 192.168.0.250 gw 192.168.0.2511720 UML# route add -host 192.168.0.250 gw 192.168.0.251
@@ -1814,8 +1723,8 @@ · 2 unmodified lines
1814 1723
1815 1724
1816 1725
1817 o To allow other hosts on your network to see the virtual machine,1726 - To allow other hosts on your network to see the virtual machine,
1818 proxy arp is set up for it.1727 proxy arp is set up for it::
1819 1728
1820 1729
1821 host# arp -Ds 192.168.0.250 eth0 pub1730 host# arp -Ds 192.168.0.250 eth0 pub
@@ -1824,7 +1733,7 @@ · 2 unmodified lines
1824 1733
1825 1734
1826 1735
1827 o Finally, the host is set up to route packets.1736 - Finally, the host is set up to route packets::
1828 1737
1829 1738
1830 host# echo 1 > /proc/sys/net/ipv4/ip_forward1739 host# echo 1 > /proc/sys/net/ipv4/ip_forward
@@ -1838,12 +1747,14 @@ · 7 unmodified lines
1838 1747
1839 1748
1840 1749
1841 7. Sharing Filesystems between Virtual Machines17507. Sharing Filesystems between Virtual Machines
1751================================================
1842 1752
1843 1753
1844 1754
1845 1755
1846 7.1. A warning17567.1. A warning
1757---------------
1847 1758
1848 Don't attempt to share filesystems simply by booting two UMLs from the1759 Don't attempt to share filesystems simply by booting two UMLs from the
1849 same file. That's the same thing as booting two physical machines1760 same file. That's the same thing as booting two physical machines
@@ -1851,7 +1762,8 @@ · 1 unmodified line
1851 1762
1852 1763
1853 1764
1854 7.2. Using layered block devices17657.2. Using layered block devices
1766---------------------------------
1855 1767
1856 The way to share a filesystem between two virtual machines is to use1768 The way to share a filesystem between two virtual machines is to use
1857 the copy-on-write (COW) layering capability of the ubd block driver.1769 the copy-on-write (COW) layering capability of the ubd block driver.
@@ -1872,7 +1784,7 @@ · 14 unmodified lines
1872 1784
1873 1785
1874 To add a copy-on-write layer to an existing block device file, simply1786 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::
1876 1788
1877 1789
1878 ubd0=root_fs_cow,root_fs_debian_221790 ubd0=root_fs_cow,root_fs_debian_22
@@ -1883,7 +1795,7 @@ · 4 unmodified lines
1883 where 'root_fs_cow' is the private COW file and 'root_fs_debian_22' is1795 where 'root_fs_cow' is the private COW file and 'root_fs_debian_22' is
1884 the existing shared filesystem. The COW file need not exist. If it1796 the existing shared filesystem. The COW file need not exist. If it
1885 doesn't, the driver will create and initialize it. Once the COW file1797 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::
1887 1799
1888 1800
1889 ubd0=root_fs_cow1801 ubd0=root_fs_cow
@@ -1896,14 +1808,16 @@ · 6 unmodified lines
1896 1808
1897 1809
1898 1810
1899 7.3. Note!18117.3. Note!
1812-----------
1900 1813
1901 When checking the size of the COW file in order to see the gobs of1814 When checking the size of the COW file in order to see the gobs of
1902 space that you're saving, make sure you use 'ls -ls' to see the actual1815 space that you're saving, make sure you use 'ls -ls' to see the actual
1903 disk consumption rather than the length of the file. The COW file is1816 disk consumption rather than the length of the file. The COW file is
1904 sparse, so the length will be very different from the disk usage.1817 sparse, so the length will be very different from the disk usage.
1905 Here is a 'ls -l' of a COW file and backing file from one boot and1818 Here is a 'ls -l' of a COW file and backing file from one boot and
1906 shutdown:1819 shutdown::
1820
1907 host% ls -l cow.debian debian2.21821 host% ls -l cow.debian debian2.2
1908 -rw-r--r-- 1 jdike jdike 492504064 Aug 6 21:16 cow.debian1822 -rw-r--r-- 1 jdike jdike 492504064 Aug 6 21:16 cow.debian
1909 -rwxrw-rw- 1 jdike jdike 537919488 Aug 6 20:42 debian2.21823 -rwxrw-rw- 1 jdike jdike 537919488 Aug 6 20:42 debian2.2
@@ -1911,7 +1825,7 @@ · 1 unmodified line
1911 1825
1912 1826
1913 1827
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'::
1915 1829
1916 1830
1917 host% ls -ls cow.debian debian2.21831 host% ls -ls cow.debian debian2.2
@@ -1926,7 +1840,8 @@ · 8 unmodified lines
1926 1840
1927 1841
1928 1842
1929 7.4. Another warning18437.4. Another warning
1844---------------------
1930 1845
1931 Once a filesystem is being used as a readonly backing file for a COW1846 Once a filesystem is being used as a readonly backing file for a COW
1932 file, do not boot directly from it or modify it in any way. Doing so1847 file, do not boot directly from it or modify it in any way. Doing so
@@ -1952,7 +1867,8 @@ · 19 unmodified lines
1952 1867
1953 1868
1954 1869
1955 7.5. uml_moo : Merging a COW file with its backing file18707.5. uml_moo : Merging a COW file with its backing file
1871--------------------------------------------------------
1956 1872
1957 Depending on how you use UML and COW devices, it may be advisable to1873 Depending on how you use UML and COW devices, it may be advisable to
1958 merge the changes in the COW file into the backing file every once in1874 merge the changes in the COW file into the backing file every once in
@@ -1961,7 +1877,7 @@ · 2 unmodified lines
1961 1877
1962 1878
1963 1879
1964 The utility that does this is uml_moo. Its usage is1880 The utility that does this is uml_moo. Its usage is::
1965 1881
1966 1882
1967 host% uml_moo COW file new backing file1883 host% uml_moo COW file new backing file
@@ -1991,8 +1907,8 @@ · 23 unmodified lines
1991 1907
1992 uml_moo is installed with the UML deb and RPM. If you didn't install1908 uml_moo is installed with the UML deb and RPM. If you didn't install
1993 UML from one of those packages, you can also get it from the UML1909 UML from one of those packages, you can also get it from the UML
1994 utilities <http://user-mode-linux.sourceforge.net/1910 utilities http://user-mode-linux.sourceforge.net/utilities tar file
1995 utilities> tar file in tools/moo.1911 in tools/moo.
1996 1912
1997 1913
1998 1914
@@ -2001,7 +1917,8 @@ · 2 unmodified lines
2001 1917
2002 1918
2003 1919
2004 8. Creating filesystems19208. Creating filesystems
1921========================
2005 1922
2006 1923
2007 You may want to create and mount new UML filesystems, either because1924 You may want to create and mount new UML filesystems, either because
@@ -2015,13 +1932,14 @@ · 7 unmodified lines
2015 should be easy to translate to the filesystem of your choice.1932 should be easy to translate to the filesystem of your choice.
2016 1933
2017 1934
2018 8.1. Create the filesystem file19358.1. Create the filesystem file
1936================================
2019 1937
2020 dd is your friend. All you need to do is tell dd to create an empty1938 dd is your friend. All you need to do is tell dd to create an empty
2021 file of the appropriate size. I usually make it sparse to save time1939 file of the appropriate size. I usually make it sparse to save time
2022 and to avoid allocating disk space until it's actually used. For1940 and to avoid allocating disk space until it's actually used. For
2023 example, the following command will create a sparse 100 meg file full1941 example, the following command will create a sparse 100 meg file full
2024 of zeroes.1942 of zeroes::
2025 1943
2026 1944
2027 host%1945 host%
@@ -2034,9 +1952,9 @@ · 6 unmodified lines
2034 1952
2035 8.2. Assign the file to a UML device1953 8.2. Assign the file to a UML device
2036 1954
2037 Add an argument like the following to the UML command line:1955 Add an argument like the following to the UML command line::
2038 1956
2039 ubd4=new_filesystem1957 ubd4=new_filesystem
2040 1958
2041 1959
2042 1960
@@ -2053,7 +1971,7 @@ · 10 unmodified lines
2053 etc), then get them into UML by way of the net or hostfs.1971 etc), then get them into UML by way of the net or hostfs.
2054 1972
2055 1973
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::
2057 1975
2058 1976
2059 host# mkreiserfs /dev/ubd/41977 host# mkreiserfs /dev/ubd/4
@@ -2077,7 +1995,7 @@ · 17 unmodified lines
2077 1995
2078 1996
2079 1997
2080 Now, mount it:1998 Now, mount it::
2081 1999
2082 2000
2083 UML#2001 UML#
@@ -2096,7 +2014,8 @@ · 12 unmodified lines
2096 2014
2097 2015
2098 2016
2099 9. Host file access20179. Host file access
2018====================
2100 2019
2101 2020
2102 If you want to access files on the host machine from inside UML, you2021 If you want to access files on the host machine from inside UML, you
@@ -2112,10 +2031,11 @@ · 9 unmodified lines
2112 files contained in it just as you would on the host.2031 files contained in it just as you would on the host.
2113 2032
2114 2033
2115 9.1. Using hostfs20349.1. Using hostfs
2035------------------
2116 2036
2117 To begin with, make sure that hostfs is available inside the virtual2037 To begin with, make sure that hostfs is available inside the virtual
2118 machine with2038 machine with::
2119 2039
2120 2040
2121 UML# cat /proc/filesystems2041 UML# cat /proc/filesystems
@@ -2127,7 +2047,7 @@ · 5 unmodified lines
2127 module and available inside the virtual machine, and insmod it.2047 module and available inside the virtual machine, and insmod it.
2128 2048
2129 2049
2130 Now all you need to do is run mount:2050 Now all you need to do is run mount::
2131 2051
2132 2052
2133 UML# mount none /mnt/host -t hostfs2053 UML# mount none /mnt/host -t hostfs
@@ -2139,7 +2059,7 @@ · 5 unmodified lines
2139 2059
2140 2060
2141 If you don't want to mount the host root directory, then you can2061 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::
2143 2063
2144 2064
2145 UML# mount none /mnt/home -t hostfs -o /home2065 UML# mount none /mnt/home -t hostfs -o /home
@@ -2151,13 +2071,14 @@ · 5 unmodified lines
2151 2071
2152 2072
2153 2073
2154 9.2. hostfs as the root filesystem20749.2. hostfs as the root filesystem
2075-----------------------------------
2155 2076
2156 It's possible to boot from a directory hierarchy on the host using2077 It's possible to boot from a directory hierarchy on the host using
2157 hostfs rather than using the standard filesystem in a file.2078 hostfs rather than using the standard filesystem in a file.
2158 2079
2159 To start, you need that hierarchy. The easiest way is to loop mount2080 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::
2161 2082
2162 2083
2163 host# mount root_fs uml_root_dir -o loop2084 host# mount root_fs uml_root_dir -o loop
@@ -2166,15 +2087,15 @@ · 2 unmodified lines
2166 2087
2167 2088
2168 You need to change the filesystem type of / in etc/fstab to be2089 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::
2170 2091
2171 /dev/ubd/0 / hostfs defaults 1 12092 /dev/ubd/0 / hostfs defaults 1 1
2172 2093
2173 2094
2174 2095
2175 2096
2176 Then you need to chown to yourself all the files in that directory2097 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::
2178 2099
2179 2100
2180 host# find . -uid 0 -exec chown jdike {} \;2101 host# find . -uid 0 -exec chown jdike {} \;
@@ -2183,7 +2104,7 @@ · 2 unmodified lines
2183 2104
2184 2105
2185 Next, make sure that your UML kernel has hostfs compiled in, not as a2106 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::
2187 2108
2188 2109
2189 ubd0=/path/to/uml/root/directory2110 ubd0=/path/to/uml/root/directory
@@ -2194,41 +2115,35 @@ · 4 unmodified lines
2194 UML should then boot as it does normally.2115 UML should then boot as it does normally.
2195 2116
2196 2117
2197 9.3. Building hostfs21189.3. Building hostfs
2119---------------------
2198 2120
2199 If you need to build hostfs because it's not in your kernel, you have2121 If you need to build hostfs because it's not in your kernel, you have
2200 two choices:2122 two choices:
2201 2123
2202 2124
2203 2125
2204 o Compiling hostfs into the kernel:2126 - Compiling hostfs into the kernel:
2205 2127
2206 2128
2207 Reconfigure the kernel and set the 'Host filesystem' option under2129 Reconfigure the kernel and set the 'Host filesystem' option under
2208 2130
2209 2131
2210 o Compiling hostfs as a module:2132 - Compiling hostfs as a module:
2211 2133
2212 2134
2213 Reconfigure the kernel and set the 'Host filesystem' option under2135 Reconfigure the kernel and set the 'Host filesystem' option under
2214 be in arch/um/fs/hostfs/hostfs.o. Install that in2136 be in arch/um/fs/hostfs/hostfs.o. Install that in
2215 /lib/modules/`uname -r`/fs in the virtual machine, boot it up, and2137 ``/lib/modules/$(uname -r)/fs`` in the virtual machine, boot it up, and::
2216 2138
2217 2139
2218 UML# insmod hostfs2140 UML# insmod hostfs
2219 2141
2220 2142
2143.. _The_Management_Console:
2221 2144
2222 214510. The Management Console
2223 2146===========================
2224
2225
2226
2227
2228
2229
2230
2231 10. The Management Console
2232 2147
2233 2148
2234 2149
@@ -2240,15 +2155,15 @@ · 5 unmodified lines
2240 2155
2241 There are a number of things you can do with the mconsole interface:2156 There are a number of things you can do with the mconsole interface:
2242 2157
2243 o get the kernel version2158 - get the kernel version
2244 2159
2245 o add and remove devices2160 - add and remove devices
2246 2161
2247 o halt or reboot the machine2162 - halt or reboot the machine
2248 2163
2249 o Send SysRq commands2164 - Send SysRq commands
2250 2165
2251 o Pause and resume the UML2166 - Pause and resume the UML
2252 2167
2253 2168
2254 You need the mconsole client (uml_mconsole) which is present in CVS2169 You need the mconsole client (uml_mconsole) which is present in CVS
@@ -2257,7 +2172,7 @@ · 2 unmodified lines
2257 2172
2258 2173
2259 You also need CONFIG_MCONSOLE (under 'General Setup') enabled in UML.2174 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::
2261 2176
2262 2177
2263 mconsole initialized on /home/jdike/.uml/umlNJ32yL/mconsole2178 mconsole initialized on /home/jdike/.uml/umlNJ32yL/mconsole
@@ -2265,7 +2180,7 @@ · 1 unmodified line
2265 2180
2266 2181
2267 2182
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.::
2269 2184
2270 2185
2271 umid=debian2186 umid=debian
@@ -2273,7 +2188,7 @@ · 1 unmodified line
2273 2188
2274 2189
2275 2190
2276 you'll see this2191 you'll see this::
2277 2192
2278 2193
2279 mconsole initialized on /home/jdike/.uml/debian/mconsole2194 mconsole initialized on /home/jdike/.uml/debian/mconsole
@@ -2282,7 +2197,7 @@ · 2 unmodified lines
2282 2197
2283 2198
2284 That file is the socket that uml_mconsole will use to communicate with2199 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::
2286 2201
2287 2202
2288 host% uml_mconsole debian2203 host% uml_mconsole debian
@@ -2290,7 +2205,7 @@ · 1 unmodified line
2290 2205
2291 2206
2292 2207
2293 or2208 or::
2294 2209
2295 2210
2296 host% uml_mconsole /home/jdike/.uml/debian/mconsole2211 host% uml_mconsole /home/jdike/.uml/debian/mconsole
@@ -2300,30 +2215,31 @@ · 3 unmodified lines
2300 2215
2301 You'll get a prompt, at which you can run one of these commands:2216 You'll get a prompt, at which you can run one of these commands:
2302 2217
2303 o version2218 - version
2304 2219
2305 o halt2220 - halt
2306 2221
2307 o reboot2222 - reboot
2308 2223
2309 o config2224 - config
2310 2225
2311 o remove2226 - remove
2312 2227
2313 o sysrq2228 - sysrq
2314 2229
2315 o help2230 - help
2316 2231
2317 o cad2232 - cad
2318 2233
2319 o stop2234 - stop
2320 2235
2321 o go2236 - go
2322 2237
2323 2238
2324 10.1. version223910.1. version
2240--------------
2325 2241
2326 This takes no arguments. It prints the UML version.2242 This takes no arguments. It prints the UML version::
2327 2243
2328 2244
2329 (mconsole) version2245 (mconsole) version
@@ -2342,11 +2258,12 @@ · 12 unmodified lines
2342 2258
2343 2259
2344 2260
2345 10.2. halt and reboot226110.2. halt and reboot
2262----------------------
2346 2263
2347 These take no arguments. They shut the machine down immediately, with2264 These take no arguments. They shut the machine down immediately, with
2348 no syncing of disks and no clean shutdown of userspace. So, they are2265 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::
2350 2267
2351 2268
2352 (mconsole) halt2269 (mconsole) halt
@@ -2357,34 +2274,36 @@ · 4 unmodified lines
2357 2274
2358 2275
2359 2276
2360 10.3. config227710.3. config
2278-------------
2361 2279
2362 "config" adds a new device to the virtual machine. Currently the ubd2280 "config" adds a new device to the virtual machine. Currently the ubd
2363 and network drivers support this. It takes one argument, which is the2281 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::
2365 2283
2366 2284
2367 2285
2368 2286
2369 (mconsole)2287 (mconsole)
2370 config ubd3=/home/jdike/incoming/roots/root_fs_debian222288 config ubd3=/home/jdike/incoming/roots/root_fs_debian22
2371 2289
2372 OK2290 OK
2373 (mconsole) config eth1=mcast2291 (mconsole) config eth1=mcast
2374 OK2292 OK
2375 2293
2376 2294
2377 2295
2378 2296
2379 2297
2380 2298
2381 10.4. remove229910.4. remove
2300-------------
2382 2301
2383 "remove" deletes a device from the system. Its argument is just the2302 "remove" deletes a device from the system. Its argument is just the
2384 name of the device to be removed. The device must be idle in whatever2303 name of the device to be removed. The device must be idle in whatever
2385 sense the driver considers necessary. In the case of the ubd driver,2304 sense the driver considers necessary. In the case of the ubd driver,
2386 the removed block device must not be mounted, swapped on, or otherwise2305 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::
2388 2307
2389 2308
2390 (mconsole) remove ubd32309 (mconsole) remove ubd3
@@ -2397,7 +2316,8 @@ · 6 unmodified lines
2397 2316
2398 2317
2399 2318
2400 10.5. sysrq231910.5. sysrq
2320------------
2401 2321
2402 This takes one argument, which is a single letter. It calls the2322 This takes one argument, which is a single letter. It calls the
2403 generic kernel's SysRq driver, which does whatever is called for by2323 generic kernel's SysRq driver, which does whatever is called for by
@@ -2407,19 +2327,21 @@ · 3 unmodified lines
2407 2327
2408 2328
2409 2329
2410 10.6. help233010.6. help
2331-----------
2411 2332
2412 "help" returns a string listing the valid commands and what each one2333 "help" returns a string listing the valid commands and what each one
2413 does.2334 does.
2414 2335
2415 2336
2416 2337
2417 10.7. cad233810.7. cad
2339----------
2418 2340
2419 This invokes the Ctl-Alt-Del action on init. What exactly this ends2341 This invokes the Ctl-Alt-Del action on init. What exactly this ends
2420 up doing is up to /etc/inittab. Normally, it reboots the machine.2342 up doing is up to /etc/inittab. Normally, it reboots the machine.
2421 With UML, this is usually not desired, so if a halt would be better,2343 With UML, this is usually not desired, so if a halt would be better,
2422 then find the section of inittab that looks like this2344 then find the section of inittab that looks like this::
2423 2345
2424 2346
2425 # What to do when CTRL-ALT-DEL is pressed.2347 # What to do when CTRL-ALT-DEL is pressed.
@@ -2432,7 +2354,8 @@ · 6 unmodified lines
2432 2354
2433 2355
2434 2356
2435 10.8. stop235710.8. stop
2358-----------
2436 2359
2437 This puts the UML in a loop reading mconsole requests until a 'go'2360 This puts the UML in a loop reading mconsole requests until a 'go'
2438 mconsole command is received. This is very useful for making backups2361 mconsole command is received. This is very useful for making backups
@@ -2448,7 +2371,8 @@ · 9 unmodified lines
2448 2371
2449 2372
2450 2373
2451 10.9. go237410.9. go
2375---------
2452 2376
2453 This resumes a UML after being paused by a 'stop' command. Note that2377 This resumes a UML after being paused by a 'stop' command. Note that
2454 when the UML has resumed, TCP connections may have timed out and if2378 when the UML has resumed, TCP connections may have timed out and if
@@ -2460,9 +2384,10 @@ · 5 unmodified lines
2460 2384
2461 2385
2462 2386
2387.. _Kernel_debugging:
2463 2388
2464 238911. Kernel debugging
2465 11. Kernel debugging2390=====================
2466 2391
2467 2392
2468 Note: The interface that makes debugging, as described here, possible2393 Note: The interface that makes debugging, as described here, possible
@@ -2477,15 +2402,16 @@ · 8 unmodified lines
2477 2402
2478 2403
2479 In order to debug the kernel, you need build it from source. See2404 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.
2481 Make sure that you enable CONFIG_DEBUGSYM and CONFIG_PT_PROXY during2406 Make sure that you enable CONFIG_DEBUGSYM and CONFIG_PT_PROXY during
2482 the config. These will compile the kernel with -g, and enable the2407 the config. These will compile the kernel with ``-g``, and enable the
2483 ptrace proxy so that gdb works with UML, respectively.2408 ptrace proxy so that gdb works with UML, respectively.
2484 2409
2485 2410
2486 2411
2487 2412
2488 11.1. Starting the kernel under gdb241311.1. Starting the kernel under gdb
2414------------------------------------
2489 2415
2490 You can have the kernel running under the control of gdb from the2416 You can have the kernel running under the control of gdb from the
2491 beginning by putting 'debug' on the command line. You will get an2417 beginning by putting 'debug' on the command line. You will get an
@@ -2498,7 +2424,11 @@ · 6 unmodified lines
2498 There is a transcript of a debugging session here <debug-2424 There is a transcript of a debugging session here <debug-
2499 session.html> , with breakpoints being set in the scheduler and in an2425 session.html> , with breakpoints being set in the scheduler and in an
2500 interrupt handler.2426 interrupt handler.
2501 11.2. Examining sleeping processes2427
2428
242911.2. Examining sleeping processes
2430-----------------------------------
2431
2502 2432
2503 Not every bug is evident in the currently running process. Sometimes,2433 Not every bug is evident in the currently running process. Sometimes,
2504 processes hang in the kernel when they shouldn't because they've2434 processes hang in the kernel when they shouldn't because they've
@@ -2516,7 +2446,7 @@ · 11 unmodified lines
2516 2446
2517 Now what you do is this:2447 Now what you do is this:
2518 2448
2519 o detach from the current thread2449 - detach from the current thread::
2520 2450
2521 2451
2522 (UML gdb) det2452 (UML gdb) det
@@ -2525,7 +2455,7 @@ · 2 unmodified lines
2525 2455
2526 2456
2527 2457
2528 o attach to the thread you are interested in2458 - attach to the thread you are interested in::
2529 2459
2530 2460
2531 (UML gdb) att <host pid>2461 (UML gdb) att <host pid>
@@ -2534,7 +2464,7 @@ · 2 unmodified lines
2534 2464
2535 2465
2536 2466
2537 o look at its stack and anything else of interest2467 - look at its stack and anything else of interest::
2538 2468
2539 2469
2540 (UML gdb) bt2470 (UML gdb) bt
@@ -2545,18 +2475,14 @@ · 4 unmodified lines
2545 Note that you can't do anything at this point that requires that a2475 Note that you can't do anything at this point that requires that a
2546 process execute, e.g. calling a function2476 process execute, e.g. calling a function
2547 2477
2548 o when you're done looking at that process, reattach to the current2478 - when you're done looking at that process, reattach to the current
2549 thread and continue it2479 thread and continue it::
2550 2480
2551 2481
2552 (UML gdb)2482 (UML gdb)
2553 att 12483 att 1
2554 2484
2555 2485
2556
2557
2558
2559
2560 (UML gdb)2486 (UML gdb)
2561 c2487 c
2562 2488
@@ -2569,12 +2495,13 @@ · 6 unmodified lines
2569 2495
2570 2496
2571 2497
2572 11.3. Running ddd on UML249811.3. Running ddd on UML
2499-------------------------
2573 2500
2574 ddd works on UML, but requires a special kludge. The process goes2501 ddd works on UML, but requires a special kludge. The process goes
2575 like this:2502 like this:
2576 2503
2577 o Start ddd2504 - Start ddd::
2578 2505
2579 2506
2580 host% ddd linux2507 host% ddd linux
@@ -2583,14 +2510,14 @@ · 2 unmodified lines
2583 2510
2584 2511
2585 2512
2586 o With ps, get the pid of the gdb that ddd started. You can ask the2513 - With ps, get the pid of the gdb that ddd started. You can ask the
2587 gdb to tell you, but for some reason that confuses things and2514 gdb to tell you, but for some reason that confuses things and
2588 causes a hang.2515 causes a hang.
2589 2516
2590 o run UML with 'debug=parent gdb-pid=<pid>' added to the command line2517 - run UML with 'debug=parent gdb-pid=<pid>' added to the command line
2591 - it will just sit there after you hit return2518 - it will just sit there after you hit return
2592 2519
2593 o type 'att 1' to the ddd gdb and you will see something like2520 - type 'att 1' to the ddd gdb and you will see something like::
2594 2521
2595 2522
2596 0xa013dc51 in __kill ()2523 0xa013dc51 in __kill ()
@@ -2602,12 +2529,14 @@ · 5 unmodified lines
2602 2529
2603 2530
2604 2531
2605 o At this point, type 'c', UML will boot up, and you can use ddd just2532 - At this point, type 'c', UML will boot up, and you can use ddd just
2606 as you do on any other process.2533 as you do on any other process.
2607 2534
2608 2535
2609 2536
2610 11.4. Debugging modules253711.4. Debugging modules
2538------------------------
2539
2611 2540
2612 gdb has support for debugging code which is dynamically loaded into2541 gdb has support for debugging code which is dynamically loaded into
2613 the process. This support is what is needed to debug kernel modules2542 the process. This support is what is needed to debug kernel modules
@@ -2629,7 +2558,8 @@ · 15 unmodified lines
2629 2558
2630 2559
2631 First, you must tell it where your modules are. There is a list in2560 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
2633 set MODULE_PATHS {2563 set MODULE_PATHS {
2634 "fat" "/usr/src/uml/linux-2.4.18/fs/fat/fat.o"2564 "fat" "/usr/src/uml/linux-2.4.18/fs/fat/fat.o"
2635 "isofs" "/usr/src/uml/linux-2.4.18/fs/isofs/isofs.o"2565 "isofs" "/usr/src/uml/linux-2.4.18/fs/isofs/isofs.o"
@@ -2641,9 +2571,7 @@ · 5 unmodified lines
2641 2571
2642 You change that to list the names and paths of the modules that you2572 You change that to list the names and paths of the modules that you
2643 are going to debug. Then you run it from the toplevel directory of2573 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:2574 your UML pool and it basically tells you what to do::
2645
2646
2647 2575
2648 2576
2649 ******** GDB pid is 21903 ********2577 ******** GDB pid is 21903 ********
@@ -2666,7 +2594,7 @@ · 16 unmodified lines
2666 2594
2667 2595
2668 After you run UML and it sits there doing nothing, you hit return at2596 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::
2670 2598
2671 2599
2672 Attaching to program: /home/jdike/linux/2.4/um/./linux, process 12600 Attaching to program: /home/jdike/linux/2.4/um/./linux, process 1
@@ -2678,63 +2606,48 @@ · 5 unmodified lines
2678 2606
2679 2607
2680 At this point, you debug normally. When you insmod something, the2608 At this point, you debug normally. When you insmod something, the
2681 expect magic will kick in and you'll see something like:2609 expect magic will kick in and you'll see something like::
2682 2610
2683 2611
2684 2612 *** Module hostfs loaded ***
2685 2613 Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs",
2686 2614 mod_user=0x8070e00) at module.c:349
2687 2615 349 char *name, *n_name, *name_tmp = NULL;
2688 2616 (UML gdb) finish
2689 2617 Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs",
2690 2618 mod_user=0x8070e00) at module.c:349
2691 2619 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411
2692 2620 411 else res = EXECUTE_SYSCALL(syscall, regs);
2693 2621 Value returned is $1 = 0
2694 2622 (UML gdb)
2695 2623 p/x (int)module_list + module_list->size_of_struct
2696 2624
2697 2625 $2 = 0xa9021054
2698 2626 (UML gdb) symbol-file ./linux
2699 *** Module hostfs loaded ***2627 Load new symbol table from "./linux"? (y or n) y
2700 Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs",2628 Reading symbols from ./linux...
2701 mod_user=0x8070e00) at module.c:3492629 done.
2702 349 char *name, *n_name, *name_tmp = NULL;2630 (UML gdb)
2703 (UML gdb) finish2631 add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054
2704 Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs",2632
2705 mod_user=0x8070e00) at module.c:3492633 add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at
2706 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:4112634 .text_addr = 0xa9021054
2707 411 else res = EXECUTE_SYSCALL(syscall, regs);2635 (y or n) y
2708 Value returned is $1 = 02636
2709 (UML gdb)2637 Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o...
2710 p/x (int)module_list + module_list->size_of_struct2638 done.
2711 2639 (UML gdb) p *module_list
2712 $2 = 0xa90210542640 $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs",
2713 (UML gdb) symbol-file ./linux2641 size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1,
2714 Load new symbol table from "./linux"? (y or n) y2642 nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0,
2715 Reading symbols from ./linux...2643 init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>,
2716 done.2644 ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0,
2717 (UML gdb)2645 persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0,
2718 add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa90210542646 kallsyms_end = 0x0,
2719 2647 archdata_start = 0x1b855 <Address 0x1b855 out of bounds>,
2720 add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at2648 archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>,
2721 .text_addr = 0xa90210542649 kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>}
2722 (y or n) y2650 >> Finished loading symbols for hostfs ...
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 ...
2738 2651
2739 2652
2740 2653
@@ -2744,7 +2657,7 @@ · 3 unmodified lines
2744 2657
2745 2658
2746 Boot the kernel under the debugger and load the module with insmod or2659 Boot the kernel under the debugger and load the module with insmod or
2747 modprobe. With gdb, do:2660 modprobe. With gdb, do::
2748 2661
2749 2662
2750 (UML gdb) p module_list2663 (UML gdb) p module_list
@@ -2758,12 +2671,12 @@ · 7 unmodified lines
2758 the name fields until find the module you want to debug. Take the2671 the name fields until find the module you want to debug. Take the
2759 address of that structure, and add module.size_of_struct (which in2672 address of that structure, and add module.size_of_struct (which in
2760 2.4.10 kernels is 96 (0x60)) to it. Gdb can make this hard addition2673 2.4.10 kernels is 96 (0x60)) to it. Gdb can make this hard addition
2761 for you :-):2674 for you :-)::
2762 2675
2763 2676
2764 2677
2765 (UML gdb)2678 (UML gdb)
2766 printf "%#x\n", (int)module_list module_list->size_of_struct2679 printf "%#x\n", (int)module_list module_list->size_of_struct
2767 2680
2768 2681
2769 2682
@@ -2771,7 +2684,7 @@ · 1 unmodified line
2771 The offset from the module start occasionally changes (before 2.4.0,2684 The offset from the module start occasionally changes (before 2.4.0,
2772 it was module.size_of_struct + 4), so it's a good idea to check the2685 it was module.size_of_struct + 4), so it's a good idea to check the
2773 init and cleanup addresses once in a while, as describe below. Now2686 init and cleanup addresses once in a while, as describe below. Now
2774 do:2687 do::
2775 2688
2776 2689
2777 (UML gdb)2690 (UML gdb)
@@ -2786,7 +2699,7 @@ · 8 unmodified lines
2786 If there's any doubt that you got the offset right, like breakpoints2699 If there's any doubt that you got the offset right, like breakpoints
2787 appear not to work, or they're appearing in the wrong place, you can2700 appear not to work, or they're appearing in the wrong place, you can
2788 check it by looking at the module structure. The init and cleanup2701 check it by looking at the module structure. The init and cleanup
2789 fields should look like:2702 fields should look like::
2790 2703
2791 2704
2792 init = 0x588066b0 <init_hostfs>, cleanup = 0x588066c0 <exit_hostfs>2705 init = 0x588066b0 <init_hostfs>, cleanup = 0x588066c0 <exit_hostfs>
@@ -2801,7 +2714,7 @@ · 8 unmodified lines
2801 2714
2802 When you want to load in a new version of the module, you need to get2715 When you want to load in a new version of the module, you need to get
2803 gdb to forget about the old one. The only way I've found to do that2716 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::
2805 2718
2806 2719
2807 (UML gdb) symbol-file2720 (UML gdb) symbol-file
@@ -2809,7 +2722,7 @@ · 1 unmodified line
2809 2722
2810 2723
2811 2724
2812 Then reload the symbols from the kernel binary:2725 Then reload the symbols from the kernel binary::
2813 2726
2814 2727
2815 (UML gdb) symbol-file /path/to/kernel2728 (UML gdb) symbol-file /path/to/kernel
@@ -2823,17 +2736,19 @@ · 7 unmodified lines
2823 2736
2824 2737
2825 2738
2826 11.5. Attaching gdb to the kernel273911.5. Attaching gdb to the kernel
2740----------------------------------
2827 2741
2828 If you don't have the kernel running under gdb, you can attach gdb to2742 If you don't have the kernel running under gdb, you can attach gdb to
2829 it later by sending the tracing thread a SIGUSR1. The first line of2743 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
2831 tracing thread pid = 200932746 tracing thread pid = 20093
2832 2747
2833 2748
2834 2749
2835 2750
2836 When you send it the signal:2751 When you send it the signal::
2837 2752
2838 2753
2839 host% kill -USR1 200932754 host% kill -USR1 20093
@@ -2845,7 +2760,7 @@ · 5 unmodified lines
2845 2760
2846 2761
2847 If you have the mconsole compiled into UML, then the mconsole client2762 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::
2849 2764
2850 2765
2851 (mconsole) (mconsole) config gdb=xterm2766 (mconsole) (mconsole) config gdb=xterm
@@ -2857,7 +2772,8 @@ · 5 unmodified lines
2857 2772
2858 2773
2859 2774
2860 11.6. Using alternate debuggers277511.6. Using alternate debuggers
2776--------------------------------
2861 2777
2862 UML has support for attaching to an already running debugger rather2778 UML has support for attaching to an already running debugger rather
2863 than starting gdb itself. This is present in CVS as of 17 Apr 2001.2779 than starting gdb itself. This is present in CVS as of 17 Apr 2001.
@@ -2886,7 +2802,7 @@ · 22 unmodified lines
2886 An example of an alternate debugger is strace. You can strace the2802 An example of an alternate debugger is strace. You can strace the
2887 actual kernel as follows:2803 actual kernel as follows:
2888 2804
2889 o Run the following in a shell2805 - Run the following in a shell::
2890 2806
2891 2807
2892 host%2808 host%
@@ -2894,13 +2810,13 @@ · 1 unmodified line
2894 2810
2895 2811
2896 2812
2897 o Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out2813 - Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out
2898 by the previous command2814 by the previous command
2899 2815
2900 o Hit return in the shell, and UML will start running, and strace2816 - Hit return in the shell, and UML will start running, and strace
2901 output will start accumulating in the output file.2817 output will start accumulating in the output file.
2902 2818
2903 Note that this is different from running2819 Note that this is different from running::
2904 2820
2905 2821
2906 host% strace ./linux2822 host% strace ./linux
@@ -2917,95 +2833,57 @@ · 10 unmodified lines
2917 2833
2918 2834
2919 2835
2920 12. Kernel debugging examples283612. Kernel debugging examples
2837==============================
2921 2838
2922 12.1. The case of the hung fsck283912.1. The case of the hung fsck
2840--------------------------------
2923 2841
2924 When booting up the kernel, fsck failed, and dropped me into a shell2842 When booting up the kernel, fsck failed, and dropped me into a shell
2925 to fix things up. I ran fsck -y, which hung:2843 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
2951 2844
2952 2845
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.
2953 2850
2851 /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
2852 (i.e., without -a or -p options)
2853 [ FAILED ]
2954 2854
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):
2955 2860
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
2956 2868
2869 Inode 19780, i_blocks is 1548, should be 540. Fix? yes
2957 2870
2871 Pass 2: Checking directory structure
2872 Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes
2958 2873
2874 Directory inode 11858, block 0, offset 0: directory corrupted
2875 Salvage? yes
2959 2876
2877 Missing '.' in directory inode 11858.
2878 Fix? yes
2960 2879
2961 2880 Missing '..' in directory inode 11858.
2962 2881 Fix? yes
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
3002 2882
3003 2883
3004 The standard drill in this sort of situation is to fire up gdb on the2884 The standard drill in this sort of situation is to fire up gdb on the
3005 signal thread, which, in this case, was pid 1935. In another window,2885 signal thread, which, in this case, was pid 1935. In another window,
3006 I run gdb and attach pid 1935.2886 I run gdb and attach pid 1935::
3007
3008
3009 2887
3010 2888
3011 ~/linux/2.3.26/um 1016: gdb linux2889 ~/linux/2.3.26/um 1016: gdb linux
@@ -3022,11 +2900,7 @@ · 10 unmodified lines
3022 0x100756d9 in __wait4 ()2900 0x100756d9 in __wait4 ()
3023 2901
3024 2902
3025 2903 Let's see what's currently running::
3026
3027
3028
3029 Let's see what's currently running:
3030 2904
3031 2905
3032 2906
@@ -3041,7 +2915,7 @@ · 8 unmodified lines
3041 reason and never woke up.2915 reason and never woke up.
3042 2916
3043 2917
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::
3045 2919
3046 2920
3047 2921
@@ -3052,7 +2926,7 @@ · 4 unmodified lines
3052 2926
3053 2927
3054 2928
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::
3056 2930
3057 2931
3058 2932
@@ -3068,8 +2942,6 @@ · 9 unmodified lines
3068 2942
3069 2943
3070 2944
3071
3072
3073 The interesting things here are the fact that its .thread.syscall.id2945 The interesting things here are the fact that its .thread.syscall.id
3074 is __NR_write (see the big switch in arch/um/kernel/syscall_kern.c or2946 is __NR_write (see the big switch in arch/um/kernel/syscall_kern.c or
3075 the defines in include/asm-um/arch/unistd.h), and that it never2947 the defines in include/asm-um/arch/unistd.h), and that it never
@@ -3081,30 +2953,20 @@ · 5 unmodified lines
3081 The fact that it never returned from write means that its stack should2953 The fact that it never returned from write means that its stack should
3082 be fairly interesting. Its pid is 1980 (.thread.extern_pid). That2954 be fairly interesting. Its pid is 1980 (.thread.extern_pid). That
3083 process is being ptraced by the signal thread, so it must be detached2955 process is being ptraced by the signal thread, so it must be detached
3084 before gdb can attach it:2956 before gdb can attach it::
3085
3086
3087
3088
3089
3090
3091 2957
3092 2958
3093 2959
2960 (gdb) call detach(1980)
3094 2961
3095 (gdb) call detach(1980)2962 Program received signal SIGSEGV, Segmentation fault.
3096 2963 <function called from gdb>
3097 Program received signal SIGSEGV, Segmentation fault.2964 The program being debugged stopped while in a function called from GDB.
3098 <function called from gdb>2965 When the function (detach) is done executing, GDB will silently
3099 The program being debugged stopped while in a function called from GDB.2966 stop (instead of continuing to evaluate the expression containing
3100 When the function (detach) is done executing, GDB will silently2967 the function call).
3101 stop (instead of continuing to evaluate the expression containing2968 (gdb) call detach(1980)
3102 the function call).2969 $15 = 0
3103 (gdb) call detach(1980)
3104 $15 = 0
3105
3106
3107
3108 2970
3109 2971
3110 The first detach segfaults for some reason, and the second one2972 The first detach segfaults for some reason, and the second one
@@ -3112,7 +2974,7 @@ · 1 unmodified line
3112 2974
3113 2975
3114 Now I detach from the signal thread, attach to the fsck thread, and2976 Now I detach from the signal thread, attach to the fsck thread, and
3115 look at its stack:2977 look at its stack::
3116 2978
3117 2979
3118 (gdb) det2980 (gdb) det
@@ -3152,14 +3014,14 @@ · 33 unmodified lines
3152 3014
3153 3015
3154 3016
3155 The interesting things here are :3017 The interesting things here are:
3156 3018
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)
3158 3020
3159 o The first faulting address (frame 11) is 0x500008003021 - The first faulting address (frame 11) is 0x50000800::
3160 3022
3161 (gdb) p (void *)13421793283023 (gdb) p (void *)1342179328
3162 $16 = (void *) 0x500008003024 $16 = (void *) 0x50000800
3163 3025
3164 3026
3165 3027
@@ -3175,7 +3037,7 @@ · 9 unmodified lines
3175 3037
3176 However, the more immediate problem is that second segfault and I'm3038 However, the more immediate problem is that second segfault and I'm
3177 going to concentrate on that. First, I want to see where the fault3039 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::
3179 3041
3180 3042
3181 3043
@@ -3211,7 +3073,7 @@ · 29 unmodified lines
3211 3073
3212 3074
3213 3075
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::
3215 3077
3216 3078
3217 (gdb) p *((struct sigcontext *) (&sig + 1))3079 (gdb) p *((struct sigcontext *) (&sig + 1))
@@ -3224,7 +3086,7 @@ · 6 unmodified lines
3224 3086
3225 3087
3226 3088
3227 The ip is in handle_mm_fault:3089 The ip is in handle_mm_fault::
3228 3090
3229 3091
3230 (gdb) p (void *)2684809453092 (gdb) p (void *)268480945
@@ -3236,7 +3098,7 @@ · 5 unmodified lines
3236 3098
3237 3099
3238 3100
3239 Specifically, it's in pte_alloc:3101 Specifically, it's in pte_alloc::
3240 3102
3241 3103
3242 (gdb) i line *$203104 (gdb) i line *$20
@@ -3249,7 +3111,7 @@ · 6 unmodified lines
3249 3111
3250 3112
3251 To find where in handle_mm_fault this is, I'll jump forward in the3113 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::
3253 3115
3254 3116
3255 3117
@@ -3286,21 +3148,21 @@ · 30 unmodified lines
3286 3148
3287 3149
3288 Something is apparently wrong with the page tables or vma_structs, so3150 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::
3290 3152
3291 3153
3292 3154
3293 #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:503155 #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:50
3294 50 handle_mm_fault(current, vma, address, is_write);3156 50 handle_mm_fault(current, vma, address, is_write);
3295 (gdb) call pgd_offset_proc(vma->vm_mm, address)3157 (gdb) call pgd_offset_proc(vma->vm_mm, address)
3296 $22 = (pgd_t *) 0x80a548c3158 $22 = (pgd_t *) 0x80a548c
3297 3159
3298 3160
3299 3161
3300 3162
3301 3163
3302 That's pretty bogus. Page tables aren't supposed to be in process3164 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::
3304 3166
3305 3167
3306 (gdb) p *vma3168 (gdb) p *vma
@@ -3325,12 +3187,9 @@ · 18 unmodified lines
3325 3187
3326 3188
3327 3189
3328
3329
3330 This also pretty bogus. With all of the 0x80xxxxx and 0xaffffxxx3190 This also pretty bogus. With all of the 0x80xxxxx and 0xaffffxxx
3331 addresses, this is looking like a stack was plonked down on top of3191 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:3192 these structures. Maybe it's a stack overflow from the next page::
3333
3334 3193
3335 3194
3336 (gdb) p vma3195 (gdb) p vma
@@ -3338,52 +3197,36 @@ · 1 unmodified line
3338 3197
3339 3198
3340 3199
3341
3342
3343 That's towards the lower quarter of the page, so that would have to3200 That's towards the lower quarter of the page, so that would have to
3344 have been pretty heavy stack overflow:3201 have been pretty heavy stack overflow::
3345 3202
3346 3203
3347 3204 (gdb) x/100x $25
3348 3205 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c
3349 3206 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000
3350 3207 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a
3351 3208 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000
3352 3209 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000
3353 3210 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000
3354 3211 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000
3355 3212 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000
3356 3213 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000
3357 3214 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000
3358 3215 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000
3359 (gdb) x/100x $253216 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000
3360 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c3217 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000
3361 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d10003218 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000
3362 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a3219 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000
3363 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x000000003220 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000
3364 0x507d2474: 0x00000000 0x00000000 0x00000000 0x000000003221 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000
3365 0x507d2484: 0x00000000 0x00000000 0x00000000 0x000000003222 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000
3366 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x000000003223 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000
3367 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x000000003224 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000
3368 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x000000003225 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000
3369 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x000000003226 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000
3370 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x000000003227 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000
3371 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x000000003228 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000
3372 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x000000003229 0x507d25b4: 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
3387 3230
3388 3231
3389 3232
@@ -3399,65 +3242,53 @@ · 9 unmodified lines
3399 on will be somewhat clearer.3242 on will be somewhat clearer.
3400 3243
3401 3244
3402 12.2. Episode 2: The case of the hung fsck324512.2. Episode 2: The case of the hung fsck
3246-------------------------------------------
3403 3247
3404 After setting a trap in the SEGV handler for accesses to the signal3248 After setting a trap in the SEGV handler for accesses to the signal
3405 thread's stack, I reran the kernel.3249 thread's stack, I reran the kernel.
3406 3250
3407 3251
3408 fsck hung again, this time by hitting the trap:3252 fsck hung again, this time by hitting the trap::
3409
3410
3411 3253
3412 3254
3413 3255
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.
3414 3260
3261 /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
3262 (i.e., without -a or -p options)
3263 [ FAILED ]
3415 3264
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):
3416 3270
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
3417 3278
3279 Pass 2: Checking directory structure
3280 Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes
3418 3281
3282 Directory inode 11858, block 0, offset 0: directory corrupted
3283 Salvage? yes
3419 3284
3285 Missing '.' in directory inode 11858.
3286 Fix? yes
3420 3287
3288 Missing '..' in directory inode 11858.
3289 Fix? yes
3421 3290
3422 3291 Untested (4127) [100fe44c]: trap_kern.c line 31
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
3461 3292
3462 3293
3463 3294
@@ -3465,7 +3296,7 @@ · 1 unmodified line
3465 3296
3466 I need to get the signal thread to detach from pid 4127 so that I can3297 I need to get the signal thread to detach from pid 4127 so that I can
3467 attach to it with gdb. This is done by sending it a SIGUSR1, which is3298 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::
3469 3300
3470 3301
3471 kill -USR1 41273302 kill -USR1 4127
@@ -3474,31 +3305,20 @@ · 2 unmodified lines
3474 3305
3475 3306
3476 3307
3477 Now I can run gdb on it:3308 Now I can run gdb on it::
3478
3479
3480
3481
3482
3483
3484
3485 3309
3486 3310
3487 3311 ~/linux/2.3.26/um 1034: gdb linux
3488 3312 GNU gdb 4.17.0.11 with Linux support
3489 3313 Copyright 1998 Free Software Foundation, Inc.
3490 3314 GDB is free software, covered by the GNU General Public License, and you are
3491 ~/linux/2.3.26/um 1034: gdb linux3315 welcome to change it and/or distribute copies of it under certain conditions.
3492 GNU gdb 4.17.0.11 with Linux support3316 Type "show copying" to see the conditions.
3493 Copyright 1998 Free Software Foundation, Inc.3317 There is absolutely no warranty for GDB. Type "show warranty" for details.
3494 GDB is free software, covered by the GNU General Public License, and you are3318 This GDB was configured as "i386-redhat-linux"...
3495 welcome to change it and/or distribute copies of it under certain conditions.3319 (gdb) att 4127
3496 Type "show copying" to see the conditions.3320 Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127
3497 There is absolutely no warranty for GDB. Type "show warranty" for details.3321 0x10075891 in __libc_nanosleep ()
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 ()
3502 3322
3503 3323
3504 3324
@@ -3506,7 +3326,7 @@ · 1 unmodified line
3506 3326
3507 The backtrace shows that it was in a write and that the fault address3327 The backtrace shows that it was in a write and that the fault address
3508 (address in frame 3) is 0x50000800, which is right in the middle of3328 (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::
3510 3330
3511 3331
3512 (gdb) bt3332 (gdb) bt
@@ -3540,58 +3360,48 @@ · 27 unmodified lines
3540 3360
3541 3361
3542 3362
3543
3544
3545 Going up the stack to the segv_handler frame and looking at where in3363 Going up the stack to the segv_handler frame and looking at where in
3546 the code the access happened shows that it happened near line 110 of3364 the code the access happened shows that it happened near line 110 of
3547 block_dev.c:3365 block_dev.c::
3548 3366
3549 3367
3550 3368
3551 3369 (gdb) up
3552 3370 #1 0x1007584d in __sleep (seconds=1000000)
3553 3371 at ../sysdeps/unix/sysv/linux/sleep.c:78
3554 3372 ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory.
3555 3373 (gdb)
3556 3374 #2 0x1006ce9a in stop () at user_util.c:191
3557 (gdb) up3375 191 while(1) sleep(1000000);
3558 #1 0x1007584d in __sleep (seconds=1000000)3376 (gdb)
3559 at ../sysdeps/unix/sysv/linux/sleep.c:783377 #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31
3560 ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory.3378 31 KERN_UNTESTED();
3561 (gdb)3379 (gdb)
3562 #2 0x1006ce9a in stop () at user_util.c:1913380 #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174
3563 191 while(1) sleep(1000000);3381 174 segv(sc->cr2, sc->err & 2);
3564 (gdb)3382 (gdb) p *sc
3565 #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:313383 $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43,
3566 31 KERN_UNTESTED();3384 __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484,
3567 (gdb)3385 esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14,
3568 #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:1743386 err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070,
3569 174 segv(sc->cr2, sc->err & 2);3387 esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0,
3570 (gdb) p *sc3388 cr2 = 1342179328}
3571 $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43,3389 (gdb) p (void *)268550834
3572 __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484,3390 $2 = (void *) 0x1001c2b2
3573 esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14,3391 (gdb) i sym $2
3574 err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070,3392 block_write + 1090 in section .text
3575 esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0,3393 (gdb) i line *$2
3576 cr2 = 1342179328}3394 Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h"
3577 (gdb) p (void *)2685508343395 starts at address 0x1001c2a1 <block_write+1073>
3578 $2 = (void *) 0x1001c2b23396 and ends at 0x1001c2bf <block_write+1103>.
3579 (gdb) i sym $23397 (gdb) i line *0x1001c2c0
3580 block_write + 1090 in section .text3398 Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103>
3581 (gdb) i line *$23399 and ends at 0x1001c2e3 <block_write+1139>.
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
3590 3400
3591 3401
3592 3402
3593 Looking at the source shows that the fault happened during a call to3403 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::
3595 3405
3596 3406
3597 107 count -= chars;3407 107 count -= chars;
@@ -3601,10 +3411,8 @@ · 3 unmodified lines
3601 3411
3602 3412
3603 3413
3604
3605
3606 p is the pointer which must contain 0x50000800, since buf contains3414 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::
3608 3416
3609 3417
3610 p = offset + bh->b_data;3418 p = offset + bh->b_data;
@@ -3615,24 +3423,22 @@ · 4 unmodified lines
3615 3423
3616 I need to figure out what bh is, and it just so happens that bh is3424 I need to figure out what bh is, and it just so happens that bh is
3617 passed as an argument to mark_buffer_uptodate and mark_buffer_dirty a3425 passed as an argument to mark_buffer_uptodate and mark_buffer_dirty a
3618 few lines later, so I do a little disassembly:3426 few lines later, so I do a little disassembly::
3619
3620
3621 3427
3622 3428
3623 (gdb) disas 0x1001c2bf 0x1001c2e03429 (gdb) disas 0x1001c2bf 0x1001c2e0
3624 Dump of assembler code from 0x1001c2bf to 0x1001c2d0:3430 Dump of assembler code from 0x1001c2bf to 0x1001c2d0:
3625 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp)3431 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp)
3626 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx3432 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx
3627 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx)3433 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx)
3628 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx)3434 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx)
3629 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx3435 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx
3630 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx3436 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx
3631 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139>3437 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139>
3632 0x1001c2d8 <block_write+1128>: pushl $0x03438 0x1001c2d8 <block_write+1128>: pushl $0x0
3633 0x1001c2da <block_write+1130>: pushl %edx3439 0x1001c2da <block_write+1130>: pushl %edx
3634 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty>3440 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty>
3635 End of assembler dump.3441 End of assembler dump.
3636 3442
3637 3443
3638 3444
@@ -3640,7 +3446,7 @@ · 1 unmodified line
3640 3446
3641 At that point, bh is in %edx (address 0x1001c2da), which is calculated3447 At that point, bh is in %edx (address 0x1001c2da), which is calculated
3642 at 0x1001c2c2 as %ebp + 0xfffffdd4, so I figure exactly what that is,3448 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::
3644 3450
3645 3451
3646 (gdb) p (void *)13426314843452 (gdb) p (void *)1342631484
@@ -3657,7 +3463,7 @@ · 10 unmodified lines
3657 3463
3658 3464
3659 Now, I look at the structure to see what's in it, and particularly,3465 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::
3661 3467
3662 3468
3663 (gdb) p *((struct buffer_head *)0x50100200)3469 (gdb) p *((struct buffer_head *)0x50100200)
@@ -3682,18 +3488,18 @@ · 18 unmodified lines
3682 3488
3683 The b_page field is a pointer to the page_struct representing the3489 The b_page field is a pointer to the page_struct representing the
3684 0x50000000 page. Looking at it shows the kernel's idea of the state3490 0x50000000 page. Looking at it shows the kernel's idea of the state
3685 of that page:3491 of that page::
3686 3492
3687 3493
3688 3494
3689 (gdb) p *$13.b_page3495 (gdb) p *$13.b_page
3690 $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0,3496 $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0,
3691 index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = {3497 index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = {
3692 next = 0x50008460, prev = 0x50019350}, wait = {3498 next = 0x50008460, prev = 0x50019350}, wait = {
3693 lock = <optimized out or zero length>, task_list = {next = 0x50004024,3499 lock = <optimized out or zero length>, task_list = {next = 0x50004024,
3694 prev = 0x50004024}, __magic = 1342193708, __creator = 0},3500 prev = 0x50004024}, __magic = 1342193708, __creator = 0},
3695 pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280,3501 pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280,
3696 zone = 0x100c5160}3502 zone = 0x100c5160}
3697 3503
3698 3504
3699 3505
@@ -3702,7 +3508,7 @@ · 2 unmodified lines
3702 Some sanity-checking: the virtual field shows the "virtual" address of3508 Some sanity-checking: the virtual field shows the "virtual" address of
3703 this page, which in this kernel is the same as its "physical" address,3509 this page, which in this kernel is the same as its "physical" address,
3704 and the page_struct itself should be mem_map[0], since it represents3510 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::
3706 3512
3707 3513
3708 3514
@@ -3719,7 +3525,7 @@ · 10 unmodified lines
3719 3525
3720 3526
3721 Now to check out the page_struct itself. In particular, the flags3527 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::
3723 3529
3724 3530
3725 (gdb) p (void *)1323531 (gdb) p (void *)132
@@ -3739,7 +3545,7 @@ · 13 unmodified lines
3739 3545
3740 3546
3741 In my setup_arch procedure, I have the following code which looks just3547 In my setup_arch procedure, I have the following code which looks just
3742 fine:3548 fine::
3743 3549
3744 3550
3745 3551
@@ -3762,7 +3568,7 @@ · 16 unmodified lines
3762 3568
3763 3569
3764 Stepping into init_bootmem, and looking at bootmem_map before looking3570 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::
3766 3572
3767 3573
3768 3574
@@ -3788,18 +3594,20 @@ · 19 unmodified lines
3788 3594
3789 3595
3790 3596
3791 13. What to do when UML doesn't work359713. What to do when UML doesn't work
3598=====================================
3792 3599
3793 3600
3794 3601
3795 3602
3796 13.1. Strange compilation errors when you build from source360313.1. Strange compilation errors when you build from source
3604------------------------------------------------------------
3797 3605
3798 As of test11, it is necessary to have "ARCH=um" in the environment or3606 As of test11, it is necessary to have "ARCH=um" in the environment or
3799 on the make command line for all steps in building UML, including3607 on the make command line for all steps in building UML, including
3800 clean, distclean, or mrproper, config, menuconfig, or xconfig, dep,3608 clean, distclean, or mrproper, config, menuconfig, or xconfig, dep,
3801 and linux. If you forget for any of them, the i386 build seems to3609 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 with3610 contaminate the UML build. If this happens, start from scratch with::
3803 3611
3804 3612
3805 host%3613 host%
@@ -3811,7 +3619,7 @@ · 5 unmodified lines
3811 and repeat the build process with ARCH=um on all the steps.3619 and repeat the build process with ARCH=um on all the steps.
3812 3620
3813 3621
3814 See ``Compiling the kernel and modules'' for more details.3622 See :ref:`Compiling_the_kernel_and_modules` for more details.
3815 3623
3816 3624
3817 Another cause of strange compilation errors is building UML in3625 Another cause of strange compilation errors is building UML in
@@ -3824,11 +3632,11 @@ · 6 unmodified lines
3824 3632
3825 3633
3826 3634
3827 13.3. A variety of panics and hangs with /tmp on a reiserfs filesys-363513.3. A variety of panics and hangs with /tmp on a reiserfs filesystem
3828 tem3636-----------------------------------------------------------------------
3829 3637
3830 I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27.3638 I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27.
3831 Panics preceded by3639 Panics preceded by::
3832 3640
3833 3641
3834 Detaching pid nnnn3642 Detaching pid nnnn
@@ -3854,17 +3662,19 @@ · 19 unmodified lines
3854 3662
3855 3663
3856 3664
3857 13.5. UML doesn't work when /tmp is an NFS filesystem366513.5. UML doesn't work when /tmp is an NFS filesystem
3666------------------------------------------------------
3858 3667
3859 This seems to be a similar situation with the ReiserFS problem above.3668 This seems to be a similar situation with the ReiserFS problem above.
3860 Some versions of NFS seems not to handle mmap correctly, which UML3669 Some versions of NFS seems not to handle mmap correctly, which UML
3861 depends on. The workaround is have /tmp be a non-NFS directory.3670 depends on. The workaround is have /tmp be a non-NFS directory.
3862 3671
3863 3672
3864 13.6. UML hangs on boot when compiled with gprof support367313.6. UML hangs on boot when compiled with gprof support
3674---------------------------------------------------------
3865 3675
3866 If you build UML with gprof support and, early in the boot, it does3676 If you build UML with gprof support and, early in the boot, it does
3867 this3677 this::
3868 3678
3869 3679
3870 kernel BUG at page_alloc.c:100!3680 kernel BUG at page_alloc.c:100!
@@ -3878,10 +3688,11 @@ · 7 unmodified lines
3878 3688
3879 3689
3880 3690
3881 13.7. syslogd dies with a SIGTERM on startup369113.7. syslogd dies with a SIGTERM on startup
3692---------------------------------------------
3882 3693
3883 The exact boot error depends on the distribution that you're booting,3694 The exact boot error depends on the distribution that you're booting,
3884 but Debian produces this:3695 but Debian produces this::
3885 3696
3886 3697
3887 /etc/rc2.d/S10sysklogd: line 49: 93 Terminated3698 /etc/rc2.d/S10sysklogd: line 49: 93 Terminated
@@ -3891,23 +3702,21 @@ · 3 unmodified lines
3891 3702
3892 3703
3893 This is a syslogd bug. There's a race between a parent process3704 This is a syslogd bug. There's a race between a parent process
3894 installing a signal handler and its child sending the signal. See3705 installing a signal handler and its child sending the signal.
3895 this uml-devel post <http://www.geocrawler.com/lists/3/Source-
3896 Forge/709/0/6612801> for the details.
3897 3706
3898 3707
3899 3708
3900 13.8. TUN/TAP networking doesn't work on a 2.4 host370913.8. TUN/TAP networking doesn't work on a 2.4 host
3710----------------------------------------------------
3901 3711
3902 There are a couple of problems which were3712 There are a couple of problems which were reported by
3903 <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed3713 Tim Robinson <timro at trkr dot net>
3904 out"> by Tim Robinson <timro at trkr dot net>
3905 3714
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.
3907 The fix is to upgrade to something more recent and then read the3716 The fix is to upgrade to something more recent and then read the
3908 next item.3717 next item.
3909 3718
3910 o If you see3719 - If you see::
3911 3720
3912 3721
3913 File descriptor in bad state3722 File descriptor in bad state
@@ -3921,8 +3730,8 @@ · 7 unmodified lines
3921 3730
3922 3731
3923 3732
3924 13.9. You can network to the host but not to other machines on the373313.9. You can network to the host but not to other machines on the net
3925 net3734=======================================================================
3926 3735
3927 If you can connect to the host, and the host can connect to UML, but3736 If you can connect to the host, and the host can connect to UML, but
3928 you cannot connect to any other machines, then you may need to enable3737 you cannot connect to any other machines, then you may need to enable
@@ -3930,7 +3739,7 @@ · 1 unmodified line
3930 using private IP addresses (192.168.x.x or 10.x.x.x) for host/UML3739 using private IP addresses (192.168.x.x or 10.x.x.x) for host/UML
3931 networking, rather than the public address space that your host is3740 networking, rather than the public address space that your host is
3932 connected to. UML does not enable IP Masquerading, so you will need3741 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::
3934 3743
3935 3744
3936 host%3745 host%
@@ -3944,11 +3753,11 @@ · 7 unmodified lines
3944 3753
3945 3754
3946 Documentation on IP Masquerading, and SNAT, can be found at3755 Documentation on IP Masquerading, and SNAT, can be found at
3947 www.netfilter.org <http://www.netfilter.org> .3756 http://www.netfilter.org.
3948 3757
3949 3758
3950 If you can reach the local net, but not the outside Internet, then3759 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::
3952 3761
3953 3762
3954 UML#3763 UML#
@@ -3972,7 +3781,8 @@ · 17 unmodified lines
3972 3781
3973 3782
3974 3783
3975 13.10. I have no root and I want to scream378413.10. I have no root and I want to scream
3785===========================================
3976 3786
3977 Thanks to Birgit Wahlich for telling me about this strange one. It3787 Thanks to Birgit Wahlich for telling me about this strange one. It
3978 turns out that there's a limit of six environment variables on the3788 turns out that there's a limit of six environment variables on the
@@ -3987,14 +3797,16 @@ · 8 unmodified lines
3987 3797
3988 3798
3989 3799
3990 13.11. UML build conflict between ptrace.h and ucontext.h380013.11. UML build conflict between ptrace.h and ucontext.h
3801==========================================================
3991 3802
3992 On some older systems, /usr/include/asm/ptrace.h and3803 On some older systems, /usr/include/asm/ptrace.h and
3993 /usr/include/sys/ucontext.h define the same names. So, when they're3804 /usr/include/sys/ucontext.h define the same names. So, when they're
3994 included together, the defines from one completely mess up the parsing3805 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
3996 /usr/include/sys/ucontext.h:47: parse error before3808 /usr/include/sys/ucontext.h:47: parse error before
3997 `10'3809 `10`
3998 3810
3999 3811
4000 3812
@@ -4007,7 +3819,8 @@ · 6 unmodified lines
4007 3819
4008 3820
4009 3821
4010 13.12. The UML BogoMips is exactly half the host's BogoMips382213.12. The UML BogoMips is exactly half the host's BogoMips
3823------------------------------------------------------------
4011 3824
4012 On i386 kernels, there are two ways of running the loop that is used3825 On i386 kernels, there are two ways of running the loop that is used
4013 to calculate the BogoMips rating, using the TSC if it's there or using3826 to calculate the BogoMips rating, using the TSC if it's there or using
@@ -4019,15 +3832,17 @@ · 5 unmodified lines
4019 3832
4020 3833
4021 3834
4022 13.13. When you run UML, it immediately segfaults383513.13. When you run UML, it immediately segfaults
3836--------------------------------------------------
4023 3837
4024 If the host is configured with the 2G/2G address space split, that's3838 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 to3839 why. See ref:`UML_on_2G/2G_hosts` for the details on getting UML to
4026 run on your host.3840 run on your host.
4027 3841
4028 3842
4029 3843
4030 13.14. xterms appear, then immediately disappear384413.14. xterms appear, then immediately disappear
3845-------------------------------------------------
4031 3846
4032 If you're running an up to date kernel with an old release of3847 If you're running an up to date kernel with an old release of
4033 uml_utilities, the port-helper program will not work properly, so3848 uml_utilities, the port-helper program will not work properly, so
@@ -4039,7 +3854,8 @@ · 5 unmodified lines
4039 3854
4040 3855
4041 3856
4042 13.15. Any other panic, hang, or strange behavior385713.15. Any other panic, hang, or strange behavior
3858--------------------------------------------------
4043 3859
4044 If you're seeing truly strange behavior, such as hangs or panics that3860 If you're seeing truly strange behavior, such as hangs or panics that
4045 happen in random places, or you try running the debugger to see what's3861 happen in random places, or you try running the debugger to see what's
@@ -4057,9 +3873,13 @@ · 11 unmodified lines
4057 it and that a fix is imminent.3873 it and that a fix is imminent.
4058 3874
4059 3875
4060 If you want to be super-helpful, read ``Diagnosing Problems'' and3876 If you want to be super-helpful, read :ref:`Diagnosing_Problems` and
4061 follow the instructions contained therein.3877 follow the instructions contained therein.
4062 14. Diagnosing Problems3878
3879.. _Diagnosing_Problems:
3880
388114. Diagnosing Problems
3882========================
4063 3883
4064 3884
4065 If you get UML to crash, hang, or otherwise misbehave, you should3885 If you get UML to crash, hang, or otherwise misbehave, you should
@@ -4074,21 +3894,22 @@ · 8 unmodified lines
4074 3894
4075 For any diagnosis, you're going to need to build a debugging kernel.3895 For any diagnosis, you're going to need to build a debugging kernel.
4076 The binaries from this site aren't debuggable. If you haven't done3896 The binaries from this site aren't debuggable. If you haven't done
4077 this before, read about ``Compiling the kernel and modules'' and3897 this before, read about :ref:`Compiling_the_kernel_and_modules` and
4078 ``Kernel debugging'' UML first.3898 :ref:`Kernel_debugging` UML first.
4079 3899
4080 3900
4081 14.1. Case 1 : Normal kernel panics390114.1. Case 1 : Normal kernel panics
3902------------------------------------
4082 3903
4083 The most common case is for a normal thread to panic. To debug this,3904 The most common case is for a normal thread to panic. To debug this,
4084 you will need to run it under the debugger (add 'debug' to the command3905 you will need to run it under the debugger (add 'debug' to the command
4085 line). An xterm will start up with gdb running inside it. Continue3906 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 and3907 it when it stops in start_kernel and make it crash. Now ``^C gdb`` and
4087 3908
4088 3909
4089 If the panic was a "Kernel mode fault", then there will be a segv3910 If the panic was a "Kernel mode fault", then there will be a segv
4090 frame on the stack and I'm going to want some more information. The3911 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::
4092 3913
4093 3914
4094 (UML gdb) backtrace3915 (UML gdb) backtrace
@@ -4107,7 +3928,7 @@ · 12 unmodified lines
4107 3928
4108 3929
4109 I'm going to want to see the symbol and line information for the value3930 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::
4111 3932
4112 3933
4113 (UML gdb) i sym 2688491583934 (UML gdb) i sym 268849158
@@ -4115,7 +3936,7 @@ · 1 unmodified line
4115 3936
4116 3937
4117 3938
4118 and3939 and::
4119 3940
4120 3941
4121 (UML gdb) i line *2688491583942 (UML gdb) i line *268849158
@@ -4128,7 +3949,8 @@ · 6 unmodified lines
4128 to get that information from the faulting ip.3949 to get that information from the faulting ip.
4129 3950
4130 3951
4131 14.2. Case 2 : Tracing thread panics395214.2. Case 2 : Tracing thread panics
3953-------------------------------------
4132 3954
4133 The less common and more painful case is when the tracing thread3955 The less common and more painful case is when the tracing thread
4134 panics. In this case, the kernel debugger will be useless because it3956 panics. In this case, the kernel debugger will be useless because it
@@ -4136,7 +3958,7 @@ · 1 unmodified line
4136 do is get a backtrace from the tracing thread. This is done by3958 do is get a backtrace from the tracing thread. This is done by
4137 figuring out what its pid is, firing up gdb, and attaching it to that3959 figuring out what its pid is, firing up gdb, and attaching it to that
4138 pid. You can figure out the tracing thread pid by looking at the3960 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::
4140 3962
4141 3963
4142 tracing thread pid = 158513964 tracing thread pid = 15851
@@ -4145,7 +3967,7 @@ · 2 unmodified lines
4145 3967
4146 3968
4147 or by running ps on the host and finding the line that looks like3969 or by running ps on the host and finding the line that looks like
4148 this:3970 this::
4149 3971
4150 3972
4151 jdike 15851 4.5 0.4 132568 1104 pts/0 S 21:34 0:05 ./linux [(tracing thread)]3973 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
4164 14.3. Case 3 : Tracing thread panics caused by other threads3986 14.3. Case 3 : Tracing thread panics caused by other threads
4165 3987
4166 However, there are cases where the misbehavior of another thread3988 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::
4168 3990
4169 3991
4170 wait_for_stop failed to wait for <pid> to stop with <signal number>3992 wait_for_stop failed to wait for <pid> to stop with <signal number>
@@ -4177,7 +3999,7 @@ · 6 unmodified lines
4177 debugger is defunct and without some fancy footwork, another gdb can't3999 debugger is defunct and without some fancy footwork, another gdb can't
4178 attach to it. So, this is how the fancy footwork goes:4000 attach to it. So, this is how the fancy footwork goes:
4179 4001
4180 In a shell:4002 In a shell::
4181 4003
4182 4004
4183 host% kill -STOP pid4005 host% kill -STOP pid
@@ -4185,7 +4007,7 @@ · 1 unmodified line
4185 4007
4186 4008
4187 4009
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::
4189 4011
4190 4012
4191 (host gdb) call detach(pid)4013 (host gdb) call detach(pid)
@@ -4193,7 +4015,7 @@ · 1 unmodified line
4193 4015
4194 If you get a segfault, do it again. It always works the second time.4016 If you get a segfault, do it again. It always works the second time.
4195 4017
4196 Detach from the tracing thread and attach to that other thread:4018 Detach from the tracing thread and attach to that other thread::
4197 4019
4198 4020
4199 (host gdb) detach4021 (host gdb) detach
@@ -4209,7 +4031,7 @@ · 9 unmodified lines
4209 4031
4210 4032
4211 If gdb hangs when attaching to that process, go back to a shell and4033 If gdb hangs when attaching to that process, go back to a shell and
4212 do:4034 do::
4213 4035
4214 4036
4215 host%4037 host%
@@ -4218,7 +4040,7 @@ · 2 unmodified lines
4218 4040
4219 4041
4220 4042
4221 And then get the backtrace:4043 And then get the backtrace::
4222 4044
4223 4045
4224 (host gdb) backtrace4046 (host gdb) backtrace
@@ -4227,13 +4049,14 @@ · 2 unmodified lines
4227 4049
4228 4050
4229 4051
4230 14.4. Case 4 : Hangs405214.4. Case 4 : Hangs
4053---------------------
4231 4054
4232 Hangs seem to be fairly rare, but they sometimes happen. When a hang4055 Hangs seem to be fairly rare, but they sometimes happen. When a hang
4233 happens, we need a backtrace from the offending process. Run the4056 happens, we need a backtrace from the offending process. Run the
4234 kernel debugger as described in case 1 and get a backtrace. If the4057 kernel debugger as described in case 1 and get a backtrace. If the
4235 current process is not the idle thread, then send in the backtrace.4058 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::
4237 4060
4238 4061
4239 #0 0x100b1401 in __libc_nanosleep ()4062 #0 0x100b1401 in __libc_nanosleep ()
@@ -4257,7 +4080,8 @@ · 17 unmodified lines
4257 4080
4258 4081
4259 4082
4260 15. Thanks408315. Thanks
4084===========
4261 4085
4262 4086
4263 A number of people have helped this project in various ways, and this4087 A number of people have helped this project in various ways, and this
@@ -4274,20 +4098,21 @@ · 10 unmodified lines
4274 bookkeeping lapses and I forget about contributions.4098 bookkeeping lapses and I forget about contributions.
4275 4099
4276 4100
4277 15.1. Code and Documentation410115.1. Code and Documentation
4102-----------------------------
4278 4103
4279 Rusty Russell <rusty at linuxcare.com.au> -4104 Rusty Russell <rusty at linuxcare.com.au> -
4280 4105
4281 o wrote the HOWTO <http://user-mode-4106 - wrote the HOWTO
4282 linux.sourceforge.net/UserModeLinux-HOWTO.html>4107 http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO.html
4283 4108
4284 o prodded me into making this project official and putting it on4109 - prodded me into making this project official and putting it on
4285 SourceForge4110 SourceForge
4286 4111
4287 o came up with the way cool UML logo <http://user-mode-4112 - came up with the way cool UML logo
4288 linux.sourceforge.net/uml-small.png>4113 http://user-mode-linux.sourceforge.net/uml-small.png
4289 4114
4290 o redid the config process4115 - redid the config process
4291 4116
4292 4117
4293 Peter Moulder <reiter at netspace.net.au> - Fixed my config and build4118 Peter Moulder <reiter at netspace.net.au> - Fixed my config and build
@@ -4296,34 +4121,32 @@ · 2 unmodified lines
4296 4121
4297 Bill Stearns <wstearns at pobox.com> -4122 Bill Stearns <wstearns at pobox.com> -
4298 4123
4299 o HOWTO updates4124 - HOWTO updates
4300 4125
4301 o lots of bug reports4126 - lots of bug reports
4302 4127
4303 o lots of testing4128 - lots of testing
4304 4129
4305 o dedicated a box (uml.ists.dartmouth.edu) to support UML development4130 - dedicated a box (uml.ists.dartmouth.edu) to support UML development
4306 4131
4307 o wrote the mkrootfs script, which allows bootable filesystems of4132 - wrote the mkrootfs script, which allows bootable filesystems of
4308 RPM-based distributions to be cranked out4133 RPM-based distributions to be cranked out
4309 4134
4310 o cranked out a large number of filesystems with said script4135 - cranked out a large number of filesystems with said script
4311 4136
4312 4137
4313 Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver4138 Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver
4314 and associated usermode tools4139 and associated usermode tools
4315 4140
4316 Lars Brinkhoff <http://lars.nocrew.org/> - Contributed the ptrace4141 Lars Brinkhoff http://lars.nocrew.org/ - Contributed the ptrace
4317 proxy from his own project <http://a386.nocrew.org/> to allow easier4142 proxy from his own project to allow easier kernel debugging
4318 kernel debugging
4319 4143
4320 4144
4321 Andrea Arcangeli <andrea at suse.de> - Redid some of the early boot4145 Andrea Arcangeli <andrea at suse.de> - Redid some of the early boot
4322 code so that it would work on machines with Large File Support4146 code so that it would work on machines with Large File Support
4323 4147
4324 4148
4325 Chris Emerson <http://www.chiark.greenend.org.uk/~cemerson/> - Did4149 Chris Emerson - Did the first UML port to Linux/ppc
4326 the first UML port to Linux/ppc
4327 4150
4328 4151
4329 Harald Welte <laforge at gnumonks.org> - Wrote the multicast4152 Harald Welte <laforge at gnumonks.org> - Wrote the multicast
@@ -4338,7 +4161,7 @@ · 8 unmodified lines
4338 wrote the iomem emulation support4161 wrote the iomem emulation support
4339 4162
4340 4163
4341 Henrik Nordstrom <http://hem.passagen.se/hno/> - Provided a variety4164 Henrik Nordstrom http://hem.passagen.se/hno/ - Provided a variety
4342 of patches, fixes, and clues4165 of patches, fixes, and clues
4343 4166
4344 4167
@@ -4373,190 +4196,193 @@ · 28 unmodified lines
4373 submitted patches for the slip transport and lots of other things.4196 submitted patches for the slip transport and lots of other things.
4374 4197
4375 4198
4376 David Coulson <http://davidcoulson.net> -4199 David Coulson http://davidcoulson.net -
4377 4200
4378 o Set up the usermodelinux.org <http://usermodelinux.org> site,4201 - Set up the http://usermodelinux.org site,
4379 which is a great way of keeping the UML user community on top of4202 which is a great way of keeping the UML user community on top of
4380 UML goings-on.4203 UML goings-on.
4381 4204
4382 o Site documentation and updates4205 - Site documentation and updates
4383 4206
4384 o Nifty little UML management daemon UMLd4207 - Nifty little UML management daemon UMLd
4385 <http://uml.openconsultancy.com/umld/>
4386 4208
4387 o Lots of testing and bug reports4209 - Lots of testing and bug reports
4388 4210
4389 4211
4390 4212
4391 4213
4392 15.2. Flushing out bugs421415.2. Flushing out bugs
4215------------------------
4393 4216
4394 4217
4395 4218
4396 o Yuri Pudgorodsky4219 - Yuri Pudgorodsky
4397 4220
4398 o Gerald Britton4221 - Gerald Britton
4399 4222
4400 o Ian Wehrman4223 - Ian Wehrman
4401 4224
4402 o Gord Lamb4225 - Gord Lamb
4403 4226
4404 o Eugene Koontz4227 - Eugene Koontz
4405 4228
4406 o John H. Hartman4229 - John H. Hartman
4407 4230
4408 o Anders Karlsson4231 - Anders Karlsson
4409 4232
4410 o Daniel Phillips4233 - Daniel Phillips
4411 4234
4412 o John Fremlin4235 - John Fremlin
4413 4236
4414 o Rainer Burgstaller4237 - Rainer Burgstaller
4415 4238
4416 o James Stevenson4239 - James Stevenson
4417 4240
4418 o Matt Clay4241 - Matt Clay
4419 4242
4420 o Cliff Jefferies4243 - Cliff Jefferies
4421 4244
4422 o Geoff Hoff4245 - Geoff Hoff
4423 4246
4424 o Lennert Buytenhek4247 - Lennert Buytenhek
4425 4248
4426 o Al Viro4249 - Al Viro
4427 4250
4428 o Frank Klingenhoefer4251 - Frank Klingenhoefer
4429 4252
4430 o Livio Baldini Soares4253 - Livio Baldini Soares
4431 4254
4432 o Jon Burgess4255 - Jon Burgess
4433 4256
4434 o Petru Paler4257 - Petru Paler
4435 4258
4436 o Paul4259 - Paul
4437 4260
4438 o Chris Reahard4261 - Chris Reahard
4439 4262
4440 o Sverker Nilsson4263 - Sverker Nilsson
4441 4264
4442 o Gong Su4265 - Gong Su
4443 4266
4444 o johan verrept4267 - johan verrept
4445 4268
4446 o Bjorn Eriksson4269 - Bjorn Eriksson
4447 4270
4448 o Lorenzo Allegrucci4271 - Lorenzo Allegrucci
4449 4272
4450 o Muli Ben-Yehuda4273 - Muli Ben-Yehuda
4451 4274
4452 o David Mansfield4275 - David Mansfield
4453 4276
4454 o Howard Goff4277 - Howard Goff
4455 4278
4456 o Mike Anderson4279 - Mike Anderson
4457 4280
4458 o John Byrne4281 - John Byrne
4459 4282
4460 o Sapan J. Batia4283 - Sapan J. Batia
4461 4284
4462 o Iris Huang4285 - Iris Huang
4463 4286
4464 o Jan Hudec4287 - Jan Hudec
4465 4288
4466 o Voluspa4289 - Voluspa
4467 4290
4468 4291
4469 4292
4470 4293
4471 15.3. Buglets and clean-ups429415.3. Buglets and clean-ups
4295----------------------------
4472 4296
4473 4297
4474 4298
4475 o Dave Zarzycki4299 - Dave Zarzycki
4476 4300
4477 o Adam Lazur4301 - Adam Lazur
4478 4302
4479 o Boria Feigin4303 - Boria Feigin
4480 4304
4481 o Brian J. Murrell4305 - Brian J. Murrell
4482 4306
4483 o JS4307 - JS
4484 4308
4485 o Roman Zippel4309 - Roman Zippel
4486 4310
4487 o Wil Cooley4311 - Wil Cooley
4488 4312
4489 o Ayelet Shemesh4313 - Ayelet Shemesh
4490 4314
4491 o Will Dyson4315 - Will Dyson
4492 4316
4493 o Sverker Nilsson4317 - Sverker Nilsson
4494 4318
4495 o dvorak4319 - dvorak
4496 4320
4497 o v.naga srinivas4321 - v.naga srinivas
4498 4322
4499 o Shlomi Fish4323 - Shlomi Fish
4500 4324
4501 o Roger Binns4325 - Roger Binns
4502 4326
4503 o johan verrept4327 - johan verrept
4504 4328
4505 o MrChuoi4329 - MrChuoi
4506 4330
4507 o Peter Cleve4331 - Peter Cleve
4508 4332
4509 o Vincent Guffens4333 - Vincent Guffens
4510 4334
4511 o Nathan Scott4335 - Nathan Scott
4512 4336
4513 o Patrick Caulfield4337 - Patrick Caulfield
4514 4338
4515 o jbearce4339 - jbearce
4516 4340
4517 o Catalin Marinas4341 - Catalin Marinas
4518 4342
4519 o Shane Spencer4343 - Shane Spencer
4520 4344
4521 o Zou Min4345 - Zou Min
4522 4346
4523 4347
4524 o Ryan Boder4348 - Ryan Boder
4525 4349
4526 o Lorenzo Colitti4350 - Lorenzo Colitti
4527 4351
4528 o Gwendal Grignou4352 - Gwendal Grignou
4529 4353
4530 o Andre' Breiler4354 - Andre' Breiler
4531 4355
4532 o Tsutomu Yasuda4356 - Tsutomu Yasuda
4533 4357
4534 4358
4535 4359
4536 15.4. Case Studies436015.4. Case Studies
4361-------------------
4537 4362
4538 4363
4539 o Jon Wright4364 - Jon Wright
4540 4365
4541 o William McEwan4366 - William McEwan
4542 4367
4543 o Michael Richardson4368 - Michael Richardson
4544 4369
4545 4370
4546 4371
4547 15.5. Other contributions437215.5. Other contributions
4373--------------------------
4548 4374
4549 4375
4550 Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script4376 Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script
4551 work with RH 6.2.4377 work with RH 6.2.
4552 4378
4553 Michael Jennings <mikejen at hevanet.com> sent in some material which4379 Michael Jennings <mikejen at hevanet.com> sent in some material which
4554 is now gracing the top of the index page <http://user-mode-4380 is now gracing the top of the index page
4555 linux.sourceforge.net/> of this site.4381 http://user-mode-linux.sourceforge.net/ of this site.
4556 4382
4557 SGI <http://www.sgi.com> (and more specifically Ralf Baechle <ralf at4383 SGI (and more specifically Ralf Baechle <ralf at
4558 uni-koblenz.de> ) gave me an account on oss.sgi.com4384 uni-koblenz.de> ) gave me an account on oss.sgi.com.
4559 <http://www.oss.sgi.com> . The bandwidth there made it possible to4385 The bandwidth there made it possible to
4560 produce most of the filesystems available on the project download4386 produce most of the filesystems available on the project download
4561 page.4387 page.
4562 4388
@@ -4573,17 +4399,5 @@ · 10 unmodified lines
4573 4399
4574 Chris Reahard built a specialized root filesystem for running a DNS4400 Chris Reahard built a specialized root filesystem for running a DNS
4575 server jailed inside UML. It's available from the download4401 server jailed inside UML. It's available from the download
4576 <http://user-mode-linux.sourceforge.net/dl-sf.html> page in the Jail4402 http://user-mode-linux.sourceforge.net/old/dl-sf.html page in the Jail
4577 Filesystems section.4403 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
19 tlb19 tlb
20 mtrr20 mtrr
21 pat21 pat
22 intel_mpx
23 intel-iommu22 intel-iommu
24 intel_txt23 intel_txt
25 amd-memory-encryption24 amd-memory-encryption
MAINTAINERS+46−47
@@ -2796,11 +2796,11 @@ F: drivers/block/aoe/ · 2795 unmodified lines
2796 2796
2797ATHEROS 71XX/9XXX GPIO DRIVER2797ATHEROS 71XX/9XXX GPIO DRIVER
2798M: Alban Bedel <albeu@free.fr>2798M: Alban Bedel <albeu@free.fr>
2799S: Maintained
2799W: https://github.com/AlbanBedel/linux2800W: https://github.com/AlbanBedel/linux
2800T: git git://github.com/AlbanBedel/linux2801T: git git://github.com/AlbanBedel/linux
2801S: Maintained
2802F: drivers/gpio/gpio-ath79.c
2803F: Documentation/devicetree/bindings/gpio/gpio-ath79.txt2802F: Documentation/devicetree/bindings/gpio/gpio-ath79.txt
2803F: drivers/gpio/gpio-ath79.c
2804 2804
2805ATHEROS 71XX/9XXX USB PHY DRIVER2805ATHEROS 71XX/9XXX USB PHY DRIVER
2806M: Alban Bedel <albeu@free.fr>2806M: Alban Bedel <albeu@free.fr>
@@ -3422,8 +3422,8 @@ BROADCOM BRCMSTB GPIO DRIVER · 615 unmodified lines
3422M: Gregory Fong <gregory.0xf0@gmail.com>3422M: Gregory Fong <gregory.0xf0@gmail.com>
3423L: bcm-kernel-feedback-list@broadcom.com3423L: bcm-kernel-feedback-list@broadcom.com
3424S: Supported3424S: Supported
3425F: drivers/gpio/gpio-brcmstb.c
3426F: Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt3425F: Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
3426F: drivers/gpio/gpio-brcmstb.c
3427 3427
3428BROADCOM BRCMSTB I2C DRIVER3428BROADCOM BRCMSTB I2C DRIVER
3429M: Kamal Dasu <kdasu.kdev@gmail.com>3429M: Kamal Dasu <kdasu.kdev@gmail.com>
@@ -3481,8 +3481,8 @@ BROADCOM KONA GPIO DRIVER · 51 unmodified lines
3481M: Ray Jui <rjui@broadcom.com>3481M: Ray Jui <rjui@broadcom.com>
3482L: bcm-kernel-feedback-list@broadcom.com3482L: bcm-kernel-feedback-list@broadcom.com
3483S: Supported3483S: Supported
3484F: drivers/gpio/gpio-bcm-kona.c
3485F: Documentation/devicetree/bindings/gpio/brcm,kona-gpio.txt3484F: Documentation/devicetree/bindings/gpio/brcm,kona-gpio.txt
3485F: drivers/gpio/gpio-bcm-kona.c
3486 3486
3487BROADCOM NETXTREME-E ROCE DRIVER3487BROADCOM NETXTREME-E ROCE DRIVER
3488M: Selvin Xavier <selvin.xavier@broadcom.com>3488M: Selvin Xavier <selvin.xavier@broadcom.com>
@@ -3597,8 +3597,8 @@ F: sound/pci/bt87x.c · 108 unmodified lines
3597 3597
3598BT8XXGPIO DRIVER3598BT8XXGPIO DRIVER
3599M: Michael Buesch <m@bues.ch>3599M: Michael Buesch <m@bues.ch>
3600W: http://bu3sch.de/btgpio.php
3601S: Maintained3600S: Maintained
3601W: http://bu3sch.de/btgpio.php
3602F: drivers/gpio/gpio-bt8xx.c3602F: drivers/gpio/gpio-bt8xx.c
3603 3603
3604BTRFS FILE SYSTEM3604BTRFS FILE SYSTEM
@@ -3649,6 +3649,7 @@ F: sound/pci/oxygen/ · 44 unmodified lines
3649 3649
3650C-SKY ARCHITECTURE3650C-SKY ARCHITECTURE
3651M: Guo Ren <guoren@kernel.org>3651M: Guo Ren <guoren@kernel.org>
3652L: linux-csky@vger.kernel.org
3652T: git https://github.com/c-sky/csky-linux.git3653T: git https://github.com/c-sky/csky-linux.git
3653S: Supported3654S: Supported
3654F: arch/csky/3655F: arch/csky/
@@ -3909,7 +3910,7 @@ S: Supported · 254 unmodified lines
3909F: Documentation/filesystems/ceph.txt3910F: Documentation/filesystems/ceph.txt
3910F: fs/ceph/3911F: fs/ceph/
3911 3912
3912CERTIFICATE HANDLING:3913CERTIFICATE HANDLING
3913M: David Howells <dhowells@redhat.com>3914M: David Howells <dhowells@redhat.com>
3914M: David Woodhouse <dwmw2@infradead.org>3915M: David Woodhouse <dwmw2@infradead.org>
3915L: keyrings@vger.kernel.org3916L: keyrings@vger.kernel.org
@@ -3919,7 +3920,7 @@ F: certs/ · 3 unmodified lines
3919F: scripts/sign-file.c3920F: scripts/sign-file.c
3920F: scripts/extract-cert.c3921F: scripts/extract-cert.c
3921 3922
3922CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:3923CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM
3923L: devel@driverdev.osuosl.org3924L: devel@driverdev.osuosl.org
3924S: Obsolete3925S: Obsolete
3925F: drivers/staging/wusbcore/3926F: drivers/staging/wusbcore/
@@ -5932,12 +5933,12 @@ S: Maintained · 2006 unmodified lines
5932F: drivers/media/dvb-frontends/ec100*5933F: drivers/media/dvb-frontends/ec100*
5933 5934
5934ECRYPT FILE SYSTEM5935ECRYPT FILE SYSTEM
5935M: Tyler Hicks <tyhicks@canonical.com>5936M: Tyler Hicks <code@tyhicks.com>
5936L: ecryptfs@vger.kernel.org5937L: ecryptfs@vger.kernel.org
5937W: http://ecryptfs.org5938W: http://ecryptfs.org
5938W: https://launchpad.net/ecryptfs5939W: https://launchpad.net/ecryptfs
5939T: git git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git5940T: git git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git
5940S: Supported5941S: Odd Fixes
5941F: Documentation/filesystems/ecryptfs.txt5942F: Documentation/filesystems/ecryptfs.txt
5942F: fs/ecryptfs/5943F: fs/ecryptfs/
5943 5944
@@ -7047,7 +7048,7 @@ L: kvm@vger.kernel.org · 1103 unmodified lines
7047S: Supported7048S: Supported
7048F: drivers/uio/uio_pci_generic.c7049F: drivers/uio/uio_pci_generic.c
7049 7050
7050GENERIC VDSO LIBRARY:7051GENERIC VDSO LIBRARY
7051M: Andy Lutomirski <luto@kernel.org>7052M: Andy Lutomirski <luto@kernel.org>
7052M: Thomas Gleixner <tglx@linutronix.de>7053M: Thomas Gleixner <tglx@linutronix.de>
7053M: Vincenzo Frascino <vincenzo.frascino@arm.com>7054M: Vincenzo Frascino <vincenzo.frascino@arm.com>
@@ -7143,18 +7144,18 @@ GPIO SUBSYSTEM · 89 unmodified lines
7143M: Linus Walleij <linus.walleij@linaro.org>7144M: Linus Walleij <linus.walleij@linaro.org>
7144M: Bartosz Golaszewski <bgolaszewski@baylibre.com>7145M: Bartosz Golaszewski <bgolaszewski@baylibre.com>
7145L: linux-gpio@vger.kernel.org7146L: linux-gpio@vger.kernel.org
7146T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
7147S: Maintained7147S: Maintained
7148T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
7149F: Documentation/ABI/obsolete/sysfs-gpio
7150F: Documentation/ABI/testing/gpio-cdev
7151F: Documentation/admin-guide/gpio/
7148F: Documentation/devicetree/bindings/gpio/7152F: Documentation/devicetree/bindings/gpio/
7149F: Documentation/driver-api/gpio/7153F: Documentation/driver-api/gpio/
7150F: Documentation/admin-guide/gpio/
7151F: Documentation/ABI/testing/gpio-cdev
7152F: Documentation/ABI/obsolete/sysfs-gpio
7153F: drivers/gpio/7154F: drivers/gpio/
7155F: include/asm-generic/gpio.h
7154F: include/linux/gpio/7156F: include/linux/gpio/
7155F: include/linux/gpio.h7157F: include/linux/gpio.h
7156F: include/linux/of_gpio.h7158F: include/linux/of_gpio.h
7157F: include/asm-generic/gpio.h
7158F: include/uapi/linux/gpio.h7159F: include/uapi/linux/gpio.h
7159F: tools/gpio/7160F: tools/gpio/
7160 7161
@@ -8055,8 +8056,8 @@ F: drivers/scsi/ips.* · 894 unmodified lines
8055ICH LPC AND GPIO DRIVER8056ICH LPC AND GPIO DRIVER
8056M: Peter Tyser <ptyser@xes-inc.com>8057M: Peter Tyser <ptyser@xes-inc.com>
8057S: Maintained8058S: Maintained
8058F: drivers/mfd/lpc_ich.c
8059F: drivers/gpio/gpio-ich.c8059F: drivers/gpio/gpio-ich.c
8060F: drivers/mfd/lpc_ich.c
8060 8061
8061ICY I2C DRIVER8062ICY I2C DRIVER
8062M: Max Staudt <max@enpas.org>8063M: Max Staudt <max@enpas.org>
@@ -8392,7 +8393,7 @@ M: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> · 329 unmodified lines
8392M: Rodrigo Vivi <rodrigo.vivi@intel.com>8393M: Rodrigo Vivi <rodrigo.vivi@intel.com>
8393L: intel-gfx@lists.freedesktop.org8394L: intel-gfx@lists.freedesktop.org
8394W: https://01.org/linuxgraphics/8395W: https://01.org/linuxgraphics/
8395B: https://01.org/linuxgraphics/documentation/how-report-bugs8396B: https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs
8396C: irc://chat.freenode.net/intel-gfx8397C: irc://chat.freenode.net/intel-gfx
8397Q: http://patchwork.freedesktop.org/project/intel-gfx/8398Q: http://patchwork.freedesktop.org/project/intel-gfx/
8398T: git git://anongit.freedesktop.org/drm-intel8399T: git git://anongit.freedesktop.org/drm-intel
@@ -9278,7 +9279,7 @@ F: include/keys/trusted-type.h · 879 unmodified lines
9278F: security/keys/trusted.c9279F: security/keys/trusted.c
9279F: include/keys/trusted.h9280F: include/keys/trusted.h
9280 9281
9281KEYS/KEYRINGS:9282KEYS/KEYRINGS
9282M: David Howells <dhowells@redhat.com>9283M: David Howells <dhowells@redhat.com>
9283M: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>9284M: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
9284L: keyrings@vger.kernel.org9285L: keyrings@vger.kernel.org
@@ -11114,14 +11115,12 @@ S: Maintained · 1829 unmodified lines
11114F: drivers/usb/image/microtek.*11115F: drivers/usb/image/microtek.*
11115 11116
11116MIPS11117MIPS
11117M: Ralf Baechle <ralf@linux-mips.org>11118M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
11118M: Paul Burton <paulburton@kernel.org>
11119L: linux-mips@vger.kernel.org11119L: linux-mips@vger.kernel.org
11120W: http://www.linux-mips.org/11120W: http://www.linux-mips.org/
11121T: git git://git.linux-mips.org/pub/scm/ralf/linux.git
11122T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git11121T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git
11123Q: http://patchwork.linux-mips.org/project/linux-mips/list/11122Q: http://patchwork.linux-mips.org/project/linux-mips/list/
11124S: Supported11123S: Maintained
11125F: Documentation/devicetree/bindings/mips/11124F: Documentation/devicetree/bindings/mips/
11126F: Documentation/mips/11125F: Documentation/mips/
11127F: arch/mips/11126F: arch/mips/
@@ -11485,7 +11484,7 @@ F: drivers/scsi/mac_scsi.* · 357 unmodified lines
11485F: drivers/scsi/sun3_scsi.*11484F: drivers/scsi/sun3_scsi.*
11486F: drivers/scsi/sun3_scsi_vme.c11485F: drivers/scsi/sun3_scsi_vme.c
11487 11486
11488NCSI LIBRARY:11487NCSI LIBRARY
11489M: Samuel Mendoza-Jonas <sam@mendozajonas.com>11488M: Samuel Mendoza-Jonas <sam@mendozajonas.com>
11490S: Maintained11489S: Maintained
11491F: net/ncsi/11490F: net/ncsi/
@@ -12741,7 +12740,7 @@ M: Tom Joseph <tjoseph@cadence.com> · 1249 unmodified lines
12741L: linux-pci@vger.kernel.org12740L: linux-pci@vger.kernel.org
12742S: Maintained12741S: Maintained
12743F: Documentation/devicetree/bindings/pci/cdns,*.txt12742F: Documentation/devicetree/bindings/pci/cdns,*.txt
12744F: drivers/pci/controller/pcie-cadence*12743F: drivers/pci/controller/cadence/
12745 12744
12746PCI DRIVER FOR FREESCALE LAYERSCAPE12745PCI DRIVER FOR FREESCALE LAYERSCAPE
12747M: Minghuan Lian <minghuan.Lian@nxp.com>12746M: Minghuan Lian <minghuan.Lian@nxp.com>
@@ -13513,7 +13512,7 @@ L: linuxppc-dev@lists.ozlabs.org · 765 unmodified lines
13513S: Maintained13512S: Maintained
13514F: drivers/block/ps3vram.c13513F: drivers/block/ps3vram.c
13515 13514
13516PSAMPLE PACKET SAMPLING SUPPORT:13515PSAMPLE PACKET SAMPLING SUPPORT
13517M: Yotam Gigi <yotam.gi@gmail.com>13516M: Yotam Gigi <yotam.gi@gmail.com>
13518S: Maintained13517S: Maintained
13519F: net/psample13518F: net/psample
@@ -14583,10 +14582,10 @@ F: drivers/media/pci/saa7146/ · 1063 unmodified lines
14583F: include/media/drv-intf/saa7146*14582F: include/media/drv-intf/saa7146*
14584 14583
14585SAFESETID SECURITY MODULE14584SAFESETID SECURITY MODULE
14586M: Micah Morton <mortonm@chromium.org>14585M: Micah Morton <mortonm@chromium.org>
14587S: Supported14586S: Supported
14588F: security/safesetid/14587F: security/safesetid/
14589F: Documentation/admin-guide/LSM/SafeSetID.rst14588F: Documentation/admin-guide/LSM/SafeSetID.rst
14590 14589
14591SAMSUNG AUDIO (ASoC) DRIVERS14590SAMSUNG AUDIO (ASoC) DRIVERS
14592M: Krzysztof Kozlowski <krzk@kernel.org>14591M: Krzysztof Kozlowski <krzk@kernel.org>
@@ -16076,8 +16075,8 @@ F: Documentation/devicetree/bindings/reset/snps,axs10x-reset.txt · 1483 unmodified lines
16076SYNOPSYS CREG GPIO DRIVER16075SYNOPSYS CREG GPIO DRIVER
16077M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>16076M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
16078S: Maintained16077S: Maintained
16079F: drivers/gpio/gpio-creg-snps.c
16080F: Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt16078F: Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt
16079F: drivers/gpio/gpio-creg-snps.c
16081 16080
16082SYNOPSYS DESIGNWARE 8250 UART DRIVER16081SYNOPSYS DESIGNWARE 8250 UART DRIVER
16083R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>16082R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
@@ -16088,8 +16087,8 @@ SYNOPSYS DESIGNWARE APB GPIO DRIVER · 4 unmodified lines
16088M: Hoan Tran <hoan@os.amperecomputing.com>16087M: Hoan Tran <hoan@os.amperecomputing.com>
16089L: linux-gpio@vger.kernel.org16088L: linux-gpio@vger.kernel.org
16090S: Maintained16089S: Maintained
16091F: drivers/gpio/gpio-dwapb.c
16092F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt16090F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
16091F: drivers/gpio/gpio-dwapb.c
16093 16092
16094SYNOPSYS DESIGNWARE AXI DMAC DRIVER16093SYNOPSYS DESIGNWARE AXI DMAC DRIVER
16095M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>16094M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
@@ -16553,8 +16552,8 @@ M: Michael Jamet <michael.jamet@intel.com> · 457 unmodified lines
16553M: Mika Westerberg <mika.westerberg@linux.intel.com>16552M: Mika Westerberg <mika.westerberg@linux.intel.com>
16554M: Yehezkel Bernat <YehezkelShB@gmail.com>16553M: Yehezkel Bernat <YehezkelShB@gmail.com>
16555L: linux-usb@vger.kernel.org16554L: linux-usb@vger.kernel.org
16556T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git
16557S: Maintained16555S: Maintained
16556T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git
16558F: Documentation/admin-guide/thunderbolt.rst16557F: Documentation/admin-guide/thunderbolt.rst
16559F: drivers/thunderbolt/16558F: drivers/thunderbolt/
16560F: include/linux/thunderbolt.h16559F: include/linux/thunderbolt.h
@@ -17081,7 +17080,7 @@ S: Maintained · 520 unmodified lines
17081F: Documentation/admin-guide/ufs.rst17080F: Documentation/admin-guide/ufs.rst
17082F: fs/ufs/17081F: fs/ufs/
17083 17082
17084UHID USERSPACE HID IO DRIVER:17083UHID USERSPACE HID IO DRIVER
17085M: David Herrmann <dh.herrmann@googlemail.com>17084M: David Herrmann <dh.herrmann@googlemail.com>
17086L: linux-input@vger.kernel.org17085L: linux-input@vger.kernel.org
17087S: Maintained17086S: Maintained
@@ -17095,18 +17094,18 @@ S: Maintained · 7 unmodified lines
17095F: drivers/usb/common/ulpi.c17094F: drivers/usb/common/ulpi.c
17096F: include/linux/ulpi/17095F: include/linux/ulpi/
17097 17096
17098ULTRA-WIDEBAND (UWB) SUBSYSTEM:17097ULTRA-WIDEBAND (UWB) SUBSYSTEM
17099L: devel@driverdev.osuosl.org17098L: devel@driverdev.osuosl.org
17100S: Obsolete17099S: Obsolete
17101F: drivers/staging/uwb/17100F: drivers/staging/uwb/
17102 17101
17103UNICODE SUBSYSTEM:17102UNICODE SUBSYSTEM
17104M: Gabriel Krisman Bertazi <krisman@collabora.com>17103M: Gabriel Krisman Bertazi <krisman@collabora.com>
17105L: linux-fsdevel@vger.kernel.org17104L: linux-fsdevel@vger.kernel.org
17106S: Supported17105S: Supported
17107F: fs/unicode/17106F: fs/unicode/
17108 17107
17109UNICORE32 ARCHITECTURE:17108UNICORE32 ARCHITECTURE
17110M: Guan Xuetao <gxt@pku.edu.cn>17109M: Guan Xuetao <gxt@pku.edu.cn>
17111W: http://mprc.pku.edu.cn/~guanxuetao/linux17110W: http://mprc.pku.edu.cn/~guanxuetao/linux
17112S: Maintained17111S: Maintained
@@ -17393,11 +17392,14 @@ F: drivers/usb/ · 280 unmodified lines
17393F: include/linux/usb.h17392F: include/linux/usb.h
17394F: include/linux/usb/17393F: include/linux/usb/
17395 17394
17396USB TYPEC PI3USB30532 MUX DRIVER17395USB TYPEC BUS FOR ALTERNATE MODES
17397M: Hans de Goede <hdegoede@redhat.com>17396M: Heikki Krogerus <heikki.krogerus@linux.intel.com>
17398L: linux-usb@vger.kernel.org17397L: linux-usb@vger.kernel.org
17399S: Maintained17398S: Maintained
17400F: drivers/usb/typec/mux/pi3usb30532.c17399F: Documentation/ABI/testing/sysfs-bus-typec
17400F: Documentation/driver-api/usb/typec_bus.rst
17401F: drivers/usb/typec/altmodes/
17402F: include/linux/usb/typec_altmode.h
17401 17403
17402USB TYPEC CLASS17404USB TYPEC CLASS
17403M: Heikki Krogerus <heikki.krogerus@linux.intel.com>17405M: Heikki Krogerus <heikki.krogerus@linux.intel.com>
@@ -17408,14 +17410,11 @@ F: Documentation/driver-api/usb/typec.rst · 4 unmodified lines
17408F: drivers/usb/typec/17410F: drivers/usb/typec/
17409F: include/linux/usb/typec.h17411F: include/linux/usb/typec.h
17410 17412
17411USB TYPEC BUS FOR ALTERNATE MODES17413USB TYPEC PI3USB30532 MUX DRIVER
17412M: Heikki Krogerus <heikki.krogerus@linux.intel.com>17414M: Hans de Goede <hdegoede@redhat.com>
17413L: linux-usb@vger.kernel.org17415L: linux-usb@vger.kernel.org
17414S: Maintained17416S: Maintained
17415F: Documentation/ABI/testing/sysfs-bus-typec17417F: drivers/usb/typec/mux/pi3usb30532.c
17416F: Documentation/driver-api/usb/typec_bus.rst
17417F: drivers/usb/typec/altmodes/
17418F: include/linux/usb/typec_altmode.h
17419 17418
17420USB TYPEC PORT CONTROLLER DRIVERS17419USB TYPEC PORT CONTROLLER DRIVERS
17421M: Guenter Roeck <linux@roeck-us.net>17420M: Guenter Roeck <linux@roeck-us.net>
@@ -17792,7 +17791,7 @@ F: include/linux/vbox_utils.h · 370 unmodified lines
17792F: include/uapi/linux/vbox*.h17791F: include/uapi/linux/vbox*.h
17793F: drivers/virt/vboxguest/17792F: drivers/virt/vboxguest/
17794 17793
17795VIRTUAL BOX SHARED FOLDER VFS DRIVER:17794VIRTUAL BOX SHARED FOLDER VFS DRIVER
17796M: Hans de Goede <hdegoede@redhat.com>17795M: Hans de Goede <hdegoede@redhat.com>
17797L: linux-fsdevel@vger.kernel.org17796L: linux-fsdevel@vger.kernel.org
17798S: Maintained17797S: Maintained
@@ -18415,8 +18414,8 @@ M: Nandor Han <nandor.han@ge.com> · 616 unmodified lines
18415M: Semi Malinen <semi.malinen@ge.com>18414M: Semi Malinen <semi.malinen@ge.com>
18416L: linux-gpio@vger.kernel.org18415L: linux-gpio@vger.kernel.org
18417S: Maintained18416S: Maintained
18418F: drivers/gpio/gpio-xra1403.c
18419F: Documentation/devicetree/bindings/gpio/gpio-xra1403.txt18417F: Documentation/devicetree/bindings/gpio/gpio-xra1403.txt
18418F: drivers/gpio/gpio-xra1403.c
18420 18419
18421XTENSA XTFPGA PLATFORM SUPPORT18420XTENSA XTFPGA PLATFORM SUPPORT
18422M: Max Filippov <jcmvbkbc@gmail.com>18421M: Max Filippov <jcmvbkbc@gmail.com>
Makefile+4−2
@@ -2,7 +2,7 @@ · 1 unmodified line
2VERSION = 52VERSION = 5
3PATCHLEVEL = 63PATCHLEVEL = 6
4SUBLEVEL = 04SUBLEVEL = 0
5EXTRAVERSION = -rc15EXTRAVERSION = -rc4
6NAME = Kleptomaniac Octopus6NAME = Kleptomaniac Octopus
7 7
8# *DOCUMENTATION*8# *DOCUMENTATION*
@@ -68,6 +68,7 @@ unexport GREP_OPTIONS · 59 unmodified lines
68#68#
69# If KBUILD_VERBOSE equals 0 then the above command will be hidden.69# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
70# If KBUILD_VERBOSE equals 1 then the above command is displayed.70# 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.
71#72#
72# To put more focus on warnings, be less verbose as default73# To put more focus on warnings, be less verbose as default
73# Use 'make V=1' to see the full commands74# Use 'make V=1' to see the full commands
@@ -1238,7 +1239,7 @@ ifneq ($(dtstree),) · 1164 unmodified lines
1238%.dtb: include/config/kernel.release scripts_dtc1239%.dtb: include/config/kernel.release scripts_dtc
1239 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@1240 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
1240 1241
1241PHONY += dtbs dtbs_install dt_binding_check1242PHONY += dtbs dtbs_install dtbs_check
1242dtbs dtbs_check: include/config/kernel.release scripts_dtc1243dtbs dtbs_check: include/config/kernel.release scripts_dtc
1243 $(Q)$(MAKE) $(build)=$(dtstree)1244 $(Q)$(MAKE) $(build)=$(dtstree)
1244 1245
@@ -1258,6 +1259,7 @@ PHONY += scripts_dtc · 13 unmodified lines
1258scripts_dtc: scripts_basic1259scripts_dtc: scripts_basic
1259 $(Q)$(MAKE) $(build)=scripts/dtc1260 $(Q)$(MAKE) $(build)=scripts/dtc
1260 1261
1262PHONY += dt_binding_check
1261dt_binding_check: scripts_dtc1263dt_binding_check: scripts_dtc
1262 $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings1264 $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
1263 1265
arch/arm/boot/dts/stih410-b2260.dts+0−3
@@ -178,9 +178,6 @@ · 177 unmodified lines
178 phy-mode = "rgmii";178 phy-mode = "rgmii";
179 pinctrl-0 = <&pinctrl_rgmii1 &pinctrl_rgmii1_mdio_1>;179 pinctrl-0 = <&pinctrl_rgmii1 &pinctrl_rgmii1_mdio_1>;
180 180
181 snps,phy-bus-name = "stmmac";
182 snps,phy-bus-id = <0>;
183 snps,phy-addr = <0>;
184 snps,reset-gpio = <&pio0 7 0>;181 snps,reset-gpio = <&pio0 7 0>;
185 snps,reset-active-low;182 snps,reset-active-low;
186 snps,reset-delays-us = <0 10000 1000000>;183 snps,reset-delays-us = <0 10000 1000000>;
arch/arm/boot/dts/stihxxx-b2120.dtsi+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
46 /* DAC */46 /* DAC */
47 format = "i2s";47 format = "i2s";
48 mclk-fs = <256>;48 mclk-fs = <256>;
49 frame-inversion = <1>;49 frame-inversion;
50 cpu {50 cpu {
51 sound-dai = <&sti_uni_player2>;51 sound-dai = <&sti_uni_player2>;
52 };52 };
arch/arm/configs/am200epdkit_defconfig+0−2
@@ -11,8 +11,6 @@ CONFIG_SLAB=y · 10 unmodified lines
11CONFIG_MODULES=y11CONFIG_MODULES=y
12CONFIG_MODULE_UNLOAD=y12CONFIG_MODULE_UNLOAD=y
13# CONFIG_BLK_DEV_BSG is not set13# CONFIG_BLK_DEV_BSG is not set
14# CONFIG_IOSCHED_DEADLINE is not set
15# CONFIG_IOSCHED_CFQ is not set
16CONFIG_ARCH_PXA=y14CONFIG_ARCH_PXA=y
17CONFIG_ARCH_GUMSTIX=y15CONFIG_ARCH_GUMSTIX=y
18CONFIG_PCCARD=y16CONFIG_PCCARD=y
arch/arm/configs/axm55xx_defconfig+0−1
@@ -25,7 +25,6 @@ CONFIG_EMBEDDED=y · 24 unmodified lines
25CONFIG_PROFILING=y25CONFIG_PROFILING=y
26CONFIG_MODULES=y26CONFIG_MODULES=y
27CONFIG_MODULE_UNLOAD=y27CONFIG_MODULE_UNLOAD=y
28# CONFIG_IOSCHED_DEADLINE is not set
29CONFIG_ARCH_AXXIA=y28CONFIG_ARCH_AXXIA=y
30CONFIG_GPIO_PCA953X=y29CONFIG_GPIO_PCA953X=y
31CONFIG_ARM_LPAE=y30CONFIG_ARM_LPAE=y
arch/arm/configs/clps711x_defconfig+0−1
@@ -7,7 +7,6 @@ CONFIG_EMBEDDED=y · 6 unmodified lines
7CONFIG_SLOB=y7CONFIG_SLOB=y
8CONFIG_JUMP_LABEL=y8CONFIG_JUMP_LABEL=y
9CONFIG_PARTITION_ADVANCED=y9CONFIG_PARTITION_ADVANCED=y
10# CONFIG_IOSCHED_CFQ is not set
11CONFIG_ARCH_CLPS711X=y10CONFIG_ARCH_CLPS711X=y
12CONFIG_ARCH_AUTCPU12=y11CONFIG_ARCH_AUTCPU12=y
13CONFIG_ARCH_CDB89712=y12CONFIG_ARCH_CDB89712=y
arch/arm/configs/cns3420vb_defconfig+1−1
@@ -17,7 +17,7 @@ CONFIG_MODULE_UNLOAD=y · 16 unmodified lines
17CONFIG_MODULE_FORCE_UNLOAD=y17CONFIG_MODULE_FORCE_UNLOAD=y
18CONFIG_MODVERSIONS=y18CONFIG_MODVERSIONS=y
19# CONFIG_BLK_DEV_BSG is not set19# CONFIG_BLK_DEV_BSG is not set
20CONFIG_IOSCHED_CFQ=m20CONFIG_IOSCHED_BFQ=m
21CONFIG_ARCH_MULTI_V6=y21CONFIG_ARCH_MULTI_V6=y
22#CONFIG_ARCH_MULTI_V7 is not set22#CONFIG_ARCH_MULTI_V7 is not set
23CONFIG_ARCH_CNS3XXX=y23CONFIG_ARCH_CNS3XXX=y
arch/arm/configs/colibri_pxa300_defconfig+0−1
@@ -43,7 +43,6 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y · 42 unmodified lines
43CONFIG_USB_MON=y43CONFIG_USB_MON=y
44CONFIG_USB_STORAGE=y44CONFIG_USB_STORAGE=y
45CONFIG_MMC=y45CONFIG_MMC=y
46# CONFIG_MMC_BLOCK_BOUNCE is not set
47CONFIG_MMC_PXA=y46CONFIG_MMC_PXA=y
48CONFIG_EXT3_FS=y47CONFIG_EXT3_FS=y
49CONFIG_NFS_FS=y48CONFIG_NFS_FS=y
arch/arm/configs/collie_defconfig+0−2
@@ -7,8 +7,6 @@ CONFIG_EXPERT=y · 6 unmodified lines
7# CONFIG_BASE_FULL is not set7# CONFIG_BASE_FULL is not set
8# CONFIG_EPOLL is not set8# CONFIG_EPOLL is not set
9CONFIG_SLOB=y9CONFIG_SLOB=y
10# CONFIG_IOSCHED_DEADLINE is not set
11# CONFIG_IOSCHED_CFQ is not set
12CONFIG_ARCH_SA1100=y10CONFIG_ARCH_SA1100=y
13CONFIG_SA1100_COLLIE=y11CONFIG_SA1100_COLLIE=y
14CONFIG_PCCARD=y12CONFIG_PCCARD=y
arch/arm/configs/davinci_all_defconfig+0−2
@@ -15,8 +15,6 @@ CONFIG_MODULE_UNLOAD=y · 14 unmodified lines
15CONFIG_MODULE_FORCE_UNLOAD=y15CONFIG_MODULE_FORCE_UNLOAD=y
16CONFIG_MODVERSIONS=y16CONFIG_MODVERSIONS=y
17CONFIG_PARTITION_ADVANCED=y17CONFIG_PARTITION_ADVANCED=y
18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_MULTIPLATFORM=y18CONFIG_ARCH_MULTIPLATFORM=y
21CONFIG_ARCH_MULTI_V7=n19CONFIG_ARCH_MULTI_V7=n
22CONFIG_ARCH_MULTI_V5=y20CONFIG_ARCH_MULTI_V5=y
arch/arm/configs/efm32_defconfig+0−2
@@ -12,8 +12,6 @@ CONFIG_EMBEDDED=y · 11 unmodified lines
12# CONFIG_VM_EVENT_COUNTERS is not set12# CONFIG_VM_EVENT_COUNTERS is not set
13# CONFIG_SLUB_DEBUG is not set13# CONFIG_SLUB_DEBUG is not set
14# CONFIG_BLK_DEV_BSG is not set14# CONFIG_BLK_DEV_BSG is not set
15# CONFIG_IOSCHED_DEADLINE is not set
16# CONFIG_IOSCHED_CFQ is not set
17# CONFIG_MMU is not set15# CONFIG_MMU is not set
18CONFIG_ARM_SINGLE_ARMV7M=y16CONFIG_ARM_SINGLE_ARMV7M=y
19CONFIG_ARCH_EFM32=y17CONFIG_ARCH_EFM32=y
arch/arm/configs/ep93xx_defconfig+0−1
@@ -11,7 +11,6 @@ CONFIG_MODULE_UNLOAD=y · 10 unmodified lines
11CONFIG_MODULE_FORCE_UNLOAD=y11CONFIG_MODULE_FORCE_UNLOAD=y
12# CONFIG_BLK_DEV_BSG is not set12# CONFIG_BLK_DEV_BSG is not set
13CONFIG_PARTITION_ADVANCED=y13CONFIG_PARTITION_ADVANCED=y
14# CONFIG_IOSCHED_CFQ is not set
15CONFIG_ARCH_EP93XX=y14CONFIG_ARCH_EP93XX=y
16CONFIG_CRUNCH=y15CONFIG_CRUNCH=y
17CONFIG_MACH_ADSSPHERE=y16CONFIG_MACH_ADSSPHERE=y
arch/arm/configs/eseries_pxa_defconfig+0−2
@@ -9,8 +9,6 @@ CONFIG_MODULES=y · 8 unmodified lines
9CONFIG_MODULE_UNLOAD=y9CONFIG_MODULE_UNLOAD=y
10CONFIG_MODULE_FORCE_UNLOAD=y10CONFIG_MODULE_FORCE_UNLOAD=y
11# CONFIG_BLK_DEV_BSG is not set11# CONFIG_BLK_DEV_BSG is not set
12# CONFIG_IOSCHED_DEADLINE is not set
13# CONFIG_IOSCHED_CFQ is not set
14CONFIG_ARCH_PXA=y12CONFIG_ARCH_PXA=y
15CONFIG_ARCH_PXA_ESERIES=y13CONFIG_ARCH_PXA_ESERIES=y
16# CONFIG_ARM_THUMB is not set14# CONFIG_ARM_THUMB is not set
arch/arm/configs/ezx_defconfig+0−1
@@ -14,7 +14,6 @@ CONFIG_MODULE_UNLOAD=y · 13 unmodified lines
14CONFIG_MODULE_FORCE_UNLOAD=y14CONFIG_MODULE_FORCE_UNLOAD=y
15CONFIG_MODVERSIONS=y15CONFIG_MODVERSIONS=y
16# CONFIG_BLK_DEV_BSG is not set16# CONFIG_BLK_DEV_BSG is not set
17# CONFIG_IOSCHED_CFQ is not set
18CONFIG_ARCH_PXA=y17CONFIG_ARCH_PXA=y
19CONFIG_PXA_EZX=y18CONFIG_PXA_EZX=y
20CONFIG_NO_HZ=y19CONFIG_NO_HZ=y
arch/arm/configs/h3600_defconfig+0−2
@@ -5,8 +5,6 @@ CONFIG_LOG_BUF_SHIFT=14 · 4 unmodified lines
5CONFIG_BLK_DEV_INITRD=y5CONFIG_BLK_DEV_INITRD=y
6CONFIG_MODULES=y6CONFIG_MODULES=y
7# CONFIG_BLK_DEV_BSG is not set7# CONFIG_BLK_DEV_BSG is not set
8# CONFIG_IOSCHED_DEADLINE is not set
9# CONFIG_IOSCHED_CFQ is not set
10CONFIG_ARCH_SA1100=y8CONFIG_ARCH_SA1100=y
11CONFIG_SA1100_H3600=y9CONFIG_SA1100_H3600=y
12CONFIG_PCCARD=y10CONFIG_PCCARD=y
arch/arm/configs/h5000_defconfig+0−1
@@ -10,7 +10,6 @@ CONFIG_MODULES=y · 9 unmodified lines
10CONFIG_MODULE_UNLOAD=y10CONFIG_MODULE_UNLOAD=y
11CONFIG_MODULE_FORCE_UNLOAD=y11CONFIG_MODULE_FORCE_UNLOAD=y
12# CONFIG_BLK_DEV_BSG is not set12# CONFIG_BLK_DEV_BSG is not set
13# CONFIG_IOSCHED_CFQ is not set
14CONFIG_ARCH_PXA=y13CONFIG_ARCH_PXA=y
15CONFIG_MACH_H5000=y14CONFIG_MACH_H5000=y
16CONFIG_AEABI=y15CONFIG_AEABI=y
arch/arm/configs/imote2_defconfig+0−1
@@ -13,7 +13,6 @@ CONFIG_MODULE_UNLOAD=y · 12 unmodified lines
13CONFIG_MODULE_FORCE_UNLOAD=y13CONFIG_MODULE_FORCE_UNLOAD=y
14CONFIG_MODVERSIONS=y14CONFIG_MODVERSIONS=y
15# CONFIG_BLK_DEV_BSG is not set15# CONFIG_BLK_DEV_BSG is not set
16# CONFIG_IOSCHED_CFQ is not set
17CONFIG_ARCH_PXA=y16CONFIG_ARCH_PXA=y
18CONFIG_MACH_INTELMOTE2=y17CONFIG_MACH_INTELMOTE2=y
19CONFIG_NO_HZ=y18CONFIG_NO_HZ=y
arch/arm/configs/imx_v4_v5_defconfig+0−2
@@ -32,8 +32,6 @@ CONFIG_KPROBES=y · 31 unmodified lines
32CONFIG_MODULES=y32CONFIG_MODULES=y
33CONFIG_MODULE_UNLOAD=y33CONFIG_MODULE_UNLOAD=y
34# CONFIG_BLK_DEV_BSG is not set34# CONFIG_BLK_DEV_BSG is not set
35# CONFIG_IOSCHED_DEADLINE is not set
36# CONFIG_IOSCHED_CFQ is not set
37CONFIG_NET=y35CONFIG_NET=y
38CONFIG_PACKET=y36CONFIG_PACKET=y
39CONFIG_UNIX=y37CONFIG_UNIX=y
arch/arm/configs/lpc18xx_defconfig+0−4
@@ -1,4 +1,3 @@
1CONFIG_CROSS_COMPILE="arm-linux-gnueabihf-"
2CONFIG_HIGH_RES_TIMERS=y1CONFIG_HIGH_RES_TIMERS=y
3CONFIG_PREEMPT=y2CONFIG_PREEMPT=y
4CONFIG_BLK_DEV_INITRD=y3CONFIG_BLK_DEV_INITRD=y
@@ -28,10 +27,7 @@ CONFIG_FLASH_SIZE=0x00080000 · 23 unmodified lines
28CONFIG_ZBOOT_ROM_TEXT=0x027CONFIG_ZBOOT_ROM_TEXT=0x0
29CONFIG_ZBOOT_ROM_BSS=0x028CONFIG_ZBOOT_ROM_BSS=0x0
30CONFIG_ARM_APPENDED_DTB=y29CONFIG_ARM_APPENDED_DTB=y
31# CONFIG_LBDAF is not set
32# CONFIG_BLK_DEV_BSG is not set30# CONFIG_BLK_DEV_BSG is not set
33# CONFIG_IOSCHED_DEADLINE is not set
34# CONFIG_IOSCHED_CFQ is not set
35CONFIG_BINFMT_FLAT=y31CONFIG_BINFMT_FLAT=y
36CONFIG_BINFMT_ZFLAT=y32CONFIG_BINFMT_ZFLAT=y
37CONFIG_BINFMT_SHARED_FLAT=y33CONFIG_BINFMT_SHARED_FLAT=y
arch/arm/configs/magician_defconfig+0−2
@@ -9,8 +9,6 @@ CONFIG_SLAB=y · 8 unmodified lines
9CONFIG_MODULES=y9CONFIG_MODULES=y
10CONFIG_MODULE_UNLOAD=y10CONFIG_MODULE_UNLOAD=y
11# CONFIG_BLK_DEV_BSG is not set11# CONFIG_BLK_DEV_BSG is not set
12# CONFIG_IOSCHED_DEADLINE is not set
13# CONFIG_IOSCHED_CFQ is not set
14CONFIG_ARCH_PXA=y12CONFIG_ARCH_PXA=y
15CONFIG_MACH_H4700=y13CONFIG_MACH_H4700=y
16CONFIG_MACH_MAGICIAN=y14CONFIG_MACH_MAGICIAN=y
arch/arm/configs/moxart_defconfig+0−1
@@ -15,7 +15,6 @@ CONFIG_EMBEDDED=y · 14 unmodified lines
15# CONFIG_SLUB_DEBUG is not set15# CONFIG_SLUB_DEBUG is not set
16# CONFIG_COMPAT_BRK is not set16# CONFIG_COMPAT_BRK is not set
17# CONFIG_BLK_DEV_BSG is not set17# CONFIG_BLK_DEV_BSG is not set
18# CONFIG_IOSCHED_DEADLINE is not set
19CONFIG_ARCH_MULTI_V4=y18CONFIG_ARCH_MULTI_V4=y
20# CONFIG_ARCH_MULTI_V7 is not set19# CONFIG_ARCH_MULTI_V7 is not set
21CONFIG_ARCH_MOXART=y20CONFIG_ARCH_MOXART=y
arch/arm/configs/mxs_defconfig+0−2
@@ -25,8 +25,6 @@ CONFIG_MODULE_UNLOAD=y · 24 unmodified lines
25CONFIG_MODULE_FORCE_UNLOAD=y25CONFIG_MODULE_FORCE_UNLOAD=y
26CONFIG_MODVERSIONS=y26CONFIG_MODVERSIONS=y
27CONFIG_BLK_DEV_INTEGRITY=y27CONFIG_BLK_DEV_INTEGRITY=y
28# CONFIG_IOSCHED_DEADLINE is not set
29# CONFIG_IOSCHED_CFQ is not set
30CONFIG_NET=y28CONFIG_NET=y
31CONFIG_PACKET=y29CONFIG_PACKET=y
32CONFIG_UNIX=y30CONFIG_UNIX=y
arch/arm/configs/omap1_defconfig+0−2
@@ -18,8 +18,6 @@ CONFIG_MODULES=y · 17 unmodified lines
18CONFIG_MODULE_UNLOAD=y18CONFIG_MODULE_UNLOAD=y
19CONFIG_MODULE_FORCE_UNLOAD=y19CONFIG_MODULE_FORCE_UNLOAD=y
20# CONFIG_BLK_DEV_BSG is not set20# CONFIG_BLK_DEV_BSG is not set
21# CONFIG_IOSCHED_DEADLINE is not set
22# CONFIG_IOSCHED_CFQ is not set
23CONFIG_ARCH_OMAP=y21CONFIG_ARCH_OMAP=y
24CONFIG_ARCH_OMAP1=y22CONFIG_ARCH_OMAP1=y
25CONFIG_OMAP_RESET_CLOCKS=y23CONFIG_OMAP_RESET_CLOCKS=y
arch/arm/configs/palmz72_defconfig+0−2
@@ -7,8 +7,6 @@ CONFIG_SLAB=y · 6 unmodified lines
7CONFIG_MODULES=y7CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y8CONFIG_MODULE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set9# CONFIG_BLK_DEV_BSG is not set
10# CONFIG_IOSCHED_DEADLINE is not set
11# CONFIG_IOSCHED_CFQ is not set
12CONFIG_ARCH_PXA=y10CONFIG_ARCH_PXA=y
13CONFIG_ARCH_PXA_PALM=y11CONFIG_ARCH_PXA_PALM=y
14# CONFIG_MACH_PALMTX is not set12# CONFIG_MACH_PALMTX is not set
arch/arm/configs/pcm027_defconfig+0−2
@@ -13,8 +13,6 @@ CONFIG_MODULES=y · 12 unmodified lines
13CONFIG_MODULE_UNLOAD=y13CONFIG_MODULE_UNLOAD=y
14CONFIG_MODULE_FORCE_UNLOAD=y14CONFIG_MODULE_FORCE_UNLOAD=y
15# CONFIG_BLK_DEV_BSG is not set15# CONFIG_BLK_DEV_BSG is not set
16# CONFIG_IOSCHED_DEADLINE is not set
17# CONFIG_IOSCHED_CFQ is not set
18CONFIG_ARCH_PXA=y16CONFIG_ARCH_PXA=y
19CONFIG_MACH_PCM027=y17CONFIG_MACH_PCM027=y
20CONFIG_MACH_PCM990_BASEBOARD=y18CONFIG_MACH_PCM990_BASEBOARD=y
arch/arm/configs/pleb_defconfig+0−2
@@ -6,8 +6,6 @@ CONFIG_EXPERT=y · 5 unmodified lines
6# CONFIG_HOTPLUG is not set6# CONFIG_HOTPLUG is not set
7# CONFIG_SHMEM is not set7# CONFIG_SHMEM is not set
8CONFIG_MODULES=y8CONFIG_MODULES=y
9# CONFIG_IOSCHED_DEADLINE is not set
10# CONFIG_IOSCHED_CFQ is not set
11CONFIG_ARCH_SA1100=y9CONFIG_ARCH_SA1100=y
12CONFIG_SA1100_PLEB=y10CONFIG_SA1100_PLEB=y
13CONFIG_ZBOOT_ROM_TEXT=0x011CONFIG_ZBOOT_ROM_TEXT=0x0
arch/arm/configs/realview_defconfig+0−1
@@ -8,7 +8,6 @@ CONFIG_SLAB=y · 7 unmodified lines
8CONFIG_MODULES=y8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set10# CONFIG_BLK_DEV_BSG is not set
11# CONFIG_IOSCHED_CFQ is not set
12CONFIG_ARCH_MULTI_V6=y11CONFIG_ARCH_MULTI_V6=y
13CONFIG_ARCH_REALVIEW=y12CONFIG_ARCH_REALVIEW=y
14CONFIG_MACH_REALVIEW_EB=y13CONFIG_MACH_REALVIEW_EB=y
arch/arm/configs/sama5_defconfig+0−3
@@ -14,8 +14,6 @@ CONFIG_MODULE_FORCE_LOAD=y · 13 unmodified lines
14CONFIG_MODULE_UNLOAD=y14CONFIG_MODULE_UNLOAD=y
15CONFIG_MODULE_FORCE_UNLOAD=y15CONFIG_MODULE_FORCE_UNLOAD=y
16# CONFIG_BLK_DEV_BSG is not set16# CONFIG_BLK_DEV_BSG is not set
17# CONFIG_IOSCHED_DEADLINE is not set
18# CONFIG_IOSCHED_CFQ is not set
19CONFIG_ARCH_AT91=y17CONFIG_ARCH_AT91=y
20CONFIG_SOC_SAMA5D2=y18CONFIG_SOC_SAMA5D2=y
21CONFIG_SOC_SAMA5D3=y19CONFIG_SOC_SAMA5D3=y
@@ -182,7 +180,6 @@ CONFIG_USB_GADGET=y · 160 unmodified lines
182CONFIG_USB_ATMEL_USBA=y180CONFIG_USB_ATMEL_USBA=y
183CONFIG_USB_G_SERIAL=y181CONFIG_USB_G_SERIAL=y
184CONFIG_MMC=y182CONFIG_MMC=y
185# CONFIG_MMC_BLOCK_BOUNCE is not set
186CONFIG_MMC_SDHCI=y183CONFIG_MMC_SDHCI=y
187CONFIG_MMC_SDHCI_PLTFM=y184CONFIG_MMC_SDHCI_PLTFM=y
188CONFIG_MMC_SDHCI_OF_AT91=y185CONFIG_MMC_SDHCI_OF_AT91=y
arch/arm/configs/stm32_defconfig+0−2
@@ -14,8 +14,6 @@ CONFIG_EMBEDDED=y · 13 unmodified lines
14# CONFIG_VM_EVENT_COUNTERS is not set14# CONFIG_VM_EVENT_COUNTERS is not set
15# CONFIG_SLUB_DEBUG is not set15# CONFIG_SLUB_DEBUG is not set
16# CONFIG_BLK_DEV_BSG is not set16# CONFIG_BLK_DEV_BSG is not set
17# CONFIG_IOSCHED_DEADLINE is not set
18# CONFIG_IOSCHED_CFQ is not set
19# CONFIG_MMU is not set17# CONFIG_MMU is not set
20CONFIG_ARCH_STM32=y18CONFIG_ARCH_STM32=y
21CONFIG_CPU_V7M_NUM_IRQ=24019CONFIG_CPU_V7M_NUM_IRQ=240
arch/arm/configs/sunxi_defconfig+1−0
@@ -85,6 +85,7 @@ CONFIG_BATTERY_AXP20X=y · 84 unmodified lines
85CONFIG_AXP20X_POWER=y85CONFIG_AXP20X_POWER=y
86CONFIG_THERMAL=y86CONFIG_THERMAL=y
87CONFIG_CPU_THERMAL=y87CONFIG_CPU_THERMAL=y
88CONFIG_SUN8I_THERMAL=y
88CONFIG_WATCHDOG=y89CONFIG_WATCHDOG=y
89CONFIG_SUNXI_WATCHDOG=y90CONFIG_SUNXI_WATCHDOG=y
90CONFIG_MFD_AC100=y91CONFIG_MFD_AC100=y
arch/arm/configs/u300_defconfig+0−2
@@ -11,7 +11,6 @@ CONFIG_MODULES=y · 10 unmodified lines
11CONFIG_MODULE_UNLOAD=y11CONFIG_MODULE_UNLOAD=y
12# CONFIG_BLK_DEV_BSG is not set12# CONFIG_BLK_DEV_BSG is not set
13CONFIG_PARTITION_ADVANCED=y13CONFIG_PARTITION_ADVANCED=y
14# CONFIG_IOSCHED_CFQ is not set
15# CONFIG_ARCH_MULTI_V7 is not set14# CONFIG_ARCH_MULTI_V7 is not set
16CONFIG_ARCH_U300=y15CONFIG_ARCH_U300=y
17CONFIG_MACH_U300_SPIDUMMY=y16CONFIG_MACH_U300_SPIDUMMY=y
@@ -46,7 +45,6 @@ CONFIG_FB=y · 28 unmodified lines
46CONFIG_BACKLIGHT_CLASS_DEVICE=y45CONFIG_BACKLIGHT_CLASS_DEVICE=y
47# CONFIG_USB_SUPPORT is not set46# CONFIG_USB_SUPPORT is not set
48CONFIG_MMC=y47CONFIG_MMC=y
49# CONFIG_MMC_BLOCK_BOUNCE is not set
50CONFIG_MMC_ARMMMCI=y48CONFIG_MMC_ARMMMCI=y
51CONFIG_RTC_CLASS=y49CONFIG_RTC_CLASS=y
52# CONFIG_RTC_HCTOSYS is not set50# CONFIG_RTC_HCTOSYS is not set
arch/arm/configs/vexpress_defconfig+0−2
@@ -15,8 +15,6 @@ CONFIG_OPROFILE=y · 14 unmodified lines
15CONFIG_MODULES=y15CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y16CONFIG_MODULE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set17# CONFIG_BLK_DEV_BSG is not set
18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_VEXPRESS=y18CONFIG_ARCH_VEXPRESS=y
21CONFIG_ARCH_VEXPRESS_DCSCB=y19CONFIG_ARCH_VEXPRESS_DCSCB=y
22CONFIG_ARCH_VEXPRESS_TC2_PM=y20CONFIG_ARCH_VEXPRESS_TC2_PM=y
arch/arm/configs/viper_defconfig+0−1
@@ -9,7 +9,6 @@ CONFIG_SLAB=y · 8 unmodified lines
9CONFIG_MODULES=y9CONFIG_MODULES=y
10CONFIG_MODULE_UNLOAD=y10CONFIG_MODULE_UNLOAD=y
11# CONFIG_BLK_DEV_BSG is not set11# CONFIG_BLK_DEV_BSG is not set
12# CONFIG_IOSCHED_CFQ is not set
13CONFIG_ARCH_PXA=y12CONFIG_ARCH_PXA=y
14CONFIG_ARCH_VIPER=y13CONFIG_ARCH_VIPER=y
15CONFIG_IWMMXT=y14CONFIG_IWMMXT=y
arch/arm/configs/zeus_defconfig+0−2
@@ -4,7 +4,6 @@ CONFIG_LOG_BUF_SHIFT=13 · 3 unmodified lines
4CONFIG_MODULES=y4CONFIG_MODULES=y
5CONFIG_MODULE_UNLOAD=y5CONFIG_MODULE_UNLOAD=y
6# CONFIG_BLK_DEV_BSG is not set6# CONFIG_BLK_DEV_BSG is not set
7# CONFIG_IOSCHED_CFQ is not set
8CONFIG_ARCH_PXA=y7CONFIG_ARCH_PXA=y
9CONFIG_MACH_ARCOM_ZEUS=y8CONFIG_MACH_ARCOM_ZEUS=y
10CONFIG_PCCARD=m9CONFIG_PCCARD=m
@@ -137,7 +136,6 @@ CONFIG_USB_MASS_STORAGE=m · 126 unmodified lines
137CONFIG_USB_G_SERIAL=m136CONFIG_USB_G_SERIAL=m
138CONFIG_USB_G_PRINTER=m137CONFIG_USB_G_PRINTER=m
139CONFIG_MMC=y138CONFIG_MMC=y
140# CONFIG_MMC_BLOCK_BOUNCE is not set
141CONFIG_MMC_PXA=y139CONFIG_MMC_PXA=y
142CONFIG_NEW_LEDS=y140CONFIG_NEW_LEDS=y
143CONFIG_LEDS_CLASS=m141CONFIG_LEDS_CLASS=m
arch/arm/configs/zx_defconfig+0−1
@@ -16,7 +16,6 @@ CONFIG_EMBEDDED=y · 15 unmodified lines
16CONFIG_PERF_EVENTS=y16CONFIG_PERF_EVENTS=y
17CONFIG_SLAB=y17CONFIG_SLAB=y
18# CONFIG_BLK_DEV_BSG is not set18# CONFIG_BLK_DEV_BSG is not set
19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_ZX=y19CONFIG_ARCH_ZX=y
21CONFIG_SOC_ZX296702=y20CONFIG_SOC_ZX296702=y
22# CONFIG_SWP_EMULATE is not set21# 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
392static inline void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) {}392static inline void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) {}
393static inline void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu) {}393static inline void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu) {}
394 394
395static inline void kvm_arm_vhe_guest_enter(void) {}
396static inline void kvm_arm_vhe_guest_exit(void) {}
397
398#define KVM_BP_HARDEN_UNKNOWN -1395#define KVM_BP_HARDEN_UNKNOWN -1
399#define KVM_BP_HARDEN_WA_NEEDED 0396#define KVM_BP_HARDEN_WA_NEEDED 0
400#define KVM_BP_HARDEN_NOT_REQUIRED 1397#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
78{78{
79 unsigned long replaced;79 unsigned long replaced;
80 80
81 if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) {81 if (IS_ENABLED(CONFIG_THUMB2_KERNEL))
82 old = __opcode_to_mem_thumb32(old);82 old = __opcode_to_mem_thumb32(old);
83 new = __opcode_to_mem_thumb32(new);83 else
84 } else {
85 old = __opcode_to_mem_arm(old);84 old = __opcode_to_mem_arm(old);
86 new = __opcode_to_mem_arm(new);
87 }
88 85
89 if (validate) {86 if (validate) {
90 if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))87 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
16 unsigned int insn;16 unsigned int insn;
17};17};
18 18
19#ifdef CONFIG_MMU
19static DEFINE_RAW_SPINLOCK(patch_lock);20static DEFINE_RAW_SPINLOCK(patch_lock);
20 21
21static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)22static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
22 __acquires(&patch_lock)
23{23{
24 unsigned int uintaddr = (uintptr_t) addr;24 unsigned int uintaddr = (uintptr_t) addr;
25 bool module = !core_kernel_text(uintaddr);25 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
34 34
35 if (flags)35 if (flags)
36 raw_spin_lock_irqsave(&patch_lock, *flags);36 raw_spin_lock_irqsave(&patch_lock, *flags);
37 else
38 __acquire(&patch_lock);
39 37
40 set_fixmap(fixmap, page_to_phys(page));38 set_fixmap(fixmap, page_to_phys(page));
41 39
@@ -43,15 +41,19 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) · 1 unmodified line
43}41}
44 42
45static void __kprobes patch_unmap(int fixmap, unsigned long *flags)43static void __kprobes patch_unmap(int fixmap, unsigned long *flags)
46 __releases(&patch_lock)
47{44{
48 clear_fixmap(fixmap);45 clear_fixmap(fixmap);
49 46
50 if (flags)47 if (flags)
51 raw_spin_unlock_irqrestore(&patch_lock, *flags);48 raw_spin_unlock_irqrestore(&patch_lock, *flags);
52 else
53 __release(&patch_lock);
54}49}
50#else
51static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
52{
53 return addr;
54}
55static void __kprobes patch_unmap(int fixmap, unsigned long *flags) { }
56#endif
55 57
56void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap)58void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap)
57{59{
@@ -64,8 +66,6 @@ void __kprobes __patch_text_real(void *addr, unsigned int insn, bool remap) · 6 unmodified lines
64 66
65 if (remap)67 if (remap)
66 waddr = patch_map(addr, FIX_TEXT_POKE0, &flags);68 waddr = patch_map(addr, FIX_TEXT_POKE0, &flags);
67 else
68 __acquire(&patch_lock);
69 69
70 if (thumb2 && __opcode_is_thumb16(insn)) {70 if (thumb2 && __opcode_is_thumb16(insn)) {
71 *(u16 *)waddr = __opcode_to_mem_thumb16(insn);71 *(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
102 if (waddr != addr) {102 if (waddr != addr) {
103 flush_kernel_vmap_range(waddr, twopage ? size / 2 : size);103 flush_kernel_vmap_range(waddr, twopage ? size / 2 : size);
104 patch_unmap(FIX_TEXT_POKE0, &flags);104 patch_unmap(FIX_TEXT_POKE0, &flags);
105 } else105 }
106 __release(&patch_lock);
107 106
108 flush_icache_range((uintptr_t)(addr),107 flush_icache_range((uintptr_t)(addr),
109 (uintptr_t)(addr) + size);108 (uintptr_t)(addr) + size);
arch/arm/mach-npcm/Kconfig+1−1
@@ -11,7 +11,7 @@ config ARCH_NPCM7XX · 10 unmodified lines
11 depends on ARCH_MULTI_V711 depends on ARCH_MULTI_V7
12 select PINCTRL_NPCM7XX12 select PINCTRL_NPCM7XX
13 select NPCM7XX_TIMER13 select NPCM7XX_TIMER
14 select ARCH_REQUIRE_GPIOLIB14 select GPIOLIB
15 select CACHE_L2X015 select CACHE_L2X0
16 select ARM_GIC16 select ARM_GIC
17 select HAVE_ARM_TWD if SMP17 select HAVE_ARM_TWD if SMP
arch/arm64/boot/dts/arm/fvp-base-revc.dts+4−4
@@ -161,10 +161,10 @@ · 160 unmodified lines
161 bus-range = <0x0 0x1>;161 bus-range = <0x0 0x1>;
162 reg = <0x0 0x40000000 0x0 0x10000000>;162 reg = <0x0 0x40000000 0x0 0x10000000>;
163 ranges = <0x2000000 0x0 0x50000000 0x0 0x50000000 0x0 0x10000000>;163 ranges = <0x2000000 0x0 0x50000000 0x0 0x50000000 0x0 0x10000000>;
164 interrupt-map = <0 0 0 1 &gic GIC_SPI 168 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 GIC_SPI 169 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 GIC_SPI 170 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 GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;167 <0 0 0 4 &gic 0 0 GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;
168 interrupt-map-mask = <0x0 0x0 0x0 0x7>;168 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
169 msi-map = <0x0 &its 0x0 0x10000>;169 msi-map = <0x0 &its 0x0 0x10000>;
170 iommu-map = <0x0 &smmu 0x0 0x10000>;170 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
452CONFIG_CPU_THERMAL=y452CONFIG_CPU_THERMAL=y
453CONFIG_THERMAL_EMULATION=y453CONFIG_THERMAL_EMULATION=y
454CONFIG_QORIQ_THERMAL=m454CONFIG_QORIQ_THERMAL=m
455CONFIG_SUN8I_THERMAL=y
455CONFIG_ROCKCHIP_THERMAL=m456CONFIG_ROCKCHIP_THERMAL=m
456CONFIG_RCAR_THERMAL=y457CONFIG_RCAR_THERMAL=y
457CONFIG_RCAR_GEN3_THERMAL=y458CONFIG_RCAR_GEN3_THERMAL=y
@@ -547,6 +548,7 @@ CONFIG_ROCKCHIP_DW_MIPI_DSI=y · 89 unmodified lines
547CONFIG_ROCKCHIP_INNO_HDMI=y548CONFIG_ROCKCHIP_INNO_HDMI=y
548CONFIG_DRM_RCAR_DU=m549CONFIG_DRM_RCAR_DU=m
549CONFIG_DRM_SUN4I=m550CONFIG_DRM_SUN4I=m
551CONFIG_DRM_SUN6I_DSI=m
550CONFIG_DRM_SUN8I_DW_HDMI=m552CONFIG_DRM_SUN8I_DW_HDMI=m
551CONFIG_DRM_SUN8I_MIXER=m553CONFIG_DRM_SUN8I_MIXER=m
552CONFIG_DRM_MSM=m554CONFIG_DRM_MSM=m
@@ -681,7 +683,7 @@ CONFIG_RTC_DRV_SNVS=m · 128 unmodified lines
681CONFIG_RTC_DRV_IMX_SC=m683CONFIG_RTC_DRV_IMX_SC=m
682CONFIG_RTC_DRV_XGENE=y684CONFIG_RTC_DRV_XGENE=y
683CONFIG_DMADEVICES=y685CONFIG_DMADEVICES=y
684CONFIG_DMA_BCM2835=m686CONFIG_DMA_BCM2835=y
685CONFIG_DMA_SUN6I=m687CONFIG_DMA_SUN6I=m
686CONFIG_FSL_EDMA=y688CONFIG_FSL_EDMA=y
687CONFIG_IMX_SDMA=y689CONFIG_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
32 isb();32 isb();
33}33}
34 34
35static inline void gic_write_dir(u32 irq)35static __always_inline void gic_write_dir(u32 irq)
36{36{
37 write_sysreg_s(irq, SYS_ICC_DIR_EL1);37 write_sysreg_s(irq, SYS_ICC_DIR_EL1);
38 isb();38 isb();
arch/arm64/include/asm/cache.h+1−1
@@ -69,7 +69,7 @@ static inline int icache_is_aliasing(void) · 68 unmodified lines
69 return test_bit(ICACHEF_ALIASING, &__icache_flags);69 return test_bit(ICACHEF_ALIASING, &__icache_flags);
70}70}
71 71
72static inline int icache_is_vpipt(void)72static __always_inline int icache_is_vpipt(void)
73{73{
74 return test_bit(ICACHEF_VPIPT, &__icache_flags);74 return test_bit(ICACHEF_VPIPT, &__icache_flags);
75}75}
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
145#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1145#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
146extern void flush_dcache_page(struct page *);146extern void flush_dcache_page(struct page *);
147 147
148static inline void __flush_icache_all(void)148static __always_inline void __flush_icache_all(void)
149{149{
150 if (cpus_have_const_cap(ARM64_HAS_CACHE_DIC))150 if (cpus_have_const_cap(ARM64_HAS_CACHE_DIC))
151 return;151 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
435 return cpuid_feature_extract_signed_field_width(features, field, 4);435 return cpuid_feature_extract_signed_field_width(features, field, 4);
436}436}
437 437
438static inline unsigned int __attribute_const__438static __always_inline unsigned int __attribute_const__
439cpuid_feature_extract_unsigned_field_width(u64 features, int field, int width)439cpuid_feature_extract_unsigned_field_width(u64 features, int field, int width)
440{440{
441 return (u64)(features << (64 - width - field)) >> (64 - width);441 return (u64)(features << (64 - width - field)) >> (64 - width);
442}442}
443 443
444static inline unsigned int __attribute_const__444static __always_inline unsigned int __attribute_const__
445cpuid_feature_extract_unsigned_field(u64 features, int field)445cpuid_feature_extract_unsigned_field(u64 features, int field)
446{446{
447 return cpuid_feature_extract_unsigned_field_width(features, field, 4);447 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
564 return val == 0x1;564 return val == 0x1;
565}565}
566 566
567static inline bool system_supports_fpsimd(void)567static __always_inline bool system_supports_fpsimd(void)
568{568{
569 return !cpus_have_const_cap(ARM64_HAS_NO_FPSIMD);569 return !cpus_have_const_cap(ARM64_HAS_NO_FPSIMD);
570}570}
@@ -575,13 +575,13 @@ static inline bool system_uses_ttbr0_pan(void) · 4 unmodified lines
575 !cpus_have_const_cap(ARM64_HAS_PAN);575 !cpus_have_const_cap(ARM64_HAS_PAN);
576}576}
577 577
578static inline bool system_supports_sve(void)578static __always_inline bool system_supports_sve(void)
579{579{
580 return IS_ENABLED(CONFIG_ARM64_SVE) &&580 return IS_ENABLED(CONFIG_ARM64_SVE) &&
581 cpus_have_const_cap(ARM64_SVE);581 cpus_have_const_cap(ARM64_SVE);
582}582}
583 583
584static inline bool system_supports_cnp(void)584static __always_inline bool system_supports_cnp(void)
585{585{
586 return IS_ENABLED(CONFIG_ARM64_CNP) &&586 return IS_ENABLED(CONFIG_ARM64_CNP) &&
587 cpus_have_const_cap(ARM64_HAS_CNP);587 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
33 33
34asmlinkage void enter_from_user_mode(void);34asmlinkage void enter_from_user_mode(void);
35void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);35void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
36void do_sp_pc_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs);
37void do_undefinstr(struct pt_regs *regs);36void do_undefinstr(struct pt_regs *regs);
38asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr);37asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr);
39void do_debug_exception(unsigned long addr_if_watchpoint, unsigned int esr,38void 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
47void do_cp15instr(unsigned int esr, struct pt_regs *regs);46void do_cp15instr(unsigned int esr, struct pt_regs *regs);
48void do_el0_svc(struct pt_regs *regs);47void do_el0_svc(struct pt_regs *regs);
49void do_el0_svc_compat(struct pt_regs *regs);48void do_el0_svc_compat(struct pt_regs *regs);
50void do_el0_ia_bp_hardening(unsigned long addr, unsigned int esr,
51 struct pt_regs *regs);
52
53#endif /* __ASM_EXCEPTION_H */49#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
34}34}
35 35
36#define __raw_writel __raw_writel36#define __raw_writel __raw_writel
37static inline void __raw_writel(u32 val, volatile void __iomem *addr)37static __always_inline void __raw_writel(u32 val, volatile void __iomem *addr)
38{38{
39 asm volatile("str %w0, [%1]" : : "rZ" (val), "r" (addr));39 asm volatile("str %w0, [%1]" : : "rZ" (val), "r" (addr));
40}40}
@@ -69,7 +69,7 @@ static inline u16 __raw_readw(const volatile void __iomem *addr) · 28 unmodified lines
69}69}
70 70
71#define __raw_readl __raw_readl71#define __raw_readl __raw_readl
72static inline u32 __raw_readl(const volatile void __iomem *addr)72static __always_inline u32 __raw_readl(const volatile void __iomem *addr)
73{73{
74 u32 val;74 u32 val;
75 asm volatile(ALTERNATIVE("ldr %w0, [%1]",75 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
36void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr);36void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr);
37void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr);37void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr);
38 38
39static inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu)39static __always_inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu)
40{40{
41 return !(vcpu->arch.hcr_el2 & HCR_RW);41 return !(vcpu->arch.hcr_el2 & HCR_RW);
42}42}
@@ -127,7 +127,7 @@ static inline void vcpu_set_vsesr(struct kvm_vcpu *vcpu, u64 vsesr) · 84 unmodified lines
127 vcpu->arch.vsesr_el2 = vsesr;127 vcpu->arch.vsesr_el2 = vsesr;
128}128}
129 129
130static inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu)130static __always_inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu)
131{131{
132 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pc;132 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pc;
133}133}
@@ -153,17 +153,17 @@ static inline void vcpu_write_elr_el1(const struct kvm_vcpu *vcpu, unsigned long · 19 unmodified lines
153 *__vcpu_elr_el1(vcpu) = v;153 *__vcpu_elr_el1(vcpu) = v;
154}154}
155 155
156static inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu)156static __always_inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu)
157{157{
158 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pstate;158 return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pstate;
159}159}
160 160
161static inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu)161static __always_inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu)
162{162{
163 return !!(*vcpu_cpsr(vcpu) & PSR_MODE32_BIT);163 return !!(*vcpu_cpsr(vcpu) & PSR_MODE32_BIT);
164}164}
165 165
166static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu)166static __always_inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu)
167{167{
168 if (vcpu_mode_is_32bit(vcpu))168 if (vcpu_mode_is_32bit(vcpu))
169 return kvm_condition_valid32(vcpu);169 return kvm_condition_valid32(vcpu);
@@ -181,13 +181,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu) · 11 unmodified lines
181 * coming from a read of ESR_EL2. Otherwise, it may give the wrong result on181 * coming from a read of ESR_EL2. Otherwise, it may give the wrong result on
182 * AArch32 with banked registers.182 * AArch32 with banked registers.
183 */183 */
184static inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu,184static __always_inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu,
185 u8 reg_num)185 u8 reg_num)
186{186{
187 return (reg_num == 31) ? 0 : vcpu_gp_regs(vcpu)->regs.regs[reg_num];187 return (reg_num == 31) ? 0 : vcpu_gp_regs(vcpu)->regs.regs[reg_num];
188}188}
189 189
190static inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num,190static __always_inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num,
191 unsigned long val)191 unsigned long val)
192{192{
193 if (reg_num != 31)193 if (reg_num != 31)
@@ -264,12 +264,12 @@ static inline bool vcpu_mode_priv(const struct kvm_vcpu *vcpu) · 70 unmodified lines
264 return mode != PSR_MODE_EL0t;264 return mode != PSR_MODE_EL0t;
265}265}
266 266
267static inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu)267static __always_inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu)
268{268{
269 return vcpu->arch.fault.esr_el2;269 return vcpu->arch.fault.esr_el2;
270}270}
271 271
272static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu)272static __always_inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu)
273{273{
274 u32 esr = kvm_vcpu_get_hsr(vcpu);274 u32 esr = kvm_vcpu_get_hsr(vcpu);
275 275
@@ -279,12 +279,12 @@ static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) · 3 unmodified lines
279 return -1;279 return -1;
280}280}
281 281
282static inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu)282static __always_inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu)
283{283{
284 return vcpu->arch.fault.far_el2;284 return vcpu->arch.fault.far_el2;
285}285}
286 286
287static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)287static __always_inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
288{288{
289 return ((phys_addr_t)vcpu->arch.fault.hpfar_el2 & HPFAR_MASK) << 8;289 return ((phys_addr_t)vcpu->arch.fault.hpfar_el2 & HPFAR_MASK) << 8;
290}290}
@@ -299,7 +299,7 @@ static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu) · 8 unmodified lines
299 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;299 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
300}300}
301 301
302static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)302static __always_inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
303{303{
304 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);304 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_ISV);
305}305}
@@ -319,17 +319,17 @@ static inline bool kvm_vcpu_dabt_issf(const struct kvm_vcpu *vcpu) · 13 unmodified lines
319 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SF);319 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SF);
320}320}
321 321
322static inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)322static __always_inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
323{323{
324 return (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT;324 return (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT;
325}325}
326 326
327static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)327static __always_inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
328{328{
329 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);329 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW);
330}330}
331 331
332static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)332static __always_inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
333{333{
334 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||334 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) ||
335 kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */335 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
340 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);340 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM);
341}341}
342 342
343static inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)343static __always_inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)
344{344{
345 return 1 << ((kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SAS) >> ESR_ELx_SAS_SHIFT);345 return 1 << ((kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SAS) >> ESR_ELx_SAS_SHIFT);
346}346}
347 347
348/* This one is not specific to Data Abort */348/* This one is not specific to Data Abort */
349static inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu)349static __always_inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu)
350{350{
351 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_IL);351 return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_IL);
352}352}
353 353
354static inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu)354static __always_inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu)
355{355{
356 return ESR_ELx_EC(kvm_vcpu_get_hsr(vcpu));356 return ESR_ELx_EC(kvm_vcpu_get_hsr(vcpu));
357}357}
@@ -361,17 +361,17 @@ static inline bool kvm_vcpu_trap_is_iabt(const struct kvm_vcpu *vcpu) · 3 unmodified lines
361 return kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_IABT_LOW;361 return kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_IABT_LOW;
362}362}
363 363
364static inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)364static __always_inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)
365{365{
366 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC;366 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC;
367}367}
368 368
369static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)369static __always_inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
370{370{
371 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC_TYPE;371 return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC_TYPE;
372}372}
373 373
374static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)374static __always_inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
375{375{
376 switch (kvm_vcpu_trap_get_fault(vcpu)) {376 switch (kvm_vcpu_trap_get_fault(vcpu)) {
377 case FSC_SEA:377 case FSC_SEA:
@@ -390,7 +390,7 @@ static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) · 12 unmodified lines
390 }390 }
391}391}
392 392
393static inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)393static __always_inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)
394{394{
395 u32 esr = kvm_vcpu_get_hsr(vcpu);395 u32 esr = kvm_vcpu_get_hsr(vcpu);
396 return ESR_ELx_SYS64_ISS_RT(esr);396 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
504 return data; /* Leave LE untouched */504 return data; /* Leave LE untouched */
505}505}
506 506
507static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)507static __always_inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr)
508{508{
509 if (vcpu_mode_is_32bit(vcpu))509 if (vcpu_mode_is_32bit(vcpu))
510 kvm_skip_instr32(vcpu, is_wide_instr);510 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
519 * Skip an instruction which has been emulated at hyp while most guest sysregs519 * Skip an instruction which has been emulated at hyp while most guest sysregs
520 * are live.520 * are live.
521 */521 */
522static inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu)522static __always_inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu)
523{523{
524 *vcpu_pc(vcpu) = read_sysreg_el2(SYS_ELR);524 *vcpu_pc(vcpu) = read_sysreg_el2(SYS_ELR);
525 vcpu->arch.ctxt.gp_regs.regs.pstate = read_sysreg_el2(SYS_SPSR);525 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
626static inline void kvm_clr_pmu_events(u32 clr) {}626static inline void kvm_clr_pmu_events(u32 clr) {}
627#endif627#endif
628 628
629static 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
645static 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
661#define KVM_BP_HARDEN_UNKNOWN -1629#define KVM_BP_HARDEN_UNKNOWN -1
662#define KVM_BP_HARDEN_WA_NEEDED 0630#define KVM_BP_HARDEN_WA_NEEDED 0
663#define KVM_BP_HARDEN_NOT_REQUIRED 1631#define KVM_BP_HARDEN_NOT_REQUIRED 1
arch/arm64/include/asm/kvm_hyp.h+7−0
@@ -47,6 +47,13 @@ · 46 unmodified lines
47#define read_sysreg_el2(r) read_sysreg_elx(r, _EL2, _EL1)47#define read_sysreg_el2(r) read_sysreg_elx(r, _EL2, _EL1)
48#define write_sysreg_el2(v,r) write_sysreg_elx(v, r, _EL2, _EL1)48#define write_sysreg_el2(v,r) write_sysreg_elx(v, r, _EL2, _EL1)
49 49
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
50int __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu);57int __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu);
51 58
52void __vgic_v3_save_state(struct kvm_vcpu *vcpu);59void __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
93 __le32 *origptr, __le32 *updptr, int nr_inst);93 __le32 *origptr, __le32 *updptr, int nr_inst);
94void kvm_compute_layout(void);94void kvm_compute_layout(void);
95 95
96static inline unsigned long __kern_hyp_va(unsigned long v)96static __always_inline unsigned long __kern_hyp_va(unsigned long v)
97{97{
98 asm volatile(ALTERNATIVE_CB("and %0, %0, #1\n"98 asm volatile(ALTERNATIVE_CB("and %0, %0, #1\n"
99 "ror %0, %0, #1\n"99 "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
473extern void *__kvm_bp_vect_base;473extern void *__kvm_bp_vect_base;
474extern int __kvm_harden_el2_vector_slot;474extern int __kvm_harden_el2_vector_slot;
475 475
476/* This is only called on a VHE system */
476static inline void *kvm_get_hyp_vector(void)477static inline void *kvm_get_hyp_vector(void)
477{478{
478 struct bp_hardening_data *data = arm64_get_bp_hardening_data();479 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
6 6
7#ifdef CONFIG_ARM64_LSE_ATOMICS7#ifdef CONFIG_ARM64_LSE_ATOMICS
8 8
9#define __LSE_PREAMBLE ".arch armv8-a+lse\n"9#define __LSE_PREAMBLE ".arch_extension lse\n"
10 10
11#include <linux/compiler_types.h>11#include <linux/compiler_types.h>
12#include <linux/export.h>12#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
213 ((__force __typeof__(addr))sign_extend64((__force u64)(addr), 55))213 ((__force __typeof__(addr))sign_extend64((__force u64)(addr), 55))
214 214
215#define untagged_addr(addr) ({ \215#define untagged_addr(addr) ({ \
216 u64 __addr = (__force u64)addr; \216 u64 __addr = (__force u64)(addr); \
217 __addr &= __untagged_addr(__addr); \217 __addr &= __untagged_addr(__addr); \
218 (__force __typeof__(addr))__addr; \218 (__force __typeof__(addr))__addr; \
219})219})
arch/arm64/include/asm/spinlock.h+5−1
@@ -18,6 +18,10 @@ · 17 unmodified lines
18 * See:18 * See:
19 * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net19 * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net
20 */20 */
21#define vcpu_is_preempted(cpu) false21#define vcpu_is_preempted vcpu_is_preempted
22static inline bool vcpu_is_preempted(int cpu)
23{
24 return false;
25}
22 26
23#endif /* __ASM_SPINLOCK_H */27#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
83 return read_sysreg(CurrentEL) == CurrentEL_EL2;83 return read_sysreg(CurrentEL) == CurrentEL_EL2;
84}84}
85 85
86static inline bool has_vhe(void)86static __always_inline bool has_vhe(void)
87{87{
88 if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))88 if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN))
89 return true;89 return true;
arch/arm64/kernel/kaslr.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <linux/sched.h>11#include <linux/sched.h>
12#include <linux/types.h>12#include <linux/types.h>
13 13
14#include <asm/archrandom.h>
14#include <asm/cacheflush.h>15#include <asm/cacheflush.h>
15#include <asm/fixmap.h>16#include <asm/fixmap.h>
16#include <asm/kernel-pgtable.h>17#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
466 if (unlikely(next->flags & PF_KTHREAD))466 if (unlikely(next->flags & PF_KTHREAD))
467 return;467 return;
468 468
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
469 /* If the mitigation is enabled, then we leave SSBS clear. */476 /* If the mitigation is enabled, then we leave SSBS clear. */
470 if ((arm64_get_ssbd_state() == ARM64_SSBD_FORCE_ENABLE) ||477 if ((arm64_get_ssbd_state() == ARM64_SSBD_FORCE_ENABLE) ||
471 test_tsk_thread_flag(next, TIF_SSBD))478 test_tsk_thread_flag(next, TIF_SSBD))
@@ -608,8 +615,6 @@ long get_tagged_addr_ctrl(void) · 136 unmodified lines
608 * only prevents the tagged address ABI enabling via prctl() and does not615 * only prevents the tagged address ABI enabling via prctl() and does not
609 * disable it for tasks that already opted in to the relaxed ABI.616 * disable it for tasks that already opted in to the relaxed ABI.
610 */617 */
611static int zero;
612static int one = 1;
613 618
614static struct ctl_table tagged_addr_sysctl_table[] = {619static struct ctl_table tagged_addr_sysctl_table[] = {
615 {620 {
@@ -618,8 +623,8 @@ static struct ctl_table tagged_addr_sysctl_table[] = { · 2 unmodified lines
618 .data = &tagged_addr_disabled,623 .data = &tagged_addr_disabled,
619 .maxlen = sizeof(int),624 .maxlen = sizeof(int),
620 .proc_handler = proc_dointvec_minmax,625 .proc_handler = proc_dointvec_minmax,
621 .extra1 = &zero,626 .extra1 = SYSCTL_ZERO,
622 .extra2 = &one,627 .extra2 = SYSCTL_ONE,
623 },628 },
624 { }629 { }
625};630};
arch/arm64/kernel/time.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23#include <linux/irq.h>23#include <linux/irq.h>
24#include <linux/delay.h>24#include <linux/delay.h>
25#include <linux/clocksource.h>25#include <linux/clocksource.h>
26#include <linux/clk-provider.h>26#include <linux/of_clk.h>
27#include <linux/acpi.h>27#include <linux/acpi.h>
28 28
29#include <clocksource/arm_arch_timer.h>29#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
625}625}
626 626
627/* Switch to the guest for VHE systems running in EL2 */627/* Switch to the guest for VHE systems running in EL2 */
628int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)628static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
629{629{
630 struct kvm_cpu_context *host_ctxt;630 struct kvm_cpu_context *host_ctxt;
631 struct kvm_cpu_context *guest_ctxt;631 struct kvm_cpu_context *guest_ctxt;
@@ -678,7 +678,42 @@ int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) · 46 unmodified lines
678 678
679 return exit_code;679 return exit_code;
680}680}
681NOKPROBE_SYMBOL(kvm_vcpu_run_vhe);681NOKPROBE_SYMBOL(__kvm_vcpu_run_vhe);
682
683int 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}
682 717
683/* Switch to the guest for legacy non-VHE systems */718/* Switch to the guest for legacy non-VHE systems */
684int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)719int __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
69 u32 data = vcpu_get_reg(vcpu, rd);69 u32 data = vcpu_get_reg(vcpu, rd);
70 if (__is_be(vcpu)) {70 if (__is_be(vcpu)) {
71 /* guest pre-swabbed data, undo this for writel() */71 /* guest pre-swabbed data, undo this for writel() */
72 data = swab32(data);72 data = __kvm_swab32(data);
73 }73 }
74 writel_relaxed(data, addr);74 writel_relaxed(data, addr);
75 } else {75 } else {
76 u32 data = readl_relaxed(addr);76 u32 data = readl_relaxed(addr);
77 if (__is_be(vcpu)) {77 if (__is_be(vcpu)) {
78 /* guest expects swabbed data */78 /* guest expects swabbed data */
79 data = swab32(data);79 data = __kvm_swab32(data);
80 }80 }
81 vcpu_set_reg(vcpu, rd, data);81 vcpu_set_reg(vcpu, rd, data);
82 }82 }
arch/csky/Kconfig+48−3
@@ -9,7 +9,6 @@ config CSKY · 8 unmodified lines
9 select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>29 select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2
10 select COMMON_CLK10 select COMMON_CLK
11 select CLKSRC_MMIO11 select CLKSRC_MMIO
12 select CLKSRC_OF
13 select CSKY_MPINTC if CPU_CK86012 select CSKY_MPINTC if CPU_CK860
14 select CSKY_MP_TIMER if CPU_CK86013 select CSKY_MP_TIMER if CPU_CK860
15 select CSKY_APB_INTC14 select CSKY_APB_INTC
@@ -37,6 +36,7 @@ config CSKY · 21 unmodified lines
37 select GX6605S_TIMER if CPU_CK61036 select GX6605S_TIMER if CPU_CK610
38 select HAVE_ARCH_TRACEHOOK37 select HAVE_ARCH_TRACEHOOK
39 select HAVE_ARCH_AUDITSYSCALL38 select HAVE_ARCH_AUDITSYSCALL
39 select HAVE_COPY_THREAD_TLS
40 select HAVE_DYNAMIC_FTRACE40 select HAVE_DYNAMIC_FTRACE
41 select HAVE_FUNCTION_TRACER41 select HAVE_FUNCTION_TRACER
42 select HAVE_FUNCTION_GRAPH_TRACER42 select HAVE_FUNCTION_GRAPH_TRACER
@@ -47,8 +47,8 @@ config CSKY · 4 unmodified lines
47 select HAVE_PERF_EVENTS47 select HAVE_PERF_EVENTS
48 select HAVE_PERF_REGS48 select HAVE_PERF_REGS
49 select HAVE_PERF_USER_STACK_DUMP49 select HAVE_PERF_USER_STACK_DUMP
50 select HAVE_DMA_API_DEBUG
51 select HAVE_DMA_CONTIGUOUS50 select HAVE_DMA_CONTIGUOUS
51 select HAVE_STACKPROTECTOR
52 select HAVE_SYSCALL_TRACEPOINTS52 select HAVE_SYSCALL_TRACEPOINTS
53 select MAY_HAVE_SPARSE_IRQ53 select MAY_HAVE_SPARSE_IRQ
54 select MODULES_USE_ELF_RELA if MODULES54 select MODULES_USE_ELF_RELA if MODULES
@@ -59,6 +59,11 @@ config CSKY · 4 unmodified lines
59 select TIMER_OF59 select TIMER_OF
60 select USB_ARCH_HAS_EHCI60 select USB_ARCH_HAS_EHCI
61 select USB_ARCH_HAS_OHCI61 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
62 67
63config CPU_HAS_CACHEV268config CPU_HAS_CACHEV2
64 bool69 bool
@@ -75,7 +80,7 @@ config CPU_HAS_TLBI · 10 unmodified lines
75config CPU_HAS_LDSTEX80config CPU_HAS_LDSTEX
76 bool81 bool
77 help82 help
78 For SMP, CPU needs "ldex&stex" instrcutions to atomic operations.83 For SMP, CPU needs "ldex&stex" instructions for atomic operations.
79 84
80config CPU_NEED_TLBSYNC85config CPU_NEED_TLBSYNC
81 bool86 bool
@@ -188,6 +193,40 @@ config CPU_PM_STOP · 106 unmodified lines
188 bool "stop"193 bool "stop"
189endchoice194endchoice
190 195
196menuconfig 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
205if HAVE_TCM
206config ITCM_RAM_BASE
207 hex "ITCM ram base"
208 default 0xffffffff
209
210config ITCM_NR_PAGES
211 int "Page count of ITCM size: NR*4KB"
212 range 1 256
213 default 32
214
215config HAVE_DTCM
216 bool "DTCM Support"
217
218config DTCM_RAM_BASE
219 hex "DTCM ram base"
220 depends on HAVE_DTCM
221 default 0xffffffff
222
223config DTCM_NR_PAGES
224 int "Page count of DTCM size: NR*4KB"
225 depends on HAVE_DTCM
226 range 1 256
227 default 32
228endif
229
191config CPU_HAS_VDSP230config CPU_HAS_VDSP
192 bool "CPU has VDSP coprocessor"231 bool "CPU has VDSP coprocessor"
193 depends on CPU_HAS_FPU && CPU_HAS_FPUV2232 depends on CPU_HAS_FPU && CPU_HAS_FPUV2
@@ -196,6 +235,10 @@ config CPU_HAS_FPU · 2 unmodified lines
196 bool "CPU has FPU coprocessor"235 bool "CPU has FPU coprocessor"
197 depends on CPU_CK807 || CPU_CK810 || CPU_CK860236 depends on CPU_CK807 || CPU_CK810 || CPU_CK860
198 237
238config CPU_HAS_ICACHE_INS
239 bool "CPU has Icache invalidate instructions"
240 depends on CPU_HAS_CACHEV2
241
199config CPU_HAS_TEE242config CPU_HAS_TEE
200 bool "CPU has Trusted Execution Environment"243 bool "CPU has Trusted Execution Environment"
201 depends on CPU_CK810244 depends on CPU_CK810
@@ -235,4 +278,6 @@ config HOTPLUG_CPU · 33 unmodified lines
235 Say N if you want to disable CPU hotplug.278 Say N if you want to disable CPU hotplug.
236endmenu279endmenu
237 280
281source "arch/csky/Kconfig.platforms"
282
238source "kernel/Kconfig.hz"283source "kernel/Kconfig.hz"
arch/csky/Kconfig.platforms+9−0
@@ -0,0 +1,9 @@
1menu "Platform drivers selection"
2
3config 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
9endmenu
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
48 48
49#define flush_icache_page(vma, page) do {} while (0);49#define flush_icache_page(vma, page) do {} while (0);
50#define flush_icache_range(start, end) cache_wbinv_range(start, end)50#define flush_icache_range(start, end) cache_wbinv_range(start, end)
51 51#define flush_icache_mm_range(mm, start, end) cache_wbinv_range(start, end)
52#define flush_icache_user_range(vma,page,addr,len) \52#define flush_icache_deferred(mm) do {} while (0);
53 flush_dcache_page(page)
54 53
55#define copy_from_user_page(vma, page, vaddr, dst, src, len) \54#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
56do { \55do { \
arch/csky/abiv1/inc/abi/entry.h+14−5
@@ -16,14 +16,16 @@ · 15 unmodified lines
16#define LSAVE_A4 4016#define LSAVE_A4 40
17#define LSAVE_A5 4417#define LSAVE_A5 44
18 18
19#define usp ss1
20
19.macro USPTOKSP21.macro USPTOKSP
20 mtcr sp, ss122 mtcr sp, usp
21 mfcr sp, ss023 mfcr sp, ss0
22.endm24.endm
23 25
24.macro KSPTOUSP26.macro KSPTOUSP
25 mtcr sp, ss027 mtcr sp, ss0
26 mfcr sp, ss128 mfcr sp, usp
27.endm29.endm
28 30
29.macro SAVE_ALL epc_inc31.macro SAVE_ALL epc_inc
@@ -45,7 +47,13 @@ · 15 unmodified lines
45 add lr, r1347 add lr, r13
46 stw lr, (sp, 8)48 stw lr, (sp, 8)
47 49
50 mov lr, sp
51 addi lr, 32
52 addi lr, 32
53 addi lr, 16
54 bt 2f
48 mfcr lr, ss155 mfcr lr, ss1
562:
49 stw lr, (sp, 16)57 stw lr, (sp, 16)
50 58
51 stw a0, (sp, 20)59 stw a0, (sp, 20)
@@ -79,9 +87,10 @@ · 27 unmodified lines
79 ldw a0, (sp, 12)87 ldw a0, (sp, 12)
80 mtcr a0, epsr88 mtcr a0, epsr
81 btsti a0, 3189 btsti a0, 31
90 bt 1f
82 ldw a0, (sp, 16)91 ldw a0, (sp, 16)
83 mtcr a0, ss192 mtcr a0, ss1
84 931:
85 ldw a0, (sp, 24)94 ldw a0, (sp, 24)
86 ldw a1, (sp, 28)95 ldw a1, (sp, 28)
87 ldw a2, (sp, 32)96 ldw a2, (sp, 32)
@@ -102,9 +111,9 @@ · 14 unmodified lines
102 addi sp, 32111 addi sp, 32
103 addi sp, 8112 addi sp, 8
104 113
105 bt 1f114 bt 2f
106 KSPTOUSP115 KSPTOUSP
1071:1162:
108 rte117 rte
109.endm118.endm
110 119
arch/csky/abiv2/cacheflush.c+59−25
@@ -6,46 +6,80 @@ · 5 unmodified lines
6#include <linux/mm.h>6#include <linux/mm.h>
7#include <asm/cache.h>7#include <asm/cache.h>
8 8
9void flush_icache_page(struct vm_area_struct *vma, struct page *page)9void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
10 pte_t *pte)
10{11{
11 unsigned long start;12 unsigned long addr;
13 struct page *page;
12 14
13 start = (unsigned long) kmap_atomic(page);15 page = pfn_to_page(pte_pfn(*pte));
16 if (page == ZERO_PAGE(0))
17 return;
14 18
15 cache_wbinv_range(start, start + PAGE_SIZE);19 if (test_and_set_bit(PG_dcache_clean, &page->flags))
20 return;
16 21
17 kunmap_atomic((void *)start);22 addr = (unsigned long) kmap_atomic(page);
18}
19 23
20void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,24 dcache_wb_range(addr, addr + PAGE_SIZE);
21 unsigned long vaddr, int len)
22{
23 unsigned long kaddr;
24 25
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}
26 31
27 cache_wbinv_range(kaddr, kaddr + len);32void flush_icache_deferred(struct mm_struct *mm)
33{
34 unsigned int cpu = smp_processor_id();
35 cpumask_t *mask = &mm->context.icache_stale_mask;
28 36
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 }
30}46}
31 47
32void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,48void flush_icache_mm_range(struct mm_struct *mm,
33 pte_t *pte)49 unsigned long start, unsigned long end)
34{50{
35 unsigned long addr, pfn;51 unsigned int cpu;
36 struct page *page;52 cpumask_t others, *mask;
37 53
38 pfn = pte_pfn(*pte);54 preempt_disable();
39 if (unlikely(!pfn_valid(pfn)))
40 return;
41 55
42 page = pfn_to_page(pfn);56#ifdef CONFIG_CPU_HAS_ICACHE_INS
43 if (page == ZERO_PAGE(0))57 if (mm == current->mm) {
58 icache_inv_range(start, end);
59 preempt_enable();
44 return;60 return;
61 }
62#endif
45 63
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);
47 67
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);
49 72
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();
51}85}
arch/csky/abiv2/inc/abi/cacheflush.h+21−12
@@ -13,24 +13,27 @@ · 12 unmodified lines
13#define flush_cache_all() do { } while (0)13#define flush_cache_all() do { } while (0)
14#define flush_cache_mm(mm) do { } while (0)14#define flush_cache_mm(mm) do { } while (0)
15#define flush_cache_dup_mm(mm) do { } while (0)15#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)
16 18
17#define flush_cache_range(vma, start, end) \19#define PG_dcache_clean PG_arch_1
18 do { \20
19 if (vma->vm_flags & VM_EXEC) \21#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
20 icache_inv_all(); \22static inline void flush_dcache_page(struct page *page)
21 } while (0)23{
24 if (test_bit(PG_dcache_clean, &page->flags))
25 clear_bit(PG_dcache_clean, &page->flags);
26}
22 27
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)
26#define flush_dcache_mmap_lock(mapping) do { } while (0)28#define flush_dcache_mmap_lock(mapping) do { } while (0)
27#define flush_dcache_mmap_unlock(mapping) do { } while (0)29#define flush_dcache_mmap_unlock(mapping) do { } while (0)
30#define flush_icache_page(vma, page) do { } while (0)
28 31
29#define flush_icache_range(start, end) cache_wbinv_range(start, end)32#define flush_icache_range(start, end) cache_wbinv_range(start, end)
30 33
31void flush_icache_page(struct vm_area_struct *vma, struct page *page);34void flush_icache_mm_range(struct mm_struct *mm,
32void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,35 unsigned long start, unsigned long end);
33 unsigned long vaddr, int len);36void flush_icache_deferred(struct mm_struct *mm);
34 37
35#define flush_cache_vmap(start, end) do { } while (0)38#define flush_cache_vmap(start, end) do { } while (0)
36#define flush_cache_vunmap(start, end) do { } while (0)39#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
38#define copy_to_user_page(vma, page, vaddr, dst, src, len) \41#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
39do { \42do { \
40 memcpy(dst, src, len); \43 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 } \
42} while (0)51} while (0)
43#define copy_from_user_page(vma, page, vaddr, dst, src, len) \52#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
44 memcpy(dst, src, len)53 memcpy(dst, src, len)
arch/csky/abiv2/inc/abi/entry.h+11−0
@@ -31,7 +31,13 @@ · 30 unmodified lines
31 31
32 mfcr lr, epsr32 mfcr lr, epsr
33 stw lr, (sp, 12)33 stw lr, (sp, 12)
34 btsti lr, 31
35 bf 1f
36 addi lr, sp, 152
37 br 2f
381:
34 mfcr lr, usp39 mfcr lr, usp
402:
35 stw lr, (sp, 16)41 stw lr, (sp, 16)
36 42
37 stw a0, (sp, 20)43 stw a0, (sp, 20)
@@ -64,8 +70,10 @@ · 26 unmodified lines
64 mtcr a0, epc70 mtcr a0, epc
65 ldw a0, (sp, 12)71 ldw a0, (sp, 12)
66 mtcr a0, epsr72 mtcr a0, epsr
73 btsti a0, 31
67 ldw a0, (sp, 16)74 ldw a0, (sp, 16)
68 mtcr a0, usp75 mtcr a0, usp
76 mtcr a0, ss0
69 77
70#ifdef CONFIG_CPU_HAS_HILO78#ifdef CONFIG_CPU_HAS_HILO
71 ldw a0, (sp, 140)79 ldw a0, (sp, 140)
@@ -86,6 +94,9 @@ · 14 unmodified lines
86 addi sp, 4094 addi sp, 40
87 ldm r16-r30, (sp)95 ldm r16-r30, (sp)
88 addi sp, 7296 addi sp, 72
97 bf 1f
98 mfcr sp, ss0
991:
89 rte100 rte
90.endm101.endm
91 102
arch/csky/configs/defconfig+0−8
@@ -10,9 +10,6 @@ CONFIG_BSD_PROCESS_ACCT=y · 9 unmodified lines
10CONFIG_BSD_PROCESS_ACCT_V3=y10CONFIG_BSD_PROCESS_ACCT_V3=y
11CONFIG_MODULES=y11CONFIG_MODULES=y
12CONFIG_MODULE_UNLOAD=y12CONFIG_MODULE_UNLOAD=y
13CONFIG_DEFAULT_DEADLINE=y
14CONFIG_CPU_CK807=y
15CONFIG_CPU_HAS_FPU=y
16CONFIG_NET=y13CONFIG_NET=y
17CONFIG_PACKET=y14CONFIG_PACKET=y
18CONFIG_UNIX=y15CONFIG_UNIX=y
@@ -27,10 +24,7 @@ CONFIG_SERIAL_NONSTANDARD=y · 8 unmodified lines
27CONFIG_SERIAL_8250=y24CONFIG_SERIAL_8250=y
28CONFIG_SERIAL_8250_CONSOLE=y25CONFIG_SERIAL_8250_CONSOLE=y
29CONFIG_SERIAL_OF_PLATFORM=y26CONFIG_SERIAL_OF_PLATFORM=y
30CONFIG_TTY_PRINTK=y
31# CONFIG_VGA_CONSOLE is not set27# CONFIG_VGA_CONSOLE is not set
32CONFIG_CSKY_MPTIMER=y
33CONFIG_GX6605S_TIMER=y
34CONFIG_PM_DEVFREQ=y28CONFIG_PM_DEVFREQ=y
35CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y29CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
36CONFIG_DEVFREQ_GOV_PERFORMANCE=y30CONFIG_DEVFREQ_GOV_PERFORMANCE=y
@@ -56,6 +50,4 @@ CONFIG_CRAMFS=y · 19 unmodified lines
56CONFIG_ROMFS_FS=y50CONFIG_ROMFS_FS=y
57CONFIG_NFS_FS=y51CONFIG_NFS_FS=y
58CONFIG_PRINTK_TIME=y52CONFIG_PRINTK_TIME=y
59CONFIG_DEBUG_INFO=y
60CONFIG_DEBUG_FS=y
61CONFIG_MAGIC_SYSRQ=y53CONFIG_MAGIC_SYSRQ=y
arch/csky/include/asm/Kbuild+0−1
@@ -28,7 +28,6 @@ generic-y += local64.h · 27 unmodified lines
28generic-y += mm-arch-hooks.h28generic-y += mm-arch-hooks.h
29generic-y += mmiowb.h29generic-y += mmiowb.h
30generic-y += module.h30generic-y += module.h
31generic-y += pci.h
32generic-y += percpu.h31generic-y += percpu.h
33generic-y += preempt.h32generic-y += preempt.h
34generic-y += qrwlock.h33generic-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
16 16
17void icache_inv_range(unsigned long start, unsigned long end);17void icache_inv_range(unsigned long start, unsigned long end);
18void icache_inv_all(void);18void icache_inv_all(void);
19void local_icache_inv_all(void *priv);
19 20
20void dcache_wb_range(unsigned long start, unsigned long end);21void dcache_wb_range(unsigned long start, unsigned long end);
21void dcache_wbinv_all(void);22void dcache_wbinv_all(void);
arch/csky/include/asm/cacheflush.h+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
4#ifndef __ASM_CSKY_CACHEFLUSH_H4#ifndef __ASM_CSKY_CACHEFLUSH_H
5#define __ASM_CSKY_CACHEFLUSH_H5#define __ASM_CSKY_CACHEFLUSH_H
6 6
7#include <linux/mm.h>
7#include <abi/cacheflush.h>8#include <abi/cacheflush.h>
8 9
9#endif /* __ASM_CSKY_CACHEFLUSH_H */10#endif /* __ASM_CSKY_CACHEFLUSH_H */
arch/csky/include/asm/fixmap.h+8−1
@@ -5,12 +5,16 @@ · 4 unmodified lines
5#define __ASM_CSKY_FIXMAP_H5#define __ASM_CSKY_FIXMAP_H
6 6
7#include <asm/page.h>7#include <asm/page.h>
8#include <asm/memory.h>
8#ifdef CONFIG_HIGHMEM9#ifdef CONFIG_HIGHMEM
9#include <linux/threads.h>10#include <linux/threads.h>
10#include <asm/kmap_types.h>11#include <asm/kmap_types.h>
11#endif12#endif
12 13
13enum fixed_addresses {14enum fixed_addresses {
15#ifdef CONFIG_HAVE_TCM
16 FIX_TCM = TCM_NR_PAGES,
17#endif
14#ifdef CONFIG_HIGHMEM18#ifdef CONFIG_HIGHMEM
15 FIX_KMAP_BEGIN,19 FIX_KMAP_BEGIN,
16 FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,20 FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
@@ -18,10 +22,13 @@ enum fixed_addresses { · 1 unmodified line
18 __end_of_fixed_addresses22 __end_of_fixed_addresses
19};23};
20 24
21#define FIXADDR_TOP 0xffffc000
22#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)25#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
23#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)26#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
24 27
25#include <asm-generic/fixmap.h>28#include <asm-generic/fixmap.h>
26 29
30extern void fixrange_init(unsigned long start, unsigned long end,
31 pgd_t *pgd_base);
32extern void __init fixaddr_init(void);
33
27#endif /* __ASM_CSKY_FIXMAP_H */34#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
7typedef struct {7typedef struct {
8 atomic64_t asid;8 atomic64_t asid;
9 void *vdso;9 void *vdso;
10 cpumask_t icache_stale_mask;
10} mm_context_t;11} mm_context_t;
11 12
12#endif /* __ASM_CSKY_MMU_H */13#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
43 43
44 TLBMISS_HANDLER_SETUP_PGD(next->pgd);44 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
45 write_mmu_entryhi(next->context.asid.counter);45 write_mmu_entryhi(next->context.asid.counter);
46
47 flush_icache_deferred(next);
46}48}
47#endif /* __ASM_CSKY_MMU_CONTEXT_H */49#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
18extern int isa_dma_bridge_buggy;
19
20#ifdef CONFIG_PCI
21static 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
27static 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
5#define __ASM_CSKY_PGTABLE_H5#define __ASM_CSKY_PGTABLE_H
6 6
7#include <asm/fixmap.h>7#include <asm/fixmap.h>
8#include <asm/memory.h>
8#include <asm/addrspace.h>9#include <asm/addrspace.h>
9#include <abi/pgtable-bits.h>10#include <abi/pgtable-bits.h>
10#include <asm-generic/pgtable-nopmd.h>11#include <asm-generic/pgtable-nopmd.h>
@@ -16,11 +17,6 @@ · 5 unmodified lines
16#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)17#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
17#define FIRST_USER_ADDRESS 0UL18#define FIRST_USER_ADDRESS 0UL
18 19
19#define PKMAP_BASE (0xff800000)
20
21#define VMALLOC_START (0xc0008000)
22#define VMALLOC_END (PKMAP_BASE - 2*PAGE_SIZE)
23
24/*20/*
25 * C-SKY is two-level paging structure:21 * C-SKY is two-level paging structure:
26 */22 */
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
8extern 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 */
16static __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
21void *tcm_alloc(size_t len);
22void tcm_free(void *addr, size_t len);
23
24#endif
arch/csky/include/uapi/asm/unistd.h+3−0
@@ -1,7 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.2// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
3 3
4#define __ARCH_WANT_STAT64
5#define __ARCH_WANT_NEW_STAT
4#define __ARCH_WANT_SYS_CLONE6#define __ARCH_WANT_SYS_CLONE
7#define __ARCH_WANT_SYS_CLONE3
5#define __ARCH_WANT_SET_GET_RLIMIT8#define __ARCH_WANT_SET_GET_RLIMIT
6#define __ARCH_WANT_TIME32_SYSCALLS9#define __ARCH_WANT_TIME32_SYSCALLS
7#include <asm-generic/unistd.h>10#include <asm-generic/unistd.h>
arch/csky/kernel/atomic.S+6−2
@@ -17,10 +17,12 @@ ENTRY(csky_cmpxchg) · 16 unmodified lines
17 mfcr a3, epc17 mfcr a3, epc
18 addi a3, TRAP0_SIZE18 addi a3, TRAP0_SIZE
19 19
20 subi sp, 820 subi sp, 16
21 stw a3, (sp, 0)21 stw a3, (sp, 0)
22 mfcr a3, epsr22 mfcr a3, epsr
23 stw a3, (sp, 4)23 stw a3, (sp, 4)
24 mfcr a3, usp
25 stw a3, (sp, 8)
24 26
25 psrset ee27 psrset ee
26#ifdef CONFIG_CPU_HAS_LDSTEX28#ifdef CONFIG_CPU_HAS_LDSTEX
@@ -47,7 +49,9 @@ ENTRY(csky_cmpxchg) · 20 unmodified lines
47 mtcr a3, epc49 mtcr a3, epc
48 ldw a3, (sp, 4)50 ldw a3, (sp, 4)
49 mtcr a3, epsr51 mtcr a3, epsr
50 addi sp, 852 ldw a3, (sp, 8)
53 mtcr a3, usp
54 addi sp, 16
51 KSPTOUSP55 KSPTOUSP
52 rte56 rte
53END(csky_cmpxchg)57END(csky_cmpxchg)
arch/csky/kernel/process.c+10−3
@@ -16,6 +16,12 @@ · 15 unmodified lines
16 16
17struct cpuinfo_csky cpu_data[NR_CPUS];17struct cpuinfo_csky cpu_data[NR_CPUS];
18 18
19#ifdef CONFIG_STACKPROTECTOR
20#include <linux/stackprotector.h>
21unsigned long __stack_chk_guard __read_mostly;
22EXPORT_SYMBOL(__stack_chk_guard);
23#endif
24
19asmlinkage void ret_from_fork(void);25asmlinkage void ret_from_fork(void);
20asmlinkage void ret_from_kernel_thread(void);26asmlinkage void ret_from_kernel_thread(void);
21 27
@@ -34,10 +40,11 @@ unsigned long thread_saved_pc(struct task_struct *tsk) · 12 unmodified lines
34 return sw->r15;40 return sw->r15;
35}41}
36 42
37int copy_thread(unsigned long clone_flags,43int copy_thread_tls(unsigned long clone_flags,
38 unsigned long usp,44 unsigned long usp,
39 unsigned long kthread_arg,45 unsigned long kthread_arg,
40 struct task_struct *p)46 struct task_struct *p,
47 unsigned long tls)
41{48{
42 struct switch_stack *childstack;49 struct switch_stack *childstack;
43 struct pt_regs *childregs = task_pt_regs(p);50 struct pt_regs *childregs = task_pt_regs(p);
@@ -64,7 +71,7 @@ int copy_thread(unsigned long clone_flags, · 20 unmodified lines
64 childregs->usp = usp;71 childregs->usp = usp;
65 if (clone_flags & CLONE_SETTLS)72 if (clone_flags & CLONE_SETTLS)
66 task_thread_info(p)->tp_value = childregs->tls73 task_thread_info(p)->tp_value = childregs->tls
67 = childregs->regs[0];74 = tls;
68 75
69 childregs->a0 = 0;76 childregs->a0 = 0;
70 childstack->r15 = (unsigned long) ret_from_fork;77 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
47 signed long size;47 signed long size;
48 48
49 memblock_reserve(__pa(_stext), _end - _stext);49 memblock_reserve(__pa(_stext), _end - _stext);
50#ifdef CONFIG_BLK_DEV_INITRD
51 memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
52#endif
53 50
54 early_init_fdt_reserve_self();51 early_init_fdt_reserve_self();
55 early_init_fdt_scan_reserved_mem();52 early_init_fdt_scan_reserved_mem();
@@ -133,6 +130,8 @@ void __init setup_arch(char **cmdline_p) · 77 unmodified lines
133 130
134 sparse_init();131 sparse_init();
135 132
133 fixaddr_init();
134
136#ifdef CONFIG_HIGHMEM135#ifdef CONFIG_HIGHMEM
137 kmap_init();136 kmap_init();
138#endif137#endif
arch/csky/kernel/smp.c+1−1
@@ -120,7 +120,7 @@ void __init setup_smp_ipi(void) · 119 unmodified lines
120 int rc;120 int rc;
121 121
122 if (ipi_irq == 0)122 if (ipi_irq == 0)
123 panic("%s IRQ mapping failed\n", __func__);123 return;
124 124
125 rc = request_percpu_irq(ipi_irq, handle_ipi, "IPI Interrupt",125 rc = request_percpu_irq(ipi_irq, handle_ipi, "IPI Interrupt",
126 &ipi_dummy_dev);126 &ipi_dummy_dev);
arch/csky/kernel/time.c+1−1
@@ -1,8 +1,8 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.2// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
3 3
4#include <linux/clk-provider.h>
5#include <linux/clocksource.h>4#include <linux/clocksource.h>
5#include <linux/of_clk.h>
6 6
7void __init time_init(void)7void __init time_init(void)
8{8{
arch/csky/kernel/vmlinux.lds.S+49−0
@@ -2,6 +2,7 @@ · 1 unmodified line
2 2
3#include <asm/vmlinux.lds.h>3#include <asm/vmlinux.lds.h>
4#include <asm/page.h>4#include <asm/page.h>
5#include <asm/memory.h>
5 6
6OUTPUT_ARCH(csky)7OUTPUT_ARCH(csky)
7ENTRY(_start)8ENTRY(_start)
@@ -53,6 +54,54 @@ SECTIONS · 45 unmodified lines
53 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)54 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
54 _edata = .;55 _edata = .;
55 56
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
56 EXCEPTION_TABLE(L1_CACHE_BYTES)105 EXCEPTION_TABLE(L1_CACHE_BYTES)
57 BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)106 BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
58 VBR_BASE107 VBR_BASE
arch/csky/mm/Makefile+3−0
@@ -1,8 +1,10 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2ifeq ($(CONFIG_CPU_HAS_CACHEV2),y)2ifeq ($(CONFIG_CPU_HAS_CACHEV2),y)
3obj-y += cachev2.o3obj-y += cachev2.o
4CFLAGS_REMOVE_cachev2.o = $(CC_FLAGS_FTRACE)
4else5else
5obj-y += cachev1.o6obj-y += cachev1.o
7CFLAGS_REMOVE_cachev1.o = $(CC_FLAGS_FTRACE)
6endif8endif
7 9
8obj-y += dma-mapping.o10obj-y += dma-mapping.o
@@ -14,3 +16,4 @@ obj-y += syscache.o · 5 unmodified lines
14obj-y += tlb.o16obj-y += tlb.o
15obj-y += asid.o17obj-y += asid.o
16obj-y += context.o18obj-y += context.o
19obj-$(CONFIG_HAVE_TCM) += tcm.o
arch/csky/mm/cachev1.c+5−0
@@ -94,6 +94,11 @@ void icache_inv_all(void) · 93 unmodified lines
94 cache_op_all(INS_CACHE|CACHE_INV, 0);94 cache_op_all(INS_CACHE|CACHE_INV, 0);
95}95}
96 96
97void local_icache_inv_all(void *priv)
98{
99 cache_op_all(INS_CACHE|CACHE_INV, 0);
100}
101
97void dcache_wb_range(unsigned long start, unsigned long end)102void dcache_wb_range(unsigned long start, unsigned long end)
98{103{
99 cache_op_range(start, end, DATA_CACHE|CACHE_CLR, 0);104 cache_op_range(start, end, DATA_CACHE|CACHE_CLR, 0);
arch/csky/mm/cachev2.c+22−23
@@ -3,15 +3,25 @@ · 2 unmodified lines
3 3
4#include <linux/spinlock.h>4#include <linux/spinlock.h>
5#include <linux/smp.h>5#include <linux/smp.h>
6#include <linux/mm.h>
6#include <asm/cache.h>7#include <asm/cache.h>
7#include <asm/barrier.h>8#include <asm/barrier.h>
8 9
9inline void dcache_wb_line(unsigned long start)10#define INS_CACHE (1 << 0)
11#define CACHE_INV (1 << 4)
12
13void local_icache_inv_all(void *priv)
10{14{
11 asm volatile("dcache.cval1 %0\n"::"r"(start):"memory");15 mtcr("cr17", INS_CACHE|CACHE_INV);
12 sync_is();16 sync_is();
13}17}
14 18
19void icache_inv_all(void)
20{
21 on_each_cpu(local_icache_inv_all, NULL, 1);
22}
23
24#ifdef CONFIG_CPU_HAS_ICACHE_INS
15void icache_inv_range(unsigned long start, unsigned long end)25void icache_inv_range(unsigned long start, unsigned long end)
16{26{
17 unsigned long i = start & ~(L1_CACHE_BYTES - 1);27 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
20 asm volatile("icache.iva %0\n"::"r"(i):"memory");30 asm volatile("icache.iva %0\n"::"r"(i):"memory");
21 sync_is();31 sync_is();
22}32}
23 33#else
24void icache_inv_all(void)34void icache_inv_range(unsigned long start, unsigned long end)
25{35{
26 asm volatile("icache.ialls\n":::"memory");36 icache_inv_all();
27 sync_is();
28}37}
38#endif
29 39
30void dcache_wb_range(unsigned long start, unsigned long end)40inline void dcache_wb_line(unsigned long start)
31{41{
32 unsigned long i = start & ~(L1_CACHE_BYTES - 1);42 asm volatile("dcache.cval1 %0\n"::"r"(start):"memory");
33
34 for (; i < end; i += L1_CACHE_BYTES)
35 asm volatile("dcache.cval1 %0\n"::"r"(i):"memory");
36 sync_is();43 sync_is();
37}44}
38 45
39void dcache_inv_range(unsigned long start, unsigned long end)46void dcache_wb_range(unsigned long start, unsigned long end)
40{47{
41 unsigned long i = start & ~(L1_CACHE_BYTES - 1);48 unsigned long i = start & ~(L1_CACHE_BYTES - 1);
42 49
43 for (; i < end; i += L1_CACHE_BYTES)50 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");
45 sync_is();52 sync_is();
46}53}
47 54
48void cache_wbinv_range(unsigned long start, unsigned long end)55void cache_wbinv_range(unsigned long start, unsigned long end)
49{56{
50 unsigned long i = start & ~(L1_CACHE_BYTES - 1);57 dcache_wb_range(start, end);
51 58 icache_inv_range(start, end);
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();
60}59}
61EXPORT_SYMBOL(cache_wbinv_range);60EXPORT_SYMBOL(cache_wbinv_range);
62 61
arch/csky/mm/highmem.c+4−60
@@ -117,85 +117,29 @@ struct page *kmap_atomic_to_page(void *ptr) · 116 unmodified lines
117 return pte_page(*pte);117 return pte_page(*pte);
118}118}
119 119
120static void __init fixrange_init(unsigned long start, unsigned long end,120static void __init kmap_pages_init(void)
121 pgd_t *pgd_base)
122{121{
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;
129 unsigned long vaddr;122 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
161void __init fixaddr_kmap_pages_init(void)
162{
163 unsigned long vaddr;
164 pgd_t *pgd_base;
165#ifdef CONFIG_HIGHMEM
166 pgd_t *pgd;123 pgd_t *pgd;
167 pmd_t *pmd;124 pmd_t *pmd;
168 pud_t *pud;125 pud_t *pud;
169 pte_t *pte;126 pte_t *pte;
170#endif127
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 */
183 vaddr = PKMAP_BASE;128 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);
185 130
186 pgd = swapper_pg_dir + __pgd_offset(vaddr);131 pgd = swapper_pg_dir + __pgd_offset(vaddr);
187 pud = (pud_t *)pgd;132 pud = (pud_t *)pgd;
188 pmd = pmd_offset(pud, vaddr);133 pmd = pmd_offset(pud, vaddr);
189 pte = pte_offset_kernel(pmd, vaddr);134 pte = pte_offset_kernel(pmd, vaddr);
190 pkmap_page_table = pte;135 pkmap_page_table = pte;
191#endif
192}136}
193 137
194void __init kmap_init(void)138void __init kmap_init(void)
195{139{
196 unsigned long vaddr;140 unsigned long vaddr;
197 141
198 fixaddr_kmap_pages_init();142 kmap_pages_init();
199 143
200 vaddr = __fix_to_virt(FIX_KMAP_BEGIN);144 vaddr = __fix_to_virt(FIX_KMAP_BEGIN);
201 145
arch/csky/mm/init.c+92−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19#include <linux/swap.h>19#include <linux/swap.h>
20#include <linux/proc_fs.h>20#include <linux/proc_fs.h>
21#include <linux/pfn.h>21#include <linux/pfn.h>
22#include <linux/initrd.h>
22 23
23#include <asm/setup.h>24#include <asm/setup.h>
24#include <asm/cachectl.h>25#include <asm/cachectl.h>
@@ -31,10 +32,50 @@ · 6 unmodified lines
31 32
32pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;33pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
33pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;34pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;
35EXPORT_SYMBOL(invalid_pte_table);
34unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]36unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
35 __page_aligned_bss;37 __page_aligned_bss;
36EXPORT_SYMBOL(empty_zero_page);38EXPORT_SYMBOL(empty_zero_page);
37 39
40#ifdef CONFIG_BLK_DEV_INITRD
41static 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
72disable:
73 initrd_start = initrd_end = 0;
74
75 pr_err(" - disabling initrd\n");
76}
77#endif
78
38void __init mem_init(void)79void __init mem_init(void)
39{80{
40#ifdef CONFIG_HIGHMEM81#ifdef CONFIG_HIGHMEM
@@ -46,6 +87,10 @@ void __init mem_init(void) · 5 unmodified lines
46#endif87#endif
47 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);88 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
48 89
90#ifdef CONFIG_BLK_DEV_INITRD
91 setup_initrd();
92#endif
93
49 memblock_free_all();94 memblock_free_all();
50 95
51#ifdef CONFIG_HIGHMEM96#ifdef CONFIG_HIGHMEM
@@ -101,3 +146,50 @@ void __init pre_mmu_init(void) · 49 unmodified lines
101 /* Setup page mask to 4k */146 /* Setup page mask to 4k */
102 write_mmu_pagemask(0);147 write_mmu_pagemask(0);
103}148}
149
150void __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
189void __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
3 3
4#include <linux/syscalls.h>4#include <linux/syscalls.h>
5#include <asm/page.h>5#include <asm/page.h>
6#include <asm/cache.h>6#include <asm/cacheflush.h>
7#include <asm/cachectl.h>7#include <asm/cachectl.h>
8 8
9SYSCALL_DEFINE3(cacheflush,9SYSCALL_DEFINE3(cacheflush,
@@ -13,17 +13,14 @@ SYSCALL_DEFINE3(cacheflush, · 3 unmodified lines
13{13{
14 switch (cache) {14 switch (cache) {
15 case ICACHE:15 case ICACHE:
16 icache_inv_range((unsigned long)addr,16 case BCACHE:
17 (unsigned long)addr + bytes);17 flush_icache_mm_range(current->mm,
18 break;18 (unsigned long)addr,
19 (unsigned long)addr + bytes);
19 case DCACHE:20 case DCACHE:
20 dcache_wb_range((unsigned long)addr,21 dcache_wb_range((unsigned long)addr,
21 (unsigned long)addr + bytes);22 (unsigned long)addr + bytes);
22 break;23 break;
23 case BCACHE:
24 cache_wbinv_range((unsigned long)addr,
25 (unsigned long)addr + bytes);
26 break;
27 default:24 default:
28 return -EINVAL;25 return -EINVAL;
29 }26 }
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
22extern char __tcm_start, __tcm_end, __dtcm_start;
23
24static struct gen_pool *tcm_pool;
25
26static 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;
105panic:
106 panic("TCM init error");
107}
108
109void *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}
122EXPORT_SYMBOL(tcm_alloc);
123
124void tcm_free(void *addr, size_t len)
125{
126 gen_pool_free(tcm_pool, (unsigned long) addr, len);
127}
128EXPORT_SYMBOL(tcm_free);
129
130static 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
161static int __init tcm_init(void)
162{
163 tcm_mapping_init();
164
165 tcm_setup_pool();
166
167 return 0;
168}
169arch_initcall(tcm_init);
arch/mips/boot/dts/ingenic/jz4740.dtsi+9−8
@@ -1,5 +1,6 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/clock/jz4740-cgu.h>2#include <dt-bindings/clock/jz4740-cgu.h>
3#include <dt-bindings/clock/ingenic,tcu.h>
3 4
4/ {5/ {
5 #address-cells = <1>;6 #address-cells = <1>;
@@ -45,14 +46,6 @@ · 39 unmodified lines
45 #clock-cells = <1>;46 #clock-cells = <1>;
46 };47 };
47 48
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
56 tcu: timer@10002000 {49 tcu: timer@10002000 {
57 compatible = "ingenic,jz4740-tcu", "simple-mfd";50 compatible = "ingenic,jz4740-tcu", "simple-mfd";
58 reg = <0x10002000 0x1000>;51 reg = <0x10002000 0x1000>;
@@ -73,6 +66,14 @@ · 14 unmodified lines
73 66
74 interrupt-parent = <&intc>;67 interrupt-parent = <&intc>;
75 interrupts = <23 22 21>;68 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 };
76 };77 };
77 78
78 rtc_dev: rtc@10003000 {79 rtc_dev: rtc@10003000 {
arch/mips/boot/dts/ingenic/jz4780.dtsi+9−8
@@ -1,5 +1,6 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/clock/jz4780-cgu.h>2#include <dt-bindings/clock/jz4780-cgu.h>
3#include <dt-bindings/clock/ingenic,tcu.h>
3#include <dt-bindings/dma/jz4780-dma.h>4#include <dt-bindings/dma/jz4780-dma.h>
4 5
5/ {6/ {
@@ -67,6 +68,14 @@ · 61 unmodified lines
67 68
68 interrupt-parent = <&intc>;69 interrupt-parent = <&intc>;
69 interrupts = <27 26 25>;70 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 };
70 };79 };
71 80
72 rtc_dev: rtc@10003000 {81 rtc_dev: rtc@10003000 {
@@ -348,14 +357,6 @@ · 275 unmodified lines
348 status = "disabled";357 status = "disabled";
349 };358 };
350 359
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
359 nemc: nemc@13410000 {360 nemc: nemc@13410000 {
360 compatible = "ingenic,jz4780-nemc";361 compatible = "ingenic,jz4780-nemc";
361 reg = <0x13410000 0x10000>;362 reg = <0x13410000 0x10000>;
arch/mips/boot/dts/ingenic/x1000.dtsi+2−4
@@ -1,4 +1,5 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/clock/ingenic,tcu.h>
2#include <dt-bindings/clock/x1000-cgu.h>3#include <dt-bindings/clock/x1000-cgu.h>
3#include <dt-bindings/dma/x1000-dma.h>4#include <dt-bindings/dma/x1000-dma.h>
4 5
@@ -72,7 +73,7 @@ · 67 unmodified lines
72 compatible = "ingenic,x1000-watchdog", "ingenic,jz4780-watchdog";73 compatible = "ingenic,x1000-watchdog", "ingenic,jz4780-watchdog";
73 reg = <0x0 0x10>;74 reg = <0x0 0x10>;
74 75
75 clocks = <&cgu X1000_CLK_RTCLK>;76 clocks = <&tcu TCU_CLK_WDT>;
76 clock-names = "wdt";77 clock-names = "wdt";
77 };78 };
78 };79 };
@@ -158,7 +159,6 @@ · 79 unmodified lines
158 i2c0: i2c-controller@10050000 {159 i2c0: i2c-controller@10050000 {
159 compatible = "ingenic,x1000-i2c";160 compatible = "ingenic,x1000-i2c";
160 reg = <0x10050000 0x1000>;161 reg = <0x10050000 0x1000>;
161
162 #address-cells = <1>;162 #address-cells = <1>;
163 #size-cells = <0>;163 #size-cells = <0>;
164 164
@@ -173,7 +173,6 @@ · 8 unmodified lines
173 i2c1: i2c-controller@10051000 {173 i2c1: i2c-controller@10051000 {
174 compatible = "ingenic,x1000-i2c";174 compatible = "ingenic,x1000-i2c";
175 reg = <0x10051000 0x1000>;175 reg = <0x10051000 0x1000>;
176
177 #address-cells = <1>;176 #address-cells = <1>;
178 #size-cells = <0>;177 #size-cells = <0>;
179 178
@@ -188,7 +187,6 @@ · 8 unmodified lines
188 i2c2: i2c-controller@10052000 {187 i2c2: i2c-controller@10052000 {
189 compatible = "ingenic,x1000-i2c";188 compatible = "ingenic,x1000-i2c";
190 reg = <0x10052000 0x1000>;189 reg = <0x10052000 0x1000>;
191
192 #address-cells = <1>;190 #address-cells = <1>;
193 #size-cells = <0>;191 #size-cells = <0>;
194 192
arch/mips/include/asm/sync.h+3−1
@@ -155,9 +155,11 @@ · 154 unmodified lines
155 * effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use155 * effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use
156 * optimized memory barrier primitives."). Here we specify that the affected156 * optimized memory barrier primitives."). Here we specify that the affected
157 * sync instructions should be emitted twice.157 * 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.
158 */160 */
159#ifdef CONFIG_CPU_CAVIUM_OCTEON161#ifdef CONFIG_CPU_CAVIUM_OCTEON
160# define __SYNC_rpt(type) (1 + (type == __SYNC_wmb))162# define __SYNC_rpt(type) (1 - (type == __SYNC_wmb))
161#else163#else
162# define __SYNC_rpt(type) 1164# define __SYNC_rpt(type) 1
163#endif165#endif
arch/mips/kernel/vpe.c+1−1
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v) · 133 unmodified lines
134{134{
135 list_del(&v->list);135 list_del(&v->list);
136 if (v->load_addr)136 if (v->load_addr)
137 release_progmem(v);137 release_progmem(v->load_addr);
138 kfree(v);138 kfree(v);
139}139}
140 140
arch/mips/vdso/Makefile+25−3
@@ -33,6 +33,7 @@ endif · 32 unmodified lines
33cflags-vdso := $(ccflags-vdso) \33cflags-vdso := $(ccflags-vdso) \
34 $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \34 $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
35 -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \35 -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
36 -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
36 -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \37 -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
37 $(call cc-option, -fno-asynchronous-unwind-tables) \38 $(call cc-option, -fno-asynchronous-unwind-tables) \
38 $(call cc-option, -fno-stack-protector)39 $(call cc-option, -fno-stack-protector)
@@ -51,6 +52,8 @@ endif · 12 unmodified lines
51 52
52CFLAGS_REMOVE_vgettimeofday.o = -pg53CFLAGS_REMOVE_vgettimeofday.o = -pg
53 54
55DISABLE_VDSO := n
56
54#57#
55# For the pre-R6 code in arch/mips/vdso/vdso.h for locating58# For the pre-R6 code in arch/mips/vdso/vdso.h for locating
56# the base address of VDSO, the linker will emit a R_MIPS_PC3259# 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
64ifndef CONFIG_CPU_MIPSR667ifndef CONFIG_CPU_MIPSR6
65 ifeq ($(call ld-ifversion, -lt, 225000000, y),y)68 ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
66 $(warning MIPS VDSO requires binutils >= 2.25)69 $(warning MIPS VDSO requires binutils >= 2.25)
67 obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))70 DISABLE_VDSO := y
68 ccflags-vdso += -DDISABLE_MIPS_VDSO
69 endif71 endif
70endif72endif
71 73
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#
79ifdef CONFIG_CPU_MICROMIPS
80 DISABLE_VDSO := y
81endif
82
83ifeq ($(DISABLE_VDSO),y)
84 obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
85 ccflags-vdso += -DDISABLE_MIPS_VDSO
86endif
87
72# VDSO linker flags.88# VDSO linker flags.
73VDSO_LDFLAGS := \89VDSO_LDFLAGS := \
74 -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \90 -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \
@@ -81,12 +97,18 @@ GCOV_PROFILE := n · 6 unmodified lines
81UBSAN_SANITIZE := n97UBSAN_SANITIZE := n
82KCOV_INSTRUMENT := n98KCOV_INSTRUMENT := n
83 99
100# Check that we don't have PIC 'jalr t9' calls left
101quiet_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
84#106#
85# Shared build commands.107# Shared build commands.
86#108#
87 109
88quiet_cmd_vdsold_and_vdso_check = LD $@110quiet_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)
90 112
91quiet_cmd_vdsold = VDSO $@113quiet_cmd_vdsold = VDSO $@
92 cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \114 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
295/*295/*
296 * Some number of bits at the level of the page table that points to296 * Some number of bits at the level of the page table that points to
297 * a hugepte are used to encode the size. This masks those bits.297 * a hugepte are used to encode the size. This masks those bits.
298 * On 8xx, HW assistance requires 4k alignment for the hugepte.
298 */299 */
300#ifdef CONFIG_PPC_8xx
301#define HUGEPD_SHIFT_MASK 0xfff
302#else
299#define HUGEPD_SHIFT_MASK 0x3f303#define HUGEPD_SHIFT_MASK 0x3f
304#endif
300 305
301#ifndef __ASSEMBLY__306#ifndef __ASSEMBLY__
302 307
arch/powerpc/include/asm/processor.h+4−0
@@ -168,6 +168,10 @@ struct thread_struct { · 167 unmodified lines
168 unsigned long srr1;168 unsigned long srr1;
169 unsigned long dar;169 unsigned long dar;
170 unsigned long dsisr;170 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
171#endif175#endif
172 /* Debug Registers */176 /* Debug Registers */
173 struct debug_reg debug;177 struct debug_reg debug;
arch/powerpc/kernel/asm-offsets.c+12−0
@@ -132,6 +132,18 @@ int main(void) · 131 unmodified lines
132 OFFSET(SRR1, thread_struct, srr1);132 OFFSET(SRR1, thread_struct, srr1);
133 OFFSET(DAR, thread_struct, dar);133 OFFSET(DAR, thread_struct, dar);
134 OFFSET(DSISR, thread_struct, dsisr);134 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
135#endif147#endif
136#ifdef CONFIG_SPE148#ifdef CONFIG_SPE
137 OFFSET(THREAD_EVR0, thread_struct, evr[0]);149 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
1184 eeh_pe_state_mark(pe, EEH_PE_RECOVERING);1184 eeh_pe_state_mark(pe, EEH_PE_RECOVERING);
1185 eeh_handle_normal_event(pe);1185 eeh_handle_normal_event(pe);
1186 } else {1186 } 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
1187 pci_lock_rescan_remove();1198 pci_lock_rescan_remove();
1188 list_for_each_entry(hose, &hose_list, list_node) {1199 list_for_each_entry(hose, &hose_list, list_node) {
1189 phb_pe = eeh_phb_pe_get(hose);1200 phb_pe = eeh_phb_pe_get(hose);
@@ -1192,16 +1203,6 @@ void eeh_handle_special_event(void) · 2 unmodified lines
1192 (phb_pe->state & EEH_PE_RECOVERING))1203 (phb_pe->state & EEH_PE_RECOVERING))
1193 continue;1204 continue;
1194 1205
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);
1205 bus = eeh_pe_bus_get(phb_pe);1206 bus = eeh_pe_bus_get(phb_pe);
1206 if (!bus) {1207 if (!bus) {
1207 pr_err("%s: Cannot find PCI bus for "1208 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
7831: lis r3,exc_exit_restart_end@ha7831: lis r3,exc_exit_restart_end@ha
784 addi r3,r3,exc_exit_restart_end@l784 addi r3,r3,exc_exit_restart_end@l
785 cmplw r12,r3785 cmplw r12,r3
786#if CONFIG_PPC_BOOK3S_601786#ifdef CONFIG_PPC_BOOK3S_601
787 bge 2b787 bge 2b
788#else788#else
789 bge 3f789 bge 3f
@@ -791,7 +791,7 @@ fast_exception_return: · 1 unmodified line
791 lis r4,exc_exit_restart@ha791 lis r4,exc_exit_restart@ha
792 addi r4,r4,exc_exit_restart@l792 addi r4,r4,exc_exit_restart@l
793 cmplw r12,r4793 cmplw r12,r4
794#if CONFIG_PPC_BOOK3S_601794#ifdef CONFIG_PPC_BOOK3S_601
795 blt 2b795 blt 2b
796#else796#else
797 blt 3f797 blt 3f
@@ -1354,12 +1354,17 @@ _GLOBAL(enter_rtas) · 556 unmodified lines
1354 mtspr SPRN_SRR0,r81354 mtspr SPRN_SRR0,r8
1355 mtspr SPRN_SRR1,r91355 mtspr SPRN_SRR1,r9
1356 RFI1356 RFI
13571: tophys(r9,r1)13571: 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
1358 lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */1363 lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */
1359 lwz r9,8(r9) /* original msr value */1364 lwz r9,8(r9) /* original msr value */
1360 addi r1,r1,INT_FRAME_SIZE1365 addi r1,r1,INT_FRAME_SIZE
1361 li r0,01366 li r0,0
1362 tophys(r7, r2)1367 tophys_novmstack r7, r2
1363 stw r0, THREAD + RTAS_SP(r7)1368 stw r0, THREAD + RTAS_SP(r7)
1364 mtspr SPRN_SRR0,r81369 mtspr SPRN_SRR0,r8
1365 mtspr SPRN_SRR1,r91370 mtspr SPRN_SRR1,r9
arch/powerpc/kernel/head_32.S+150−5
@@ -290,17 +290,55 @@ MachineCheck: · 289 unmodified lines
2907: EXCEPTION_PROLOG_22907: EXCEPTION_PROLOG_2
291 addi r3,r1,STACK_FRAME_OVERHEAD291 addi r3,r1,STACK_FRAME_OVERHEAD
292#ifdef CONFIG_PPC_CHRP292#ifdef CONFIG_PPC_CHRP
293 bne cr1,1f293#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
294#endif298#endif
295 EXC_XFER_STD(0x200, machine_check_exception)299 beq cr1, machine_check_tramp
296#ifdef CONFIG_PPC_CHRP300 b machine_check_in_rtas
2971: b machine_check_in_rtas301#else
302 b machine_check_tramp
298#endif303#endif
299 304
300/* Data access exception. */305/* Data access exception. */
301 . = 0x300306 . = 0x300
302 DO_KVM 0x300307 DO_KVM 0x300
303DataAccess:308DataAccess:
309#ifdef CONFIG_VMAP_STACK
310 mtspr SPRN_SPRG_SCRATCH0,r10
311 mfspr r10, SPRN_SPRG_THREAD
312BEGIN_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)
326END_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 */
304 EXCEPTION_PROLOG handle_dar_dsisr=1342 EXCEPTION_PROLOG handle_dar_dsisr=1
305 get_and_save_dar_dsisr_on_stack r4, r5, r11343 get_and_save_dar_dsisr_on_stack r4, r5, r11
306BEGIN_MMU_FTR_SECTION344BEGIN_MMU_FTR_SECTION
@@ -316,11 +354,32 @@ BEGIN_MMU_FTR_SECTION · 9 unmodified lines
316FTR_SECTION_ELSE354FTR_SECTION_ELSE
317 b handle_page_fault_tramp_2355 b handle_page_fault_tramp_2
318ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE)356ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE)
357#endif /* CONFIG_VMAP_STACK */
319 358
320/* Instruction access exception. */359/* Instruction access exception. */
321 . = 0x400360 . = 0x400
322 DO_KVM 0x400361 DO_KVM 0x400
323InstructionAccess:362InstructionAccess:
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
372BEGIN_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 */
377END_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 */
324 EXCEPTION_PROLOG383 EXCEPTION_PROLOG
325 andis. r0,r9,SRR1_ISI_NOPT@h /* no pte found? */384 andis. r0,r9,SRR1_ISI_NOPT@h /* no pte found? */
326 beq 1f /* if so, try to put a PTE */385 beq 1f /* if so, try to put a PTE */
@@ -329,6 +388,7 @@ InstructionAccess: · 2 unmodified lines
329BEGIN_MMU_FTR_SECTION388BEGIN_MMU_FTR_SECTION
330 bl hash_page389 bl hash_page
331END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)390END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
391#endif /* CONFIG_VMAP_STACK */
3321: mr r4,r123921: mr r4,r12
333 andis. r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */393 andis. r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */
334 stw r4, _DAR(r11)394 stw r4, _DAR(r11)
@@ -344,7 +404,7 @@ Alignment: · 9 unmodified lines
344 EXCEPTION_PROLOG handle_dar_dsisr=1404 EXCEPTION_PROLOG handle_dar_dsisr=1
345 save_dar_dsisr_on_stack r4, r5, r11405 save_dar_dsisr_on_stack r4, r5, r11
346 addi r3,r1,STACK_FRAME_OVERHEAD406 addi r3,r1,STACK_FRAME_OVERHEAD
347 EXC_XFER_STD(0x600, alignment_exception)407 b alignment_exception_tramp
348 408
349/* Program check exception */409/* Program check exception */
350 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)410 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
645 705
646 . = 0x3000706 . = 0x3000
647 707
708machine_check_tramp:
709 EXC_XFER_STD(0x200, machine_check_exception)
710
711alignment_exception_tramp:
712 EXC_XFER_STD(0x600, alignment_exception)
713
648handle_page_fault_tramp_1:714handle_page_fault_tramp_1:
715#ifdef CONFIG_VMAP_STACK
716 EXCEPTION_PROLOG_2 handle_dar_dsisr=1
717#endif
649 lwz r4, _DAR(r11)718 lwz r4, _DAR(r11)
650 lwz r5, _DSISR(r11)719 lwz r5, _DSISR(r11)
651 /* fall through */720 /* fall through */
652handle_page_fault_tramp_2:721handle_page_fault_tramp_2:
653 EXC_XFER_LITE(0x300, handle_page_fault)722 EXC_XFER_LITE(0x300, handle_page_fault)
654 723
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
753hash_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
765hash_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
779fast_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
7921: /* ISI */
793 mtcr r11
794 mfspr r11, SPRN_SPRG_SCRATCH1
795 mfspr r10, SPRN_SPRG_SCRATCH0
796 SYNC
797 RFI
798
655stack_overflow:799stack_overflow:
656 vmap_stack_overflow_exception800 vmap_stack_overflow_exception
801#endif
657 802
658AltiVecUnavailable:803AltiVecUnavailable:
659 EXCEPTION_PROLOG804 EXCEPTION_PROLOG
arch/powerpc/kernel/head_32.h+20−1
@@ -64,11 +64,25 @@ · 63 unmodified lines
64.endm64.endm
65 65
66.macro EXCEPTION_PROLOG_2 handle_dar_dsisr=066.macro EXCEPTION_PROLOG_2 handle_dar_dsisr=0
67#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S)
68BEGIN_MMU_FTR_SECTION
69 mtcr r10
70FTR_SECTION_ELSE
71 stw r10, _CCR(r11)
72ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE)
73#else
67 stw r10,_CCR(r11) /* save registers */74 stw r10,_CCR(r11) /* save registers */
75#endif
76 mfspr r10, SPRN_SPRG_SCRATCH0
68 stw r12,GPR12(r11)77 stw r12,GPR12(r11)
69 stw r9,GPR9(r11)78 stw r9,GPR9(r11)
70 mfspr r10,SPRN_SPRG_SCRATCH0
71 stw r10,GPR10(r11)79 stw r10,GPR10(r11)
80#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S)
81BEGIN_MMU_FTR_SECTION
82 mfcr r10
83 stw r10, _CCR(r11)
84END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
85#endif
72 mfspr r12,SPRN_SPRG_SCRATCH186 mfspr r12,SPRN_SPRG_SCRATCH1
73 stw r12,GPR11(r11)87 stw r12,GPR11(r11)
74 mflr r1088 mflr r10
@@ -83,6 +97,11 @@ · 8 unmodified lines
83 stw r10, _DSISR(r11)97 stw r10, _DSISR(r11)
84 .endif98 .endif
85 lwz r9, SRR1(r12)99 lwz r9, SRR1(r12)
100#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S)
101BEGIN_MMU_FTR_SECTION
102 andi. r10, r9, MSR_PR
103END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
104#endif
86 lwz r12, SRR0(r12)105 lwz r12, SRR0(r12)
87#else106#else
88 mfspr r12,SPRN_SRR0107 mfspr r12,SPRN_SRR0
arch/powerpc/kernel/head_8xx.S+1−1
@@ -256,7 +256,7 @@ InstructionTLBMiss: · 255 unmodified lines
256 * set. All other Linux PTE bits control the behavior256 * set. All other Linux PTE bits control the behavior
257 * of the MMU.257 * of the MMU.
258 */258 */
259 rlwimi r10, r10, 0, 0x0f00 /* Clear bits 20-23 */259 rlwinm r10, r10, 0, ~0x0f00 /* Clear bits 20-23 */
260 rlwimi r10, r10, 4, 0x0400 /* Copy _PAGE_EXEC into bit 21 */260 rlwimi r10, r10, 4, 0x0400 /* Copy _PAGE_EXEC into bit 21 */
261 ori r10, r10, RPN_PATTERN | 0x200 /* Set 22 and 24-27 */261 ori r10, r10, RPN_PATTERN | 0x200 /* Set 22 and 24-27 */
262 mtspr SPRN_MI_RPN, r10 /* Update TLB entry */262 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
166 mfspr r9,SPRN_HID0166 mfspr r9,SPRN_HID0
167 andis. r9,r9,HID0_NAP@h167 andis. r9,r9,HID0_NAP@h
168 beq 1f168 beq 1f
169#ifdef CONFIG_VMAP_STACK
170 addis r9, r11, nap_save_msscr0@ha
171#else
169 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha172 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha
173#endif
170 lwz r9,nap_save_msscr0@l(r9)174 lwz r9,nap_save_msscr0@l(r9)
171 mtspr SPRN_MSSCR0, r9175 mtspr SPRN_MSSCR0, r9
172 sync176 sync
@@ -174,7 +178,11 @@ BEGIN_FTR_SECTION · 1 unmodified line
1741:1781:
175END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)179END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
176BEGIN_FTR_SECTION180BEGIN_FTR_SECTION
181#ifdef CONFIG_VMAP_STACK
182 addis r9, r11, nap_save_hid1@ha
183#else
177 addis r9,r11,(nap_save_hid1-KERNELBASE)@ha184 addis r9,r11,(nap_save_hid1-KERNELBASE)@ha
185#endif
178 lwz r9,nap_save_hid1@l(r9)186 lwz r9,nap_save_hid1@l(r9)
179 mtspr SPRN_HID1, r9187 mtspr SPRN_HID1, r9
180END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)188END_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
200 * normal/non-checkpointed stack pointer.200 * normal/non-checkpointed stack pointer.
201 */201 */
202 202
203 unsigned long ret = tsk->thread.regs->gpr[1];
204
203#ifdef CONFIG_PPC_TRANSACTIONAL_MEM205#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
204 BUG_ON(tsk != current);206 BUG_ON(tsk != current);
205 207
206 if (MSR_TM_ACTIVE(tsk->thread.regs->msr)) {208 if (MSR_TM_ACTIVE(tsk->thread.regs->msr)) {
209 preempt_disable();
207 tm_reclaim_current(TM_CAUSE_SIGNAL);210 tm_reclaim_current(TM_CAUSE_SIGNAL);
208 if (MSR_TM_TRANSACTIONAL(tsk->thread.regs->msr))211 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();
210 }223 }
211#endif224#endif
212 return tsk->thread.regs->gpr[1];225 return ret;
213}226}
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
489 */489 */
490static int save_tm_user_regs(struct pt_regs *regs,490static int save_tm_user_regs(struct pt_regs *regs,
491 struct mcontext __user *frame,491 struct mcontext __user *frame,
492 struct mcontext __user *tm_frame, int sigret)492 struct mcontext __user *tm_frame, int sigret,
493 unsigned long msr)
493{494{
494 unsigned long msr = regs->msr;
495
496 WARN_ON(tm_suspend_disabled);495 WARN_ON(tm_suspend_disabled);
497 496
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
505 /* Save both sets of general registers */497 /* Save both sets of general registers */
506 if (save_general_regs(&current->thread.ckpt_regs, frame)498 if (save_general_regs(&current->thread.ckpt_regs, frame)
507 || save_general_regs(regs, tm_frame))499 || save_general_regs(regs, tm_frame))
@@ -912,6 +904,10 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 404 unmodified lines
912 int sigret;904 int sigret;
913 unsigned long tramp;905 unsigned long tramp;
914 struct pt_regs *regs = tsk->thread.regs;906 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
915 911
916 BUG_ON(tsk != current);912 BUG_ON(tsk != current);
917 913
@@ -944,13 +940,13 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 26 unmodified lines
944 940
945#ifdef CONFIG_PPC_TRANSACTIONAL_MEM941#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
946 tm_frame = &rt_sf->uc_transact.uc_mcontext;942 tm_frame = &rt_sf->uc_transact.uc_mcontext;
947 if (MSR_TM_ACTIVE(regs->msr)) {943 if (MSR_TM_ACTIVE(msr)) {
948 if (__put_user((unsigned long)&rt_sf->uc_transact,944 if (__put_user((unsigned long)&rt_sf->uc_transact,
949 &rt_sf->uc.uc_link) ||945 &rt_sf->uc.uc_link) ||
950 __put_user((unsigned long)tm_frame,946 __put_user((unsigned long)tm_frame,
951 &rt_sf->uc_transact.uc_regs))947 &rt_sf->uc_transact.uc_regs))
952 goto badframe;948 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))
954 goto badframe;950 goto badframe;
955 }951 }
956 else952 else
@@ -1369,6 +1365,10 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 412 unmodified lines
1369 int sigret;1365 int sigret;
1370 unsigned long tramp;1366 unsigned long tramp;
1371 struct pt_regs *regs = tsk->thread.regs;1367 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
1372 1372
1373 BUG_ON(tsk != current);1373 BUG_ON(tsk != current);
1374 1374
@@ -1402,9 +1402,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 27 unmodified lines
1402 1402
1403#ifdef CONFIG_PPC_TRANSACTIONAL_MEM1403#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1404 tm_mctx = &frame->mctx_transact;1404 tm_mctx = &frame->mctx_transact;
1405 if (MSR_TM_ACTIVE(regs->msr)) {1405 if (MSR_TM_ACTIVE(msr)) {
1406 if (save_tm_user_regs(regs, &frame->mctx, &frame->mctx_transact,1406 if (save_tm_user_regs(regs, &frame->mctx, &frame->mctx_transact,
1407 sigret))1407 sigret, msr))
1408 goto badframe;1408 goto badframe;
1409 }1409 }
1410 else1410 else
arch/powerpc/kernel/signal_64.c+10−12
@@ -192,7 +192,8 @@ static long setup_sigcontext(struct sigcontext __user *sc, · 191 unmodified lines
192static long setup_tm_sigcontexts(struct sigcontext __user *sc,192static long setup_tm_sigcontexts(struct sigcontext __user *sc,
193 struct sigcontext __user *tm_sc,193 struct sigcontext __user *tm_sc,
194 struct task_struct *tsk,194 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)
196{197{
197 /* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the198 /* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
198 * process never used altivec yet (MSR_VEC is zero in pt_regs of199 * 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
207 elf_vrreg_t __user *tm_v_regs = sigcontext_vmx_regs(tm_sc);208 elf_vrreg_t __user *tm_v_regs = sigcontext_vmx_regs(tm_sc);
208#endif209#endif
209 struct pt_regs *regs = tsk->thread.regs;210 struct pt_regs *regs = tsk->thread.regs;
210 unsigned long msr = tsk->thread.regs->msr;
211 long err = 0;211 long err = 0;
212 212
213 BUG_ON(tsk != current);213 BUG_ON(tsk != current);
214 214
215 BUG_ON(!MSR_TM_ACTIVE(regs->msr));215 BUG_ON(!MSR_TM_ACTIVE(msr));
216 216
217 WARN_ON(tm_suspend_disabled);217 WARN_ON(tm_suspend_disabled);
218 218
@@ -222,13 +222,6 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc, · 3 unmodified lines
222 */222 */
223 msr |= tsk->thread.ckpt_regs.msr & (MSR_FP | MSR_VEC | MSR_VSX);223 msr |= tsk->thread.ckpt_regs.msr & (MSR_FP | MSR_VEC | MSR_VSX);
224 224
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
232#ifdef CONFIG_ALTIVEC225#ifdef CONFIG_ALTIVEC
233 err |= __put_user(v_regs, &sc->v_regs);226 err |= __put_user(v_regs, &sc->v_regs);
234 err |= __put_user(tm_v_regs, &tm_sc->v_regs);227 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
824 unsigned long newsp = 0;817 unsigned long newsp = 0;
825 long err = 0;818 long err = 0;
826 struct pt_regs *regs = tsk->thread.regs;819 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
827 824
828 BUG_ON(tsk != current);825 BUG_ON(tsk != current);
829 826
@@ -841,7 +838,7 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, · 11 unmodified lines
841 err |= __put_user(0, &frame->uc.uc_flags);838 err |= __put_user(0, &frame->uc.uc_flags);
842 err |= __save_altstack(&frame->uc.uc_stack, regs->gpr[1]);839 err |= __save_altstack(&frame->uc.uc_stack, regs->gpr[1]);
843#ifdef CONFIG_PPC_TRANSACTIONAL_MEM840#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
844 if (MSR_TM_ACTIVE(regs->msr)) {841 if (MSR_TM_ACTIVE(msr)) {
845 /* The ucontext_t passed to userland points to the second842 /* The ucontext_t passed to userland points to the second
846 * ucontext_t (for transactional state) with its uc_link ptr.843 * ucontext_t (for transactional state) with its uc_link ptr.
847 */844 */
@@ -849,7 +846,8 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, · 1 unmodified line
849 err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext,846 err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext,
850 &frame->uc_transact.uc_mcontext,847 &frame->uc_transact.uc_mcontext,
851 tsk, ksig->sig, NULL,848 tsk, ksig->sig, NULL,
852 (unsigned long)ksig->ka.sa.sa_handler);849 (unsigned long)ksig->ka.sa.sa_handler,
850 msr);
853 } else851 } else
854#endif852#endif
855 {853 {
arch/powerpc/mm/book3s32/hash_low.S+23−29
@@ -25,12 +25,6 @@ · 24 unmodified lines
25#include <asm/feature-fixups.h>25#include <asm/feature-fixups.h>
26#include <asm/code-patching-asm.h>26#include <asm/code-patching-asm.h>
27 27
28#ifdef CONFIG_VMAP_STACK
29#define ADDR_OFFSET 0
30#else
31#define ADDR_OFFSET PAGE_OFFSET
32#endif
33
34#ifdef CONFIG_SMP28#ifdef CONFIG_SMP
35 .section .bss29 .section .bss
36 .align 230 .align 2
@@ -53,8 +47,8 @@ mmu_hash_lock: · 16 unmodified lines
53 .text47 .text
54_GLOBAL(hash_page)48_GLOBAL(hash_page)
55#ifdef CONFIG_SMP49#ifdef CONFIG_SMP
56 lis r8, (mmu_hash_lock - ADDR_OFFSET)@h50 lis r8, (mmu_hash_lock - PAGE_OFFSET)@h
57 ori r8, r8, (mmu_hash_lock - ADDR_OFFSET)@l51 ori r8, r8, (mmu_hash_lock - PAGE_OFFSET)@l
58 lis r0,0x0fff52 lis r0,0x0fff
59 b 10f53 b 10f
6011: lwz r6,0(r8)5411: lwz r6,0(r8)
@@ -72,12 +66,9 @@ _GLOBAL(hash_page) · 11 unmodified lines
72 cmplw 0,r4,r066 cmplw 0,r4,r0
73 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */67 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */
74 mfspr r5, SPRN_SPRG_PGDIR /* phys page-table root */68 mfspr r5, SPRN_SPRG_PGDIR /* phys page-table root */
75#ifdef CONFIG_VMAP_STACK
76 tovirt(r5, r5)
77#endif
78 blt+ 112f /* assume user more likely */69 blt+ 112f /* assume user more likely */
79 lis r5, (swapper_pg_dir - ADDR_OFFSET)@ha /* if kernel address, use */70 lis r5, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
80 addi r5 ,r5 ,(swapper_pg_dir - ADDR_OFFSET)@l /* kernel page table */71 addi r5 ,r5 ,(swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */
81 rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */72 rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */
82112:73112:
83#ifndef CONFIG_PTE_64BIT74#ifndef CONFIG_PTE_64BIT
@@ -89,9 +80,6 @@ _GLOBAL(hash_page) · 5 unmodified lines
89 lwzx r8,r8,r5 /* Get L1 entry */80 lwzx r8,r8,r5 /* Get L1 entry */
90 rlwinm. r8,r8,0,0,20 /* extract pt base address */81 rlwinm. r8,r8,0,0,20 /* extract pt base address */
91#endif82#endif
92#ifdef CONFIG_VMAP_STACK
93 tovirt(r8, r8)
94#endif
95#ifdef CONFIG_SMP83#ifdef CONFIG_SMP
96 beq- hash_page_out /* return if no mapping */84 beq- hash_page_out /* return if no mapping */
97#else85#else
@@ -143,30 +131,36 @@ retry: · 45 unmodified lines
143 bne- retry /* retry if someone got there first */131 bne- retry /* retry if someone got there first */
144 132
145 mfsrin r3,r4 /* get segment reg for segment */133 mfsrin r3,r4 /* get segment reg for segment */
134#ifndef CONFIG_VMAP_STACK
146 mfctr r0135 mfctr r0
147 stw r0,_CTR(r11)136 stw r0,_CTR(r11)
137#endif
148 bl create_hpte /* add the hash table entry */138 bl create_hpte /* add the hash table entry */
149 139
150#ifdef CONFIG_SMP140#ifdef CONFIG_SMP
151 eieio141 eieio
152 lis r8, (mmu_hash_lock - ADDR_OFFSET)@ha142 lis r8, (mmu_hash_lock - PAGE_OFFSET)@ha
153 li r0,0143 li r0,0
154 stw r0, (mmu_hash_lock - ADDR_OFFSET)@l(r8)144 stw r0, (mmu_hash_lock - PAGE_OFFSET)@l(r8)
155#endif145#endif
156 146
147#ifdef CONFIG_VMAP_STACK
148 b fast_hash_page_return
149#else
157 /* Return from the exception */150 /* Return from the exception */
158 lwz r5,_CTR(r11)151 lwz r5,_CTR(r11)
159 mtctr r5152 mtctr r5
160 lwz r0,GPR0(r11)153 lwz r0,GPR0(r11)
161 lwz r8,GPR8(r11)154 lwz r8,GPR8(r11)
162 b fast_exception_return155 b fast_exception_return
156#endif
163 157
164#ifdef CONFIG_SMP158#ifdef CONFIG_SMP
165hash_page_out:159hash_page_out:
166 eieio160 eieio
167 lis r8, (mmu_hash_lock - ADDR_OFFSET)@ha161 lis r8, (mmu_hash_lock - PAGE_OFFSET)@ha
168 li r0,0162 li r0,0
169 stw r0, (mmu_hash_lock - ADDR_OFFSET)@l(r8)163 stw r0, (mmu_hash_lock - PAGE_OFFSET)@l(r8)
170 blr164 blr
171#endif /* CONFIG_SMP */165#endif /* CONFIG_SMP */
172 166
@@ -341,7 +335,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 168 unmodified lines
341 patch_site 1f, patch__hash_page_A1335 patch_site 1f, patch__hash_page_A1
342 patch_site 2f, patch__hash_page_A2336 patch_site 2f, patch__hash_page_A2
343 /* Get the address of the primary PTE group in the hash table (r3) */337 /* Get the address of the primary PTE group in the hash table (r3) */
3440: lis r0, (Hash_base - ADDR_OFFSET)@h /* base address of hash table */3380: lis r0, (Hash_base - PAGE_OFFSET)@h /* base address of hash table */
3451: rlwimi r0,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */3391: rlwimi r0,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */
3462: rlwinm r3,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */3402: rlwinm r3,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */
347 xor r3,r3,r0 /* make primary hash */341 xor r3,r3,r0 /* make primary hash */
@@ -355,10 +349,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 7 unmodified lines
355 beq+ 10f /* no PTE: go look for an empty slot */349 beq+ 10f /* no PTE: go look for an empty slot */
356 tlbie r4350 tlbie r4
357 351
358 lis r4, (htab_hash_searches - ADDR_OFFSET)@ha352 lis r4, (htab_hash_searches - PAGE_OFFSET)@ha
359 lwz r6, (htab_hash_searches - ADDR_OFFSET)@l(r4)353 lwz r6, (htab_hash_searches - PAGE_OFFSET)@l(r4)
360 addi r6,r6,1 /* count how many searches we do */354 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)
362 356
363 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */357 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */
364 mtctr r0358 mtctr r0
@@ -390,10 +384,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 25 unmodified lines
390 beq+ found_empty384 beq+ found_empty
391 385
392 /* update counter of times that the primary PTEG is full */386 /* update counter of times that the primary PTEG is full */
393 lis r4, (primary_pteg_full - ADDR_OFFSET)@ha387 lis r4, (primary_pteg_full - PAGE_OFFSET)@ha
394 lwz r6, (primary_pteg_full - ADDR_OFFSET)@l(r4)388 lwz r6, (primary_pteg_full - PAGE_OFFSET)@l(r4)
395 addi r6,r6,1389 addi r6,r6,1
396 stw r6, (primary_pteg_full - ADDR_OFFSET)@l(r4)390 stw r6, (primary_pteg_full - PAGE_OFFSET)@l(r4)
397 391
398 patch_site 0f, patch__hash_page_C392 patch_site 0f, patch__hash_page_C
399 /* Search the secondary PTEG for an empty slot */393 /* Search the secondary PTEG for an empty slot */
@@ -427,8 +421,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 27 unmodified lines
427 * lockup here but that shouldn't happen421 * lockup here but that shouldn't happen
428 */422 */
429 423
4301: lis r4, (next_slot - ADDR_OFFSET)@ha /* get next evict slot */4241: lis r4, (next_slot - PAGE_OFFSET)@ha /* get next evict slot */
431 lwz r6, (next_slot - ADDR_OFFSET)@l(r4)425 lwz r6, (next_slot - PAGE_OFFSET)@l(r4)
432 addi r6,r6,HPTE_SIZE /* search for candidate */426 addi r6,r6,HPTE_SIZE /* search for candidate */
433 andi. r6,r6,7*HPTE_SIZE427 andi. r6,r6,7*HPTE_SIZE
434 stw r6,next_slot@l(r4)428 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
413void __init MMU_init_hw_patch(void)413void __init MMU_init_hw_patch(void)
414{414{
415 unsigned int hmask = Hash_mask >> (16 - LG_HPTEG_SIZE);415 unsigned int hmask = Hash_mask >> (16 - LG_HPTEG_SIZE);
416 unsigned int hash;416 unsigned int hash = (unsigned int)Hash - PAGE_OFFSET;
417 417
418 if (ppc_md.progress)418 if (ppc_md.progress)
419 ppc_md.progress("hash:patch", 0x345);419 ppc_md.progress("hash:patch", 0x345);
@@ -425,11 +425,6 @@ void __init MMU_init_hw_patch(void) · 5 unmodified lines
425 /*425 /*
426 * Patch up the instructions in hashtable.S:create_hpte426 * Patch up the instructions in hashtable.S:create_hpte
427 */427 */
428 if (IS_ENABLED(CONFIG_VMAP_STACK))
429 hash = (unsigned int)Hash;
430 else
431 hash = (unsigned int)Hash - PAGE_OFFSET;
432
433 modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16);428 modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16);
434 modify_instruction_site(&patch__hash_page_A1, 0x7c0, hash_mb << 6);429 modify_instruction_site(&patch__hash_page_A1, 0x7c0, hash_mb << 6);
435 modify_instruction_site(&patch__hash_page_A2, 0x7c0, hash_mb2 << 6);430 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
439 /*434 /*
440 * Patch up the instructions in hashtable.S:flush_hash_page435 * Patch up the instructions in hashtable.S:flush_hash_page
441 */436 */
442 modify_instruction_site(&patch__flush_hash_A0, 0xffff,437 modify_instruction_site(&patch__flush_hash_A0, 0xffff, hash >> 16);
443 ((unsigned int)Hash - PAGE_OFFSET) >> 16);
444 modify_instruction_site(&patch__flush_hash_A1, 0x7c0, hash_mb << 6);438 modify_instruction_site(&patch__flush_hash_A1, 0x7c0, hash_mb << 6);
445 modify_instruction_site(&patch__flush_hash_A2, 0x7c0, hash_mb2 << 6);439 modify_instruction_site(&patch__flush_hash_A2, 0x7c0, hash_mb2 << 6);
446 modify_instruction_site(&patch__flush_hash_B, 0xffff, hmask);440 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
53 if (pshift >= pdshift) {53 if (pshift >= pdshift) {
54 cachep = PGT_CACHE(PTE_T_ORDER);54 cachep = PGT_CACHE(PTE_T_ORDER);
55 num_hugepd = 1 << (pshift - pdshift);55 num_hugepd = 1 << (pshift - pdshift);
56 new = NULL;
56 } else if (IS_ENABLED(CONFIG_PPC_8xx)) {57 } else if (IS_ENABLED(CONFIG_PPC_8xx)) {
57 cachep = PGT_CACHE(PTE_INDEX_SIZE);58 cachep = NULL;
58 num_hugepd = 1;59 num_hugepd = 1;
60 new = pte_alloc_one(mm);
59 } else {61 } else {
60 cachep = PGT_CACHE(pdshift - pshift);62 cachep = PGT_CACHE(pdshift - pshift);
61 num_hugepd = 1;63 num_hugepd = 1;
64 new = NULL;
62 }65 }
63 66
64 if (!cachep) {67 if (!cachep && !new) {
65 WARN_ONCE(1, "No page table cache created for hugetlb tables");68 WARN_ONCE(1, "No page table cache created for hugetlb tables");
66 return -ENOMEM;69 return -ENOMEM;
67 }70 }
68 71
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));
70 74
71 BUG_ON(pshift > HUGEPD_SHIFT_MASK);75 BUG_ON(pshift > HUGEPD_SHIFT_MASK);
72 BUG_ON((unsigned long)new & HUGEPD_SHIFT_MASK);76 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
97 if (i < num_hugepd) {101 if (i < num_hugepd) {
98 for (i = i - 1 ; i >= 0; i--, hpdp--)102 for (i = i - 1 ; i >= 0; i--, hpdp--)
99 *hpdp = __hugepd(0);103 *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);
101 } else {108 } else {
102 kmemleak_ignore(new);109 kmemleak_ignore(new);
103 }110 }
@@ -324,8 +331,7 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif · 220 unmodified lines
324 if (shift >= pdshift)331 if (shift >= pdshift)
325 hugepd_free(tlb, hugepte);332 hugepd_free(tlb, hugepte);
326 else if (IS_ENABLED(CONFIG_PPC_8xx))333 else if (IS_ENABLED(CONFIG_PPC_8xx))
327 pgtable_free_tlb(tlb, hugepte,334 pgtable_free_tlb(tlb, hugepte, 0);
328 get_hugepd_cache_index(PTE_INDEX_SIZE));
329 else335 else
330 pgtable_free_tlb(tlb, hugepte,336 pgtable_free_tlb(tlb, hugepte,
331 get_hugepd_cache_index(pdshift - shift));337 get_hugepd_cache_index(pdshift - shift));
@@ -639,12 +645,13 @@ static int __init hugetlbpage_init(void) · 307 unmodified lines
639 * if we have pdshift and shift value same, we don't645 * if we have pdshift and shift value same, we don't
640 * use pgt cache for hugepd.646 * use pgt cache for hugepd.
641 */647 */
642 if (pdshift > shift && IS_ENABLED(CONFIG_PPC_8xx))648 if (pdshift > shift) {
643 pgtable_cache_add(PTE_INDEX_SIZE);649 if (!IS_ENABLED(CONFIG_PPC_8xx))
644 else if (pdshift > shift)650 pgtable_cache_add(pdshift - shift);
645 pgtable_cache_add(pdshift - shift);651 } else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) ||
646 else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || IS_ENABLED(CONFIG_PPC_8xx))652 IS_ENABLED(CONFIG_PPC_8xx)) {
647 pgtable_cache_add(PTE_T_ORDER);653 pgtable_cache_add(PTE_T_ORDER);
654 }
648 655
649 configured = true;656 configured = true;
650 }657 }
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
185 185
186static void __init kasan_early_hash_table(void)186static void __init kasan_early_hash_table(void)
187{187{
188 unsigned int hash = IS_ENABLED(CONFIG_VMAP_STACK) ? (unsigned int)early_hash :188 unsigned int hash = __pa(early_hash);
189 __pa(early_hash);
190 189
191 modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16);190 modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16);
192 modify_instruction_site(&patch__flush_hash_A0, 0xffff, hash >> 16);191 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
3435 int c;3435 int c;
3436 3436
3437 c = skipbl();3437 c = skipbl();
3438 if (c == '\n') {
3439 *s = 0;
3440 return;
3441 }
3442
3438 do {3443 do {
3439 if( size > 1 ){3444 if( size > 1 ){
3440 *s++ = c;3445 *s++ = c;
arch/riscv/boot/.gitignore+2−0
@@ -1,2 +1,4 @@
1Image1Image
2Image.gz2Image.gz
3loader
4loader.lds
arch/riscv/include/asm/csr.h+12−0
@@ -72,6 +72,16 @@ · 71 unmodified lines
72#define EXC_LOAD_PAGE_FAULT 1372#define EXC_LOAD_PAGE_FAULT 13
73#define EXC_STORE_PAGE_FAULT 1573#define EXC_STORE_PAGE_FAULT 15
74 74
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
75/* symbolic CSR names: */85/* symbolic CSR names: */
76#define CSR_CYCLE 0xc0086#define CSR_CYCLE 0xc00
77#define CSR_TIME 0xc0187#define CSR_TIME 0xc01
@@ -100,6 +110,8 @@ · 22 unmodified lines
100#define CSR_MCAUSE 0x342110#define CSR_MCAUSE 0x342
101#define CSR_MTVAL 0x343111#define CSR_MTVAL 0x343
102#define CSR_MIP 0x344112#define CSR_MIP 0x344
113#define CSR_PMPCFG0 0x3a0
114#define CSR_PMPADDR0 0x3b0
103#define CSR_MHARTID 0xf14115#define CSR_MHARTID 0xf14
104 116
105#ifdef CONFIG_RISCV_M_MODE117#ifdef CONFIG_RISCV_M_MODE
arch/riscv/kernel/head.S+6−0
@@ -58,6 +58,12 @@ _start_kernel: · 57 unmodified lines
58 /* Reset all registers except ra, a0, a1 */58 /* Reset all registers except ra, a0, a1 */
59 call reset_regs59 call reset_regs
60 60
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
61 /*67 /*
62 * The hartid in a0 is expected later on, and we have no firmware68 * The hartid in a0 is expected later on, and we have no firmware
63 * to hand it to us.69 * to hand it to us.
arch/riscv/kernel/traps.c+2−2
@@ -156,6 +156,6 @@ void __init trap_init(void) · 155 unmodified lines
156 csr_write(CSR_SCRATCH, 0);156 csr_write(CSR_SCRATCH, 0);
157 /* Set the exception vector address */157 /* Set the exception vector address */
158 csr_write(CSR_TVEC, &handle_exception);158 csr_write(CSR_TVEC, &handle_exception);
159 /* Enable all interrupts */159 /* Enable interrupts */
160 csr_write(CSR_IE, -1);160 csr_write(CSR_IE, IE_SIE | IE_EIE);
161}161}
arch/riscv/mm/kasan_init.c+31−22
@@ -19,18 +19,20 @@ asmlinkage void __init kasan_early_init(void) · 18 unmodified lines
19 for (i = 0; i < PTRS_PER_PTE; ++i)19 for (i = 0; i < PTRS_PER_PTE; ++i)
20 set_pte(kasan_early_shadow_pte + i,20 set_pte(kasan_early_shadow_pte + i,
21 mk_pte(virt_to_page(kasan_early_shadow_page),21 mk_pte(virt_to_page(kasan_early_shadow_page),
22 PAGE_KERNEL));22 PAGE_KERNEL));
23 23
24 for (i = 0; i < PTRS_PER_PMD; ++i)24 for (i = 0; i < PTRS_PER_PMD; ++i)
25 set_pmd(kasan_early_shadow_pmd + i,25 set_pmd(kasan_early_shadow_pmd + i,
26 pfn_pmd(PFN_DOWN(__pa((uintptr_t)kasan_early_shadow_pte)),26 pfn_pmd(PFN_DOWN
27 __pgprot(_PAGE_TABLE)));27 (__pa((uintptr_t) kasan_early_shadow_pte)),
28 __pgprot(_PAGE_TABLE)));
28 29
29 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;30 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;
30 i += PGDIR_SIZE, ++pgd)31 i += PGDIR_SIZE, ++pgd)
31 set_pgd(pgd,32 set_pgd(pgd,
32 pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))),33 pfn_pgd(PFN_DOWN
33 __pgprot(_PAGE_TABLE)));34 (__pa(((uintptr_t) kasan_early_shadow_pmd))),
35 __pgprot(_PAGE_TABLE)));
34 36
35 /* init for swapper_pg_dir */37 /* init for swapper_pg_dir */
36 pgd = pgd_offset_k(KASAN_SHADOW_START);38 pgd = pgd_offset_k(KASAN_SHADOW_START);
@@ -38,37 +40,43 @@ asmlinkage void __init kasan_early_init(void) · 1 unmodified line
38 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;40 for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END;
39 i += PGDIR_SIZE, ++pgd)41 i += PGDIR_SIZE, ++pgd)
40 set_pgd(pgd,42 set_pgd(pgd,
41 pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))),43 pfn_pgd(PFN_DOWN
42 __pgprot(_PAGE_TABLE)));44 (__pa(((uintptr_t) kasan_early_shadow_pmd))),
45 __pgprot(_PAGE_TABLE)));
43 46
44 flush_tlb_all();47 flush_tlb_all();
45}48}
46 49
47static void __init populate(void *start, void *end)50static void __init populate(void *start, void *end)
48{51{
49 unsigned long i;52 unsigned long i, offset;
50 unsigned long vaddr = (unsigned long)start & PAGE_MASK;53 unsigned long vaddr = (unsigned long)start & PAGE_MASK;
51 unsigned long vend = PAGE_ALIGN((unsigned long)end);54 unsigned long vend = PAGE_ALIGN((unsigned long)end);
52 unsigned long n_pages = (vend - vaddr) / PAGE_SIZE;55 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;
53 unsigned long n_pmds =58 unsigned long n_pmds =
54 (n_pages % PTRS_PER_PTE) ? n_pages / PTRS_PER_PTE + 1 :59 ((n_ptes + PTRS_PER_PMD) & -PTRS_PER_PMD) / PTRS_PER_PMD;
55 n_pages / PTRS_PER_PTE;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);
56 pgd_t *pgd = pgd_offset_k(vaddr);65 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);
59 66
60 for (i = 0; i < n_pages; i++) {67 for (i = 0; i < n_pages; i++) {
61 phys_addr_t phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);68 phys_addr_t phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
62 69 set_pte(&pte[i], pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
63 set_pte(pte + i, pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
64 }70 }
65 71
66 for (i = 0; i < n_pmds; ++pgd, i += PTRS_PER_PMD)72 for (i = 0, offset = 0; i < n_ptes; i++, offset += PTRS_PER_PTE)
67 set_pgd(pgd, pfn_pgd(PFN_DOWN(__pa(((uintptr_t)(pmd + i)))),73 set_pmd(&pmd[i],
74 pfn_pmd(PFN_DOWN(__pa(&pte[offset])),
68 __pgprot(_PAGE_TABLE)));75 __pgprot(_PAGE_TABLE)));
69 76
70 for (i = 0; i < n_pages; ++pmd, i += PTRS_PER_PTE)77 for (i = 0, offset = 0; i < n_pmds; i++, offset += PTRS_PER_PMD)
71 set_pmd(pmd, pfn_pmd(PFN_DOWN(__pa((uintptr_t)(pte + i))),78 set_pgd(&pgd[i],
79 pfn_pgd(PFN_DOWN(__pa(&pmd[offset])),
72 __pgprot(_PAGE_TABLE)));80 __pgprot(_PAGE_TABLE)));
73 81
74 flush_tlb_all();82 flush_tlb_all();
@@ -81,7 +89,8 @@ void __init kasan_init(void) · 6 unmodified lines
81 unsigned long i;89 unsigned long i;
82 90
83 kasan_populate_early_shadow((void *)KASAN_SHADOW_START,91 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));
85 94
86 for_each_memblock(memory, reg) {95 for_each_memblock(memory, reg) {
87 void *start = (void *)__va(reg->base);96 void *start = (void *)__va(reg->base);
@@ -90,14 +99,14 @@ void __init kasan_init(void) · 2 unmodified lines
90 if (start >= end)99 if (start >= end)
91 break;100 break;
92 101
93 populate(kasan_mem_to_shadow(start),102 populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end));
94 kasan_mem_to_shadow(end));
95 };103 };
96 104
97 for (i = 0; i < PTRS_PER_PTE; i++)105 for (i = 0; i < PTRS_PER_PTE; i++)
98 set_pte(&kasan_early_shadow_pte[i],106 set_pte(&kasan_early_shadow_pte[i],
99 mk_pte(virt_to_page(kasan_early_shadow_page),107 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)));
101 110
102 memset(kasan_early_shadow_page, 0, PAGE_SIZE);111 memset(kasan_early_shadow_page, 0, PAGE_SIZE);
103 init_task.kasan_depth = 0;112 init_task.kasan_depth = 0;
arch/s390/Makefile+1−1
@@ -146,7 +146,7 @@ all: bzImage · 145 unmodified lines
146#KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg...146#KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg...
147KBUILD_IMAGE := $(boot)/bzImage147KBUILD_IMAGE := $(boot)/bzImage
148 148
149install: vmlinux149install:
150 $(Q)$(MAKE) $(build)=$(boot) $@150 $(Q)$(MAKE) $(build)=$(boot) $@
151 151
152bzImage: vmlinux152bzImage: vmlinux
arch/s390/boot/Makefile+1−1
@@ -70,7 +70,7 @@ $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE · 69 unmodified lines
70$(obj)/startup.a: $(OBJECTS) FORCE70$(obj)/startup.a: $(OBJECTS) FORCE
71 $(call if_changed,ar)71 $(call if_changed,ar)
72 72
73install: $(CONFIGURE) $(obj)/bzImage73install:
74 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \74 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
75 System.map "$(INSTALL_PATH)"75 System.map "$(INSTALL_PATH)"
76 76
arch/s390/boot/kaslr.c+1−1
@@ -75,7 +75,7 @@ static unsigned long get_random(unsigned long limit) · 74 unmodified lines
75 *(unsigned long *) prng.parm_block ^= seed;75 *(unsigned long *) prng.parm_block ^= seed;
76 for (i = 0; i < 16; i++) {76 for (i = 0; i < 16; i++) {
77 cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block,77 cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block,
78 (char *) entropy, (char *) entropy,78 (u8 *) entropy, (u8 *) entropy,
79 sizeof(entropy));79 sizeof(entropy));
80 memcpy(prng.parm_block, entropy, sizeof(entropy));80 memcpy(prng.parm_block, entropy, sizeof(entropy));
81 }81 }
arch/s390/boot/uv.c+2−1
@@ -15,7 +15,8 @@ void uv_query_info(void) · 14 unmodified lines
15 if (!test_facility(158))15 if (!test_facility(158))
16 return;16 return;
17 17
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)
19 return;20 return;
20 21
21 if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&22 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
53CONFIG_CRASH_DUMP=y53CONFIG_CRASH_DUMP=y
54CONFIG_HIBERNATION=y54CONFIG_HIBERNATION=y
55CONFIG_PM_DEBUG=y55CONFIG_PM_DEBUG=y
56CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
56CONFIG_CMM=m57CONFIG_CMM=m
57CONFIG_APPLDATA_BASE=y58CONFIG_APPLDATA_BASE=y
58CONFIG_KVM=m59CONFIG_KVM=m
@@ -474,7 +475,6 @@ CONFIG_NLMON=m · 415 unmodified lines
474# CONFIG_NET_VENDOR_EMULEX is not set475# CONFIG_NET_VENDOR_EMULEX is not set
475# CONFIG_NET_VENDOR_EZCHIP is not set476# CONFIG_NET_VENDOR_EZCHIP is not set
476# CONFIG_NET_VENDOR_GOOGLE is not set477# CONFIG_NET_VENDOR_GOOGLE is not set
477# CONFIG_NET_VENDOR_HP is not set
478# CONFIG_NET_VENDOR_HUAWEI is not set478# CONFIG_NET_VENDOR_HUAWEI is not set
479# CONFIG_NET_VENDOR_INTEL is not set479# CONFIG_NET_VENDOR_INTEL is not set
480# CONFIG_NET_VENDOR_MARVELL is not set480# CONFIG_NET_VENDOR_MARVELL is not set
@@ -684,7 +684,6 @@ CONFIG_CRYPTO_ADIANTUM=m · 203 unmodified lines
684CONFIG_CRYPTO_XCBC=m684CONFIG_CRYPTO_XCBC=m
685CONFIG_CRYPTO_VMAC=m685CONFIG_CRYPTO_VMAC=m
686CONFIG_CRYPTO_CRC32=m686CONFIG_CRYPTO_CRC32=m
687CONFIG_CRYPTO_XXHASH=m
688CONFIG_CRYPTO_MICHAEL_MIC=m687CONFIG_CRYPTO_MICHAEL_MIC=m
689CONFIG_CRYPTO_RMD128=m688CONFIG_CRYPTO_RMD128=m
690CONFIG_CRYPTO_RMD160=m689CONFIG_CRYPTO_RMD160=m
@@ -748,7 +747,6 @@ CONFIG_DEBUG_INFO_DWARF4=y · 57 unmodified lines
748CONFIG_GDB_SCRIPTS=y747CONFIG_GDB_SCRIPTS=y
749CONFIG_FRAME_WARN=1024748CONFIG_FRAME_WARN=1024
750CONFIG_HEADERS_INSTALL=y749CONFIG_HEADERS_INSTALL=y
751CONFIG_HEADERS_CHECK=y
752CONFIG_DEBUG_SECTION_MISMATCH=y750CONFIG_DEBUG_SECTION_MISMATCH=y
753CONFIG_MAGIC_SYSRQ=y751CONFIG_MAGIC_SYSRQ=y
754CONFIG_DEBUG_PAGEALLOC=y752CONFIG_DEBUG_PAGEALLOC=y
@@ -772,9 +770,9 @@ CONFIG_DEBUG_MEMORY_INIT=y · 17 unmodified lines
772CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m770CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
773CONFIG_DEBUG_PER_CPU_MAPS=y771CONFIG_DEBUG_PER_CPU_MAPS=y
774CONFIG_DEBUG_SHIRQ=y772CONFIG_DEBUG_SHIRQ=y
773CONFIG_PANIC_ON_OOPS=y
775CONFIG_DETECT_HUNG_TASK=y774CONFIG_DETECT_HUNG_TASK=y
776CONFIG_WQ_WATCHDOG=y775CONFIG_WQ_WATCHDOG=y
777CONFIG_PANIC_ON_OOPS=y
778CONFIG_DEBUG_TIMEKEEPING=y776CONFIG_DEBUG_TIMEKEEPING=y
779CONFIG_PROVE_LOCKING=y777CONFIG_PROVE_LOCKING=y
780CONFIG_LOCK_STAT=y778CONFIG_LOCK_STAT=y
@@ -783,9 +781,20 @@ CONFIG_DEBUG_ATOMIC_SLEEP=y · 2 unmodified lines
783CONFIG_DEBUG_LOCKING_API_SELFTESTS=y781CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
784CONFIG_DEBUG_SG=y782CONFIG_DEBUG_SG=y
785CONFIG_DEBUG_NOTIFIERS=y783CONFIG_DEBUG_NOTIFIERS=y
784CONFIG_BUG_ON_DATA_CORRUPTION=y
786CONFIG_DEBUG_CREDENTIALS=y785CONFIG_DEBUG_CREDENTIALS=y
787CONFIG_RCU_TORTURE_TEST=m786CONFIG_RCU_TORTURE_TEST=m
788CONFIG_RCU_CPU_STALL_TIMEOUT=300787CONFIG_RCU_CPU_STALL_TIMEOUT=300
788CONFIG_LATENCYTOP=y
789CONFIG_FUNCTION_PROFILER=y
790CONFIG_STACK_TRACER=y
791CONFIG_IRQSOFF_TRACER=y
792CONFIG_PREEMPT_TRACER=y
793CONFIG_SCHED_TRACER=y
794CONFIG_FTRACE_SYSCALLS=y
795CONFIG_BLK_DEV_IO_TRACE=y
796CONFIG_HIST_TRIGGERS=y
797CONFIG_S390_PTDUMP=y
789CONFIG_NOTIFIER_ERROR_INJECTION=m798CONFIG_NOTIFIER_ERROR_INJECTION=m
790CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m799CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m
791CONFIG_FAULT_INJECTION=y800CONFIG_FAULT_INJECTION=y
@@ -796,15 +805,6 @@ CONFIG_FAIL_IO_TIMEOUT=y · 4 unmodified lines
796CONFIG_FAIL_FUTEX=y805CONFIG_FAIL_FUTEX=y
797CONFIG_FAULT_INJECTION_DEBUG_FS=y806CONFIG_FAULT_INJECTION_DEBUG_FS=y
798CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y807CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
799CONFIG_LATENCYTOP=y
800CONFIG_IRQSOFF_TRACER=y
801CONFIG_PREEMPT_TRACER=y
802CONFIG_SCHED_TRACER=y
803CONFIG_FTRACE_SYSCALLS=y
804CONFIG_STACK_TRACER=y
805CONFIG_BLK_DEV_IO_TRACE=y
806CONFIG_FUNCTION_PROFILER=y
807CONFIG_HIST_TRIGGERS=y
808CONFIG_LKDTM=m808CONFIG_LKDTM=m
809CONFIG_TEST_LIST_SORT=y809CONFIG_TEST_LIST_SORT=y
810CONFIG_TEST_SORT=y810CONFIG_TEST_SORT=y
@@ -814,5 +814,3 @@ CONFIG_INTERVAL_TREE_TEST=m · 3 unmodified lines
814CONFIG_PERCPU_TEST=m814CONFIG_PERCPU_TEST=m
815CONFIG_ATOMIC64_SELFTEST=y815CONFIG_ATOMIC64_SELFTEST=y
816CONFIG_TEST_BPF=m816CONFIG_TEST_BPF=m
817CONFIG_BUG_ON_DATA_CORRUPTION=y
818CONFIG_S390_PTDUMP=y
arch/s390/configs/defconfig+5−6
@@ -53,6 +53,7 @@ CONFIG_VFIO_AP=m · 52 unmodified lines
53CONFIG_CRASH_DUMP=y53CONFIG_CRASH_DUMP=y
54CONFIG_HIBERNATION=y54CONFIG_HIBERNATION=y
55CONFIG_PM_DEBUG=y55CONFIG_PM_DEBUG=y
56CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y
56CONFIG_CMM=m57CONFIG_CMM=m
57CONFIG_APPLDATA_BASE=y58CONFIG_APPLDATA_BASE=y
58CONFIG_KVM=m59CONFIG_KVM=m
@@ -470,7 +471,6 @@ CONFIG_NLMON=m · 411 unmodified lines
470# CONFIG_NET_VENDOR_EMULEX is not set471# CONFIG_NET_VENDOR_EMULEX is not set
471# CONFIG_NET_VENDOR_EZCHIP is not set472# CONFIG_NET_VENDOR_EZCHIP is not set
472# CONFIG_NET_VENDOR_GOOGLE is not set473# CONFIG_NET_VENDOR_GOOGLE is not set
473# CONFIG_NET_VENDOR_HP is not set
474# CONFIG_NET_VENDOR_HUAWEI is not set474# CONFIG_NET_VENDOR_HUAWEI is not set
475# CONFIG_NET_VENDOR_INTEL is not set475# CONFIG_NET_VENDOR_INTEL is not set
476# CONFIG_NET_VENDOR_MARVELL is not set476# CONFIG_NET_VENDOR_MARVELL is not set
@@ -677,7 +677,6 @@ CONFIG_CRYPTO_ADIANTUM=m · 200 unmodified lines
677CONFIG_CRYPTO_XCBC=m677CONFIG_CRYPTO_XCBC=m
678CONFIG_CRYPTO_VMAC=m678CONFIG_CRYPTO_VMAC=m
679CONFIG_CRYPTO_CRC32=m679CONFIG_CRYPTO_CRC32=m
680CONFIG_CRYPTO_XXHASH=m
681CONFIG_CRYPTO_MICHAEL_MIC=m680CONFIG_CRYPTO_MICHAEL_MIC=m
682CONFIG_CRYPTO_RMD128=m681CONFIG_CRYPTO_RMD128=m
683CONFIG_CRYPTO_RMD160=m682CONFIG_CRYPTO_RMD160=m
@@ -739,18 +738,18 @@ CONFIG_DEBUG_SECTION_MISMATCH=y · 55 unmodified lines
739CONFIG_MAGIC_SYSRQ=y738CONFIG_MAGIC_SYSRQ=y
740CONFIG_DEBUG_MEMORY_INIT=y739CONFIG_DEBUG_MEMORY_INIT=y
741CONFIG_PANIC_ON_OOPS=y740CONFIG_PANIC_ON_OOPS=y
741CONFIG_BUG_ON_DATA_CORRUPTION=y
742CONFIG_RCU_TORTURE_TEST=m742CONFIG_RCU_TORTURE_TEST=m
743CONFIG_RCU_CPU_STALL_TIMEOUT=60743CONFIG_RCU_CPU_STALL_TIMEOUT=60
744CONFIG_LATENCYTOP=y744CONFIG_LATENCYTOP=y
745CONFIG_FUNCTION_PROFILER=y
746CONFIG_STACK_TRACER=y
745CONFIG_SCHED_TRACER=y747CONFIG_SCHED_TRACER=y
746CONFIG_FTRACE_SYSCALLS=y748CONFIG_FTRACE_SYSCALLS=y
747CONFIG_STACK_TRACER=y
748CONFIG_BLK_DEV_IO_TRACE=y749CONFIG_BLK_DEV_IO_TRACE=y
749CONFIG_FUNCTION_PROFILER=y
750CONFIG_HIST_TRIGGERS=y750CONFIG_HIST_TRIGGERS=y
751CONFIG_S390_PTDUMP=y
751CONFIG_LKDTM=m752CONFIG_LKDTM=m
752CONFIG_PERCPU_TEST=m753CONFIG_PERCPU_TEST=m
753CONFIG_ATOMIC64_SELFTEST=y754CONFIG_ATOMIC64_SELFTEST=y
754CONFIG_TEST_BPF=m755CONFIG_TEST_BPF=m
755CONFIG_BUG_ON_DATA_CORRUPTION=y
756CONFIG_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
42 42
43static inline void storage_key_init_range(unsigned long start, unsigned long end)43static inline void storage_key_init_range(unsigned long start, unsigned long end)
44{44{
45 if (PAGE_DEFAULT_KEY)45 if (PAGE_DEFAULT_KEY != 0)
46 __storage_key_init_range(start, end);46 __storage_key_init_range(start, end);
47}47}
48 48
arch/s390/include/asm/processor.h+0−1
@@ -84,7 +84,6 @@ void s390_update_cpu_mhz(void); · 83 unmodified lines
84void cpu_detect_mhz_feature(void);84void cpu_detect_mhz_feature(void);
85 85
86extern const struct seq_operations cpuinfo_op;86extern const struct seq_operations cpuinfo_op;
87extern int sysctl_ieee_emulation_warnings;
88extern void execve_tail(void);87extern void execve_tail(void);
89extern void __bpon(void);88extern void __bpon(void);
90 89
arch/s390/include/asm/qdio.h+3−3
@@ -201,7 +201,7 @@ struct slib { · 200 unmodified lines
201 * @scount: SBAL count201 * @scount: SBAL count
202 * @sflags: whole SBAL flags202 * @sflags: whole SBAL flags
203 * @length: length203 * @length: length
204 * @addr: address204 * @addr: absolute data address
205*/205*/
206struct qdio_buffer_element {206struct qdio_buffer_element {
207 u8 eflags;207 u8 eflags;
@@ -211,7 +211,7 @@ struct qdio_buffer_element { · 3 unmodified lines
211 u8 scount;211 u8 scount;
212 u8 sflags;212 u8 sflags;
213 u32 length;213 u32 length;
214 void *addr;214 u64 addr;
215} __attribute__ ((packed, aligned(16)));215} __attribute__ ((packed, aligned(16)));
216 216
217/**217/**
@@ -227,7 +227,7 @@ struct qdio_buffer { · 9 unmodified lines
227 * @sbal: absolute SBAL address227 * @sbal: absolute SBAL address
228 */228 */
229struct sl_element {229struct sl_element {
230 unsigned long sbal;230 u64 sbal;
231} __attribute__ ((packed));231} __attribute__ ((packed));
232 232
233/**233/**
arch/s390/include/asm/timex.h+1−1
@@ -155,7 +155,7 @@ static inline void get_tod_clock_ext(char *clk) · 154 unmodified lines
155 155
156static inline unsigned long long get_tod_clock(void)156static inline unsigned long long get_tod_clock(void)
157{157{
158 unsigned char clk[STORE_CLOCK_EXT_SIZE];158 char clk[STORE_CLOCK_EXT_SIZE];
159 159
160 get_tod_clock_ext(clk);160 get_tod_clock_ext(clk);
161 return *((unsigned long long *)&clk[1]);161 return *((unsigned long long *)&clk[1]);
arch/x86/boot/compressed/kaslr_64.c+0−3
@@ -29,9 +29,6 @@ · 28 unmodified lines
29#define __PAGE_OFFSET __PAGE_OFFSET_BASE29#define __PAGE_OFFSET __PAGE_OFFSET_BASE
30#include "../../mm/ident_map.c"30#include "../../mm/ident_map.c"
31 31
32/* Used by pgtable.h asm code to force instruction serialization. */
33unsigned long __force_order;
34
35/* Used to track our page table allocation area. */32/* Used to track our page table allocation area. */
36struct alloc_pgt_data {33struct alloc_pgt_data {
37 unsigned char *pgt_buf;34 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
250 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,250 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
251 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,251 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
252 [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,252 [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
253 [PERF_COUNT_HW_CACHE_MISSES] = 0x0964,
253 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,254 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
254 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,255 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
255 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x0287,256 [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
4765 break;4765 break;
4766 4766
4767 case INTEL_FAM6_ATOM_TREMONT_D:4767 case INTEL_FAM6_ATOM_TREMONT_D:
4768 case INTEL_FAM6_ATOM_TREMONT:
4768 x86_pmu.late_ack = true;4769 x86_pmu.late_ack = true;
4769 memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,4770 memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
4770 sizeof(hw_cache_event_ids));4771 sizeof(hw_cache_event_ids));
arch/x86/events/intel/cstate.c+13−9
@@ -40,17 +40,18 @@ · 39 unmodified lines
40 * Model specific counters:40 * Model specific counters:
41 * MSR_CORE_C1_RES: CORE C1 Residency Counter41 * MSR_CORE_C1_RES: CORE C1 Residency Counter
42 * perf code: 0x0042 * perf code: 0x00
43 * Available model: SLM,AMT,GLM,CNL43 * Available model: SLM,AMT,GLM,CNL,TNT
44 * Scope: Core (each processor core has a MSR)44 * Scope: Core (each processor core has a MSR)
45 * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter45 * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter
46 * perf code: 0x0146 * perf code: 0x01
47 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM,47 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM,
48 * CNL,KBL,CML48 * CNL,KBL,CML,TNT
49 * Scope: Core49 * Scope: Core
50 * MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter50 * MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter
51 * perf code: 0x0251 * perf code: 0x02
52 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,52 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
53 * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL53 * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
54 * TNT
54 * Scope: Core55 * Scope: Core
55 * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter56 * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter
56 * perf code: 0x0357 * perf code: 0x03
@@ -60,17 +61,18 @@ · 3 unmodified lines
60 * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter.61 * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter.
61 * perf code: 0x0062 * perf code: 0x00
62 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL,63 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL,
63 * KBL,CML,ICL,TGL64 * KBL,CML,ICL,TGL,TNT
64 * Scope: Package (physical package)65 * Scope: Package (physical package)
65 * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter.66 * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter.
66 * perf code: 0x0167 * perf code: 0x01
67 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL,68 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL,
68 * GLM,CNL,KBL,CML,ICL,TGL69 * GLM,CNL,KBL,CML,ICL,TGL,TNT
69 * Scope: Package (physical package)70 * Scope: Package (physical package)
70 * MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter.71 * MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter.
71 * perf code: 0x0272 * perf code: 0x02
72 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW73 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
73 * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL74 * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
75 * TNT
74 * Scope: Package (physical package)76 * Scope: Package (physical package)
75 * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter.77 * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter.
76 * perf code: 0x0378 * perf code: 0x03
@@ -87,7 +89,8 @@ · 10 unmodified lines
87 * Scope: Package (physical package)89 * Scope: Package (physical package)
88 * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter.90 * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter.
89 * perf code: 0x0691 * perf code: 0x06
90 * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL92 * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL,
93 * TNT
91 * Scope: Package (physical package)94 * Scope: Package (physical package)
92 *95 *
93 */96 */
@@ -640,8 +643,9 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { · 546 unmodified lines
640 643
641 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT, glm_cstates),644 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT, glm_cstates),
642 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_D, glm_cstates),645 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_D, glm_cstates),
643
644 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_PLUS, glm_cstates),646 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),
645 649
646 X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_L, icl_cstates),650 X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_L, icl_cstates),
647 X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE, icl_cstates),651 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
1714 old = ((s64)(prev_raw_count << shift) >> shift);1714 old = ((s64)(prev_raw_count << shift) >> shift);
1715 local64_add(new - old + count * period, &event->count);1715 local64_add(new - old + count * period, &event->count);
1716 1716
1717 local64_set(&hwc->period_left, -new);
1718
1717 perf_event_update_userpage(event);1719 perf_event_update_userpage(event);
1718 1720
1719 return 0;1721 return 0;
arch/x86/events/msr.c+2−1
@@ -75,8 +75,9 @@ static bool test_intel(int idx, void *data) · 74 unmodified lines
75 75
76 case INTEL_FAM6_ATOM_GOLDMONT:76 case INTEL_FAM6_ATOM_GOLDMONT:
77 case INTEL_FAM6_ATOM_GOLDMONT_D:77 case INTEL_FAM6_ATOM_GOLDMONT_D:
78
79 case INTEL_FAM6_ATOM_GOLDMONT_PLUS:78 case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
79 case INTEL_FAM6_ATOM_TREMONT_D:
80 case INTEL_FAM6_ATOM_TREMONT:
80 81
81 case INTEL_FAM6_XEON_PHI_KNL:82 case INTEL_FAM6_XEON_PHI_KNL:
82 case INTEL_FAM6_XEON_PHI_KNM:83 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
19void io_bitmap_share(struct task_struct *tsk);19void io_bitmap_share(struct task_struct *tsk);
20void io_bitmap_exit(void);20void io_bitmap_exit(void);
21 21
22void tss_update_io_bitmap(void);22void 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
23#else30#else
24static inline void io_bitmap_share(struct task_struct *tsk) { }31static inline void io_bitmap_share(struct task_struct *tsk) { }
25static inline void io_bitmap_exit(void) { }32static 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
292#define X86EMUL_SMM_MASK (1 << 6)292#define X86EMUL_SMM_MASK (1 << 6)
293#define X86EMUL_SMM_INSIDE_NMI_MASK (1 << 7)293#define X86EMUL_SMM_INSIDE_NMI_MASK (1 << 7)
294 294
295/*
296 * fastop functions are declared as taking a never-defined fastop parameter,
297 * so they can't be called from C directly.
298 */
299struct fastop;
300
301typedef void (*fastop_t)(struct fastop *);
302
295struct x86_emulate_ctxt {303struct x86_emulate_ctxt {
296 const struct x86_emulate_ops *ops;304 const struct x86_emulate_ops *ops;
297 305
@@ -324,7 +332,10 @@ struct x86_emulate_ctxt { · 26 unmodified lines
324 struct operand src;332 struct operand src;
325 struct operand src2;333 struct operand src2;
326 struct operand dst;334 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 };
328 int (*check_perm)(struct x86_emulate_ctxt *ctxt);339 int (*check_perm)(struct x86_emulate_ctxt *ctxt);
329 /*340 /*
330 * The following six fields are cleared together,341 * 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
781 u64 msr_kvm_poll_control;781 u64 msr_kvm_poll_control;
782 782
783 /*783 /*
784 * Indicate whether the access faults on its page table in guest784 * Indicates the guest is trying to write a gfn that contains one or
785 * which is set when fix page fault and used to detect unhandeable785 * more of the PTEs used to translate the write itself, i.e. the access
786 * instruction.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.
787 */797 */
788 bool write_fault_to_shadow_pgtable;798 bool write_fault_to_shadow_pgtable;
789 799
@@ -1112,6 +1122,7 @@ struct kvm_x86_ops { · 322 unmodified lines
1112 int (*handle_exit)(struct kvm_vcpu *vcpu,1122 int (*handle_exit)(struct kvm_vcpu *vcpu,
1113 enum exit_fastpath_completion exit_fastpath);1123 enum exit_fastpath_completion exit_fastpath);
1114 int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);1124 int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);
1125 void (*update_emulated_instruction)(struct kvm_vcpu *vcpu);
1115 void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);1126 void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
1116 u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu);1127 u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu);
1117 void (*patch_hypercall)(struct kvm_vcpu *vcpu,1128 void (*patch_hypercall)(struct kvm_vcpu *vcpu,
@@ -1136,7 +1147,7 @@ struct kvm_x86_ops { · 18 unmodified lines
1136 void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);1147 void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
1137 void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);1148 void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu);
1138 void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu, hpa_t hpa);1149 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);
1140 int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);1151 int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);
1141 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);1152 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
1142 int (*set_identity_map_addr)(struct kvm *kvm, u64 ident_addr);1153 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
512#define MSR_K7_HWCR 0xc0010015512#define MSR_K7_HWCR 0xc0010015
513#define MSR_K7_HWCR_SMMLOCK_BIT 0513#define MSR_K7_HWCR_SMMLOCK_BIT 0
514#define MSR_K7_HWCR_SMMLOCK BIT_ULL(MSR_K7_HWCR_SMMLOCK_BIT)514#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)
515#define MSR_K7_FID_VID_CTL 0xc0010041517#define MSR_K7_FID_VID_CTL 0xc0010041
516#define MSR_K7_FID_VID_STATUS 0xc0010042518#define MSR_K7_FID_VID_STATUS 0xc0010042
517 519
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
295 PVOP_VCALL3(cpu.write_idt_entry, dt, entry, g);295 PVOP_VCALL3(cpu.write_idt_entry, dt, entry, g);
296}296}
297 297
298#ifdef CONFIG_X86_IOPL_IOPERM
299static inline void tss_update_io_bitmap(void)
300{
301 PVOP_VCALL0(cpu.update_io_bitmap);
302}
303#endif
304
298static inline void paravirt_activate_mm(struct mm_struct *prev,305static inline void paravirt_activate_mm(struct mm_struct *prev,
299 struct mm_struct *next)306 struct mm_struct *next)
300{307{
arch/x86/include/asm/paravirt_types.h+4−0
@@ -140,6 +140,10 @@ struct pv_cpu_ops { · 139 unmodified lines
140 140
141 void (*load_sp0)(unsigned long sp0);141 void (*load_sp0)(unsigned long sp0);
142 142
143#ifdef CONFIG_X86_IOPL_IOPERM
144 void (*update_io_bitmap)(void);
145#endif
146
143 void (*wbinvd)(void);147 void (*wbinvd)(void);
144 148
145 /* cpuid emulation, mostly so that caps bits can be disabled */149 /* 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
72#define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC)72#define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC)
73#define SECONDARY_EXEC_PT_USE_GPA VMCS_CONTROL_BIT(PT_USE_GPA)73#define SECONDARY_EXEC_PT_USE_GPA VMCS_CONTROL_BIT(PT_USE_GPA)
74#define SECONDARY_EXEC_TSC_SCALING VMCS_CONTROL_BIT(TSC_SCALING)74#define SECONDARY_EXEC_TSC_SCALING VMCS_CONTROL_BIT(TSC_SCALING)
75#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE 0x0400000075#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE VMCS_CONTROL_BIT(USR_WAIT_PAUSE)
76 76
77#define PIN_BASED_EXT_INTR_MASK VMCS_CONTROL_BIT(INTR_EXITING)77#define PIN_BASED_EXT_INTR_MASK VMCS_CONTROL_BIT(INTR_EXITING)
78#define PIN_BASED_NMI_EXITING VMCS_CONTROL_BIT(NMI_EXITING)78#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
81#define VMX_FEATURE_MODE_BASED_EPT_EXEC ( 2*32+ 22) /* "ept_mode_based_exec" Enable separate EPT EXEC bits for supervisor vs. user */81#define VMX_FEATURE_MODE_BASED_EPT_EXEC ( 2*32+ 22) /* "ept_mode_based_exec" Enable separate EPT EXEC bits for supervisor vs. user */
82#define VMX_FEATURE_PT_USE_GPA ( 2*32+ 24) /* "" Processor Trace logs GPAs */82#define VMX_FEATURE_PT_USE_GPA ( 2*32+ 24) /* "" Processor Trace logs GPAs */
83#define VMX_FEATURE_TSC_SCALING ( 2*32+ 25) /* Scale hardware TSC when read in guest */83#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 */
84#define VMX_FEATURE_ENCLV_EXITING ( 2*32+ 28) /* "" VM-Exit on ENCLV (leaf dependent) */85#define VMX_FEATURE_ENCLV_EXITING ( 2*32+ 28) /* "" VM-Exit on ENCLV (leaf dependent) */
85 86
86#endif /* _ASM_X86_VMXFEATURES_H */87#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
390#define KVM_STATE_NESTED_GUEST_MODE 0x00000001390#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
391#define KVM_STATE_NESTED_RUN_PENDING 0x00000002391#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
392#define KVM_STATE_NESTED_EVMCS 0x00000004392#define KVM_STATE_NESTED_EVMCS 0x00000004
393#define KVM_STATE_NESTED_MTF_PENDING 0x00000008
393 394
394#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001395#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
395#define KVM_STATE_NESTED_SMM_VMXON 0x00000002396#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
arch/x86/kernel/cpu/amd.c+14−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 28
29static const int amd_erratum_383[];29static const int amd_erratum_383[];
30static const int amd_erratum_400[];30static const int amd_erratum_400[];
31static const int amd_erratum_1054[];
31static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);32static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);
32 33
33/*34/*
@@ -972,6 +973,15 @@ static void init_amd(struct cpuinfo_x86 *c) · 938 unmodified lines
972 /* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */973 /* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */
973 if (!cpu_has(c, X86_FEATURE_XENPV))974 if (!cpu_has(c, X86_FEATURE_XENPV))
974 set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);975 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);
975}985}
976 986
977#ifdef CONFIG_X86_32987#ifdef CONFIG_X86_32
@@ -1099,6 +1109,10 @@ static const int amd_erratum_400[] = · 121 unmodified lines
1099static const int amd_erratum_383[] =1109static const int amd_erratum_383[] =
1100 AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf));1110 AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf));
1101 1111
1112/* #1054: Instructions Retired Performance Counter May Be Inaccurate */
1113static const int amd_erratum_1054[] =
1114 AMD_OSVW_ERRATUM(0, AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf));
1115
1102 1116
1103static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)1117static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
1104{1118{
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
445 * cpuid bit to be set. We need to ensure that we445 * cpuid bit to be set. We need to ensure that we
446 * update that bit in this CPU's "cpu_info".446 * update that bit in this CPU's "cpu_info".
447 */447 */
448 get_cpu_cap(c);448 set_cpu_cap(c, X86_FEATURE_OSPKE);
449}449}
450 450
451#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS451#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
1163 .store = store,1163 .store = store,
1164};1164};
1165 1165
1166static void threshold_block_release(struct kobject *kobj);
1167
1166static struct kobj_type threshold_ktype = {1168static struct kobj_type threshold_ktype = {
1167 .sysfs_ops = &threshold_ops,1169 .sysfs_ops = &threshold_ops,
1168 .default_attrs = default_attrs,1170 .default_attrs = default_attrs,
1171 .release = threshold_block_release,
1169};1172};
1170 1173
1171static const char *get_name(unsigned int bank, struct threshold_block *b)1174static 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
1198 return buf_mcatype;1201 return buf_mcatype;
1199}1202}
1200 1203
1201static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank,1204static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb,
1202 unsigned int block, u32 address)1205 unsigned int bank, unsigned int block,
1206 u32 address)
1203{1207{
1204 struct threshold_block *b = NULL;1208 struct threshold_block *b = NULL;
1205 u32 low, high;1209 u32 low, high;
@@ -1243,16 +1247,12 @@ static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, · 37 unmodified lines
1243 1247
1244 INIT_LIST_HEAD(&b->miscj);1248 INIT_LIST_HEAD(&b->miscj);
1245 1249
1246 if (per_cpu(threshold_banks, cpu)[bank]->blocks) {1250 if (tb->blocks)
1247 list_add(&b->miscj,1251 list_add(&b->miscj, &tb->blocks->miscj);
1248 &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj);1252 else
1249 } else {1253 tb->blocks = b;
1250 per_cpu(threshold_banks, cpu)[bank]->blocks = b;
1251 }
1252 1254
1253 err = kobject_init_and_add(&b->kobj, &threshold_ktype,1255 err = kobject_init_and_add(&b->kobj, &threshold_ktype, tb->kobj, get_name(bank, b));
1254 per_cpu(threshold_banks, cpu)[bank]->kobj,
1255 get_name(bank, b));
1256 if (err)1256 if (err)
1257 goto out_free;1257 goto out_free;
1258recurse:1258recurse:
@@ -1260,7 +1260,7 @@ recurse: · 1 unmodified line
1260 if (!address)1260 if (!address)
1261 return 0;1261 return 0;
1262 1262
1263 err = allocate_threshold_blocks(cpu, bank, block, address);1263 err = allocate_threshold_blocks(cpu, tb, bank, block, address);
1264 if (err)1264 if (err)
1265 goto out_free;1265 goto out_free;
1266 1266
@@ -1345,8 +1345,6 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 78 unmodified lines
1345 goto out_free;1345 goto out_free;
1346 }1346 }
1347 1347
1348 per_cpu(threshold_banks, cpu)[bank] = b;
1349
1350 if (is_shared_bank(bank)) {1348 if (is_shared_bank(bank)) {
1351 refcount_set(&b->cpus, 1);1349 refcount_set(&b->cpus, 1);
1352 1350
@@ -1357,9 +1355,13 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 4 unmodified lines
1357 }1355 }
1358 }1356 }
1359 1357
1360 err = allocate_threshold_blocks(cpu, bank, 0, msr_ops.misc(bank));1358 err = allocate_threshold_blocks(cpu, b, bank, 0, msr_ops.misc(bank));
1361 if (!err)1359 if (err)
1362 goto out;1360 goto out_free;
1361
1362 per_cpu(threshold_banks, cpu)[bank] = b;
1363
1364 return 0;
1363 1365
1364 out_free:1366 out_free:
1365 kfree(b);1367 kfree(b);
@@ -1368,8 +1370,12 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 2 unmodified lines
1368 return err;1370 return err;
1369}1371}
1370 1372
1371static void deallocate_threshold_block(unsigned int cpu,1373static void threshold_block_release(struct kobject *kobj)
1372 unsigned int bank)1374{
1375 kfree(to_block(kobj));
1376}
1377
1378static void deallocate_threshold_block(unsigned int cpu, unsigned int bank)
1373{1379{
1374 struct threshold_block *pos = NULL;1380 struct threshold_block *pos = NULL;
1375 struct threshold_block *tmp = NULL;1381 struct threshold_block *tmp = NULL;
@@ -1379,13 +1385,11 @@ static void deallocate_threshold_block(unsigned int cpu, · 3 unmodified lines
1379 return;1385 return;
1380 1386
1381 list_for_each_entry_safe(pos, tmp, &head->blocks->miscj, miscj) {1387 list_for_each_entry_safe(pos, tmp, &head->blocks->miscj, miscj) {
1382 kobject_put(&pos->kobj);
1383 list_del(&pos->miscj);1388 list_del(&pos->miscj);
1384 kfree(pos);1389 kobject_put(&pos->kobj);
1385 }1390 }
1386 1391
1387 kfree(per_cpu(threshold_banks, cpu)[bank]->blocks);1392 kobject_put(&head->blocks->kobj);
1388 per_cpu(threshold_banks, cpu)[bank]->blocks = NULL;
1389}1393}
1390 1394
1391static void __threshold_remove_blocks(struct threshold_bank *b)1395static 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
10 10
11static enum efi_secureboot_mode get_sb_mode(void)11static enum efi_secureboot_mode get_sb_mode(void)
12{12{
13 efi_char16_t efi_SecureBoot_name[] = L"SecureBoot";
14 efi_char16_t efi_SetupMode_name[] = L"SecureBoot";
15 efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID;13 efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
16 efi_status_t status;14 efi_status_t status;
17 unsigned long size;15 unsigned long size;
@@ -25,7 +23,7 @@ static enum efi_secureboot_mode get_sb_mode(void) · 7 unmodified lines
25 }23 }
26 24
27 /* Get variable contents into buffer */25 /* 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,
29 NULL, &size, &secboot);27 NULL, &size, &secboot);
30 if (status == EFI_NOT_FOUND) {28 if (status == EFI_NOT_FOUND) {
31 pr_info("ima: secureboot mode disabled\n");29 pr_info("ima: secureboot mode disabled\n");
@@ -38,7 +36,7 @@ static enum efi_secureboot_mode get_sb_mode(void) · 6 unmodified lines
38 }36 }
39 37
40 size = sizeof(setupmode);38 size = sizeof(setupmode);
41 status = efi.get_variable(efi_SetupMode_name, &efi_variable_guid,39 status = efi.get_variable(L"SetupMode", &efi_variable_guid,
42 NULL, &size, &setupmode);40 NULL, &size, &setupmode);
43 41
44 if (status != EFI_SUCCESS) /* ignore unknown SetupMode */42 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
425 }425 }
426}426}
427 427
428static 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
435static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask);
436
428#ifdef CONFIG_SMP437#ifdef CONFIG_SMP
438
439static bool pv_ipi_supported(void)
440{
441 return kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI);
442}
443
444static 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
429#define KVM_IPI_CLUSTER_SIZE (2 * BITS_PER_LONG)451#define KVM_IPI_CLUSTER_SIZE (2 * BITS_PER_LONG)
430 452
431static void __send_ipi_mask(const struct cpumask *mask, int vector)453static 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
490static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector)512static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector)
491{513{
492 unsigned int this_cpu = smp_processor_id();514 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);
494 const struct cpumask *local_mask;516 const struct cpumask *local_mask;
495 517
496 cpumask_copy(&new_mask, mask);518 cpumask_copy(new_mask, mask);
497 cpumask_clear_cpu(this_cpu, &new_mask);519 cpumask_clear_cpu(this_cpu, new_mask);
498 local_mask = &new_mask;520 local_mask = new_mask;
499 __send_ipi_mask(local_mask, vector);521 __send_ipi_mask(local_mask, vector);
500}522}
501 523
@@ -575,7 +597,6 @@ static void __init kvm_apf_trap_init(void) · 73 unmodified lines
575 update_intr_gate(X86_TRAP_PF, async_page_fault);597 update_intr_gate(X86_TRAP_PF, async_page_fault);
576}598}
577 599
578static DEFINE_PER_CPU(cpumask_var_t, __pv_tlb_mask);
579 600
580static void kvm_flush_tlb_others(const struct cpumask *cpumask,601static void kvm_flush_tlb_others(const struct cpumask *cpumask,
581 const struct flush_tlb_info *info)602 const struct flush_tlb_info *info)
@@ -583,7 +604,7 @@ static void kvm_flush_tlb_others(const struct cpumask *cpumask, · 1 unmodified line
583 u8 state;604 u8 state;
584 int cpu;605 int cpu;
585 struct kvm_steal_time *src;606 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);
587 608
588 cpumask_copy(flushmask, cpumask);609 cpumask_copy(flushmask, cpumask);
589 /*610 /*
@@ -619,11 +640,10 @@ static void __init kvm_guest_init(void) · 29 unmodified lines
619 pv_ops.time.steal_clock = kvm_steal_clock;640 pv_ops.time.steal_clock = kvm_steal_clock;
620 }641 }
621 642
622 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&643 if (pv_tlb_flush_supported()) {
623 !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
624 kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
625 pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;644 pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
626 pv_ops.mmu.tlb_remove_table = tlb_remove_table;645 pv_ops.mmu.tlb_remove_table = tlb_remove_table;
646 pr_info("KVM setup pv remote TLB flush\n");
627 }647 }
628 648
629 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))649 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
@@ -632,9 +652,7 @@ static void __init kvm_guest_init(void) · 2 unmodified lines
632#ifdef CONFIG_SMP652#ifdef CONFIG_SMP
633 smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus;653 smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus;
634 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;654 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;
635 if (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&655 if (pv_sched_yield_supported()) {
636 !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
637 kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
638 smp_ops.send_call_func_ipi = kvm_smp_send_call_func_ipi;656 smp_ops.send_call_func_ipi = kvm_smp_send_call_func_ipi;
639 pr_info("KVM setup pv sched yield\n");657 pr_info("KVM setup pv sched yield\n");
640 }658 }
@@ -700,7 +718,7 @@ static uint32_t __init kvm_detect(void) · 59 unmodified lines
700static void __init kvm_apic_init(void)718static void __init kvm_apic_init(void)
701{719{
702#if defined(CONFIG_SMP)720#if defined(CONFIG_SMP)
703 if (kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI))721 if (pv_ipi_supported())
704 kvm_setup_pv_ipi();722 kvm_setup_pv_ipi();
705#endif723#endif
706}724}
@@ -732,26 +750,31 @@ static __init int activate_jump_labels(void) · 25 unmodified lines
732}750}
733arch_initcall(activate_jump_labels);751arch_initcall(activate_jump_labels);
734 752
735static __init int kvm_setup_pv_tlb_flush(void)753static __init int kvm_alloc_cpumask(void)
736{754{
737 int cpu;755 int cpu;
756 bool alloc = false;
738 757
739 if (!kvm_para_available() || nopv)758 if (!kvm_para_available() || nopv)
740 return 0;759 return 0;
741 760
742 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&761 if (pv_tlb_flush_supported())
743 !kvm_para_has_hint(KVM_HINTS_REALTIME) &&762 alloc = true;
744 kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {763
764#if defined(CONFIG_SMP)
765 if (pv_ipi_supported())
766 alloc = true;
767#endif
768
769 if (alloc)
745 for_each_possible_cpu(cpu) {770 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),
747 GFP_KERNEL, cpu_to_node(cpu));772 GFP_KERNEL, cpu_to_node(cpu));
748 }773 }
749 pr_info("KVM setup pv remote TLB flush\n");
750 }
751 774
752 return 0;775 return 0;
753}776}
754arch_initcall(kvm_setup_pv_tlb_flush);777arch_initcall(kvm_alloc_cpumask);
755 778
756#ifdef CONFIG_PARAVIRT_SPINLOCKS779#ifdef CONFIG_PARAVIRT_SPINLOCKS
757 780
arch/x86/kernel/paravirt.c+5−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30#include <asm/timer.h>30#include <asm/timer.h>
31#include <asm/special_insns.h>31#include <asm/special_insns.h>
32#include <asm/tlb.h>32#include <asm/tlb.h>
33#include <asm/io_bitmap.h>
33 34
34/*35/*
35 * nop stub, which must not clobber anything *including the stack* to36 * nop stub, which must not clobber anything *including the stack* to
@@ -341,6 +342,10 @@ struct paravirt_patch_template pv_ops = { · 305 unmodified lines
341 .cpu.iret = native_iret,342 .cpu.iret = native_iret,
342 .cpu.swapgs = native_swapgs,343 .cpu.swapgs = native_swapgs,
343 344
345#ifdef CONFIG_X86_IOPL_IOPERM
346 .cpu.update_io_bitmap = native_tss_update_io_bitmap,
347#endif
348
344 .cpu.start_context_switch = paravirt_nop,349 .cpu.start_context_switch = paravirt_nop,
345 .cpu.end_context_switch = paravirt_nop,350 .cpu.end_context_switch = paravirt_nop,
346 351
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
374/**374/**
375 * tss_update_io_bitmap - Update I/O bitmap before exiting to usermode375 * tss_update_io_bitmap - Update I/O bitmap before exiting to usermode
376 */376 */
377void tss_update_io_bitmap(void)377void native_tss_update_io_bitmap(void)
378{378{
379 struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw);379 struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw);
380 struct thread_struct *t = &current->thread;380 struct thread_struct *t = &current->thread;
arch/x86/kvm/Kconfig+13−0
@@ -59,6 +59,19 @@ config KVM · 58 unmodified lines
59 59
60 If unsure, say N.60 If unsure, say N.
61 61
62config 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
62config KVM_INTEL75config KVM_INTEL
63 tristate "KVM for Intel (and compatible) processors support"76 tristate "KVM for Intel (and compatible) processors support"
64 depends on KVM && IA32_FEAT_CTL77 depends on KVM && IA32_FEAT_CTL
arch/x86/kvm/Makefile+1−0
@@ -1,6 +1,7 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2 2
3ccflags-y += -Iarch/x86/kvm3ccflags-y += -Iarch/x86/kvm
4ccflags-$(CONFIG_KVM_WERROR) += -Werror
4 5
5KVM := ../../../virt/kvm6KVM := ../../../virt/kvm
6 7
arch/x86/kvm/emulate.c+14−22
@@ -191,25 +191,6 @@ · 190 unmodified lines
191#define NR_FASTOP (ilog2(sizeof(ulong)) + 1)191#define NR_FASTOP (ilog2(sizeof(ulong)) + 1)
192#define FASTOP_SIZE 8192#define FASTOP_SIZE 8
193 193
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
211struct fastop;
212
213struct opcode {194struct opcode {
214 u64 flags : 56;195 u64 flags : 56;
215 u64 intercept : 8;196 u64 intercept : 8;
@@ -311,8 +292,19 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) · 95 unmodified lines
311#define ON64(x)292#define ON64(x)
312#endif293#endif
313 294
314typedef void (*fastop_t)(struct fastop *);295/*
315 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 */
316static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);308static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
317 309
318#define __FOP_FUNC(name) \310#define __FOP_FUNC(name) \
@@ -5683,7 +5675,7 @@ special_insn: · 5364 unmodified lines
5683 5675
5684 if (ctxt->execute) {5676 if (ctxt->execute) {
5685 if (ctxt->d & Fastop)5677 if (ctxt->d & Fastop)
5686 rc = fastop(ctxt, (fastop_t)ctxt->execute);5678 rc = fastop(ctxt, ctxt->fop);
5687 else5679 else
5688 rc = ctxt->execute(ctxt);5680 rc = ctxt->execute(ctxt);
5689 if (rc != X86EMUL_CONTINUE)5681 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
417 417
418 kvm_set_msi_irq(vcpu->kvm, entry, &irq);418 kvm_set_msi_irq(vcpu->kvm, entry, &irq);
419 419
420 if (irq.level &&420 if (irq.trig_mode &&
421 kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,421 kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,
422 irq.dest_id, irq.dest_mode))422 irq.dest_id, irq.dest_mode))
423 __set_bit(irq.vector, ioapic_handled_vectors);423 __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
627static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu)627static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu)
628{628{
629 u8 val;629 u8 val;
630 if (pv_eoi_get_user(vcpu, &val) < 0)630 if (pv_eoi_get_user(vcpu, &val) < 0) {
631 printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n",631 printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n",
632 (unsigned long long)vcpu->arch.pv_eoi.msr_val);632 (unsigned long long)vcpu->arch.pv_eoi.msr_val);
633 return false;
634 }
633 return val & 0x1;635 return val & 0x1;
634}636}
635 637
@@ -1046,11 +1048,8 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 410 unmodified lines
1046 apic->regs + APIC_TMR);1048 apic->regs + APIC_TMR);
1047 }1049 }
1048 1050
1049 if (vcpu->arch.apicv_active)1051 if (kvm_x86_ops->deliver_posted_interrupt(vcpu, vector)) {
1050 kvm_x86_ops->deliver_posted_interrupt(vcpu, vector);
1051 else {
1052 kvm_lapic_set_irr(vector, apic);1052 kvm_lapic_set_irr(vector, apic);
1053
1054 kvm_make_request(KVM_REQ_EVENT, vcpu);1053 kvm_make_request(KVM_REQ_EVENT, vcpu);
1055 kvm_vcpu_kick(vcpu);1054 kvm_vcpu_kick(vcpu);
1056 }1055 }
@@ -1080,9 +1079,6 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 23 unmodified lines
1080 result = 1;1079 result = 1;
1081 /* assumes that there are only KVM_APIC_INIT/SIPI */1080 /* assumes that there are only KVM_APIC_INIT/SIPI */
1082 apic->pending_events = (1UL << KVM_APIC_INIT);1081 apic->pending_events = (1UL << KVM_APIC_INIT);
1083 /* make sure pending_events is visible before sending
1084 * the request */
1085 smp_wmb();
1086 kvm_make_request(KVM_REQ_EVENT, vcpu);1082 kvm_make_request(KVM_REQ_EVENT, vcpu);
1087 kvm_vcpu_kick(vcpu);1083 kvm_vcpu_kick(vcpu);
1088 }1084 }
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
102 kvm_get_active_pcid(vcpu));102 kvm_get_active_pcid(vcpu));
103}103}
104 104
105int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
106 bool prefault);
107
108static 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
105/*118/*
106 * Currently, we have two sorts of write-protection, a) the first one119 * Currently, we have two sorts of write-protection, a) the first one
107 * write-protects guest page to sync the guest modification, b) another one is120 * 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
4219}4219}
4220EXPORT_SYMBOL_GPL(kvm_handle_page_fault);4220EXPORT_SYMBOL_GPL(kvm_handle_page_fault);
4221 4221
4222static int tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,4222int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
4223 bool prefault)4223 bool prefault)
4224{4224{
4225 int max_level;4225 int max_level;
4226 4226
@@ -4925,7 +4925,7 @@ static void init_kvm_tdp_mmu(struct kvm_vcpu *vcpu) · 698 unmodified lines
4925 return;4925 return;
4926 4926
4927 context->mmu_role.as_u64 = new_role.as_u64;4927 context->mmu_role.as_u64 = new_role.as_u64;
4928 context->page_fault = tdp_page_fault;4928 context->page_fault = kvm_tdp_page_fault;
4929 context->sync_page = nonpaging_sync_page;4929 context->sync_page = nonpaging_sync_page;
4930 context->invlpg = nonpaging_invlpg;4930 context->invlpg = nonpaging_invlpg;
4931 context->update_pte = nonpaging_update_pte;4931 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
5436 }5436 }
5437 5437
5438 if (r == RET_PF_INVALID) {5438 if (r == RET_PF_INVALID) {
5439 r = vcpu->arch.mmu->page_fault(vcpu, cr2_or_gpa,5439 r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa,
5440 lower_32_bits(error_code),5440 lower_32_bits(error_code), false);
5441 false);
5442 WARN_ON(r == RET_PF_INVALID);5441 WARN_ON(r == RET_PF_INVALID);
5443 }5442 }
5444 5443
arch/x86/kvm/mmu/paging_tmpl.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
33 #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT33 #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
34 #define PT_HAVE_ACCESSED_DIRTY(mmu) true34 #define PT_HAVE_ACCESSED_DIRTY(mmu) true
35 #ifdef CONFIG_X86_6435 #ifdef CONFIG_X86_64
36 #define PT_MAX_FULL_LEVELS 436 #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
37 #define CMPXCHG cmpxchg37 #define CMPXCHG cmpxchg
38 #else38 #else
39 #define CMPXCHG cmpxchg6439 #define CMPXCHG cmpxchg64
arch/x86/kvm/mmutrace.h+1−1
@@ -339,7 +339,7 @@ TRACE_EVENT( · 338 unmodified lines
339 /* These depend on page entry type, so compute them now. */339 /* These depend on page entry type, so compute them now. */
340 __field(bool, r)340 __field(bool, r)
341 __field(bool, x)341 __field(bool, x)
342 __field(u8, u)342 __field(signed char, u)
343 ),343 ),
344 344
345 TP_fast_assign(345 TP_fast_assign(
arch/x86/kvm/svm.c+41−31
@@ -57,11 +57,13 @@ · 56 unmodified lines
57MODULE_AUTHOR("Qumranet");57MODULE_AUTHOR("Qumranet");
58MODULE_LICENSE("GPL");58MODULE_LICENSE("GPL");
59 59
60#ifdef MODULE
60static const struct x86_cpu_id svm_cpu_id[] = {61static const struct x86_cpu_id svm_cpu_id[] = {
61 X86_FEATURE_MATCH(X86_FEATURE_SVM),62 X86_FEATURE_MATCH(X86_FEATURE_SVM),
62 {}63 {}
63};64};
64MODULE_DEVICE_TABLE(x86cpu, svm_cpu_id);65MODULE_DEVICE_TABLE(x86cpu, svm_cpu_id);
66#endif
65 67
66#define IOPM_ALLOC_ORDER 268#define IOPM_ALLOC_ORDER 2
67#define MSRPM_ALLOC_ORDER 169#define MSRPM_ALLOC_ORDER 1
@@ -1005,33 +1007,32 @@ static void svm_cpu_uninit(int cpu) · 937 unmodified lines
1005static int svm_cpu_init(int cpu)1007static int svm_cpu_init(int cpu)
1006{1008{
1007 struct svm_cpu_data *sd;1009 struct svm_cpu_data *sd;
1008 int r;
1009 1010
1010 sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL);1011 sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL);
1011 if (!sd)1012 if (!sd)
1012 return -ENOMEM;1013 return -ENOMEM;
1013 sd->cpu = cpu;1014 sd->cpu = cpu;
1014 r = -ENOMEM;
1015 sd->save_area = alloc_page(GFP_KERNEL);1015 sd->save_area = alloc_page(GFP_KERNEL);
1016 if (!sd->save_area)1016 if (!sd->save_area)
1017 goto err_1;1017 goto free_cpu_data;
1018 1018
1019 if (svm_sev_enabled()) {1019 if (svm_sev_enabled()) {
1020 r = -ENOMEM;
1021 sd->sev_vmcbs = kmalloc_array(max_sev_asid + 1,1020 sd->sev_vmcbs = kmalloc_array(max_sev_asid + 1,
1022 sizeof(void *),1021 sizeof(void *),
1023 GFP_KERNEL);1022 GFP_KERNEL);
1024 if (!sd->sev_vmcbs)1023 if (!sd->sev_vmcbs)
1025 goto err_1;1024 goto free_save_area;
1026 }1025 }
1027 1026
1028 per_cpu(svm_data, cpu) = sd;1027 per_cpu(svm_data, cpu) = sd;
1029 1028
1030 return 0;1029 return 0;
1031 1030
1032err_1:1031free_save_area:
1032 __free_page(sd->save_area);
1033free_cpu_data:
1033 kfree(sd);1034 kfree(sd);
1034 return r;1035 return -ENOMEM;
1035 1036
1036}1037}
1037 1038
@@ -1350,6 +1351,24 @@ static __init void svm_adjust_mmio_mask(void) · 312 unmodified lines
1350 kvm_mmu_set_mmio_spte_mask(mask, mask, PT_WRITABLE_MASK | PT_USER_MASK);1351 kvm_mmu_set_mmio_spte_mask(mask, mask, PT_WRITABLE_MASK | PT_USER_MASK);
1351}1352}
1352 1353
1354static 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
1353static __init int svm_hardware_setup(void)1372static __init int svm_hardware_setup(void)
1354{1373{
1355 int cpu;1374 int cpu;
@@ -1463,29 +1482,10 @@ static __init int svm_hardware_setup(void) · 107 unmodified lines
1463 return 0;1482 return 0;
1464 1483
1465err:1484err:
1466 __free_pages(iopm_pages, IOPM_ALLOC_ORDER);1485 svm_hardware_teardown();
1467 iopm_base = 0;
1468 return r;1486 return r;
1469}1487}
1470 1488
1471static __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
1489static void init_seg(struct vmcb_seg *seg)1489static void init_seg(struct vmcb_seg *seg)
1490{1490{
1491 seg->selector = 0;1491 seg->selector = 0;
@@ -2175,7 +2175,6 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 683 unmodified lines
2175 u32 dummy;2175 u32 dummy;
2176 u32 eax = 1;2176 u32 eax = 1;
2177 2177
2178 vcpu->arch.microcode_version = 0x01000065;
2179 svm->spec_ctrl = 0;2178 svm->spec_ctrl = 0;
2180 svm->virt_spec_ctrl = 0;2179 svm->virt_spec_ctrl = 0;
2181 2180
@@ -2197,8 +2196,9 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 15 unmodified lines
2197static int avic_init_vcpu(struct vcpu_svm *svm)2196static int avic_init_vcpu(struct vcpu_svm *svm)
2198{2197{
2199 int ret;2198 int ret;
2199 struct kvm_vcpu *vcpu = &svm->vcpu;
2200 2200
2201 if (!kvm_vcpu_apicv_active(&svm->vcpu))2201 if (!avic || !irqchip_in_kernel(vcpu->kvm))
2202 return 0;2202 return 0;
2203 2203
2204 ret = avic_init_backing_page(&svm->vcpu);2204 ret = avic_init_backing_page(&svm->vcpu);
@@ -2266,6 +2266,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu) · 61 unmodified lines
2266 init_vmcb(svm);2266 init_vmcb(svm);
2267 2267
2268 svm_init_osvw(vcpu);2268 svm_init_osvw(vcpu);
2269 vcpu->arch.microcode_version = 0x01000065;
2269 2270
2270 return 0;2271 return 0;
2271 2272
@@ -5232,6 +5233,9 @@ static void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) · 2960 unmodified lines
5232 struct vmcb *vmcb = svm->vmcb;5233 struct vmcb *vmcb = svm->vmcb;
5233 bool activated = kvm_vcpu_apicv_active(vcpu);5234 bool activated = kvm_vcpu_apicv_active(vcpu);
5234 5235
5236 if (!avic)
5237 return;
5238
5235 if (activated) {5239 if (activated) {
5236 /**5240 /**
5237 * During AVIC temporary deactivation, guest could update5241 * 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
5255 return;5259 return;
5256}5260}
5257 5261
5258static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)5262static int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
5259{5263{
5264 if (!vcpu->arch.apicv_active)
5265 return -1;
5266
5260 kvm_lapic_set_irr(vec, vcpu->arch.apic);5267 kvm_lapic_set_irr(vec, vcpu->arch.apic);
5261 smp_mb__after_atomic();5268 smp_mb__after_atomic();
5262 5269
@@ -5268,6 +5275,8 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) · 5 unmodified lines
5268 put_cpu();5275 put_cpu();
5269 } else5276 } else
5270 kvm_vcpu_wake_up(vcpu);5277 kvm_vcpu_wake_up(vcpu);
5278
5279 return 0;
5271}5280}
5272 5281
5273static bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)5282static 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
7378 .cpu_has_kvm_support = has_svm,7387 .cpu_has_kvm_support = has_svm,
7379 .disabled_by_bios = is_disabled,7388 .disabled_by_bios = is_disabled,
7380 .hardware_setup = svm_hardware_setup,7389 .hardware_setup = svm_hardware_setup,
7381 .hardware_unsetup = svm_hardware_unsetup,7390 .hardware_unsetup = svm_hardware_teardown,
7382 .check_processor_compatibility = svm_check_processor_compat,7391 .check_processor_compatibility = svm_check_processor_compat,
7383 .hardware_enable = svm_hardware_enable,7392 .hardware_enable = svm_hardware_enable,
7384 .hardware_disable = svm_hardware_disable,7393 .hardware_disable = svm_hardware_disable,
@@ -7433,6 +7442,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 48 unmodified lines
7433 .run = svm_vcpu_run,7442 .run = svm_vcpu_run,
7434 .handle_exit = handle_exit,7443 .handle_exit = handle_exit,
7435 .skip_emulated_instruction = skip_emulated_instruction,7444 .skip_emulated_instruction = skip_emulated_instruction,
7445 .update_emulated_instruction = NULL,
7436 .set_interrupt_shadow = svm_set_interrupt_shadow,7446 .set_interrupt_shadow = svm_set_interrupt_shadow,
7437 .get_interrupt_shadow = svm_get_interrupt_shadow,7447 .get_interrupt_shadow = svm_get_interrupt_shadow,
7438 .patch_hypercall = svm_patch_hypercall,7448 .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
12extern bool __read_mostly enable_unrestricted_guest;12extern bool __read_mostly enable_unrestricted_guest;
13extern bool __read_mostly enable_ept_ad_bits;13extern bool __read_mostly enable_ept_ad_bits;
14extern bool __read_mostly enable_pml;14extern bool __read_mostly enable_pml;
15extern bool __read_mostly enable_apicv;
15extern int __read_mostly pt_mode;16extern int __read_mostly pt_mode;
16 17
17#define PT_MODE_SYSTEM 018#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
544 }544 }
545}545}
546 546
547static inline void enable_x2apic_msr_intercepts(unsigned long *msr_bitmap) {547static inline void enable_x2apic_msr_intercepts(unsigned long *msr_bitmap)
548{
548 int msr;549 int msr;
549 550
550 for (msr = 0x800; msr <= 0x8ff; msr += BITS_PER_LONG) {551 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
1981 }1982 }
1982 1983
1983 /*1984 /*
1984 * Clean fields data can't de used on VMLAUNCH and when we switch1985 * Clean fields data can't be used on VMLAUNCH and when we switch
1985 * between different L2 guests as KVM keeps a single VMCS12 per L1.1986 * between different L2 guests as KVM keeps a single VMCS12 per L1.
1986 */1987 */
1987 if (from_launch || evmcs_gpa_changed)1988 if (from_launch || evmcs_gpa_changed)
@@ -3160,10 +3161,10 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu, · 1172 unmodified lines
3160 * or KVM_SET_NESTED_STATE). Otherwise it's called from vmlaunch/vmresume.3161 * or KVM_SET_NESTED_STATE). Otherwise it's called from vmlaunch/vmresume.
3161 *3162 *
3162 * Returns:3163 * Returns:
3163 * NVMX_ENTRY_SUCCESS: Entered VMX non-root mode3164 * NVMX_VMENTRY_SUCCESS: Entered VMX non-root mode
3164 * NVMX_ENTRY_VMFAIL: Consistency check VMFail3165 * NVMX_VMENTRY_VMFAIL: Consistency check VMFail
3165 * NVMX_ENTRY_VMEXIT: Consistency check VMExit3166 * NVMX_VMENTRY_VMEXIT: Consistency check VMExit
3166 * NVMX_ENTRY_KVM_INTERNAL_ERROR: KVM internal error3167 * NVMX_VMENTRY_KVM_INTERNAL_ERROR: KVM internal error
3167 */3168 */
3168enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,3169enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
3169 bool from_vmentry)3170 bool from_vmentry)
@@ -3575,25 +3576,80 @@ static void nested_vmx_inject_exception_vmexit(struct kvm_vcpu *vcpu, · 405 unmodified lines
3575 nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI, intr_info, exit_qual);3576 nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI, intr_info, exit_qual);
3576}3577}
3577 3578
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 */
3585static 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 */
3599static 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
3578static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)3606static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)
3579{3607{
3580 struct vcpu_vmx *vmx = to_vmx(vcpu);3608 struct vcpu_vmx *vmx = to_vmx(vcpu);
3581 unsigned long exit_qual;3609 unsigned long exit_qual;
3582 bool block_nested_events =3610 bool block_nested_events =
3583 vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);3611 vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);
3612 bool mtf_pending = vmx->nested.mtf_pending;
3584 struct kvm_lapic *apic = vcpu->arch.apic;3613 struct kvm_lapic *apic = vcpu->arch.apic;
3585 3614
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
3586 if (lapic_in_kernel(vcpu) &&3621 if (lapic_in_kernel(vcpu) &&
3587 test_bit(KVM_APIC_INIT, &apic->pending_events)) {3622 test_bit(KVM_APIC_INIT, &apic->pending_events)) {
3588 if (block_nested_events)3623 if (block_nested_events)
3589 return -EBUSY;3624 return -EBUSY;
3625 nested_vmx_update_pending_dbg(vcpu);
3590 clear_bit(KVM_APIC_INIT, &apic->pending_events);3626 clear_bit(KVM_APIC_INIT, &apic->pending_events);
3591 nested_vmx_vmexit(vcpu, EXIT_REASON_INIT_SIGNAL, 0, 0);3627 nested_vmx_vmexit(vcpu, EXIT_REASON_INIT_SIGNAL, 0, 0);
3592 return 0;3628 return 0;
3593 }3629 }
3594 3630
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
3595 if (vcpu->arch.exception.pending &&3651 if (vcpu->arch.exception.pending &&
3596 nested_vmx_check_exception(vcpu, &exit_qual)) {3652 nested_vmx_check_exception(vcpu, &exit_qual)) {
3597 if (block_nested_events)3653 if (block_nested_events)
3598 return -EBUSY;3654 return -EBUSY;
3599 nested_vmx_inject_exception_vmexit(vcpu, exit_qual);3655 nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
@@ -5256,24 +5312,17 @@ fail: · 1656 unmodified lines
5256 return 1;5312 return 1;
5257}5313}
5258 5314
5259 5315/*
5260static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu,5316 * Return true if an IO instruction with the specified port and size should cause
5261 struct vmcs12 *vmcs12)5317 * a VM-exit into L1.
5318 */
5319bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port,
5320 int size)
5262{5321{
5263 unsigned long exit_qualification;5322 struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
5264 gpa_t bitmap, last_bitmap;5323 gpa_t bitmap, last_bitmap;
5265 unsigned int port;
5266 int size;
5267 u8 b;5324 u8 b;
5268 5325
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
5277 last_bitmap = (gpa_t)-1;5326 last_bitmap = (gpa_t)-1;
5278 b = -1;5327 b = -1;
5279 5328
@@ -5300,8 +5349,26 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, · 20 unmodified lines
5300 return false;5349 return false;
5301}5350}
5302 5351
5352static 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
5303/*5370/*
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,
5305 * rather than handle it ourselves in L0. I.e., check whether L1 expressed5372 * rather than handle it ourselves in L0. I.e., check whether L1 expressed
5306 * disinterest in the current event (read or write a specific MSR) by using an5373 * disinterest in the current event (read or write a specific MSR) by using an
5307 * MSR bitmap. This may be the case even when L0 doesn't use MSR bitmaps.5374 * 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
5683 5750
5684 if (vmx->nested.nested_run_pending)5751 if (vmx->nested.nested_run_pending)
5685 kvm_state.flags |= KVM_STATE_NESTED_RUN_PENDING;5752 kvm_state.flags |= KVM_STATE_NESTED_RUN_PENDING;
5753
5754 if (vmx->nested.mtf_pending)
5755 kvm_state.flags |= KVM_STATE_NESTED_MTF_PENDING;
5686 }5756 }
5687 }5757 }
5688 5758
@@ -5863,6 +5933,9 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 174 unmodified lines
5863 vmx->nested.nested_run_pending =5933 vmx->nested.nested_run_pending =
5864 !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);5934 !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
5865 5935
5936 vmx->nested.mtf_pending =
5937 !!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING);
5938
5866 ret = -EINVAL;5939 ret = -EINVAL;
5867 if (nested_cpu_has_shadow_vmcs(vmcs12) &&5940 if (nested_cpu_has_shadow_vmcs(vmcs12) &&
5868 vmcs12->vmcs_link_pointer != -1ull) {5941 vmcs12->vmcs_link_pointer != -1ull) {
@@ -5920,8 +5993,7 @@ void nested_vmx_set_vmcs_shadowing_bitmap(void) · 51 unmodified lines
5920 * bit in the high half is on if the corresponding bit in the control field5993 * bit in the high half is on if the corresponding bit in the control field
5921 * may be on. See also vmx_control_verify().5994 * may be on. See also vmx_control_verify().
5922 */5995 */
5923void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,5996void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
5924 bool apicv)
5925{5997{
5926 /*5998 /*
5927 * Note that as a general rule, the high half of the MSRs (bits in5999 * 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
5948 PIN_BASED_EXT_INTR_MASK |6020 PIN_BASED_EXT_INTR_MASK |
5949 PIN_BASED_NMI_EXITING |6021 PIN_BASED_NMI_EXITING |
5950 PIN_BASED_VIRTUAL_NMIS |6022 PIN_BASED_VIRTUAL_NMIS |
5951 (apicv ? PIN_BASED_POSTED_INTR : 0);6023 (enable_apicv ? PIN_BASED_POSTED_INTR : 0);
5952 msrs->pinbased_ctls_high |=6024 msrs->pinbased_ctls_high |=
5953 PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR |6025 PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR |
5954 PIN_BASED_VMX_PREEMPTION_TIMER;6026 PIN_BASED_VMX_PREEMPTION_TIMER;
arch/x86/kvm/vmx/nested.h+8−2
@@ -17,8 +17,7 @@ enum nvmx_vmentry_status { · 16 unmodified lines
17};17};
18 18
19void vmx_leave_nested(struct kvm_vcpu *vcpu);19void vmx_leave_nested(struct kvm_vcpu *vcpu);
20void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,20void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps);
21 bool apicv);
22void nested_vmx_hardware_unsetup(void);21void nested_vmx_hardware_unsetup(void);
23__init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));22__init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));
24void nested_vmx_set_vmcs_shadowing_bitmap(void);23void 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
34int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,33int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,
35 u32 vmx_instruction_info, bool wr, int len, gva_t *ret);34 u32 vmx_instruction_info, bool wr, int len, gva_t *ret);
36void nested_vmx_pmu_entry_exit_ctls_update(struct kvm_vcpu *vcpu);35void nested_vmx_pmu_entry_exit_ctls_update(struct kvm_vcpu *vcpu);
36bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port,
37 int size);
37 38
38static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)39static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)
39{40{
@@ -175,6 +176,11 @@ static inline bool nested_cpu_has_virtual_nmis(struct vmcs12 *vmcs12) · 135 unmodified lines
175 return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;176 return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;
176}177}
177 178
179static inline int nested_cpu_has_mtf(struct vmcs12 *vmcs12)
180{
181 return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
182}
183
178static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)184static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
179{185{
180 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);186 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);
arch/x86/kvm/vmx/vmx.c+131−21
@@ -64,11 +64,13 @@ · 63 unmodified lines
64MODULE_AUTHOR("Qumranet");64MODULE_AUTHOR("Qumranet");
65MODULE_LICENSE("GPL");65MODULE_LICENSE("GPL");
66 66
67#ifdef MODULE
67static const struct x86_cpu_id vmx_cpu_id[] = {68static const struct x86_cpu_id vmx_cpu_id[] = {
68 X86_FEATURE_MATCH(X86_FEATURE_VMX),69 X86_FEATURE_MATCH(X86_FEATURE_VMX),
69 {}70 {}
70};71};
71MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id);72MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id);
73#endif
72 74
73bool __read_mostly enable_vpid = 1;75bool __read_mostly enable_vpid = 1;
74module_param_named(vpid, enable_vpid, bool, 0444);76module_param_named(vpid, enable_vpid, bool, 0444);
@@ -95,7 +97,7 @@ module_param(emulate_invalid_guest_state, bool, S_IRUGO); · 20 unmodified lines
95static bool __read_mostly fasteoi = 1;97static bool __read_mostly fasteoi = 1;
96module_param(fasteoi, bool, S_IRUGO);98module_param(fasteoi, bool, S_IRUGO);
97 99
98static bool __read_mostly enable_apicv = 1;100bool __read_mostly enable_apicv = 1;
99module_param(enable_apicv, bool, S_IRUGO);101module_param(enable_apicv, bool, S_IRUGO);
100 102
101/*103/*
@@ -1175,6 +1177,10 @@ void vmx_prepare_switch_to_guest(struct kvm_vcpu *vcpu) · 1073 unmodified lines
1175 vmx->guest_msrs[i].mask);1177 vmx->guest_msrs[i].mask);
1176 1178
1177 }1179 }
1180
1181 if (vmx->nested.need_vmcs12_to_shadow_sync)
1182 nested_sync_vmcs12_to_shadow(vcpu);
1183
1178 if (vmx->guest_state_loaded)1184 if (vmx->guest_state_loaded)
1179 return;1185 return;
1180 1186
@@ -1599,6 +1605,40 @@ static int skip_emulated_instruction(struct kvm_vcpu *vcpu) · 418 unmodified lines
1599 return 1;1605 return 1;
1600}1606}
1601 1607
1608
1609/*
1610 * Recognizes a pending MTF VM-exit and records the nested state for later
1611 * delivery.
1612 */
1613static 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
1636static int vmx_skip_emulated_instruction(struct kvm_vcpu *vcpu)
1637{
1638 vmx_update_emulated_instruction(vcpu);
1639 return skip_emulated_instruction(vcpu);
1640}
1641
1602static void vmx_clear_hlt(struct kvm_vcpu *vcpu)1642static void vmx_clear_hlt(struct kvm_vcpu *vcpu)
1603{1643{
1604 /*1644 /*
@@ -2947,6 +2987,9 @@ void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 1342 unmodified lines
2947 2987
2948static int get_ept_level(struct kvm_vcpu *vcpu)2988static int get_ept_level(struct kvm_vcpu *vcpu)
2949{2989{
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;
2950 if (cpu_has_vmx_ept_5levels() && (cpuid_maxphyaddr(vcpu) > 48))2993 if (cpu_has_vmx_ept_5levels() && (cpuid_maxphyaddr(vcpu) > 48))
2951 return 5;2994 return 5;
2952 return 4;2995 return 4;
@@ -3815,24 +3858,29 @@ static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, · 862 unmodified lines
3815 * 2. If target vcpu isn't running(root mode), kick it to pick up the3858 * 2. If target vcpu isn't running(root mode), kick it to pick up the
3816 * interrupt from PIR in next vmentry.3859 * interrupt from PIR in next vmentry.
3817 */3860 */
3818static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)3861static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
3819{3862{
3820 struct vcpu_vmx *vmx = to_vmx(vcpu);3863 struct vcpu_vmx *vmx = to_vmx(vcpu);
3821 int r;3864 int r;
3822 3865
3823 r = vmx_deliver_nested_posted_interrupt(vcpu, vector);3866 r = vmx_deliver_nested_posted_interrupt(vcpu, vector);
3824 if (!r)3867 if (!r)
3825 return;3868 return 0;
3869
3870 if (!vcpu->arch.apicv_active)
3871 return -1;
3826 3872
3827 if (pi_test_and_set_pir(vector, &vmx->pi_desc))3873 if (pi_test_and_set_pir(vector, &vmx->pi_desc))
3828 return;3874 return 0;
3829 3875
3830 /* If a previous notification has sent the IPI, nothing to do. */3876 /* If a previous notification has sent the IPI, nothing to do. */
3831 if (pi_test_and_set_on(&vmx->pi_desc))3877 if (pi_test_and_set_on(&vmx->pi_desc))
3832 return;3878 return 0;
3833 3879
3834 if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false))3880 if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false))
3835 kvm_vcpu_kick(vcpu);3881 kvm_vcpu_kick(vcpu);
3882
3883 return 0;
3836}3884}
3837 3885
3838/*3886/*
@@ -4238,7 +4286,6 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 399 unmodified lines
4238 4286
4239 vmx->msr_ia32_umwait_control = 0;4287 vmx->msr_ia32_umwait_control = 0;
4240 4288
4241 vcpu->arch.microcode_version = 0x100000000ULL;
4242 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();4289 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
4243 vmx->hv_deadline_tsc = -1;4290 vmx->hv_deadline_tsc = -1;
4244 kvm_set_cr8(vcpu, 0);4291 kvm_set_cr8(vcpu, 0);
@@ -6480,8 +6527,11 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 2235 unmodified lines
6480 vmcs_write32(PLE_WINDOW, vmx->ple_window);6527 vmcs_write32(PLE_WINDOW, vmx->ple_window);
6481 }6528 }
6482 6529
6483 if (vmx->nested.need_vmcs12_to_shadow_sync)6530 /*
6484 nested_sync_vmcs12_to_shadow(vcpu);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);
6485 6535
6486 if (kvm_register_is_dirty(vcpu, VCPU_REGS_RSP))6536 if (kvm_register_is_dirty(vcpu, VCPU_REGS_RSP))
6487 vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);6537 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
6755 6805
6756 if (nested)6806 if (nested)
6757 nested_vmx_setup_ctls_msrs(&vmx->nested.msrs,6807 nested_vmx_setup_ctls_msrs(&vmx->nested.msrs,
6758 vmx_capability.ept,6808 vmx_capability.ept);
6759 kvm_vcpu_apicv_active(vcpu));
6760 else6809 else
6761 memset(&vmx->nested.msrs, 0, sizeof(vmx->nested.msrs));6810 memset(&vmx->nested.msrs, 0, sizeof(vmx->nested.msrs));
6762 6811
6763 vmx->nested.posted_intr_nv = -1;6812 vmx->nested.posted_intr_nv = -1;
6764 vmx->nested.current_vmptr = -1ull;6813 vmx->nested.current_vmptr = -1ull;
6765 6814
6815 vcpu->arch.microcode_version = 0x100000000ULL;
6766 vmx->msr_ia32_feature_control_valid_bits = FEAT_CTL_LOCKED;6816 vmx->msr_ia32_feature_control_valid_bits = FEAT_CTL_LOCKED;
6767 6817
6768 /*6818 /*
@@ -6836,8 +6886,7 @@ static int __init vmx_check_processor_compat(void) · 67 unmodified lines
6836 if (setup_vmcs_config(&vmcs_conf, &vmx_cap) < 0)6886 if (setup_vmcs_config(&vmcs_conf, &vmx_cap) < 0)
6837 return -EIO;6887 return -EIO;
6838 if (nested)6888 if (nested)
6839 nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept,6889 nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept);
6840 enable_apicv);
6841 if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {6890 if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {
6842 printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",6891 printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
6843 smp_processor_id());6892 smp_processor_id());
@@ -7098,6 +7147,40 @@ static void vmx_request_immediate_exit(struct kvm_vcpu *vcpu) · 254 unmodified lines
7098 to_vmx(vcpu)->req_immediate_exit = true;7147 to_vmx(vcpu)->req_immediate_exit = true;
7099}7148}
7100 7149
7150static 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
7101static int vmx_check_intercept(struct kvm_vcpu *vcpu,7184static int vmx_check_intercept(struct kvm_vcpu *vcpu,
7102 struct x86_instruction_info *info,7185 struct x86_instruction_info *info,
7103 enum x86_intercept_stage stage)7186 enum x86_intercept_stage stage)
@@ -7105,19 +7188,45 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu, · 1 unmodified line
7105 struct vmcs12 *vmcs12 = get_vmcs12(vcpu);7188 struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
7106 struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt;7189 struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt;
7107 7190
7191 switch (info->intercept) {
7108 /*7192 /*
7109 * RDPID causes #UD if disabled through secondary execution controls.7193 * RDPID causes #UD if disabled through secondary execution controls.
7110 * Because it is marked as EmulateOnUD, we need to intercept it here.7194 * Because it is marked as EmulateOnUD, we need to intercept it here.
7111 */7195 */
7112 if (info->intercept == x86_intercept_rdtscp &&7196 case x86_intercept_rdtscp:
7113 !nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) {7197 if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) {
7114 ctxt->exception.vector = UD_VECTOR;7198 ctxt->exception.vector = UD_VECTOR;
7115 ctxt->exception.error_code_valid = false;7199 ctxt->exception.error_code_valid = false;
7116 return X86EMUL_PROPAGATE_FAULT;7200 return X86EMUL_PROPAGATE_FAULT;
7117 }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;
7118 7223
7119 /* TODO: check more intercepts... */7224 /* TODO: check more intercepts... */
7120 return X86EMUL_CONTINUE;7225 default:
7226 break;
7227 }
7228
7229 return X86EMUL_UNHANDLEABLE;
7121}7230}
7122 7231
7123#ifdef CONFIG_X86_647232#ifdef CONFIG_X86_64
@@ -7699,7 +7808,7 @@ static __init int hardware_setup(void) · 575 unmodified lines
7699 7808
7700 if (nested) {7809 if (nested) {
7701 nested_vmx_setup_ctls_msrs(&vmcs_config.nested,7810 nested_vmx_setup_ctls_msrs(&vmcs_config.nested,
7702 vmx_capability.ept, enable_apicv);7811 vmx_capability.ept);
7703 7812
7704 r = nested_vmx_hardware_setup(kvm_vmx_exit_handlers);7813 r = nested_vmx_hardware_setup(kvm_vmx_exit_handlers);
7705 if (r)7814 if (r)
@@ -7783,7 +7892,8 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 77 unmodified lines
7783 7892
7784 .run = vmx_vcpu_run,7893 .run = vmx_vcpu_run,
7785 .handle_exit = vmx_handle_exit,7894 .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,
7787 .set_interrupt_shadow = vmx_set_interrupt_shadow,7897 .set_interrupt_shadow = vmx_set_interrupt_shadow,
7788 .get_interrupt_shadow = vmx_get_interrupt_shadow,7898 .get_interrupt_shadow = vmx_get_interrupt_shadow,
7789 .patch_hypercall = vmx_patch_hypercall,7899 .patch_hypercall = vmx_patch_hypercall,
arch/x86/kvm/vmx/vmx.h+3−0
@@ -150,6 +150,9 @@ struct nested_vmx { · 149 unmodified lines
150 /* L2 must run next, and mustn't decide to exit to L1. */150 /* L2 must run next, and mustn't decide to exit to L1. */
151 bool nested_run_pending;151 bool nested_run_pending;
152 152
153 /* Pending MTF VM-exit into L1. */
154 bool mtf_pending;
155
153 struct loaded_vmcs vmcs02;156 struct loaded_vmcs vmcs02;
154 157
155 /*158 /*
arch/x86/kvm/x86.c+35−23
@@ -438,6 +438,14 @@ void kvm_deliver_exception_payload(struct kvm_vcpu *vcpu) · 437 unmodified lines
438 * for #DB exceptions under VMX.438 * for #DB exceptions under VMX.
439 */439 */
440 vcpu->arch.dr6 ^= payload & DR6_RTM;440 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);
441 break;449 break;
442 case PF_VECTOR:450 case PF_VECTOR:
443 vcpu->arch.cr2 = payload;451 vcpu->arch.cr2 = payload;
@@ -490,19 +498,7 @@ static void kvm_multiple_exception(struct kvm_vcpu *vcpu, · 46 unmodified lines
490 vcpu->arch.exception.error_code = error_code;498 vcpu->arch.exception.error_code = error_code;
491 vcpu->arch.exception.has_payload = has_payload;499 vcpu->arch.exception.has_payload = has_payload;
492 vcpu->arch.exception.payload = payload;500 vcpu->arch.exception.payload = payload;
493 /*501 if (!is_guest_mode(vcpu))
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))
506 kvm_deliver_exception_payload(vcpu);502 kvm_deliver_exception_payload(vcpu);
507 return;503 return;
508 }504 }
@@ -2448,7 +2444,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 1939 unmodified lines
2448 vcpu->hv_clock.tsc_timestamp = tsc_timestamp;2444 vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
2449 vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;2445 vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
2450 vcpu->last_guest_tsc = tsc_timestamp;2446 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);
2452 2448
2453 /* If the host uses TSC clocksource, then it is stable */2449 /* If the host uses TSC clocksource, then it is stable */
2454 pvclock_flags = 0;2450 pvclock_flags = 0;
@@ -3795,6 +3791,21 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, · 1340 unmodified lines
3795{3791{
3796 process_nmi(vcpu);3792 process_nmi(vcpu);
3797 3793
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
3798 /*3809 /*
3799 * The API doesn't provide the instruction length for software3810 * The API doesn't provide the instruction length for software
3800 * exceptions, so don't report them. As long as the guest RIP3811 * exceptions, so don't report them. As long as the guest RIP
@@ -6880,6 +6891,8 @@ restart: · 3079 unmodified lines
6880 kvm_rip_write(vcpu, ctxt->eip);6891 kvm_rip_write(vcpu, ctxt->eip);
6881 if (r && ctxt->tf)6892 if (r && ctxt->tf)
6882 r = kvm_vcpu_do_singlestep(vcpu);6893 r = kvm_vcpu_do_singlestep(vcpu);
6894 if (kvm_x86_ops->update_emulated_instruction)
6895 kvm_x86_ops->update_emulated_instruction(vcpu);
6883 __kvm_set_rflags(vcpu, ctxt->eflags);6896 __kvm_set_rflags(vcpu, ctxt->eflags);
6884 }6897 }
6885 6898
@@ -7177,15 +7190,15 @@ static void kvm_timer_init(void) · 291 unmodified lines
7177 7190
7178 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {7191 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
7179#ifdef CONFIG_CPU_FREQ7192#ifdef CONFIG_CPU_FREQ
7180 struct cpufreq_policy policy;7193 struct cpufreq_policy *policy;
7181 int cpu;7194 int cpu;
7182 7195
7183 memset(&policy, 0, sizeof(policy));
7184 cpu = get_cpu();7196 cpu = get_cpu();
7185 cpufreq_get_policy(&policy, cpu);7197 policy = cpufreq_cpu_get(cpu);
7186 if (policy.cpuinfo.max_freq)7198 if (policy && policy->cpuinfo.max_freq)
7187 max_tsc_khz = policy.cpuinfo.max_freq;7199 max_tsc_khz = policy->cpuinfo.max_freq;
7188 put_cpu();7200 put_cpu();
7201 cpufreq_cpu_put(policy);
7189#endif7202#endif
7190 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,7203 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
7191 CPUFREQ_TRANSITION_NOTIFIER);7204 CPUFREQ_TRANSITION_NOTIFIER);
@@ -7295,12 +7308,12 @@ int kvm_arch_init(void *opaque) · 103 unmodified lines
7295 }7308 }
7296 7309
7297 if (!ops->cpu_has_kvm_support()) {7310 if (!ops->cpu_has_kvm_support()) {
7298 printk(KERN_ERR "kvm: no hardware support\n");7311 pr_err_ratelimited("kvm: no hardware support\n");
7299 r = -EOPNOTSUPP;7312 r = -EOPNOTSUPP;
7300 goto out;7313 goto out;
7301 }7314 }
7302 if (ops->disabled_by_bios()) {7315 if (ops->disabled_by_bios()) {
7303 printk(KERN_ERR "kvm: disabled by bios\n");7316 pr_err_ratelimited("kvm: disabled by bios\n");
7304 r = -EOPNOTSUPP;7317 r = -EOPNOTSUPP;
7305 goto out;7318 goto out;
7306 }7319 }
@@ -8942,7 +8955,6 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int idt_index, · 1635 unmodified lines
8942 8955
8943 kvm_rip_write(vcpu, ctxt->eip);8956 kvm_rip_write(vcpu, ctxt->eip);
8944 kvm_set_rflags(vcpu, ctxt->eflags);8957 kvm_set_rflags(vcpu, ctxt->eflags);
8945 kvm_make_request(KVM_REQ_EVENT, vcpu);
8946 return 1;8958 return 1;
8947}8959}
8948EXPORT_SYMBOL_GPL(kvm_task_switch);8960EXPORT_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
10182 work->arch.cr3 != vcpu->arch.mmu->get_cr3(vcpu))10194 work->arch.cr3 != vcpu->arch.mmu->get_cr3(vcpu))
10183 return;10195 return;
10184 10196
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);
10186}10198}
10187 10199
10188static inline u32 kvm_async_pf_hash_fn(gfn_t gfn)10200static 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
363{363{
364 const struct ptdump_range ptdump_ranges[] = {364 const struct ptdump_range ptdump_ranges[] = {
365#ifdef CONFIG_X86_64365#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
371 {0, PTRS_PER_PGD * PGD_LEVEL_MULT / 2},366 {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},
373#else368#else
374 {0, ~0UL},369 {0, ~0UL},
375#endif370#endif
arch/x86/platform/efi/efi_64.c+52−99
@@ -180,7 +180,7 @@ void efi_sync_low_kernel_mappings(void) · 179 unmodified lines
180static inline phys_addr_t180static inline phys_addr_t
181virt_to_phys_or_null_size(void *va, unsigned long size)181virt_to_phys_or_null_size(void *va, unsigned long size)
182{182{
183 bool bad_size;183 phys_addr_t pa;
184 184
185 if (!va)185 if (!va)
186 return 0;186 return 0;
@@ -188,16 +188,13 @@ virt_to_phys_or_null_size(void *va, unsigned long size) · 1 unmodified line
188 if (virt_addr_valid(va))188 if (virt_addr_valid(va))
189 return virt_to_phys(va);189 return virt_to_phys(va);
190 190
191 /*191 pa = slow_virt_to_phys(va);
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);
197 192
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;
199 196
200 return slow_virt_to_phys(va);197 return pa;
201}198}
202 199
203#define virt_to_phys_or_null(addr) \200#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
568 565
569static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)566static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)
570{567{
571 efi_status_t status;568 return EFI_UNSUPPORTED;
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;
587}569}
588 570
589static efi_status_t efi_thunk_set_time(efi_time_t *tm)571static efi_status_t efi_thunk_set_time(efi_time_t *tm)
590{572{
591 efi_status_t status;573 return EFI_UNSUPPORTED;
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;
606}574}
607 575
608static efi_status_t576static efi_status_t
609efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,577efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
610 efi_time_t *tm)578 efi_time_t *tm)
611{579{
612 efi_status_t status;580 return EFI_UNSUPPORTED;
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;
630}581}
631 582
632static efi_status_t583static efi_status_t
633efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)584efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
634{585{
635 efi_status_t status;586 return EFI_UNSUPPORTED;
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;
650}587}
651 588
652static unsigned long efi_name_size(efi_char16_t *name)589static unsigned long efi_name_size(efi_char16_t *name)
@@ -658,6 +595,8 @@ static efi_status_t · 5 unmodified lines
658efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,595efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
659 u32 *attr, unsigned long *data_size, void *data)596 u32 *attr, unsigned long *data_size, void *data)
660{597{
598 u8 buf[24] __aligned(8);
599 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
661 efi_status_t status;600 efi_status_t status;
662 u32 phys_name, phys_vendor, phys_attr;601 u32 phys_name, phys_vendor, phys_attr;
663 u32 phys_data_size, phys_data;602 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
665 604
666 spin_lock_irqsave(&efi_runtime_lock, flags);605 spin_lock_irqsave(&efi_runtime_lock, flags);
667 606
607 *vnd = *vendor;
608
668 phys_data_size = virt_to_phys_or_null(data_size);609 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);
670 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));611 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));
671 phys_attr = virt_to_phys_or_null(attr);612 phys_attr = virt_to_phys_or_null(attr);
672 phys_data = virt_to_phys_or_null_size(data, *data_size);613 phys_data = virt_to_phys_or_null_size(data, *data_size);
673 614
674 status = efi_thunk(get_variable, phys_name, phys_vendor,615 if (!phys_name || (data && !phys_data))
675 phys_attr, phys_data_size, 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);
676 620
677 spin_unlock_irqrestore(&efi_runtime_lock, flags);621 spin_unlock_irqrestore(&efi_runtime_lock, flags);
678 622
@@ -683,19 +627,25 @@ static efi_status_t · 4 unmodified lines
683efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,627efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
684 u32 attr, unsigned long data_size, void *data)628 u32 attr, unsigned long data_size, void *data)
685{629{
630 u8 buf[24] __aligned(8);
631 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
686 u32 phys_name, phys_vendor, phys_data;632 u32 phys_name, phys_vendor, phys_data;
687 efi_status_t status;633 efi_status_t status;
688 unsigned long flags;634 unsigned long flags;
689 635
690 spin_lock_irqsave(&efi_runtime_lock, flags);636 spin_lock_irqsave(&efi_runtime_lock, flags);
691 637
638 *vnd = *vendor;
639
692 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));640 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);
694 phys_data = virt_to_phys_or_null_size(data, data_size);642 phys_data = virt_to_phys_or_null_size(data, data_size);
695 643
696 /* If data_size is > sizeof(u32) we've got problems */644 if (!phys_name || !phys_data)
697 status = efi_thunk(set_variable, phys_name, phys_vendor,645 status = EFI_INVALID_PARAMETER;
698 attr, data_size, phys_data);646 else
647 status = efi_thunk(set_variable, phys_name, phys_vendor,
648 attr, data_size, phys_data);
699 649
700 spin_unlock_irqrestore(&efi_runtime_lock, flags);650 spin_unlock_irqrestore(&efi_runtime_lock, flags);
701 651
@@ -707,6 +657,8 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 5 unmodified lines
707 u32 attr, unsigned long data_size,657 u32 attr, unsigned long data_size,
708 void *data)658 void *data)
709{659{
660 u8 buf[24] __aligned(8);
661 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
710 u32 phys_name, phys_vendor, phys_data;662 u32 phys_name, phys_vendor, phys_data;
711 efi_status_t status;663 efi_status_t status;
712 unsigned long flags;664 unsigned long flags;
@@ -714,13 +666,17 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, · 1 unmodified line
714 if (!spin_trylock_irqsave(&efi_runtime_lock, flags))666 if (!spin_trylock_irqsave(&efi_runtime_lock, flags))
715 return EFI_NOT_READY;667 return EFI_NOT_READY;
716 668
669 *vnd = *vendor;
670
717 phys_name = virt_to_phys_or_null_size(name, efi_name_size(name));671 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);
719 phys_data = virt_to_phys_or_null_size(data, data_size);673 phys_data = virt_to_phys_or_null_size(data, data_size);
720 674
721 /* If data_size is > sizeof(u32) we've got problems */675 if (!phys_name || !phys_data)
722 status = efi_thunk(set_variable, phys_name, phys_vendor,676 status = EFI_INVALID_PARAMETER;
723 attr, data_size, phys_data);677 else
678 status = efi_thunk(set_variable, phys_name, phys_vendor,
679 attr, data_size, phys_data);
724 680
725 spin_unlock_irqrestore(&efi_runtime_lock, flags);681 spin_unlock_irqrestore(&efi_runtime_lock, flags);
726 682
@@ -732,39 +688,36 @@ efi_thunk_get_next_variable(unsigned long *name_size, · 5 unmodified lines
732 efi_char16_t *name,688 efi_char16_t *name,
733 efi_guid_t *vendor)689 efi_guid_t *vendor)
734{690{
691 u8 buf[24] __aligned(8);
692 efi_guid_t *vnd = PTR_ALIGN((efi_guid_t *)buf, sizeof(*vnd));
735 efi_status_t status;693 efi_status_t status;
736 u32 phys_name_size, phys_name, phys_vendor;694 u32 phys_name_size, phys_name, phys_vendor;
737 unsigned long flags;695 unsigned long flags;
738 696
739 spin_lock_irqsave(&efi_runtime_lock, flags);697 spin_lock_irqsave(&efi_runtime_lock, flags);
740 698
699 *vnd = *vendor;
700
741 phys_name_size = virt_to_phys_or_null(name_size);701 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);
743 phys_name = virt_to_phys_or_null_size(name, *name_size);703 phys_name = virt_to_phys_or_null_size(name, *name_size);
744 704
745 status = efi_thunk(get_next_variable, phys_name_size,705 if (!phys_name)
746 phys_name, phys_vendor);706 status = EFI_INVALID_PARAMETER;
707 else
708 status = efi_thunk(get_next_variable, phys_name_size,
709 phys_name, phys_vendor);
747 710
748 spin_unlock_irqrestore(&efi_runtime_lock, flags);711 spin_unlock_irqrestore(&efi_runtime_lock, flags);
749 712
713 *vendor = *vnd;
750 return status;714 return status;
751}715}
752 716
753static efi_status_t717static efi_status_t
754efi_thunk_get_next_high_mono_count(u32 *count)718efi_thunk_get_next_high_mono_count(u32 *count)
755{719{
756 efi_status_t status;720 return EFI_UNSUPPORTED;
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;
768}721}
769 722
770static void723static void
arch/x86/xen/enlighten_pv.c+29−3
@@ -72,6 +72,9 @@ · 71 unmodified lines
72#include <asm/mwait.h>72#include <asm/mwait.h>
73#include <asm/pci_x86.h>73#include <asm/pci_x86.h>
74#include <asm/cpu.h>74#include <asm/cpu.h>
75#ifdef CONFIG_X86_IOPL_IOPERM
76#include <asm/io_bitmap.h>
77#endif
75 78
76#ifdef CONFIG_ACPI79#ifdef CONFIG_ACPI
77#include <linux/acpi.h>80#include <linux/acpi.h>
@@ -837,6 +840,25 @@ static void xen_load_sp0(unsigned long sp0) · 759 unmodified lines
837 this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0);840 this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0);
838}841}
839 842
843#ifdef CONFIG_X86_IOPL_IOPERM
844static 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
840static void xen_io_delay(void)862static void xen_io_delay(void)
841{863{
842}864}
@@ -896,14 +918,15 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err) · 53 unmodified lines
896static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)918static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
897{919{
898 int ret;920 int ret;
921#ifdef CONFIG_X86_64
922 unsigned int which;
923 u64 base;
924#endif
899 925
900 ret = 0;926 ret = 0;
901 927
902 switch (msr) {928 switch (msr) {
903#ifdef CONFIG_X86_64929#ifdef CONFIG_X86_64
904 unsigned which;
905 u64 base;
906
907 case MSR_FS_BASE: which = SEGBASE_FS; goto set;930 case MSR_FS_BASE: which = SEGBASE_FS; goto set;
908 case MSR_KERNEL_GS_BASE: which = SEGBASE_GS_USER; goto set;931 case MSR_KERNEL_GS_BASE: which = SEGBASE_GS_USER; goto set;
909 case MSR_GS_BASE: which = SEGBASE_GS_KERNEL; goto set;932 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
1046 .write_idt_entry = xen_write_idt_entry,1069 .write_idt_entry = xen_write_idt_entry,
1047 .load_sp0 = xen_load_sp0,1070 .load_sp0 = xen_load_sp0,
1048 1071
1072#ifdef CONFIG_X86_IOPL_IOPERM
1073 .update_io_bitmap = xen_update_io_bitmap,
1074#endif
1049 .io_delay = xen_io_delay,1075 .io_delay = xen_io_delay,
1050 1076
1051 /* Xen takes care of %gs when switching to usermode for us */1077 /* 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
412 */412 */
413 if ((policy & REQ_FSEQ_DATA) &&413 if ((policy & REQ_FSEQ_DATA) &&
414 !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {414 !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
415 blk_mq_request_bypass_insert(rq, false);415 blk_mq_request_bypass_insert(rq, false, false);
416 return;416 return;
417 }417 }
418 418
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
361 bool has_sched,361 bool has_sched,
362 struct request *rq)362 struct request *rq)
363{363{
364 /* dispatch flush rq directly */364 /*
365 if (rq->rq_flags & RQF_FLUSH_SEQ) {365 * dispatch flush and passthrough rq directly
366 spin_lock(&hctx->lock);366 *
367 list_add(&rq->queuelist, &hctx->dispatch);367 * passthrough request has to be added to hctx->dispatch directly.
368 spin_unlock(&hctx->lock);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))
369 return true;376 return true;
370 }
371 377
372 if (has_sched)378 if (has_sched)
373 rq->rq_flags |= RQF_SORTED;379 rq->rq_flags |= RQF_SORTED;
@@ -391,8 +397,10 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head, · 17 unmodified lines
391 397
392 WARN_ON(e && (rq->tag != -1));398 WARN_ON(e && (rq->tag != -1));
393 399
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);
395 goto run;402 goto run;
403 }
396 404
397 if (e && e->type->ops.insert_requests) {405 if (e && e->type->ops.insert_requests) {
398 LIST_HEAD(list);406 LIST_HEAD(list);
block/blk-mq-tag.c+2−2
@@ -183,8 +183,8 @@ found_tag: · 182 unmodified lines
183 return tag + tag_offset;183 return tag + tag_offset;
184}184}
185 185
186void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,186void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
187 struct blk_mq_ctx *ctx, unsigned int tag)187 unsigned int tag)
188{188{
189 if (!blk_mq_tag_is_reserved(tags, tag)) {189 if (!blk_mq_tag_is_reserved(tags, tag)) {
190 const int real_tag = tag - tags->nr_reserved_tags;190 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
26extern void blk_mq_free_tags(struct blk_mq_tags *tags);26extern void blk_mq_free_tags(struct blk_mq_tags *tags);
27 27
28extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);28extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);
29extern void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,29extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
30 struct blk_mq_ctx *ctx, unsigned int tag);30 unsigned int tag);
31extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,31extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
32 struct blk_mq_tags **tags,32 struct blk_mq_tags **tags,
33 unsigned int depth, bool can_grow);33 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
477 blk_pm_mark_last_busy(rq);477 blk_pm_mark_last_busy(rq);
478 rq->mq_hctx = NULL;478 rq->mq_hctx = NULL;
479 if (rq->tag != -1)479 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);
481 if (sched_tag != -1)481 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);
483 blk_mq_sched_restart(hctx);483 blk_mq_sched_restart(hctx);
484 blk_queue_exit(q);484 blk_queue_exit(q);
485}485}
@@ -735,7 +735,7 @@ static void blk_mq_requeue_work(struct work_struct *work) · 249 unmodified lines
735 * merge.735 * merge.
736 */736 */
737 if (rq->rq_flags & RQF_DONTPREP)737 if (rq->rq_flags & RQF_DONTPREP)
738 blk_mq_request_bypass_insert(rq, false);738 blk_mq_request_bypass_insert(rq, false, false);
739 else739 else
740 blk_mq_sched_insert_request(rq, true, false, false);740 blk_mq_sched_insert_request(rq, true, false, false);
741 }741 }
@@ -1286,7 +1286,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 544 unmodified lines
1286 q->mq_ops->commit_rqs(hctx);1286 q->mq_ops->commit_rqs(hctx);
1287 1287
1288 spin_lock(&hctx->lock);1288 spin_lock(&hctx->lock);
1289 list_splice_init(list, &hctx->dispatch);1289 list_splice_tail_init(list, &hctx->dispatch);
1290 spin_unlock(&hctx->lock);1290 spin_unlock(&hctx->lock);
1291 1291
1292 /*1292 /*
@@ -1677,12 +1677,16 @@ void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, · 384 unmodified lines
1677 * Should only be used carefully, when the caller knows we want to1677 * Should only be used carefully, when the caller knows we want to
1678 * bypass a potential IO scheduler on the target device.1678 * bypass a potential IO scheduler on the target device.
1679 */1679 */
1680void blk_mq_request_bypass_insert(struct request *rq, bool run_queue)1680void blk_mq_request_bypass_insert(struct request *rq, bool at_head,
1681 bool run_queue)
1681{1682{
1682 struct blk_mq_hw_ctx *hctx = rq->mq_hctx;1683 struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
1683 1684
1684 spin_lock(&hctx->lock);1685 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);
1686 spin_unlock(&hctx->lock);1690 spin_unlock(&hctx->lock);
1687 1691
1688 if (run_queue)1692 if (run_queue)
@@ -1849,7 +1853,7 @@ insert: · 160 unmodified lines
1849 if (bypass_insert)1853 if (bypass_insert)
1850 return BLK_STS_RESOURCE;1854 return BLK_STS_RESOURCE;
1851 1855
1852 blk_mq_request_bypass_insert(rq, run_queue);1856 blk_mq_request_bypass_insert(rq, false, run_queue);
1853 return BLK_STS_OK;1857 return BLK_STS_OK;
1854}1858}
1855 1859
@@ -1876,7 +1880,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, · 20 unmodified lines
1876 1880
1877 ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false, true);1881 ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false, true);
1878 if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)1882 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);
1880 else if (ret != BLK_STS_OK)1884 else if (ret != BLK_STS_OK)
1881 blk_mq_end_request(rq, ret);1885 blk_mq_end_request(rq, ret);
1882 1886
@@ -1910,7 +1914,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx, · 27 unmodified lines
1910 if (ret != BLK_STS_OK) {1914 if (ret != BLK_STS_OK) {
1911 if (ret == BLK_STS_RESOURCE ||1915 if (ret == BLK_STS_RESOURCE ||
1912 ret == BLK_STS_DEV_RESOURCE) {1916 ret == BLK_STS_DEV_RESOURCE) {
1913 blk_mq_request_bypass_insert(rq,1917 blk_mq_request_bypass_insert(rq, false,
1914 list_empty(list));1918 list_empty(list));
1915 break;1919 break;
1916 }1920 }
@@ -3398,7 +3402,6 @@ static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb) · 1481 unmodified lines
3398}3402}
3399 3403
3400static unsigned long blk_mq_poll_nsecs(struct request_queue *q,3404static unsigned long blk_mq_poll_nsecs(struct request_queue *q,
3401 struct blk_mq_hw_ctx *hctx,
3402 struct request *rq)3405 struct request *rq)
3403{3406{
3404 unsigned long ret = 0;3407 unsigned long ret = 0;
@@ -3431,7 +3434,6 @@ static unsigned long blk_mq_poll_nsecs(struct request_queue *q, · 26 unmodified lines
3431}3434}
3432 3435
3433static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,3436static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
3434 struct blk_mq_hw_ctx *hctx,
3435 struct request *rq)3437 struct request *rq)
3436{3438{
3437 struct hrtimer_sleeper hs;3439 struct hrtimer_sleeper hs;
@@ -3451,7 +3453,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, · 13 unmodified lines
3451 if (q->poll_nsec > 0)3453 if (q->poll_nsec > 0)
3452 nsecs = q->poll_nsec;3454 nsecs = q->poll_nsec;
3453 else3455 else
3454 nsecs = blk_mq_poll_nsecs(q, hctx, rq);3456 nsecs = blk_mq_poll_nsecs(q, rq);
3455 3457
3456 if (!nsecs)3458 if (!nsecs)
3457 return false;3459 return false;
@@ -3506,7 +3508,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q, · 48 unmodified lines
3506 return false;3508 return false;
3507 }3509 }
3508 3510
3509 return blk_mq_poll_hybrid_sleep(q, hctx, rq);3511 return blk_mq_poll_hybrid_sleep(q, rq);
3510}3512}
3511 3513
3512/**3514/**
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
66 */66 */
67void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,67void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
68 bool at_head);68 bool at_head);
69void blk_mq_request_bypass_insert(struct request *rq, bool run_queue);69void blk_mq_request_bypass_insert(struct request *rq, bool at_head,
70 bool run_queue);
70void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,71void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
71 struct list_head *list);72 struct list_head *list);
72 73
@@ -199,7 +200,7 @@ static inline bool blk_mq_get_dispatch_budget(struct blk_mq_hw_ctx *hctx) · 126 unmodified lines
199static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,200static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
200 struct request *rq)201 struct request *rq)
201{202{
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);
203 rq->tag = -1;204 rq->tag = -1;
204 205
205 if (rq->rq_flags & RQF_MQ_INFLIGHT) {206 if (rq->rq_flags & RQF_MQ_INFLIGHT) {
crypto/Kconfig+0−4
@@ -136,8 +136,6 @@ config CRYPTO_USER · 135 unmodified lines
136 Userspace configuration for cryptographic instantiations such as136 Userspace configuration for cryptographic instantiations such as
137 cbc(aes).137 cbc(aes).
138 138
139if CRYPTO_MANAGER2
140
141config CRYPTO_MANAGER_DISABLE_TESTS139config CRYPTO_MANAGER_DISABLE_TESTS
142 bool "Disable run-time self tests"140 bool "Disable run-time self tests"
143 default y141 default y
@@ -155,8 +153,6 @@ config CRYPTO_MANAGER_EXTRA_TESTS · 11 unmodified lines
155 This is intended for developer use only, as these tests take much153 This is intended for developer use only, as these tests take much
156 longer to run than the normal self tests.154 longer to run than the normal self tests.
157 155
158endif # if CRYPTO_MANAGER2
159
160config CRYPTO_GF128MUL156config CRYPTO_GF128MUL
161 tristate157 tristate
162 158
crypto/hash_info.c+1−1
@@ -26,7 +26,7 @@ const char *const hash_algo_name[HASH_ALGO__LAST] = { · 25 unmodified lines
26 [HASH_ALGO_TGR_128] = "tgr128",26 [HASH_ALGO_TGR_128] = "tgr128",
27 [HASH_ALGO_TGR_160] = "tgr160",27 [HASH_ALGO_TGR_160] = "tgr160",
28 [HASH_ALGO_TGR_192] = "tgr192",28 [HASH_ALGO_TGR_192] = "tgr192",
29 [HASH_ALGO_SM3_256] = "sm3-256",29 [HASH_ALGO_SM3_256] = "sm3",
30 [HASH_ALGO_STREEBOG_256] = "streebog256",30 [HASH_ALGO_STREEBOG_256] = "streebog256",
31 [HASH_ALGO_STREEBOG_512] = "streebog512",31 [HASH_ALGO_STREEBOG_512] = "streebog512",
32};32};
crypto/testmgr.c+36−0
@@ -4436,6 +4436,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 4435 unmodified lines
4436 .cipher = __VECS(tf_cbc_tv_template)4436 .cipher = __VECS(tf_cbc_tv_template)
4437 },4437 },
4438 }, {4438 }, {
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
4439 .alg = "cbcmac(aes)",4448 .alg = "cbcmac(aes)",
4440 .fips_allowed = 1,4449 .fips_allowed = 1,
4441 .test = alg_test_hash,4450 .test = alg_test_hash,
@@ -4587,6 +4596,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 145 unmodified lines
4587 .cipher = __VECS(tf_ctr_tv_template)4596 .cipher = __VECS(tf_ctr_tv_template)
4588 }4597 }
4589 }, {4598 }, {
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
4590 .alg = "cts(cbc(aes))",4608 .alg = "cts(cbc(aes))",
4591 .test = alg_test_skcipher,4609 .test = alg_test_skcipher,
4592 .fips_allowed = 1,4610 .fips_allowed = 1,
@@ -4879,6 +4897,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 286 unmodified lines
4879 .cipher = __VECS(xtea_tv_template)4897 .cipher = __VECS(xtea_tv_template)
4880 }4898 }
4881 }, {4899 }, {
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
4882 .alg = "ecdh",4909 .alg = "ecdh",
4883 .test = alg_test_kpp,4910 .test = alg_test_kpp,
4884 .fips_allowed = 1,4911 .fips_allowed = 1,
@@ -5465,6 +5492,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 580 unmodified lines
5465 .cipher = __VECS(tf_xts_tv_template)5492 .cipher = __VECS(tf_xts_tv_template)
5466 }5493 }
5467 }, {5494 }, {
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
5468 .alg = "xts4096(paes)",5504 .alg = "xts4096(paes)",
5469 .test = alg_test_null,5505 .test = alg_test_null,
5470 .fips_allowed = 1,5506 .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
55}55}
56#endif56#endif
57 57
58static bool acpi_no_watchdog;
59
58static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)60static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
59{61{
60 const struct acpi_table_wdat *wdat = NULL;62 const struct acpi_table_wdat *wdat = NULL;
61 acpi_status status;63 acpi_status status;
62 64
63 if (acpi_disabled)65 if (acpi_disabled || acpi_no_watchdog)
64 return NULL;66 return NULL;
65 67
66 status = acpi_get_table(ACPI_SIG_WDAT, 0,68 status = acpi_get_table(ACPI_SIG_WDAT, 0,
@@ -88,6 +90,14 @@ bool acpi_has_watchdog(void) · 21 unmodified lines
88}90}
89EXPORT_SYMBOL_GPL(acpi_has_watchdog);91EXPORT_SYMBOL_GPL(acpi_has_watchdog);
90 92
93/* ACPI watchdog can be disabled on boot command line */
94static 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
91void __init acpi_watchdog_init(void)101void __init acpi_watchdog_init(void)
92{102{
93 const struct acpi_wdat_entry *entries;103 const struct acpi_wdat_entry *entries;
@@ -126,12 +136,11 @@ void __init acpi_watchdog_init(void) · 32 unmodified lines
126 gas = &entries[i].register_region;136 gas = &entries[i].register_region;
127 137
128 res.start = gas->address;138 res.start = gas->address;
139 res.end = res.start + ACPI_ACCESS_BYTE_WIDTH(gas->access_width) - 1;
129 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {140 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
130 res.flags = IORESOURCE_MEM;141 res.flags = IORESOURCE_MEM;
131 res.end = res.start + ALIGN(gas->access_width, 4) - 1;
132 } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {142 } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
133 res.flags = IORESOURCE_IO;143 res.flags = IORESOURCE_IO;
134 res.end = res.start + gas->access_width - 1;
135 } else {144 } else {
136 pr_warn("Unsupported address space: %u\n",145 pr_warn("Unsupported address space: %u\n",
137 gas->space_id);146 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
101 101
102acpi_status acpi_hw_enable_all_wakeup_gpes(void);102acpi_status acpi_hw_enable_all_wakeup_gpes(void);
103 103
104u8 acpi_hw_check_all_gpes(void);
105
104acpi_status106acpi_status
105acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,107acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
106 struct acpi_gpe_block_info *gpe_block,108 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
265 handler) (acpi_gbl_fixed_event_handlers[event].context));265 handler) (acpi_gbl_fixed_event_handlers[event].context));
266}266}
267 267
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
280u32 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
268#endif /* !ACPI_REDUCED_HARDWARE */313#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
795 795
796ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)796ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
797 797
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 ******************************************************************************/
810u32 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
828ACPI_EXPORT_SYMBOL(acpi_any_gpe_status_set)
829
798/*******************************************************************************830/*******************************************************************************
799 *831 *
800 * FUNCTION: acpi_install_gpe_block832 * 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
444 return (AE_OK);444 return (AE_OK);
445}445}
446 446
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
460static acpi_status
461acpi_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
447/******************************************************************************494/******************************************************************************
448 *495 *
449 * FUNCTION: acpi_hw_disable_all_gpes496 * FUNCTION: acpi_hw_disable_all_gpes
@@ -510,4 +557,28 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void) · 60 unmodified lines
510 return_ACPI_STATUS(status);557 return_ACPI_STATUS(status);
511}558}
512 559
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
573u8 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
513#endif /* !ACPI_REDUCED_HARDWARE */584#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/ec.c+26−18
@@ -179,6 +179,7 @@ EXPORT_SYMBOL(first_ec); · 178 unmodified lines
179 179
180static struct acpi_ec *boot_ec;180static struct acpi_ec *boot_ec;
181static bool boot_ec_is_ecdt = false;181static bool boot_ec_is_ecdt = false;
182static struct workqueue_struct *ec_wq;
182static struct workqueue_struct *ec_query_wq;183static struct workqueue_struct *ec_query_wq;
183 184
184static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */185static 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
469 ec_dbg_evt("Command(%s) submitted/blocked",470 ec_dbg_evt("Command(%s) submitted/blocked",
470 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));471 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY));
471 ec->nr_pending_queries++;472 ec->nr_pending_queries++;
472 schedule_work(&ec->work);473 queue_work(ec_wq, &ec->work);
473 }474 }
474}475}
475 476
@@ -535,7 +536,7 @@ static void acpi_ec_enable_event(struct acpi_ec *ec) · 59 unmodified lines
535#ifdef CONFIG_PM_SLEEP536#ifdef CONFIG_PM_SLEEP
536static void __acpi_ec_flush_work(void)537static void __acpi_ec_flush_work(void)
537{538{
538 flush_scheduled_work(); /* flush ec->work */539 drain_workqueue(ec_wq); /* flush ec->work */
539 flush_workqueue(ec_query_wq); /* flush queries */540 flush_workqueue(ec_query_wq); /* flush queries */
540}541}
541 542
@@ -556,8 +557,8 @@ static void acpi_ec_disable_event(struct acpi_ec *ec) · 14 unmodified lines
556 557
557void acpi_ec_flush_work(void)558void acpi_ec_flush_work(void)
558{559{
559 /* Without ec_query_wq there is nothing to flush. */560 /* Without ec_wq there is nothing to flush. */
560 if (!ec_query_wq)561 if (!ec_wq)
561 return;562 return;
562 563
563 __acpi_ec_flush_work();564 __acpi_ec_flush_work();
@@ -2107,25 +2108,33 @@ static struct acpi_driver acpi_ec_driver = { · 1543 unmodified lines
2107 .drv.pm = &acpi_ec_pm,2108 .drv.pm = &acpi_ec_pm,
2108};2109};
2109 2110
2110static inline int acpi_ec_query_init(void)2111static void acpi_ec_destroy_workqueues(void)
2111{2112{
2112 if (!ec_query_wq) {2113 if (ec_wq) {
2113 ec_query_wq = alloc_workqueue("kec_query", 0,2114 destroy_workqueue(ec_wq);
2114 ec_max_queries);2115 ec_wq = NULL;
2115 if (!ec_query_wq)
2116 return -ENODEV;
2117 }2116 }
2118 return 0;
2119}
2120
2121static inline void acpi_ec_query_exit(void)
2122{
2123 if (ec_query_wq) {2117 if (ec_query_wq) {
2124 destroy_workqueue(ec_query_wq);2118 destroy_workqueue(ec_query_wq);
2125 ec_query_wq = NULL;2119 ec_query_wq = NULL;
2126 }2120 }
2127}2121}
2128 2122
2123static 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
2129static const struct dmi_system_id acpi_ec_no_wakeup[] = {2138static const struct dmi_system_id acpi_ec_no_wakeup[] = {
2130 {2139 {
2131 .ident = "Thinkpad X1 Carbon 6th",2140 .ident = "Thinkpad X1 Carbon 6th",
@@ -2156,8 +2165,7 @@ int __init acpi_ec_init(void) · 24 unmodified lines
2156 int result;2165 int result;
2157 int ecdt_fail, dsdt_fail;2166 int ecdt_fail, dsdt_fail;
2158 2167
2159 /* register workqueue for _Qxx evaluations */2168 result = acpi_ec_init_workqueues();
2160 result = acpi_ec_query_init();
2161 if (result)2169 if (result)
2162 return result;2170 return result;
2163 2171
@@ -2188,6 +2196,6 @@ static void __exit acpi_ec_exit(void) · 24 unmodified lines
2188{2196{
2189 2197
2190 acpi_bus_unregister_driver(&acpi_ec_driver);2198 acpi_bus_unregister_driver(&acpi_ec_driver);
2191 acpi_ec_query_exit();2199 acpi_ec_destroy_workqueues();
2192}2200}
2193#endif /* 0 */2201#endif /* 0 */
drivers/acpi/sleep.c+44−13
@@ -990,21 +990,41 @@ static void acpi_s2idle_sync(void) · 989 unmodified lines
990 acpi_os_wait_events_complete(); /* synchronize Notify handling */990 acpi_os_wait_events_complete(); /* synchronize Notify handling */
991}991}
992 992
993static void acpi_s2idle_wake(void)993static bool acpi_s2idle_wake(void)
994{994{
995 /*995 if (!acpi_sci_irq_valid())
996 * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the SCI has996 return pm_wakeup_pending();
997 * not triggered while suspended, so bail out.997
998 */998 while (pm_wakeup_pending()) {
999 if (!acpi_sci_irq_valid() ||999 /*
1000 irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))1000 * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the
1001 return;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.