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
Unified · Split
| @@ -100,6 +100,10 @@ modules.order · 99 unmodified lines | ||
| 100 | 100 | /include/ksym/ |
| 101 | 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 | 107 | # stgit generated dirs |
| 104 | 108 | patches-* |
| 105 | 109 | |
| @@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see: · 15 unmodified lines | ||
| 16 | 16 | Documentation/process/license-rules.rst |
| 17 | 17 | |
| 18 | 18 | for more details. |
| 19 | + | |
| 20 | +All contributions to the Linux Kernel are subject to this COPYING file. | |
| @@ -567,6 +567,11 @@ D: Original author of Amiga FFS filesystem · 566 unmodified lines | ||
| 567 | 567 | S: Orlando, Florida |
| 568 | 568 | S: USA |
| 569 | 569 | |
| 570 | +N: Paul Burton | |
| 571 | +E: paulburton@kernel.org | |
| 572 | +W: https://pburton.com | |
| 573 | +D: MIPS maintainer 2018-2020 | |
| 574 | + | |
| 570 | 575 | N: Lennert Buytenhek |
| 571 | 576 | E: kernel@wantstofly.org |
| 572 | 577 | D: Original (2.4) rewrite of the ethernet bridging code |
| @@ -62,6 +62,30 @@ Or more shorter, written as following:: · 61 unmodified lines | ||
| 62 | 62 | In both styles, same key words are automatically merged when parsing it |
| 63 | 63 | at boot time. So you can append similar trees or key-values. |
| 64 | 64 | |
| 65 | +Same-key Values | |
| 66 | +--------------- | |
| 67 | + | |
| 68 | +It is prohibited that two or more values or arrays share a same-key. | |
| 69 | +For example,:: | |
| 70 | + | |
| 71 | + foo = bar, baz | |
| 72 | + foo = qux # !ERROR! we can not re-define same key | |
| 73 | + | |
| 74 | +If you want to append the value to existing key as an array member, | |
| 75 | +you can use ``+=`` operator. For example:: | |
| 76 | + | |
| 77 | + foo = bar, baz | |
| 78 | + foo += qux | |
| 79 | + | |
| 80 | +In this case, the key ``foo`` has ``bar``, ``baz`` and ``qux``. | |
| 81 | + | |
| 82 | +However, a sub-key and a value can not co-exist under a parent key. | |
| 83 | +For example, following config is NOT allowed.:: | |
| 84 | + | |
| 85 | + foo = value1 | |
| 86 | + foo.bar = value2 # !ERROR! subkey "bar" and value "value1" can NOT co-exist | |
| 87 | + | |
| 88 | + | |
| 65 | 89 | Comments |
| 66 | 90 | -------- |
| 67 | 91 | |
| @@ -102,9 +126,13 @@ Boot Kernel With a Boot Config · 34 unmodified lines | ||
| 102 | 126 | ============================== |
| 103 | 127 | |
| 104 | 128 | Since the boot configuration file is loaded with initrd, it will be added |
| 105 | −to the end of the initrd (initramfs) image file. The Linux kernel decodes | |
| 106 | −the last part of the initrd image in memory to get the boot configuration | |
| 107 | −data. | |
| 129 | +to the end of the initrd (initramfs) image file with size, checksum and | |
| 130 | +12-byte magic word as below. | |
| 131 | + | |
| 132 | +[initrd][bootconfig][size(u32)][checksum(u32)][#BOOTCONFIG\n] | |
| 133 | + | |
| 134 | +The Linux kernel decodes the last part of the initrd image in memory to | |
| 135 | +get the boot configuration data. | |
| 108 | 136 | Because of this "piggyback" method, there is no need to change or |
| 109 | 137 | update the boot loader and the kernel image itself. |
| 110 | 138 | |
| @@ -136,6 +136,10 @@ · 135 unmodified lines | ||
| 136 | 136 | dynamic table installation which will install SSDT |
| 137 | 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 | 143 | acpi_rsdp= [ACPI,EFI,KEXEC] |
| 140 | 144 | Pass the RSDP address to the kernel, mostly used |
| 141 | 145 | on machines running EFI runtime service to boot the |
| @@ -129,7 +129,7 @@ this logic. · 128 unmodified lines | ||
| 129 | 129 | |
| 130 | 130 | As a single binary will need to support both 48-bit and 52-bit VA |
| 131 | 131 | spaces, the VMEMMAP must be sized large enough for 52-bit VAs and |
| 132 | −also must be sized large enought to accommodate a fixed PAGE_OFFSET. | |
| 132 | +also must be sized large enough to accommodate a fixed PAGE_OFFSET. | |
| 133 | 133 | |
| 134 | 134 | Most code in the kernel should not need to consider the VA_BITS, for |
| 135 | 135 | code that does need to know the VA size the variables are |
| @@ -44,8 +44,15 @@ The AArch64 Tagged Address ABI has two stages of relaxation depending · 43 unmodified lines | ||
| 44 | 44 | how the user addresses are used by the kernel: |
| 45 | 45 | |
| 46 | 46 | 1. User addresses not accessed by the kernel but used for address space |
| 47 | − management (e.g. ``mmap()``, ``mprotect()``, ``madvise()``). The use | |
| 48 | − of valid tagged pointers in this context is always allowed. | |
| 47 | + management (e.g. ``mprotect()``, ``madvise()``). The use of valid | |
| 48 | + tagged pointers in this context is allowed with the exception of | |
| 49 | + ``brk()``, ``mmap()`` and the ``new_address`` argument to | |
| 50 | + ``mremap()`` as these have the potential to alias with existing | |
| 51 | + user addresses. | |
| 52 | + | |
| 53 | + NOTE: This behaviour changed in v5.6 and so some earlier kernels may | |
| 54 | + incorrectly accept valid tagged pointers for the ``brk()``, | |
| 55 | + ``mmap()`` and ``mremap()`` system calls. | |
| 49 | 56 | |
| 50 | 57 | 2. User addresses accessed by the kernel (e.g. ``write()``). This ABI |
| 51 | 58 | relaxation is disabled by default and the application thread needs to |
| @@ -551,6 +551,7 @@ options to your ``.config``: · 550 unmodified lines | ||
| 551 | 551 | Once the kernel is built and installed, a simple |
| 552 | 552 | |
| 553 | 553 | .. code-block:: bash |
| 554 | + | |
| 554 | 555 | modprobe example-test |
| 555 | 556 | |
| 556 | 557 | ...will run the tests. |
| @@ -43,9 +43,13 @@ properties: · 42 unmodified lines | ||
| 43 | 43 | - enum: |
| 44 | 44 | - allwinner,sun8i-h3-tcon-tv |
| 45 | 45 | - allwinner,sun50i-a64-tcon-tv |
| 46 | − - allwinner,sun50i-h6-tcon-tv | |
| 47 | 46 | - 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 | 53 | reg: |
| 50 | 54 | maxItems: 1 |
| 51 | 55 | |
| @@ -1,9 +1,10 @@ | ||
| 1 | −Ilitek ILI210x/ILI2117/ILI251x touchscreen controller | |
| 1 | +Ilitek ILI210x/ILI2117/ILI2120/ILI251x touchscreen controller | |
| 2 | 2 | |
| 3 | 3 | Required properties: |
| 4 | 4 | - compatible: |
| 5 | 5 | ilitek,ili210x for ILI210x |
| 6 | 6 | ilitek,ili2117 for ILI2117 |
| 7 | + ilitek,ili2120 for ILI2120 | |
| 7 | 8 | ilitek,ili251x for ILI251x |
| 8 | 9 | |
| 9 | 10 | - reg: The I2C address of the device |
| @@ -33,24 +33,40 @@ properties: · 32 unmodified lines | ||
| 33 | 33 | maxItems: 1 |
| 34 | 34 | |
| 35 | 35 | clocks: |
| 36 | − minItems: 2 | |
| 37 | − maxItems: 3 | |
| 38 | − items: | |
| 39 | − - description: The CSI interface clock | |
| 40 | − - description: The CSI ISP clock | |
| 41 | − - description: The CSI DRAM clock | |
| 36 | + oneOf: | |
| 37 | + - items: | |
| 38 | + - description: The CSI interface clock | |
| 39 | + - description: The CSI DRAM clock | |
| 40 | + | |
| 41 | + - items: | |
| 42 | + - description: The CSI interface clock | |
| 43 | + - description: The CSI ISP clock | |
| 44 | + - description: The CSI DRAM clock | |
| 42 | 45 | |
| 43 | 46 | clock-names: |
| 44 | − minItems: 2 | |
| 45 | − maxItems: 3 | |
| 46 | − items: | |
| 47 | − - const: bus | |
| 48 | − - const: isp | |
| 49 | − - const: ram | |
| 47 | + oneOf: | |
| 48 | + - items: | |
| 49 | + - const: bus | |
| 50 | + - const: ram | |
| 51 | + | |
| 52 | + - items: | |
| 53 | + - const: bus | |
| 54 | + - const: isp | |
| 55 | + - const: ram | |
| 50 | 56 | |
| 51 | 57 | resets: |
| 52 | 58 | 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 | 70 | # See ./video-interfaces.txt for details |
| 55 | 71 | port: |
| 56 | 72 | type: object |
| @@ -347,6 +347,7 @@ examples: · 346 unmodified lines | ||
| 347 | 347 | interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; |
| 348 | 348 | |
| 349 | 349 | #iommu-cells = <1>; |
| 350 | + #reset-cells = <1>; | |
| 350 | 351 | }; |
| 351 | 352 | |
| 352 | 353 | external-memory-controller@7001b000 { |
| @@ -363,20 +364,23 @@ examples: · 10 unmodified lines | ||
| 363 | 364 | timing-0 { |
| 364 | 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 | 367 | nvidia,emc-auto-cal-config = <0xa1430000>; |
| 374 | 368 | nvidia,emc-auto-cal-config2 = <0x00000000>; |
| 375 | 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 | 375 | nvidia,emc-mode-1 = <0x80100003>; |
| 378 | 376 | nvidia,emc-mode-2 = <0x80200008>; |
| 379 | 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 | 385 | nvidia,emc-configuration = < |
| 382 | 386 | 0x00000000 /* EMC_RC */ |
| @@ -124,7 +124,7 @@ not every application needs SDIO irq, e.g. MMC cards. · 123 unmodified lines | ||
| 124 | 124 | pinctrl-1 = <&mmc1_idle>; |
| 125 | 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 | 130 | mmc1_idle : pinmux_cirq_pin { |
| @@ -56,7 +56,6 @@ patternProperties: · 55 unmodified lines | ||
| 56 | 56 | examples: |
| 57 | 57 | - | |
| 58 | 58 | davinci_mdio: mdio@5c030000 { |
| 59 | − compatible = "ti,davinci_mdio"; | |
| 60 | 59 | reg = <0x5c030000 0x1000>; |
| 61 | 60 | #address-cells = <1>; |
| 62 | 61 | #size-cells = <0>; |
| @@ -1,12 +1,17 @@ | ||
| 1 | 1 | ARM Freescale DSPI controller |
| 2 | 2 | |
| 3 | 3 | Required properties: |
| 4 | −- compatible : "fsl,vf610-dspi", "fsl,ls1021a-v1.0-dspi", | |
| 5 | − "fsl,ls2085a-dspi" | |
| 6 | − or | |
| 7 | − "fsl,ls2080a-dspi" followed by "fsl,ls2085a-dspi" | |
| 8 | − "fsl,ls1012a-dspi" followed by "fsl,ls1021a-v1.0-dspi" | |
| 9 | − "fsl,ls1088a-dspi" followed by "fsl,ls1021a-v1.0-dspi" | |
| 4 | +- compatible : must be one of: | |
| 5 | + "fsl,vf610-dspi", | |
| 6 | + "fsl,ls1021a-v1.0-dspi", | |
| 7 | + "fsl,ls1012a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"), | |
| 8 | + "fsl,ls1028a-dspi", | |
| 9 | + "fsl,ls1043a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"), | |
| 10 | + "fsl,ls1046a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"), | |
| 11 | + "fsl,ls1088a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"), | |
| 12 | + "fsl,ls2080a-dspi" (optionally followed by "fsl,ls2085a-dspi"), | |
| 13 | + "fsl,ls2085a-dspi", | |
| 14 | + "fsl,lx2160a-dspi", | |
| 10 | 15 | - reg : Offset and length of the register set for the device |
| 11 | 16 | - interrupts : Should contain SPI controller interrupt |
| 12 | 17 | - clocks: from common clock binding: handle to dspi clock. |
| @@ -71,9 +71,13 @@ b) Example for device tree:: · 70 unmodified lines | ||
| 71 | 71 | ipmb@10 { |
| 72 | 72 | compatible = "ipmb-dev"; |
| 73 | 73 | reg = <0x10>; |
| 74 | + i2c-protocol; | |
| 74 | 75 | }; |
| 75 | 76 | }; |
| 76 | 77 | |
| 78 | +If xmit of data to be done using raw i2c block vs smbus | |
| 79 | +then "i2c-protocol" needs to be defined as above. | |
| 80 | + | |
| 77 | 81 | 2) Manually from Linux:: |
| 78 | 82 | |
| 79 | 83 | modprobe ipmb-dev-int |
| @@ -134,7 +134,7 @@ Sequential zone files can only be written sequentially, starting from the file · 133 unmodified lines | ||
| 134 | 134 | end, that is, write operations can only be append writes. Zonefs makes no |
| 135 | 135 | attempt at accepting random writes and will fail any write request that has a |
| 136 | 136 | start offset not corresponding to the end of the file, or to the end of the last |
| 137 | −write issued and still in-flight (for asynchrnous I/O operations). | |
| 137 | +write issued and still in-flight (for asynchronous I/O operations). | |
| 138 | 138 | |
| 139 | 139 | Since dirty page writeback by the page cache does not guarantee a sequential |
| 140 | 140 | write pattern, zonefs prevents buffered writes and writeable shared mappings |
| @@ -142,7 +142,7 @@ on sequential files. Only direct I/O writes are accepted for these files. · 1 unmodified line | ||
| 142 | 142 | zonefs relies on the sequential delivery of write I/O requests to the device |
| 143 | 143 | implemented by the block layer elevator. An elevator implementing the sequential |
| 144 | 144 | write feature for zoned block device (ELEVATOR_F_ZBD_SEQ_WRITE elevator feature) |
| 145 | −must be used. This type of elevator (e.g. mq-deadline) is the set by default | |
| 145 | +must be used. This type of elevator (e.g. mq-deadline) is set by default | |
| 146 | 146 | for zoned block devices on device initialization. |
| 147 | 147 | |
| 148 | 148 | There are no restrictions on the type of I/O used for read operations in |
| @@ -196,7 +196,7 @@ additional conditions that result in I/O errors. · 47 unmodified lines | ||
| 196 | 196 | may still happen in the case of a partial failure of a very large direct I/O |
| 197 | 197 | operation split into multiple BIOs/requests or asynchronous I/O operations. |
| 198 | 198 | If one of the write request within the set of sequential write requests |
| 199 | − issued to the device fails, all write requests after queued after it will | |
| 199 | + issued to the device fails, all write requests queued after it will | |
| 200 | 200 | become unaligned and fail. |
| 201 | 201 | |
| 202 | 202 | * 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 | 207 | causing all data to be dropped after the sector that caused the error. |
| 208 | 208 | |
| 209 | 209 | All I/O errors detected by zonefs are notified to the user with an error code |
| 210 | −return for the system call that trigered or detected the error. The recovery | |
| 210 | +return for the system call that triggered or detected the error. The recovery | |
| 211 | 211 | actions taken by zonefs in response to I/O errors depend on the I/O type (read |
| 212 | 212 | vs write) and on the reason for the error (bad sector, unaligned writes or zone |
| 213 | 213 | condition change). |
| @@ -222,7 +222,7 @@ condition change). · 8 unmodified lines | ||
| 222 | 222 | * A zone condition change to read-only or offline also always triggers zonefs |
| 223 | 223 | I/O error recovery. |
| 224 | 224 | |
| 225 | −Zonefs minimal I/O error recovery may change a file size and a file access | |
| 225 | +Zonefs minimal I/O error recovery may change a file size and file access | |
| 226 | 226 | permissions. |
| 227 | 227 | |
| 228 | 228 | * File size changes: |
| @@ -237,7 +237,7 @@ permissions. · 8 unmodified lines | ||
| 237 | 237 | A file size may also be reduced to reflect a delayed write error detected on |
| 238 | 238 | fsync(): in this case, the amount of data effectively written in the zone may |
| 239 | 239 | be less than originally indicated by the file inode size. After such I/O |
| 240 | − error, zonefs always fixes a file inode size to reflect the amount of data | |
| 240 | + error, zonefs always fixes the file inode size to reflect the amount of data | |
| 241 | 241 | persistently stored in the file zone. |
| 242 | 242 | |
| 243 | 243 | * Access permission changes: |
| @@ -281,11 +281,11 @@ Further notes: · 37 unmodified lines | ||
| 281 | 281 | permissions to read-only applies to all files. The file system is remounted |
| 282 | 282 | read-only. |
| 283 | 283 | * Access permission and file size changes due to the device transitioning zones |
| 284 | − to the offline condition are permanent. Remounting or reformating the device | |
| 284 | + to the offline condition are permanent. Remounting or reformatting the device | |
| 285 | 285 | with mkfs.zonefs (mkzonefs) will not change back offline zone files to a good |
| 286 | 286 | state. |
| 287 | 287 | * File access permission changes to read-only due to the device transitioning |
| 288 | − zones to the read-only condition are permanent. Remounting or reformating | |
| 288 | + zones to the read-only condition are permanent. Remounting or reformatting | |
| 289 | 289 | the device will not re-enable file write access. |
| 290 | 290 | * File access permission changes implied by the remount-ro, zone-ro and |
| 291 | 291 | zone-offline mount options are temporary for zones in a good condition. |
| @@ -301,13 +301,13 @@ Mount options · 9 unmodified lines | ||
| 301 | 301 | |
| 302 | 302 | zonefs define the "errors=<behavior>" mount option to allow the user to specify |
| 303 | 303 | zonefs behavior in response to I/O errors, inode size inconsistencies or zone |
| 304 | −condition chages. The defined behaviors are as follow: | |
| 304 | +condition changes. The defined behaviors are as follow: | |
| 305 | 305 | * remount-ro (default) |
| 306 | 306 | * zone-ro |
| 307 | 307 | * zone-offline |
| 308 | 308 | * repair |
| 309 | 309 | |
| 310 | −The I/O error actions defined for each behavior is detailed in the previous | |
| 310 | +The I/O error actions defined for each behavior are detailed in the previous | |
| 311 | 311 | section. |
| 312 | 312 | |
| 313 | 313 | Zonefs User Space Tools |
| @@ -24,6 +24,7 @@ This driver implements support for Infineon Multi-phase XDPE122 family · 23 unmodified lines | ||
| 24 | 24 | dual loop voltage regulators. |
| 25 | 25 | The family includes XDPE12284 and XDPE12254 devices. |
| 26 | 26 | The devices from this family complaint with: |
| 27 | + | |
| 27 | 28 | - Intel VR13 and VR13HC rev 1.3, IMVP8 rev 1.2 and IMPVP9 rev 1.3 DC-DC |
| 28 | 29 | converter specification. |
| 29 | 30 | - Intel SVID rev 1.9. protocol. |
| @@ -765,7 +765,7 @@ is not sufficient this sometimes needs to be explicit. · 764 unmodified lines | ||
| 765 | 765 | Example:: |
| 766 | 766 | |
| 767 | 767 | #arch/x86/boot/Makefile |
| 768 | − subdir- := compressed/ | |
| 768 | + subdir- := compressed | |
| 769 | 769 | |
| 770 | 770 | The above assignment instructs kbuild to descend down in the |
| 771 | 771 | directory compressed/ when "make clean" is executed. |
| @@ -1379,9 +1379,6 @@ See subsequent chapter for the syntax of the Kbuild file. · 607 unmodified lines | ||
| 1379 | 1379 | in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate |
| 1380 | 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 | − | |
| 1385 | 1382 | 8 Kbuild Variables |
| 1386 | 1383 | ================== |
| 1387 | 1384 | |
| @@ -487,8 +487,9 @@ phy_register_fixup_for_id():: · 486 unmodified lines | ||
| 487 | 487 | The stubs set one of the two matching criteria, and set the other one to |
| 488 | 488 | match anything. |
| 489 | 489 | |
| 490 | −When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module, | |
| 491 | −unregister fixup and free allocate memory are required. | |
| 490 | +When phy_register_fixup() or \*_for_uid()/\*_for_id() is called at module load | |
| 491 | +time, the module needs to unregister the fixup and free allocated memory when | |
| 492 | +it's unloaded. | |
| 492 | 493 | |
| 493 | 494 | Call one of following function before unloading module:: |
| 494 | 495 | |
| @@ -13,7 +13,6 @@ Power Management · 12 unmodified lines | ||
| 13 | 13 | drivers-testing |
| 14 | 14 | energy-model |
| 15 | 15 | freezing-of-tasks |
| 16 | − interface | |
| 17 | 16 | opp |
| 18 | 17 | pci |
| 19 | 18 | pm_qos_interface |
| @@ -244,23 +244,23 @@ disclosure of a particular issue, unless requested by a response team or by · 243 unmodified lines | ||
| 244 | 244 | an involved disclosed party. The current ambassadors list: |
| 245 | 245 | |
| 246 | 246 | ============= ======================================================== |
| 247 | − ARM | |
| 247 | + ARM Grant Likely <grant.likely@arm.com> | |
| 248 | 248 | AMD Tom Lendacky <tom.lendacky@amd.com> |
| 249 | 249 | IBM |
| 250 | 250 | Intel Tony Luck <tony.luck@intel.com> |
| 251 | 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 | 254 | VMware |
| 255 | 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 | 258 | Debian Ben Hutchings <ben@decadent.org.uk> |
| 259 | 259 | Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
| 260 | 260 | Red Hat Josh Poimboeuf <jpoimboe@redhat.com> |
| 261 | 261 | SUSE Jiri Kosina <jkosina@suse.cz> |
| 262 | 262 | |
| 263 | − Amazon Peter Bowen <pzb@amzn.com> | |
| 263 | + Amazon | |
| 264 | 264 | Google Kees Cook <keescook@chromium.org> |
| 265 | 265 | ============= ======================================================== |
| 266 | 266 | |
| @@ -30,4 +30,4 @@ if [ -n "$parallel" ] ; then · 29 unmodified lines | ||
| 30 | 30 | parallel="-j$parallel" |
| 31 | 31 | fi |
| 32 | 32 | |
| 33 | −exec "$sphinx" "$parallel" "$@" | |
| 33 | +exec "$sphinx" $parallel "$@" | |
| @@ -183,7 +183,7 @@ CVE分配 · 182 unmodified lines | ||
| 183 | 183 | VMware |
| 184 | 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 | 187 | Debian Ben Hutchings <ben@decadent.org.uk> |
| 188 | 188 | Oracle Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
| 189 | 189 | Red Hat Josh Poimboeuf <jpoimboe@redhat.com> |
| @@ -1,9 +1,11 @@ | ||
| 1 | +================== | |
| 1 | 2 | Guest halt polling |
| 2 | 3 | ================== |
| 3 | 4 | |
| 4 | 5 | The cpuidle_haltpoll driver, with the haltpoll governor, allows |
| 5 | 6 | the guest vcpus to poll for a specified amount of time before |
| 6 | 7 | halting. |
| 8 | + | |
| 7 | 9 | This provides the following benefits to host side polling: |
| 8 | 10 | |
| 9 | 11 | 1) The POLL flag is set while polling is performed, which allows |
| @@ -29,18 +31,21 @@ Module Parameters · 19 unmodified lines | ||
| 29 | 31 | The haltpoll governor has 5 tunable module parameters: |
| 30 | 32 | |
| 31 | 33 | 1) guest_halt_poll_ns: |
| 34 | + | |
| 32 | 35 | Maximum amount of time, in nanoseconds, that polling is |
| 33 | 36 | performed before halting. |
| 34 | 37 | |
| 35 | 38 | Default: 200000 |
| 36 | 39 | |
| 37 | 40 | 2) guest_halt_poll_shrink: |
| 41 | + | |
| 38 | 42 | Division factor used to shrink per-cpu guest_halt_poll_ns when |
| 39 | 43 | wakeup event occurs after the global guest_halt_poll_ns. |
| 40 | 44 | |
| 41 | 45 | Default: 2 |
| 42 | 46 | |
| 43 | 47 | 3) guest_halt_poll_grow: |
| 48 | + | |
| 44 | 49 | Multiplication factor used to grow per-cpu guest_halt_poll_ns |
| 45 | 50 | when event occurs after per-cpu guest_halt_poll_ns |
| 46 | 51 | but before global guest_halt_poll_ns. |
| @@ -48,6 +53,7 @@ but before global guest_halt_poll_ns. · 1 unmodified line | ||
| 48 | 53 | Default: 2 |
| 49 | 54 | |
| 50 | 55 | 4) guest_halt_poll_grow_start: |
| 56 | + | |
| 51 | 57 | The per-cpu guest_halt_poll_ns eventually reaches zero |
| 52 | 58 | in case of an idle system. This value sets the initial |
| 53 | 59 | per-cpu guest_halt_poll_ns when growing. This can |
| @@ -66,7 +72,7 @@ high once achieves global guest_halt_poll_ns value). · 12 unmodified lines | ||
| 66 | 72 | |
| 67 | 73 | Default: Y |
| 68 | 74 | |
| 69 | −The module parameters can be set from the debugfs files in: | |
| 75 | +The module parameters can be set from the debugfs files in:: | |
| 70 | 76 | |
| 71 | 77 | /sys/module/haltpoll/parameters/ |
| 72 | 78 | |
| @@ -74,5 +80,5 @@ Further Notes · 1 unmodified line | ||
| 74 | 80 | ============= |
| 75 | 81 | |
| 76 | 82 | - Care should be taken when setting the guest_halt_poll_ns parameter as a |
| 77 | −large value has the potential to drive the cpu usage to 100% on a machine which | |
| 78 | −would be almost entirely idle otherwise. | |
| 83 | + large value has the potential to drive the cpu usage to 100% on a machine | |
| 84 | + which would be almost entirely idle otherwise. | |
| @@ -8,7 +8,9 @@ Linux Virtualization Support · 7 unmodified lines | ||
| 8 | 8 | :maxdepth: 2 |
| 9 | 9 | |
| 10 | 10 | kvm/index |
| 11 | + uml/user_mode_linux | |
| 11 | 12 | paravirt_ops |
| 13 | + guest-halt-polling | |
| 12 | 14 | |
| 13 | 15 | .. only:: html and subproject |
| 14 | 16 | |
| @@ -1,8 +1,11 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=================================================================== | |
| 1 | 4 | The Definitive KVM (Kernel-based Virtual Machine) API Documentation |
| 2 | 5 | =================================================================== |
| 3 | 6 | |
| 4 | 7 | 1. General description |
| 5 | −---------------------- | |
| 8 | +====================== | |
| 6 | 9 | |
| 7 | 10 | The kvm API is a set of ioctls that are issued to control various aspects |
| 8 | 11 | of a virtual machine. The ioctls belong to the following classes: |
| @@ -33,7 +36,7 @@ of a virtual machine. The ioctls belong to the following classes: · 24 unmodified lines | ||
| 33 | 36 | was used to create the VM. |
| 34 | 37 | |
| 35 | 38 | 2. File descriptors |
| 36 | −------------------- | |
| 39 | +=================== | |
| 37 | 40 | |
| 38 | 41 | The kvm API is centered around file descriptors. An initial |
| 39 | 42 | open("/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 | |
| 72 | 75 | 3. Extensions |
| 73 | −------------- | |
| 76 | +============= | |
| 74 | 77 | |
| 75 | 78 | As of Linux 2.6.22, the KVM ABI has been stabilized: no backward |
| 76 | 79 | incompatible 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 | |
| 86 | 89 | 4. API description |
| 87 | −------------------ | |
| 90 | +================== | |
| 88 | 91 | |
| 89 | 92 | This section describes ioctls that can be used to control kvm guests. |
| 90 | 93 | For each ioctl, the following information is provided along with a |
| 91 | 94 | description: |
| 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 | 98 | which means that is will be provided by any kernel that supports |
| 95 | 99 | API version 12 (see section 4.1), a KVM_CAP_xyz constant, which |
| 96 | 100 | means availability needs to be checked with KVM_CHECK_EXTENSION |
| @@ -99,24 +103,29 @@ description: · 2 unmodified lines | ||
| 99 | 103 | availability: for kernels that don't support the ioctl, |
| 100 | 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 | 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 | 118 | are not detailed, but errors with specific meanings are. |
| 111 | 119 | |
| 112 | 120 | |
| 113 | 121 | 4.1 KVM_GET_API_VERSION |
| 122 | +----------------------- | |
| 114 | 123 | |
| 115 | −Capability: basic | |
| 116 | −Architectures: all | |
| 117 | −Type: system ioctl | |
| 118 | −Parameters: none | |
| 119 | −Returns: the constant KVM_API_VERSION (=12) | |
| 124 | +:Capability: basic | |
| 125 | +:Architectures: all | |
| 126 | +:Type: system ioctl | |
| 127 | +:Parameters: none | |
| 128 | +:Returns: the constant KVM_API_VERSION (=12) | |
| 120 | 129 | |
| 121 | 130 | This identifies the API version as the stable kvm API. It is not |
| 122 | 131 | expected that this number will change. However, Linux 2.6.20 and |
| @@ -127,12 +136,13 @@ described as 'basic' will be available. · 4 unmodified lines | ||
| 127 | 136 | |
| 128 | 137 | |
| 129 | 138 | 4.2 KVM_CREATE_VM |
| 139 | +----------------- | |
| 130 | 140 | |
| 131 | −Capability: basic | |
| 132 | −Architectures: all | |
| 133 | −Type: system ioctl | |
| 134 | −Parameters: machine type identifier (KVM_VM_*) | |
| 135 | −Returns: a VM fd that can be used to control the new virtual machine. | |
| 141 | +:Capability: basic | |
| 142 | +:Architectures: all | |
| 143 | +:Type: system ioctl | |
| 144 | +:Parameters: machine type identifier (KVM_VM_*) | |
| 145 | +:Returns: a VM fd that can be used to control the new virtual machine. | |
| 136 | 146 | |
| 137 | 147 | The new VM has no virtual cpus and no memory. |
| 138 | 148 | You probably want to use 0 as machine type. |
| @@ -155,17 +165,17 @@ identifier, where IPA_Bits is the maximum width of any physical · 16 unmodified lines | ||
| 155 | 165 | address used by the VM. The IPA_Bits is encoded in bits[7-0] of the |
| 156 | 166 | machine type identifier. |
| 157 | 167 | |
| 158 | −e.g, to configure a guest to use 48bit physical address size : | |
| 168 | +e.g, to configure a guest to use 48bit physical address size:: | |
| 159 | 169 | |
| 160 | 170 | vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48)); |
| 161 | 171 | |
| 162 | −The requested size (IPA_Bits) must be : | |
| 163 | − 0 - Implies default size, 40bits (for backward compatibility) | |
| 172 | +The requested size (IPA_Bits) must be: | |
| 164 | 173 | |
| 165 | − or | |
| 166 | − | |
| 167 | − N - Implies N bits, where N is a positive integer such that, | |
| 174 | + == ========================================================= | |
| 175 | + 0 Implies default size, 40bits (for backward compatibility) | |
| 176 | + N Implies N bits, where N is a positive integer such that, | |
| 168 | 177 | 32 <= N <= Host_IPA_Limit |
| 178 | + == ========================================================= | |
| 169 | 179 | |
| 170 | 180 | Host_IPA_Limit is the maximum possible value for IPA_Bits on the host and |
| 171 | 181 | is 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 | |
| 181 | 191 | 4.3 KVM_GET_MSR_INDEX_LIST, KVM_GET_MSR_FEATURE_INDEX_LIST |
| 192 | +---------------------------------------------------------- | |
| 193 | + | |
| 194 | +:Capability: basic, KVM_CAP_GET_MSR_FEATURES for KVM_GET_MSR_FEATURE_INDEX_LIST | |
| 195 | +:Architectures: x86 | |
| 196 | +:Type: system ioctl | |
| 197 | +:Parameters: struct kvm_msr_list (in/out) | |
| 198 | +:Returns: 0 on success; -1 on error | |
| 182 | 199 | |
| 183 | −Capability: basic, KVM_CAP_GET_MSR_FEATURES for KVM_GET_MSR_FEATURE_INDEX_LIST | |
| 184 | −Architectures: x86 | |
| 185 | −Type: system ioctl | |
| 186 | −Parameters: struct kvm_msr_list (in/out) | |
| 187 | −Returns: 0 on success; -1 on error | |
| 188 | 200 | Errors: |
| 189 | − EFAULT: the msr index list cannot be read from or written to | |
| 190 | − E2BIG: the msr index list is to be to fit in the array specified by | |
| 201 | + | |
| 202 | + ====== ============================================================ | |
| 203 | + EFAULT the msr index list cannot be read from or written to | |
| 204 | + E2BIG the msr index list is to be to fit in the array specified by | |
| 191 | 205 | the user. |
| 206 | + ====== ============================================================ | |
| 192 | 207 | |
| 193 | −struct kvm_msr_list { | |
| 208 | +:: | |
| 209 | + | |
| 210 | + struct kvm_msr_list { | |
| 194 | 211 | __u32 nmsrs; /* number of msrs in entries */ |
| 195 | 212 | __u32 indices[0]; |
| 196 | −}; | |
| 213 | + }; | |
| 197 | 214 | |
| 198 | 215 | The user fills in the size of the indices array in nmsrs, and in return |
| 199 | 216 | kvm 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 | |
| 216 | 233 | 4.4 KVM_CHECK_EXTENSION |
| 234 | +----------------------- | |
| 217 | 235 | |
| 218 | −Capability: basic, KVM_CAP_CHECK_EXTENSION_VM for vm ioctl | |
| 219 | −Architectures: all | |
| 220 | −Type: system ioctl, vm ioctl | |
| 221 | −Parameters: extension identifier (KVM_CAP_*) | |
| 222 | −Returns: 0 if unsupported; 1 (or some other positive integer) if supported | |
| 236 | +:Capability: basic, KVM_CAP_CHECK_EXTENSION_VM for vm ioctl | |
| 237 | +:Architectures: all | |
| 238 | +:Type: system ioctl, vm ioctl | |
| 239 | +:Parameters: extension identifier (KVM_CAP_*) | |
| 240 | +:Returns: 0 if unsupported; 1 (or some other positive integer) if supported | |
| 223 | 241 | |
| 224 | 242 | The API allows the application to query about extensions to the core |
| 225 | 243 | kvm API. Userspace passes an extension identifier (an integer) and |
| @@ -232,12 +250,13 @@ It is thus encouraged to use the vm ioctl to query for capabilities (available · 6 unmodified lines | ||
| 232 | 250 | with KVM_CAP_CHECK_EXTENSION_VM on the vm fd) |
| 233 | 251 | |
| 234 | 252 | 4.5 KVM_GET_VCPU_MMAP_SIZE |
| 253 | +-------------------------- | |
| 235 | 254 | |
| 236 | −Capability: basic | |
| 237 | −Architectures: all | |
| 238 | −Type: system ioctl | |
| 239 | −Parameters: none | |
| 240 | −Returns: size of vcpu mmap area, in bytes | |
| 255 | +:Capability: basic | |
| 256 | +:Architectures: all | |
| 257 | +:Type: system ioctl | |
| 258 | +:Parameters: none | |
| 259 | +:Returns: size of vcpu mmap area, in bytes | |
| 241 | 260 | |
| 242 | 261 | The KVM_RUN ioctl (cf.) communicates with userspace via a shared |
| 243 | 262 | memory 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 | |
| 247 | 266 | 4.6 KVM_SET_MEMORY_REGION |
| 267 | +------------------------- | |
| 248 | 268 | |
| 249 | −Capability: basic | |
| 250 | −Architectures: all | |
| 251 | −Type: vm ioctl | |
| 252 | −Parameters: struct kvm_memory_region (in) | |
| 253 | −Returns: 0 on success, -1 on error | |
| 269 | +:Capability: basic | |
| 270 | +:Architectures: all | |
| 271 | +:Type: vm ioctl | |
| 272 | +:Parameters: struct kvm_memory_region (in) | |
| 273 | +:Returns: 0 on success, -1 on error | |
| 254 | 274 | |
| 255 | 275 | This ioctl is obsolete and has been removed. |
| 256 | 276 | |
| 257 | 277 | |
| 258 | 278 | 4.7 KVM_CREATE_VCPU |
| 279 | +------------------- | |
| 259 | 280 | |
| 260 | −Capability: basic | |
| 261 | −Architectures: all | |
| 262 | −Type: vm ioctl | |
| 263 | −Parameters: vcpu id (apic id on x86) | |
| 264 | −Returns: vcpu fd on success, -1 on error | |
| 281 | +:Capability: basic | |
| 282 | +:Architectures: all | |
| 283 | +:Type: vm ioctl | |
| 284 | +:Parameters: vcpu id (apic id on x86) | |
| 285 | +:Returns: vcpu fd on success, -1 on error | |
| 265 | 286 | |
| 266 | 287 | This API adds a vcpu to a virtual machine. No more than max_vcpus may be added. |
| 267 | 288 | The vcpu id is an integer in the range [0, max_vcpu_id). |
| @@ -302,22 +323,25 @@ cpu's hardware control block. · 34 unmodified lines | ||
| 302 | 323 | |
| 303 | 324 | |
| 304 | 325 | 4.8 KVM_GET_DIRTY_LOG (vm ioctl) |
| 326 | +-------------------------------- | |
| 305 | 327 | |
| 306 | −Capability: basic | |
| 307 | −Architectures: all | |
| 308 | −Type: vm ioctl | |
| 309 | −Parameters: struct kvm_dirty_log (in/out) | |
| 310 | −Returns: 0 on success, -1 on error | |
| 328 | +:Capability: basic | |
| 329 | +:Architectures: all | |
| 330 | +:Type: vm ioctl | |
| 331 | +:Parameters: struct kvm_dirty_log (in/out) | |
| 332 | +:Returns: 0 on success, -1 on error | |
| 311 | 333 | |
| 312 | −/* for KVM_GET_DIRTY_LOG */ | |
| 313 | −struct kvm_dirty_log { | |
| 334 | +:: | |
| 335 | + | |
| 336 | + /* for KVM_GET_DIRTY_LOG */ | |
| 337 | + struct kvm_dirty_log { | |
| 314 | 338 | __u32 slot; |
| 315 | 339 | __u32 padding; |
| 316 | 340 | union { |
| 317 | 341 | void __user *dirty_bitmap; /* one bit per page */ |
| 318 | 342 | __u64 padding; |
| 319 | 343 | }; |
| 320 | −}; | |
| 344 | + }; | |
| 321 | 345 | |
| 322 | 346 | Given a memory slot, return a bitmap containing any pages dirtied |
| 323 | 347 | since the last call to this ioctl. Bit 0 is the first page in the |
| @@ -334,25 +358,31 @@ KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is enabled. For more information, · 10 unmodified lines | ||
| 334 | 358 | see the description of the capability. |
| 335 | 359 | |
| 336 | 360 | 4.9 KVM_SET_MEMORY_ALIAS |
| 361 | +------------------------ | |
| 337 | 362 | |
| 338 | −Capability: basic | |
| 339 | −Architectures: x86 | |
| 340 | −Type: vm ioctl | |
| 341 | −Parameters: struct kvm_memory_alias (in) | |
| 342 | −Returns: 0 (success), -1 (error) | |
| 363 | +:Capability: basic | |
| 364 | +:Architectures: x86 | |
| 365 | +:Type: vm ioctl | |
| 366 | +:Parameters: struct kvm_memory_alias (in) | |
| 367 | +:Returns: 0 (success), -1 (error) | |
| 343 | 368 | |
| 344 | 369 | This ioctl is obsolete and has been removed. |
| 345 | 370 | |
| 346 | 371 | |
| 347 | 372 | 4.10 KVM_RUN |
| 373 | +------------ | |
| 374 | + | |
| 375 | +:Capability: basic | |
| 376 | +:Architectures: all | |
| 377 | +:Type: vcpu ioctl | |
| 378 | +:Parameters: none | |
| 379 | +:Returns: 0 on success, -1 on error | |
| 348 | 380 | |
| 349 | −Capability: basic | |
| 350 | −Architectures: all | |
| 351 | −Type: vcpu ioctl | |
| 352 | −Parameters: none | |
| 353 | −Returns: 0 on success, -1 on error | |
| 354 | 381 | Errors: |
| 355 | − EINTR: an unmasked signal is pending | |
| 382 | + | |
| 383 | + ===== ============================= | |
| 384 | + EINTR an unmasked signal is pending | |
| 385 | + ===== ============================= | |
| 356 | 386 | |
| 357 | 387 | This ioctl is used to run a guest virtual cpu. While there are no |
| 358 | 388 | explicit 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 | |
| 364 | 394 | 4.11 KVM_GET_REGS |
| 395 | +----------------- | |
| 365 | 396 | |
| 366 | −Capability: basic | |
| 367 | −Architectures: all except ARM, arm64 | |
| 368 | −Type: vcpu ioctl | |
| 369 | −Parameters: struct kvm_regs (out) | |
| 370 | −Returns: 0 on success, -1 on error | |
| 397 | +:Capability: basic | |
| 398 | +:Architectures: all except ARM, arm64 | |
| 399 | +:Type: vcpu ioctl | |
| 400 | +:Parameters: struct kvm_regs (out) | |
| 401 | +:Returns: 0 on success, -1 on error | |
| 371 | 402 | |
| 372 | 403 | Reads the general purpose registers from the vcpu. |
| 373 | 404 | |
| 374 | −/* x86 */ | |
| 375 | −struct kvm_regs { | |
| 405 | +:: | |
| 406 | + | |
| 407 | + /* x86 */ | |
| 408 | + struct kvm_regs { | |
| 376 | 409 | /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ |
| 377 | 410 | __u64 rax, rbx, rcx, rdx; |
| 378 | 411 | __u64 rsi, rdi, rsp, rbp; |
| 379 | 412 | __u64 r8, r9, r10, r11; |
| 380 | 413 | __u64 r12, r13, r14, r15; |
| 381 | 414 | __u64 rip, rflags; |
| 382 | −}; | |
| 415 | + }; | |
| 383 | 416 | |
| 384 | −/* mips */ | |
| 385 | −struct kvm_regs { | |
| 417 | + /* mips */ | |
| 418 | + struct kvm_regs { | |
| 386 | 419 | /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ |
| 387 | 420 | __u64 gpr[32]; |
| 388 | 421 | __u64 hi; |
| 389 | 422 | __u64 lo; |
| 390 | 423 | __u64 pc; |
| 391 | −}; | |
| 424 | + }; | |
| 392 | 425 | |
| 393 | 426 | |
| 394 | 427 | 4.12 KVM_SET_REGS |
| 428 | +----------------- | |
| 395 | 429 | |
| 396 | −Capability: basic | |
| 397 | −Architectures: all except ARM, arm64 | |
| 398 | −Type: vcpu ioctl | |
| 399 | −Parameters: struct kvm_regs (in) | |
| 400 | −Returns: 0 on success, -1 on error | |
| 430 | +:Capability: basic | |
| 431 | +:Architectures: all except ARM, arm64 | |
| 432 | +:Type: vcpu ioctl | |
| 433 | +:Parameters: struct kvm_regs (in) | |
| 434 | +:Returns: 0 on success, -1 on error | |
| 401 | 435 | |
| 402 | 436 | Writes 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 | |
| 407 | 441 | 4.13 KVM_GET_SREGS |
| 442 | +------------------ | |
| 408 | 443 | |
| 409 | −Capability: basic | |
| 410 | −Architectures: x86, ppc | |
| 411 | −Type: vcpu ioctl | |
| 412 | −Parameters: struct kvm_sregs (out) | |
| 413 | −Returns: 0 on success, -1 on error | |
| 444 | +:Capability: basic | |
| 445 | +:Architectures: x86, ppc | |
| 446 | +:Type: vcpu ioctl | |
| 447 | +:Parameters: struct kvm_sregs (out) | |
| 448 | +:Returns: 0 on success, -1 on error | |
| 414 | 449 | |
| 415 | 450 | Reads special registers from the vcpu. |
| 416 | 451 | |
| 417 | −/* x86 */ | |
| 418 | −struct kvm_sregs { | |
| 452 | +:: | |
| 453 | + | |
| 454 | + /* x86 */ | |
| 455 | + struct kvm_sregs { | |
| 419 | 456 | struct kvm_segment cs, ds, es, fs, gs, ss; |
| 420 | 457 | struct kvm_segment tr, ldt; |
| 421 | 458 | struct kvm_dtable gdt, idt; |
| @@ -423,9 +460,9 @@ struct kvm_sregs { · 1 unmodified line | ||
| 423 | 460 | __u64 efer; |
| 424 | 461 | __u64 apic_base; |
| 425 | 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 | |
| 430 | 467 | interrupt_bitmap is a bitmap of pending external interrupts. At most |
| 431 | 468 | one bit may be set. This interrupt has been acknowledged by the APIC |
| @@ -433,29 +470,33 @@ but not yet injected into the cpu core. · 1 unmodified line | ||
| 433 | 470 | |
| 434 | 471 | |
| 435 | 472 | 4.14 KVM_SET_SREGS |
| 473 | +------------------ | |
| 436 | 474 | |
| 437 | −Capability: basic | |
| 438 | −Architectures: x86, ppc | |
| 439 | −Type: vcpu ioctl | |
| 440 | −Parameters: struct kvm_sregs (in) | |
| 441 | −Returns: 0 on success, -1 on error | |
| 475 | +:Capability: basic | |
| 476 | +:Architectures: x86, ppc | |
| 477 | +:Type: vcpu ioctl | |
| 478 | +:Parameters: struct kvm_sregs (in) | |
| 479 | +:Returns: 0 on success, -1 on error | |
| 442 | 480 | |
| 443 | 481 | Writes special registers into the vcpu. See KVM_GET_SREGS for the |
| 444 | 482 | data structures. |
| 445 | 483 | |
| 446 | 484 | |
| 447 | 485 | 4.15 KVM_TRANSLATE |
| 486 | +------------------ | |
| 448 | 487 | |
| 449 | −Capability: basic | |
| 450 | −Architectures: x86 | |
| 451 | −Type: vcpu ioctl | |
| 452 | −Parameters: struct kvm_translation (in/out) | |
| 453 | −Returns: 0 on success, -1 on error | |
| 488 | +:Capability: basic | |
| 489 | +:Architectures: x86 | |
| 490 | +:Type: vcpu ioctl | |
| 491 | +:Parameters: struct kvm_translation (in/out) | |
| 492 | +:Returns: 0 on success, -1 on error | |
| 454 | 493 | |
| 455 | 494 | Translates a virtual address according to the vcpu's current address |
| 456 | 495 | translation mode. |
| 457 | 496 | |
| 458 | −struct kvm_translation { | |
| 497 | +:: | |
| 498 | + | |
| 499 | + struct kvm_translation { | |
| 459 | 500 | /* in */ |
| 460 | 501 | __u64 linear_address; |
| 461 | 502 | |
| @@ -465,59 +506,68 @@ struct kvm_translation { · 3 unmodified lines | ||
| 465 | 506 | __u8 writeable; |
| 466 | 507 | __u8 usermode; |
| 467 | 508 | __u8 pad[5]; |
| 468 | −}; | |
| 509 | + }; | |
| 469 | 510 | |
| 470 | 511 | |
| 471 | 512 | 4.16 KVM_INTERRUPT |
| 513 | +------------------ | |
| 472 | 514 | |
| 473 | −Capability: basic | |
| 474 | −Architectures: x86, ppc, mips | |
| 475 | −Type: vcpu ioctl | |
| 476 | −Parameters: struct kvm_interrupt (in) | |
| 477 | −Returns: 0 on success, negative on failure. | |
| 515 | +:Capability: basic | |
| 516 | +:Architectures: x86, ppc, mips | |
| 517 | +:Type: vcpu ioctl | |
| 518 | +:Parameters: struct kvm_interrupt (in) | |
| 519 | +:Returns: 0 on success, negative on failure. | |
| 478 | 520 | |
| 479 | 521 | Queues a hardware interrupt vector to be injected. |
| 480 | 522 | |
| 481 | −/* for KVM_INTERRUPT */ | |
| 482 | −struct kvm_interrupt { | |
| 523 | +:: | |
| 524 | + | |
| 525 | + /* for KVM_INTERRUPT */ | |
| 526 | + struct kvm_interrupt { | |
| 483 | 527 | /* in */ |
| 484 | 528 | __u32 irq; |
| 485 | −}; | |
| 529 | + }; | |
| 486 | 530 | |
| 487 | 531 | X86: |
| 532 | +^^^^ | |
| 533 | + | |
| 534 | +:Returns: | |
| 488 | 535 | |
| 489 | −Returns: 0 on success, | |
| 490 | − -EEXIST if an interrupt is already enqueued | |
| 491 | − -EINVAL the the irq number is invalid | |
| 492 | − -ENXIO if the PIC is in the kernel | |
| 493 | − -EFAULT if the pointer is invalid | |
| 536 | + ========= =================================== | |
| 537 | + 0 on success, | |
| 538 | + -EEXIST if an interrupt is already enqueued | |
| 539 | + -EINVAL the the irq number is invalid | |
| 540 | + -ENXIO if the PIC is in the kernel | |
| 541 | + -EFAULT if the pointer is invalid | |
| 542 | + ========= =================================== | |
| 494 | 543 | |
| 495 | 544 | Note 'irq' is an interrupt vector, not an interrupt pin or line. This |
| 496 | 545 | ioctl is useful if the in-kernel PIC is not used. |
| 497 | 546 | |
| 498 | 547 | PPC: |
| 548 | +^^^^ | |
| 499 | 549 | |
| 500 | 550 | Queues an external interrupt to be injected. This ioctl is overleaded |
| 501 | 551 | with 3 different irq values: |
| 502 | 552 | |
| 503 | 553 | a) KVM_INTERRUPT_SET |
| 504 | 554 | |
| 505 | − This injects an edge type external interrupt into the guest once it's ready | |
| 506 | − to receive interrupts. When injected, the interrupt is done. | |
| 555 | + This injects an edge type external interrupt into the guest once it's ready | |
| 556 | + to receive interrupts. When injected, the interrupt is done. | |
| 507 | 557 | |
| 508 | 558 | b) 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 | |
| 514 | 564 | c) KVM_INTERRUPT_SET_LEVEL |
| 515 | 565 | |
| 516 | − This injects a level type external interrupt into the guest context. The | |
| 517 | − interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET | |
| 518 | − is triggered. | |
| 566 | + This injects a level type external interrupt into the guest context. The | |
| 567 | + interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET | |
| 568 | + is triggered. | |
| 519 | 569 | |
| 520 | − Only available with KVM_CAP_PPC_IRQ_LEVEL. | |
| 570 | + Only available with KVM_CAP_PPC_IRQ_LEVEL. | |
| 521 | 571 | |
| 522 | 572 | Note that any value for 'irq' other than the ones stated above is invalid |
| 523 | 573 | and incurs unexpected behavior. |
| @@ -525,6 +575,7 @@ and incurs unexpected behavior. · 1 unmodified line | ||
| 525 | 575 | This is an asynchronous vcpu ioctl and can be invoked from any thread. |
| 526 | 576 | |
| 527 | 577 | MIPS: |
| 578 | +^^^^^ | |
| 528 | 579 | |
| 529 | 580 | Queues an external interrupt to be injected into the virtual CPU. A negative |
| 530 | 581 | interrupt number dequeues the interrupt. |
| @@ -533,24 +584,26 @@ This is an asynchronous vcpu ioctl and can be invoked from any thread. · 2 unmodified lines | ||
| 533 | 584 | |
| 534 | 585 | |
| 535 | 586 | 4.17 KVM_DEBUG_GUEST |
| 587 | +-------------------- | |
| 536 | 588 | |
| 537 | −Capability: basic | |
| 538 | −Architectures: none | |
| 539 | −Type: vcpu ioctl | |
| 540 | −Parameters: none) | |
| 541 | −Returns: -1 on error | |
| 589 | +:Capability: basic | |
| 590 | +:Architectures: none | |
| 591 | +:Type: vcpu ioctl | |
| 592 | +:Parameters: none) | |
| 593 | +:Returns: -1 on error | |
| 542 | 594 | |
| 543 | 595 | Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead. |
| 544 | 596 | |
| 545 | 597 | |
| 546 | 598 | 4.18 KVM_GET_MSRS |
| 599 | +----------------- | |
| 547 | 600 | |
| 548 | −Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system) | |
| 549 | −Architectures: x86 | |
| 550 | −Type: system ioctl, vcpu ioctl | |
| 551 | −Parameters: struct kvm_msrs (in/out) | |
| 552 | −Returns: number of msrs successfully returned; | |
| 553 | − -1 on error | |
| 601 | +:Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system) | |
| 602 | +:Architectures: x86 | |
| 603 | +:Type: system ioctl, vcpu ioctl | |
| 604 | +:Parameters: struct kvm_msrs (in/out) | |
| 605 | +:Returns: number of msrs successfully returned; | |
| 606 | + -1 on error | |
| 554 | 607 | |
| 555 | 608 | When used as a system ioctl: |
| 556 | 609 | Reads the values of MSR-based features that are available for the VM. This |
| @@ -562,18 +615,20 @@ When used as a vcpu ioctl: · 5 unmodified lines | ||
| 562 | 615 | Reads model-specific registers from the vcpu. Supported msr indices can |
| 563 | 616 | be obtained using KVM_GET_MSR_INDEX_LIST in a system ioctl. |
| 564 | 617 | |
| 565 | −struct kvm_msrs { | |
| 618 | +:: | |
| 619 | + | |
| 620 | + struct kvm_msrs { | |
| 566 | 621 | __u32 nmsrs; /* number of msrs in entries */ |
| 567 | 622 | __u32 pad; |
| 568 | 623 | |
| 569 | 624 | struct kvm_msr_entry entries[0]; |
| 570 | −}; | |
| 625 | + }; | |
| 571 | 626 | |
| 572 | −struct kvm_msr_entry { | |
| 627 | + struct kvm_msr_entry { | |
| 573 | 628 | __u32 index; |
| 574 | 629 | __u32 reserved; |
| 575 | 630 | __u64 data; |
| 576 | −}; | |
| 631 | + }; | |
| 577 | 632 | |
| 578 | 633 | Application code should set the 'nmsrs' member (which indicates the |
| 579 | 634 | size of the entries array) and the 'index' member of each array entry. |
| @@ -581,12 +636,13 @@ kvm will fill in the 'data' member. · 1 unmodified line | ||
| 581 | 636 | |
| 582 | 637 | |
| 583 | 638 | 4.19 KVM_SET_MSRS |
| 639 | +----------------- | |
| 584 | 640 | |
| 585 | −Capability: basic | |
| 586 | −Architectures: x86 | |
| 587 | −Type: vcpu ioctl | |
| 588 | −Parameters: struct kvm_msrs (in) | |
| 589 | −Returns: number of msrs successfully set (see below), -1 on error | |
| 641 | +:Capability: basic | |
| 642 | +:Architectures: x86 | |
| 643 | +:Type: vcpu ioctl | |
| 644 | +:Parameters: struct kvm_msrs (in) | |
| 645 | +:Returns: number of msrs successfully set (see below), -1 on error | |
| 590 | 646 | |
| 591 | 647 | Writes model-specific registers to the vcpu. See KVM_GET_MSRS for the |
| 592 | 648 | data structures. |
| @@ -602,41 +658,44 @@ MSRs that have been set successfully. · 9 unmodified lines | ||
| 602 | 658 | |
| 603 | 659 | |
| 604 | 660 | 4.20 KVM_SET_CPUID |
| 661 | +------------------ | |
| 605 | 662 | |
| 606 | −Capability: basic | |
| 607 | −Architectures: x86 | |
| 608 | −Type: vcpu ioctl | |
| 609 | −Parameters: struct kvm_cpuid (in) | |
| 610 | −Returns: 0 on success, -1 on error | |
| 663 | +:Capability: basic | |
| 664 | +:Architectures: x86 | |
| 665 | +:Type: vcpu ioctl | |
| 666 | +:Parameters: struct kvm_cpuid (in) | |
| 667 | +:Returns: 0 on success, -1 on error | |
| 611 | 668 | |
| 612 | 669 | Defines the vcpu responses to the cpuid instruction. Applications |
| 613 | 670 | should use the KVM_SET_CPUID2 ioctl if available. |
| 614 | 671 | |
| 672 | +:: | |
| 615 | 673 | |
| 616 | −struct kvm_cpuid_entry { | |
| 674 | + struct kvm_cpuid_entry { | |
| 617 | 675 | __u32 function; |
| 618 | 676 | __u32 eax; |
| 619 | 677 | __u32 ebx; |
| 620 | 678 | __u32 ecx; |
| 621 | 679 | __u32 edx; |
| 622 | 680 | __u32 padding; |
| 623 | −}; | |
| 681 | + }; | |
| 624 | 682 | |
| 625 | −/* for KVM_SET_CPUID */ | |
| 626 | −struct kvm_cpuid { | |
| 683 | + /* for KVM_SET_CPUID */ | |
| 684 | + struct kvm_cpuid { | |
| 627 | 685 | __u32 nent; |
| 628 | 686 | __u32 padding; |
| 629 | 687 | struct kvm_cpuid_entry entries[0]; |
| 630 | −}; | |
| 688 | + }; | |
| 631 | 689 | |
| 632 | 690 | |
| 633 | 691 | 4.21 KVM_SET_SIGNAL_MASK |
| 692 | +------------------------ | |
| 634 | 693 | |
| 635 | −Capability: basic | |
| 636 | −Architectures: all | |
| 637 | −Type: vcpu ioctl | |
| 638 | −Parameters: struct kvm_signal_mask (in) | |
| 639 | −Returns: 0 on success, -1 on error | |
| 694 | +:Capability: basic | |
| 695 | +:Architectures: all | |
| 696 | +:Type: vcpu ioctl | |
| 697 | +:Parameters: struct kvm_signal_mask (in) | |
| 698 | +:Returns: 0 on success, -1 on error | |
| 640 | 699 | |
| 641 | 700 | Defines which signals are blocked during execution of KVM_RUN. This |
| 642 | 701 | signal mask temporarily overrides the threads signal mask. Any |
| @@ -646,25 +705,30 @@ their traditional behaviour) will cause KVM_RUN to return with -EINTR. · 3 unmodified lines | ||
| 646 | 705 | Note the signal will only be delivered if not blocked by the original |
| 647 | 706 | signal mask. |
| 648 | 707 | |
| 649 | −/* for KVM_SET_SIGNAL_MASK */ | |
| 650 | −struct kvm_signal_mask { | |
| 708 | +:: | |
| 709 | + | |
| 710 | + /* for KVM_SET_SIGNAL_MASK */ | |
| 711 | + struct kvm_signal_mask { | |
| 651 | 712 | __u32 len; |
| 652 | 713 | __u8 sigset[0]; |
| 653 | −}; | |
| 714 | + }; | |
| 654 | 715 | |
| 655 | 716 | |
| 656 | 717 | 4.22 KVM_GET_FPU |
| 718 | +---------------- | |
| 657 | 719 | |
| 658 | −Capability: basic | |
| 659 | −Architectures: x86 | |
| 660 | −Type: vcpu ioctl | |
| 661 | −Parameters: struct kvm_fpu (out) | |
| 662 | −Returns: 0 on success, -1 on error | |
| 720 | +:Capability: basic | |
| 721 | +:Architectures: x86 | |
| 722 | +:Type: vcpu ioctl | |
| 723 | +:Parameters: struct kvm_fpu (out) | |
| 724 | +:Returns: 0 on success, -1 on error | |
| 663 | 725 | |
| 664 | 726 | Reads the floating point state from the vcpu. |
| 665 | 727 | |
| 666 | −/* for KVM_GET_FPU and KVM_SET_FPU */ | |
| 667 | −struct kvm_fpu { | |
| 728 | +:: | |
| 729 | + | |
| 730 | + /* for KVM_GET_FPU and KVM_SET_FPU */ | |
| 731 | + struct kvm_fpu { | |
| 668 | 732 | __u8 fpr[8][16]; |
| 669 | 733 | __u16 fcw; |
| 670 | 734 | __u16 fsw; |
| @@ -676,21 +740,24 @@ struct kvm_fpu { · 5 unmodified lines | ||
| 676 | 740 | __u8 xmm[16][16]; |
| 677 | 741 | __u32 mxcsr; |
| 678 | 742 | __u32 pad2; |
| 679 | −}; | |
| 743 | + }; | |
| 680 | 744 | |
| 681 | 745 | |
| 682 | 746 | 4.23 KVM_SET_FPU |
| 747 | +---------------- | |
| 683 | 748 | |
| 684 | −Capability: basic | |
| 685 | −Architectures: x86 | |
| 686 | −Type: vcpu ioctl | |
| 687 | −Parameters: struct kvm_fpu (in) | |
| 688 | −Returns: 0 on success, -1 on error | |
| 749 | +:Capability: basic | |
| 750 | +:Architectures: x86 | |
| 751 | +:Type: vcpu ioctl | |
| 752 | +:Parameters: struct kvm_fpu (in) | |
| 753 | +:Returns: 0 on success, -1 on error | |
| 689 | 754 | |
| 690 | 755 | Writes the floating point state to the vcpu. |
| 691 | 756 | |
| 692 | −/* for KVM_GET_FPU and KVM_SET_FPU */ | |
| 693 | −struct kvm_fpu { | |
| 757 | +:: | |
| 758 | + | |
| 759 | + /* for KVM_GET_FPU and KVM_SET_FPU */ | |
| 760 | + struct kvm_fpu { | |
| 694 | 761 | __u8 fpr[8][16]; |
| 695 | 762 | __u16 fcw; |
| 696 | 763 | __u16 fsw; |
| @@ -702,16 +769,17 @@ struct kvm_fpu { · 5 unmodified lines | ||
| 702 | 769 | __u8 xmm[16][16]; |
| 703 | 770 | __u32 mxcsr; |
| 704 | 771 | __u32 pad2; |
| 705 | −}; | |
| 772 | + }; | |
| 706 | 773 | |
| 707 | 774 | |
| 708 | 775 | 4.24 KVM_CREATE_IRQCHIP |
| 776 | +----------------------- | |
| 709 | 777 | |
| 710 | −Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390) | |
| 711 | −Architectures: x86, ARM, arm64, s390 | |
| 712 | −Type: vm ioctl | |
| 713 | −Parameters: none | |
| 714 | −Returns: 0 on success, -1 on error | |
| 778 | +:Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390) | |
| 779 | +:Architectures: x86, ARM, arm64, s390 | |
| 780 | +:Type: vm ioctl | |
| 781 | +:Parameters: none | |
| 782 | +:Returns: 0 on success, -1 on error | |
| 715 | 783 | |
| 716 | 784 | Creates an interrupt controller model in the kernel. |
| 717 | 785 | On x86, creates a virtual ioapic, a virtual PIC (two PICs, nested), and sets up |
| @@ -727,12 +795,13 @@ before KVM_CREATE_IRQCHIP can be used. · 9 unmodified lines | ||
| 727 | 795 | |
| 728 | 796 | |
| 729 | 797 | 4.25 KVM_IRQ_LINE |
| 798 | +----------------- | |
| 730 | 799 | |
| 731 | −Capability: KVM_CAP_IRQCHIP | |
| 732 | −Architectures: x86, arm, arm64 | |
| 733 | −Type: vm ioctl | |
| 734 | −Parameters: struct kvm_irq_level | |
| 735 | −Returns: 0 on success, -1 on error | |
| 800 | +:Capability: KVM_CAP_IRQCHIP | |
| 801 | +:Architectures: x86, arm, arm64 | |
| 802 | +:Type: vm ioctl | |
| 803 | +:Parameters: struct kvm_irq_level | |
| 804 | +:Returns: 0 on success, -1 on error | |
| 736 | 805 | |
| 737 | 806 | Sets the level of a GSI input to the interrupt controller model in the kernel. |
| 738 | 807 | On some architectures it is required that an interrupt controller model has |
| @@ -756,16 +825,20 @@ of course). · 17 unmodified lines | ||
| 756 | 825 | ARM/arm64 can signal an interrupt either at the CPU level, or at the |
| 757 | 826 | in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to |
| 758 | 827 | use PPIs designated for specific cpus. The irq field is interpreted |
| 759 | −like this: | |
| 828 | +like this:: | |
| 760 | 829 | |
| 761 | 830 | bits: | 31 ... 28 | 27 ... 24 | 23 ... 16 | 15 ... 0 | |
| 762 | 831 | field: | vcpu2_index | irq_type | vcpu_index | irq_id | |
| 763 | 832 | |
| 764 | 833 | The irq_type field has the following values: |
| 765 | −- irq_type[0]: out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ | |
| 766 | −- irq_type[1]: in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.) | |
| 834 | + | |
| 835 | +- irq_type[0]: | |
| 836 | + out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ | |
| 837 | +- irq_type[1]: | |
| 838 | + in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.) | |
| 767 | 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 | 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 | ||
| 779 | 852 | injection of interrupts for the in-kernel irqchip. KVM_IRQ_LINE can always |
| 780 | 853 | be used for a userspace interrupt controller. |
| 781 | 854 | |
| 782 | −struct kvm_irq_level { | |
| 855 | +:: | |
| 856 | + | |
| 857 | + struct kvm_irq_level { | |
| 783 | 858 | union { |
| 784 | 859 | __u32 irq; /* GSI */ |
| 785 | 860 | __s32 status; /* not used for KVM_IRQ_LEVEL */ |
| 786 | 861 | }; |
| 787 | 862 | __u32 level; /* 0 or 1 */ |
| 788 | −}; | |
| 863 | + }; | |
| 789 | 864 | |
| 790 | 865 | |
| 791 | 866 | 4.26 KVM_GET_IRQCHIP |
| 867 | +-------------------- | |
| 792 | 868 | |
| 793 | −Capability: KVM_CAP_IRQCHIP | |
| 794 | −Architectures: x86 | |
| 795 | −Type: vm ioctl | |
| 796 | −Parameters: struct kvm_irqchip (in/out) | |
| 797 | −Returns: 0 on success, -1 on error | |
| 869 | +:Capability: KVM_CAP_IRQCHIP | |
| 870 | +:Architectures: x86 | |
| 871 | +:Type: vm ioctl | |
| 872 | +:Parameters: struct kvm_irqchip (in/out) | |
| 873 | +:Returns: 0 on success, -1 on error | |
| 798 | 874 | |
| 799 | 875 | Reads the state of a kernel interrupt controller created with |
| 800 | 876 | KVM_CREATE_IRQCHIP into a buffer provided by the caller. |
| 801 | 877 | |
| 802 | −struct kvm_irqchip { | |
| 878 | +:: | |
| 879 | + | |
| 880 | + struct kvm_irqchip { | |
| 803 | 881 | __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */ |
| 804 | 882 | __u32 pad; |
| 805 | 883 | union { |
| @@ -807,21 +885,24 @@ struct kvm_irqchip { · 1 unmodified line | ||
| 807 | 885 | struct kvm_pic_state pic; |
| 808 | 886 | struct kvm_ioapic_state ioapic; |
| 809 | 887 | } chip; |
| 810 | −}; | |
| 888 | + }; | |
| 811 | 889 | |
| 812 | 890 | |
| 813 | 891 | 4.27 KVM_SET_IRQCHIP |
| 892 | +-------------------- | |
| 814 | 893 | |
| 815 | −Capability: KVM_CAP_IRQCHIP | |
| 816 | −Architectures: x86 | |
| 817 | −Type: vm ioctl | |
| 818 | −Parameters: struct kvm_irqchip (in) | |
| 819 | −Returns: 0 on success, -1 on error | |
| 894 | +:Capability: KVM_CAP_IRQCHIP | |
| 895 | +:Architectures: x86 | |
| 896 | +:Type: vm ioctl | |
| 897 | +:Parameters: struct kvm_irqchip (in) | |
| 898 | +:Returns: 0 on success, -1 on error | |
| 820 | 899 | |
| 821 | 900 | Sets the state of a kernel interrupt controller created with |
| 822 | 901 | KVM_CREATE_IRQCHIP from a buffer provided by the caller. |
| 823 | 902 | |
| 824 | −struct kvm_irqchip { | |
| 903 | +:: | |
| 904 | + | |
| 905 | + struct kvm_irqchip { | |
| 825 | 906 | __u32 chip_id; /* 0 = PIC1, 1 = PIC2, 2 = IOAPIC */ |
| 826 | 907 | __u32 pad; |
| 827 | 908 | union { |
| @@ -829,16 +910,17 @@ struct kvm_irqchip { · 1 unmodified line | ||
| 829 | 910 | struct kvm_pic_state pic; |
| 830 | 911 | struct kvm_ioapic_state ioapic; |
| 831 | 912 | } chip; |
| 832 | −}; | |
| 913 | + }; | |
| 833 | 914 | |
| 834 | 915 | |
| 835 | 916 | 4.28 KVM_XEN_HVM_CONFIG |
| 917 | +----------------------- | |
| 836 | 918 | |
| 837 | −Capability: KVM_CAP_XEN_HVM | |
| 838 | −Architectures: x86 | |
| 839 | −Type: vm ioctl | |
| 840 | −Parameters: struct kvm_xen_hvm_config (in) | |
| 841 | −Returns: 0 on success, -1 on error | |
| 919 | +:Capability: KVM_CAP_XEN_HVM | |
| 920 | +:Architectures: x86 | |
| 921 | +:Type: vm ioctl | |
| 922 | +:Parameters: struct kvm_xen_hvm_config (in) | |
| 923 | +:Returns: 0 on success, -1 on error | |
| 842 | 924 | |
| 843 | 925 | Sets the MSR that the Xen HVM guest uses to initialize its hypercall |
| 844 | 926 | page, and provides the starting address and size of the hypercall |
| @@ -846,7 +928,9 @@ blobs in userspace. When the guest writes the MSR, kvm copies one · 1 unmodified line | ||
| 846 | 928 | page of a blob (32- or 64-bit, depending on the vcpu mode) to guest |
| 847 | 929 | memory. |
| 848 | 930 | |
| 849 | −struct kvm_xen_hvm_config { | |
| 931 | +:: | |
| 932 | + | |
| 933 | + struct kvm_xen_hvm_config { | |
| 850 | 934 | __u32 flags; |
| 851 | 935 | __u32 msr; |
| 852 | 936 | __u64 blob_addr_32; |
| @@ -854,16 +938,17 @@ struct kvm_xen_hvm_config { · 1 unmodified line | ||
| 854 | 938 | __u8 blob_size_32; |
| 855 | 939 | __u8 blob_size_64; |
| 856 | 940 | __u8 pad2[30]; |
| 857 | −}; | |
| 941 | + }; | |
| 858 | 942 | |
| 859 | 943 | |
| 860 | 944 | 4.29 KVM_GET_CLOCK |
| 945 | +------------------ | |
| 861 | 946 | |
| 862 | −Capability: KVM_CAP_ADJUST_CLOCK | |
| 863 | −Architectures: x86 | |
| 864 | −Type: vm ioctl | |
| 865 | −Parameters: struct kvm_clock_data (out) | |
| 866 | −Returns: 0 on success, -1 on error | |
| 947 | +:Capability: KVM_CAP_ADJUST_CLOCK | |
| 948 | +:Architectures: x86 | |
| 949 | +:Type: vm ioctl | |
| 950 | +:Parameters: struct kvm_clock_data (out) | |
| 951 | +:Returns: 0 on success, -1 on error | |
| 867 | 952 | |
| 868 | 953 | Gets the current timestamp of kvmclock as seen by the current guest. In |
| 869 | 954 | conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios |
| @@ -880,47 +965,56 @@ with KVM_SET_CLOCK. KVM will try to make all VCPUs follow this clock, · 10 unmodified lines | ||
| 880 | 965 | but the exact value read by each VCPU could differ, because the host |
| 881 | 966 | TSC is not stable. |
| 882 | 967 | |
| 883 | −struct kvm_clock_data { | |
| 968 | +:: | |
| 969 | + | |
| 970 | + struct kvm_clock_data { | |
| 884 | 971 | __u64 clock; /* kvmclock current value */ |
| 885 | 972 | __u32 flags; |
| 886 | 973 | __u32 pad[9]; |
| 887 | −}; | |
| 974 | + }; | |
| 888 | 975 | |
| 889 | 976 | |
| 890 | 977 | 4.30 KVM_SET_CLOCK |
| 978 | +------------------ | |
| 891 | 979 | |
| 892 | −Capability: KVM_CAP_ADJUST_CLOCK | |
| 893 | −Architectures: x86 | |
| 894 | −Type: vm ioctl | |
| 895 | −Parameters: struct kvm_clock_data (in) | |
| 896 | −Returns: 0 on success, -1 on error | |
| 980 | +:Capability: KVM_CAP_ADJUST_CLOCK | |
| 981 | +:Architectures: x86 | |
| 982 | +:Type: vm ioctl | |
| 983 | +:Parameters: struct kvm_clock_data (in) | |
| 984 | +:Returns: 0 on success, -1 on error | |
| 897 | 985 | |
| 898 | 986 | Sets the current timestamp of kvmclock to the value specified in its parameter. |
| 899 | 987 | In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios |
| 900 | 988 | such as migration. |
| 901 | 989 | |
| 902 | −struct kvm_clock_data { | |
| 990 | +:: | |
| 991 | + | |
| 992 | + struct kvm_clock_data { | |
| 903 | 993 | __u64 clock; /* kvmclock current value */ |
| 904 | 994 | __u32 flags; |
| 905 | 995 | __u32 pad[9]; |
| 906 | −}; | |
| 996 | + }; | |
| 907 | 997 | |
| 908 | 998 | |
| 909 | 999 | 4.31 KVM_GET_VCPU_EVENTS |
| 1000 | +------------------------ | |
| 910 | 1001 | |
| 911 | −Capability: KVM_CAP_VCPU_EVENTS | |
| 912 | −Extended by: KVM_CAP_INTR_SHADOW | |
| 913 | −Architectures: x86, arm, arm64 | |
| 914 | −Type: vcpu ioctl | |
| 915 | −Parameters: struct kvm_vcpu_event (out) | |
| 916 | −Returns: 0 on success, -1 on error | |
| 1002 | +:Capability: KVM_CAP_VCPU_EVENTS | |
| 1003 | +:Extended by: KVM_CAP_INTR_SHADOW | |
| 1004 | +:Architectures: x86, arm, arm64 | |
| 1005 | +:Type: vcpu ioctl | |
| 1006 | +:Parameters: struct kvm_vcpu_event (out) | |
| 1007 | +:Returns: 0 on success, -1 on error | |
| 917 | 1008 | |
| 918 | 1009 | X86: |
| 1010 | +^^^^ | |
| 919 | 1011 | |
| 920 | 1012 | Gets currently pending exceptions, interrupts, and NMIs as well as related |
| 921 | 1013 | states of the vcpu. |
| 922 | 1014 | |
| 923 | −struct kvm_vcpu_events { | |
| 1015 | +:: | |
| 1016 | + | |
| 1017 | + struct kvm_vcpu_events { | |
| 924 | 1018 | struct { |
| 925 | 1019 | __u8 injected; |
| 926 | 1020 | __u8 nr; |
| @@ -951,7 +1045,7 @@ struct kvm_vcpu_events { · 24 unmodified lines | ||
| 951 | 1045 | __u8 reserved[27]; |
| 952 | 1046 | __u8 exception_has_payload; |
| 953 | 1047 | __u64 exception_payload; |
| 954 | −}; | |
| 1048 | + }; | |
| 955 | 1049 | |
| 956 | 1050 | The 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 | 1061 | KVM_CAP_EXCEPTION_PAYLOAD is enabled. |
| 968 | 1062 | |
| 969 | 1063 | ARM/ARM64: |
| 1064 | +^^^^^^^^^^ | |
| 970 | 1065 | |
| 971 | 1066 | If the guest accesses a device that is being emulated by the host kernel in |
| 972 | 1067 | such a way that a real device would generate a physical SError, KVM may make |
| @@ -1006,8 +1101,9 @@ It is not possible to read back a pending external abort (injected via · 33 unmodified lines | ||
| 1006 | 1101 | KVM_SET_VCPU_EVENTS or otherwise) because such an exception is always delivered |
| 1007 | 1102 | directly to the virtual CPU). |
| 1008 | 1103 | |
| 1104 | +:: | |
| 1009 | 1105 | |
| 1010 | −struct kvm_vcpu_events { | |
| 1106 | + struct kvm_vcpu_events { | |
| 1011 | 1107 | struct { |
| 1012 | 1108 | __u8 serror_pending; |
| 1013 | 1109 | __u8 serror_has_esr; |
| @@ -1017,18 +1113,20 @@ struct kvm_vcpu_events { · 3 unmodified lines | ||
| 1017 | 1113 | __u64 serror_esr; |
| 1018 | 1114 | } exception; |
| 1019 | 1115 | __u32 reserved[12]; |
| 1020 | −}; | |
| 1116 | + }; | |
| 1021 | 1117 | |
| 1022 | 1118 | 4.32 KVM_SET_VCPU_EVENTS |
| 1119 | +------------------------ | |
| 1023 | 1120 | |
| 1024 | −Capability: KVM_CAP_VCPU_EVENTS | |
| 1025 | −Extended by: KVM_CAP_INTR_SHADOW | |
| 1026 | −Architectures: x86, arm, arm64 | |
| 1027 | −Type: vcpu ioctl | |
| 1028 | −Parameters: struct kvm_vcpu_event (in) | |
| 1029 | −Returns: 0 on success, -1 on error | |
| 1121 | +:Capability: KVM_CAP_VCPU_EVENTS | |
| 1122 | +:Extended by: KVM_CAP_INTR_SHADOW | |
| 1123 | +:Architectures: x86, arm, arm64 | |
| 1124 | +:Type: vcpu ioctl | |
| 1125 | +:Parameters: struct kvm_vcpu_event (in) | |
| 1126 | +:Returns: 0 on success, -1 on error | |
| 1030 | 1127 | |
| 1031 | 1128 | X86: |
| 1129 | +^^^^ | |
| 1032 | 1130 | |
| 1033 | 1131 | Set pending exceptions, interrupts, and NMIs as well as related states of the |
| 1034 | 1132 | vcpu. |
| @@ -1040,9 +1138,11 @@ from the update. These fields are nmi.pending, sipi_vector, smi.smm, · 5 unmodified lines | ||
| 1040 | 1138 | smi.pending. Keep the corresponding bits in the flags field cleared to |
| 1041 | 1139 | suppress overwriting the current in-kernel state. The bits are: |
| 1042 | 1140 | |
| 1043 | −KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel | |
| 1044 | −KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector | |
| 1045 | −KVM_VCPUEVENT_VALID_SMM - transfer the smi sub-struct. | |
| 1141 | +=============================== ================================== | |
| 1142 | +KVM_VCPUEVENT_VALID_NMI_PENDING transfer nmi.pending to the kernel | |
| 1143 | +KVM_VCPUEVENT_VALID_SIPI_VECTOR transfer sipi_vector | |
| 1144 | +KVM_VCPUEVENT_VALID_SMM transfer the smi sub-struct. | |
| 1145 | +=============================== ================================== | |
| 1046 | 1146 | |
| 1047 | 1147 | If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in |
| 1048 | 1148 | the flags field to signal that interrupt.shadow contains a valid state and |
| @@ -1056,6 +1156,7 @@ exception_has_payload, exception_payload, and exception.pending fields · 7 unmodified lines | ||
| 1056 | 1156 | contain a valid state and shall be written into the VCPU. |
| 1057 | 1157 | |
| 1058 | 1158 | ARM/ARM64: |
| 1159 | +^^^^^^^^^^ | |
| 1059 | 1160 | |
| 1060 | 1161 | User 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 | |
| 1080 | 1181 | 4.33 KVM_GET_DEBUGREGS |
| 1182 | +---------------------- | |
| 1081 | 1183 | |
| 1082 | −Capability: KVM_CAP_DEBUGREGS | |
| 1083 | −Architectures: x86 | |
| 1084 | −Type: vm ioctl | |
| 1085 | −Parameters: struct kvm_debugregs (out) | |
| 1086 | −Returns: 0 on success, -1 on error | |
| 1184 | +:Capability: KVM_CAP_DEBUGREGS | |
| 1185 | +:Architectures: x86 | |
| 1186 | +:Type: vm ioctl | |
| 1187 | +:Parameters: struct kvm_debugregs (out) | |
| 1188 | +:Returns: 0 on success, -1 on error | |
| 1087 | 1189 | |
| 1088 | 1190 | Reads debug registers from the vcpu. |
| 1089 | 1191 | |
| 1090 | −struct kvm_debugregs { | |
| 1192 | +:: | |
| 1193 | + | |
| 1194 | + struct kvm_debugregs { | |
| 1091 | 1195 | __u64 db[4]; |
| 1092 | 1196 | __u64 dr6; |
| 1093 | 1197 | __u64 dr7; |
| 1094 | 1198 | __u64 flags; |
| 1095 | 1199 | __u64 reserved[9]; |
| 1096 | −}; | |
| 1200 | + }; | |
| 1097 | 1201 | |
| 1098 | 1202 | |
| 1099 | 1203 | 4.34 KVM_SET_DEBUGREGS |
| 1204 | +---------------------- | |
| 1100 | 1205 | |
| 1101 | −Capability: KVM_CAP_DEBUGREGS | |
| 1102 | −Architectures: x86 | |
| 1103 | −Type: vm ioctl | |
| 1104 | −Parameters: struct kvm_debugregs (in) | |
| 1105 | −Returns: 0 on success, -1 on error | |
| 1206 | +:Capability: KVM_CAP_DEBUGREGS | |
| 1207 | +:Architectures: x86 | |
| 1208 | +:Type: vm ioctl | |
| 1209 | +:Parameters: struct kvm_debugregs (in) | |
| 1210 | +:Returns: 0 on success, -1 on error | |
| 1106 | 1211 | |
| 1107 | 1212 | Writes 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 | |
| 1113 | 1218 | 4.35 KVM_SET_USER_MEMORY_REGION |
| 1219 | +------------------------------- | |
| 1114 | 1220 | |
| 1115 | −Capability: KVM_CAP_USER_MEMORY | |
| 1116 | −Architectures: all | |
| 1117 | −Type: vm ioctl | |
| 1118 | −Parameters: struct kvm_userspace_memory_region (in) | |
| 1119 | −Returns: 0 on success, -1 on error | |
| 1221 | +:Capability: KVM_CAP_USER_MEMORY | |
| 1222 | +:Architectures: all | |
| 1223 | +:Type: vm ioctl | |
| 1224 | +:Parameters: struct kvm_userspace_memory_region (in) | |
| 1225 | +:Returns: 0 on success, -1 on error | |
| 1120 | 1226 | |
| 1121 | −struct kvm_userspace_memory_region { | |
| 1227 | +:: | |
| 1228 | + | |
| 1229 | + struct kvm_userspace_memory_region { | |
| 1122 | 1230 | __u32 slot; |
| 1123 | 1231 | __u32 flags; |
| 1124 | 1232 | __u64 guest_phys_addr; |
| 1125 | 1233 | __u64 memory_size; /* bytes */ |
| 1126 | 1234 | __u64 userspace_addr; /* start of the userspace allocated memory */ |
| 1127 | −}; | |
| 1235 | + }; | |
| 1128 | 1236 | |
| 1129 | −/* for kvm_memory_region::flags */ | |
| 1130 | −#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) | |
| 1131 | −#define KVM_MEM_READONLY (1UL << 1) | |
| 1237 | + /* for kvm_memory_region::flags */ | |
| 1238 | + #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) | |
| 1239 | + #define KVM_MEM_READONLY (1UL << 1) | |
| 1132 | 1240 | |
| 1133 | 1241 | This ioctl allows the user to create, modify or delete a guest physical |
| 1134 | 1242 | memory slot. Bits 0-15 of "slot" specify the slot id and this value |
| @@ -1174,12 +1282,13 @@ allocation and is deprecated. · 39 unmodified lines | ||
| 1174 | 1282 | |
| 1175 | 1283 | |
| 1176 | 1284 | 4.36 KVM_SET_TSS_ADDR |
| 1285 | +--------------------- | |
| 1177 | 1286 | |
| 1178 | −Capability: KVM_CAP_SET_TSS_ADDR | |
| 1179 | −Architectures: x86 | |
| 1180 | −Type: vm ioctl | |
| 1181 | −Parameters: unsigned long tss_address (in) | |
| 1182 | −Returns: 0 on success, -1 on error | |
| 1287 | +:Capability: KVM_CAP_SET_TSS_ADDR | |
| 1288 | +:Architectures: x86 | |
| 1289 | +:Type: vm ioctl | |
| 1290 | +:Parameters: unsigned long tss_address (in) | |
| 1291 | +:Returns: 0 on success, -1 on error | |
| 1183 | 1292 | |
| 1184 | 1293 | This ioctl defines the physical address of a three-page region in the guest |
| 1185 | 1294 | physical address space. The region must be within the first 4GB of the |
| @@ -1193,21 +1302,24 @@ documentation when it pops into existence). · 7 unmodified lines | ||
| 1193 | 1302 | |
| 1194 | 1303 | |
| 1195 | 1304 | 4.37 KVM_ENABLE_CAP |
| 1305 | +------------------- | |
| 1306 | + | |
| 1307 | +:Capability: KVM_CAP_ENABLE_CAP | |
| 1308 | +:Architectures: mips, ppc, s390 | |
| 1309 | +:Type: vcpu ioctl | |
| 1310 | +:Parameters: struct kvm_enable_cap (in) | |
| 1311 | +:Returns: 0 on success; -1 on error | |
| 1196 | 1312 | |
| 1197 | −Capability: KVM_CAP_ENABLE_CAP | |
| 1198 | −Architectures: mips, ppc, s390 | |
| 1199 | −Type: vcpu ioctl | |
| 1200 | −Parameters: struct kvm_enable_cap (in) | |
| 1201 | −Returns: 0 on success; -1 on error | |
| 1313 | +:Capability: KVM_CAP_ENABLE_CAP_VM | |
| 1314 | +:Architectures: all | |
| 1315 | +:Type: vcpu ioctl | |
| 1316 | +:Parameters: struct kvm_enable_cap (in) | |
| 1317 | +:Returns: 0 on success; -1 on error | |
| 1202 | 1318 | |
| 1203 | −Capability: KVM_CAP_ENABLE_CAP_VM | |
| 1204 | −Architectures: all | |
| 1205 | −Type: vcpu ioctl | |
| 1206 | −Parameters: struct kvm_enable_cap (in) | |
| 1207 | −Returns: 0 on success; -1 on error | |
| 1319 | +.. note:: | |
| 1208 | 1320 | |
| 1209 | −+Not all extensions are enabled by default. Using this ioctl the application | |
| 1210 | −can enable an extension, making it available to the guest. | |
| 1321 | + Not all extensions are enabled by default. Using this ioctl the application | |
| 1322 | + can enable an extension, making it available to the guest. | |
| 1211 | 1323 | |
| 1212 | 1324 | On systems that do not support this ioctl, it always fails. On systems that |
| 1213 | 1325 | do support it, it only works for extensions that are supported for enablement. |
| @@ -1215,76 +1327,91 @@ do support it, it only works for extensions that are supported for enablement. · 1 unmodified line | ||
| 1215 | 1327 | To check if a capability can be enabled, the KVM_CHECK_EXTENSION ioctl should |
| 1216 | 1328 | be used. |
| 1217 | 1329 | |
| 1218 | −struct kvm_enable_cap { | |
| 1330 | +:: | |
| 1331 | + | |
| 1332 | + struct kvm_enable_cap { | |
| 1219 | 1333 | /* in */ |
| 1220 | 1334 | __u32 cap; |
| 1221 | 1335 | |
| 1222 | 1336 | The capability that is supposed to get enabled. |
| 1223 | 1337 | |
| 1338 | +:: | |
| 1339 | + | |
| 1224 | 1340 | __u32 flags; |
| 1225 | 1341 | |
| 1226 | 1342 | A bitfield indicating future enhancements. Has to be 0 for now. |
| 1227 | 1343 | |
| 1344 | +:: | |
| 1345 | + | |
| 1228 | 1346 | __u64 args[4]; |
| 1229 | 1347 | |
| 1230 | 1348 | Arguments for enabling a feature. If a feature needs initial values to |
| 1231 | 1349 | function properly, this is the place to put them. |
| 1232 | 1350 | |
| 1351 | +:: | |
| 1352 | + | |
| 1233 | 1353 | __u8 pad[64]; |
| 1234 | −}; | |
| 1354 | + }; | |
| 1235 | 1355 | |
| 1236 | 1356 | The vcpu ioctl should be used for vcpu-specific capabilities, the vm ioctl |
| 1237 | 1357 | for vm-wide capabilities. |
| 1238 | 1358 | |
| 1239 | 1359 | 4.38 KVM_GET_MP_STATE |
| 1360 | +--------------------- | |
| 1361 | + | |
| 1362 | +:Capability: KVM_CAP_MP_STATE | |
| 1363 | +:Architectures: x86, s390, arm, arm64 | |
| 1364 | +:Type: vcpu ioctl | |
| 1365 | +:Parameters: struct kvm_mp_state (out) | |
| 1366 | +:Returns: 0 on success; -1 on error | |
| 1240 | 1367 | |
| 1241 | −Capability: KVM_CAP_MP_STATE | |
| 1242 | −Architectures: x86, s390, arm, arm64 | |
| 1243 | −Type: vcpu ioctl | |
| 1244 | −Parameters: struct kvm_mp_state (out) | |
| 1245 | −Returns: 0 on success; -1 on error | |
| 1368 | +:: | |
| 1246 | 1369 | |
| 1247 | −struct kvm_mp_state { | |
| 1370 | + struct kvm_mp_state { | |
| 1248 | 1371 | __u32 mp_state; |
| 1249 | −}; | |
| 1372 | + }; | |
| 1250 | 1373 | |
| 1251 | 1374 | Returns the vcpu's current "multiprocessing state" (though also valid on |
| 1252 | 1375 | uniprocessor guests). |
| 1253 | 1376 | |
| 1254 | 1377 | Possible values are: |
| 1255 | 1378 | |
| 1256 | − - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86,arm/arm64] | |
| 1257 | − - KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP) | |
| 1379 | + ========================== =============================================== | |
| 1380 | + KVM_MP_STATE_RUNNABLE the vcpu is currently running [x86,arm/arm64] | |
| 1381 | + KVM_MP_STATE_UNINITIALIZED the vcpu is an application processor (AP) | |
| 1258 | 1382 | which has not yet received an INIT signal [x86] |
| 1259 | − - KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is | |
| 1383 | + KVM_MP_STATE_INIT_RECEIVED the vcpu has received an INIT signal, and is | |
| 1260 | 1384 | now ready for a SIPI [x86] |
| 1261 | − - KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and | |
| 1385 | + KVM_MP_STATE_HALTED the vcpu has executed a HLT instruction and | |
| 1262 | 1386 | is waiting for an interrupt [x86] |
| 1263 | − - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector | |
| 1387 | + KVM_MP_STATE_SIPI_RECEIVED the vcpu has just received a SIPI (vector | |
| 1264 | 1388 | accessible via KVM_GET_VCPU_EVENTS) [x86] |
| 1265 | − - KVM_MP_STATE_STOPPED: the vcpu is stopped [s390,arm/arm64] | |
| 1266 | − - KVM_MP_STATE_CHECK_STOP: the vcpu is in a special error state [s390] | |
| 1267 | − - KVM_MP_STATE_OPERATING: the vcpu is operating (running or halted) | |
| 1389 | + KVM_MP_STATE_STOPPED the vcpu is stopped [s390,arm/arm64] | |
| 1390 | + KVM_MP_STATE_CHECK_STOP the vcpu is in a special error state [s390] | |
| 1391 | + KVM_MP_STATE_OPERATING the vcpu is operating (running or halted) | |
| 1268 | 1392 | [s390] |
| 1269 | − - KVM_MP_STATE_LOAD: the vcpu is in a special load/startup state | |
| 1393 | + KVM_MP_STATE_LOAD the vcpu is in a special load/startup state | |
| 1270 | 1394 | [s390] |
| 1395 | + ========================== =============================================== | |
| 1271 | 1396 | |
| 1272 | 1397 | On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an |
| 1273 | 1398 | in-kernel irqchip, the multiprocessing state must be maintained by userspace on |
| 1274 | 1399 | these architectures. |
| 1275 | 1400 | |
| 1276 | 1401 | For arm/arm64: |
| 1402 | +^^^^^^^^^^^^^^ | |
| 1277 | 1403 | |
| 1278 | 1404 | The only states that are valid are KVM_MP_STATE_STOPPED and |
| 1279 | 1405 | KVM_MP_STATE_RUNNABLE which reflect if the vcpu is paused or not. |
| 1280 | 1406 | |
| 1281 | 1407 | 4.39 KVM_SET_MP_STATE |
| 1408 | +--------------------- | |
| 1282 | 1409 | |
| 1283 | −Capability: KVM_CAP_MP_STATE | |
| 1284 | −Architectures: x86, s390, arm, arm64 | |
| 1285 | −Type: vcpu ioctl | |
| 1286 | −Parameters: struct kvm_mp_state (in) | |
| 1287 | −Returns: 0 on success; -1 on error | |
| 1410 | +:Capability: KVM_CAP_MP_STATE | |
| 1411 | +:Architectures: x86, s390, arm, arm64 | |
| 1412 | +:Type: vcpu ioctl | |
| 1413 | +:Parameters: struct kvm_mp_state (in) | |
| 1414 | +:Returns: 0 on success; -1 on error | |
| 1288 | 1415 | |
| 1289 | 1416 | Sets the vcpu's current "multiprocessing state"; see KVM_GET_MP_STATE for |
| 1290 | 1417 | arguments. |
| @@ -1294,17 +1421,19 @@ in-kernel irqchip, the multiprocessing state must be maintained by userspace on · 3 unmodified lines | ||
| 1294 | 1421 | these architectures. |
| 1295 | 1422 | |
| 1296 | 1423 | For arm/arm64: |
| 1424 | +^^^^^^^^^^^^^^ | |
| 1297 | 1425 | |
| 1298 | 1426 | The only states that are valid are KVM_MP_STATE_STOPPED and |
| 1299 | 1427 | KVM_MP_STATE_RUNNABLE which reflect if the vcpu should be paused or not. |
| 1300 | 1428 | |
| 1301 | 1429 | 4.40 KVM_SET_IDENTITY_MAP_ADDR |
| 1430 | +------------------------------ | |
| 1302 | 1431 | |
| 1303 | −Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR | |
| 1304 | −Architectures: x86 | |
| 1305 | −Type: vm ioctl | |
| 1306 | −Parameters: unsigned long identity (in) | |
| 1307 | −Returns: 0 on success, -1 on error | |
| 1432 | +:Capability: KVM_CAP_SET_IDENTITY_MAP_ADDR | |
| 1433 | +:Architectures: x86 | |
| 1434 | +:Type: vm ioctl | |
| 1435 | +:Parameters: unsigned long identity (in) | |
| 1436 | +:Returns: 0 on success, -1 on error | |
| 1308 | 1437 | |
| 1309 | 1438 | This ioctl defines the physical address of a one-page region in the guest |
| 1310 | 1439 | physical address space. The region must be within the first 4GB of the |
| @@ -1322,12 +1451,13 @@ documentation when it pops into existence). · 11 unmodified lines | ||
| 1322 | 1451 | Fails if any VCPU has already been created. |
| 1323 | 1452 | |
| 1324 | 1453 | 4.41 KVM_SET_BOOT_CPU_ID |
| 1454 | +------------------------ | |
| 1325 | 1455 | |
| 1326 | −Capability: KVM_CAP_SET_BOOT_CPU_ID | |
| 1327 | −Architectures: x86 | |
| 1328 | −Type: vm ioctl | |
| 1329 | −Parameters: unsigned long vcpu_id | |
| 1330 | −Returns: 0 on success, -1 on error | |
| 1456 | +:Capability: KVM_CAP_SET_BOOT_CPU_ID | |
| 1457 | +:Architectures: x86 | |
| 1458 | +:Type: vm ioctl | |
| 1459 | +:Parameters: unsigned long vcpu_id | |
| 1460 | +:Returns: 0 on success, -1 on error | |
| 1331 | 1461 | |
| 1332 | 1462 | Define which vcpu is the Bootstrap Processor (BSP). Values are the same |
| 1333 | 1463 | as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default |
| @@ -1335,102 +1465,119 @@ is vcpu 0. · 1 unmodified line | ||
| 1335 | 1465 | |
| 1336 | 1466 | |
| 1337 | 1467 | 4.42 KVM_GET_XSAVE |
| 1468 | +------------------ | |
| 1338 | 1469 | |
| 1339 | −Capability: KVM_CAP_XSAVE | |
| 1340 | −Architectures: x86 | |
| 1341 | −Type: vcpu ioctl | |
| 1342 | −Parameters: struct kvm_xsave (out) | |
| 1343 | −Returns: 0 on success, -1 on error | |
| 1470 | +:Capability: KVM_CAP_XSAVE | |
| 1471 | +:Architectures: x86 | |
| 1472 | +:Type: vcpu ioctl | |
| 1473 | +:Parameters: struct kvm_xsave (out) | |
| 1474 | +:Returns: 0 on success, -1 on error | |
| 1344 | 1475 | |
| 1345 | −struct kvm_xsave { | |
| 1476 | + | |
| 1477 | +:: | |
| 1478 | + | |
| 1479 | + struct kvm_xsave { | |
| 1346 | 1480 | __u32 region[1024]; |
| 1347 | −}; | |
| 1481 | + }; | |
| 1348 | 1482 | |
| 1349 | 1483 | This ioctl would copy current vcpu's xsave struct to the userspace. |
| 1350 | 1484 | |
| 1351 | 1485 | |
| 1352 | 1486 | 4.43 KVM_SET_XSAVE |
| 1487 | +------------------ | |
| 1488 | + | |
| 1489 | +:Capability: KVM_CAP_XSAVE | |
| 1490 | +:Architectures: x86 | |
| 1491 | +:Type: vcpu ioctl | |
| 1492 | +:Parameters: struct kvm_xsave (in) | |
| 1493 | +:Returns: 0 on success, -1 on error | |
| 1353 | 1494 | |
| 1354 | −Capability: KVM_CAP_XSAVE | |
| 1355 | −Architectures: x86 | |
| 1356 | −Type: vcpu ioctl | |
| 1357 | −Parameters: struct kvm_xsave (in) | |
| 1358 | −Returns: 0 on success, -1 on error | |
| 1495 | +:: | |
| 1359 | 1496 | |
| 1360 | −struct kvm_xsave { | |
| 1497 | + | |
| 1498 | + struct kvm_xsave { | |
| 1361 | 1499 | __u32 region[1024]; |
| 1362 | −}; | |
| 1500 | + }; | |
| 1363 | 1501 | |
| 1364 | 1502 | This ioctl would copy userspace's xsave struct to the kernel. |
| 1365 | 1503 | |
| 1366 | 1504 | |
| 1367 | 1505 | 4.44 KVM_GET_XCRS |
| 1506 | +----------------- | |
| 1507 | + | |
| 1508 | +:Capability: KVM_CAP_XCRS | |
| 1509 | +:Architectures: x86 | |
| 1510 | +:Type: vcpu ioctl | |
| 1511 | +:Parameters: struct kvm_xcrs (out) | |
| 1512 | +:Returns: 0 on success, -1 on error | |
| 1368 | 1513 | |
| 1369 | −Capability: KVM_CAP_XCRS | |
| 1370 | −Architectures: x86 | |
| 1371 | −Type: vcpu ioctl | |
| 1372 | −Parameters: struct kvm_xcrs (out) | |
| 1373 | −Returns: 0 on success, -1 on error | |
| 1514 | +:: | |
| 1374 | 1515 | |
| 1375 | −struct kvm_xcr { | |
| 1516 | + struct kvm_xcr { | |
| 1376 | 1517 | __u32 xcr; |
| 1377 | 1518 | __u32 reserved; |
| 1378 | 1519 | __u64 value; |
| 1379 | −}; | |
| 1520 | + }; | |
| 1380 | 1521 | |
| 1381 | −struct kvm_xcrs { | |
| 1522 | + struct kvm_xcrs { | |
| 1382 | 1523 | __u32 nr_xcrs; |
| 1383 | 1524 | __u32 flags; |
| 1384 | 1525 | struct kvm_xcr xcrs[KVM_MAX_XCRS]; |
| 1385 | 1526 | __u64 padding[16]; |
| 1386 | −}; | |
| 1527 | + }; | |
| 1387 | 1528 | |
| 1388 | 1529 | This ioctl would copy current vcpu's xcrs to the userspace. |
| 1389 | 1530 | |
| 1390 | 1531 | |
| 1391 | 1532 | 4.45 KVM_SET_XCRS |
| 1533 | +----------------- | |
| 1534 | + | |
| 1535 | +:Capability: KVM_CAP_XCRS | |
| 1536 | +:Architectures: x86 | |
| 1537 | +:Type: vcpu ioctl | |
| 1538 | +:Parameters: struct kvm_xcrs (in) | |
| 1539 | +:Returns: 0 on success, -1 on error | |
| 1392 | 1540 | |
| 1393 | −Capability: KVM_CAP_XCRS | |
| 1394 | −Architectures: x86 | |
| 1395 | −Type: vcpu ioctl | |
| 1396 | −Parameters: struct kvm_xcrs (in) | |
| 1397 | −Returns: 0 on success, -1 on error | |
| 1541 | +:: | |
| 1398 | 1542 | |
| 1399 | −struct kvm_xcr { | |
| 1543 | + struct kvm_xcr { | |
| 1400 | 1544 | __u32 xcr; |
| 1401 | 1545 | __u32 reserved; |
| 1402 | 1546 | __u64 value; |
| 1403 | −}; | |
| 1547 | + }; | |
| 1404 | 1548 | |
| 1405 | −struct kvm_xcrs { | |
| 1549 | + struct kvm_xcrs { | |
| 1406 | 1550 | __u32 nr_xcrs; |
| 1407 | 1551 | __u32 flags; |
| 1408 | 1552 | struct kvm_xcr xcrs[KVM_MAX_XCRS]; |
| 1409 | 1553 | __u64 padding[16]; |
| 1410 | −}; | |
| 1554 | + }; | |
| 1411 | 1555 | |
| 1412 | 1556 | This ioctl would set vcpu's xcr to the value userspace specified. |
| 1413 | 1557 | |
| 1414 | 1558 | |
| 1415 | 1559 | 4.46 KVM_GET_SUPPORTED_CPUID |
| 1560 | +---------------------------- | |
| 1416 | 1561 | |
| 1417 | −Capability: KVM_CAP_EXT_CPUID | |
| 1418 | −Architectures: x86 | |
| 1419 | −Type: system ioctl | |
| 1420 | −Parameters: struct kvm_cpuid2 (in/out) | |
| 1421 | −Returns: 0 on success, -1 on error | |
| 1562 | +:Capability: KVM_CAP_EXT_CPUID | |
| 1563 | +:Architectures: x86 | |
| 1564 | +:Type: system ioctl | |
| 1565 | +:Parameters: struct kvm_cpuid2 (in/out) | |
| 1566 | +:Returns: 0 on success, -1 on error | |
| 1422 | 1567 | |
| 1423 | −struct kvm_cpuid2 { | |
| 1568 | +:: | |
| 1569 | + | |
| 1570 | + struct kvm_cpuid2 { | |
| 1424 | 1571 | __u32 nent; |
| 1425 | 1572 | __u32 padding; |
| 1426 | 1573 | struct kvm_cpuid_entry2 entries[0]; |
| 1427 | −}; | |
| 1574 | + }; | |
| 1428 | 1575 | |
| 1429 | −#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0) | |
| 1430 | −#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1) | |
| 1431 | −#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2) | |
| 1576 | + #define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0) | |
| 1577 | + #define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1) | |
| 1578 | + #define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2) | |
| 1432 | 1579 | |
| 1433 | −struct kvm_cpuid_entry2 { | |
| 1580 | + struct kvm_cpuid_entry2 { | |
| 1434 | 1581 | __u32 function; |
| 1435 | 1582 | __u32 index; |
| 1436 | 1583 | __u32 flags; |
| @@ -1439,7 +1586,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines | ||
| 1439 | 1586 | __u32 ecx; |
| 1440 | 1587 | __u32 edx; |
| 1441 | 1588 | __u32 padding[3]; |
| 1442 | −}; | |
| 1589 | + }; | |
| 1443 | 1590 | |
| 1444 | 1591 | This ioctl returns x86 cpuid features which are supported by both the |
| 1445 | 1592 | hardware and kvm in its default configuration. Userspace can use the |
| @@ -1467,10 +1614,16 @@ with unknown or unsupported features masked out. Some features (for example, · 21 unmodified lines | ||
| 1467 | 1614 | x2apic), may not be present in the host cpu, but are exposed by kvm if it can |
| 1468 | 1615 | emulate them efficiently. The fields in each entry are defined as follows: |
| 1469 | 1616 | |
| 1470 | − function: the eax value used to obtain the entry | |
| 1471 | − index: the ecx value used to obtain the entry (for entries that are | |
| 1617 | + function: | |
| 1618 | + the eax value used to obtain the entry | |
| 1619 | + | |
| 1620 | + index: | |
| 1621 | + the ecx value used to obtain the entry (for entries that are | |
| 1472 | 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 | 1627 | KVM_CPUID_FLAG_SIGNIFCANT_INDEX: |
| 1475 | 1628 | if the index field is valid |
| 1476 | 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 | 1633 | KVM_CPUID_FLAG_STATE_READ_NEXT: |
| 1481 | 1634 | for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is |
| 1482 | 1635 | the first entry to be read by a cpu |
| 1483 | − eax, ebx, ecx, edx: the values returned by the cpuid instruction for | |
| 1636 | + | |
| 1637 | + eax, ebx, ecx, edx: | |
| 1638 | + the values returned by the cpuid instruction for | |
| 1484 | 1639 | this function/index combination |
| 1485 | 1640 | |
| 1486 | 1641 | The TSC deadline timer feature (CPUID leaf 1, ecx[24]) is always returned |
| 1487 | 1642 | as false, since the feature depends on KVM_CREATE_IRQCHIP for local APIC |
| 1488 | −support. Instead it is reported via | |
| 1643 | +support. Instead it is reported via:: | |
| 1489 | 1644 | |
| 1490 | 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 | |
| 1496 | 1651 | 4.47 KVM_PPC_GET_PVINFO |
| 1652 | +----------------------- | |
| 1497 | 1653 | |
| 1498 | −Capability: KVM_CAP_PPC_GET_PVINFO | |
| 1499 | −Architectures: ppc | |
| 1500 | −Type: vm ioctl | |
| 1501 | −Parameters: struct kvm_ppc_pvinfo (out) | |
| 1502 | −Returns: 0 on success, !0 on error | |
| 1654 | +:Capability: KVM_CAP_PPC_GET_PVINFO | |
| 1655 | +:Architectures: ppc | |
| 1656 | +:Type: vm ioctl | |
| 1657 | +:Parameters: struct kvm_ppc_pvinfo (out) | |
| 1658 | +:Returns: 0 on success, !0 on error | |
| 1503 | 1659 | |
| 1504 | −struct kvm_ppc_pvinfo { | |
| 1660 | +:: | |
| 1661 | + | |
| 1662 | + struct kvm_ppc_pvinfo { | |
| 1505 | 1663 | __u32 flags; |
| 1506 | 1664 | __u32 hcall[4]; |
| 1507 | 1665 | __u8 pad[108]; |
| 1508 | −}; | |
| 1666 | + }; | |
| 1509 | 1667 | |
| 1510 | 1668 | This ioctl fetches PV specific information that need to be passed to the guest |
| 1511 | 1669 | using the device tree or other means from vm context. |
| @@ -1515,33 +1673,39 @@ The hcall array defines 4 instructions that make up a hypercall. · 3 unmodified lines | ||
| 1515 | 1673 | If any additional field gets added to this structure later on, a bit for that |
| 1516 | 1674 | additional piece of information will be set in the flags bitmap. |
| 1517 | 1675 | |
| 1518 | −The flags bitmap is defined as: | |
| 1676 | +The flags bitmap is defined as:: | |
| 1519 | 1677 | |
| 1520 | 1678 | /* the host supports the ePAPR idle hcall |
| 1521 | 1679 | #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0) |
| 1522 | 1680 | |
| 1523 | 1681 | 4.52 KVM_SET_GSI_ROUTING |
| 1682 | +------------------------ | |
| 1524 | 1683 | |
| 1525 | −Capability: KVM_CAP_IRQ_ROUTING | |
| 1526 | −Architectures: x86 s390 arm arm64 | |
| 1527 | −Type: vm ioctl | |
| 1528 | −Parameters: struct kvm_irq_routing (in) | |
| 1529 | −Returns: 0 on success, -1 on error | |
| 1684 | +:Capability: KVM_CAP_IRQ_ROUTING | |
| 1685 | +:Architectures: x86 s390 arm arm64 | |
| 1686 | +:Type: vm ioctl | |
| 1687 | +:Parameters: struct kvm_irq_routing (in) | |
| 1688 | +:Returns: 0 on success, -1 on error | |
| 1530 | 1689 | |
| 1531 | 1690 | Sets the GSI routing table entries, overwriting any previously set entries. |
| 1532 | 1691 | |
| 1533 | 1692 | On arm/arm64, GSI routing has the following limitation: |
| 1693 | + | |
| 1534 | 1694 | - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD. |
| 1535 | 1695 | |
| 1536 | −struct kvm_irq_routing { | |
| 1696 | +:: | |
| 1697 | + | |
| 1698 | + struct kvm_irq_routing { | |
| 1537 | 1699 | __u32 nr; |
| 1538 | 1700 | __u32 flags; |
| 1539 | 1701 | struct kvm_irq_routing_entry entries[0]; |
| 1540 | −}; | |
| 1702 | + }; | |
| 1541 | 1703 | |
| 1542 | 1704 | No flags are specified so far, the corresponding field must be set to zero. |
| 1543 | 1705 | |
| 1544 | −struct kvm_irq_routing_entry { | |
| 1706 | +:: | |
| 1707 | + | |
| 1708 | + struct kvm_irq_routing_entry { | |
| 1545 | 1709 | __u32 gsi; |
| 1546 | 1710 | __u32 type; |
| 1547 | 1711 | __u32 flags; |
| @@ -1553,15 +1717,16 @@ struct kvm_irq_routing_entry { · 5 unmodified lines | ||
| 1553 | 1717 | struct kvm_irq_routing_hv_sint hv_sint; |
| 1554 | 1718 | __u32 pad[8]; |
| 1555 | 1719 | } u; |
| 1556 | −}; | |
| 1720 | + }; | |
| 1557 | 1721 | |
| 1558 | −/* gsi routing entry types */ | |
| 1559 | −#define KVM_IRQ_ROUTING_IRQCHIP 1 | |
| 1560 | −#define KVM_IRQ_ROUTING_MSI 2 | |
| 1561 | −#define KVM_IRQ_ROUTING_S390_ADAPTER 3 | |
| 1562 | −#define KVM_IRQ_ROUTING_HV_SINT 4 | |
| 1722 | + /* gsi routing entry types */ | |
| 1723 | + #define KVM_IRQ_ROUTING_IRQCHIP 1 | |
| 1724 | + #define KVM_IRQ_ROUTING_MSI 2 | |
| 1725 | + #define KVM_IRQ_ROUTING_S390_ADAPTER 3 | |
| 1726 | + #define KVM_IRQ_ROUTING_HV_SINT 4 | |
| 1563 | 1727 | |
| 1564 | 1728 | flags: |
| 1729 | + | |
| 1565 | 1730 | - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry |
| 1566 | 1731 | type, specifies that the devid field contains a valid value. The per-VM |
| 1567 | 1732 | KVM_CAP_MSI_DEVID capability advertises the requirement to provide |
| @@ -1569,12 +1734,14 @@ flags: · 1 unmodified line | ||
| 1569 | 1734 | never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail. |
| 1570 | 1735 | - zero otherwise |
| 1571 | 1736 | |
| 1572 | −struct kvm_irq_routing_irqchip { | |
| 1737 | +:: | |
| 1738 | + | |
| 1739 | + struct kvm_irq_routing_irqchip { | |
| 1573 | 1740 | __u32 irqchip; |
| 1574 | 1741 | __u32 pin; |
| 1575 | −}; | |
| 1742 | + }; | |
| 1576 | 1743 | |
| 1577 | −struct kvm_irq_routing_msi { | |
| 1744 | + struct kvm_irq_routing_msi { | |
| 1578 | 1745 | __u32 address_lo; |
| 1579 | 1746 | __u32 address_hi; |
| 1580 | 1747 | __u32 data; |
| @@ -1582,7 +1749,7 @@ struct kvm_irq_routing_msi { · 1 unmodified line | ||
| 1582 | 1749 | __u32 pad; |
| 1583 | 1750 | __u32 devid; |
| 1584 | 1751 | }; |
| 1585 | −}; | |
| 1752 | + }; | |
| 1586 | 1753 | |
| 1587 | 1754 | If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier |
| 1588 | 1755 | for the device that wrote the MSI message. For PCI, this is usually a |
| @@ -1593,39 +1760,43 @@ feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled, · 4 unmodified lines | ||
| 1593 | 1760 | address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of |
| 1594 | 1761 | address_hi must be zero. |
| 1595 | 1762 | |
| 1596 | −struct kvm_irq_routing_s390_adapter { | |
| 1763 | +:: | |
| 1764 | + | |
| 1765 | + struct kvm_irq_routing_s390_adapter { | |
| 1597 | 1766 | __u64 ind_addr; |
| 1598 | 1767 | __u64 summary_addr; |
| 1599 | 1768 | __u64 ind_offset; |
| 1600 | 1769 | __u32 summary_offset; |
| 1601 | 1770 | __u32 adapter_id; |
| 1602 | −}; | |
| 1771 | + }; | |
| 1603 | 1772 | |
| 1604 | −struct kvm_irq_routing_hv_sint { | |
| 1773 | + struct kvm_irq_routing_hv_sint { | |
| 1605 | 1774 | __u32 vcpu; |
| 1606 | 1775 | __u32 sint; |
| 1607 | −}; | |
| 1776 | + }; | |
| 1608 | 1777 | |
| 1609 | 1778 | |
| 1610 | 1779 | 4.55 KVM_SET_TSC_KHZ |
| 1780 | +-------------------- | |
| 1611 | 1781 | |
| 1612 | −Capability: KVM_CAP_TSC_CONTROL | |
| 1613 | −Architectures: x86 | |
| 1614 | −Type: vcpu ioctl | |
| 1615 | −Parameters: virtual tsc_khz | |
| 1616 | −Returns: 0 on success, -1 on error | |
| 1782 | +:Capability: KVM_CAP_TSC_CONTROL | |
| 1783 | +:Architectures: x86 | |
| 1784 | +:Type: vcpu ioctl | |
| 1785 | +:Parameters: virtual tsc_khz | |
| 1786 | +:Returns: 0 on success, -1 on error | |
| 1617 | 1787 | |
| 1618 | 1788 | Specifies the tsc frequency for the virtual machine. The unit of the |
| 1619 | 1789 | frequency is KHz. |
| 1620 | 1790 | |
| 1621 | 1791 | |
| 1622 | 1792 | 4.56 KVM_GET_TSC_KHZ |
| 1793 | +-------------------- | |
| 1623 | 1794 | |
| 1624 | −Capability: KVM_CAP_GET_TSC_KHZ | |
| 1625 | −Architectures: x86 | |
| 1626 | −Type: vcpu ioctl | |
| 1627 | −Parameters: none | |
| 1628 | −Returns: virtual tsc-khz on success, negative value on error | |
| 1795 | +:Capability: KVM_CAP_GET_TSC_KHZ | |
| 1796 | +:Architectures: x86 | |
| 1797 | +:Type: vcpu ioctl | |
| 1798 | +:Parameters: none | |
| 1799 | +:Returns: virtual tsc-khz on success, negative value on error | |
| 1629 | 1800 | |
| 1630 | 1801 | Returns the tsc frequency of the guest. The unit of the return value is |
| 1631 | 1802 | KHz. 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 | |
| 1635 | 1806 | 4.57 KVM_GET_LAPIC |
| 1807 | +------------------ | |
| 1636 | 1808 | |
| 1637 | −Capability: KVM_CAP_IRQCHIP | |
| 1638 | −Architectures: x86 | |
| 1639 | −Type: vcpu ioctl | |
| 1640 | −Parameters: struct kvm_lapic_state (out) | |
| 1641 | −Returns: 0 on success, -1 on error | |
| 1809 | +:Capability: KVM_CAP_IRQCHIP | |
| 1810 | +:Architectures: x86 | |
| 1811 | +:Type: vcpu ioctl | |
| 1812 | +:Parameters: struct kvm_lapic_state (out) | |
| 1813 | +:Returns: 0 on success, -1 on error | |
| 1642 | 1814 | |
| 1643 | −#define KVM_APIC_REG_SIZE 0x400 | |
| 1644 | −struct kvm_lapic_state { | |
| 1815 | +:: | |
| 1816 | + | |
| 1817 | + #define KVM_APIC_REG_SIZE 0x400 | |
| 1818 | + struct kvm_lapic_state { | |
| 1645 | 1819 | char regs[KVM_APIC_REG_SIZE]; |
| 1646 | −}; | |
| 1820 | + }; | |
| 1647 | 1821 | |
| 1648 | 1822 | Reads the Local APIC registers and copies them into the input argument. The |
| 1649 | 1823 | data 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 | |
| 1663 | 1837 | 4.58 KVM_SET_LAPIC |
| 1838 | +------------------ | |
| 1664 | 1839 | |
| 1665 | −Capability: KVM_CAP_IRQCHIP | |
| 1666 | −Architectures: x86 | |
| 1667 | −Type: vcpu ioctl | |
| 1668 | −Parameters: struct kvm_lapic_state (in) | |
| 1669 | −Returns: 0 on success, -1 on error | |
| 1840 | +:Capability: KVM_CAP_IRQCHIP | |
| 1841 | +:Architectures: x86 | |
| 1842 | +:Type: vcpu ioctl | |
| 1843 | +:Parameters: struct kvm_lapic_state (in) | |
| 1844 | +:Returns: 0 on success, -1 on error | |
| 1670 | 1845 | |
| 1671 | −#define KVM_APIC_REG_SIZE 0x400 | |
| 1672 | −struct kvm_lapic_state { | |
| 1846 | +:: | |
| 1847 | + | |
| 1848 | + #define KVM_APIC_REG_SIZE 0x400 | |
| 1849 | + struct kvm_lapic_state { | |
| 1673 | 1850 | char regs[KVM_APIC_REG_SIZE]; |
| 1674 | −}; | |
| 1851 | + }; | |
| 1675 | 1852 | |
| 1676 | 1853 | Copies the input argument into the Local APIC registers. The data format |
| 1677 | 1854 | and layout are the same as documented in the architecture manual. |
| @@ -1682,35 +1859,38 @@ See the note in KVM_GET_LAPIC. · 4 unmodified lines | ||
| 1682 | 1859 | |
| 1683 | 1860 | |
| 1684 | 1861 | 4.59 KVM_IOEVENTFD |
| 1862 | +------------------ | |
| 1685 | 1863 | |
| 1686 | −Capability: KVM_CAP_IOEVENTFD | |
| 1687 | −Architectures: all | |
| 1688 | −Type: vm ioctl | |
| 1689 | −Parameters: struct kvm_ioeventfd (in) | |
| 1690 | −Returns: 0 on success, !0 on error | |
| 1864 | +:Capability: KVM_CAP_IOEVENTFD | |
| 1865 | +:Architectures: all | |
| 1866 | +:Type: vm ioctl | |
| 1867 | +:Parameters: struct kvm_ioeventfd (in) | |
| 1868 | +:Returns: 0 on success, !0 on error | |
| 1691 | 1869 | |
| 1692 | 1870 | This ioctl attaches or detaches an ioeventfd to a legal pio/mmio address |
| 1693 | 1871 | within the guest. A guest write in the registered address will signal the |
| 1694 | 1872 | provided event instead of triggering an exit. |
| 1695 | 1873 | |
| 1696 | −struct kvm_ioeventfd { | |
| 1874 | +:: | |
| 1875 | + | |
| 1876 | + struct kvm_ioeventfd { | |
| 1697 | 1877 | __u64 datamatch; |
| 1698 | 1878 | __u64 addr; /* legal pio/mmio address */ |
| 1699 | 1879 | __u32 len; /* 0, 1, 2, 4, or 8 bytes */ |
| 1700 | 1880 | __s32 fd; |
| 1701 | 1881 | __u32 flags; |
| 1702 | 1882 | __u8 pad[36]; |
| 1703 | −}; | |
| 1883 | + }; | |
| 1704 | 1884 | |
| 1705 | 1885 | For the special case of virtio-ccw devices on s390, the ioevent is matched |
| 1706 | 1886 | to a subchannel/virtqueue tuple instead. |
| 1707 | 1887 | |
| 1708 | −The following flags are defined: | |
| 1888 | +The following flags are defined:: | |
| 1709 | 1889 | |
| 1710 | −#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) | |
| 1711 | −#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) | |
| 1712 | −#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) | |
| 1713 | −#define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \ | |
| 1890 | + #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) | |
| 1891 | + #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) | |
| 1892 | + #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) | |
| 1893 | + #define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \ | |
| 1714 | 1894 | (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify) |
| 1715 | 1895 | |
| 1716 | 1896 | If datamatch flag is set, the event will be signaled only if the written value |
| @@ -1725,17 +1905,20 @@ The speedup may only apply to specific architectures, but the ioeventfd will · 8 unmodified lines | ||
| 1725 | 1905 | work anyway. |
| 1726 | 1906 | |
| 1727 | 1907 | 4.60 KVM_DIRTY_TLB |
| 1908 | +------------------ | |
| 1909 | + | |
| 1910 | +:Capability: KVM_CAP_SW_TLB | |
| 1911 | +:Architectures: ppc | |
| 1912 | +:Type: vcpu ioctl | |
| 1913 | +:Parameters: struct kvm_dirty_tlb (in) | |
| 1914 | +:Returns: 0 on success, -1 on error | |
| 1728 | 1915 | |
| 1729 | −Capability: KVM_CAP_SW_TLB | |
| 1730 | −Architectures: ppc | |
| 1731 | −Type: vcpu ioctl | |
| 1732 | −Parameters: struct kvm_dirty_tlb (in) | |
| 1733 | −Returns: 0 on success, -1 on error | |
| 1916 | +:: | |
| 1734 | 1917 | |
| 1735 | −struct kvm_dirty_tlb { | |
| 1918 | + struct kvm_dirty_tlb { | |
| 1736 | 1919 | __u64 bitmap; |
| 1737 | 1920 | __u32 num_dirty; |
| 1738 | −}; | |
| 1921 | + }; | |
| 1739 | 1922 | |
| 1740 | 1923 | This must be called whenever userspace has changed an entry in the shared |
| 1741 | 1924 | TLB, prior to calling KVM_RUN on the associated vcpu. |
| @@ -1758,23 +1941,26 @@ be set to the number of set bits in the bitmap. · 16 unmodified lines | ||
| 1758 | 1941 | |
| 1759 | 1942 | |
| 1760 | 1943 | 4.62 KVM_CREATE_SPAPR_TCE |
| 1944 | +------------------------- | |
| 1761 | 1945 | |
| 1762 | −Capability: KVM_CAP_SPAPR_TCE | |
| 1763 | −Architectures: powerpc | |
| 1764 | −Type: vm ioctl | |
| 1765 | −Parameters: struct kvm_create_spapr_tce (in) | |
| 1766 | −Returns: file descriptor for manipulating the created TCE table | |
| 1946 | +:Capability: KVM_CAP_SPAPR_TCE | |
| 1947 | +:Architectures: powerpc | |
| 1948 | +:Type: vm ioctl | |
| 1949 | +:Parameters: struct kvm_create_spapr_tce (in) | |
| 1950 | +:Returns: file descriptor for manipulating the created TCE table | |
| 1767 | 1951 | |
| 1768 | 1952 | This creates a virtual TCE (translation control entry) table, which |
| 1769 | 1953 | is an IOMMU for PAPR-style virtual I/O. It is used to translate |
| 1770 | 1954 | logical addresses used in virtual I/O into guest physical addresses, |
| 1771 | 1955 | and provides a scatter/gather capability for PAPR virtual I/O. |
| 1772 | 1956 | |
| 1773 | −/* for KVM_CAP_SPAPR_TCE */ | |
| 1774 | −struct kvm_create_spapr_tce { | |
| 1957 | +:: | |
| 1958 | + | |
| 1959 | + /* for KVM_CAP_SPAPR_TCE */ | |
| 1960 | + struct kvm_create_spapr_tce { | |
| 1775 | 1961 | __u64 liobn; |
| 1776 | 1962 | __u32 window_size; |
| 1777 | −}; | |
| 1963 | + }; | |
| 1778 | 1964 | |
| 1779 | 1965 | The liobn field gives the logical IO bus number for which to create a |
| 1780 | 1966 | TCE table. The window_size field specifies the size of the DMA window |
| @@ -1794,12 +1980,13 @@ circumstances. · 13 unmodified lines | ||
| 1794 | 1980 | |
| 1795 | 1981 | |
| 1796 | 1982 | 4.63 KVM_ALLOCATE_RMA |
| 1983 | +--------------------- | |
| 1797 | 1984 | |
| 1798 | −Capability: KVM_CAP_PPC_RMA | |
| 1799 | −Architectures: powerpc | |
| 1800 | −Type: vm ioctl | |
| 1801 | −Parameters: struct kvm_allocate_rma (out) | |
| 1802 | −Returns: file descriptor for mapping the allocated RMA | |
| 1985 | +:Capability: KVM_CAP_PPC_RMA | |
| 1986 | +:Architectures: powerpc | |
| 1987 | +:Type: vm ioctl | |
| 1988 | +:Parameters: struct kvm_allocate_rma (out) | |
| 1989 | +:Returns: file descriptor for mapping the allocated RMA | |
| 1803 | 1990 | |
| 1804 | 1991 | This allocates a Real Mode Area (RMA) from the pool allocated at boot |
| 1805 | 1992 | time by the kernel. An RMA is a physically-contiguous, aligned region |
| @@ -1808,10 +1995,12 @@ will be accessed by real-mode (MMU off) accesses in a KVM guest. · 2 unmodified lines | ||
| 1808 | 1995 | POWER processors support a set of sizes for the RMA that usually |
| 1809 | 1996 | includes 64MB, 128MB, 256MB and some larger powers of two. |
| 1810 | 1997 | |
| 1811 | −/* for KVM_ALLOCATE_RMA */ | |
| 1812 | −struct kvm_allocate_rma { | |
| 1998 | +:: | |
| 1999 | + | |
| 2000 | + /* for KVM_ALLOCATE_RMA */ | |
| 2001 | + struct kvm_allocate_rma { | |
| 1813 | 2002 | __u64 rma_size; |
| 1814 | −}; | |
| 2003 | + }; | |
| 1815 | 2004 | |
| 1816 | 2005 | The return value is a file descriptor which can be passed to mmap(2) |
| 1817 | 2006 | to map the allocated RMA into userspace. The mapped area can then be |
| @@ -1827,12 +2016,13 @@ because it supports the Virtual RMA (VRMA) facility. · 9 unmodified lines | ||
| 1827 | 2016 | |
| 1828 | 2017 | |
| 1829 | 2018 | 4.64 KVM_NMI |
| 2019 | +------------ | |
| 1830 | 2020 | |
| 1831 | −Capability: KVM_CAP_USER_NMI | |
| 1832 | −Architectures: x86 | |
| 1833 | −Type: vcpu ioctl | |
| 1834 | −Parameters: none | |
| 1835 | −Returns: 0 on success, -1 on error | |
| 2021 | +:Capability: KVM_CAP_USER_NMI | |
| 2022 | +:Architectures: x86 | |
| 2023 | +:Type: vcpu ioctl | |
| 2024 | +:Parameters: none | |
| 2025 | +:Returns: 0 on success, -1 on error | |
| 1836 | 2026 | |
| 1837 | 2027 | Queues an NMI on the thread's vcpu. Note this is well defined only |
| 1838 | 2028 | when KVM_CREATE_IRQCHIP has not been called, since this is an interface |
| @@ -1853,14 +2043,16 @@ debugging. · 14 unmodified lines | ||
| 1853 | 2043 | |
| 1854 | 2044 | |
| 1855 | 2045 | 4.65 KVM_S390_UCAS_MAP |
| 2046 | +---------------------- | |
| 1856 | 2047 | |
| 1857 | −Capability: KVM_CAP_S390_UCONTROL | |
| 1858 | −Architectures: s390 | |
| 1859 | −Type: vcpu ioctl | |
| 1860 | −Parameters: struct kvm_s390_ucas_mapping (in) | |
| 1861 | −Returns: 0 in case of success | |
| 2048 | +:Capability: KVM_CAP_S390_UCONTROL | |
| 2049 | +:Architectures: s390 | |
| 2050 | +:Type: vcpu ioctl | |
| 2051 | +:Parameters: struct kvm_s390_ucas_mapping (in) | |
| 2052 | +:Returns: 0 in case of success | |
| 2053 | + | |
| 2054 | +The parameter is defined like this:: | |
| 1862 | 2055 | |
| 1863 | −The parameter is defined like this: | |
| 1864 | 2056 | struct kvm_s390_ucas_mapping { |
| 1865 | 2057 | __u64 user_addr; |
| 1866 | 2058 | __u64 vcpu_addr; |
| @@ -1873,14 +2065,16 @@ be aligned by 1 megabyte. · 6 unmodified lines | ||
| 1873 | 2065 | |
| 1874 | 2066 | |
| 1875 | 2067 | 4.66 KVM_S390_UCAS_UNMAP |
| 2068 | +------------------------ | |
| 1876 | 2069 | |
| 1877 | −Capability: KVM_CAP_S390_UCONTROL | |
| 1878 | −Architectures: s390 | |
| 1879 | −Type: vcpu ioctl | |
| 1880 | −Parameters: struct kvm_s390_ucas_mapping (in) | |
| 1881 | −Returns: 0 in case of success | |
| 2070 | +:Capability: KVM_CAP_S390_UCONTROL | |
| 2071 | +:Architectures: s390 | |
| 2072 | +:Type: vcpu ioctl | |
| 2073 | +:Parameters: struct kvm_s390_ucas_mapping (in) | |
| 2074 | +:Returns: 0 in case of success | |
| 2075 | + | |
| 2076 | +The parameter is defined like this:: | |
| 1882 | 2077 | |
| 1883 | −The parameter is defined like this: | |
| 1884 | 2078 | struct kvm_s390_ucas_mapping { |
| 1885 | 2079 | __u64 user_addr; |
| 1886 | 2080 | __u64 vcpu_addr; |
| @@ -1893,12 +2087,13 @@ All parameters need to be aligned by 1 megabyte. · 6 unmodified lines | ||
| 1893 | 2087 | |
| 1894 | 2088 | |
| 1895 | 2089 | 4.67 KVM_S390_VCPU_FAULT |
| 2090 | +------------------------ | |
| 1896 | 2091 | |
| 1897 | −Capability: KVM_CAP_S390_UCONTROL | |
| 1898 | −Architectures: s390 | |
| 1899 | −Type: vcpu ioctl | |
| 1900 | −Parameters: vcpu absolute address (in) | |
| 1901 | −Returns: 0 in case of success | |
| 2092 | +:Capability: KVM_CAP_S390_UCONTROL | |
| 2093 | +:Architectures: s390 | |
| 2094 | +:Type: vcpu ioctl | |
| 2095 | +:Parameters: vcpu absolute address (in) | |
| 2096 | +:Returns: 0 in case of success | |
| 1902 | 2097 | |
| 1903 | 2098 | This call creates a page table entry on the virtual cpu's address space |
| 1904 | 2099 | (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 | |
| 1912 | 2107 | 4.68 KVM_SET_ONE_REG |
| 2108 | +-------------------- | |
| 2109 | + | |
| 2110 | +:Capability: KVM_CAP_ONE_REG | |
| 2111 | +:Architectures: all | |
| 2112 | +:Type: vcpu ioctl | |
| 2113 | +:Parameters: struct kvm_one_reg (in) | |
| 2114 | +:Returns: 0 on success, negative value on failure | |
| 1913 | 2115 | |
| 1914 | −Capability: KVM_CAP_ONE_REG | |
| 1915 | −Architectures: all | |
| 1916 | −Type: vcpu ioctl | |
| 1917 | −Parameters: struct kvm_one_reg (in) | |
| 1918 | −Returns: 0 on success, negative value on failure | |
| 1919 | 2116 | Errors: |
| 1920 | − ENOENT: no such register | |
| 1921 | − EINVAL: invalid register ID, or no such register | |
| 1922 | − EPERM: (arm64) register access not allowed before vcpu finalization | |
| 2117 | + | |
| 2118 | + ====== ============================================================ | |
| 2119 | + ENOENT no such register | |
| 2120 | + EINVAL invalid register ID, or no such register | |
| 2121 | + EPERM (arm64) register access not allowed before vcpu finalization | |
| 2122 | + ====== ============================================================ | |
| 2123 | + | |
| 1923 | 2124 | (These error codes are indicative only: do not rely on a specific error |
| 1924 | 2125 | code being returned in a specific situation.) |
| 1925 | 2126 | |
| 1926 | −struct kvm_one_reg { | |
| 2127 | +:: | |
| 2128 | + | |
| 2129 | + struct kvm_one_reg { | |
| 1927 | 2130 | __u64 id; |
| 1928 | 2131 | __u64 addr; |
| 1929 | −}; | |
| 2132 | + }; | |
| 1930 | 2133 | |
| 1931 | 2134 | Using this ioctl, a single vcpu register can be set to a specific value |
| 1932 | 2135 | defined by user space with the passed in struct kvm_one_reg, where id |
| @@ -1936,217 +2139,226 @@ and architecture specific registers. Each have their own range of operation · 3 unmodified lines | ||
| 1936 | 2139 | and their own constants and width. To keep track of the implemented |
| 1937 | 2140 | registers, find a list below: |
| 1938 | 2141 | |
| 1939 | − Arch | Register | Width (bits) | |
| 1940 | − | | | |
| 1941 | − PPC | KVM_REG_PPC_HIOR | 64 | |
| 1942 | − PPC | KVM_REG_PPC_IAC1 | 64 | |
| 1943 | − PPC | KVM_REG_PPC_IAC2 | 64 | |
| 1944 | − PPC | KVM_REG_PPC_IAC3 | 64 | |
| 1945 | − PPC | KVM_REG_PPC_IAC4 | 64 | |
| 1946 | − PPC | KVM_REG_PPC_DAC1 | 64 | |
| 1947 | − PPC | KVM_REG_PPC_DAC2 | 64 | |
| 1948 | − PPC | KVM_REG_PPC_DABR | 64 | |
| 1949 | − PPC | KVM_REG_PPC_DSCR | 64 | |
| 1950 | − PPC | KVM_REG_PPC_PURR | 64 | |
| 1951 | − PPC | KVM_REG_PPC_SPURR | 64 | |
| 1952 | − PPC | KVM_REG_PPC_DAR | 64 | |
| 1953 | − PPC | KVM_REG_PPC_DSISR | 32 | |
| 1954 | − PPC | KVM_REG_PPC_AMR | 64 | |
| 1955 | − PPC | KVM_REG_PPC_UAMOR | 64 | |
| 1956 | − PPC | KVM_REG_PPC_MMCR0 | 64 | |
| 1957 | − PPC | KVM_REG_PPC_MMCR1 | 64 | |
| 1958 | − PPC | KVM_REG_PPC_MMCRA | 64 | |
| 1959 | − PPC | KVM_REG_PPC_MMCR2 | 64 | |
| 1960 | − PPC | KVM_REG_PPC_MMCRS | 64 | |
| 1961 | − PPC | KVM_REG_PPC_SIAR | 64 | |
| 1962 | − PPC | KVM_REG_PPC_SDAR | 64 | |
| 1963 | − PPC | KVM_REG_PPC_SIER | 64 | |
| 1964 | − PPC | KVM_REG_PPC_PMC1 | 32 | |
| 1965 | − PPC | KVM_REG_PPC_PMC2 | 32 | |
| 1966 | − PPC | KVM_REG_PPC_PMC3 | 32 | |
| 1967 | − PPC | KVM_REG_PPC_PMC4 | 32 | |
| 1968 | − PPC | KVM_REG_PPC_PMC5 | 32 | |
| 1969 | − PPC | KVM_REG_PPC_PMC6 | 32 | |
| 1970 | − PPC | KVM_REG_PPC_PMC7 | 32 | |
| 1971 | − PPC | KVM_REG_PPC_PMC8 | 32 | |
| 1972 | − PPC | KVM_REG_PPC_FPR0 | 64 | |
| 1973 | − ... | |
| 1974 | − PPC | KVM_REG_PPC_FPR31 | 64 | |
| 1975 | − PPC | KVM_REG_PPC_VR0 | 128 | |
| 1976 | − ... | |
| 1977 | − PPC | KVM_REG_PPC_VR31 | 128 | |
| 1978 | − PPC | KVM_REG_PPC_VSR0 | 128 | |
| 1979 | − ... | |
| 1980 | − PPC | KVM_REG_PPC_VSR31 | 128 | |
| 1981 | − PPC | KVM_REG_PPC_FPSCR | 64 | |
| 1982 | − PPC | KVM_REG_PPC_VSCR | 32 | |
| 1983 | − PPC | KVM_REG_PPC_VPA_ADDR | 64 | |
| 1984 | − PPC | KVM_REG_PPC_VPA_SLB | 128 | |
| 1985 | − PPC | KVM_REG_PPC_VPA_DTL | 128 | |
| 1986 | − PPC | KVM_REG_PPC_EPCR | 32 | |
| 1987 | − PPC | KVM_REG_PPC_EPR | 32 | |
| 1988 | − PPC | KVM_REG_PPC_TCR | 32 | |
| 1989 | − PPC | KVM_REG_PPC_TSR | 32 | |
| 1990 | − PPC | KVM_REG_PPC_OR_TSR | 32 | |
| 1991 | − PPC | KVM_REG_PPC_CLEAR_TSR | 32 | |
| 1992 | − PPC | KVM_REG_PPC_MAS0 | 32 | |
| 1993 | − PPC | KVM_REG_PPC_MAS1 | 32 | |
| 1994 | − PPC | KVM_REG_PPC_MAS2 | 64 | |
| 1995 | − PPC | KVM_REG_PPC_MAS7_3 | 64 | |
| 1996 | − PPC | KVM_REG_PPC_MAS4 | 32 | |
| 1997 | − PPC | KVM_REG_PPC_MAS6 | 32 | |
| 1998 | − PPC | KVM_REG_PPC_MMUCFG | 32 | |
| 1999 | − PPC | KVM_REG_PPC_TLB0CFG | 32 | |
| 2000 | − PPC | KVM_REG_PPC_TLB1CFG | 32 | |
| 2001 | − PPC | KVM_REG_PPC_TLB2CFG | 32 | |
| 2002 | − PPC | KVM_REG_PPC_TLB3CFG | 32 | |
| 2003 | − PPC | KVM_REG_PPC_TLB0PS | 32 | |
| 2004 | − PPC | KVM_REG_PPC_TLB1PS | 32 | |
| 2005 | − PPC | KVM_REG_PPC_TLB2PS | 32 | |
| 2006 | − PPC | KVM_REG_PPC_TLB3PS | 32 | |
| 2007 | − PPC | KVM_REG_PPC_EPTCFG | 32 | |
| 2008 | − PPC | KVM_REG_PPC_ICP_STATE | 64 | |
| 2009 | − PPC | KVM_REG_PPC_VP_STATE | 128 | |
| 2010 | − PPC | KVM_REG_PPC_TB_OFFSET | 64 | |
| 2011 | − PPC | KVM_REG_PPC_SPMC1 | 32 | |
| 2012 | − PPC | KVM_REG_PPC_SPMC2 | 32 | |
| 2013 | − PPC | KVM_REG_PPC_IAMR | 64 | |
| 2014 | − PPC | KVM_REG_PPC_TFHAR | 64 | |
| 2015 | − PPC | KVM_REG_PPC_TFIAR | 64 | |
| 2016 | − PPC | KVM_REG_PPC_TEXASR | 64 | |
| 2017 | − PPC | KVM_REG_PPC_FSCR | 64 | |
| 2018 | − PPC | KVM_REG_PPC_PSPB | 32 | |
| 2019 | − PPC | KVM_REG_PPC_EBBHR | 64 | |
| 2020 | − PPC | KVM_REG_PPC_EBBRR | 64 | |
| 2021 | − PPC | KVM_REG_PPC_BESCR | 64 | |
| 2022 | − PPC | KVM_REG_PPC_TAR | 64 | |
| 2023 | − PPC | KVM_REG_PPC_DPDES | 64 | |
| 2024 | − PPC | KVM_REG_PPC_DAWR | 64 | |
| 2025 | − PPC | KVM_REG_PPC_DAWRX | 64 | |
| 2026 | − PPC | KVM_REG_PPC_CIABR | 64 | |
| 2027 | − PPC | KVM_REG_PPC_IC | 64 | |
| 2028 | − PPC | KVM_REG_PPC_VTB | 64 | |
| 2029 | − PPC | KVM_REG_PPC_CSIGR | 64 | |
| 2030 | − PPC | KVM_REG_PPC_TACR | 64 | |
| 2031 | − PPC | KVM_REG_PPC_TCSCR | 64 | |
| 2032 | − PPC | KVM_REG_PPC_PID | 64 | |
| 2033 | − PPC | KVM_REG_PPC_ACOP | 64 | |
| 2034 | − PPC | KVM_REG_PPC_VRSAVE | 32 | |
| 2035 | − PPC | KVM_REG_PPC_LPCR | 32 | |
| 2036 | − PPC | KVM_REG_PPC_LPCR_64 | 64 | |
| 2037 | − PPC | KVM_REG_PPC_PPR | 64 | |
| 2038 | − PPC | KVM_REG_PPC_ARCH_COMPAT | 32 | |
| 2039 | − PPC | KVM_REG_PPC_DABRX | 32 | |
| 2040 | − PPC | KVM_REG_PPC_WORT | 64 | |
| 2041 | − PPC | KVM_REG_PPC_SPRG9 | 64 | |
| 2042 | − PPC | KVM_REG_PPC_DBSR | 32 | |
| 2043 | − PPC | KVM_REG_PPC_TIDR | 64 | |
| 2044 | − PPC | KVM_REG_PPC_PSSCR | 64 | |
| 2045 | − PPC | KVM_REG_PPC_DEC_EXPIRY | 64 | |
| 2046 | − PPC | KVM_REG_PPC_PTCR | 64 | |
| 2047 | − PPC | KVM_REG_PPC_TM_GPR0 | 64 | |
| 2048 | − ... | |
| 2049 | − PPC | KVM_REG_PPC_TM_GPR31 | 64 | |
| 2050 | − PPC | KVM_REG_PPC_TM_VSR0 | 128 | |
| 2051 | − ... | |
| 2052 | − PPC | KVM_REG_PPC_TM_VSR63 | 128 | |
| 2053 | − PPC | KVM_REG_PPC_TM_CR | 64 | |
| 2054 | − PPC | KVM_REG_PPC_TM_LR | 64 | |
| 2055 | − PPC | KVM_REG_PPC_TM_CTR | 64 | |
| 2056 | − PPC | KVM_REG_PPC_TM_FPSCR | 64 | |
| 2057 | − PPC | KVM_REG_PPC_TM_AMR | 64 | |
| 2058 | − PPC | KVM_REG_PPC_TM_PPR | 64 | |
| 2059 | − PPC | KVM_REG_PPC_TM_VRSAVE | 64 | |
| 2060 | − PPC | KVM_REG_PPC_TM_VSCR | 32 | |
| 2061 | − PPC | KVM_REG_PPC_TM_DSCR | 64 | |
| 2062 | − PPC | KVM_REG_PPC_TM_TAR | 64 | |
| 2063 | − PPC | KVM_REG_PPC_TM_XER | 64 | |
| 2064 | − | | | |
| 2065 | − MIPS | KVM_REG_MIPS_R0 | 64 | |
| 2066 | − ... | |
| 2067 | − MIPS | KVM_REG_MIPS_R31 | 64 | |
| 2068 | − MIPS | KVM_REG_MIPS_HI | 64 | |
| 2069 | − MIPS | KVM_REG_MIPS_LO | 64 | |
| 2070 | − MIPS | KVM_REG_MIPS_PC | 64 | |
| 2071 | − MIPS | KVM_REG_MIPS_CP0_INDEX | 32 | |
| 2072 | − MIPS | KVM_REG_MIPS_CP0_ENTRYLO0 | 64 | |
| 2073 | − MIPS | KVM_REG_MIPS_CP0_ENTRYLO1 | 64 | |
| 2074 | − MIPS | KVM_REG_MIPS_CP0_CONTEXT | 64 | |
| 2075 | − MIPS | KVM_REG_MIPS_CP0_CONTEXTCONFIG| 32 | |
| 2076 | − MIPS | KVM_REG_MIPS_CP0_USERLOCAL | 64 | |
| 2077 | − MIPS | KVM_REG_MIPS_CP0_XCONTEXTCONFIG| 64 | |
| 2078 | − MIPS | KVM_REG_MIPS_CP0_PAGEMASK | 32 | |
| 2079 | − MIPS | KVM_REG_MIPS_CP0_PAGEGRAIN | 32 | |
| 2080 | − MIPS | KVM_REG_MIPS_CP0_SEGCTL0 | 64 | |
| 2081 | − MIPS | KVM_REG_MIPS_CP0_SEGCTL1 | 64 | |
| 2082 | − MIPS | KVM_REG_MIPS_CP0_SEGCTL2 | 64 | |
| 2083 | − MIPS | KVM_REG_MIPS_CP0_PWBASE | 64 | |
| 2084 | − MIPS | KVM_REG_MIPS_CP0_PWFIELD | 64 | |
| 2085 | − MIPS | KVM_REG_MIPS_CP0_PWSIZE | 64 | |
| 2086 | − MIPS | KVM_REG_MIPS_CP0_WIRED | 32 | |
| 2087 | − MIPS | KVM_REG_MIPS_CP0_PWCTL | 32 | |
| 2088 | − MIPS | KVM_REG_MIPS_CP0_HWRENA | 32 | |
| 2089 | − MIPS | KVM_REG_MIPS_CP0_BADVADDR | 64 | |
| 2090 | − MIPS | KVM_REG_MIPS_CP0_BADINSTR | 32 | |
| 2091 | − MIPS | KVM_REG_MIPS_CP0_BADINSTRP | 32 | |
| 2092 | − MIPS | KVM_REG_MIPS_CP0_COUNT | 32 | |
| 2093 | − MIPS | KVM_REG_MIPS_CP0_ENTRYHI | 64 | |
| 2094 | − MIPS | KVM_REG_MIPS_CP0_COMPARE | 32 | |
| 2095 | − MIPS | KVM_REG_MIPS_CP0_STATUS | 32 | |
| 2096 | − MIPS | KVM_REG_MIPS_CP0_INTCTL | 32 | |
| 2097 | − MIPS | KVM_REG_MIPS_CP0_CAUSE | 32 | |
| 2098 | − MIPS | KVM_REG_MIPS_CP0_EPC | 64 | |
| 2099 | − MIPS | KVM_REG_MIPS_CP0_PRID | 32 | |
| 2100 | − MIPS | KVM_REG_MIPS_CP0_EBASE | 64 | |
| 2101 | − MIPS | KVM_REG_MIPS_CP0_CONFIG | 32 | |
| 2102 | − MIPS | KVM_REG_MIPS_CP0_CONFIG1 | 32 | |
| 2103 | − MIPS | KVM_REG_MIPS_CP0_CONFIG2 | 32 | |
| 2104 | − MIPS | KVM_REG_MIPS_CP0_CONFIG3 | 32 | |
| 2105 | − MIPS | KVM_REG_MIPS_CP0_CONFIG4 | 32 | |
| 2106 | − MIPS | KVM_REG_MIPS_CP0_CONFIG5 | 32 | |
| 2107 | − MIPS | KVM_REG_MIPS_CP0_CONFIG7 | 32 | |
| 2108 | − MIPS | KVM_REG_MIPS_CP0_XCONTEXT | 64 | |
| 2109 | − MIPS | KVM_REG_MIPS_CP0_ERROREPC | 64 | |
| 2110 | − MIPS | KVM_REG_MIPS_CP0_KSCRATCH1 | 64 | |
| 2111 | − MIPS | KVM_REG_MIPS_CP0_KSCRATCH2 | 64 | |
| 2112 | − MIPS | KVM_REG_MIPS_CP0_KSCRATCH3 | 64 | |
| 2113 | − MIPS | KVM_REG_MIPS_CP0_KSCRATCH4 | 64 | |
| 2114 | − MIPS | KVM_REG_MIPS_CP0_KSCRATCH5 | 64 | |
| 2115 | − MIPS | KVM_REG_MIPS_CP0_KSCRATCH6 | 64 | |
| 2116 | − MIPS | KVM_REG_MIPS_CP0_MAAR(0..63) | 64 | |
| 2117 | − MIPS | KVM_REG_MIPS_COUNT_CTL | 64 | |
| 2118 | − MIPS | KVM_REG_MIPS_COUNT_RESUME | 64 | |
| 2119 | − MIPS | KVM_REG_MIPS_COUNT_HZ | 64 | |
| 2120 | − MIPS | KVM_REG_MIPS_FPR_32(0..31) | 32 | |
| 2121 | − MIPS | KVM_REG_MIPS_FPR_64(0..31) | 64 | |
| 2122 | − MIPS | KVM_REG_MIPS_VEC_128(0..31) | 128 | |
| 2123 | − MIPS | KVM_REG_MIPS_FCR_IR | 32 | |
| 2124 | − MIPS | KVM_REG_MIPS_FCR_CSR | 32 | |
| 2125 | − MIPS | KVM_REG_MIPS_MSA_IR | 32 | |
| 2126 | − MIPS | KVM_REG_MIPS_MSA_CSR | 32 | |
| 2142 | + ======= =============================== ============ | |
| 2143 | + Arch Register Width (bits) | |
| 2144 | + ======= =============================== ============ | |
| 2145 | + PPC KVM_REG_PPC_HIOR 64 | |
| 2146 | + PPC KVM_REG_PPC_IAC1 64 | |
| 2147 | + PPC KVM_REG_PPC_IAC2 64 | |
| 2148 | + PPC KVM_REG_PPC_IAC3 64 | |
| 2149 | + PPC KVM_REG_PPC_IAC4 64 | |
| 2150 | + PPC KVM_REG_PPC_DAC1 64 | |
| 2151 | + PPC KVM_REG_PPC_DAC2 64 | |
| 2152 | + PPC KVM_REG_PPC_DABR 64 | |
| 2153 | + PPC KVM_REG_PPC_DSCR 64 | |
| 2154 | + PPC KVM_REG_PPC_PURR 64 | |
| 2155 | + PPC KVM_REG_PPC_SPURR 64 | |
| 2156 | + PPC KVM_REG_PPC_DAR 64 | |
| 2157 | + PPC KVM_REG_PPC_DSISR 32 | |
| 2158 | + PPC KVM_REG_PPC_AMR 64 | |
| 2159 | + PPC KVM_REG_PPC_UAMOR 64 | |
| 2160 | + PPC KVM_REG_PPC_MMCR0 64 | |
| 2161 | + PPC KVM_REG_PPC_MMCR1 64 | |
| 2162 | + PPC KVM_REG_PPC_MMCRA 64 | |
| 2163 | + PPC KVM_REG_PPC_MMCR2 64 | |
| 2164 | + PPC KVM_REG_PPC_MMCRS 64 | |
| 2165 | + PPC KVM_REG_PPC_SIAR 64 | |
| 2166 | + PPC KVM_REG_PPC_SDAR 64 | |
| 2167 | + PPC KVM_REG_PPC_SIER 64 | |
| 2168 | + PPC KVM_REG_PPC_PMC1 32 | |
| 2169 | + PPC KVM_REG_PPC_PMC2 32 | |
| 2170 | + PPC KVM_REG_PPC_PMC3 32 | |
| 2171 | + PPC KVM_REG_PPC_PMC4 32 | |
| 2172 | + PPC KVM_REG_PPC_PMC5 32 | |
| 2173 | + PPC KVM_REG_PPC_PMC6 32 | |
| 2174 | + PPC KVM_REG_PPC_PMC7 32 | |
| 2175 | + PPC KVM_REG_PPC_PMC8 32 | |
| 2176 | + PPC KVM_REG_PPC_FPR0 64 | |
| 2177 | + ... | |
| 2178 | + PPC KVM_REG_PPC_FPR31 64 | |
| 2179 | + PPC KVM_REG_PPC_VR0 128 | |
| 2180 | + ... | |
| 2181 | + PPC KVM_REG_PPC_VR31 128 | |
| 2182 | + PPC KVM_REG_PPC_VSR0 128 | |
| 2183 | + ... | |
| 2184 | + PPC KVM_REG_PPC_VSR31 128 | |
| 2185 | + PPC KVM_REG_PPC_FPSCR 64 | |
| 2186 | + PPC KVM_REG_PPC_VSCR 32 | |
| 2187 | + PPC KVM_REG_PPC_VPA_ADDR 64 | |
| 2188 | + PPC KVM_REG_PPC_VPA_SLB 128 | |
| 2189 | + PPC KVM_REG_PPC_VPA_DTL 128 | |
| 2190 | + PPC KVM_REG_PPC_EPCR 32 | |
| 2191 | + PPC KVM_REG_PPC_EPR 32 | |
| 2192 | + PPC KVM_REG_PPC_TCR 32 | |
| 2193 | + PPC KVM_REG_PPC_TSR 32 | |
| 2194 | + PPC KVM_REG_PPC_OR_TSR 32 | |
| 2195 | + PPC KVM_REG_PPC_CLEAR_TSR 32 | |
| 2196 | + PPC KVM_REG_PPC_MAS0 32 | |
| 2197 | + PPC KVM_REG_PPC_MAS1 32 | |
| 2198 | + PPC KVM_REG_PPC_MAS2 64 | |
| 2199 | + PPC KVM_REG_PPC_MAS7_3 64 | |
| 2200 | + PPC KVM_REG_PPC_MAS4 32 | |
| 2201 | + PPC KVM_REG_PPC_MAS6 32 | |
| 2202 | + PPC KVM_REG_PPC_MMUCFG 32 | |
| 2203 | + PPC KVM_REG_PPC_TLB0CFG 32 | |
| 2204 | + PPC KVM_REG_PPC_TLB1CFG 32 | |
| 2205 | + PPC KVM_REG_PPC_TLB2CFG 32 | |
| 2206 | + PPC KVM_REG_PPC_TLB3CFG 32 | |
| 2207 | + PPC KVM_REG_PPC_TLB0PS 32 | |
| 2208 | + PPC KVM_REG_PPC_TLB1PS 32 | |
| 2209 | + PPC KVM_REG_PPC_TLB2PS 32 | |
| 2210 | + PPC KVM_REG_PPC_TLB3PS 32 | |
| 2211 | + PPC KVM_REG_PPC_EPTCFG 32 | |
| 2212 | + PPC KVM_REG_PPC_ICP_STATE 64 | |
| 2213 | + PPC KVM_REG_PPC_VP_STATE 128 | |
| 2214 | + PPC KVM_REG_PPC_TB_OFFSET 64 | |
| 2215 | + PPC KVM_REG_PPC_SPMC1 32 | |
| 2216 | + PPC KVM_REG_PPC_SPMC2 32 | |
| 2217 | + PPC KVM_REG_PPC_IAMR 64 | |
| 2218 | + PPC KVM_REG_PPC_TFHAR 64 | |
| 2219 | + PPC KVM_REG_PPC_TFIAR 64 | |
| 2220 | + PPC KVM_REG_PPC_TEXASR 64 | |
| 2221 | + PPC KVM_REG_PPC_FSCR 64 | |
| 2222 | + PPC KVM_REG_PPC_PSPB 32 | |
| 2223 | + PPC KVM_REG_PPC_EBBHR 64 | |
| 2224 | + PPC KVM_REG_PPC_EBBRR 64 | |
| 2225 | + PPC KVM_REG_PPC_BESCR 64 | |
| 2226 | + PPC KVM_REG_PPC_TAR 64 | |
| 2227 | + PPC KVM_REG_PPC_DPDES 64 | |
| 2228 | + PPC KVM_REG_PPC_DAWR 64 | |
| 2229 | + PPC KVM_REG_PPC_DAWRX 64 | |
| 2230 | + PPC KVM_REG_PPC_CIABR 64 | |
| 2231 | + PPC KVM_REG_PPC_IC 64 | |
| 2232 | + PPC KVM_REG_PPC_VTB 64 | |
| 2233 | + PPC KVM_REG_PPC_CSIGR 64 | |
| 2234 | + PPC KVM_REG_PPC_TACR 64 | |
| 2235 | + PPC KVM_REG_PPC_TCSCR 64 | |
| 2236 | + PPC KVM_REG_PPC_PID 64 | |
| 2237 | + PPC KVM_REG_PPC_ACOP 64 | |
| 2238 | + PPC KVM_REG_PPC_VRSAVE 32 | |
| 2239 | + PPC KVM_REG_PPC_LPCR 32 | |
| 2240 | + PPC KVM_REG_PPC_LPCR_64 64 | |
| 2241 | + PPC KVM_REG_PPC_PPR 64 | |
| 2242 | + PPC KVM_REG_PPC_ARCH_COMPAT 32 | |
| 2243 | + PPC KVM_REG_PPC_DABRX 32 | |
| 2244 | + PPC KVM_REG_PPC_WORT 64 | |
| 2245 | + PPC KVM_REG_PPC_SPRG9 64 | |
| 2246 | + PPC KVM_REG_PPC_DBSR 32 | |
| 2247 | + PPC KVM_REG_PPC_TIDR 64 | |
| 2248 | + PPC KVM_REG_PPC_PSSCR 64 | |
| 2249 | + PPC KVM_REG_PPC_DEC_EXPIRY 64 | |
| 2250 | + PPC KVM_REG_PPC_PTCR 64 | |
| 2251 | + PPC KVM_REG_PPC_TM_GPR0 64 | |
| 2252 | + ... | |
| 2253 | + PPC KVM_REG_PPC_TM_GPR31 64 | |
| 2254 | + PPC KVM_REG_PPC_TM_VSR0 128 | |
| 2255 | + ... | |
| 2256 | + PPC KVM_REG_PPC_TM_VSR63 128 | |
| 2257 | + PPC KVM_REG_PPC_TM_CR 64 | |
| 2258 | + PPC KVM_REG_PPC_TM_LR 64 | |
| 2259 | + PPC KVM_REG_PPC_TM_CTR 64 | |
| 2260 | + PPC KVM_REG_PPC_TM_FPSCR 64 | |
| 2261 | + PPC KVM_REG_PPC_TM_AMR 64 | |
| 2262 | + PPC KVM_REG_PPC_TM_PPR 64 | |
| 2263 | + PPC KVM_REG_PPC_TM_VRSAVE 64 | |
| 2264 | + PPC KVM_REG_PPC_TM_VSCR 32 | |
| 2265 | + PPC KVM_REG_PPC_TM_DSCR 64 | |
| 2266 | + PPC KVM_REG_PPC_TM_TAR 64 | |
| 2267 | + PPC KVM_REG_PPC_TM_XER 64 | |
| 2268 | + | |
| 2269 | + MIPS KVM_REG_MIPS_R0 64 | |
| 2270 | + ... | |
| 2271 | + MIPS KVM_REG_MIPS_R31 64 | |
| 2272 | + MIPS KVM_REG_MIPS_HI 64 | |
| 2273 | + MIPS KVM_REG_MIPS_LO 64 | |
| 2274 | + MIPS KVM_REG_MIPS_PC 64 | |
| 2275 | + MIPS KVM_REG_MIPS_CP0_INDEX 32 | |
| 2276 | + MIPS KVM_REG_MIPS_CP0_ENTRYLO0 64 | |
| 2277 | + MIPS KVM_REG_MIPS_CP0_ENTRYLO1 64 | |
| 2278 | + MIPS KVM_REG_MIPS_CP0_CONTEXT 64 | |
| 2279 | + MIPS KVM_REG_MIPS_CP0_CONTEXTCONFIG 32 | |
| 2280 | + MIPS KVM_REG_MIPS_CP0_USERLOCAL 64 | |
| 2281 | + MIPS KVM_REG_MIPS_CP0_XCONTEXTCONFIG 64 | |
| 2282 | + MIPS KVM_REG_MIPS_CP0_PAGEMASK 32 | |
| 2283 | + MIPS KVM_REG_MIPS_CP0_PAGEGRAIN 32 | |
| 2284 | + MIPS KVM_REG_MIPS_CP0_SEGCTL0 64 | |
| 2285 | + MIPS KVM_REG_MIPS_CP0_SEGCTL1 64 | |
| 2286 | + MIPS KVM_REG_MIPS_CP0_SEGCTL2 64 | |
| 2287 | + MIPS KVM_REG_MIPS_CP0_PWBASE 64 | |
| 2288 | + MIPS KVM_REG_MIPS_CP0_PWFIELD 64 | |
| 2289 | + MIPS KVM_REG_MIPS_CP0_PWSIZE 64 | |
| 2290 | + MIPS KVM_REG_MIPS_CP0_WIRED 32 | |
| 2291 | + MIPS KVM_REG_MIPS_CP0_PWCTL 32 | |
| 2292 | + MIPS KVM_REG_MIPS_CP0_HWRENA 32 | |
| 2293 | + MIPS KVM_REG_MIPS_CP0_BADVADDR 64 | |
| 2294 | + MIPS KVM_REG_MIPS_CP0_BADINSTR 32 | |
| 2295 | + MIPS KVM_REG_MIPS_CP0_BADINSTRP 32 | |
| 2296 | + MIPS KVM_REG_MIPS_CP0_COUNT 32 | |
| 2297 | + MIPS KVM_REG_MIPS_CP0_ENTRYHI 64 | |
| 2298 | + MIPS KVM_REG_MIPS_CP0_COMPARE 32 | |
| 2299 | + MIPS KVM_REG_MIPS_CP0_STATUS 32 | |
| 2300 | + MIPS KVM_REG_MIPS_CP0_INTCTL 32 | |
| 2301 | + MIPS KVM_REG_MIPS_CP0_CAUSE 32 | |
| 2302 | + MIPS KVM_REG_MIPS_CP0_EPC 64 | |
| 2303 | + MIPS KVM_REG_MIPS_CP0_PRID 32 | |
| 2304 | + MIPS KVM_REG_MIPS_CP0_EBASE 64 | |
| 2305 | + MIPS KVM_REG_MIPS_CP0_CONFIG 32 | |
| 2306 | + MIPS KVM_REG_MIPS_CP0_CONFIG1 32 | |
| 2307 | + MIPS KVM_REG_MIPS_CP0_CONFIG2 32 | |
| 2308 | + MIPS KVM_REG_MIPS_CP0_CONFIG3 32 | |
| 2309 | + MIPS KVM_REG_MIPS_CP0_CONFIG4 32 | |
| 2310 | + MIPS KVM_REG_MIPS_CP0_CONFIG5 32 | |
| 2311 | + MIPS KVM_REG_MIPS_CP0_CONFIG7 32 | |
| 2312 | + MIPS KVM_REG_MIPS_CP0_XCONTEXT 64 | |
| 2313 | + MIPS KVM_REG_MIPS_CP0_ERROREPC 64 | |
| 2314 | + MIPS KVM_REG_MIPS_CP0_KSCRATCH1 64 | |
| 2315 | + MIPS KVM_REG_MIPS_CP0_KSCRATCH2 64 | |
| 2316 | + MIPS KVM_REG_MIPS_CP0_KSCRATCH3 64 | |
| 2317 | + MIPS KVM_REG_MIPS_CP0_KSCRATCH4 64 | |
| 2318 | + MIPS KVM_REG_MIPS_CP0_KSCRATCH5 64 | |
| 2319 | + MIPS KVM_REG_MIPS_CP0_KSCRATCH6 64 | |
| 2320 | + MIPS KVM_REG_MIPS_CP0_MAAR(0..63) 64 | |
| 2321 | + MIPS KVM_REG_MIPS_COUNT_CTL 64 | |
| 2322 | + MIPS KVM_REG_MIPS_COUNT_RESUME 64 | |
| 2323 | + MIPS KVM_REG_MIPS_COUNT_HZ 64 | |
| 2324 | + MIPS KVM_REG_MIPS_FPR_32(0..31) 32 | |
| 2325 | + MIPS KVM_REG_MIPS_FPR_64(0..31) 64 | |
| 2326 | + MIPS KVM_REG_MIPS_VEC_128(0..31) 128 | |
| 2327 | + MIPS KVM_REG_MIPS_FCR_IR 32 | |
| 2328 | + MIPS KVM_REG_MIPS_FCR_CSR 32 | |
| 2329 | + MIPS KVM_REG_MIPS_MSA_IR 32 | |
| 2330 | + MIPS KVM_REG_MIPS_MSA_CSR 32 | |
| 2331 | + ======= =============================== ============ | |
| 2127 | 2332 | |
| 2128 | 2333 | ARM registers are mapped using the lower 32 bits. The upper 16 of that |
| 2129 | 2334 | is the register group type, or coprocessor number: |
| 2130 | 2335 | |
| 2131 | −ARM core registers have the following id bit patterns: | |
| 2336 | +ARM core registers have the following id bit patterns:: | |
| 2337 | + | |
| 2132 | 2338 | 0x4020 0000 0010 <index into the kvm_regs struct:16> |
| 2133 | 2339 | |
| 2134 | −ARM 32-bit CP15 registers have the following id bit patterns: | |
| 2340 | +ARM 32-bit CP15 registers have the following id bit patterns:: | |
| 2341 | + | |
| 2135 | 2342 | 0x4020 0000 000F <zero:1> <crn:4> <crm:4> <opc1:4> <opc2:3> |
| 2136 | 2343 | |
| 2137 | −ARM 64-bit CP15 registers have the following id bit patterns: | |
| 2344 | +ARM 64-bit CP15 registers have the following id bit patterns:: | |
| 2345 | + | |
| 2138 | 2346 | 0x4030 0000 000F <zero:1> <zero:4> <crm:4> <opc1:4> <zero:3> |
| 2139 | 2347 | |
| 2140 | −ARM CCSIDR registers are demultiplexed by CSSELR value: | |
| 2348 | +ARM CCSIDR registers are demultiplexed by CSSELR value:: | |
| 2349 | + | |
| 2141 | 2350 | 0x4020 0000 0011 00 <csselr:8> |
| 2142 | 2351 | |
| 2143 | −ARM 32-bit VFP control registers have the following id bit patterns: | |
| 2352 | +ARM 32-bit VFP control registers have the following id bit patterns:: | |
| 2353 | + | |
| 2144 | 2354 | 0x4020 0000 0012 1 <regno:12> |
| 2145 | 2355 | |
| 2146 | −ARM 64-bit FP registers have the following id bit patterns: | |
| 2356 | +ARM 64-bit FP registers have the following id bit patterns:: | |
| 2357 | + | |
| 2147 | 2358 | 0x4030 0000 0012 0 <regno:12> |
| 2148 | 2359 | |
| 2149 | −ARM firmware pseudo-registers have the following bit pattern: | |
| 2360 | +ARM firmware pseudo-registers have the following bit pattern:: | |
| 2361 | + | |
| 2150 | 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 | ||
| 2156 | 2368 | arm64 core/FP-SIMD registers have the following id bit patterns. Note |
| 2157 | 2369 | that the size of the access is variable, as the kvm_regs structure |
| 2158 | 2370 | contains elements ranging from 32 to 128 bits. The index is a 32bit |
| 2159 | −value in the kvm_regs structure seen as a 32bit array. | |
| 2371 | +value in the kvm_regs structure seen as a 32bit array:: | |
| 2372 | + | |
| 2160 | 2373 | 0x60x0 0000 0010 <index into the kvm_regs struct:16> |
| 2161 | 2374 | |
| 2162 | 2375 | Specifically: |
| 2376 | + | |
| 2377 | +======================= ========= ===== ======================================= | |
| 2163 | 2378 | Encoding Register Bits kvm_regs member |
| 2164 | −---------------------------------------------------------------- | |
| 2379 | +======================= ========= ===== ======================================= | |
| 2165 | 2380 | 0x6030 0000 0010 0000 X0 64 regs.regs[0] |
| 2166 | 2381 | 0x6030 0000 0010 0002 X1 64 regs.regs[1] |
| 2167 | − ... | |
| 2382 | + ... | |
| 2168 | 2383 | 0x6030 0000 0010 003c X30 64 regs.regs[30] |
| 2169 | 2384 | 0x6030 0000 0010 003e SP 64 regs.sp |
| 2170 | 2385 | 0x6030 0000 0010 0040 PC 64 regs.pc |
| @@ -2176,27 +2391,31 @@ Specifically: · 5 unmodified lines | ||
| 2176 | 2391 | 0x6030 0000 0010 004c SPSR_UND 64 spsr[KVM_SPSR_UND] |
| 2177 | 2392 | 0x6030 0000 0010 004e SPSR_IRQ 64 spsr[KVM_SPSR_IRQ] |
| 2178 | 2393 | 0x6060 0000 0010 0050 SPSR_FIQ 64 spsr[KVM_SPSR_FIQ] |
| 2179 | − 0x6040 0000 0010 0054 V0 128 fp_regs.vregs[0] (*) | |
| 2180 | − 0x6040 0000 0010 0058 V1 128 fp_regs.vregs[1] (*) | |
| 2181 | − ... | |
| 2182 | − 0x6040 0000 0010 00d0 V31 128 fp_regs.vregs[31] (*) | |
| 2394 | + 0x6040 0000 0010 0054 V0 128 fp_regs.vregs[0] [1]_ | |
| 2395 | + 0x6040 0000 0010 0058 V1 128 fp_regs.vregs[1] [1]_ | |
| 2396 | + ... | |
| 2397 | + 0x6040 0000 0010 00d0 V31 128 fp_regs.vregs[31] [1]_ | |
| 2183 | 2398 | 0x6020 0000 0010 00d4 FPSR 32 fp_regs.fpsr |
| 2184 | 2399 | 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. See | |
| 2187 | − KVM_ARM_VCPU_INIT. | |
| 2405 | + The equivalent register content can be accessed via bits [127:0] of | |
| 2406 | + the corresponding SVE Zn registers instead for vcpus that have SVE | |
| 2407 | + enabled (see below). | |
| 2188 | 2408 | |
| 2189 | − The equivalent register content can be accessed via bits [127:0] of | |
| 2190 | − the corresponding SVE Zn registers instead for vcpus that have SVE | |
| 2191 | − enabled (see below). | |
| 2409 | +arm64 CCSIDR registers are demultiplexed by CSSELR value:: | |
| 2192 | 2410 | |
| 2193 | −arm64 CCSIDR registers are demultiplexed by CSSELR value: | |
| 2194 | 2411 | 0x6020 0000 0011 00 <csselr:8> |
| 2195 | 2412 | |
| 2196 | −arm64 system registers have the following id bit patterns: | |
| 2413 | +arm64 system registers have the following id bit patterns:: | |
| 2414 | + | |
| 2197 | 2415 | 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3> |
| 2198 | 2416 | |
| 2199 | −WARNING: | |
| 2417 | +.. warning:: | |
| 2418 | + | |
| 2200 | 2419 | Two system register IDs do not follow the specified pattern. These |
| 2201 | 2420 | are KVM_REG_ARM_TIMER_CVAL and KVM_REG_ARM_TIMER_CNT, which map to |
| 2202 | 2421 | system registers CNTV_CVAL_EL0 and CNTVCT_EL0 respectively. These |
| @@ -2205,10 +2424,12 @@ WARNING: · 2 unmodified lines | ||
| 2205 | 2424 | derived from the register encoding for CNTV_CVAL_EL0. As this is |
| 2206 | 2425 | API, it must remain this way. |
| 2207 | 2426 | |
| 2208 | −arm64 firmware pseudo-registers have the following bit pattern: | |
| 2427 | +arm64 firmware pseudo-registers have the following bit pattern:: | |
| 2428 | + | |
| 2209 | 2429 | 0x6030 0000 0014 <regno:16> |
| 2210 | 2430 | |
| 2211 | −arm64 SVE registers have the following bit patterns: | |
| 2431 | +arm64 SVE registers have the following bit patterns:: | |
| 2432 | + | |
| 2212 | 2433 | 0x6080 0000 0015 00 <n:5> <slice:5> Zn bits[2048*slice + 2047 : 2048*slice] |
| 2213 | 2434 | 0x6050 0000 0015 04 <n:4> <slice:5> Pn bits[256*slice + 255 : 256*slice] |
| 2214 | 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 | |
| 2217 | 2438 | Access to register IDs where 2048 * slice >= 128 * max_vq will fail with |
| 2218 | 2439 | ENOENT. max_vq is the vcpu's maximum supported vector length in 128-bit |
| 2219 | −quadwords: see (**) below. | |
| 2440 | +quadwords: see [2]_ below. | |
| 2220 | 2441 | |
| 2221 | 2442 | These registers are only accessible on vcpus for which SVE is enabled. |
| 2222 | 2443 | See KVM_ARM_VCPU_INIT for details. |
| @@ -2231,21 +2452,21 @@ lengths supported by the vcpu to be discovered and configured by · 8 unmodified lines | ||
| 2231 | 2452 | userspace. When transferred to or from user memory via KVM_GET_ONE_REG |
| 2232 | 2453 | or KVM_SET_ONE_REG, the value of this register is of type |
| 2233 | 2454 | __u64[KVM_ARM64_SVE_VLS_WORDS], and encodes the set of vector lengths as |
| 2234 | −follows: | |
| 2455 | +follows:: | |
| 2235 | 2456 | |
| 2236 | −__u64 vector_lengths[KVM_ARM64_SVE_VLS_WORDS]; | |
| 2457 | + __u64 vector_lengths[KVM_ARM64_SVE_VLS_WORDS]; | |
| 2237 | 2458 | |
| 2238 | −if (vq >= SVE_VQ_MIN && vq <= SVE_VQ_MAX && | |
| 2239 | − ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >> | |
| 2459 | + if (vq >= SVE_VQ_MIN && vq <= SVE_VQ_MAX && | |
| 2460 | + ((vector_lengths[(vq - KVM_ARM64_SVE_VQ_MIN) / 64] >> | |
| 2240 | 2461 | ((vq - KVM_ARM64_SVE_VQ_MIN) % 64)) & 1)) |
| 2241 | 2462 | /* Vector length vq * 16 bytes supported */ |
| 2242 | −else | |
| 2463 | + else | |
| 2243 | 2464 | /* Vector length vq * 16 bytes not supported */ |
| 2244 | 2465 | |
| 2245 | −(**) The maximum value vq for which the above condition is true is | |
| 2246 | −max_vq. This is the maximum vector length available to the guest on | |
| 2247 | −this vcpu, and determines which register slices are visible through | |
| 2248 | −this ioctl interface. | |
| 2466 | +.. [2] The maximum value vq for which the above condition is true is | |
| 2467 | + max_vq. This is the maximum vector length available to the guest on | |
| 2468 | + this vcpu, and determines which register slices are visible through | |
| 2469 | + this ioctl interface. | |
| 2249 | 2470 | |
| 2250 | 2471 | (See Documentation/arm64/sve.rst for an explanation of the "vq" |
| 2251 | 2472 | nomenclature.) |
| @@ -2270,11 +2491,13 @@ write this register will fail with EPERM. · 18 unmodified lines | ||
| 2270 | 2491 | MIPS registers are mapped using the lower 32 bits. The upper 16 of that is |
| 2271 | 2492 | the register group type: |
| 2272 | 2493 | |
| 2273 | −MIPS core registers (see above) have the following id bit patterns: | |
| 2494 | +MIPS core registers (see above) have the following id bit patterns:: | |
| 2495 | + | |
| 2274 | 2496 | 0x7030 0000 0000 <reg:16> |
| 2275 | 2497 | |
| 2276 | 2498 | MIPS CP0 registers (see KVM_REG_MIPS_CP0_* above) have the following id bit |
| 2277 | −patterns depending on whether they're 32-bit or 64-bit registers: | |
| 2499 | +patterns depending on whether they're 32-bit or 64-bit registers:: | |
| 2500 | + | |
| 2278 | 2501 | 0x7020 0000 0001 00 <reg:5> <sel:3> (32-bit) |
| 2279 | 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 | ||
| 2285 | 2508 | the PFNX field starting at bit 30. |
| 2286 | 2509 | |
| 2287 | 2510 | MIPS MAARs (see KVM_REG_MIPS_CP0_MAAR(*) above) have the following id bit |
| 2288 | −patterns: | |
| 2511 | +patterns:: | |
| 2512 | + | |
| 2289 | 2513 | 0x7030 0000 0001 01 <reg:8> |
| 2290 | 2514 | |
| 2291 | −MIPS KVM control registers (see above) have the following id bit patterns: | |
| 2515 | +MIPS KVM control registers (see above) have the following id bit patterns:: | |
| 2516 | + | |
| 2292 | 2517 | 0x7030 0000 0002 <reg:16> |
| 2293 | 2518 | |
| 2294 | 2519 | MIPS FPU registers (see KVM_REG_MIPS_FPR_{32,64}() above) have the following |
| @@ -2297,31 +2522,40 @@ always accessed according to the current guest FPU mode (Status.FR and · 2 unmodified lines | ||
| 2297 | 2522 | Config5.FRE), i.e. as the guest would see them, and they become unpredictable |
| 2298 | 2523 | if the guest FPU mode is changed. MIPS SIMD Architecture (MSA) vector |
| 2299 | 2524 | registers (see KVM_REG_MIPS_VEC_128() above) have similar patterns as they |
| 2300 | −overlap the FPU registers: | |
| 2525 | +overlap the FPU registers:: | |
| 2526 | + | |
| 2301 | 2527 | 0x7020 0000 0003 00 <0:3> <reg:5> (32-bit FPU registers) |
| 2302 | 2528 | 0x7030 0000 0003 00 <0:3> <reg:5> (64-bit FPU registers) |
| 2303 | 2529 | 0x7040 0000 0003 00 <0:3> <reg:5> (128-bit MSA vector registers) |
| 2304 | 2530 | |
| 2305 | 2531 | MIPS FPU control registers (see KVM_REG_MIPS_FCR_{IR,CSR} above) have the |
| 2306 | −following id bit patterns: | |
| 2532 | +following id bit patterns:: | |
| 2533 | + | |
| 2307 | 2534 | 0x7020 0000 0003 01 <0:3> <reg:5> |
| 2308 | 2535 | |
| 2309 | 2536 | MIPS MSA control registers (see KVM_REG_MIPS_MSA_{IR,CSR} above) have the |
| 2310 | −following id bit patterns: | |
| 2537 | +following id bit patterns:: | |
| 2538 | + | |
| 2311 | 2539 | 0x7020 0000 0003 02 <0:3> <reg:5> |
| 2312 | 2540 | |
| 2313 | 2541 | |
| 2314 | 2542 | 4.69 KVM_GET_ONE_REG |
| 2543 | +-------------------- | |
| 2544 | + | |
| 2545 | +:Capability: KVM_CAP_ONE_REG | |
| 2546 | +:Architectures: all | |
| 2547 | +:Type: vcpu ioctl | |
| 2548 | +:Parameters: struct kvm_one_reg (in and out) | |
| 2549 | +:Returns: 0 on success, negative value on failure | |
| 2315 | 2550 | |
| 2316 | −Capability: KVM_CAP_ONE_REG | |
| 2317 | −Architectures: all | |
| 2318 | −Type: vcpu ioctl | |
| 2319 | −Parameters: struct kvm_one_reg (in and out) | |
| 2320 | −Returns: 0 on success, negative value on failure | |
| 2321 | 2551 | Errors include: |
| 2322 | − ENOENT: no such register | |
| 2323 | − EINVAL: invalid register ID, or no such register | |
| 2324 | − EPERM: (arm64) register access not allowed before vcpu finalization | |
| 2552 | + | |
| 2553 | + ======== ============================================================ | |
| 2554 | + ENOENT no such register | |
| 2555 | + EINVAL invalid register ID, or no such register | |
| 2556 | + EPERM (arm64) register access not allowed before vcpu finalization | |
| 2557 | + ======== ============================================================ | |
| 2558 | + | |
| 2325 | 2559 | (These error codes are indicative only: do not rely on a specific error |
| 2326 | 2560 | code being returned in a specific situation.) |
| 2327 | 2561 | |
| @@ -2335,12 +2569,13 @@ list in 4.68. · 7 unmodified lines | ||
| 2335 | 2569 | |
| 2336 | 2570 | |
| 2337 | 2571 | 4.70 KVM_KVMCLOCK_CTRL |
| 2572 | +---------------------- | |
| 2338 | 2573 | |
| 2339 | −Capability: KVM_CAP_KVMCLOCK_CTRL | |
| 2340 | −Architectures: Any that implement pvclocks (currently x86 only) | |
| 2341 | −Type: vcpu ioctl | |
| 2342 | −Parameters: None | |
| 2343 | −Returns: 0 on success, -1 on error | |
| 2574 | +:Capability: KVM_CAP_KVMCLOCK_CTRL | |
| 2575 | +:Architectures: Any that implement pvclocks (currently x86 only) | |
| 2576 | +:Type: vcpu ioctl | |
| 2577 | +:Parameters: None | |
| 2578 | +:Returns: 0 on success, -1 on error | |
| 2344 | 2579 | |
| 2345 | 2580 | This signals to the host kernel that the specified guest is being paused by |
| 2346 | 2581 | userspace. The host will set a flag in the pvclock structure that is checked |
| @@ -2356,26 +2591,30 @@ after pausing the vcpu, but before it is resumed. · 9 unmodified lines | ||
| 2356 | 2591 | |
| 2357 | 2592 | |
| 2358 | 2593 | 4.71 KVM_SIGNAL_MSI |
| 2594 | +------------------- | |
| 2359 | 2595 | |
| 2360 | −Capability: KVM_CAP_SIGNAL_MSI | |
| 2361 | −Architectures: x86 arm arm64 | |
| 2362 | −Type: vm ioctl | |
| 2363 | −Parameters: struct kvm_msi (in) | |
| 2364 | −Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error | |
| 2596 | +:Capability: KVM_CAP_SIGNAL_MSI | |
| 2597 | +:Architectures: x86 arm arm64 | |
| 2598 | +:Type: vm ioctl | |
| 2599 | +:Parameters: struct kvm_msi (in) | |
| 2600 | +:Returns: >0 on delivery, 0 if guest blocked the MSI, and -1 on error | |
| 2365 | 2601 | |
| 2366 | 2602 | Directly inject a MSI message. Only valid with in-kernel irqchip that handles |
| 2367 | 2603 | MSI messages. |
| 2368 | 2604 | |
| 2369 | −struct kvm_msi { | |
| 2605 | +:: | |
| 2606 | + | |
| 2607 | + struct kvm_msi { | |
| 2370 | 2608 | __u32 address_lo; |
| 2371 | 2609 | __u32 address_hi; |
| 2372 | 2610 | __u32 data; |
| 2373 | 2611 | __u32 flags; |
| 2374 | 2612 | __u32 devid; |
| 2375 | 2613 | __u8 pad[12]; |
| 2376 | −}; | |
| 2614 | + }; | |
| 2377 | 2615 | |
| 2378 | −flags: KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM | |
| 2616 | +flags: | |
| 2617 | + KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM | |
| 2379 | 2618 | KVM_CAP_MSI_DEVID capability advertises the requirement to provide |
| 2380 | 2619 | the device ID. If this capability is not available, userspace |
| 2381 | 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 | |
| 2393 | 2632 | 4.71 KVM_CREATE_PIT2 |
| 2633 | +-------------------- | |
| 2394 | 2634 | |
| 2395 | −Capability: KVM_CAP_PIT2 | |
| 2396 | −Architectures: x86 | |
| 2397 | −Type: vm ioctl | |
| 2398 | −Parameters: struct kvm_pit_config (in) | |
| 2399 | −Returns: 0 on success, -1 on error | |
| 2635 | +:Capability: KVM_CAP_PIT2 | |
| 2636 | +:Architectures: x86 | |
| 2637 | +:Type: vm ioctl | |
| 2638 | +:Parameters: struct kvm_pit_config (in) | |
| 2639 | +:Returns: 0 on success, -1 on error | |
| 2400 | 2640 | |
| 2401 | 2641 | Creates an in-kernel device model for the i8254 PIT. This call is only valid |
| 2402 | 2642 | after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP. The following |
| 2403 | −parameters have to be passed: | |
| 2643 | +parameters have to be passed:: | |
| 2404 | 2644 | |
| 2405 | −struct kvm_pit_config { | |
| 2645 | + struct kvm_pit_config { | |
| 2406 | 2646 | __u32 flags; |
| 2407 | 2647 | __u32 pad[15]; |
| 2408 | −}; | |
| 2648 | + }; | |
| 2409 | 2649 | |
| 2410 | −Valid flags are: | |
| 2650 | +Valid 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 | |
| 2414 | 2654 | PIT timer interrupts may use a per-VM kernel thread for injection. If it |
| 2415 | −exists, this thread will have a name of the following pattern: | |
| 2655 | +exists, this thread will have a name of the following pattern:: | |
| 2416 | 2656 | |
| 2417 | −kvm-pit/<owner-process-pid> | |
| 2657 | + kvm-pit/<owner-process-pid> | |
| 2418 | 2658 | |
| 2419 | 2659 | When running a guest with elevated priorities, the scheduling parameters of |
| 2420 | 2660 | this 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 | |
| 2425 | 2665 | 4.72 KVM_GET_PIT2 |
| 2666 | +----------------- | |
| 2426 | 2667 | |
| 2427 | −Capability: KVM_CAP_PIT_STATE2 | |
| 2428 | −Architectures: x86 | |
| 2429 | −Type: vm ioctl | |
| 2430 | −Parameters: struct kvm_pit_state2 (out) | |
| 2431 | −Returns: 0 on success, -1 on error | |
| 2668 | +:Capability: KVM_CAP_PIT_STATE2 | |
| 2669 | +:Architectures: x86 | |
| 2670 | +:Type: vm ioctl | |
| 2671 | +:Parameters: struct kvm_pit_state2 (out) | |
| 2672 | +:Returns: 0 on success, -1 on error | |
| 2432 | 2673 | |
| 2433 | 2674 | Retrieves the state of the in-kernel PIT model. Only valid after |
| 2434 | −KVM_CREATE_PIT2. The state is returned in the following structure: | |
| 2675 | +KVM_CREATE_PIT2. The state is returned in the following structure:: | |
| 2435 | 2676 | |
| 2436 | −struct kvm_pit_state2 { | |
| 2677 | + struct kvm_pit_state2 { | |
| 2437 | 2678 | struct kvm_pit_channel_state channels[3]; |
| 2438 | 2679 | __u32 flags; |
| 2439 | 2680 | __u32 reserved[9]; |
| 2440 | −}; | |
| 2681 | + }; | |
| 2441 | 2682 | |
| 2442 | −Valid flags are: | |
| 2683 | +Valid flags are:: | |
| 2443 | 2684 | |
| 2444 | −/* disable PIT in HPET legacy mode */ | |
| 2445 | −#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001 | |
| 2685 | + /* disable PIT in HPET legacy mode */ | |
| 2686 | + #define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001 | |
| 2446 | 2687 | |
| 2447 | 2688 | This IOCTL replaces the obsolete KVM_GET_PIT. |
| 2448 | 2689 | |
| 2449 | 2690 | |
| 2450 | 2691 | 4.73 KVM_SET_PIT2 |
| 2692 | +----------------- | |
| 2451 | 2693 | |
| 2452 | −Capability: KVM_CAP_PIT_STATE2 | |
| 2453 | −Architectures: x86 | |
| 2454 | −Type: vm ioctl | |
| 2455 | −Parameters: struct kvm_pit_state2 (in) | |
| 2456 | −Returns: 0 on success, -1 on error | |
| 2694 | +:Capability: KVM_CAP_PIT_STATE2 | |
| 2695 | +:Architectures: x86 | |
| 2696 | +:Type: vm ioctl | |
| 2697 | +:Parameters: struct kvm_pit_state2 (in) | |
| 2698 | +:Returns: 0 on success, -1 on error | |
| 2457 | 2699 | |
| 2458 | 2700 | Sets the state of the in-kernel PIT model. Only valid after KVM_CREATE_PIT2. |
| 2459 | 2701 | See KVM_GET_PIT2 for details on struct kvm_pit_state2. |
| @@ -2462,12 +2704,13 @@ This IOCTL replaces the obsolete KVM_SET_PIT. · 2 unmodified lines | ||
| 2462 | 2704 | |
| 2463 | 2705 | |
| 2464 | 2706 | 4.74 KVM_PPC_GET_SMMU_INFO |
| 2707 | +-------------------------- | |
| 2465 | 2708 | |
| 2466 | −Capability: KVM_CAP_PPC_GET_SMMU_INFO | |
| 2467 | −Architectures: powerpc | |
| 2468 | −Type: vm ioctl | |
| 2469 | −Parameters: None | |
| 2470 | −Returns: 0 on success, -1 on error | |
| 2709 | +:Capability: KVM_CAP_PPC_GET_SMMU_INFO | |
| 2710 | +:Architectures: powerpc | |
| 2711 | +:Type: vm ioctl | |
| 2712 | +:Parameters: None | |
| 2713 | +:Returns: 0 on success, -1 on error | |
| 2471 | 2714 | |
| 2472 | 2715 | This populates and returns a structure describing the features of |
| 2473 | 2716 | the "Server" class MMU emulation supported by KVM. |
| @@ -2475,7 +2718,7 @@ This can in turn be used by userspace to generate the appropriate · 1 unmodified line | ||
| 2475 | 2718 | device-tree properties for the guest operating system. |
| 2476 | 2719 | |
| 2477 | 2720 | The structure contains some global information, followed by an |
| 2478 | −array of supported segment page sizes: | |
| 2721 | +array of supported segment page sizes:: | |
| 2479 | 2722 | |
| 2480 | 2723 | struct kvm_ppc_smmu_info { |
| 2481 | 2724 | __u64 flags; |
| @@ -2503,7 +2746,7 @@ The "slb_size" field indicates how many SLB entries are supported · 21 unmodified lines | ||
| 2503 | 2746 | |
| 2504 | 2747 | The "sps" array contains 8 entries indicating the supported base |
| 2505 | 2748 | page sizes for a segment in increasing order. Each entry is defined |
| 2506 | −as follow: | |
| 2749 | +as follow:: | |
| 2507 | 2750 | |
| 2508 | 2751 | struct kvm_ppc_one_seg_page_size { |
| 2509 | 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 | ||
| 2524 | 2767 | only larger or equal to the base page size), along with the |
| 2525 | 2768 | corresponding encoding in the hash PTE. Similarly, the array is |
| 2526 | 2769 | 8 entries sorted by increasing sizes and an entry with a "0" shift |
| 2527 | −is an empty entry and a terminator: | |
| 2770 | +is an empty entry and a terminator:: | |
| 2528 | 2771 | |
| 2529 | 2772 | struct kvm_ppc_one_page_size { |
| 2530 | 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 | ||
| 2536 | 2779 | into the hash PTE second double word). |
| 2537 | 2780 | |
| 2538 | 2781 | 4.75 KVM_IRQFD |
| 2782 | +-------------- | |
| 2539 | 2783 | |
| 2540 | −Capability: KVM_CAP_IRQFD | |
| 2541 | −Architectures: x86 s390 arm arm64 | |
| 2542 | −Type: vm ioctl | |
| 2543 | −Parameters: struct kvm_irqfd (in) | |
| 2544 | −Returns: 0 on success, -1 on error | |
| 2784 | +:Capability: KVM_CAP_IRQFD | |
| 2785 | +:Architectures: x86 s390 arm arm64 | |
| 2786 | +:Type: vm ioctl | |
| 2787 | +:Parameters: struct kvm_irqfd (in) | |
| 2788 | +:Returns: 0 on success, -1 on error | |
| 2545 | 2789 | |
| 2546 | 2790 | Allows setting an eventfd to directly trigger a guest interrupt. |
| 2547 | 2791 | kvm_irqfd.fd specifies the file descriptor to use as the eventfd and |
| @@ -2565,6 +2809,7 @@ irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment · 17 unmodified lines | ||
| 2565 | 2809 | and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. |
| 2566 | 2810 | |
| 2567 | 2811 | On arm/arm64, gsi routing being supported, the following can happen: |
| 2812 | + | |
| 2568 | 2813 | - in case no routing entry is associated to this gsi, injection fails |
| 2569 | 2814 | - in case the gsi is associated to an irqchip routing entry, |
| 2570 | 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 | 2818 | to GICv3 ITS in-kernel emulation). |
| 2574 | 2819 | |
| 2575 | 2820 | 4.76 KVM_PPC_ALLOCATE_HTAB |
| 2821 | +-------------------------- | |
| 2576 | 2822 | |
| 2577 | −Capability: KVM_CAP_PPC_ALLOC_HTAB | |
| 2578 | −Architectures: powerpc | |
| 2579 | −Type: vm ioctl | |
| 2580 | −Parameters: Pointer to u32 containing hash table order (in/out) | |
| 2581 | −Returns: 0 on success, -1 on error | |
| 2823 | +:Capability: KVM_CAP_PPC_ALLOC_HTAB | |
| 2824 | +:Architectures: powerpc | |
| 2825 | +:Type: vm ioctl | |
| 2826 | +:Parameters: Pointer to u32 containing hash table order (in/out) | |
| 2827 | +:Returns: 0 on success, -1 on error | |
| 2582 | 2828 | |
| 2583 | 2829 | This requests the host kernel to allocate an MMU hash table for a |
| 2584 | 2830 | guest using the PAPR paravirtualization interface. This only does |
| @@ -2609,75 +2855,88 @@ real-mode area (VRMA) facility, the kernel will re-create the VMRA · 24 unmodified lines | ||
| 2609 | 2855 | HPTEs on the next KVM_RUN of any vcpu. |
| 2610 | 2856 | |
| 2611 | 2857 | 4.77 KVM_S390_INTERRUPT |
| 2858 | +----------------------- | |
| 2612 | 2859 | |
| 2613 | −Capability: basic | |
| 2614 | −Architectures: s390 | |
| 2615 | −Type: vm ioctl, vcpu ioctl | |
| 2616 | −Parameters: struct kvm_s390_interrupt (in) | |
| 2617 | −Returns: 0 on success, -1 on error | |
| 2860 | +:Capability: basic | |
| 2861 | +:Architectures: s390 | |
| 2862 | +:Type: vm ioctl, vcpu ioctl | |
| 2863 | +:Parameters: struct kvm_s390_interrupt (in) | |
| 2864 | +:Returns: 0 on success, -1 on error | |
| 2618 | 2865 | |
| 2619 | 2866 | Allows to inject an interrupt to the guest. Interrupts can be floating |
| 2620 | 2867 | (vm ioctl) or per cpu (vcpu ioctl), depending on the interrupt type. |
| 2621 | 2868 | |
| 2622 | −Interrupt parameters are passed via kvm_s390_interrupt: | |
| 2869 | +Interrupt parameters are passed via kvm_s390_interrupt:: | |
| 2623 | 2870 | |
| 2624 | −struct kvm_s390_interrupt { | |
| 2871 | + struct kvm_s390_interrupt { | |
| 2625 | 2872 | __u32 type; |
| 2626 | 2873 | __u32 parm; |
| 2627 | 2874 | __u64 parm64; |
| 2628 | −}; | |
| 2875 | + }; | |
| 2629 | 2876 | |
| 2630 | 2877 | type can be one of the following: |
| 2631 | 2878 | |
| 2632 | −KVM_S390_SIGP_STOP (vcpu) - sigp stop; optional flags in parm | |
| 2633 | −KVM_S390_PROGRAM_INT (vcpu) - program check; code in parm | |
| 2634 | −KVM_S390_SIGP_SET_PREFIX (vcpu) - sigp set prefix; prefix address in parm | |
| 2635 | −KVM_S390_RESTART (vcpu) - restart | |
| 2636 | −KVM_S390_INT_CLOCK_COMP (vcpu) - clock comparator interrupt | |
| 2637 | −KVM_S390_INT_CPU_TIMER (vcpu) - CPU timer interrupt | |
| 2638 | −KVM_S390_INT_VIRTIO (vm) - virtio external interrupt; external interrupt | |
| 2639 | − parameters in parm and parm64 | |
| 2640 | −KVM_S390_INT_SERVICE (vm) - sclp external interrupt; sclp parameter in parm | |
| 2641 | −KVM_S390_INT_EMERGENCY (vcpu) - sigp emergency; source cpu in parm | |
| 2642 | −KVM_S390_INT_EXTERNAL_CALL (vcpu) - sigp external call; source cpu in parm | |
| 2643 | −KVM_S390_INT_IO(ai,cssid,ssid,schid) (vm) - compound value to indicate an | |
| 2644 | − I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel); | |
| 2645 | − I/O interruption parameters in parm (subchannel) and parm64 (intparm, | |
| 2646 | − interruption subclass) | |
| 2647 | −KVM_S390_MCHK (vm, vcpu) - machine check interrupt; cr 14 bits in parm, | |
| 2648 | − machine check interrupt code in parm64 (note that | |
| 2649 | − machine checks needing further payload are not | |
| 2650 | − supported by this ioctl) | |
| 2879 | +KVM_S390_SIGP_STOP (vcpu) | |
| 2880 | + - sigp stop; optional flags in parm | |
| 2881 | +KVM_S390_PROGRAM_INT (vcpu) | |
| 2882 | + - program check; code in parm | |
| 2883 | +KVM_S390_SIGP_SET_PREFIX (vcpu) | |
| 2884 | + - sigp set prefix; prefix address in parm | |
| 2885 | +KVM_S390_RESTART (vcpu) | |
| 2886 | + - restart | |
| 2887 | +KVM_S390_INT_CLOCK_COMP (vcpu) | |
| 2888 | + - clock comparator interrupt | |
| 2889 | +KVM_S390_INT_CPU_TIMER (vcpu) | |
| 2890 | + - CPU timer interrupt | |
| 2891 | +KVM_S390_INT_VIRTIO (vm) | |
| 2892 | + - virtio external interrupt; external interrupt | |
| 2893 | + parameters in parm and parm64 | |
| 2894 | +KVM_S390_INT_SERVICE (vm) | |
| 2895 | + - sclp external interrupt; sclp parameter in parm | |
| 2896 | +KVM_S390_INT_EMERGENCY (vcpu) | |
| 2897 | + - sigp emergency; source cpu in parm | |
| 2898 | +KVM_S390_INT_EXTERNAL_CALL (vcpu) | |
| 2899 | + - sigp external call; source cpu in parm | |
| 2900 | +KVM_S390_INT_IO(ai,cssid,ssid,schid) (vm) | |
| 2901 | + - compound value to indicate an | |
| 2902 | + I/O interrupt (ai - adapter interrupt; cssid,ssid,schid - subchannel); | |
| 2903 | + I/O interruption parameters in parm (subchannel) and parm64 (intparm, | |
| 2904 | + interruption subclass) | |
| 2905 | +KVM_S390_MCHK (vm, vcpu) | |
| 2906 | + - machine check interrupt; cr 14 bits in parm, machine check interrupt | |
| 2907 | + code in parm64 (note that machine checks needing further payload are not | |
| 2908 | + supported by this ioctl) | |
| 2651 | 2909 | |
| 2652 | 2910 | This is an asynchronous vcpu ioctl and can be invoked from any thread. |
| 2653 | 2911 | |
| 2654 | 2912 | 4.78 KVM_PPC_GET_HTAB_FD |
| 2913 | +------------------------ | |
| 2655 | 2914 | |
| 2656 | −Capability: KVM_CAP_PPC_HTAB_FD | |
| 2657 | −Architectures: powerpc | |
| 2658 | −Type: vm ioctl | |
| 2659 | −Parameters: Pointer to struct kvm_get_htab_fd (in) | |
| 2660 | −Returns: file descriptor number (>= 0) on success, -1 on error | |
| 2915 | +:Capability: KVM_CAP_PPC_HTAB_FD | |
| 2916 | +:Architectures: powerpc | |
| 2917 | +:Type: vm ioctl | |
| 2918 | +:Parameters: Pointer to struct kvm_get_htab_fd (in) | |
| 2919 | +:Returns: file descriptor number (>= 0) on success, -1 on error | |
| 2661 | 2920 | |
| 2662 | 2921 | This returns a file descriptor that can be used either to read out the |
| 2663 | 2922 | entries in the guest's hashed page table (HPT), or to write entries to |
| 2664 | 2923 | initialize the HPT. The returned fd can only be written to if the |
| 2665 | 2924 | KVM_GET_HTAB_WRITE bit is set in the flags field of the argument, and |
| 2666 | 2925 | can only be read if that bit is clear. The argument struct looks like |
| 2667 | −this: | |
| 2926 | +this:: | |
| 2668 | 2927 | |
| 2669 | −/* For KVM_PPC_GET_HTAB_FD */ | |
| 2670 | −struct kvm_get_htab_fd { | |
| 2928 | + /* For KVM_PPC_GET_HTAB_FD */ | |
| 2929 | + struct kvm_get_htab_fd { | |
| 2671 | 2930 | __u64 flags; |
| 2672 | 2931 | __u64 start_index; |
| 2673 | 2932 | __u64 reserved[2]; |
| 2674 | −}; | |
| 2933 | + }; | |
| 2675 | 2934 | |
| 2676 | −/* Values for kvm_get_htab_fd.flags */ | |
| 2677 | −#define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1) | |
| 2678 | −#define KVM_GET_HTAB_WRITE ((__u64)0x2) | |
| 2935 | + /* Values for kvm_get_htab_fd.flags */ | |
| 2936 | + #define KVM_GET_HTAB_BOLTED_ONLY ((__u64)0x1) | |
| 2937 | + #define KVM_GET_HTAB_WRITE ((__u64)0x2) | |
| 2679 | 2938 | |
| 2680 | −The `start_index' field gives the index in the HPT of the entry at | |
| 2939 | +The 'start_index' field gives the index in the HPT of the entry at | |
| 2681 | 2940 | which to start reading. It is ignored when writing. |
| 2682 | 2941 | |
| 2683 | 2942 | Reads on the fd will initially supply information about all |
| @@ -2692,29 +2951,34 @@ Data read or written is structured as a header (8 bytes) followed by a · 8 unmodified lines | ||
| 2692 | 2951 | series of valid HPT entries (16 bytes) each. The header indicates how |
| 2693 | 2952 | many valid HPT entries there are and how many invalid entries follow |
| 2694 | 2953 | the valid entries. The invalid entries are not represented explicitly |
| 2695 | −in the stream. The header format is: | |
| 2954 | +in the stream. The header format is:: | |
| 2696 | 2955 | |
| 2697 | −struct kvm_get_htab_header { | |
| 2956 | + struct kvm_get_htab_header { | |
| 2698 | 2957 | __u32 index; |
| 2699 | 2958 | __u16 n_valid; |
| 2700 | 2959 | __u16 n_invalid; |
| 2701 | −}; | |
| 2960 | + }; | |
| 2702 | 2961 | |
| 2703 | 2962 | Writes to the fd create HPT entries starting at the index given in the |
| 2704 | −header; first `n_valid' valid entries with contents from the data | |
| 2705 | −written, then `n_invalid' invalid entries, invalidating any previously | |
| 2963 | +header; first 'n_valid' valid entries with contents from the data | |
| 2964 | +written, then 'n_invalid' invalid entries, invalidating any previously | |
| 2706 | 2965 | valid entries found. |
| 2707 | 2966 | |
| 2708 | 2967 | 4.79 KVM_CREATE_DEVICE |
| 2968 | +---------------------- | |
| 2969 | + | |
| 2970 | +:Capability: KVM_CAP_DEVICE_CTRL | |
| 2971 | +:Type: vm ioctl | |
| 2972 | +:Parameters: struct kvm_create_device (in/out) | |
| 2973 | +:Returns: 0 on success, -1 on error | |
| 2709 | 2974 | |
| 2710 | −Capability: KVM_CAP_DEVICE_CTRL | |
| 2711 | −Type: vm ioctl | |
| 2712 | −Parameters: struct kvm_create_device (in/out) | |
| 2713 | −Returns: 0 on success, -1 on error | |
| 2714 | 2975 | Errors: |
| 2715 | − ENODEV: The device type is unknown or unsupported | |
| 2716 | − EEXIST: Device already created, and this type of device may not | |
| 2976 | + | |
| 2977 | + ====== ======================================================= | |
| 2978 | + ENODEV The device type is unknown or unsupported | |
| 2979 | + EEXIST Device already created, and this type of device may not | |
| 2717 | 2980 | be instantiated multiple times |
| 2981 | + ====== ======================================================= | |
| 2718 | 2982 | |
| 2719 | 2983 | Other error conditions may be defined by individual device types or |
| 2720 | 2984 | have their standard meanings. |
| @@ -2730,25 +2994,32 @@ Individual devices should not define flags. Attributes should be used · 9 unmodified lines | ||
| 2730 | 2994 | for specifying any behavior that is not implied by the device type |
| 2731 | 2995 | number. |
| 2732 | 2996 | |
| 2733 | −struct kvm_create_device { | |
| 2997 | +:: | |
| 2998 | + | |
| 2999 | + struct kvm_create_device { | |
| 2734 | 3000 | __u32 type; /* in: KVM_DEV_TYPE_xxx */ |
| 2735 | 3001 | __u32 fd; /* out: device handle */ |
| 2736 | 3002 | __u32 flags; /* in: KVM_CREATE_DEVICE_xxx */ |
| 2737 | −}; | |
| 3003 | + }; | |
| 2738 | 3004 | |
| 2739 | 3005 | 4.80 KVM_SET_DEVICE_ATTR/KVM_GET_DEVICE_ATTR |
| 3006 | +-------------------------------------------- | |
| 3007 | + | |
| 3008 | +:Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device, | |
| 3009 | + KVM_CAP_VCPU_ATTRIBUTES for vcpu device | |
| 3010 | +:Type: device ioctl, vm ioctl, vcpu ioctl | |
| 3011 | +:Parameters: struct kvm_device_attr | |
| 3012 | +:Returns: 0 on success, -1 on error | |
| 2740 | 3013 | |
| 2741 | −Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device, | |
| 2742 | − KVM_CAP_VCPU_ATTRIBUTES for vcpu device | |
| 2743 | −Type: device ioctl, vm ioctl, vcpu ioctl | |
| 2744 | −Parameters: struct kvm_device_attr | |
| 2745 | −Returns: 0 on success, -1 on error | |
| 2746 | 3014 | Errors: |
| 2747 | − ENXIO: The group or attribute is unknown/unsupported for this device | |
| 3015 | + | |
| 3016 | + ===== ============================================================= | |
| 3017 | + ENXIO The group or attribute is unknown/unsupported for this device | |
| 2748 | 3018 | or hardware support is missing. |
| 2749 | − EPERM: The attribute cannot (currently) be accessed this way | |
| 3019 | + EPERM The attribute cannot (currently) be accessed this way | |
| 2750 | 3020 | (e.g. read-only attribute, or attribute that only makes |
| 2751 | 3021 | sense when the device is in a different state) |
| 3022 | + ===== ============================================================= | |
| 2752 | 3023 | |
| 2753 | 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 | ||
| 2757 | 3028 | the "devices" directory. As with ONE_REG, the size of the data |
| 2758 | 3029 | transferred is defined by the particular attribute. |
| 2759 | 3030 | |
| 2760 | −struct kvm_device_attr { | |
| 3031 | +:: | |
| 3032 | + | |
| 3033 | + struct kvm_device_attr { | |
| 2761 | 3034 | __u32 flags; /* no flags currently defined */ |
| 2762 | 3035 | __u32 group; /* device-defined */ |
| 2763 | 3036 | __u64 attr; /* group-defined */ |
| 2764 | 3037 | __u64 addr; /* userspace address of attr data */ |
| 2765 | −}; | |
| 3038 | + }; | |
| 2766 | 3039 | |
| 2767 | 3040 | 4.81 KVM_HAS_DEVICE_ATTR |
| 3041 | +------------------------ | |
| 3042 | + | |
| 3043 | +:Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device, | |
| 3044 | + KVM_CAP_VCPU_ATTRIBUTES for vcpu device | |
| 3045 | +:Type: device ioctl, vm ioctl, vcpu ioctl | |
| 3046 | +:Parameters: struct kvm_device_attr | |
| 3047 | +:Returns: 0 on success, -1 on error | |
| 2768 | 3048 | |
| 2769 | −Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device, | |
| 2770 | − KVM_CAP_VCPU_ATTRIBUTES for vcpu device | |
| 2771 | −Type: device ioctl, vm ioctl, vcpu ioctl | |
| 2772 | −Parameters: struct kvm_device_attr | |
| 2773 | −Returns: 0 on success, -1 on error | |
| 2774 | 3049 | Errors: |
| 2775 | − ENXIO: The group or attribute is unknown/unsupported for this device | |
| 3050 | + | |
| 3051 | + ===== ============================================================= | |
| 3052 | + ENXIO The group or attribute is unknown/unsupported for this device | |
| 2776 | 3053 | or hardware support is missing. |
| 3054 | + ===== ============================================================= | |
| 2777 | 3055 | |
| 2778 | 3056 | Tests whether a device supports a particular attribute. A successful |
| 2779 | 3057 | return indicates the attribute is implemented. It does not necessarily |
| @@ -2781,15 +3059,20 @@ indicate that the attribute can be read or written in the device's · 1 unmodified line | ||
| 2781 | 3059 | current state. "addr" is ignored. |
| 2782 | 3060 | |
| 2783 | 3061 | 4.82 KVM_ARM_VCPU_INIT |
| 3062 | +---------------------- | |
| 3063 | + | |
| 3064 | +:Capability: basic | |
| 3065 | +:Architectures: arm, arm64 | |
| 3066 | +:Type: vcpu ioctl | |
| 3067 | +:Parameters: struct kvm_vcpu_init (in) | |
| 3068 | +:Returns: 0 on success; -1 on error | |
| 2784 | 3069 | |
| 2785 | −Capability: basic | |
| 2786 | −Architectures: arm, arm64 | |
| 2787 | −Type: vcpu ioctl | |
| 2788 | −Parameters: struct kvm_vcpu_init (in) | |
| 2789 | −Returns: 0 on success; -1 on error | |
| 2790 | 3070 | Errors: |
| 2791 | − EINVAL: the target is unknown, or the combination of features is invalid. | |
| 2792 | − ENOENT: a features bit specified is unknown. | |
| 3071 | + | |
| 3072 | + ====== ================================================================= | |
| 3073 | + EINVAL the target is unknown, or the combination of features is invalid. | |
| 3074 | + ENOENT a features bit specified is unknown. | |
| 3075 | + ====== ================================================================= | |
| 2793 | 3076 | |
| 2794 | 3077 | This tells KVM what type of CPU to present to the guest, and what |
| 2795 | 3078 | optional features it should have. This will cause a reset of the cpu |
| @@ -2805,6 +3088,7 @@ state. All calls to this function after the initial call must use the same · 9 unmodified lines | ||
| 2805 | 3088 | target and same set of feature flags, otherwise EINVAL will be returned. |
| 2806 | 3089 | |
| 2807 | 3090 | Possible features: |
| 3091 | + | |
| 2808 | 3092 | - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. |
| 2809 | 3093 | Depends on KVM_CAP_ARM_PSCI. If not set, the CPU will be powered on |
| 2810 | 3094 | and execute guest code when KVM_RUN is called. |
| @@ -2861,14 +3145,19 @@ Possible features: · 50 unmodified lines | ||
| 2861 | 3145 | no longer be written using KVM_SET_ONE_REG. |
| 2862 | 3146 | |
| 2863 | 3147 | 4.83 KVM_ARM_PREFERRED_TARGET |
| 3148 | +----------------------------- | |
| 3149 | + | |
| 3150 | +:Capability: basic | |
| 3151 | +:Architectures: arm, arm64 | |
| 3152 | +:Type: vm ioctl | |
| 3153 | +:Parameters: struct struct kvm_vcpu_init (out) | |
| 3154 | +:Returns: 0 on success; -1 on error | |
| 2864 | 3155 | |
| 2865 | −Capability: basic | |
| 2866 | −Architectures: arm, arm64 | |
| 2867 | −Type: vm ioctl | |
| 2868 | −Parameters: struct struct kvm_vcpu_init (out) | |
| 2869 | −Returns: 0 on success; -1 on error | |
| 2870 | 3156 | Errors: |
| 2871 | − ENODEV: no preferred target available for the host | |
| 3157 | + | |
| 3158 | + ====== ========================================== | |
| 3159 | + ENODEV no preferred target available for the host | |
| 3160 | + ====== ========================================== | |
| 2872 | 3161 | |
| 2873 | 3162 | This queries KVM for preferred CPU target type which can be emulated |
| 2874 | 3163 | by KVM on underlying host. |
| @@ -2885,43 +3174,57 @@ in VCPU matching underlying host. · 10 unmodified lines | ||
| 2885 | 3174 | |
| 2886 | 3175 | |
| 2887 | 3176 | 4.84 KVM_GET_REG_LIST |
| 3177 | +--------------------- | |
| 3178 | + | |
| 3179 | +:Capability: basic | |
| 3180 | +:Architectures: arm, arm64, mips | |
| 3181 | +:Type: vcpu ioctl | |
| 3182 | +:Parameters: struct kvm_reg_list (in/out) | |
| 3183 | +:Returns: 0 on success; -1 on error | |
| 2888 | 3184 | |
| 2889 | −Capability: basic | |
| 2890 | −Architectures: arm, arm64, mips | |
| 2891 | −Type: vcpu ioctl | |
| 2892 | −Parameters: struct kvm_reg_list (in/out) | |
| 2893 | −Returns: 0 on success; -1 on error | |
| 2894 | 3185 | Errors: |
| 2895 | − E2BIG: the reg index list is too big to fit in the array specified by | |
| 3186 | + | |
| 3187 | + ===== ============================================================== | |
| 3188 | + E2BIG the reg index list is too big to fit in the array specified by | |
| 2896 | 3189 | the user (the number required will be written into n). |
| 3190 | + ===== ============================================================== | |
| 3191 | + | |
| 3192 | +:: | |
| 2897 | 3193 | |
| 2898 | −struct kvm_reg_list { | |
| 3194 | + struct kvm_reg_list { | |
| 2899 | 3195 | __u64 n; /* number of registers in reg[] */ |
| 2900 | 3196 | __u64 reg[0]; |
| 2901 | −}; | |
| 3197 | + }; | |
| 2902 | 3198 | |
| 2903 | 3199 | This ioctl returns the guest registers that are supported for the |
| 2904 | 3200 | KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. |
| 2905 | 3201 | |
| 2906 | 3202 | |
| 2907 | 3203 | 4.85 KVM_ARM_SET_DEVICE_ADDR (deprecated) |
| 3204 | +----------------------------------------- | |
| 3205 | + | |
| 3206 | +:Capability: KVM_CAP_ARM_SET_DEVICE_ADDR | |
| 3207 | +:Architectures: arm, arm64 | |
| 3208 | +:Type: vm ioctl | |
| 3209 | +:Parameters: struct kvm_arm_device_address (in) | |
| 3210 | +:Returns: 0 on success, -1 on error | |
| 2908 | 3211 | |
| 2909 | −Capability: KVM_CAP_ARM_SET_DEVICE_ADDR | |
| 2910 | −Architectures: arm, arm64 | |
| 2911 | −Type: vm ioctl | |
| 2912 | −Parameters: struct kvm_arm_device_address (in) | |
| 2913 | −Returns: 0 on success, -1 on error | |
| 2914 | 3212 | Errors: |
| 2915 | − ENODEV: The device id is unknown | |
| 2916 | − ENXIO: Device not supported on current system | |
| 2917 | − EEXIST: Address already set | |
| 2918 | − E2BIG: Address outside guest physical address space | |
| 2919 | − EBUSY: Address overlaps with other device range | |
| 2920 | 3213 | |
| 2921 | −struct kvm_arm_device_addr { | |
| 3214 | + ====== ============================================ | |
| 3215 | + ENODEV The device id is unknown | |
| 3216 | + ENXIO Device not supported on current system | |
| 3217 | + EEXIST Address already set | |
| 3218 | + E2BIG Address outside guest physical address space | |
| 3219 | + EBUSY Address overlaps with other device range | |
| 3220 | + ====== ============================================ | |
| 3221 | + | |
| 3222 | +:: | |
| 3223 | + | |
| 3224 | + struct kvm_arm_device_addr { | |
| 2922 | 3225 | __u64 id; |
| 2923 | 3226 | __u64 addr; |
| 2924 | −}; | |
| 3227 | + }; | |
| 2925 | 3228 | |
| 2926 | 3229 | Specify a device address in the guest's physical address space where guests |
| 2927 | 3230 | can access emulated or directly exposed devices, which the host kernel needs |
| @@ -2929,7 +3232,7 @@ to know about. The id field is an architecture specific identifier for a · 1 unmodified line | ||
| 2929 | 3232 | specific device. |
| 2930 | 3233 | |
| 2931 | 3234 | ARM/arm64 divides the id field into two parts, a device id and an |
| 2932 | −address type id specific to the individual device. | |
| 3235 | +address type id specific to the individual device:: | |
| 2933 | 3236 | |
| 2934 | 3237 | bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 | |
| 2935 | 3238 | field: | 0x00000000 | device id | addr type id | |
| @@ -2947,12 +3250,13 @@ should be used instead. · 11 unmodified lines | ||
| 2947 | 3250 | |
| 2948 | 3251 | |
| 2949 | 3252 | 4.86 KVM_PPC_RTAS_DEFINE_TOKEN |
| 3253 | +------------------------------ | |
| 2950 | 3254 | |
| 2951 | −Capability: KVM_CAP_PPC_RTAS | |
| 2952 | −Architectures: ppc | |
| 2953 | −Type: vm ioctl | |
| 2954 | −Parameters: struct kvm_rtas_token_args | |
| 2955 | −Returns: 0 on success, -1 on error | |
| 3255 | +:Capability: KVM_CAP_PPC_RTAS | |
| 3256 | +:Architectures: ppc | |
| 3257 | +:Type: vm ioctl | |
| 3258 | +:Parameters: struct kvm_rtas_token_args | |
| 3259 | +:Returns: 0 on success, -1 on error | |
| 2956 | 3260 | |
| 2957 | 3261 | Defines a token value for a RTAS (Run Time Abstraction Services) |
| 2958 | 3262 | service in order to allow it to be handled in the kernel. The |
| @@ -2966,18 +3270,21 @@ calls by the guest for that service will be passed to userspace to be · 7 unmodified lines | ||
| 2966 | 3270 | handled. |
| 2967 | 3271 | |
| 2968 | 3272 | 4.87 KVM_SET_GUEST_DEBUG |
| 3273 | +------------------------ | |
| 2969 | 3274 | |
| 2970 | −Capability: KVM_CAP_SET_GUEST_DEBUG | |
| 2971 | −Architectures: x86, s390, ppc, arm64 | |
| 2972 | −Type: vcpu ioctl | |
| 2973 | −Parameters: struct kvm_guest_debug (in) | |
| 2974 | −Returns: 0 on success; -1 on error | |
| 3275 | +:Capability: KVM_CAP_SET_GUEST_DEBUG | |
| 3276 | +:Architectures: x86, s390, ppc, arm64 | |
| 3277 | +:Type: vcpu ioctl | |
| 3278 | +:Parameters: struct kvm_guest_debug (in) | |
| 3279 | +:Returns: 0 on success; -1 on error | |
| 2975 | 3280 | |
| 2976 | −struct kvm_guest_debug { | |
| 3281 | +:: | |
| 3282 | + | |
| 3283 | + struct kvm_guest_debug { | |
| 2977 | 3284 | __u32 control; |
| 2978 | 3285 | __u32 pad; |
| 2979 | 3286 | struct kvm_guest_debug_arch arch; |
| 2980 | −}; | |
| 3287 | + }; | |
| 2981 | 3288 | |
| 2982 | 3289 | Set up the processor specific debug registers and configure vcpu for |
| 2983 | 3290 | handling guest debug events. There are two parts to the structure, the |
| @@ -3019,26 +3326,31 @@ KVM_EXIT_DEBUG with the kvm_debug_exit_arch part of the kvm_run · 35 unmodified lines | ||
| 3019 | 3326 | structure containing architecture specific debug information. |
| 3020 | 3327 | |
| 3021 | 3328 | 4.88 KVM_GET_EMULATED_CPUID |
| 3329 | +--------------------------- | |
| 3330 | + | |
| 3331 | +:Capability: KVM_CAP_EXT_EMUL_CPUID | |
| 3332 | +:Architectures: x86 | |
| 3333 | +:Type: system ioctl | |
| 3334 | +:Parameters: struct kvm_cpuid2 (in/out) | |
| 3335 | +:Returns: 0 on success, -1 on error | |
| 3022 | 3336 | |
| 3023 | −Capability: KVM_CAP_EXT_EMUL_CPUID | |
| 3024 | −Architectures: x86 | |
| 3025 | −Type: system ioctl | |
| 3026 | −Parameters: struct kvm_cpuid2 (in/out) | |
| 3027 | −Returns: 0 on success, -1 on error | |
| 3337 | +:: | |
| 3028 | 3338 | |
| 3029 | −struct kvm_cpuid2 { | |
| 3339 | + struct kvm_cpuid2 { | |
| 3030 | 3340 | __u32 nent; |
| 3031 | 3341 | __u32 flags; |
| 3032 | 3342 | struct kvm_cpuid_entry2 entries[0]; |
| 3033 | −}; | |
| 3343 | + }; | |
| 3034 | 3344 | |
| 3035 | 3345 | The member 'flags' is used for passing flags from userspace. |
| 3036 | 3346 | |
| 3037 | −#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0) | |
| 3038 | −#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1) | |
| 3039 | −#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2) | |
| 3347 | +:: | |
| 3040 | 3348 | |
| 3041 | −struct kvm_cpuid_entry2 { | |
| 3349 | + #define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0) | |
| 3350 | + #define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1) | |
| 3351 | + #define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2) | |
| 3352 | + | |
| 3353 | + struct kvm_cpuid_entry2 { | |
| 3042 | 3354 | __u32 function; |
| 3043 | 3355 | __u32 index; |
| 3044 | 3356 | __u32 flags; |
| @@ -3047,7 +3359,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines | ||
| 3047 | 3359 | __u32 ecx; |
| 3048 | 3360 | __u32 edx; |
| 3049 | 3361 | __u32 padding[3]; |
| 3050 | −}; | |
| 3362 | + }; | |
| 3051 | 3363 | |
| 3052 | 3364 | This ioctl returns x86 cpuid features which are emulated by |
| 3053 | 3365 | kvm.Userspace can use the information returned by this ioctl to query |
| @@ -3072,10 +3384,14 @@ emulated efficiently and thus not included here. · 18 unmodified lines | ||
| 3072 | 3384 | |
| 3073 | 3385 | The fields in each entry are defined as follows: |
| 3074 | 3386 | |
| 3075 | − function: the eax value used to obtain the entry | |
| 3076 | − index: the ecx value used to obtain the entry (for entries that are | |
| 3387 | + function: | |
| 3388 | + the eax value used to obtain the entry | |
| 3389 | + index: | |
| 3390 | + the ecx value used to obtain the entry (for entries that are | |
| 3077 | 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 | 3395 | KVM_CPUID_FLAG_SIGNIFCANT_INDEX: |
| 3080 | 3396 | if the index field is valid |
| 3081 | 3397 | KVM_CPUID_FLAG_STATEFUL_FUNC: |
| @@ -3085,24 +3401,28 @@ The fields in each entry are defined as follows: · 3 unmodified lines | ||
| 3085 | 3401 | KVM_CPUID_FLAG_STATE_READ_NEXT: |
| 3086 | 3402 | for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is |
| 3087 | 3403 | the first entry to be read by a cpu |
| 3088 | − eax, ebx, ecx, edx: the values returned by the cpuid instruction for | |
| 3404 | + | |
| 3405 | + eax, ebx, ecx, edx: | |
| 3406 | + | |
| 3407 | + the values returned by the cpuid instruction for | |
| 3089 | 3408 | this function/index combination |
| 3090 | 3409 | |
| 3091 | 3410 | 4.89 KVM_S390_MEM_OP |
| 3411 | +-------------------- | |
| 3092 | 3412 | |
| 3093 | −Capability: KVM_CAP_S390_MEM_OP | |
| 3094 | −Architectures: s390 | |
| 3095 | −Type: vcpu ioctl | |
| 3096 | −Parameters: struct kvm_s390_mem_op (in) | |
| 3097 | −Returns: = 0 on success, | |
| 3098 | − < 0 on generic error (e.g. -EFAULT or -ENOMEM), | |
| 3099 | − > 0 if an exception occurred while walking the page tables | |
| 3413 | +:Capability: KVM_CAP_S390_MEM_OP | |
| 3414 | +:Architectures: s390 | |
| 3415 | +:Type: vcpu ioctl | |
| 3416 | +:Parameters: struct kvm_s390_mem_op (in) | |
| 3417 | +:Returns: = 0 on success, | |
| 3418 | + < 0 on generic error (e.g. -EFAULT or -ENOMEM), | |
| 3419 | + > 0 if an exception occurred while walking the page tables | |
| 3100 | 3420 | |
| 3101 | 3421 | Read or write data from/to the logical (virtual) memory of a VCPU. |
| 3102 | 3422 | |
| 3103 | −Parameters are specified via the following structure: | |
| 3423 | +Parameters are specified via the following structure:: | |
| 3104 | 3424 | |
| 3105 | −struct kvm_s390_mem_op { | |
| 3425 | + struct kvm_s390_mem_op { | |
| 3106 | 3426 | __u64 gaddr; /* the guest address */ |
| 3107 | 3427 | __u64 flags; /* flags */ |
| 3108 | 3428 | __u32 size; /* amount of bytes */ |
| @@ -3110,7 +3430,7 @@ struct kvm_s390_mem_op { · 1 unmodified line | ||
| 3110 | 3430 | __u64 buf; /* buffer in userspace */ |
| 3111 | 3431 | __u8 ar; /* the access register number */ |
| 3112 | 3432 | __u8 reserved[31]; /* should be set to 0 */ |
| 3113 | −}; | |
| 3433 | + }; | |
| 3114 | 3434 | |
| 3115 | 3435 | The type of operation is specified in the "op" field. It is either |
| 3116 | 3436 | KVM_S390_MEMOP_LOGICAL_READ for reading from logical memory space or |
| @@ -3137,24 +3457,25 @@ The "reserved" field is meant for future extensions. It is not used by · 20 unmodified lines | ||
| 3137 | 3457 | KVM with the currently defined set of flags. |
| 3138 | 3458 | |
| 3139 | 3459 | 4.90 KVM_S390_GET_SKEYS |
| 3460 | +----------------------- | |
| 3140 | 3461 | |
| 3141 | −Capability: KVM_CAP_S390_SKEYS | |
| 3142 | −Architectures: s390 | |
| 3143 | −Type: vm ioctl | |
| 3144 | −Parameters: struct kvm_s390_skeys | |
| 3145 | −Returns: 0 on success, KVM_S390_GET_KEYS_NONE if guest is not using storage | |
| 3146 | − keys, negative value on error | |
| 3462 | +:Capability: KVM_CAP_S390_SKEYS | |
| 3463 | +:Architectures: s390 | |
| 3464 | +:Type: vm ioctl | |
| 3465 | +:Parameters: struct kvm_s390_skeys | |
| 3466 | +:Returns: 0 on success, KVM_S390_GET_KEYS_NONE if guest is not using storage | |
| 3467 | + keys, negative value on error | |
| 3147 | 3468 | |
| 3148 | 3469 | This ioctl is used to get guest storage key values on the s390 |
| 3149 | −architecture. The ioctl takes parameters via the kvm_s390_skeys struct. | |
| 3470 | +architecture. The ioctl takes parameters via the kvm_s390_skeys struct:: | |
| 3150 | 3471 | |
| 3151 | −struct kvm_s390_skeys { | |
| 3472 | + struct kvm_s390_skeys { | |
| 3152 | 3473 | __u64 start_gfn; |
| 3153 | 3474 | __u64 count; |
| 3154 | 3475 | __u64 skeydata_addr; |
| 3155 | 3476 | __u32 flags; |
| 3156 | 3477 | __u32 reserved[9]; |
| 3157 | −}; | |
| 3478 | + }; | |
| 3158 | 3479 | |
| 3159 | 3480 | The start_gfn field is the number of the first guest frame whose storage keys |
| 3160 | 3481 | you want to get. |
| @@ -3168,12 +3489,13 @@ The skeydata_addr field is the address to a buffer large enough to hold count · 7 unmodified lines | ||
| 3168 | 3489 | bytes. This buffer will be filled with storage key data by the ioctl. |
| 3169 | 3490 | |
| 3170 | 3491 | 4.91 KVM_S390_SET_SKEYS |
| 3492 | +----------------------- | |
| 3171 | 3493 | |
| 3172 | −Capability: KVM_CAP_S390_SKEYS | |
| 3173 | −Architectures: s390 | |
| 3174 | −Type: vm ioctl | |
| 3175 | −Parameters: struct kvm_s390_skeys | |
| 3176 | −Returns: 0 on success, negative value on error | |
| 3494 | +:Capability: KVM_CAP_S390_SKEYS | |
| 3495 | +:Architectures: s390 | |
| 3496 | +:Type: vm ioctl | |
| 3497 | +:Parameters: struct kvm_s390_skeys | |
| 3498 | +:Returns: 0 on success, negative value on error | |
| 3177 | 3499 | |
| 3178 | 3500 | This ioctl is used to set guest storage key values on the s390 |
| 3179 | 3501 | architecture. The ioctl takes parameters via the kvm_s390_skeys struct. |
| @@ -3195,21 +3517,27 @@ Note: If any architecturally invalid key value is found in the given data then · 15 unmodified lines | ||
| 3195 | 3517 | the ioctl will return -EINVAL. |
| 3196 | 3518 | |
| 3197 | 3519 | 4.92 KVM_S390_IRQ |
| 3520 | +----------------- | |
| 3521 | + | |
| 3522 | +:Capability: KVM_CAP_S390_INJECT_IRQ | |
| 3523 | +:Architectures: s390 | |
| 3524 | +:Type: vcpu ioctl | |
| 3525 | +:Parameters: struct kvm_s390_irq (in) | |
| 3526 | +:Returns: 0 on success, -1 on error | |
| 3198 | 3527 | |
| 3199 | −Capability: KVM_CAP_S390_INJECT_IRQ | |
| 3200 | −Architectures: s390 | |
| 3201 | −Type: vcpu ioctl | |
| 3202 | −Parameters: struct kvm_s390_irq (in) | |
| 3203 | −Returns: 0 on success, -1 on error | |
| 3204 | 3528 | Errors: |
| 3205 | − EINVAL: interrupt type is invalid | |
| 3206 | − type is KVM_S390_SIGP_STOP and flag parameter is invalid value | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + ====== ================================================================= | |
| 3532 | + EINVAL interrupt type is invalid | |
| 3533 | + type is KVM_S390_SIGP_STOP and flag parameter is invalid value, | |
| 3207 | 3534 | type is KVM_S390_INT_EXTERNAL_CALL and code is bigger |
| 3208 | − than the maximum of VCPUs | |
| 3209 | − EBUSY: type is KVM_S390_SIGP_SET_PREFIX and vcpu is not stopped | |
| 3210 | − type is KVM_S390_SIGP_STOP and a stop irq is already pending | |
| 3535 | + than the maximum of VCPUs | |
| 3536 | + EBUSY type is KVM_S390_SIGP_SET_PREFIX and vcpu is not stopped, | |
| 3537 | + type is KVM_S390_SIGP_STOP and a stop irq is already pending, | |
| 3211 | 3538 | type is KVM_S390_INT_EXTERNAL_CALL and an external call interrupt |
| 3212 | − is already pending | |
| 3539 | + is already pending | |
| 3540 | + ====== ================================================================= | |
| 3213 | 3541 | |
| 3214 | 3542 | Allows 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 | ||
| 3217 | 3545 | to inject additional payload which is not |
| 3218 | 3546 | possible via KVM_S390_INTERRUPT. |
| 3219 | 3547 | |
| 3220 | −Interrupt parameters are passed via kvm_s390_irq: | |
| 3548 | +Interrupt parameters are passed via kvm_s390_irq:: | |
| 3221 | 3549 | |
| 3222 | −struct kvm_s390_irq { | |
| 3550 | + struct kvm_s390_irq { | |
| 3223 | 3551 | __u64 type; |
| 3224 | 3552 | union { |
| 3225 | 3553 | struct kvm_s390_io_info io; |
| @@ -3232,44 +3560,45 @@ struct kvm_s390_irq { · 6 unmodified lines | ||
| 3232 | 3560 | struct kvm_s390_mchk_info mchk; |
| 3233 | 3561 | char reserved[64]; |
| 3234 | 3562 | } u; |
| 3235 | −}; | |
| 3563 | + }; | |
| 3236 | 3564 | |
| 3237 | 3565 | type can be one of the following: |
| 3238 | 3566 | |
| 3239 | −KVM_S390_SIGP_STOP - sigp stop; parameter in .stop | |
| 3240 | −KVM_S390_PROGRAM_INT - program check; parameters in .pgm | |
| 3241 | −KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix | |
| 3242 | −KVM_S390_RESTART - restart; no parameters | |
| 3243 | −KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters | |
| 3244 | −KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters | |
| 3245 | −KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg | |
| 3246 | −KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall | |
| 3247 | −KVM_S390_MCHK - machine check interrupt; parameters in .mchk | |
| 3567 | +- KVM_S390_SIGP_STOP - sigp stop; parameter in .stop | |
| 3568 | +- KVM_S390_PROGRAM_INT - program check; parameters in .pgm | |
| 3569 | +- KVM_S390_SIGP_SET_PREFIX - sigp set prefix; parameters in .prefix | |
| 3570 | +- KVM_S390_RESTART - restart; no parameters | |
| 3571 | +- KVM_S390_INT_CLOCK_COMP - clock comparator interrupt; no parameters | |
| 3572 | +- KVM_S390_INT_CPU_TIMER - CPU timer interrupt; no parameters | |
| 3573 | +- KVM_S390_INT_EMERGENCY - sigp emergency; parameters in .emerg | |
| 3574 | +- KVM_S390_INT_EXTERNAL_CALL - sigp external call; parameters in .extcall | |
| 3575 | +- KVM_S390_MCHK - machine check interrupt; parameters in .mchk | |
| 3248 | 3576 | |
| 3249 | 3577 | This is an asynchronous vcpu ioctl and can be invoked from any thread. |
| 3250 | 3578 | |
| 3251 | 3579 | 4.94 KVM_S390_GET_IRQ_STATE |
| 3580 | +--------------------------- | |
| 3252 | 3581 | |
| 3253 | −Capability: KVM_CAP_S390_IRQ_STATE | |
| 3254 | −Architectures: s390 | |
| 3255 | −Type: vcpu ioctl | |
| 3256 | −Parameters: struct kvm_s390_irq_state (out) | |
| 3257 | −Returns: >= number of bytes copied into buffer, | |
| 3258 | − -EINVAL if buffer size is 0, | |
| 3259 | − -ENOBUFS if buffer size is too small to fit all pending interrupts, | |
| 3260 | − -EFAULT if the buffer address was invalid | |
| 3582 | +:Capability: KVM_CAP_S390_IRQ_STATE | |
| 3583 | +:Architectures: s390 | |
| 3584 | +:Type: vcpu ioctl | |
| 3585 | +:Parameters: struct kvm_s390_irq_state (out) | |
| 3586 | +:Returns: >= number of bytes copied into buffer, | |
| 3587 | + -EINVAL if buffer size is 0, | |
| 3588 | + -ENOBUFS if buffer size is too small to fit all pending interrupts, | |
| 3589 | + -EFAULT if the buffer address was invalid | |
| 3261 | 3590 | |
| 3262 | 3591 | This ioctl allows userspace to retrieve the complete state of all currently |
| 3263 | 3592 | pending interrupts in a single buffer. Use cases include migration |
| 3264 | 3593 | and introspection. The parameter structure contains the address of a |
| 3265 | −userspace buffer and its length: | |
| 3594 | +userspace buffer and its length:: | |
| 3266 | 3595 | |
| 3267 | −struct kvm_s390_irq_state { | |
| 3596 | + struct kvm_s390_irq_state { | |
| 3268 | 3597 | __u64 buf; |
| 3269 | 3598 | __u32 flags; /* will stay unused for compatibility reasons */ |
| 3270 | 3599 | __u32 len; |
| 3271 | 3600 | __u32 reserved[4]; /* will stay unused for compatibility reasons */ |
| 3272 | −}; | |
| 3601 | + }; | |
| 3273 | 3602 | |
| 3274 | 3603 | Userspace passes in the above struct and for each pending interrupt a |
| 3275 | 3604 | struct kvm_s390_irq is copied to the provided buffer. |
| @@ -3283,29 +3612,30 @@ If -ENOBUFS is returned the buffer provided was too small and userspace · 7 unmodified lines | ||
| 3283 | 3612 | may retry with a bigger buffer. |
| 3284 | 3613 | |
| 3285 | 3614 | 4.95 KVM_S390_SET_IRQ_STATE |
| 3286 | − | |
| 3287 | −Capability: KVM_CAP_S390_IRQ_STATE | |
| 3288 | −Architectures: s390 | |
| 3289 | −Type: vcpu ioctl | |
| 3290 | −Parameters: struct kvm_s390_irq_state (in) | |
| 3291 | −Returns: 0 on success, | |
| 3292 | − -EFAULT if the buffer address was invalid, | |
| 3293 | − -EINVAL for an invalid buffer length (see below), | |
| 3294 | − -EBUSY if there were already interrupts pending, | |
| 3295 | − errors occurring when actually injecting the | |
| 3615 | +--------------------------- | |
| 3616 | + | |
| 3617 | +:Capability: KVM_CAP_S390_IRQ_STATE | |
| 3618 | +:Architectures: s390 | |
| 3619 | +:Type: vcpu ioctl | |
| 3620 | +:Parameters: struct kvm_s390_irq_state (in) | |
| 3621 | +:Returns: 0 on success, | |
| 3622 | + -EFAULT if the buffer address was invalid, | |
| 3623 | + -EINVAL for an invalid buffer length (see below), | |
| 3624 | + -EBUSY if there were already interrupts pending, | |
| 3625 | + errors occurring when actually injecting the | |
| 3296 | 3626 | interrupt. See KVM_S390_IRQ. |
| 3297 | 3627 | |
| 3298 | 3628 | This ioctl allows userspace to set the complete state of all cpu-local |
| 3299 | 3629 | interrupts currently pending for the vcpu. It is intended for restoring |
| 3300 | 3630 | interrupt state after a migration. The input parameter is a userspace buffer |
| 3301 | −containing a struct kvm_s390_irq_state: | |
| 3631 | +containing a struct kvm_s390_irq_state:: | |
| 3302 | 3632 | |
| 3303 | −struct kvm_s390_irq_state { | |
| 3633 | + struct kvm_s390_irq_state { | |
| 3304 | 3634 | __u64 buf; |
| 3305 | 3635 | __u32 flags; /* will stay unused for compatibility reasons */ |
| 3306 | 3636 | __u32 len; |
| 3307 | 3637 | __u32 reserved[4]; /* will stay unused for compatibility reasons */ |
| 3308 | −}; | |
| 3638 | + }; | |
| 3309 | 3639 | |
| 3310 | 3640 | The restrictions for flags and reserved apply as well. |
| 3311 | 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 | ||
| 3320 | 3650 | which is the maximum number of possibly pending cpu-local interrupts. |
| 3321 | 3651 | |
| 3322 | 3652 | 4.96 KVM_SMI |
| 3653 | +------------ | |
| 3323 | 3654 | |
| 3324 | −Capability: KVM_CAP_X86_SMM | |
| 3325 | −Architectures: x86 | |
| 3326 | −Type: vcpu ioctl | |
| 3327 | −Parameters: none | |
| 3328 | −Returns: 0 on success, -1 on error | |
| 3655 | +:Capability: KVM_CAP_X86_SMM | |
| 3656 | +:Architectures: x86 | |
| 3657 | +:Type: vcpu ioctl | |
| 3658 | +:Parameters: none | |
| 3659 | +:Returns: 0 on success, -1 on error | |
| 3329 | 3660 | |
| 3330 | 3661 | Queues an SMI on the thread's vcpu. |
| 3331 | 3662 | |
| 3332 | 3663 | 4.97 KVM_CAP_PPC_MULTITCE |
| 3664 | +------------------------- | |
| 3333 | 3665 | |
| 3334 | −Capability: KVM_CAP_PPC_MULTITCE | |
| 3335 | −Architectures: ppc | |
| 3336 | −Type: vm | |
| 3666 | +:Capability: KVM_CAP_PPC_MULTITCE | |
| 3667 | +:Architectures: ppc | |
| 3668 | +:Type: vm | |
| 3337 | 3669 | |
| 3338 | 3670 | This capability means the kernel is capable of handling hypercalls |
| 3339 | 3671 | H_PUT_TCE_INDIRECT and H_STUFF_TCE without passing those into the user |
| @@ -3355,26 +3687,27 @@ an implementation for these despite the in kernel acceleration. · 15 unmodified lines | ||
| 3355 | 3687 | This capability is always enabled. |
| 3356 | 3688 | |
| 3357 | 3689 | 4.98 KVM_CREATE_SPAPR_TCE_64 |
| 3690 | +---------------------------- | |
| 3358 | 3691 | |
| 3359 | −Capability: KVM_CAP_SPAPR_TCE_64 | |
| 3360 | −Architectures: powerpc | |
| 3361 | −Type: vm ioctl | |
| 3362 | −Parameters: struct kvm_create_spapr_tce_64 (in) | |
| 3363 | −Returns: file descriptor for manipulating the created TCE table | |
| 3692 | +:Capability: KVM_CAP_SPAPR_TCE_64 | |
| 3693 | +:Architectures: powerpc | |
| 3694 | +:Type: vm ioctl | |
| 3695 | +:Parameters: struct kvm_create_spapr_tce_64 (in) | |
| 3696 | +:Returns: file descriptor for manipulating the created TCE table | |
| 3364 | 3697 | |
| 3365 | 3698 | This is an extension for KVM_CAP_SPAPR_TCE which only supports 32bit |
| 3366 | 3699 | windows, described in 4.62 KVM_CREATE_SPAPR_TCE |
| 3367 | 3700 | |
| 3368 | −This capability uses extended struct in ioctl interface: | |
| 3701 | +This capability uses extended struct in ioctl interface:: | |
| 3369 | 3702 | |
| 3370 | −/* for KVM_CAP_SPAPR_TCE_64 */ | |
| 3371 | −struct kvm_create_spapr_tce_64 { | |
| 3703 | + /* for KVM_CAP_SPAPR_TCE_64 */ | |
| 3704 | + struct kvm_create_spapr_tce_64 { | |
| 3372 | 3705 | __u64 liobn; |
| 3373 | 3706 | __u32 page_shift; |
| 3374 | 3707 | __u32 flags; |
| 3375 | 3708 | __u64 offset; /* in pages */ |
| 3376 | 3709 | __u64 size; /* in pages */ |
| 3377 | −}; | |
| 3710 | + }; | |
| 3378 | 3711 | |
| 3379 | 3712 | The aim of extension is to support an additional bigger DMA window with |
| 3380 | 3713 | a variable page size. |
| @@ -3387,12 +3720,13 @@ of IOMMU pages. · 6 unmodified lines | ||
| 3387 | 3720 | The rest of functionality is identical to KVM_CREATE_SPAPR_TCE. |
| 3388 | 3721 | |
| 3389 | 3722 | 4.99 KVM_REINJECT_CONTROL |
| 3723 | +------------------------- | |
| 3390 | 3724 | |
| 3391 | −Capability: KVM_CAP_REINJECT_CONTROL | |
| 3392 | −Architectures: x86 | |
| 3393 | −Type: vm ioctl | |
| 3394 | −Parameters: struct kvm_reinject_control (in) | |
| 3395 | −Returns: 0 on success, | |
| 3725 | +:Capability: KVM_CAP_REINJECT_CONTROL | |
| 3726 | +:Architectures: x86 | |
| 3727 | +:Type: vm ioctl | |
| 3728 | +:Parameters: struct kvm_reinject_control (in) | |
| 3729 | +:Returns: 0 on success, | |
| 3396 | 3730 | -EFAULT if struct kvm_reinject_control cannot be read, |
| 3397 | 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 | ||
| 3402 | 3736 | interrupt whenever there isn't a pending interrupt from i8254. |
| 3403 | 3737 | !reinject mode injects an interrupt as soon as a tick arrives. |
| 3404 | 3738 | |
| 3405 | −struct kvm_reinject_control { | |
| 3739 | +:: | |
| 3740 | + | |
| 3741 | + struct kvm_reinject_control { | |
| 3406 | 3742 | __u8 pit_reinject; |
| 3407 | 3743 | __u8 reserved[31]; |
| 3408 | −}; | |
| 3744 | + }; | |
| 3409 | 3745 | |
| 3410 | 3746 | pit_reinject = 0 (!reinject mode) is recommended, unless running an old |
| 3411 | 3747 | operating system that uses the PIT for timing (e.g. Linux 2.4.x). |
| 3412 | 3748 | |
| 3413 | 3749 | 4.100 KVM_PPC_CONFIGURE_V3_MMU |
| 3750 | +------------------------------ | |
| 3414 | 3751 | |
| 3415 | −Capability: KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3 | |
| 3416 | −Architectures: ppc | |
| 3417 | −Type: vm ioctl | |
| 3418 | −Parameters: struct kvm_ppc_mmuv3_cfg (in) | |
| 3419 | −Returns: 0 on success, | |
| 3752 | +:Capability: KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3 | |
| 3753 | +:Architectures: ppc | |
| 3754 | +:Type: vm ioctl | |
| 3755 | +:Parameters: struct kvm_ppc_mmuv3_cfg (in) | |
| 3756 | +:Returns: 0 on success, | |
| 3420 | 3757 | -EFAULT if struct kvm_ppc_mmuv3_cfg cannot be read, |
| 3421 | 3758 | -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 | ||
| 3424 | 3761 | page table) translation, and sets the pointer to the process table for |
| 3425 | 3762 | the guest. |
| 3426 | 3763 | |
| 3427 | −struct kvm_ppc_mmuv3_cfg { | |
| 3764 | +:: | |
| 3765 | + | |
| 3766 | + struct kvm_ppc_mmuv3_cfg { | |
| 3428 | 3767 | __u64 flags; |
| 3429 | 3768 | __u64 process_table; |
| 3430 | −}; | |
| 3769 | + }; | |
| 3431 | 3770 | |
| 3432 | 3771 | There are two bits that can be set in flags; KVM_PPC_MMUV3_RADIX and |
| 3433 | 3772 | KVM_PPC_MMUV3_GTSE. KVM_PPC_MMUV3_RADIX, if set, configures the guest |
| @@ -3442,12 +3781,13 @@ as the second doubleword of the partition table entry, as defined in · 8 unmodified lines | ||
| 3442 | 3781 | the Power ISA V3.00, Book III section 5.7.6.1. |
| 3443 | 3782 | |
| 3444 | 3783 | 4.101 KVM_PPC_GET_RMMU_INFO |
| 3784 | +--------------------------- | |
| 3445 | 3785 | |
| 3446 | −Capability: KVM_CAP_PPC_RADIX_MMU | |
| 3447 | −Architectures: ppc | |
| 3448 | −Type: vm ioctl | |
| 3449 | −Parameters: struct kvm_ppc_rmmu_info (out) | |
| 3450 | −Returns: 0 on success, | |
| 3786 | +:Capability: KVM_CAP_PPC_RADIX_MMU | |
| 3787 | +:Architectures: ppc | |
| 3788 | +:Type: vm ioctl | |
| 3789 | +:Parameters: struct kvm_ppc_rmmu_info (out) | |
| 3790 | +:Returns: 0 on success, | |
| 3451 | 3791 | -EFAULT if struct kvm_ppc_rmmu_info cannot be written, |
| 3452 | 3792 | -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 | ||
| 3456 | 3796 | page sizes to put in the "AP" (actual page size) field for the tlbie |
| 3457 | 3797 | (TLB invalidate entry) instruction. |
| 3458 | 3798 | |
| 3459 | −struct kvm_ppc_rmmu_info { | |
| 3799 | +:: | |
| 3800 | + | |
| 3801 | + struct kvm_ppc_rmmu_info { | |
| 3460 | 3802 | struct kvm_ppc_radix_geom { |
| 3461 | 3803 | __u8 page_shift; |
| 3462 | 3804 | __u8 level_bits[4]; |
| 3463 | 3805 | __u8 pad[3]; |
| 3464 | 3806 | } geometries[8]; |
| 3465 | 3807 | __u32 ap_encodings[8]; |
| 3466 | −}; | |
| 3808 | + }; | |
| 3467 | 3809 | |
| 3468 | 3810 | The geometries[] field gives up to 8 supported geometries for the |
| 3469 | 3811 | radix page table, in terms of the log base 2 of the smallest page |
| @@ -3476,19 +3818,54 @@ encodings, encoded with the AP value in the top 3 bits and the log · 6 unmodified lines | ||
| 3476 | 3818 | base 2 of the page size in the bottom 6 bits. |
| 3477 | 3819 | |
| 3478 | 3820 | 4.102 KVM_PPC_RESIZE_HPT_PREPARE |
| 3821 | +-------------------------------- | |
| 3479 | 3822 | |
| 3480 | −Capability: KVM_CAP_SPAPR_RESIZE_HPT | |
| 3481 | −Architectures: powerpc | |
| 3482 | −Type: vm ioctl | |
| 3483 | −Parameters: struct kvm_ppc_resize_hpt (in) | |
| 3484 | −Returns: 0 on successful completion, | |
| 3823 | +:Capability: KVM_CAP_SPAPR_RESIZE_HPT | |
| 3824 | +:Architectures: powerpc | |
| 3825 | +:Type: vm ioctl | |
| 3826 | +:Parameters: struct kvm_ppc_resize_hpt (in) | |
| 3827 | +:Returns: 0 on successful completion, | |
| 3485 | 3828 | >0 if a new HPT is being prepared, the value is an estimated |
| 3486 | − number of milliseconds until preparation is complete | |
| 3829 | + number of milliseconds until preparation is complete, | |
| 3487 | 3830 | -EFAULT if struct kvm_reinject_control cannot be read, |
| 3488 | − -EINVAL if the supplied shift or flags are invalid | |
| 3489 | − -ENOMEM if unable to allocate the new HPT | |
| 3490 | − -ENOSPC if there was a hash collision when moving existing | |
| 3491 | − HPT entries to the new HPT | |
| 3831 | + -EINVAL if the supplied shift or flags are invalid, | |
| 3832 | + -ENOMEM if unable to allocate the new HPT, | |
| 3833 | + -ENOSPC if there was a hash collision | |
| 3834 | + | |
| 3835 | +:: | |
| 3836 | + | |
| 3837 | + struct kvm_ppc_rmmu_info { | |
| 3838 | + struct kvm_ppc_radix_geom { | |
| 3839 | + __u8 page_shift; | |
| 3840 | + __u8 level_bits[4]; | |
| 3841 | + __u8 pad[3]; | |
| 3842 | + } geometries[8]; | |
| 3843 | + __u32 ap_encodings[8]; | |
| 3844 | + }; | |
| 3845 | + | |
| 3846 | +The geometries[] field gives up to 8 supported geometries for the | |
| 3847 | +radix page table, in terms of the log base 2 of the smallest page | |
| 3848 | +size, and the number of bits indexed at each level of the tree, from | |
| 3849 | +the PTE level up to the PGD level in that order. Any unused entries | |
| 3850 | +will have 0 in the page_shift field. | |
| 3851 | + | |
| 3852 | +The ap_encodings gives the supported page sizes and their AP field | |
| 3853 | +encodings, encoded with the AP value in the top 3 bits and the log | |
| 3854 | +base 2 of the page size in the bottom 6 bits. | |
| 3855 | + | |
| 3856 | +4.102 KVM_PPC_RESIZE_HPT_PREPARE | |
| 3857 | +-------------------------------- | |
| 3858 | + | |
| 3859 | +:Capability: KVM_CAP_SPAPR_RESIZE_HPT | |
| 3860 | +:Architectures: powerpc | |
| 3861 | +:Type: vm ioctl | |
| 3862 | +:Parameters: struct kvm_ppc_resize_hpt (in) | |
| 3863 | +:Returns: 0 on successful completion, | |
| 3864 | + >0 if a new HPT is being prepared, the value is an estimated | |
| 3865 | + number of milliseconds until preparation is complete, | |
| 3866 | + -EFAULT if struct kvm_reinject_control cannot be read, | |
| 3867 | + -EINVAL if the supplied shift or flags are invalid,when moving existing | |
| 3868 | + HPT entries to the new HPT, | |
| 3492 | 3869 | -EIO on other error conditions |
| 3493 | 3870 | |
| 3494 | 3871 | Used to implement the PAPR extension for runtime resizing of a guest's |
| @@ -3506,6 +3883,7 @@ requested in the parameters, discards the existing pending HPT and · 11 unmodified lines | ||
| 3506 | 3883 | creates a new one as above. |
| 3507 | 3884 | |
| 3508 | 3885 | If called when there is a pending HPT of the size requested, will: |
| 3886 | + | |
| 3509 | 3887 | * If preparation of the pending HPT is already complete, return 0 |
| 3510 | 3888 | * If preparation of the pending HPT has failed, return an error |
| 3511 | 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 | ||
| 3522 | 3900 | it returns <= 0. The first call will initiate preparation, subsequent |
| 3523 | 3901 | ones will monitor preparation until it completes or fails. |
| 3524 | 3902 | |
| 3525 | −struct kvm_ppc_resize_hpt { | |
| 3903 | +:: | |
| 3904 | + | |
| 3905 | + struct kvm_ppc_resize_hpt { | |
| 3526 | 3906 | __u64 flags; |
| 3527 | 3907 | __u32 shift; |
| 3528 | 3908 | __u32 pad; |
| 3529 | −}; | |
| 3909 | + }; | |
| 3530 | 3910 | |
| 3531 | 3911 | 4.103 KVM_PPC_RESIZE_HPT_COMMIT |
| 3912 | +------------------------------- | |
| 3532 | 3913 | |
| 3533 | −Capability: KVM_CAP_SPAPR_RESIZE_HPT | |
| 3534 | −Architectures: powerpc | |
| 3535 | −Type: vm ioctl | |
| 3536 | −Parameters: struct kvm_ppc_resize_hpt (in) | |
| 3537 | −Returns: 0 on successful completion, | |
| 3914 | +:Capability: KVM_CAP_SPAPR_RESIZE_HPT | |
| 3915 | +:Architectures: powerpc | |
| 3916 | +:Type: vm ioctl | |
| 3917 | +:Parameters: struct kvm_ppc_resize_hpt (in) | |
| 3918 | +:Returns: 0 on successful completion, | |
| 3538 | 3919 | -EFAULT if struct kvm_reinject_control cannot be read, |
| 3539 | − -EINVAL if the supplied shift or flags are invalid | |
| 3920 | + -EINVAL if the supplied shift or flags are invalid, | |
| 3540 | 3921 | -ENXIO is there is no pending HPT, or the pending HPT doesn't |
| 3541 | − have the requested size | |
| 3542 | − -EBUSY if the pending HPT is not fully prepared | |
| 3922 | + have the requested size, | |
| 3923 | + -EBUSY if the pending HPT is not fully prepared, | |
| 3543 | 3924 | -ENOSPC if there was a hash collision when moving existing |
| 3544 | − HPT entries to the new HPT | |
| 3925 | + HPT entries to the new HPT, | |
| 3545 | 3926 | -EIO on other error conditions |
| 3546 | 3927 | |
| 3547 | 3928 | Used to implement the PAPR extension for runtime resizing of a guest's |
| @@ -3564,31 +3945,35 @@ HPT and the previous HPT will be discarded. · 16 unmodified lines | ||
| 3564 | 3945 | |
| 3565 | 3946 | On failure, the guest will still be operating on its previous HPT. |
| 3566 | 3947 | |
| 3567 | −struct kvm_ppc_resize_hpt { | |
| 3948 | +:: | |
| 3949 | + | |
| 3950 | + struct kvm_ppc_resize_hpt { | |
| 3568 | 3951 | __u64 flags; |
| 3569 | 3952 | __u32 shift; |
| 3570 | 3953 | __u32 pad; |
| 3571 | −}; | |
| 3954 | + }; | |
| 3572 | 3955 | |
| 3573 | 3956 | 4.104 KVM_X86_GET_MCE_CAP_SUPPORTED |
| 3957 | +----------------------------------- | |
| 3574 | 3958 | |
| 3575 | −Capability: KVM_CAP_MCE | |
| 3576 | −Architectures: x86 | |
| 3577 | −Type: system ioctl | |
| 3578 | −Parameters: u64 mce_cap (out) | |
| 3579 | −Returns: 0 on success, -1 on error | |
| 3959 | +:Capability: KVM_CAP_MCE | |
| 3960 | +:Architectures: x86 | |
| 3961 | +:Type: system ioctl | |
| 3962 | +:Parameters: u64 mce_cap (out) | |
| 3963 | +:Returns: 0 on success, -1 on error | |
| 3580 | 3964 | |
| 3581 | 3965 | Returns supported MCE capabilities. The u64 mce_cap parameter |
| 3582 | 3966 | has the same format as the MSR_IA32_MCG_CAP register. Supported |
| 3583 | 3967 | capabilities will have the corresponding bits set. |
| 3584 | 3968 | |
| 3585 | 3969 | 4.105 KVM_X86_SETUP_MCE |
| 3970 | +----------------------- | |
| 3586 | 3971 | |
| 3587 | −Capability: KVM_CAP_MCE | |
| 3588 | −Architectures: x86 | |
| 3589 | −Type: vcpu ioctl | |
| 3590 | −Parameters: u64 mcg_cap (in) | |
| 3591 | −Returns: 0 on success, | |
| 3972 | +:Capability: KVM_CAP_MCE | |
| 3973 | +:Architectures: x86 | |
| 3974 | +:Type: vcpu ioctl | |
| 3975 | +:Parameters: u64 mcg_cap (in) | |
| 3976 | +:Returns: 0 on success, | |
| 3592 | 3977 | -EFAULT if u64 mcg_cap cannot be read, |
| 3593 | 3978 | -EINVAL if the requested number of banks is invalid, |
| 3594 | 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 | ||
| 3601 | 3986 | retrieved with KVM_X86_GET_MCE_CAP_SUPPORTED. |
| 3602 | 3987 | |
| 3603 | 3988 | 4.106 KVM_X86_SET_MCE |
| 3989 | +--------------------- | |
| 3604 | 3990 | |
| 3605 | −Capability: KVM_CAP_MCE | |
| 3606 | −Architectures: x86 | |
| 3607 | −Type: vcpu ioctl | |
| 3608 | −Parameters: struct kvm_x86_mce (in) | |
| 3609 | −Returns: 0 on success, | |
| 3991 | +:Capability: KVM_CAP_MCE | |
| 3992 | +:Architectures: x86 | |
| 3993 | +:Type: vcpu ioctl | |
| 3994 | +:Parameters: struct kvm_x86_mce (in) | |
| 3995 | +:Returns: 0 on success, | |
| 3610 | 3996 | -EFAULT if struct kvm_x86_mce cannot be read, |
| 3611 | 3997 | -EINVAL if the bank number is invalid, |
| 3612 | 3998 | -EINVAL if VAL bit is not set in status field. |
| 3613 | 3999 | |
| 3614 | 4000 | Inject a machine check error (MCE) into the guest. The input |
| 3615 | −parameter is: | |
| 4001 | +parameter is:: | |
| 3616 | 4002 | |
| 3617 | −struct kvm_x86_mce { | |
| 4003 | + struct kvm_x86_mce { | |
| 3618 | 4004 | __u64 status; |
| 3619 | 4005 | __u64 addr; |
| 3620 | 4006 | __u64 misc; |
| @@ -3622,7 +4008,7 @@ struct kvm_x86_mce { · 1 unmodified line | ||
| 3622 | 4008 | __u8 bank; |
| 3623 | 4009 | __u8 pad1[7]; |
| 3624 | 4010 | __u64 pad2[3]; |
| 3625 | −}; | |
| 4011 | + }; | |
| 3626 | 4012 | |
| 3627 | 4013 | If the MCE being reported is an uncorrected error, KVM will |
| 3628 | 4014 | inject it as an MCE exception into the guest. If the guest |
| @@ -3634,15 +4020,17 @@ store it in the corresponding bank (provided this bank is · 5 unmodified lines | ||
| 3634 | 4020 | not holding a previously reported uncorrected error). |
| 3635 | 4021 | |
| 3636 | 4022 | 4.107 KVM_S390_GET_CMMA_BITS |
| 4023 | +---------------------------- | |
| 3637 | 4024 | |
| 3638 | −Capability: KVM_CAP_S390_CMMA_MIGRATION | |
| 3639 | −Architectures: s390 | |
| 3640 | −Type: vm ioctl | |
| 3641 | −Parameters: struct kvm_s390_cmma_log (in, out) | |
| 3642 | −Returns: 0 on success, a negative value on error | |
| 4025 | +:Capability: KVM_CAP_S390_CMMA_MIGRATION | |
| 4026 | +:Architectures: s390 | |
| 4027 | +:Type: vm ioctl | |
| 4028 | +:Parameters: struct kvm_s390_cmma_log (in, out) | |
| 4029 | +:Returns: 0 on success, a negative value on error | |
| 3643 | 4030 | |
| 3644 | 4031 | This ioctl is used to get the values of the CMMA bits on the s390 |
| 3645 | 4032 | architecture. It is meant to be used in two scenarios: |
| 4033 | + | |
| 3646 | 4034 | - During live migration to save the CMMA values. Live migration needs |
| 3647 | 4035 | to be enabled via the KVM_REQ_START_MIGRATION VM property. |
| 3648 | 4036 | - 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 | ||
| 3652 | 4040 | values are written to a buffer whose location is indicated via the "values" |
| 3653 | 4041 | member in the kvm_s390_cmma_log struct. The values in the input struct are |
| 3654 | 4042 | also updated as needed. |
| 4043 | + | |
| 3655 | 4044 | Each CMMA value takes up one byte. |
| 3656 | 4045 | |
| 3657 | −struct kvm_s390_cmma_log { | |
| 4046 | +:: | |
| 4047 | + | |
| 4048 | + struct kvm_s390_cmma_log { | |
| 3658 | 4049 | __u64 start_gfn; |
| 3659 | 4050 | __u32 count; |
| 3660 | 4051 | __u32 flags; |
| @@ -3663,7 +4054,7 @@ struct kvm_s390_cmma_log { · 2 unmodified lines | ||
| 3663 | 4054 | __u64 mask; |
| 3664 | 4055 | }; |
| 3665 | 4056 | __u64 values; |
| 3666 | −}; | |
| 4057 | + }; | |
| 3667 | 4058 | |
| 3668 | 4059 | start_gfn is the number of the first guest frame whose CMMA values are |
| 3669 | 4060 | to be retrieved, |
| @@ -3724,12 +4115,13 @@ KVM_S390_CMMA_PEEK is not set but migration mode was not enabled, with · 54 unmodified lines | ||
| 3724 | 4115 | present for the addresses (e.g. when using hugepages). |
| 3725 | 4116 | |
| 3726 | 4117 | 4.108 KVM_S390_SET_CMMA_BITS |
| 4118 | +---------------------------- | |
| 3727 | 4119 | |
| 3728 | −Capability: KVM_CAP_S390_CMMA_MIGRATION | |
| 3729 | −Architectures: s390 | |
| 3730 | −Type: vm ioctl | |
| 3731 | −Parameters: struct kvm_s390_cmma_log (in) | |
| 3732 | −Returns: 0 on success, a negative value on error | |
| 4120 | +:Capability: KVM_CAP_S390_CMMA_MIGRATION | |
| 4121 | +:Architectures: s390 | |
| 4122 | +:Type: vm ioctl | |
| 4123 | +:Parameters: struct kvm_s390_cmma_log (in) | |
| 4124 | +:Returns: 0 on success, a negative value on error | |
| 3733 | 4125 | |
| 3734 | 4126 | This ioctl is used to set the values of the CMMA bits on the s390 |
| 3735 | 4127 | architecture. It is meant to be used during live migration to restore |
| @@ -3737,16 +4129,18 @@ the CMMA values, but there are no restrictions on its use. · 1 unmodified line | ||
| 3737 | 4129 | The ioctl takes parameters via the kvm_s390_cmma_values struct. |
| 3738 | 4130 | Each CMMA value takes up one byte. |
| 3739 | 4131 | |
| 3740 | −struct kvm_s390_cmma_log { | |
| 4132 | +:: | |
| 4133 | + | |
| 4134 | + struct kvm_s390_cmma_log { | |
| 3741 | 4135 | __u64 start_gfn; |
| 3742 | 4136 | __u32 count; |
| 3743 | 4137 | __u32 flags; |
| 3744 | 4138 | union { |
| 3745 | 4139 | __u64 remaining; |
| 3746 | 4140 | __u64 mask; |
| 3747 | − }; | |
| 4141 | + }; | |
| 3748 | 4142 | __u64 values; |
| 3749 | −}; | |
| 4143 | + }; | |
| 3750 | 4144 | |
| 3751 | 4145 | start_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 | ||
| 3769 | 4163 | hugepages). |
| 3770 | 4164 | |
| 3771 | 4165 | 4.109 KVM_PPC_GET_CPU_CHAR |
| 4166 | +-------------------------- | |
| 3772 | 4167 | |
| 3773 | −Capability: KVM_CAP_PPC_GET_CPU_CHAR | |
| 3774 | −Architectures: powerpc | |
| 3775 | −Type: vm ioctl | |
| 3776 | −Parameters: struct kvm_ppc_cpu_char (out) | |
| 3777 | −Returns: 0 on successful completion | |
| 4168 | +:Capability: KVM_CAP_PPC_GET_CPU_CHAR | |
| 4169 | +:Architectures: powerpc | |
| 4170 | +:Type: vm ioctl | |
| 4171 | +:Parameters: struct kvm_ppc_cpu_char (out) | |
| 4172 | +:Returns: 0 on successful completion, | |
| 3778 | 4173 | -EFAULT if struct kvm_ppc_cpu_char cannot be written |
| 3779 | 4174 | |
| 3780 | 4175 | This ioctl gives userspace information about certain characteristics |
| 3781 | 4176 | of the CPU relating to speculative execution of instructions and |
| 3782 | 4177 | possible information leakage resulting from speculative execution (see |
| 3783 | 4178 | CVE-2017-5715, CVE-2017-5753 and CVE-2017-5754). The information is |
| 3784 | −returned in struct kvm_ppc_cpu_char, which looks like this: | |
| 4179 | +returned in struct kvm_ppc_cpu_char, which looks like this:: | |
| 3785 | 4180 | |
| 3786 | −struct kvm_ppc_cpu_char { | |
| 4181 | + struct kvm_ppc_cpu_char { | |
| 3787 | 4182 | __u64 character; /* characteristics of the CPU */ |
| 3788 | 4183 | __u64 behaviour; /* recommended software behaviour */ |
| 3789 | 4184 | __u64 character_mask; /* valid bits in character */ |
| 3790 | 4185 | __u64 behaviour_mask; /* valid bits in behaviour */ |
| 3791 | −}; | |
| 4186 | + }; | |
| 3792 | 4187 | |
| 3793 | 4188 | For extensibility, the character_mask and behaviour_mask fields |
| 3794 | 4189 | indicate which bits of character and behaviour have been filled in by |
| @@ -3815,12 +4210,13 @@ These fields use the same bit definitions as the new · 20 unmodified lines | ||
| 3815 | 4210 | H_GET_CPU_CHARACTERISTICS hypercall. |
| 3816 | 4211 | |
| 3817 | 4212 | 4.110 KVM_MEMORY_ENCRYPT_OP |
| 4213 | +--------------------------- | |
| 3818 | 4214 | |
| 3819 | −Capability: basic | |
| 3820 | −Architectures: x86 | |
| 3821 | −Type: system | |
| 3822 | −Parameters: an opaque platform specific structure (in/out) | |
| 3823 | −Returns: 0 on success; -1 on error | |
| 4215 | +:Capability: basic | |
| 4216 | +:Architectures: x86 | |
| 4217 | +:Type: system | |
| 4218 | +:Parameters: an opaque platform specific structure (in/out) | |
| 4219 | +:Returns: 0 on success; -1 on error | |
| 3824 | 4220 | |
| 3825 | 4221 | If the platform supports creating encrypted VMs then this ioctl can be used |
| 3826 | 4222 | for issuing platform-specific memory encryption commands to manage those |
| @@ -3831,12 +4227,13 @@ Currently, this ioctl is used for issuing Secure Encrypted Virtualization · 4 unmodified lines | ||
| 3831 | 4227 | Documentation/virt/kvm/amd-memory-encryption.rst. |
| 3832 | 4228 | |
| 3833 | 4229 | 4.111 KVM_MEMORY_ENCRYPT_REG_REGION |
| 4230 | +----------------------------------- | |
| 3834 | 4231 | |
| 3835 | −Capability: basic | |
| 3836 | −Architectures: x86 | |
| 3837 | −Type: system | |
| 3838 | −Parameters: struct kvm_enc_region (in) | |
| 3839 | −Returns: 0 on success; -1 on error | |
| 4232 | +:Capability: basic | |
| 4233 | +:Architectures: x86 | |
| 4234 | +:Type: system | |
| 4235 | +:Parameters: struct kvm_enc_region (in) | |
| 4236 | +:Returns: 0 on success; -1 on error | |
| 3840 | 4237 | |
| 3841 | 4238 | This ioctl can be used to register a guest memory region which may |
| 3842 | 4239 | contain encrypted data (e.g. guest RAM, SMRAM etc). |
| @@ -3854,60 +4251,71 @@ swap or migrate (move) ciphertext pages. Hence, for now we pin the guest · 11 unmodified lines | ||
| 3854 | 4251 | memory region registered with the ioctl. |
| 3855 | 4252 | |
| 3856 | 4253 | 4.112 KVM_MEMORY_ENCRYPT_UNREG_REGION |
| 4254 | +------------------------------------- | |
| 3857 | 4255 | |
| 3858 | −Capability: basic | |
| 3859 | −Architectures: x86 | |
| 3860 | −Type: system | |
| 3861 | −Parameters: struct kvm_enc_region (in) | |
| 3862 | −Returns: 0 on success; -1 on error | |
| 4256 | +:Capability: basic | |
| 4257 | +:Architectures: x86 | |
| 4258 | +:Type: system | |
| 4259 | +:Parameters: struct kvm_enc_region (in) | |
| 4260 | +:Returns: 0 on success; -1 on error | |
| 3863 | 4261 | |
| 3864 | 4262 | This ioctl can be used to unregister the guest memory region registered |
| 3865 | 4263 | with KVM_MEMORY_ENCRYPT_REG_REGION ioctl above. |
| 3866 | 4264 | |
| 3867 | 4265 | 4.113 KVM_HYPERV_EVENTFD |
| 4266 | +------------------------ | |
| 3868 | 4267 | |
| 3869 | −Capability: KVM_CAP_HYPERV_EVENTFD | |
| 3870 | −Architectures: x86 | |
| 3871 | −Type: vm ioctl | |
| 3872 | −Parameters: struct kvm_hyperv_eventfd (in) | |
| 4268 | +:Capability: KVM_CAP_HYPERV_EVENTFD | |
| 4269 | +:Architectures: x86 | |
| 4270 | +:Type: vm ioctl | |
| 4271 | +:Parameters: struct kvm_hyperv_eventfd (in) | |
| 3873 | 4272 | |
| 3874 | 4273 | This ioctl (un)registers an eventfd to receive notifications from the guest on |
| 3875 | 4274 | the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without |
| 3876 | 4275 | causing a user exit. SIGNAL_EVENT hypercall with non-zero event flag number |
| 3877 | 4276 | (bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL user exit. |
| 3878 | 4277 | |
| 3879 | −struct kvm_hyperv_eventfd { | |
| 4278 | +:: | |
| 4279 | + | |
| 4280 | + struct kvm_hyperv_eventfd { | |
| 3880 | 4281 | __u32 conn_id; |
| 3881 | 4282 | __s32 fd; |
| 3882 | 4283 | __u32 flags; |
| 3883 | 4284 | __u32 padding[3]; |
| 3884 | −}; | |
| 4285 | + }; | |
| 3885 | 4286 | |
| 3886 | −The conn_id field should fit within 24 bits: | |
| 4287 | +The conn_id field should fit within 24 bits:: | |
| 3887 | 4288 | |
| 3888 | −#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff | |
| 4289 | + #define KVM_HYPERV_CONN_ID_MASK 0x00ffffff | |
| 3889 | 4290 | |
| 3890 | −The acceptable values for the flags field are: | |
| 4291 | +The 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 | |
| 3894 | −Returns: 0 on success, | |
| 3895 | − -EINVAL if conn_id or flags is outside the allowed range | |
| 3896 | − -ENOENT on deassign if the conn_id isn't registered | |
| 3897 | − -EEXIST on assign if the conn_id is already registered | |
| 4295 | +:Returns: 0 on success, | |
| 4296 | + -EINVAL if conn_id or flags is outside the allowed range, | |
| 4297 | + -ENOENT on deassign if the conn_id isn't registered, | |
| 4298 | + -EEXIST on assign if the conn_id is already registered | |
| 3898 | 4299 | |
| 3899 | 4300 | 4.114 KVM_GET_NESTED_STATE |
| 4301 | +-------------------------- | |
| 4302 | + | |
| 4303 | +:Capability: KVM_CAP_NESTED_STATE | |
| 4304 | +:Architectures: x86 | |
| 4305 | +:Type: vcpu ioctl | |
| 4306 | +:Parameters: struct kvm_nested_state (in/out) | |
| 4307 | +:Returns: 0 on success, -1 on error | |
| 3900 | 4308 | |
| 3901 | −Capability: KVM_CAP_NESTED_STATE | |
| 3902 | −Architectures: x86 | |
| 3903 | −Type: vcpu ioctl | |
| 3904 | −Parameters: struct kvm_nested_state (in/out) | |
| 3905 | −Returns: 0 on success, -1 on error | |
| 3906 | 4309 | Errors: |
| 3907 | − E2BIG: the total state size exceeds the value of 'size' specified by | |
| 4310 | + | |
| 4311 | + ===== ============================================================= | |
| 4312 | + E2BIG the total state size exceeds the value of 'size' specified by | |
| 3908 | 4313 | the user; the size required will be written into size. |
| 4314 | + ===== ============================================================= | |
| 4315 | + | |
| 4316 | +:: | |
| 3909 | 4317 | |
| 3910 | −struct kvm_nested_state { | |
| 4318 | + struct kvm_nested_state { | |
| 3911 | 4319 | __u16 flags; |
| 3912 | 4320 | __u16 format; |
| 3913 | 4321 | __u32 size; |
| @@ -3924,33 +4332,33 @@ struct kvm_nested_state { · 10 unmodified lines | ||
| 3924 | 4332 | struct kvm_vmx_nested_state_data vmx[0]; |
| 3925 | 4333 | struct kvm_svm_nested_state_data svm[0]; |
| 3926 | 4334 | } data; |
| 3927 | −}; | |
| 4335 | + }; | |
| 3928 | 4336 | |
| 3929 | −#define KVM_STATE_NESTED_GUEST_MODE 0x00000001 | |
| 3930 | −#define KVM_STATE_NESTED_RUN_PENDING 0x00000002 | |
| 3931 | −#define KVM_STATE_NESTED_EVMCS 0x00000004 | |
| 4337 | + #define KVM_STATE_NESTED_GUEST_MODE 0x00000001 | |
| 4338 | + #define KVM_STATE_NESTED_RUN_PENDING 0x00000002 | |
| 4339 | + #define KVM_STATE_NESTED_EVMCS 0x00000004 | |
| 3932 | 4340 | |
| 3933 | −#define KVM_STATE_NESTED_FORMAT_VMX 0 | |
| 3934 | −#define KVM_STATE_NESTED_FORMAT_SVM 1 | |
| 4341 | + #define KVM_STATE_NESTED_FORMAT_VMX 0 | |
| 4342 | + #define KVM_STATE_NESTED_FORMAT_SVM 1 | |
| 3935 | 4343 | |
| 3936 | −#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000 | |
| 4344 | + #define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000 | |
| 3937 | 4345 | |
| 3938 | −#define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001 | |
| 3939 | −#define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002 | |
| 4346 | + #define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001 | |
| 4347 | + #define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002 | |
| 3940 | 4348 | |
| 3941 | −struct kvm_vmx_nested_state_hdr { | |
| 4349 | + struct kvm_vmx_nested_state_hdr { | |
| 3942 | 4350 | __u64 vmxon_pa; |
| 3943 | 4351 | __u64 vmcs12_pa; |
| 3944 | 4352 | |
| 3945 | 4353 | struct { |
| 3946 | 4354 | __u16 flags; |
| 3947 | 4355 | } smm; |
| 3948 | −}; | |
| 4356 | + }; | |
| 3949 | 4357 | |
| 3950 | −struct kvm_vmx_nested_state_data { | |
| 4358 | + struct kvm_vmx_nested_state_data { | |
| 3951 | 4359 | __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE]; |
| 3952 | 4360 | __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE]; |
| 3953 | −}; | |
| 4361 | + }; | |
| 3954 | 4362 | |
| 3955 | 4363 | This ioctl copies the vcpu's nested virtualization state from the kernel to |
| 3956 | 4364 | userspace. |
| @@ -3959,24 +4367,26 @@ The maximum size of the state can be retrieved by passing KVM_CAP_NESTED_STATE · 2 unmodified lines | ||
| 3959 | 4367 | to the KVM_CHECK_EXTENSION ioctl(). |
| 3960 | 4368 | |
| 3961 | 4369 | 4.115 KVM_SET_NESTED_STATE |
| 4370 | +-------------------------- | |
| 3962 | 4371 | |
| 3963 | −Capability: KVM_CAP_NESTED_STATE | |
| 3964 | −Architectures: x86 | |
| 3965 | −Type: vcpu ioctl | |
| 3966 | −Parameters: struct kvm_nested_state (in) | |
| 3967 | −Returns: 0 on success, -1 on error | |
| 4372 | +:Capability: KVM_CAP_NESTED_STATE | |
| 4373 | +:Architectures: x86 | |
| 4374 | +:Type: vcpu ioctl | |
| 4375 | +:Parameters: struct kvm_nested_state (in) | |
| 4376 | +:Returns: 0 on success, -1 on error | |
| 3968 | 4377 | |
| 3969 | 4378 | This copies the vcpu's kvm_nested_state struct from userspace to the kernel. |
| 3970 | 4379 | For the definition of struct kvm_nested_state, see KVM_GET_NESTED_STATE. |
| 3971 | 4380 | |
| 3972 | 4381 | 4.116 KVM_(UN)REGISTER_COALESCED_MMIO |
| 4382 | +------------------------------------- | |
| 3973 | 4383 | |
| 3974 | −Capability: KVM_CAP_COALESCED_MMIO (for coalesced mmio) | |
| 3975 | − KVM_CAP_COALESCED_PIO (for coalesced pio) | |
| 3976 | −Architectures: all | |
| 3977 | −Type: vm ioctl | |
| 3978 | −Parameters: struct kvm_coalesced_mmio_zone | |
| 3979 | −Returns: 0 on success, < 0 on error | |
| 4384 | +:Capability: KVM_CAP_COALESCED_MMIO (for coalesced mmio) | |
| 4385 | + KVM_CAP_COALESCED_PIO (for coalesced pio) | |
| 4386 | +:Architectures: all | |
| 4387 | +:Type: vm ioctl | |
| 4388 | +:Parameters: struct kvm_coalesced_mmio_zone | |
| 4389 | +:Returns: 0 on success, < 0 on error | |
| 3980 | 4390 | |
| 3981 | 4391 | Coalesced I/O is a performance optimization that defers hardware |
| 3982 | 4392 | register write emulation so that userspace exits are avoided. It is |
| @@ -3998,15 +4408,18 @@ between coalesced mmio and pio except that coalesced pio records accesses · 15 unmodified lines | ||
| 3998 | 4408 | to I/O ports. |
| 3999 | 4409 | |
| 4000 | 4410 | 4.117 KVM_CLEAR_DIRTY_LOG (vm ioctl) |
| 4411 | +------------------------------------ | |
| 4001 | 4412 | |
| 4002 | −Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 | |
| 4003 | −Architectures: x86, arm, arm64, mips | |
| 4004 | −Type: vm ioctl | |
| 4005 | −Parameters: struct kvm_dirty_log (in) | |
| 4006 | −Returns: 0 on success, -1 on error | |
| 4413 | +:Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 | |
| 4414 | +:Architectures: x86, arm, arm64, mips | |
| 4415 | +:Type: vm ioctl | |
| 4416 | +:Parameters: struct kvm_dirty_log (in) | |
| 4417 | +:Returns: 0 on success, -1 on error | |
| 4007 | 4418 | |
| 4008 | −/* for KVM_CLEAR_DIRTY_LOG */ | |
| 4009 | −struct kvm_clear_dirty_log { | |
| 4419 | +:: | |
| 4420 | + | |
| 4421 | + /* for KVM_CLEAR_DIRTY_LOG */ | |
| 4422 | + struct kvm_clear_dirty_log { | |
| 4010 | 4423 | __u32 slot; |
| 4011 | 4424 | __u32 num_pages; |
| 4012 | 4425 | __u64 first_page; |
| @@ -4014,7 +4427,7 @@ struct kvm_clear_dirty_log { · 1 unmodified line | ||
| 4014 | 4427 | void __user *dirty_bitmap; /* one bit per page */ |
| 4015 | 4428 | __u64 padding; |
| 4016 | 4429 | }; |
| 4017 | −}; | |
| 4430 | + }; | |
| 4018 | 4431 | |
| 4019 | 4432 | The ioctl clears the dirty status of pages in a memory slot, according to |
| 4020 | 4433 | the bitmap that is passed in struct kvm_clear_dirty_log's dirty_bitmap |
| @@ -4038,20 +4451,23 @@ However, it can always be used as long as KVM_CHECK_EXTENSION confirms · 17 unmodified lines | ||
| 4038 | 4451 | that KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is present. |
| 4039 | 4452 | |
| 4040 | 4453 | 4.118 KVM_GET_SUPPORTED_HV_CPUID |
| 4454 | +-------------------------------- | |
| 4455 | + | |
| 4456 | +:Capability: KVM_CAP_HYPERV_CPUID | |
| 4457 | +:Architectures: x86 | |
| 4458 | +:Type: vcpu ioctl | |
| 4459 | +:Parameters: struct kvm_cpuid2 (in/out) | |
| 4460 | +:Returns: 0 on success, -1 on error | |
| 4041 | 4461 | |
| 4042 | −Capability: KVM_CAP_HYPERV_CPUID | |
| 4043 | −Architectures: x86 | |
| 4044 | −Type: vcpu ioctl | |
| 4045 | −Parameters: struct kvm_cpuid2 (in/out) | |
| 4046 | −Returns: 0 on success, -1 on error | |
| 4462 | +:: | |
| 4047 | 4463 | |
| 4048 | −struct kvm_cpuid2 { | |
| 4464 | + struct kvm_cpuid2 { | |
| 4049 | 4465 | __u32 nent; |
| 4050 | 4466 | __u32 padding; |
| 4051 | 4467 | struct kvm_cpuid_entry2 entries[0]; |
| 4052 | −}; | |
| 4468 | + }; | |
| 4053 | 4469 | |
| 4054 | −struct kvm_cpuid_entry2 { | |
| 4470 | + struct kvm_cpuid_entry2 { | |
| 4055 | 4471 | __u32 function; |
| 4056 | 4472 | __u32 index; |
| 4057 | 4473 | __u32 flags; |
| @@ -4060,7 +4476,7 @@ struct kvm_cpuid_entry2 { · 2 unmodified lines | ||
| 4060 | 4476 | __u32 ecx; |
| 4061 | 4477 | __u32 edx; |
| 4062 | 4478 | __u32 padding[3]; |
| 4063 | −}; | |
| 4479 | + }; | |
| 4064 | 4480 | |
| 4065 | 4481 | This ioctl returns x86 cpuid features leaves related to Hyper-V emulation in |
| 4066 | 4482 | KVM. Userspace can use the information returned by this ioctl to construct |
| @@ -4073,13 +4489,13 @@ KVM_GET_SUPPORTED_CPUID ioctl because some of them intersect with KVM feature · 6 unmodified lines | ||
| 4073 | 4489 | leaves (0x40000000, 0x40000001). |
| 4074 | 4490 | |
| 4075 | 4491 | Currently, the following list of CPUID leaves are returned: |
| 4076 | − HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS | |
| 4077 | − HYPERV_CPUID_INTERFACE | |
| 4078 | − HYPERV_CPUID_VERSION | |
| 4079 | − HYPERV_CPUID_FEATURES | |
| 4080 | − HYPERV_CPUID_ENLIGHTMENT_INFO | |
| 4081 | − HYPERV_CPUID_IMPLEMENT_LIMITS | |
| 4082 | − HYPERV_CPUID_NESTED_FEATURES | |
| 4492 | + - HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS | |
| 4493 | + - HYPERV_CPUID_INTERFACE | |
| 4494 | + - HYPERV_CPUID_VERSION | |
| 4495 | + - HYPERV_CPUID_FEATURES | |
| 4496 | + - HYPERV_CPUID_ENLIGHTMENT_INFO | |
| 4497 | + - HYPERV_CPUID_IMPLEMENT_LIMITS | |
| 4498 | + - HYPERV_CPUID_NESTED_FEATURES | |
| 4083 | 4499 | |
| 4084 | 4500 | HYPERV_CPUID_NESTED_FEATURES leaf is only exposed when Enlightened VMCS was |
| 4085 | 4501 | enabled on the corresponding vCPU (KVM_CAP_HYPERV_ENLIGHTENED_VMCS). |
| @@ -4095,17 +4511,25 @@ number of valid entries in the 'entries' array, which is then filled. · 9 unmodified lines | ||
| 4095 | 4511 | userspace should not expect to get any particular value there. |
| 4096 | 4512 | |
| 4097 | 4513 | 4.119 KVM_ARM_VCPU_FINALIZE |
| 4514 | +--------------------------- | |
| 4515 | + | |
| 4516 | +:Architectures: arm, arm64 | |
| 4517 | +:Type: vcpu ioctl | |
| 4518 | +:Parameters: int feature (in) | |
| 4519 | +:Returns: 0 on success, -1 on error | |
| 4098 | 4520 | |
| 4099 | −Architectures: arm, arm64 | |
| 4100 | −Type: vcpu ioctl | |
| 4101 | −Parameters: int feature (in) | |
| 4102 | −Returns: 0 on success, -1 on error | |
| 4103 | 4521 | Errors: |
| 4104 | − EPERM: feature not enabled, needs configuration, or already finalized | |
| 4105 | − EINVAL: feature unknown or not present | |
| 4522 | + | |
| 4523 | + ====== ============================================================== | |
| 4524 | + EPERM feature not enabled, needs configuration, or already finalized | |
| 4525 | + EINVAL feature unknown or not present | |
| 4526 | + ====== ============================================================== | |
| 4106 | 4527 | |
| 4107 | 4528 | Recognised values for feature: |
| 4529 | + | |
| 4530 | + ===== =========================================== | |
| 4108 | 4531 | arm64 KVM_ARM_VCPU_SVE (requires KVM_CAP_ARM_SVE) |
| 4532 | + ===== =========================================== | |
| 4109 | 4533 | |
| 4110 | 4534 | Finalizes 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 | ||
| 4129 | 4553 | using this ioctl. |
| 4130 | 4554 | |
| 4131 | 4555 | 4.120 KVM_SET_PMU_EVENT_FILTER |
| 4556 | +------------------------------ | |
| 4132 | 4557 | |
| 4133 | −Capability: KVM_CAP_PMU_EVENT_FILTER | |
| 4134 | −Architectures: x86 | |
| 4135 | −Type: vm ioctl | |
| 4136 | −Parameters: struct kvm_pmu_event_filter (in) | |
| 4137 | −Returns: 0 on success, -1 on error | |
| 4558 | +:Capability: KVM_CAP_PMU_EVENT_FILTER | |
| 4559 | +:Architectures: x86 | |
| 4560 | +:Type: vm ioctl | |
| 4561 | +:Parameters: struct kvm_pmu_event_filter (in) | |
| 4562 | +:Returns: 0 on success, -1 on error | |
| 4138 | 4563 | |
| 4139 | −struct kvm_pmu_event_filter { | |
| 4564 | +:: | |
| 4565 | + | |
| 4566 | + struct kvm_pmu_event_filter { | |
| 4140 | 4567 | __u32 action; |
| 4141 | 4568 | __u32 nevents; |
| 4142 | 4569 | __u32 fixed_counter_bitmap; |
| 4143 | 4570 | __u32 flags; |
| 4144 | 4571 | __u32 pad[4]; |
| 4145 | 4572 | __u64 events[0]; |
| 4146 | −}; | |
| 4573 | + }; | |
| 4147 | 4574 | |
| 4148 | 4575 | This ioctl restricts the set of PMU events that the guest can program. |
| 4149 | 4576 | The argument holds a list of events which will be allowed or denied. |
| @@ -4154,20 +4581,26 @@ counters are controlled by the fixed_counter_bitmap. · 4 unmodified lines | ||
| 4154 | 4581 | |
| 4155 | 4582 | No flags are defined yet, the field must be zero. |
| 4156 | 4583 | |
| 4157 | −Valid values for 'action': | |
| 4158 | −#define KVM_PMU_EVENT_ALLOW 0 | |
| 4159 | −#define KVM_PMU_EVENT_DENY 1 | |
| 4584 | +Valid values for 'action':: | |
| 4585 | + | |
| 4586 | + #define KVM_PMU_EVENT_ALLOW 0 | |
| 4587 | + #define KVM_PMU_EVENT_DENY 1 | |
| 4160 | 4588 | |
| 4161 | 4589 | 4.121 KVM_PPC_SVM_OFF |
| 4590 | +--------------------- | |
| 4591 | + | |
| 4592 | +:Capability: basic | |
| 4593 | +:Architectures: powerpc | |
| 4594 | +:Type: vm ioctl | |
| 4595 | +:Parameters: none | |
| 4596 | +:Returns: 0 on successful completion, | |
| 4162 | 4597 | |
| 4163 | −Capability: basic | |
| 4164 | −Architectures: powerpc | |
| 4165 | −Type: vm ioctl | |
| 4166 | −Parameters: none | |
| 4167 | −Returns: 0 on successful completion, | |
| 4168 | 4598 | Errors: |
| 4169 | − EINVAL: if ultravisor failed to terminate the secure guest | |
| 4170 | − ENOMEM: if hypervisor failed to allocate new radix page tables for guest | |
| 4599 | + | |
| 4600 | + ====== ================================================================ | |
| 4601 | + EINVAL if ultravisor failed to terminate the secure guest | |
| 4602 | + ENOMEM if hypervisor failed to allocate new radix page tables for guest | |
| 4603 | + ====== ================================================================ | |
| 4171 | 4604 | |
| 4172 | 4605 | This ioctl is used to turn off the secure mode of the guest or transition |
| 4173 | 4606 | the guest from secure mode to normal mode. This is invoked when the guest |
| @@ -4178,35 +4611,38 @@ unpins the VPA pages and releases all the device pages that are used to · 4 unmodified lines | ||
| 4178 | 4611 | track the secure pages by hypervisor. |
| 4179 | 4612 | |
| 4180 | 4613 | 4.122 KVM_S390_NORMAL_RESET |
| 4614 | +--------------------------- | |
| 4181 | 4615 | |
| 4182 | −Capability: KVM_CAP_S390_VCPU_RESETS | |
| 4183 | −Architectures: s390 | |
| 4184 | −Type: vcpu ioctl | |
| 4185 | −Parameters: none | |
| 4186 | −Returns: 0 | |
| 4616 | +:Capability: KVM_CAP_S390_VCPU_RESETS | |
| 4617 | +:Architectures: s390 | |
| 4618 | +:Type: vcpu ioctl | |
| 4619 | +:Parameters: none | |
| 4620 | +:Returns: 0 | |
| 4187 | 4621 | |
| 4188 | 4622 | This ioctl resets VCPU registers and control structures according to |
| 4189 | 4623 | the cpu reset definition in the POP (Principles Of Operation). |
| 4190 | 4624 | |
| 4191 | 4625 | 4.123 KVM_S390_INITIAL_RESET |
| 4626 | +---------------------------- | |
| 4192 | 4627 | |
| 4193 | −Capability: none | |
| 4194 | −Architectures: s390 | |
| 4195 | −Type: vcpu ioctl | |
| 4196 | −Parameters: none | |
| 4197 | −Returns: 0 | |
| 4628 | +:Capability: none | |
| 4629 | +:Architectures: s390 | |
| 4630 | +:Type: vcpu ioctl | |
| 4631 | +:Parameters: none | |
| 4632 | +:Returns: 0 | |
| 4198 | 4633 | |
| 4199 | 4634 | This ioctl resets VCPU registers and control structures according to |
| 4200 | 4635 | the initial cpu reset definition in the POP. However, the cpu is not |
| 4201 | 4636 | put into ESA mode. This reset is a superset of the normal reset. |
| 4202 | 4637 | |
| 4203 | 4638 | 4.124 KVM_S390_CLEAR_RESET |
| 4639 | +-------------------------- | |
| 4204 | 4640 | |
| 4205 | −Capability: KVM_CAP_S390_VCPU_RESETS | |
| 4206 | −Architectures: s390 | |
| 4207 | −Type: vcpu ioctl | |
| 4208 | −Parameters: none | |
| 4209 | −Returns: 0 | |
| 4641 | +:Capability: KVM_CAP_S390_VCPU_RESETS | |
| 4642 | +:Architectures: s390 | |
| 4643 | +:Type: vcpu ioctl | |
| 4644 | +:Parameters: none | |
| 4645 | +:Returns: 0 | |
| 4210 | 4646 | |
| 4211 | 4647 | This ioctl resets VCPU registers and control structures according to |
| 4212 | 4648 | the clear cpu reset definition in the POP. However, the cpu is not put |
| @@ -4214,7 +4650,7 @@ into ESA mode. This reset is a superset of the initial reset. · 1 unmodified line | ||
| 4214 | 4650 | |
| 4215 | 4651 | |
| 4216 | 4652 | 5. The kvm_run structure |
| 4217 | −------------------------ | |
| 4653 | +======================== | |
| 4218 | 4654 | |
| 4219 | 4655 | Application code obtains a pointer to the kvm_run structure by |
| 4220 | 4656 | mmap()ing a vcpu fd. From that point, application code can control |
| @@ -4222,13 +4658,17 @@ execution by changing fields in kvm_run prior to calling the KVM_RUN · 1 unmodified line | ||
| 4222 | 4658 | ioctl, and obtain information about the reason KVM_RUN returned by |
| 4223 | 4659 | looking up structure members. |
| 4224 | 4660 | |
| 4225 | −struct kvm_run { | |
| 4661 | +:: | |
| 4662 | + | |
| 4663 | + struct kvm_run { | |
| 4226 | 4664 | /* in */ |
| 4227 | 4665 | __u8 request_interrupt_window; |
| 4228 | 4666 | |
| 4229 | 4667 | Request that KVM_RUN return when it becomes possible to inject external |
| 4230 | 4668 | interrupts into the guest. Useful in conjunction with KVM_INTERRUPT. |
| 4231 | 4669 | |
| 4670 | +:: | |
| 4671 | + | |
| 4232 | 4672 | __u8 immediate_exit; |
| 4233 | 4673 | |
| 4234 | 4674 | This field is polled once when KVM_RUN starts; if non-zero, KVM_RUN |
| @@ -4240,6 +4680,8 @@ a signal handler that sets run->immediate_exit to a non-zero value. · 5 unmodified lines | ||
| 4240 | 4680 | |
| 4241 | 4681 | This field is ignored if KVM_CAP_IMMEDIATE_EXIT is not available. |
| 4242 | 4682 | |
| 4683 | +:: | |
| 4684 | + | |
| 4243 | 4685 | __u8 padding1[6]; |
| 4244 | 4686 | |
| 4245 | 4687 | /* out */ |
| @@ -4249,16 +4691,22 @@ When KVM_RUN has returned successfully (return value 0), this informs · 3 unmodified lines | ||
| 4249 | 4691 | application code why KVM_RUN has returned. Allowable values for this |
| 4250 | 4692 | field are detailed below. |
| 4251 | 4693 | |
| 4694 | +:: | |
| 4695 | + | |
| 4252 | 4696 | __u8 ready_for_interrupt_injection; |
| 4253 | 4697 | |
| 4254 | 4698 | If request_interrupt_window has been specified, this field indicates |
| 4255 | 4699 | an interrupt can be injected now with KVM_INTERRUPT. |
| 4256 | 4700 | |
| 4701 | +:: | |
| 4702 | + | |
| 4257 | 4703 | __u8 if_flag; |
| 4258 | 4704 | |
| 4259 | 4705 | The value of the current interrupt flag. Only valid if in-kernel |
| 4260 | 4706 | local APIC is not used. |
| 4261 | 4707 | |
| 4708 | +:: | |
| 4709 | + | |
| 4262 | 4710 | __u16 flags; |
| 4263 | 4711 | |
| 4264 | 4712 | More architecture-specific flags detailing state of the VCPU that may |
| @@ -4266,17 +4714,23 @@ affect the device's behavior. The only currently defined flag is · 1 unmodified line | ||
| 4266 | 4714 | KVM_RUN_X86_SMM, which is valid on x86 machines and is set if the |
| 4267 | 4715 | VCPU is in system management mode. |
| 4268 | 4716 | |
| 4717 | +:: | |
| 4718 | + | |
| 4269 | 4719 | /* in (pre_kvm_run), out (post_kvm_run) */ |
| 4270 | 4720 | __u64 cr8; |
| 4271 | 4721 | |
| 4272 | 4722 | The value of the cr8 register. Only valid if in-kernel local APIC is |
| 4273 | 4723 | not used. Both input and output. |
| 4274 | 4724 | |
| 4725 | +:: | |
| 4726 | + | |
| 4275 | 4727 | __u64 apic_base; |
| 4276 | 4728 | |
| 4277 | 4729 | The value of the APIC BASE msr. Only valid if in-kernel local |
| 4278 | 4730 | APIC is not used. Both input and output. |
| 4279 | 4731 | |
| 4732 | +:: | |
| 4733 | + | |
| 4280 | 4734 | union { |
| 4281 | 4735 | /* KVM_EXIT_UNKNOWN */ |
| 4282 | 4736 | struct { |
| @@ -4287,6 +4741,8 @@ If exit_reason is KVM_EXIT_UNKNOWN, the vcpu has exited due to unknown · 4 unmodified lines | ||
| 4287 | 4741 | reasons. Further architecture-specific information is available in |
| 4288 | 4742 | hardware_exit_reason. |
| 4289 | 4743 | |
| 4744 | +:: | |
| 4745 | + | |
| 4290 | 4746 | /* KVM_EXIT_FAIL_ENTRY */ |
| 4291 | 4747 | struct { |
| 4292 | 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 | ||
| 4296 | 4752 | to unknown reasons. Further architecture-specific information is |
| 4297 | 4753 | available in hardware_entry_failure_reason. |
| 4298 | 4754 | |
| 4755 | +:: | |
| 4756 | + | |
| 4299 | 4757 | /* KVM_EXIT_EXCEPTION */ |
| 4300 | 4758 | struct { |
| 4301 | 4759 | __u32 exception; |
| @@ -4304,10 +4762,12 @@ available in hardware_entry_failure_reason. · 2 unmodified lines | ||
| 4304 | 4762 | |
| 4305 | 4763 | Unused. |
| 4306 | 4764 | |
| 4765 | +:: | |
| 4766 | + | |
| 4307 | 4767 | /* KVM_EXIT_IO */ |
| 4308 | 4768 | struct { |
| 4309 | −#define KVM_EXIT_IO_IN 0 | |
| 4310 | −#define KVM_EXIT_IO_OUT 1 | |
| 4769 | + #define KVM_EXIT_IO_IN 0 | |
| 4770 | + #define KVM_EXIT_IO_OUT 1 | |
| 4311 | 4771 | __u8 direction; |
| 4312 | 4772 | __u8 size; /* bytes */ |
| 4313 | 4773 | __u16 port; |
| @@ -4321,6 +4781,8 @@ data_offset describes where the data is located (KVM_EXIT_IO_OUT) or · 7 unmodified lines | ||
| 4321 | 4781 | where kvm expects application code to place the data for the next |
| 4322 | 4782 | KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array. |
| 4323 | 4783 | |
| 4784 | +:: | |
| 4785 | + | |
| 4324 | 4786 | /* KVM_EXIT_DEBUG */ |
| 4325 | 4787 | struct { |
| 4326 | 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 | ||
| 4329 | 4791 | If the exit_reason is KVM_EXIT_DEBUG, then a vcpu is processing a debug event |
| 4330 | 4792 | for which architecture specific information is returned. |
| 4331 | 4793 | |
| 4794 | +:: | |
| 4795 | + | |
| 4332 | 4796 | /* KVM_EXIT_MMIO */ |
| 4333 | 4797 | struct { |
| 4334 | 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 | ||
| 4346 | 4810 | appear if the VCPU performed a load or store of the appropriate width directly |
| 4347 | 4811 | to the byte array. |
| 4348 | 4812 | |
| 4349 | −NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR and | |
| 4813 | +.. note:: | |
| 4814 | + | |
| 4815 | + For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR and | |
| 4350 | 4816 | KVM_EXIT_EPR the corresponding |
| 4817 | + | |
| 4351 | 4818 | operations are complete (and guest state is consistent) only after userspace |
| 4352 | 4819 | has re-entered the kernel with KVM_RUN. The kernel side will first finish |
| 4353 | 4820 | incomplete operations and then check for pending signals. Userspace |
| 4354 | 4821 | can re-enter the guest with an unmasked signal pending to complete |
| 4355 | 4822 | pending operations. |
| 4356 | 4823 | |
| 4824 | +:: | |
| 4825 | + | |
| 4357 | 4826 | /* KVM_EXIT_HYPERCALL */ |
| 4358 | 4827 | struct { |
| 4359 | 4828 | __u64 nr; |
| @@ -4365,7 +4834,10 @@ pending operations. · 5 unmodified lines | ||
| 4365 | 4834 | |
| 4366 | 4835 | Unused. This was once used for 'hypercall to userspace'. To implement |
| 4367 | 4836 | such functionality, use KVM_EXIT_IO (x86) or KVM_EXIT_MMIO (all except s390). |
| 4368 | −Note KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO. | |
| 4837 | + | |
| 4838 | +.. note:: KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO. | |
| 4839 | + | |
| 4840 | +:: | |
| 4369 | 4841 | |
| 4370 | 4842 | /* KVM_EXIT_TPR_ACCESS */ |
| 4371 | 4843 | struct { |
| @@ -4376,6 +4848,8 @@ Note KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO. · 4 unmodified lines | ||
| 4376 | 4848 | |
| 4377 | 4849 | To be documented (KVM_TPR_ACCESS_REPORTING). |
| 4378 | 4850 | |
| 4851 | +:: | |
| 4852 | + | |
| 4379 | 4853 | /* KVM_EXIT_S390_SIEIC */ |
| 4380 | 4854 | struct { |
| 4381 | 4855 | __u8 icptcode; |
| @@ -4387,16 +4861,20 @@ To be documented (KVM_TPR_ACCESS_REPORTING). · 5 unmodified lines | ||
| 4387 | 4861 | |
| 4388 | 4862 | s390 specific. |
| 4389 | 4863 | |
| 4864 | +:: | |
| 4865 | + | |
| 4390 | 4866 | /* KVM_EXIT_S390_RESET */ |
| 4391 | −#define KVM_S390_RESET_POR 1 | |
| 4392 | −#define KVM_S390_RESET_CLEAR 2 | |
| 4393 | −#define KVM_S390_RESET_SUBSYSTEM 4 | |
| 4394 | −#define KVM_S390_RESET_CPU_INIT 8 | |
| 4395 | −#define KVM_S390_RESET_IPL 16 | |
| 4867 | + #define KVM_S390_RESET_POR 1 | |
| 4868 | + #define KVM_S390_RESET_CLEAR 2 | |
| 4869 | + #define KVM_S390_RESET_SUBSYSTEM 4 | |
| 4870 | + #define KVM_S390_RESET_CPU_INIT 8 | |
| 4871 | + #define KVM_S390_RESET_IPL 16 | |
| 4396 | 4872 | __u64 s390_reset_flags; |
| 4397 | 4873 | |
| 4398 | 4874 | s390 specific. |
| 4399 | 4875 | |
| 4876 | +:: | |
| 4877 | + | |
| 4400 | 4878 | /* KVM_EXIT_S390_UCONTROL */ |
| 4401 | 4879 | struct { |
| 4402 | 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 | ||
| 4411 | 4889 | Principles of Operation Book in the Chapter for Dynamic Address Translation |
| 4412 | 4890 | (DAT) |
1015 more lines aren’t shown here.
| @@ -1,4 +1,8 @@ | ||
| 1 | −* Internal ABI between the kernel and HYP | |
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +======================================= | |
| 4 | +Internal ABI between the kernel and HYP | |
| 5 | +======================================= | |
| 2 | 6 | |
| 3 | 7 | This file documents the interaction between the Linux kernel and the |
| 4 | 8 | hypervisor layer when running Linux as a hypervisor (for example |
| @@ -19,25 +23,31 @@ and only act on individual CPUs. · 14 unmodified lines | ||
| 19 | 23 | Unless specified otherwise, any built-in hypervisor must implement |
| 20 | 24 | these functions (see arch/arm{,64}/include/asm/virt.h): |
| 21 | 25 | |
| 22 | −* r0/x0 = HVC_SET_VECTORS | |
| 23 | − r1/x1 = vectors | |
| 26 | +* :: | |
| 27 | + | |
| 28 | + r0/x0 = HVC_SET_VECTORS | |
| 29 | + r1/x1 = vectors | |
| 24 | 30 | |
| 25 | 31 | Set HVBAR/VBAR_EL2 to 'vectors' to enable a hypervisor. 'vectors' |
| 26 | 32 | must be a physical address, and respect the alignment requirements |
| 27 | 33 | of the architecture. Only implemented by the initial stubs, not by |
| 28 | 34 | Linux hypervisors. |
| 29 | 35 | |
| 30 | −* r0/x0 = HVC_RESET_VECTORS | |
| 36 | +* :: | |
| 37 | + | |
| 38 | + r0/x0 = HVC_RESET_VECTORS | |
| 31 | 39 | |
| 32 | 40 | Turn HYP/EL2 MMU off, and reset HVBAR/VBAR_EL2 to the initials |
| 33 | 41 | stubs' exception vector value. This effectively disables an existing |
| 34 | 42 | hypervisor. |
| 35 | 43 | |
| 36 | −* r0/x0 = HVC_SOFT_RESTART | |
| 37 | − r1/x1 = restart address | |
| 38 | − x2 = x0's value when entering the next payload (arm64) | |
| 39 | − x3 = x1's value when entering the next payload (arm64) | |
| 40 | − x4 = x2's value when entering the next payload (arm64) | |
| 44 | +* :: | |
| 45 | + | |
| 46 | + r0/x0 = HVC_SOFT_RESTART | |
| 47 | + r1/x1 = restart address | |
| 48 | + x2 = x0's value when entering the next payload (arm64) | |
| 49 | + x3 = x1's value when entering the next payload (arm64) | |
| 50 | + x4 = x2's value when entering the next payload (arm64) | |
| 41 | 51 | |
| 42 | 52 | Mask all exceptions, disable the MMU, move the arguments into place |
| 43 | 53 | (arm64 only), and jump to the restart address while at HYP/EL2. This |
| @@ -0,0 +1,12 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=== | |
| 4 | +ARM | |
| 5 | +=== | |
| 6 | + | |
| 7 | +.. toctree:: | |
| 8 | + :maxdepth: 2 | |
| 9 | + | |
| 10 | + hyp-abi | |
| 11 | + psci | |
| 12 | + pvtime | |
| @@ -1,3 +1,9 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +========================================= | |
| 4 | +Power State Coordination Interface (PSCI) | |
| 5 | +========================================= | |
| 6 | + | |
| 1 | 7 | KVM implements the PSCI (Power State Coordination Interface) |
| 2 | 8 | specification in order to provide services such as CPU on/off, reset |
| 3 | 9 | and power-off to the guest. |
| @@ -30,32 +36,42 @@ The following register is defined: · 26 unmodified lines | ||
| 30 | 36 | - Affects the whole VM (even if the register view is per-vcpu) |
| 31 | 37 | |
| 32 | 38 | * KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1: |
| 33 | − Holds the state of the firmware support to mitigate CVE-2017-5715, as | |
| 34 | − offered by KVM to the guest via a HVC call. The workaround is described | |
| 35 | − under SMCCC_ARCH_WORKAROUND_1 in [1]. | |
| 39 | + Holds the state of the firmware support to mitigate CVE-2017-5715, as | |
| 40 | + offered by KVM to the guest via a HVC call. The workaround is described | |
| 41 | + under SMCCC_ARCH_WORKAROUND_1 in [1]. | |
| 42 | + | |
| 36 | 43 | Accepted values are: |
| 37 | − KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL: KVM does not offer | |
| 44 | + | |
| 45 | + KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL: | |
| 46 | + KVM does not offer | |
| 38 | 47 | firmware support for the workaround. The mitigation status for the |
| 39 | 48 | guest is unknown. |
| 40 | − KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL: The workaround HVC call is | |
| 49 | + KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL: | |
| 50 | + The workaround HVC call is | |
| 41 | 51 | available to the guest and required for the mitigation. |
| 42 | − KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED: The workaround HVC call | |
| 52 | + KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED: | |
| 53 | + The workaround HVC call | |
| 43 | 54 | is available to the guest, but it is not needed on this VCPU. |
| 44 | 55 | |
| 45 | 56 | * KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2: |
| 46 | − Holds the state of the firmware support to mitigate CVE-2018-3639, as | |
| 47 | − offered by KVM to the guest via a HVC call. The workaround is described | |
| 48 | − under SMCCC_ARCH_WORKAROUND_2 in [1]. | |
| 57 | + Holds the state of the firmware support to mitigate CVE-2018-3639, as | |
| 58 | + offered by KVM to the guest via a HVC call. The workaround is described | |
| 59 | + under SMCCC_ARCH_WORKAROUND_2 in [1]_. | |
| 60 | + | |
| 49 | 61 | Accepted values are: |
| 50 | − KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL: A workaround is not | |
| 62 | + | |
| 63 | + KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL: | |
| 64 | + A workaround is not | |
| 51 | 65 | available. KVM does not offer firmware support for the workaround. |
| 52 | − KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN: The workaround state is | |
| 66 | + KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN: | |
| 67 | + The workaround state is | |
| 53 | 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 | 71 | and can be disabled by a vCPU. If |
| 56 | 72 | KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED is set, it is active for |
| 57 | 73 | this vCPU. |
| 58 | − KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED: The workaround is | |
| 59 | − always active on this vCPU or it is not needed. | |
| 74 | + KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED: | |
| 75 | + The workaround is always active on this vCPU or it is not needed. | |
| 60 | 76 | |
| 61 | −[1] https://developer.arm.com/-/media/developer/pdf/ARM_DEN_0070A_Firmware_interfaces_for_mitigating_CVE-2017-5715.pdf | |
| 77 | +.. [1] https://developer.arm.com/-/media/developer/pdf/ARM_DEN_0070A_Firmware_interfaces_for_mitigating_CVE-2017-5715.pdf | |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=============================================== | |
| 1 | 4 | ARM 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 | ||
| 12 | 15 | a separate, non-overlapping MMIO region. |
| 13 | 16 | |
| 14 | 17 | |
| 15 | −Groups: | |
| 16 | − KVM_DEV_ARM_VGIC_GRP_ADDR | |
| 18 | +Groups | |
| 19 | +====== | |
| 20 | + | |
| 21 | +KVM_DEV_ARM_VGIC_GRP_ADDR | |
| 22 | +------------------------- | |
| 23 | + | |
| 17 | 24 | Attributes: |
| 18 | 25 | KVM_VGIC_ITS_ADDR_TYPE (rw, 64-bit) |
| 19 | 26 | Base address in the guest physical address space of the GICv3 ITS |
| 20 | 27 | control register frame. |
| 21 | 28 | This address needs to be 64K aligned and the region covers 128K. |
| 29 | + | |
| 22 | 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 | + | |
| 41 | +KVM_DEV_ARM_VGIC_GRP_CTRL | |
| 42 | +------------------------- | |
| 29 | 43 | |
| 30 | − KVM_DEV_ARM_VGIC_GRP_CTRL | |
| 31 | 44 | Attributes: |
| 32 | 45 | KVM_DEV_ARM_VGIC_CTRL_INIT |
| 33 | 46 | request the initialization of the ITS, no additional parameter in |
| @@ -58,16 +71,21 @@ Groups: · 24 unmodified lines | ||
| 58 | 71 | "ITS Restore Sequence". |
| 59 | 72 | |
| 60 | 73 | Errors: |
| 61 | − -ENXIO: ITS not properly configured as required prior to setting | |
| 74 | + | |
| 75 | + ======= ========================================================== | |
| 76 | + -ENXIO ITS not properly configured as required prior to setting | |
| 62 | 77 | this attribute |
| 63 | − -ENOMEM: Memory shortage when allocating ITS internal data | |
| 64 | − -EINVAL: Inconsistent restored data | |
| 65 | − -EFAULT: Invalid guest ram access | |
| 66 | − -EBUSY: One or more VCPUS are running | |
| 67 | − -EACCES: The virtual ITS is backed by a physical GICv4 ITS, and the | |
| 78 | + -ENOMEM Memory shortage when allocating ITS internal data | |
| 79 | + -EINVAL Inconsistent restored data | |
| 80 | + -EFAULT Invalid guest ram access | |
| 81 | + -EBUSY One or more VCPUS are running | |
| 82 | + -EACCES The virtual ITS is backed by a physical GICv4 ITS, and the | |
| 68 | 83 | state is not available |
| 84 | + ======= ========================================================== | |
| 85 | + | |
| 86 | +KVM_DEV_ARM_VGIC_GRP_ITS_REGS | |
| 87 | +----------------------------- | |
| 69 | 88 | |
| 70 | − KVM_DEV_ARM_VGIC_GRP_ITS_REGS | |
| 71 | 89 | Attributes: |
| 72 | 90 | The attr field of kvm_device_attr encodes the offset of the |
| 73 | 91 | ITS register, relative to the ITS control frame base address |
| @@ -78,6 +96,7 @@ Groups: · 4 unmodified lines | ||
| 78 | 96 | be accessed with full length. |
| 79 | 97 | |
| 80 | 98 | Writes to read-only registers are ignored by the kernel except for: |
| 99 | + | |
| 81 | 100 | - GITS_CREADR. It must be restored otherwise commands in the queue |
| 82 | 101 | will be re-executed after restoring CWRITER. GITS_CREADR must be |
| 83 | 102 | restored before restoring the GITS_CTLR which is likely to enable the |
| @@ -91,30 +110,36 @@ Groups: · 7 unmodified lines | ||
| 91 | 110 | |
| 92 | 111 | For other registers, getting or setting a register has the same |
| 93 | 112 | effect as reading/writing the register on real hardware. |
| 113 | + | |
| 94 | 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: | |
| 101 | − ------------------------- | |
| 116 | + ======= ==================================================== | |
| 117 | + -ENXIO Offset does not correspond to any supported register | |
| 118 | + -EFAULT Invalid user pointer for attr->addr | |
| 119 | + -EINVAL Offset is not 64-bit aligned | |
| 120 | + -EBUSY one or more VCPUS are running | |
| 121 | + ======= ==================================================== | |
| 122 | + | |
| 123 | +ITS Restore Sequence: | |
| 124 | +--------------------- | |
| 102 | 125 | |
| 103 | 126 | The following ordering must be followed when restoring the GIC and the ITS: |
| 127 | + | |
| 104 | 128 | a) restore all guest memory and create vcpus |
| 105 | 129 | b) restore all redistributors |
| 106 | 130 | c) provide the ITS base address |
| 107 | 131 | (KVM_DEV_ARM_VGIC_GRP_ADDR) |
| 108 | 132 | d) restore the ITS in the following order: |
| 109 | − 1. Restore GITS_CBASER | |
| 110 | − 2. Restore all other GITS_ registers, except GITS_CTLR! | |
| 111 | − 3. Load the ITS table data (KVM_DEV_ARM_ITS_RESTORE_TABLES) | |
| 112 | − 4. Restore GITS_CTLR | |
| 133 | + | |
| 134 | + 1. Restore GITS_CBASER | |
| 135 | + 2. Restore all other ``GITS_`` registers, except GITS_CTLR! | |
| 136 | + 3. Load the ITS table data (KVM_DEV_ARM_ITS_RESTORE_TABLES) | |
| 137 | + 4. Restore GITS_CTLR | |
| 113 | 138 | |
| 114 | 139 | Then vcpus can be started. |
| 115 | 140 | |
| 116 | − ITS Table ABI REV0: | |
| 117 | − ------------------- | |
| 141 | +ITS Table ABI REV0: | |
| 142 | +------------------- | |
| 118 | 143 | |
| 119 | 144 | Revision 0 of the ABI only supports the features of a virtual GICv3, and does |
| 120 | 145 | 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 | 150 | entries in the collection are listed in no particular order. |
| 126 | 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 | | |
| 131 | − values: | V | next | ITT_addr | Size | | |
| 155 | + bits: | 63| 62 ... 49 | 48 ... 5 | 4 ... 0 | | |
| 156 | + values: | V | next | ITT_addr | Size | | |
| 157 | + | |
| 158 | + where: | |
| 132 | 159 | |
| 133 | − where; | |
| 134 | 160 | - V indicates whether the entry is valid. If not, other fields |
| 135 | 161 | are not meaningful. |
| 136 | 162 | - 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 | 166 | - Size specifies the supported number of bits for the EventID, |
| 141 | 167 | 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 | | |
| 146 | − values: | V | RES0 | RDBase | ICID | | |
| 171 | + bits: | 63| 62 .. 52 | 51 ... 16 | 15 ... 0 | | |
| 172 | + values: | V | RES0 | RDBase | ICID | | |
| 147 | 173 | |
| 148 | 174 | where: |
| 175 | + | |
| 149 | 176 | - V indicates whether the entry is valid. If not, other fields are |
| 150 | 177 | not meaningful. |
| 151 | 178 | - RES0: reserved field with Should-Be-Zero-or-Preserved behavior. |
| 152 | 179 | - RDBase is the PE number (GICR_TYPER.Processor_Number semantic), |
| 153 | 180 | - 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 | | |
| 158 | − values: | next | pINTID | ICID | | |
| 184 | + bits: | 63 ... 48 | 47 ... 16 | 15 ... 0 | | |
| 185 | + values: | next | pINTID | ICID | | |
| 159 | 186 | |
| 160 | 187 | where: |
| 188 | + | |
| 161 | 189 | - next: equals to 0 if this entry is the last one; otherwise it corresponds |
| 162 | 190 | to the EventID offset to the next ITE capped by 2^16 -1. |
| 163 | 191 | - pINTID is the physical LPI ID; if zero, it means the entry is not valid |
| 164 | 192 | and other fields are not meaningful. |
| 165 | 193 | - ICID is the collection ID |
| 166 | 194 | |
| 167 | − ITS Reset State: | |
| 168 | − ---------------- | |
| 195 | +ITS Reset State: | |
| 196 | +---------------- | |
| 169 | 197 | |
| 170 | 198 | RESET returns the ITS to the same state that it was when first created and |
| 171 | 199 | initialized. When the RESET command returns, the following things are |
| @@ -1,9 +1,12 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +============================================================== | |
| 1 | 4 | ARM Virtual Generic Interrupt Controller v3 and later (VGICv3) |
| 2 | 5 | ============================================================== |
| 3 | 6 | |
| 4 | 7 | |
| 5 | 8 | Device types supported: |
| 6 | − KVM_DEV_TYPE_ARM_VGIC_V3 ARM Generic Interrupt Controller v3.0 | |
| 9 | + - KVM_DEV_TYPE_ARM_VGIC_V3 ARM Generic Interrupt Controller v3.0 | |
| 7 | 10 | |
| 8 | 11 | Only one VGIC instance may be instantiated through this API. The created VGIC |
| 9 | 12 | will act as the VM interrupt controller, requiring emulated user-space devices |
| @@ -15,7 +18,8 @@ Creating a guest GICv3 device requires a host GICv3 as well. · 5 unmodified lines | ||
| 15 | 18 | |
| 16 | 19 | Groups: |
| 17 | 20 | KVM_DEV_ARM_VGIC_GRP_ADDR |
| 18 | − Attributes: | |
| 21 | + Attributes: | |
| 22 | + | |
| 19 | 23 | KVM_VGIC_V3_ADDR_TYPE_DIST (rw, 64-bit) |
| 20 | 24 | Base address in the guest physical address space of the GICv3 distributor |
| 21 | 25 | register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V3. |
| @@ -29,21 +33,25 @@ Groups: · 7 unmodified lines | ||
| 29 | 33 | This address needs to be 64K aligned. |
| 30 | 34 | |
| 31 | 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: | |
| 33 | − bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 0 | |
| 34 | − values: | count | base | flags | index | |
| 36 | + The attribute data pointed to by kvm_device_attr.addr is a __u64 value:: | |
| 37 | + | |
| 38 | + bits: | 63 .... 52 | 51 .... 16 | 15 - 12 |11 - 0 | |
| 39 | + values: | count | base | flags | index | |
| 40 | + | |
| 35 | 41 | - index encodes the unique redistributor region index |
| 36 | 42 | - flags: reserved for future use, currently 0 |
| 37 | 43 | - base field encodes bits [51:16] of the guest physical base address |
| 38 | 44 | of the first redistributor in the region. |
| 39 | 45 | - count encodes the number of redistributors in the region. Must be |
| 40 | 46 | greater than 0. |
| 47 | + | |
| 41 | 48 | There are two 64K pages for each redistributor in the region and |
| 42 | 49 | redistributors are laid out contiguously within the region. Regions |
| 43 | 50 | are filled with redistributors in the index order. The sum of all |
| 44 | 51 | region count fields must be greater than or equal to the number of |
| 45 | 52 | VCPUs. Redistributor regions must be registered in the incremental |
| 46 | 53 | index order, starting from index 0. |
| 54 | + | |
| 47 | 55 | The characteristics of a specific redistributor region can be read |
| 48 | 56 | by presetting the index field in the attr data. |
| 49 | 57 | Only valid for KVM_DEV_TYPE_ARM_VGIC_V3. |
| @@ -52,23 +60,27 @@ Groups: · 2 unmodified lines | ||
| 52 | 60 | KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attributes. |
| 53 | 61 | |
| 54 | 62 | Errors: |
| 55 | − -E2BIG: Address outside of addressable IPA range | |
| 56 | − -EINVAL: Incorrectly aligned address, bad redistributor region | |
| 63 | + | |
| 64 | + ======= ============================================================= | |
| 65 | + -E2BIG Address outside of addressable IPA range | |
| 66 | + -EINVAL Incorrectly aligned address, bad redistributor region | |
| 57 | 67 | count/index, mixed redistributor region attribute usage |
| 58 | − -EEXIST: Address already configured | |
| 59 | − -ENOENT: Attempt to read the characteristics of a non existing | |
| 68 | + -EEXIST Address already configured | |
| 69 | + -ENOENT Attempt to read the characteristics of a non existing | |
| 60 | 70 | redistributor region |
| 61 | − -ENXIO: The group or attribute is unknown/unsupported for this device | |
| 71 | + -ENXIO The group or attribute is unknown/unsupported for this device | |
| 62 | 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_REGS | |
| 67 | − KVM_DEV_ARM_VGIC_GRP_REDIST_REGS | |
| 68 | − Attributes: | |
| 69 | − The attr field of kvm_device_attr encodes two values: | |
| 70 | − bits: | 63 .... 32 | 31 .... 0 | | |
| 71 | − values: | mpidr | offset | | |
| 80 | + The attr field of kvm_device_attr encodes two values:: | |
| 81 | + | |
| 82 | + bits: | 63 .... 32 | 31 .... 0 | | |
| 83 | + values: | mpidr | offset | | |
| 72 | 84 | |
| 73 | 85 | All distributor regs are (rw, 32-bit) and kvm_device_attr.addr points to a |
| 74 | 86 | __u32 value. 64-bit registers must be accessed by separately accessing the |
| @@ -93,7 +105,8 @@ Groups: · 18 unmodified lines | ||
| 93 | 105 | redistributor is accessed. The mpidr is ignored for the distributor. |
| 94 | 106 | |
| 95 | 107 | 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 | 110 | | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 | |
| 98 | 111 | | Aff3 | Aff2 | Aff1 | Aff0 | |
| 99 | 112 | |
| @@ -148,24 +161,30 @@ Groups: · 48 unmodified lines | ||
| 148 | 161 | ignored. |
| 149 | 162 | |
| 150 | 163 | Errors: |
| 151 | − -ENXIO: Getting or setting this register is not yet supported | |
| 152 | − -EBUSY: One or more VCPUs are running | |
| 164 | + | |
| 165 | + ====== ===================================================== | |
| 166 | + -ENXIO Getting or setting this register is not yet supported | |
| 167 | + -EBUSY One or more VCPUs are running | |
| 168 | + ====== ===================================================== | |
| 153 | 169 | |
| 154 | 170 | |
| 155 | 171 | KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS |
| 156 | − Attributes: | |
| 157 | − The attr field of kvm_device_attr encodes two values: | |
| 158 | − bits: | 63 .... 32 | 31 .... 16 | 15 .... 0 | | |
| 159 | − values: | mpidr | RES | instr | | |
| 172 | + Attributes: | |
| 173 | + | |
| 174 | + The attr field of kvm_device_attr encodes two values:: | |
| 175 | + | |
| 176 | + bits: | 63 .... 32 | 31 .... 16 | 15 .... 0 | | |
| 177 | + values: | mpidr | RES | instr | | |
| 160 | 178 | |
| 161 | 179 | 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 | 182 | | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 | |
| 164 | 183 | | Aff3 | Aff2 | Aff1 | Aff0 | |
| 165 | 184 | |
| 166 | 185 | The instr field encodes the system register to access based on the fields |
| 167 | 186 | 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 | 189 | | 15 ... 14 | 13 ... 11 | 10 ... 7 | 6 ... 3 | 2 ... 0 | |
| 171 | 190 | | Op 0 | Op1 | CRn | CRm | Op2 | |
| @@ -178,26 +197,35 @@ Groups: · 6 unmodified lines | ||
| 178 | 197 | |
| 179 | 198 | CPU interface registers access is not implemented for AArch32 mode. |
| 180 | 199 | Error -ENXIO is returned when accessed in AArch32 mode. |
| 200 | + | |
| 181 | 201 | Errors: |
| 182 | − -ENXIO: Getting or setting this register is not yet supported | |
| 183 | − -EBUSY: VCPU is running | |
| 184 | − -EINVAL: Invalid mpidr or register value supplied | |
| 202 | + | |
| 203 | + ======= ===================================================== | |
| 204 | + -ENXIO Getting or setting this register is not yet supported | |
| 205 | + -EBUSY VCPU is running | |
| 206 | + -EINVAL Invalid mpidr or register value supplied | |
| 207 | + ======= ===================================================== | |
| 185 | 208 | |
| 186 | 209 | |
| 187 | 210 | KVM_DEV_ARM_VGIC_GRP_NR_IRQS |
| 188 | − Attributes: | |
| 211 | + Attributes: | |
| 212 | + | |
| 189 | 213 | A value describing the number of interrupts (SGI, PPI and SPI) for |
| 190 | 214 | this GIC instance, ranging from 64 to 1024, in increments of 32. |
| 191 | 215 | |
| 192 | 216 | kvm_device_attr.addr points to a __u32 value. |
| 193 | 217 | |
| 194 | 218 | Errors: |
| 195 | − -EINVAL: Value set is out of the expected range | |
| 196 | − -EBUSY: Value has already be set. | |
| 219 | + | |
| 220 | + ======= ====================================== | |
| 221 | + -EINVAL Value set is out of the expected range | |
| 222 | + -EBUSY Value has already be set. | |
| 223 | + ======= ====================================== | |
| 197 | 224 | |
| 198 | 225 | |
| 199 | 226 | KVM_DEV_ARM_VGIC_GRP_CTRL |
| 200 | − Attributes: | |
| 227 | + Attributes: | |
| 228 | + | |
| 201 | 229 | KVM_DEV_ARM_VGIC_CTRL_INIT |
| 202 | 230 | request the initialization of the VGIC, no additional parameter in |
| 203 | 231 | kvm_device_attr.addr. |
| @@ -205,20 +233,26 @@ Groups: · 1 unmodified line | ||
| 205 | 233 | save all LPI pending bits into guest RAM pending tables. |
| 206 | 234 | |
| 207 | 235 | The first kB of the pending table is not altered by this operation. |
| 236 | + | |
| 208 | 237 | Errors: |
| 209 | − -ENXIO: VGIC not properly configured as required prior to calling | |
| 210 | − this attribute | |
| 211 | − -ENODEV: no online VCPU | |
| 212 | − -ENOMEM: memory shortage when allocating vgic internal data | |
| 213 | − -EFAULT: Invalid guest ram access | |
| 214 | − -EBUSY: One or more VCPUS are running | |
| 238 | + | |
| 239 | + ======= ======================================================== | |
| 240 | + -ENXIO VGIC not properly configured as required prior to calling | |
| 241 | + this attribute | |
| 242 | + -ENODEV no online VCPU | |
| 243 | + -ENOMEM memory shortage when allocating vgic internal data | |
| 244 | + -EFAULT Invalid guest ram access | |
| 245 | + -EBUSY One or more VCPUS are running | |
| 246 | + ======= ======================================================== | |
| 215 | 247 | |
| 216 | 248 | |
| 217 | 249 | KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO |
| 218 | − Attributes: | |
| 219 | − The attr field of kvm_device_attr encodes the following values: | |
| 220 | − bits: | 63 .... 32 | 31 .... 10 | 9 .... 0 | | |
| 221 | − values: | mpidr | info | vINTID | | |
| 250 | + Attributes: | |
| 251 | + | |
| 252 | + The attr field of kvm_device_attr encodes the following values:: | |
| 253 | + | |
| 254 | + bits: | 63 .... 32 | 31 .... 10 | 9 .... 0 | | |
| 255 | + values: | mpidr | info | vINTID | | |
| 222 | 256 | |
| 223 | 257 | The vINTID specifies which set of IRQs is reported on. |
| 224 | 258 | |
| @@ -228,6 +262,7 @@ Groups: · 3 unmodified lines | ||
| 228 | 262 | VGIC_LEVEL_INFO_LINE_LEVEL: |
| 229 | 263 | Get/Set the input level of the IRQ line for a set of 32 contiguously |
| 230 | 264 | numbered interrupts. |
| 265 | + | |
| 231 | 266 | vINTID must be a multiple of 32. |
| 232 | 267 | |
| 233 | 268 | kvm_device_attr.addr points to a __u32 value which will contain a |
| @@ -243,9 +278,14 @@ Groups: · 9 unmodified lines | ||
| 243 | 278 | reported with the same value regardless of the mpidr specified. |
| 244 | 279 | |
| 245 | 280 | 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 | 283 | | 63 .... 56 | 55 .... 48 | 47 .... 40 | 39 .... 32 | |
| 248 | 284 | | Aff3 | Aff2 | Aff1 | Aff0 | |
| 285 | + | |
| 249 | 286 | Errors: |
| 250 | − -EINVAL: vINTID is not multiple of 32 or | |
| 251 | − info field is not VGIC_LEVEL_INFO_LINE_LEVEL | |
| 287 | + | |
| 288 | + ======= ============================================= | |
| 289 | + -EINVAL vINTID is not multiple of 32 or info field is | |
| 290 | + not VGIC_LEVEL_INFO_LINE_LEVEL | |
| 291 | + ======= ============================================= | |
| @@ -1,8 +1,12 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +================================================== | |
| 1 | 4 | ARM Virtual Generic Interrupt Controller v2 (VGIC) |
| 2 | 5 | ================================================== |
| 3 | 6 | |
| 4 | 7 | Device types supported: |
| 5 | − KVM_DEV_TYPE_ARM_VGIC_V2 ARM Generic Interrupt Controller v2.0 | |
| 8 | + | |
| 9 | + - KVM_DEV_TYPE_ARM_VGIC_V2 ARM Generic Interrupt Controller v2.0 | |
| 6 | 10 | |
| 7 | 11 | Only one VGIC instance may be instantiated through either this API or the |
| 8 | 12 | legacy KVM_CREATE_IRQCHIP API. The created VGIC will act as the VM interrupt |
| @@ -17,7 +21,8 @@ create both a GICv3 and GICv2 device on the same VM. · 8 unmodified lines | ||
| 17 | 21 | |
| 18 | 22 | Groups: |
| 19 | 23 | KVM_DEV_ARM_VGIC_GRP_ADDR |
| 20 | − Attributes: | |
| 24 | + Attributes: | |
| 25 | + | |
| 21 | 26 | KVM_VGIC_V2_ADDR_TYPE_DIST (rw, 64-bit) |
| 22 | 27 | Base address in the guest physical address space of the GIC distributor |
| 23 | 28 | register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2. |
| @@ -27,19 +32,25 @@ Groups: · 3 unmodified lines | ||
| 27 | 32 | Base address in the guest physical address space of the GIC virtual cpu |
| 28 | 33 | interface register mappings. Only valid for KVM_DEV_TYPE_ARM_VGIC_V2. |
| 29 | 34 | This address needs to be 4K aligned and the region covers 4 KByte. |
| 35 | + | |
| 30 | 36 | Errors: |
| 31 | − -E2BIG: Address outside of addressable IPA range | |
| 32 | − -EINVAL: Incorrectly aligned address | |
| 33 | − -EEXIST: Address already configured | |
| 34 | − -ENXIO: The group or attribute is unknown/unsupported for this device | |
| 37 | + | |
| 38 | + ======= ============================================================= | |
| 39 | + -E2BIG Address outside of addressable IPA range | |
| 40 | + -EINVAL Incorrectly aligned address | |
| 41 | + -EEXIST Address already configured | |
| 42 | + -ENXIO The group or attribute is unknown/unsupported for this device | |
| 35 | 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 | 47 | KVM_DEV_ARM_VGIC_GRP_DIST_REGS |
| 39 | − Attributes: | |
| 40 | − The attr field of kvm_device_attr encodes two values: | |
| 41 | − bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 | | |
| 42 | − values: | reserved | vcpu_index | offset | | |
| 48 | + Attributes: | |
| 49 | + | |
| 50 | + The attr field of kvm_device_attr encodes two values:: | |
| 51 | + | |
| 52 | + bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 | | |
| 53 | + values: | reserved | vcpu_index | offset | | |
| 43 | 54 | |
| 44 | 55 | All distributor regs are (rw, 32-bit) |
| 45 | 56 | |
| @@ -58,16 +69,22 @@ Groups: · 12 unmodified lines | ||
| 58 | 69 | KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_CPU_REGS) to ensure |
| 59 | 70 | the expected behavior. Unless GICD_IIDR has been set from userspace, writes |
| 60 | 71 | to the interrupt group registers (GICD_IGROUPR) are ignored. |
| 72 | + | |
| 61 | 73 | Errors: |
| 62 | − -ENXIO: Getting or setting this register is not yet supported | |
| 63 | − -EBUSY: One or more VCPUs are running | |
| 64 | − -EINVAL: Invalid vcpu_index supplied | |
| 74 | + | |
| 75 | + ======= ===================================================== | |
| 76 | + -ENXIO Getting or setting this register is not yet supported | |
| 77 | + -EBUSY One or more VCPUs are running | |
| 78 | + -EINVAL Invalid vcpu_index supplied | |
| 79 | + ======= ===================================================== | |
| 65 | 80 | |
| 66 | 81 | KVM_DEV_ARM_VGIC_GRP_CPU_REGS |
| 67 | − Attributes: | |
| 68 | − The attr field of kvm_device_attr encodes two values: | |
| 69 | − bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 | | |
| 70 | − values: | reserved | vcpu_index | offset | | |
| 82 | + Attributes: | |
| 83 | + | |
| 84 | + The attr field of kvm_device_attr encodes two values:: | |
| 85 | + | |
| 86 | + bits: | 63 .... 40 | 39 .. 32 | 31 .... 0 | | |
| 87 | + values: | reserved | vcpu_index | offset | | |
| 71 | 88 | |
| 72 | 89 | All CPU interface regs are (rw, 32-bit) |
| 73 | 90 | |
| @@ -101,27 +118,39 @@ Groups: · 27 unmodified lines | ||
| 101 | 118 | value left by 3 places to obtain the actual priority mask level. |
| 102 | 119 | |
| 103 | 120 | Errors: |
| 104 | − -ENXIO: Getting or setting this register is not yet supported | |
| 105 | − -EBUSY: One or more VCPUs are running | |
| 106 | − -EINVAL: Invalid vcpu_index supplied | |
| 121 | + | |
| 122 | + ======= ===================================================== | |
| 123 | + -ENXIO Getting or setting this register is not yet supported | |
| 124 | + -EBUSY One or more VCPUs are running | |
| 125 | + -EINVAL Invalid vcpu_index supplied | |
| 126 | + ======= ===================================================== | |
| 107 | 127 | |
| 108 | 128 | KVM_DEV_ARM_VGIC_GRP_NR_IRQS |
| 109 | − Attributes: | |
| 129 | + Attributes: | |
| 130 | + | |
| 110 | 131 | A value describing the number of interrupts (SGI, PPI and SPI) for |
| 111 | 132 | this GIC instance, ranging from 64 to 1024, in increments of 32. |
| 112 | 133 | |
| 113 | 134 | Errors: |
| 114 | − -EINVAL: Value set is out of the expected range | |
| 115 | − -EBUSY: Value has already be set, or GIC has already been initialized | |
| 116 | − with default values. | |
| 135 | + | |
| 136 | + ======= ============================================================= | |
| 137 | + -EINVAL Value set is out of the expected range | |
| 138 | + -EBUSY Value has already be set, or GIC has already been initialized | |
| 139 | + with default values. | |
| 140 | + ======= ============================================================= | |
| 117 | 141 | |
| 118 | 142 | KVM_DEV_ARM_VGIC_GRP_CTRL |
| 119 | − Attributes: | |
| 143 | + Attributes: | |
| 144 | + | |
| 120 | 145 | KVM_DEV_ARM_VGIC_CTRL_INIT |
| 121 | 146 | request the initialization of the VGIC or ITS, no additional parameter |
| 122 | 147 | in kvm_device_attr.addr. |
| 148 | + | |
| 123 | 149 | Errors: |
| 124 | − -ENXIO: VGIC not properly configured as required prior to calling | |
| 125 | − this attribute | |
| 126 | − -ENODEV: no online VCPU | |
| 127 | − -ENOMEM: memory shortage when allocating vgic internal data | |
| 150 | + | |
| 151 | + ======= ========================================================= | |
| 152 | + -ENXIO VGIC not properly configured as required prior to calling | |
| 153 | + this attribute | |
| 154 | + -ENODEV no online VCPU | |
| 155 | + -ENOMEM memory shortage when allocating vgic internal data | |
| 156 | + ======= ========================================================= | |
| @@ -0,0 +1,19 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +======= | |
| 4 | +Devices | |
| 5 | +======= | |
| 6 | + | |
| 7 | +.. toctree:: | |
| 8 | + :maxdepth: 2 | |
| 9 | + | |
| 10 | + arm-vgic-its | |
| 11 | + arm-vgic | |
| 12 | + arm-vgic-v3 | |
| 13 | + mpic | |
| 14 | + s390_flic | |
| 15 | + vcpu | |
| 16 | + vfio | |
| 17 | + vm | |
| 18 | + xics | |
| 19 | + xive | |
| @@ -1,9 +1,13 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +========================= | |
| 1 | 4 | MPIC interrupt controller |
| 2 | 5 | ========================= |
| 3 | 6 | |
| 4 | 7 | Device types supported: |
| 5 | − KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.0 | |
| 6 | − KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.2 | |
| 8 | + | |
| 9 | + - KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.0 | |
| 10 | + - KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.2 | |
| 7 | 11 | |
| 8 | 12 | Only one MPIC instance, of any type, may be instantiated. The created |
| 9 | 13 | MPIC will act as the system interrupt controller, connecting to each |
| @@ -11,7 +15,8 @@ vcpu's interrupt inputs. · 1 unmodified line | ||
| 11 | 15 | |
| 12 | 16 | Groups: |
| 13 | 17 | KVM_DEV_MPIC_GRP_MISC |
| 14 | − Attributes: | |
| 18 | + Attributes: | |
| 19 | + | |
| 15 | 20 | KVM_DEV_MPIC_BASE_ADDR (rw, 64-bit) |
| 16 | 21 | Base address of the 256 KiB MPIC register space. Must be |
| 17 | 22 | naturally aligned. A value of zero disables the mapping. |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +==================================== | |
| 1 | 4 | FLIC (floating interrupt controller) |
| 2 | 5 | ==================================== |
| 3 | 6 | |
| @@ -31,8 +34,10 @@ Groups: · 27 unmodified lines | ||
| 31 | 34 | Copies all floating interrupts into a buffer provided by userspace. |
| 32 | 35 | When the buffer is too small it returns -ENOMEM, which is the indication |
| 33 | 36 | for userspace to try again with a bigger buffer. |
| 37 | + | |
| 34 | 38 | -ENOBUFS is returned when the allocation of a kernelspace buffer has |
| 35 | 39 | failed. |
| 40 | + | |
| 36 | 41 | -EFAULT is returned when copying data to userspace failed. |
| 37 | 42 | All interrupts remain pending, i.e. are not deleted from the list of |
| 38 | 43 | currently pending interrupts. |
| @@ -60,38 +65,41 @@ Groups: · 21 unmodified lines | ||
| 60 | 65 | |
| 61 | 66 | KVM_DEV_FLIC_ADAPTER_REGISTER |
| 62 | 67 | 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 | |
| 65 | −struct kvm_s390_io_adapter { | |
| 66 | − __u32 id; | |
| 67 | − __u8 isc; | |
| 68 | − __u8 maskable; | |
| 69 | − __u8 swap; | |
| 70 | − __u8 flags; | |
| 71 | −}; | |
| 70 | + struct kvm_s390_io_adapter { | |
| 71 | + __u32 id; | |
| 72 | + __u8 isc; | |
| 73 | + __u8 maskable; | |
| 74 | + __u8 swap; | |
| 75 | + __u8 flags; | |
| 76 | + }; | |
| 72 | 77 | |
| 73 | 78 | id contains the unique id for the adapter, isc the I/O interruption subclass |
| 74 | 79 | to use, maskable whether this adapter may be masked (interrupts turned off), |
| 75 | 80 | swap whether the indicators need to be byte swapped, and flags contains |
| 76 | 81 | further characteristics of the adapter. |
| 82 | + | |
| 77 | 83 | Currently defined values for 'flags' are: |
| 84 | + | |
| 78 | 85 | - KVM_S390_ADAPTER_SUPPRESSIBLE: adapter is subject to AIS |
| 79 | 86 | (adapter-interrupt-suppression) facility. This flag only has an effect if |
| 80 | 87 | the AIS capability is enabled. |
| 88 | + | |
| 81 | 89 | Unknown flag values are ignored. |
| 82 | 90 | |
| 83 | 91 | |
| 84 | 92 | KVM_DEV_FLIC_ADAPTER_MODIFY |
| 85 | 93 | 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 | |
| 88 | −struct kvm_s390_io_adapter_req { | |
| 89 | − __u32 id; | |
| 90 | − __u8 type; | |
| 91 | − __u8 mask; | |
| 92 | − __u16 pad0; | |
| 93 | − __u64 addr; | |
| 94 | −}; | |
| 96 | + struct kvm_s390_io_adapter_req { | |
| 97 | + __u32 id; | |
| 98 | + __u8 type; | |
| 99 | + __u8 mask; | |
| 100 | + __u16 pad0; | |
| 101 | + __u64 addr; | |
| 102 | + }; | |
| 95 | 103 | |
| 96 | 104 | id specifies the adapter and type the operation. The supported operations |
| 97 | 105 | are: |
| @@ -103,8 +111,9 @@ struct kvm_s390_io_adapter_req { · 5 unmodified lines | ||
| 103 | 111 | perform a gmap translation for the guest address provided in addr, |
| 104 | 112 | pin a userspace page for the translated address and add it to the |
| 105 | 113 | list of mappings |
| 106 | − Note: A new mapping will be created unconditionally; therefore, | |
| 107 | − the calling code should avoid making duplicate mappings. | |
| 114 | + | |
| 115 | + .. note:: A new mapping will be created unconditionally; therefore, | |
| 116 | + the calling code should avoid making duplicate mappings. | |
| 108 | 117 | |
| 109 | 118 | KVM_S390_IO_ADAPTER_UNMAP |
| 110 | 119 | 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 | 122 | KVM_DEV_FLIC_AISM |
| 114 | 123 | 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 | |
| 117 | −struct kvm_s390_ais_req { | |
| 118 | − __u8 isc; | |
| 119 | − __u16 mode; | |
| 120 | −}; | |
| 126 | + struct kvm_s390_ais_req { | |
| 127 | + __u8 isc; | |
| 128 | + __u16 mode; | |
| 129 | + }; | |
| 121 | 130 | |
| 122 | 131 | isc contains the target I/O interruption subclass, mode the target |
| 123 | 132 | adapter-interruption-suppression mode. The following modes are |
| 124 | 133 | currently supported: |
| 134 | + | |
| 125 | 135 | - KVM_S390_AIS_MODE_ALL: ALL-Interruptions Mode, i.e. airq injection |
| 126 | 136 | is always allowed; |
| 127 | 137 | - 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 | 150 | KVM_DEV_FLIC_AISM_ALL |
| 141 | 151 | 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 | |
| 144 | −struct kvm_s390_ais_all { | |
| 145 | − __u8 simm; /* Single-Interruption-Mode mask */ | |
| 146 | − __u8 nimm; /* No-Interruption-Mode mask * | |
| 147 | −}; | |
| 154 | + struct kvm_s390_ais_all { | |
| 155 | + __u8 simm; /* Single-Interruption-Mode mask */ | |
| 156 | + __u8 nimm; /* No-Interruption-Mode mask * | |
| 157 | + }; | |
| 148 | 158 | |
| 149 | 159 | simm contains Single-Interruption-Mode mask for all ISCs, nimm contains |
| 150 | 160 | 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 | ||
| 159 | 169 | that a FLIC operation is unavailable based on the error code resulting from a |
| 160 | 170 | usage attempt. |
| 161 | 171 | |
| 162 | −Note: The KVM_DEV_FLIC_CLEAR_IO_IRQ ioctl will return EINVAL in case a zero | |
| 163 | −schid is specified. | |
| 172 | +.. note:: The KVM_DEV_FLIC_CLEAR_IO_IRQ ioctl will return EINVAL in case a | |
| 173 | + zero schid is specified. | |
| @@ -0,0 +1,114 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +====================== | |
| 4 | +Generic vcpu interface | |
| 5 | +====================== | |
| 6 | + | |
| 7 | +The virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR, | |
| 8 | +KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct | |
| 9 | +kvm_device_attr as other devices, but targets VCPU-wide settings and controls. | |
| 10 | + | |
| 11 | +The groups and attributes per virtual cpu, if any, are architecture specific. | |
| 12 | + | |
| 13 | +1. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL | |
| 14 | +================================== | |
| 15 | + | |
| 16 | +:Architectures: ARM64 | |
| 17 | + | |
| 18 | +1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ | |
| 19 | +--------------------------------------- | |
| 20 | + | |
| 21 | +:Parameters: in kvm_device_attr.addr the address for PMU overflow interrupt is a | |
| 22 | + pointer to an int | |
| 23 | + | |
| 24 | +Returns: | |
| 25 | + | |
| 26 | + ======= ======================================================== | |
| 27 | + -EBUSY The PMU overflow interrupt is already set | |
| 28 | + -ENXIO The overflow interrupt not set when attempting to get it | |
| 29 | + -ENODEV PMUv3 not supported | |
| 30 | + -EINVAL Invalid PMU overflow interrupt number supplied or | |
| 31 | + trying to set the IRQ number without using an in-kernel | |
| 32 | + irqchip. | |
| 33 | + ======= ======================================================== | |
| 34 | + | |
| 35 | +A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt | |
| 36 | +number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt | |
| 37 | +type must be same for each vcpu. As a PPI, the interrupt number is the same for | |
| 38 | +all vcpus, while as an SPI it must be a separate number per vcpu. | |
| 39 | + | |
| 40 | +1.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT | |
| 41 | +--------------------------------------- | |
| 42 | + | |
| 43 | +:Parameters: no additional parameter in kvm_device_attr.addr | |
| 44 | + | |
| 45 | +Returns: | |
| 46 | + | |
| 47 | + ======= ====================================================== | |
| 48 | + -ENODEV PMUv3 not supported or GIC not initialized | |
| 49 | + -ENXIO PMUv3 not properly configured or in-kernel irqchip not | |
| 50 | + configured as required prior to calling this attribute | |
| 51 | + -EBUSY PMUv3 already initialized | |
| 52 | + ======= ====================================================== | |
| 53 | + | |
| 54 | +Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel | |
| 55 | +virtual GIC implementation, this must be done after initializing the in-kernel | |
| 56 | +irqchip. | |
| 57 | + | |
| 58 | + | |
| 59 | +2. GROUP: KVM_ARM_VCPU_TIMER_CTRL | |
| 60 | +================================= | |
| 61 | + | |
| 62 | +:Architectures: ARM, ARM64 | |
| 63 | + | |
| 64 | +2.1. ATTRIBUTES: KVM_ARM_VCPU_TIMER_IRQ_VTIMER, KVM_ARM_VCPU_TIMER_IRQ_PTIMER | |
| 65 | +----------------------------------------------------------------------------- | |
| 66 | + | |
| 67 | +:Parameters: in kvm_device_attr.addr the address for the timer interrupt is a | |
| 68 | + pointer to an int | |
| 69 | + | |
| 70 | +Returns: | |
| 71 | + | |
| 72 | + ======= ================================= | |
| 73 | + -EINVAL Invalid timer interrupt number | |
| 74 | + -EBUSY One or more VCPUs has already run | |
| 75 | + ======= ================================= | |
| 76 | + | |
| 77 | +A value describing the architected timer interrupt number when connected to an | |
| 78 | +in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the | |
| 79 | +attribute overrides the default values (see below). | |
| 80 | + | |
| 81 | +============================= ========================================== | |
| 82 | +KVM_ARM_VCPU_TIMER_IRQ_VTIMER The EL1 virtual timer intid (default: 27) | |
| 83 | +KVM_ARM_VCPU_TIMER_IRQ_PTIMER The EL1 physical timer intid (default: 30) | |
| 84 | +============================= ========================================== | |
| 85 | + | |
| 86 | +Setting the same PPI for different timers will prevent the VCPUs from running. | |
| 87 | +Setting the interrupt number on a VCPU configures all VCPUs created at that | |
| 88 | +time to use the number provided for a given timer, overwriting any previously | |
| 89 | +configured values on other VCPUs. Userspace should configure the interrupt | |
| 90 | +numbers on at least one VCPU after creating all VCPUs and before running any | |
| 91 | +VCPUs. | |
| 92 | + | |
| 93 | +3. GROUP: KVM_ARM_VCPU_PVTIME_CTRL | |
| 94 | +================================== | |
| 95 | + | |
| 96 | +:Architectures: ARM64 | |
| 97 | + | |
| 98 | +3.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA | |
| 99 | +-------------------------------------- | |
| 100 | + | |
| 101 | +:Parameters: 64-bit base address | |
| 102 | + | |
| 103 | +Returns: | |
| 104 | + | |
| 105 | + ======= ====================================== | |
| 106 | + -ENXIO Stolen time not implemented | |
| 107 | + -EEXIST Base address already set for this VCPU | |
| 108 | + -EINVAL Base address not 64 byte aligned | |
| 109 | + ======= ====================================== | |
| 110 | + | |
| 111 | +Specifies the base address of the stolen time structure for this VCPU. The | |
| 112 | +base address must be 64 byte aligned and exist within a valid guest memory | |
| 113 | +region. See Documentation/virt/kvm/arm/pvtime.txt for more information | |
| 114 | +including the layout of the stolen time structure. | |
| @@ -1,76 +0,0 @@ | ||
| 1 | −Generic vcpu interface | |
| 2 | −==================================== | |
| 3 | − | |
| 4 | −The virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR, | |
| 5 | −KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct | |
| 6 | −kvm_device_attr as other devices, but targets VCPU-wide settings and controls. | |
| 7 | − | |
| 8 | −The groups and attributes per virtual cpu, if any, are architecture specific. | |
| 9 | − | |
| 10 | −1. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL | |
| 11 | −Architectures: ARM64 | |
| 12 | − | |
| 13 | −1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ | |
| 14 | −Parameters: in kvm_device_attr.addr the address for PMU overflow interrupt is a | |
| 15 | − pointer to an int | |
| 16 | −Returns: -EBUSY: The PMU overflow interrupt is already set | |
| 17 | − -ENXIO: The overflow interrupt not set when attempting to get it | |
| 18 | − -ENODEV: PMUv3 not supported | |
| 19 | − -EINVAL: Invalid PMU overflow interrupt number supplied or | |
| 20 | − trying to set the IRQ number without using an in-kernel | |
| 21 | − irqchip. | |
| 22 | − | |
| 23 | −A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt | |
| 24 | −number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt | |
| 25 | −type must be same for each vcpu. As a PPI, the interrupt number is the same for | |
| 26 | −all vcpus, while as an SPI it must be a separate number per vcpu. | |
| 27 | − | |
| 28 | −1.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT | |
| 29 | −Parameters: no additional parameter in kvm_device_attr.addr | |
| 30 | −Returns: -ENODEV: PMUv3 not supported or GIC not initialized | |
| 31 | − -ENXIO: PMUv3 not properly configured or in-kernel irqchip not | |
| 32 | − configured as required prior to calling this attribute | |
| 33 | − -EBUSY: PMUv3 already initialized | |
| 34 | − | |
| 35 | −Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel | |
| 36 | −virtual GIC implementation, this must be done after initializing the in-kernel | |
| 37 | −irqchip. | |
| 38 | − | |
| 39 | − | |
| 40 | −2. GROUP: KVM_ARM_VCPU_TIMER_CTRL | |
| 41 | −Architectures: ARM,ARM64 | |
| 42 | − | |
| 43 | −2.1. ATTRIBUTE: KVM_ARM_VCPU_TIMER_IRQ_VTIMER | |
| 44 | −2.2. ATTRIBUTE: KVM_ARM_VCPU_TIMER_IRQ_PTIMER | |
| 45 | −Parameters: in kvm_device_attr.addr the address for the timer interrupt is a | |
| 46 | − pointer to an int | |
| 47 | −Returns: -EINVAL: Invalid timer interrupt number | |
| 48 | − -EBUSY: One or more VCPUs has already run | |
| 49 | − | |
| 50 | −A value describing the architected timer interrupt number when connected to an | |
| 51 | −in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the | |
| 52 | −attribute overrides the default values (see below). | |
| 53 | − | |
| 54 | −KVM_ARM_VCPU_TIMER_IRQ_VTIMER: The EL1 virtual timer intid (default: 27) | |
| 55 | −KVM_ARM_VCPU_TIMER_IRQ_PTIMER: The EL1 physical timer intid (default: 30) | |
| 56 | − | |
| 57 | −Setting the same PPI for different timers will prevent the VCPUs from running. | |
| 58 | −Setting the interrupt number on a VCPU configures all VCPUs created at that | |
| 59 | −time to use the number provided for a given timer, overwriting any previously | |
| 60 | −configured values on other VCPUs. Userspace should configure the interrupt | |
| 61 | −numbers on at least one VCPU after creating all VCPUs and before running any | |
| 62 | −VCPUs. | |
| 63 | − | |
| 64 | −3. GROUP: KVM_ARM_VCPU_PVTIME_CTRL | |
| 65 | −Architectures: ARM64 | |
| 66 | − | |
| 67 | −3.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA | |
| 68 | −Parameters: 64-bit base address | |
| 69 | −Returns: -ENXIO: Stolen time not implemented | |
| 70 | − -EEXIST: Base address already set for this VCPU | |
| 71 | − -EINVAL: Base address not 64 byte aligned | |
| 72 | − | |
| 73 | −Specifies the base address of the stolen time structure for this VCPU. The | |
| 74 | −base address must be 64 byte aligned and exist within a valid guest memory | |
| 75 | −region. See Documentation/virt/kvm/arm/pvtime.txt for more information | |
| 76 | −including the layout of the stolen time structure. | |
| @@ -1,8 +1,12 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=================== | |
| 1 | 4 | VFIO virtual device |
| 2 | 5 | =================== |
| 3 | 6 | |
| 4 | 7 | Device types supported: |
| 5 | − KVM_DEV_TYPE_VFIO | |
| 8 | + | |
| 9 | + - KVM_DEV_TYPE_VFIO | |
| 6 | 10 | |
| 7 | 11 | Only one VFIO instance may be created per VM. The created device |
| 8 | 12 | tracks VFIO groups in use by the VM and features of those groups |
| @@ -23,14 +27,15 @@ KVM_DEV_VFIO_GROUP attributes: · 14 unmodified lines | ||
| 23 | 27 | for the VFIO group. |
| 24 | 28 | KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE: attaches a guest visible TCE table |
| 25 | 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 { | |
| 29 | − __s32 groupfd; | |
| 30 | − __s32 tablefd; | |
| 31 | − }; | |
| 37 | + where: | |
| 32 | 38 | |
| 33 | − where | |
| 34 | − @groupfd is a file descriptor for a VFIO group; | |
| 35 | − @tablefd is a file descriptor for a TCE table allocated via | |
| 36 | − KVM_CREATE_SPAPR_TCE. | |
| 39 | + - @groupfd is a file descriptor for a VFIO group; | |
| 40 | + - @tablefd is a file descriptor for a TCE table allocated via | |
| 41 | + KVM_CREATE_SPAPR_TCE. | |
| @@ -1,5 +1,8 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +==================== | |
| 1 | 4 | Generic vm interface |
| 2 | −==================================== | |
| 5 | +==================== | |
| 3 | 6 | |
| 4 | 7 | The virtual machine "device" also accepts the ioctls KVM_SET_DEVICE_ATTR, |
| 5 | 8 | KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same |
| @@ -10,30 +13,38 @@ The groups and attributes per virtual machine, if any, are architecture · 4 unmodified lines | ||
| 10 | 13 | specific. |
| 11 | 14 | |
| 12 | 15 | 1. GROUP: KVM_S390_VM_MEM_CTRL |
| 13 | −Architectures: s390 | |
| 16 | +============================== | |
| 17 | + | |
| 18 | +:Architectures: s390 | |
| 14 | 19 | |
| 15 | 20 | 1.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA |
| 16 | −Parameters: none | |
| 17 | −Returns: -EBUSY if a vcpu is already defined, otherwise 0 | |
| 21 | +------------------------------------------- | |
| 22 | + | |
| 23 | +:Parameters: none | |
| 24 | +:Returns: -EBUSY if a vcpu is already defined, otherwise 0 | |
| 18 | 25 | |
| 19 | 26 | Enables Collaborative Memory Management Assist (CMMA) for the virtual machine. |
| 20 | 27 | |
| 21 | 28 | 1.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA |
| 22 | −Parameters: none | |
| 23 | −Returns: -EINVAL if CMMA was not enabled | |
| 24 | − 0 otherwise | |
| 29 | +---------------------------------------- | |
| 30 | + | |
| 31 | +:Parameters: none | |
| 32 | +:Returns: -EINVAL if CMMA was not enabled; | |
| 33 | + 0 otherwise | |
| 25 | 34 | |
| 26 | 35 | Clear the CMMA status for all guest pages, so any pages the guest marked |
| 27 | 36 | as unused are again used any may not be reclaimed by the host. |
| 28 | 37 | |
| 29 | 38 | 1.3. ATTRIBUTE KVM_S390_VM_MEM_LIMIT_SIZE |
| 30 | −Parameters: in attr->addr the address for the new limit of guest memory | |
| 31 | −Returns: -EFAULT if the given address is not accessible | |
| 32 | − -EINVAL if the virtual machine is of type UCONTROL | |
| 33 | − -E2BIG if the given guest memory is to big for that machine | |
| 34 | − -EBUSY if a vcpu is already defined | |
| 35 | − -ENOMEM if not enough memory is available for a new shadow guest mapping | |
| 36 | − 0 otherwise | |
| 39 | +----------------------------------------- | |
| 40 | + | |
| 41 | +:Parameters: in attr->addr the address for the new limit of guest memory | |
| 42 | +:Returns: -EFAULT if the given address is not accessible; | |
| 43 | + -EINVAL if the virtual machine is of type UCONTROL; | |
| 44 | + -E2BIG if the given guest memory is to big for that machine; | |
| 45 | + -EBUSY if a vcpu is already defined; | |
| 46 | + -ENOMEM if not enough memory is available for a new shadow guest mapping; | |
| 47 | + 0 otherwise. | |
| 37 | 48 | |
| 38 | 49 | Allows userspace to query the actual limit and set a new limit for |
| 39 | 50 | the maximum guest memory size. The limit will be rounded up to |
| @@ -42,78 +53,92 @@ the number of page table levels. In the case that there is no limit we will set · 2 unmodified lines | ||
| 42 | 53 | the limit to KVM_S390_NO_MEM_LIMIT (U64_MAX). |
| 43 | 54 | |
| 44 | 55 | 2. GROUP: KVM_S390_VM_CPU_MODEL |
| 45 | −Architectures: s390 | |
| 56 | +=============================== | |
| 57 | + | |
| 58 | +:Architectures: s390 | |
| 46 | 59 | |
| 47 | 60 | 2.1. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE (r/o) |
| 61 | +--------------------------------------------- | |
| 48 | 62 | |
| 49 | −Allows user space to retrieve machine and kvm specific cpu related information: | |
| 63 | +Allows user space to retrieve machine and kvm specific cpu related information:: | |
| 50 | 64 | |
| 51 | −struct kvm_s390_vm_cpu_machine { | |
| 65 | + struct kvm_s390_vm_cpu_machine { | |
| 52 | 66 | __u64 cpuid; # CPUID of host |
| 53 | 67 | __u32 ibc; # IBC level range offered by host |
| 54 | 68 | __u8 pad[4]; |
| 55 | 69 | __u64 fac_mask[256]; # set of cpu facilities enabled by KVM |
| 56 | 70 | __u64 fac_list[256]; # set of cpu facilities offered by host |
| 57 | −} | |
| 71 | + } | |
| 58 | 72 | |
| 59 | −Parameters: address of buffer to store the machine related cpu data | |
| 60 | − of type struct kvm_s390_vm_cpu_machine* | |
| 61 | −Returns: -EFAULT if the given address is not accessible from kernel space | |
| 62 | − -ENOMEM if not enough memory is available to process the ioctl | |
| 63 | − 0 in case of success | |
| 73 | +:Parameters: address of buffer to store the machine related cpu data | |
| 74 | + of type struct kvm_s390_vm_cpu_machine* | |
| 75 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 76 | + -ENOMEM if not enough memory is available to process the ioctl; | |
| 77 | + 0 in case of success. | |
| 64 | 78 | |
| 65 | 79 | 2.2. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR (r/w) |
| 80 | +=============================================== | |
| 66 | 81 | |
| 67 | −Allows user space to retrieve or request to change cpu related information for a vcpu: | |
| 82 | +Allows user space to retrieve or request to change cpu related information for a vcpu:: | |
| 68 | 83 | |
| 69 | −struct kvm_s390_vm_cpu_processor { | |
| 84 | + struct kvm_s390_vm_cpu_processor { | |
| 70 | 85 | __u64 cpuid; # CPUID currently (to be) used by this vcpu |
| 71 | 86 | __u16 ibc; # IBC level currently (to be) used by this vcpu |
| 72 | 87 | __u8 pad[6]; |
| 73 | 88 | __u64 fac_list[256]; # set of cpu facilities currently (to be) used |
| 74 | − # by this vcpu | |
| 75 | −} | |
| 89 | + # by this vcpu | |
| 90 | + } | |
| 76 | 91 | |
| 77 | 92 | KVM does not enforce or limit the cpu model data in any form. Take the information |
| 78 | 93 | retrieved by means of KVM_S390_VM_CPU_MACHINE as hint for reasonable configuration |
| 79 | 94 | setups. Instruction interceptions triggered by additionally set facility bits that |
| 80 | 95 | are not handled by KVM need to by imlemented in the VM driver code. |
| 81 | 96 | |
| 82 | −Parameters: address of buffer to store/set the processor related cpu | |
| 83 | − data of type struct kvm_s390_vm_cpu_processor*. | |
| 84 | −Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case) | |
| 85 | − -EFAULT if the given address is not accessible from kernel space | |
| 86 | − -ENOMEM if not enough memory is available to process the ioctl | |
| 87 | − 0 in case of success | |
| 97 | +:Parameters: address of buffer to store/set the processor related cpu | |
| 98 | + data of type struct kvm_s390_vm_cpu_processor*. | |
| 99 | +:Returns: -EBUSY in case 1 or more vcpus are already activated (only in write case); | |
| 100 | + -EFAULT if the given address is not accessible from kernel space; | |
| 101 | + -ENOMEM if not enough memory is available to process the ioctl; | |
| 102 | + 0 in case of success. | |
| 103 | + | |
| 104 | +.. _KVM_S390_VM_CPU_MACHINE_FEAT: | |
| 88 | 105 | |
| 89 | 106 | 2.3. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_FEAT (r/o) |
| 107 | +-------------------------------------------------- | |
| 90 | 108 | |
| 91 | 109 | Allows user space to retrieve available cpu features. A feature is available if |
| 92 | 110 | provided by the hardware and supported by kvm. In theory, cpu features could |
| 93 | 111 | even be completely emulated by kvm. |
| 94 | 112 | |
| 95 | −struct kvm_s390_vm_cpu_feat { | |
| 96 | − __u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering | |
| 97 | −}; | |
| 113 | +:: | |
| 98 | 114 | |
| 99 | −Parameters: address of a buffer to load the feature list from. | |
| 100 | −Returns: -EFAULT if the given address is not accessible from kernel space. | |
| 101 | − 0 in case of success. | |
| 115 | + struct kvm_s390_vm_cpu_feat { | |
| 116 | + __u64 feat[16]; # Bitmap (1 = feature available), MSB 0 bit numbering | |
| 117 | + }; | |
| 118 | + | |
| 119 | +:Parameters: address of a buffer to load the feature list from. | |
| 120 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 121 | + 0 in case of success. | |
| 102 | 122 | |
| 103 | 123 | 2.4. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_FEAT (r/w) |
| 124 | +---------------------------------------------------- | |
| 104 | 125 | |
| 105 | 126 | Allows user space to retrieve or change enabled cpu features for all VCPUs of a |
| 106 | 127 | VM. Features that are not available cannot be enabled. |
| 107 | 128 | |
| 108 | −See 2.3. for a description of the parameter struct. | |
| 129 | +See :ref:`KVM_S390_VM_CPU_MACHINE_FEAT` for | |
| 130 | +a description of the parameter struct. | |
| 109 | 131 | |
| 110 | −Parameters: address of a buffer to store/load the feature list from. | |
| 111 | −Returns: -EFAULT if the given address is not accessible from kernel space. | |
| 112 | − -EINVAL if a cpu feature that is not available is to be enabled. | |
| 113 | − -EBUSY if at least one VCPU has already been defined. | |
| 132 | +:Parameters: address of a buffer to store/load the feature list from. | |
| 133 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 134 | + -EINVAL if a cpu feature that is not available is to be enabled; | |
| 135 | + -EBUSY if at least one VCPU has already been defined; | |
| 114 | 136 | 0 in case of success. |
| 115 | 137 | |
| 138 | +.. _KVM_S390_VM_CPU_MACHINE_SUBFUNC: | |
| 139 | + | |
| 116 | 140 | 2.5. ATTRIBUTE: KVM_S390_VM_CPU_MACHINE_SUBFUNC (r/o) |
| 141 | +----------------------------------------------------- | |
| 117 | 142 | |
| 118 | 143 | Allows user space to retrieve available cpu subfunctions without any filtering |
| 119 | 144 | done by a set IBC. These subfunctions are indicated to the guest VCPU via |
| @@ -126,7 +151,9 @@ contained in the returned struct. If the affected instruction · 6 unmodified lines | ||
| 126 | 151 | indicates subfunctions via a "test bit" mechanism, the subfunction codes are |
| 127 | 152 | contained in the returned struct in MSB 0 bit numbering. |
| 128 | 153 | |
| 129 | −struct kvm_s390_vm_cpu_subfunc { | |
| 154 | +:: | |
| 155 | + | |
| 156 | + struct kvm_s390_vm_cpu_subfunc { | |
| 130 | 157 | u8 plo[32]; # always valid (ESA/390 feature) |
| 131 | 158 | u8 ptff[16]; # valid with TOD-clock steering |
| 132 | 159 | u8 kmac[16]; # valid with Message-Security-Assist |
| @@ -143,13 +170,14 @@ struct kvm_s390_vm_cpu_subfunc { · 10 unmodified lines | ||
| 143 | 170 | u8 kma[16]; # valid with Message-Security-Assist-Extension 8 |
| 144 | 171 | u8 kdsa[16]; # valid with Message-Security-Assist-Extension 9 |
| 145 | 172 | u8 reserved[1792]; # reserved for future instructions |
| 146 | −}; | |
| 173 | + }; | |
| 147 | 174 | |
| 148 | −Parameters: address of a buffer to load the subfunction blocks from. | |
| 149 | −Returns: -EFAULT if the given address is not accessible from kernel space. | |
| 175 | +:Parameters: address of a buffer to load the subfunction blocks from. | |
| 176 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 150 | 177 | 0 in case of success. |
| 151 | 178 | |
| 152 | 179 | 2.6. ATTRIBUTE: KVM_S390_VM_CPU_PROCESSOR_SUBFUNC (r/w) |
| 180 | +------------------------------------------------------- | |
| 153 | 181 | |
| 154 | 182 | Allows user space to retrieve or change cpu subfunctions to be indicated for |
| 155 | 183 | all VCPUs of a VM. This attribute will only be available if kernel and |
| @@ -164,107 +192,125 @@ As long as no data has been written, a read will fail. The IBC will be used · 8 unmodified lines | ||
| 164 | 192 | to determine available subfunctions in this case, this will guarantee backward |
| 165 | 193 | compatibility. |
| 166 | 194 | |
| 167 | −See 2.5. for a description of the parameter struct. | |
| 195 | +See :ref:`KVM_S390_VM_CPU_MACHINE_SUBFUNC` for a | |
| 196 | +description of the parameter struct. | |
| 168 | 197 | |
| 169 | −Parameters: address of a buffer to store/load the subfunction blocks from. | |
| 170 | −Returns: -EFAULT if the given address is not accessible from kernel space. | |
| 171 | − -EINVAL when reading, if there was no write yet. | |
| 172 | − -EBUSY if at least one VCPU has already been defined. | |
| 198 | +:Parameters: address of a buffer to store/load the subfunction blocks from. | |
| 199 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 200 | + -EINVAL when reading, if there was no write yet; | |
| 201 | + -EBUSY if at least one VCPU has already been defined; | |
| 173 | 202 | 0 in case of success. |
| 174 | 203 | |
| 175 | 204 | 3. GROUP: KVM_S390_VM_TOD |
| 176 | −Architectures: s390 | |
| 205 | +========================= | |
| 206 | + | |
| 207 | +:Architectures: s390 | |
| 177 | 208 | |
| 178 | 209 | 3.1. ATTRIBUTE: KVM_S390_VM_TOD_HIGH |
| 210 | +------------------------------------ | |
| 179 | 211 | |
| 180 | 212 | Allows user space to set/get the TOD clock extension (u8) (superseded by |
| 181 | 213 | KVM_S390_VM_TOD_EXT). |
| 182 | 214 | |
| 183 | −Parameters: address of a buffer in user space to store the data (u8) to | |
| 184 | −Returns: -EFAULT if the given address is not accessible from kernel space | |
| 215 | +:Parameters: address of a buffer in user space to store the data (u8) to | |
| 216 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 185 | 217 | -EINVAL if setting the TOD clock extension to != 0 is not supported |
| 186 | 218 | |
| 187 | 219 | 3.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW |
| 220 | +----------------------------------- | |
| 188 | 221 | |
| 189 | 222 | Allows user space to set/get bits 0-63 of the TOD clock register as defined in |
| 190 | 223 | the POP (u64). |
| 191 | 224 | |
| 192 | −Parameters: address of a buffer in user space to store the data (u64) to | |
| 193 | −Returns: -EFAULT if the given address is not accessible from kernel space | |
| 225 | +:Parameters: address of a buffer in user space to store the data (u64) to | |
| 226 | +:Returns: -EFAULT if the given address is not accessible from kernel space | |
| 194 | 227 | |
| 195 | 228 | 3.3. ATTRIBUTE: KVM_S390_VM_TOD_EXT |
| 229 | +----------------------------------- | |
| 230 | + | |
| 196 | 231 | Allows user space to set/get bits 0-63 of the TOD clock register as defined in |
| 197 | 232 | the POP (u64). If the guest CPU model supports the TOD clock extension (u8), it |
| 198 | 233 | also allows user space to get/set it. If the guest CPU model does not support |
| 199 | 234 | it, it is stored as 0 and not allowed to be set to a value != 0. |
| 200 | 235 | |
| 201 | −Parameters: address of a buffer in user space to store the data | |
| 202 | − (kvm_s390_vm_tod_clock) to | |
| 203 | −Returns: -EFAULT if the given address is not accessible from kernel space | |
| 236 | +:Parameters: address of a buffer in user space to store the data | |
| 237 | + (kvm_s390_vm_tod_clock) to | |
| 238 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 204 | 239 | -EINVAL if setting the TOD clock extension to != 0 is not supported |
| 205 | 240 | |
| 206 | 241 | 4. GROUP: KVM_S390_VM_CRYPTO |
| 207 | −Architectures: s390 | |
| 242 | +============================ | |
| 243 | + | |
| 244 | +:Architectures: s390 | |
| 208 | 245 | |
| 209 | 246 | 4.1. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_AES_KW (w/o) |
| 247 | +------------------------------------------------------ | |
| 210 | 248 | |
| 211 | 249 | Allows user space to enable aes key wrapping, including generating a new |
| 212 | 250 | wrapping key. |
| 213 | 251 | |
| 214 | −Parameters: none | |
| 215 | −Returns: 0 | |
| 252 | +:Parameters: none | |
| 253 | +:Returns: 0 | |
| 216 | 254 | |
| 217 | 255 | 4.2. ATTRIBUTE: KVM_S390_VM_CRYPTO_ENABLE_DEA_KW (w/o) |
| 256 | +------------------------------------------------------ | |
| 218 | 257 | |
| 219 | 258 | Allows user space to enable dea key wrapping, including generating a new |
| 220 | 259 | wrapping key. |
| 221 | 260 | |
| 222 | −Parameters: none | |
| 223 | −Returns: 0 | |
| 261 | +:Parameters: none | |
| 262 | +:Returns: 0 | |
| 224 | 263 | |
| 225 | 264 | 4.3. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_AES_KW (w/o) |
| 265 | +------------------------------------------------------- | |
| 226 | 266 | |
| 227 | 267 | Allows user space to disable aes key wrapping, clearing the wrapping key. |
| 228 | 268 | |
| 229 | −Parameters: none | |
| 230 | −Returns: 0 | |
| 269 | +:Parameters: none | |
| 270 | +:Returns: 0 | |
| 231 | 271 | |
| 232 | 272 | 4.4. ATTRIBUTE: KVM_S390_VM_CRYPTO_DISABLE_DEA_KW (w/o) |
| 273 | +------------------------------------------------------- | |
| 233 | 274 | |
| 234 | 275 | Allows user space to disable dea key wrapping, clearing the wrapping key. |
| 235 | 276 | |
| 236 | −Parameters: none | |
| 237 | −Returns: 0 | |
| 277 | +:Parameters: none | |
| 278 | +:Returns: 0 | |
| 238 | 279 | |
| 239 | 280 | 5. GROUP: KVM_S390_VM_MIGRATION |
| 240 | −Architectures: s390 | |
| 281 | +=============================== | |
| 282 | + | |
| 283 | +:Architectures: s390 | |
| 241 | 284 | |
| 242 | 285 | 5.1. ATTRIBUTE: KVM_S390_VM_MIGRATION_STOP (w/o) |
| 286 | +------------------------------------------------ | |
| 243 | 287 | |
| 244 | 288 | Allows userspace to stop migration mode, needed for PGSTE migration. |
| 245 | 289 | Setting this attribute when migration mode is not active will have no |
| 246 | 290 | effects. |
| 247 | 291 | |
| 248 | −Parameters: none | |
| 249 | −Returns: 0 | |
| 292 | +:Parameters: none | |
| 293 | +:Returns: 0 | |
| 250 | 294 | |
| 251 | 295 | 5.2. ATTRIBUTE: KVM_S390_VM_MIGRATION_START (w/o) |
| 296 | +------------------------------------------------- | |
| 252 | 297 | |
| 253 | 298 | Allows userspace to start migration mode, needed for PGSTE migration. |
| 254 | 299 | Setting this attribute when migration mode is already active will have |
| 255 | 300 | no effects. |
| 256 | 301 | |
| 257 | −Parameters: none | |
| 258 | −Returns: -ENOMEM if there is not enough free memory to start migration mode | |
| 259 | − -EINVAL if the state of the VM is invalid (e.g. no memory defined) | |
| 302 | +:Parameters: none | |
| 303 | +:Returns: -ENOMEM if there is not enough free memory to start migration mode; | |
| 304 | + -EINVAL if the state of the VM is invalid (e.g. no memory defined); | |
| 260 | 305 | 0 in case of success. |
| 261 | 306 | |
| 262 | 307 | 5.3. ATTRIBUTE: KVM_S390_VM_MIGRATION_STATUS (r/o) |
| 308 | +-------------------------------------------------- | |
| 263 | 309 | |
| 264 | 310 | Allows userspace to query the status of migration mode. |
| 265 | 311 | |
| 266 | −Parameters: address of a buffer in user space to store the data (u64) to; | |
| 267 | − the data itself is either 0 if migration mode is disabled or 1 | |
| 268 | − if it is enabled | |
| 269 | −Returns: -EFAULT if the given address is not accessible from kernel space | |
| 312 | +:Parameters: address of a buffer in user space to store the data (u64) to; | |
| 313 | + the data itself is either 0 if migration mode is disabled or 1 | |
| 314 | + if it is enabled | |
| 315 | +:Returns: -EFAULT if the given address is not accessible from kernel space; | |
| 270 | 316 | 0 in case of success. |
| @@ -1,20 +1,31 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +========================= | |
| 1 | 4 | XICS interrupt controller |
| 5 | +========================= | |
| 2 | 6 | |
| 3 | 7 | Device type supported: KVM_DEV_TYPE_XICS |
| 4 | 8 | |
| 5 | 9 | Groups: |
| 6 | 10 | 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 | 14 | 2. KVM_DEV_XICS_GRP_CTRL |
| 10 | − Attributes: | |
| 11 | − 2.1 KVM_DEV_XICS_NR_SERVERS (write only) | |
| 15 | + Attributes: | |
| 16 | + | |
| 17 | + 2.1 KVM_DEV_XICS_NR_SERVERS (write only) | |
| 18 | + | |
| 12 | 19 | The kvm_device_attr.addr points to a __u32 value which is the number of |
| 13 | 20 | interrupt server numbers (ie, highest possible vcpu id plus one). |
| 21 | + | |
| 14 | 22 | Errors: |
| 15 | − -EINVAL: Value greater than KVM_MAX_VCPU_ID. | |
| 16 | − -EFAULT: Invalid user pointer for attr->addr. | |
| 17 | − -EBUSY: A vcpu is already connected to the device. | |
| 23 | + | |
| 24 | + ======= ========================================== | |
| 25 | + -EINVAL Value greater than KVM_MAX_VCPU_ID. | |
| 26 | + -EFAULT Invalid user pointer for attr->addr. | |
| 27 | + -EBUSY A vcpu is already connected to the device. | |
| 28 | + ======= ========================================== | |
| 18 | 29 | |
| 19 | 30 | This device emulates the XICS (eXternal Interrupt Controller |
| 20 | 31 | Specification) defined in PAPR. The XICS has a set of interrupt |
| @@ -53,24 +64,29 @@ the interrupt source number. The 64 bit state word has the following · 32 unmodified lines | ||
| 53 | 64 | bitfields, starting from the least-significant end of the word: |
| 54 | 65 | |
| 55 | 66 | * Destination (server number), 32 bits |
| 67 | + | |
| 56 | 68 | This specifies where the interrupt should be sent, and is the |
| 57 | 69 | interrupt server number specified for the destination vcpu. |
| 58 | 70 | |
| 59 | 71 | * Priority, 8 bits |
| 72 | + | |
| 60 | 73 | This is the priority specified for this interrupt source, where 0 is |
| 61 | 74 | the highest priority and 255 is the lowest. An interrupt with a |
| 62 | 75 | priority of 255 will never be delivered. |
| 63 | 76 | |
| 64 | 77 | * Level sensitive flag, 1 bit |
| 78 | + | |
| 65 | 79 | This bit is 1 for a level-sensitive interrupt source, or 0 for |
| 66 | 80 | edge-sensitive (or MSI). |
| 67 | 81 | |
| 68 | 82 | * Masked flag, 1 bit |
| 83 | + | |
| 69 | 84 | This bit is set to 1 if the interrupt is masked (cannot be delivered |
| 70 | 85 | regardless of its priority), for example by the ibm,int-off RTAS |
| 71 | 86 | call, or 0 if it is not masked. |
| 72 | 87 | |
| 73 | 88 | * Pending flag, 1 bit |
| 89 | + | |
| 74 | 90 | This bit is 1 if the source has a pending interrupt, otherwise 0. |
| 75 | 91 | |
| 76 | 92 | Only one XICS instance may be created per VM. |
| @@ -1,8 +1,11 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=========================================================== | |
| 1 | 4 | POWER9 eXternal Interrupt Virtualization Engine (XIVE Gen1) |
| 2 | −========================================================== | |
| 5 | +=========================================================== | |
| 3 | 6 | |
| 4 | 7 | Device types supported: |
| 5 | − KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1 | |
| 8 | + - KVM_DEV_TYPE_XIVE POWER9 XIVE Interrupt Controller generation 1 | |
| 6 | 9 | |
| 7 | 10 | This device acts as a VM interrupt controller. It provides the KVM |
| 8 | 11 | interface to configure the interrupt sources of a VM in the underlying |
| @@ -64,72 +67,100 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 55 unmodified lines | ||
| 64 | 67 | |
| 65 | 68 | * Groups: |
| 66 | 69 | |
| 67 | − 1. KVM_DEV_XIVE_GRP_CTRL | |
| 68 | − Provides global controls on the device | |
| 70 | +1. KVM_DEV_XIVE_GRP_CTRL | |
| 71 | + Provides global controls on the device | |
| 72 | + | |
| 69 | 73 | Attributes: |
| 70 | 74 | 1.1 KVM_DEV_XIVE_RESET (write only) |
| 71 | 75 | Resets the interrupt controller configuration for sources and event |
| 72 | 76 | queues. To be used by kexec and kdump. |
| 77 | + | |
| 73 | 78 | Errors: none |
| 74 | 79 | |
| 75 | 80 | 1.2 KVM_DEV_XIVE_EQ_SYNC (write only) |
| 76 | 81 | Sync all the sources and queues and mark the EQ pages dirty. This |
| 77 | 82 | to make sure that a consistent memory state is captured when |
| 78 | 83 | migrating the VM. |
| 84 | + | |
| 79 | 85 | Errors: none |
| 80 | 86 | |
| 81 | 87 | 1.3 KVM_DEV_XIVE_NR_SERVERS (write only) |
| 82 | 88 | The kvm_device_attr.addr points to a __u32 value which is the number of |
| 83 | 89 | interrupt server numbers (ie, highest possible vcpu id plus one). |
| 90 | + | |
| 84 | 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) | |
| 90 | − Initializes a new source in the XIVE device and mask it. | |
| 93 | + ======= ========================================== | |
| 94 | + -EINVAL Value greater than KVM_MAX_VCPU_ID. | |
| 95 | + -EFAULT Invalid user pointer for attr->addr. | |
| 96 | + -EBUSY A vCPU is already connected to the device. | |
| 97 | + ======= ========================================== | |
| 98 | + | |
| 99 | +2. KVM_DEV_XIVE_GRP_SOURCE (write only) | |
| 100 | + Initializes a new source in the XIVE device and mask it. | |
| 101 | + | |
| 91 | 102 | Attributes: |
| 92 | 103 | Interrupt source number (64-bit) |
| 93 | − The kvm_device_attr.addr points to a __u64 value: | |
| 94 | − bits: | 63 .... 2 | 1 | 0 | |
| 95 | − values: | unused | level | type | |
| 104 | + | |
| 105 | + The kvm_device_attr.addr points to a __u64 value:: | |
| 106 | + | |
| 107 | + bits: | 63 .... 2 | 1 | 0 | |
| 108 | + values: | unused | level | type | |
| 109 | + | |
| 96 | 110 | - type: 0:MSI 1:LSI |
| 97 | 111 | - level: assertion level in case of an LSI. |
| 112 | + | |
| 98 | 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) | |
| 105 | − Configures source targeting | |
| 115 | + ======= ========================================== | |
| 116 | + -E2BIG Interrupt source number is out of range | |
| 117 | + -ENOMEM Could not create a new source block | |
| 118 | + -EFAULT Invalid user pointer for attr->addr. | |
| 119 | + -ENXIO Could not allocate underlying HW interrupt | |
| 120 | + ======= ========================================== | |
| 121 | + | |
| 122 | +3. KVM_DEV_XIVE_GRP_SOURCE_CONFIG (write only) | |
| 123 | + Configures source targeting | |
| 124 | + | |
| 106 | 125 | Attributes: |
| 107 | 126 | Interrupt source number (64-bit) |
| 108 | − The kvm_device_attr.addr points to a __u64 value: | |
| 109 | − bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0 | |
| 110 | − values: | eisn | mask | server | priority | |
| 127 | + | |
| 128 | + The kvm_device_attr.addr points to a __u64 value:: | |
| 129 | + | |
| 130 | + bits: | 63 .... 33 | 32 | 31 .. 3 | 2 .. 0 | |
| 131 | + values: | eisn | mask | server | priority | |
| 132 | + | |
| 111 | 133 | - priority: 0-7 interrupt priority level |
| 112 | 134 | - server: CPU number chosen to handle the interrupt |
| 113 | 135 | - mask: mask flag (unused) |
| 114 | 136 | - eisn: Effective Interrupt Source Number |
| 137 | + | |
| 115 | 138 | Errors: |
| 116 | − -ENOENT: Unknown source number | |
| 117 | − -EINVAL: Not initialized source number | |
| 118 | − -EINVAL: Invalid priority | |
| 119 | − -EINVAL: Invalid CPU number. | |
| 120 | − -EFAULT: Invalid user pointer for attr->addr. | |
| 121 | − -ENXIO: CPU event queues not configured or configuration of the | |
| 122 | − underlying HW interrupt failed | |
| 123 | − -EBUSY: No CPU available to serve interrupt | |
| 124 | − | |
| 125 | − 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write) | |
| 126 | − Configures an event queue of a CPU | |
| 139 | + | |
| 140 | + ======= ======================================================= | |
| 141 | + -ENOENT Unknown source number | |
| 142 | + -EINVAL Not initialized source number | |
| 143 | + -EINVAL Invalid priority | |
| 144 | + -EINVAL Invalid CPU number. | |
| 145 | + -EFAULT Invalid user pointer for attr->addr. | |
| 146 | + -ENXIO CPU event queues not configured or configuration of the | |
| 147 | + underlying HW interrupt failed | |
| 148 | + -EBUSY No CPU available to serve interrupt | |
| 149 | + ======= ======================================================= | |
| 150 | + | |
| 151 | +4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write) | |
| 152 | + Configures an event queue of a CPU | |
| 153 | + | |
| 127 | 154 | Attributes: |
| 128 | 155 | EQ descriptor identifier (64-bit) |
| 129 | − The EQ descriptor identifier is a tuple (server, priority) : | |
| 130 | − bits: | 63 .... 32 | 31 .. 3 | 2 .. 0 | |
| 131 | − values: | unused | server | priority | |
| 132 | − The kvm_device_attr.addr points to : | |
| 156 | + | |
| 157 | + The EQ descriptor identifier is a tuple (server, priority):: | |
| 158 | + | |
| 159 | + bits: | 63 .... 32 | 31 .. 3 | 2 .. 0 | |
| 160 | + values: | unused | server | priority | |
| 161 | + | |
| 162 | + The kvm_device_attr.addr points to:: | |
| 163 | + | |
| 133 | 164 | struct kvm_ppc_xive_eq { |
| 134 | 165 | __u32 flags; |
| 135 | 166 | __u32 qshift; |
| @@ -138,8 +169,9 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 2 unmodified lines | ||
| 138 | 169 | __u32 qindex; |
| 139 | 170 | __u8 pad[40]; |
| 140 | 171 | }; |
| 172 | + | |
| 141 | 173 | - flags: queue flags |
| 142 | − KVM_XIVE_EQ_ALWAYS_NOTIFY (required) | |
| 174 | + KVM_XIVE_EQ_ALWAYS_NOTIFY (required) | |
| 143 | 175 | forces notification without using the coalescing mechanism |
| 144 | 176 | provided by the XIVE END ESBs. |
| 145 | 177 | - qshift: queue size (power of 2) |
| @@ -147,22 +179,31 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 1 unmodified line | ||
| 147 | 179 | - qtoggle: current queue toggle bit |
| 148 | 180 | - qindex: current queue index |
| 149 | 181 | - pad: reserved for future use |
| 182 | + | |
| 150 | 183 | Errors: |
| 151 | − -ENOENT: Invalid CPU number | |
| 152 | − -EINVAL: Invalid priority | |
| 153 | − -EINVAL: Invalid flags | |
| 154 | − -EINVAL: Invalid queue size | |
| 155 | − -EINVAL: Invalid queue address | |
| 156 | − -EFAULT: Invalid user pointer for attr->addr. | |
| 157 | − -EIO: Configuration of the underlying HW failed | |
| 158 | − | |
| 159 | − 5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only) | |
| 160 | − Synchronize the source to flush event notifications | |
| 184 | + | |
| 185 | + ======= ========================================= | |
| 186 | + -ENOENT Invalid CPU number | |
| 187 | + -EINVAL Invalid priority | |
| 188 | + -EINVAL Invalid flags | |
| 189 | + -EINVAL Invalid queue size | |
| 190 | + -EINVAL Invalid queue address | |
| 191 | + -EFAULT Invalid user pointer for attr->addr. | |
| 192 | + -EIO Configuration of the underlying HW failed | |
| 193 | + ======= ========================================= | |
| 194 | + | |
| 195 | +5. KVM_DEV_XIVE_GRP_SOURCE_SYNC (write only) | |
| 196 | + Synchronize the source to flush event notifications | |
| 197 | + | |
| 161 | 198 | Attributes: |
| 162 | 199 | Interrupt source number (64-bit) |
| 200 | + | |
| 163 | 201 | Errors: |
| 164 | − -ENOENT: Unknown source number | |
| 165 | − -EINVAL: Not initialized source number | |
| 202 | + | |
| 203 | + ======= ============================= | |
| 204 | + -ENOENT Unknown source number | |
| 205 | + -EINVAL Not initialized source number | |
| 206 | + ======= ============================= | |
| 166 | 207 | |
| 167 | 208 | * VCPU state |
| 168 | 209 | |
| @@ -175,11 +216,12 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 6 unmodified lines | ||
| 175 | 216 | as it synthesizes the priorities of the pending interrupts. We |
| 176 | 217 | capture a bit more to report debug information. |
| 177 | 218 | |
| 178 | − KVM_REG_PPC_VP_STATE (2 * 64bits) | |
| 179 | − bits: | 63 .... 32 | 31 .... 0 | | |
| 180 | − values: | TIMA word0 | TIMA word1 | | |
| 181 | − bits: | 127 .......... 64 | | |
| 182 | − values: | unused | | |
| 219 | + KVM_REG_PPC_VP_STATE (2 * 64bits):: | |
| 220 | + | |
| 221 | + bits: | 63 .... 32 | 31 .... 0 | | |
| 222 | + values: | TIMA word0 | TIMA word1 | | |
| 223 | + bits: | 127 .......... 64 | | |
| 224 | + values: | unused | | |
| 183 | 225 | |
| 184 | 226 | * Migration: |
| 185 | 227 | |
| @@ -196,7 +238,7 @@ the legacy interrupt mode, referred as XICS (POWER7/8). · 10 unmodified lines | ||
| 196 | 238 | 3. Capture the state of the source targeting, the EQs configuration |
| 197 | 239 | and the state of thread interrupt context registers. |
| 198 | 240 | |
| 199 | − Restore is similar : | |
| 241 | + Restore is similar: | |
| 200 | 242 | |
| 201 | 243 | 1. Restore the EQ configuration. As targeting depends on it. |
| 202 | 244 | 2. Restore targeting |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=========================== | |
| 1 | 4 | The 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 | ||
| 68 | 71 | which come at an approximately constant rate, otherwise there will be constant |
| 69 | 72 | adjustment of the polling interval. |
| 70 | 73 | |
| 71 | −[0] total block time: the time between when the halt polling function is | |
| 74 | +[0] total block time: | |
| 75 | + the time between when the halt polling function is | |
| 72 | 76 | invoked and a wakeup source received (irrespective of |
| 73 | 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 | ||
| 81 | 85 | parameters in virt/kvm/kvm_main.c, or arch/powerpc/kvm/book3s_hv.c in the |
| 82 | 86 | powerpc kvm-hv case. |
| 83 | 87 | |
| 84 | −Module Parameter | Description | Default Value | |
| 85 | −-------------------------------------------------------------------------------- | |
| 86 | −halt_poll_ns | The global max polling | KVM_HALT_POLL_NS_DEFAULT | |
| 87 | − | interval which defines | | |
| 88 | − | the ceiling value of the | | |
| 89 | − | polling interval for | (per arch value) | |
| 90 | − | each vcpu. | | |
| 91 | −-------------------------------------------------------------------------------- | |
| 92 | −halt_poll_ns_grow | The value by which the | 2 | |
| 93 | − | halt polling interval is | | |
| 94 | − | multiplied in the | | |
| 95 | − | grow_halt_poll_ns() | | |
| 96 | − | function. | | |
| 97 | −-------------------------------------------------------------------------------- | |
| 98 | −halt_poll_ns_grow_start | The initial value to grow | 10000 | |
| 99 | − | to from zero in the | | |
| 100 | − | grow_halt_poll_ns() | | |
| 101 | − | function. | | |
| 102 | −-------------------------------------------------------------------------------- | |
| 103 | −halt_poll_ns_shrink | The value by which the | 0 | |
| 104 | − | halt polling interval is | | |
| 105 | − | divided in the | | |
| 106 | − | shrink_halt_poll_ns() | | |
| 107 | − | function. | | |
| 108 | −-------------------------------------------------------------------------------- | |
| 88 | ++-----------------------+---------------------------+-------------------------+ | |
| 89 | +|Module Parameter | Description | Default Value | | |
| 90 | ++-----------------------+---------------------------+-------------------------+ | |
| 91 | +|halt_poll_ns | The global max polling | KVM_HALT_POLL_NS_DEFAULT| | |
| 92 | +| | interval which defines | | | |
| 93 | +| | the ceiling value of the | | | |
| 94 | +| | polling interval for | (per arch value) | | |
| 95 | +| | each vcpu. | | | |
| 96 | ++-----------------------+---------------------------+-------------------------+ | |
| 97 | +|halt_poll_ns_grow | The value by which the | 2 | | |
| 98 | +| | halt polling interval is | | | |
| 99 | +| | multiplied in the | | | |
| 100 | +| | grow_halt_poll_ns() | | | |
| 101 | +| | function. | | | |
| 102 | ++-----------------------+---------------------------+-------------------------+ | |
| 103 | +|halt_poll_ns_grow_start| The initial value to grow | 10000 | | |
| 104 | +| | to from zero in the | | | |
| 105 | +| | grow_halt_poll_ns() | | | |
| 106 | +| | function. | | | |
| 107 | ++-----------------------+---------------------------+-------------------------+ | |
| 108 | +|halt_poll_ns_shrink | The value by which the | 0 | | |
| 109 | +| | halt polling interval is | | | |
| 110 | +| | divided in the | | | |
| 111 | +| | shrink_halt_poll_ns() | | | |
| 112 | +| | function. | | | |
| 113 | ++-----------------------+---------------------------+-------------------------+ | |
| 109 | 114 | |
| 110 | 115 | These 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 | ||
| 117 | 122 | Further Notes |
| 118 | 123 | ============= |
| 119 | 124 | |
| 120 | −- Care should be taken when setting the halt_poll_ns module parameter as a | |
| 121 | −large value has the potential to drive the cpu usage to 100% on a machine which | |
| 122 | −would be almost entirely idle otherwise. This is because even if a guest has | |
| 123 | −wakeups during which very little work is done and which are quite far apart, if | |
| 124 | −the period is shorter than the global max polling interval (halt_poll_ns) then | |
| 125 | −the host will always poll for the entire block time and thus cpu utilisation | |
| 126 | −will go to 100%. | |
| 127 | − | |
| 128 | −- Halt polling essentially presents a trade off between power usage and latency | |
| 129 | −and the module parameters should be used to tune the affinity for this. Idle | |
| 130 | −cpu time is essentially converted to host kernel time with the aim of decreasing | |
| 131 | −latency when entering the guest. | |
| 132 | − | |
| 133 | −- Halt polling will only be conducted by the host when no other tasks are | |
| 134 | −runnable on that cpu, otherwise the polling will cease immediately and | |
| 135 | −schedule will be invoked to allow that other task to run. Thus this doesn't | |
| 136 | −allow a guest to denial of service the cpu. | |
| 125 | +- Care should be taken when setting the halt_poll_ns module parameter as a large value | |
| 126 | + has the potential to drive the cpu usage to 100% on a machine which would be almost | |
| 127 | + entirely idle otherwise. This is because even if a guest has wakeups during which very | |
| 128 | + little work is done and which are quite far apart, if the period is shorter than the | |
| 129 | + global max polling interval (halt_poll_ns) then the host will always poll for the | |
| 130 | + entire block time and thus cpu utilisation will go to 100%. | |
| 131 | + | |
| 132 | +- Halt polling essentially presents a trade off between power usage and latency and | |
| 133 | + the module parameters should be used to tune the affinity for this. Idle cpu time is | |
| 134 | + essentially converted to host kernel time with the aim of decreasing latency when | |
| 135 | + entering the guest. | |
| 136 | + | |
| 137 | +- Halt polling will only be conducted by the host when no other tasks are runnable on | |
| 138 | + that cpu, otherwise the polling will cease immediately and schedule will be invoked to | |
| 139 | + allow that other task to run. Thus this doesn't allow a guest to denial of service the | |
| 140 | + cpu. | |
| @@ -1,5 +1,9 @@ | ||
| 1 | −Linux KVM Hypercall: | |
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +=================== | |
| 4 | +Linux KVM Hypercall | |
| 2 | 5 | =================== |
| 6 | + | |
| 3 | 7 | X86: |
| 4 | 8 | KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall |
| 5 | 9 | instruction. The hypervisor can replace it with instructions that are |
| @@ -20,7 +24,7 @@ S390: · 14 unmodified lines | ||
| 20 | 24 | For further information on the S390 diagnose call as supported by KVM, |
| 21 | 25 | refer to Documentation/virt/kvm/s390-diag.txt. |
| 22 | 26 | |
| 23 | − PowerPC: | |
| 27 | +PowerPC: | |
| 24 | 28 | It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. |
| 25 | 29 | Return value is placed in R3. |
| 26 | 30 | |
| @@ -34,7 +38,8 @@ MIPS: · 7 unmodified lines | ||
| 34 | 38 | the return value is placed in $2 (v0). |
| 35 | 39 | |
| 36 | 40 | KVM Hypercalls Documentation |
| 37 | −=========================== | |
| 41 | +============================ | |
| 42 | + | |
| 38 | 43 | The template for each hypercall is: |
| 39 | 44 | 1. Hypercall name. |
| 40 | 45 | 2. Architecture(s) |
| @@ -43,56 +48,64 @@ The template for each hypercall is: · 2 unmodified lines | ||
| 43 | 48 | |
| 44 | 49 | 1. KVM_HC_VAPIC_POLL_IRQ |
| 45 | 50 | ------------------------ |
| 46 | −Architecture: x86 | |
| 47 | −Status: active | |
| 48 | −Purpose: Trigger guest exit so that the host can check for pending | |
| 49 | −interrupts on reentry. | |
| 51 | + | |
| 52 | +:Architecture: x86 | |
| 53 | +:Status: active | |
| 54 | +:Purpose: Trigger guest exit so that the host can check for pending | |
| 55 | + interrupts on reentry. | |
| 50 | 56 | |
| 51 | 57 | 2. KVM_HC_MMU_OP |
| 52 | −------------------------ | |
| 53 | −Architecture: x86 | |
| 54 | −Status: deprecated. | |
| 55 | −Purpose: Support MMU operations such as writing to PTE, | |
| 56 | −flushing TLB, release PT. | |
| 58 | +---------------- | |
| 59 | + | |
| 60 | +:Architecture: x86 | |
| 61 | +:Status: deprecated. | |
| 62 | +:Purpose: Support MMU operations such as writing to PTE, | |
| 63 | + flushing TLB, release PT. | |
| 57 | 64 | |
| 58 | 65 | 3. KVM_HC_FEATURES |
| 59 | −------------------------ | |
| 60 | −Architecture: PPC | |
| 61 | −Status: active | |
| 62 | −Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid | |
| 63 | −used to enumerate which hypercalls are available. On PPC, either device tree | |
| 64 | −based lookup ( which is also what EPAPR dictates) OR KVM specific enumeration | |
| 65 | −mechanism (which is this hypercall) can be used. | |
| 66 | +------------------ | |
| 67 | + | |
| 68 | +:Architecture: PPC | |
| 69 | +:Status: active | |
| 70 | +:Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid | |
| 71 | + used to enumerate which hypercalls are available. On PPC, either | |
| 72 | + device tree based lookup ( which is also what EPAPR dictates) | |
| 73 | + OR KVM specific enumeration mechanism (which is this hypercall) | |
| 74 | + can be used. | |
| 66 | 75 | |
| 67 | 76 | 4. KVM_HC_PPC_MAP_MAGIC_PAGE |
| 68 | −------------------------ | |
| 69 | −Architecture: PPC | |
| 70 | −Status: active | |
| 71 | −Purpose: To enable communication between the hypervisor and guest there is a | |
| 72 | −shared page that contains parts of supervisor visible register state. | |
| 73 | −The guest can map this shared page to access its supervisor register through | |
| 74 | −memory using this hypercall. | |
| 77 | +---------------------------- | |
| 78 | + | |
| 79 | +:Architecture: PPC | |
| 80 | +:Status: active | |
| 81 | +:Purpose: To enable communication between the hypervisor and guest there is a | |
| 82 | + shared page that contains parts of supervisor visible register state. | |
| 83 | + The guest can map this shared page to access its supervisor register | |
| 84 | + through memory using this hypercall. | |
| 75 | 85 | |
| 76 | 86 | 5. KVM_HC_KICK_CPU |
| 77 | −------------------------ | |
| 78 | −Architecture: x86 | |
| 79 | −Status: active | |
| 80 | −Purpose: Hypercall used to wakeup a vcpu from HLT state | |
| 81 | −Usage example : A vcpu of a paravirtualized guest that is busywaiting in guest | |
| 82 | −kernel mode for an event to occur (ex: a spinlock to become available) can | |
| 83 | −execute HLT instruction once it has busy-waited for more than a threshold | |
| 84 | −time-interval. Execution of HLT instruction would cause the hypervisor to put | |
| 85 | −the vcpu to sleep until occurrence of an appropriate event. Another vcpu of the | |
| 86 | −same guest can wakeup the sleeping vcpu by issuing KVM_HC_KICK_CPU hypercall, | |
| 87 | −specifying APIC ID (a1) of the vcpu to be woken up. An additional argument (a0) | |
| 88 | −is used in the hypercall for future use. | |
| 87 | +------------------ | |
| 88 | + | |
| 89 | +:Architecture: x86 | |
| 90 | +:Status: active | |
| 91 | +:Purpose: Hypercall used to wakeup a vcpu from HLT state | |
| 92 | +:Usage example: | |
| 93 | + A vcpu of a paravirtualized guest that is busywaiting in guest | |
| 94 | + kernel mode for an event to occur (ex: a spinlock to become available) can | |
| 95 | + execute HLT instruction once it has busy-waited for more than a threshold | |
| 96 | + time-interval. Execution of HLT instruction would cause the hypervisor to put | |
| 97 | + the vcpu to sleep until occurrence of an appropriate event. Another vcpu of the | |
| 98 | + same guest can wakeup the sleeping vcpu by issuing KVM_HC_KICK_CPU hypercall, | |
| 99 | + specifying APIC ID (a1) of the vcpu to be woken up. An additional argument (a0) | |
| 100 | + is used in the hypercall for future use. | |
| 89 | 101 | |
| 90 | 102 | |
| 91 | 103 | 6. KVM_HC_CLOCK_PAIRING |
| 92 | −------------------------ | |
| 93 | −Architecture: x86 | |
| 94 | −Status: active | |
| 95 | −Purpose: Hypercall used to synchronize host and guest clocks. | |
| 104 | +----------------------- | |
| 105 | +:Architecture: x86 | |
| 106 | +:Status: active | |
| 107 | +:Purpose: Hypercall used to synchronize host and guest clocks. | |
| 108 | + | |
| 96 | 109 | Usage: |
| 97 | 110 | |
| 98 | 111 | a0: guest physical address where host copies |
| @@ -101,6 +114,8 @@ a0: guest physical address where host copies · 2 unmodified lines | ||
| 101 | 114 | a1: clock_type, ATM only KVM_CLOCK_PAIRING_WALLCLOCK (0) |
| 102 | 115 | is supported (corresponding to the host's CLOCK_REALTIME clock). |
| 103 | 116 | |
| 117 | + :: | |
| 118 | + | |
| 104 | 119 | struct kvm_clock_pairing { |
| 105 | 120 | __s64 sec; |
| 106 | 121 | __s64 nsec; |
| @@ -123,15 +138,16 @@ Returns KVM_EOPNOTSUPP if the host does not use TSC clocksource, · 16 unmodified lines | ||
| 123 | 138 | or if clock type is different than KVM_CLOCK_PAIRING_WALLCLOCK. |
| 124 | 139 | |
| 125 | 140 | 6. KVM_HC_SEND_IPI |
| 126 | −------------------------ | |
| 127 | −Architecture: x86 | |
| 128 | −Status: active | |
| 129 | −Purpose: Send IPIs to multiple vCPUs. | |
| 141 | +------------------ | |
| 142 | + | |
| 143 | +:Architecture: x86 | |
| 144 | +:Status: active | |
| 145 | +:Purpose: Send IPIs to multiple vCPUs. | |
| 130 | 146 | |
| 131 | −a0: lower part of the bitmap of destination APIC IDs | |
| 132 | −a1: higher part of the bitmap of destination APIC IDs | |
| 133 | −a2: the lowest APIC ID in bitmap | |
| 134 | −a3: APIC ICR | |
| 147 | +- a0: lower part of the bitmap of destination APIC IDs | |
| 148 | +- a1: higher part of the bitmap of destination APIC IDs | |
| 149 | +- a2: the lowest APIC ID in bitmap | |
| 150 | +- a3: APIC ICR | |
| 135 | 151 | |
| 136 | 152 | The hypercall lets a guest send multicast IPIs, with at most 128 |
| 137 | 153 | 128 destinations per hypercall in 64-bit mode and 64 vCPUs per |
| @@ -143,12 +159,13 @@ corresponds to the APIC ID a2+1, and so on. · 5 unmodified lines | ||
| 143 | 159 | Returns the number of CPUs to which the IPIs were delivered successfully. |
| 144 | 160 | |
| 145 | 161 | 7. KVM_HC_SCHED_YIELD |
| 146 | −------------------------ | |
| 147 | −Architecture: x86 | |
| 148 | −Status: active | |
| 149 | −Purpose: Hypercall used to yield if the IPI target vCPU is preempted | |
| 162 | +--------------------- | |
| 163 | + | |
| 164 | +:Architecture: x86 | |
| 165 | +:Status: active | |
| 166 | +:Purpose: Hypercall used to yield if the IPI target vCPU is preempted | |
| 150 | 167 | |
| 151 | 168 | a0: destination APIC ID |
| 152 | 169 | |
| 153 | −Usage example: When sending a call-function IPI-many to vCPUs, yield if | |
| 154 | −any of the IPI target vCPUs was preempted. | |
| 170 | +:Usage example: When sending a call-function IPI-many to vCPUs, yield if | |
| 171 | + any of the IPI target vCPUs was preempted. | |
| @@ -7,6 +7,22 @@ KVM · 6 unmodified lines | ||
| 7 | 7 | .. toctree:: |
| 8 | 8 | :maxdepth: 2 |
| 9 | 9 | |
| 10 | + api | |
| 10 | 11 | amd-memory-encryption |
| 11 | 12 | cpuid |
| 13 | + halt-polling | |
| 14 | + hypercalls | |
| 15 | + locking | |
| 16 | + mmu | |
| 17 | + msr | |
| 18 | + nested-vmx | |
| 19 | + ppc-pv | |
| 20 | + s390-diag | |
| 21 | + timekeeping | |
| 12 | 22 | vcpu-requests |
| 23 | + | |
| 24 | + review-checklist | |
| 25 | + | |
| 26 | + arm/index | |
| 27 | + | |
| 28 | + devices/index | |
| @@ -0,0 +1,243 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +================= | |
| 4 | +KVM Lock Overview | |
| 5 | +================= | |
| 6 | + | |
| 7 | +1. Acquisition Orders | |
| 8 | +--------------------- | |
| 9 | + | |
| 10 | +The acquisition orders for mutexes are as follows: | |
| 11 | + | |
| 12 | +- kvm->lock is taken outside vcpu->mutex | |
| 13 | + | |
| 14 | +- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock | |
| 15 | + | |
| 16 | +- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring | |
| 17 | + them together is quite rare. | |
| 18 | + | |
| 19 | +On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock. | |
| 20 | + | |
| 21 | +Everything else is a leaf: no other lock is taken inside the critical | |
| 22 | +sections. | |
| 23 | + | |
| 24 | +2. Exception | |
| 25 | +------------ | |
| 26 | + | |
| 27 | +Fast page fault: | |
| 28 | + | |
| 29 | +Fast page fault is the fast path which fixes the guest page fault out of | |
| 30 | +the mmu-lock on x86. Currently, the page fault can be fast in one of the | |
| 31 | +following two cases: | |
| 32 | + | |
| 33 | +1. Access Tracking: The SPTE is not present, but it is marked for access | |
| 34 | + tracking i.e. the SPTE_SPECIAL_MASK is set. That means we need to | |
| 35 | + restore the saved R/X bits. This is described in more detail later below. | |
| 36 | + | |
| 37 | +2. Write-Protection: The SPTE is present and the fault is | |
| 38 | + caused by write-protect. That means we just need to change the W bit of | |
| 39 | + the spte. | |
| 40 | + | |
| 41 | +What we use to avoid all the race is the SPTE_HOST_WRITEABLE bit and | |
| 42 | +SPTE_MMU_WRITEABLE bit on the spte: | |
| 43 | + | |
| 44 | +- SPTE_HOST_WRITEABLE means the gfn is writable on host. | |
| 45 | +- SPTE_MMU_WRITEABLE means the gfn is writable on mmu. The bit is set when | |
| 46 | + the gfn is writable on guest mmu and it is not write-protected by shadow | |
| 47 | + page write-protection. | |
| 48 | + | |
| 49 | +On fast page fault path, we will use cmpxchg to atomically set the spte W | |
| 50 | +bit if spte.SPTE_HOST_WRITEABLE = 1 and spte.SPTE_WRITE_PROTECT = 1, or | |
| 51 | +restore the saved R/X bits if VMX_EPT_TRACK_ACCESS mask is set, or both. This | |
| 52 | +is safe because whenever changing these bits can be detected by cmpxchg. | |
| 53 | + | |
| 54 | +But we need carefully check these cases: | |
| 55 | + | |
| 56 | +1) The mapping from gfn to pfn | |
| 57 | + | |
| 58 | +The mapping from gfn to pfn may be changed since we can only ensure the pfn | |
| 59 | +is not changed during cmpxchg. This is a ABA problem, for example, below case | |
| 60 | +will happen: | |
| 61 | + | |
| 62 | ++------------------------------------------------------------------------+ | |
| 63 | +| At the beginning:: | | |
| 64 | +| | | |
| 65 | +| gpte = gfn1 | | |
| 66 | +| gfn1 is mapped to pfn1 on host | | |
| 67 | +| spte is the shadow page table entry corresponding with gpte and | | |
| 68 | +| spte = pfn1 | | |
| 69 | ++------------------------------------------------------------------------+ | |
| 70 | +| On fast page fault path: | | |
| 71 | ++------------------------------------+-----------------------------------+ | |
| 72 | +| CPU 0: | CPU 1: | | |
| 73 | ++------------------------------------+-----------------------------------+ | |
| 74 | +| :: | | | |
| 75 | +| | | | |
| 76 | +| old_spte = *spte; | | | |
| 77 | ++------------------------------------+-----------------------------------+ | |
| 78 | +| | pfn1 is swapped out:: | | |
| 79 | +| | | | |
| 80 | +| | spte = 0; | | |
| 81 | +| | | | |
| 82 | +| | pfn1 is re-alloced for gfn2. | | |
| 83 | +| | | | |
| 84 | +| | gpte is changed to point to | | |
| 85 | +| | gfn2 by the guest:: | | |
| 86 | +| | | | |
| 87 | +| | spte = pfn1; | | |
| 88 | ++------------------------------------+-----------------------------------+ | |
| 89 | +| :: | | |
| 90 | +| | | |
| 91 | +| if (cmpxchg(spte, old_spte, old_spte+W) | | |
| 92 | +| mark_page_dirty(vcpu->kvm, gfn1) | | |
| 93 | +| OOPS!!! | | |
| 94 | ++------------------------------------------------------------------------+ | |
| 95 | + | |
| 96 | +We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap. | |
| 97 | + | |
| 98 | +For direct sp, we can easily avoid it since the spte of direct sp is fixed | |
| 99 | +to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic() | |
| 100 | +to pin gfn to pfn, because after gfn_to_pfn_atomic(): | |
| 101 | + | |
| 102 | +- We have held the refcount of pfn that means the pfn can not be freed and | |
| 103 | + be reused for another gfn. | |
| 104 | +- The pfn is writable that means it can not be shared between different gfns | |
| 105 | + by KSM. | |
| 106 | + | |
| 107 | +Then, we can ensure the dirty bitmaps is correctly set for a gfn. | |
| 108 | + | |
| 109 | +Currently, to simplify the whole things, we disable fast page fault for | |
| 110 | +indirect shadow page. | |
| 111 | + | |
| 112 | +2) Dirty bit tracking | |
| 113 | + | |
| 114 | +In the origin code, the spte can be fast updated (non-atomically) if the | |
| 115 | +spte is read-only and the Accessed bit has already been set since the | |
| 116 | +Accessed bit and Dirty bit can not be lost. | |
| 117 | + | |
| 118 | +But it is not true after fast page fault since the spte can be marked | |
| 119 | +writable between reading spte and updating spte. Like below case: | |
| 120 | + | |
| 121 | ++------------------------------------------------------------------------+ | |
| 122 | +| At the beginning:: | | |
| 123 | +| | | |
| 124 | +| spte.W = 0 | | |
| 125 | +| spte.Accessed = 1 | | |
| 126 | ++------------------------------------+-----------------------------------+ | |
| 127 | +| CPU 0: | CPU 1: | | |
| 128 | ++------------------------------------+-----------------------------------+ | |
| 129 | +| In mmu_spte_clear_track_bits():: | | | |
| 130 | +| | | | |
| 131 | +| old_spte = *spte; | | | |
| 132 | +| | | | |
| 133 | +| | | | |
| 134 | +| /* 'if' condition is satisfied. */| | | |
| 135 | +| if (old_spte.Accessed == 1 && | | | |
| 136 | +| old_spte.W == 0) | | | |
| 137 | +| spte = 0ull; | | | |
| 138 | ++------------------------------------+-----------------------------------+ | |
| 139 | +| | on fast page fault path:: | | |
| 140 | +| | | | |
| 141 | +| | spte.W = 1 | | |
| 142 | +| | | | |
| 143 | +| | memory write on the spte:: | | |
| 144 | +| | | | |
| 145 | +| | spte.Dirty = 1 | | |
| 146 | ++------------------------------------+-----------------------------------+ | |
| 147 | +| :: | | | |
| 148 | +| | | | |
| 149 | +| else | | | |
| 150 | +| old_spte = xchg(spte, 0ull) | | | |
| 151 | +| if (old_spte.Accessed == 1) | | | |
| 152 | +| kvm_set_pfn_accessed(spte.pfn);| | | |
| 153 | +| if (old_spte.Dirty == 1) | | | |
| 154 | +| kvm_set_pfn_dirty(spte.pfn); | | | |
| 155 | +| OOPS!!! | | | |
| 156 | ++------------------------------------+-----------------------------------+ | |
| 157 | + | |
| 158 | +The Dirty bit is lost in this case. | |
| 159 | + | |
| 160 | +In order to avoid this kind of issue, we always treat the spte as "volatile" | |
| 161 | +if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means, | |
| 162 | +the spte is always atomically updated in this case. | |
| 163 | + | |
| 164 | +3) flush tlbs due to spte updated | |
| 165 | + | |
| 166 | +If the spte is updated from writable to readonly, we should flush all TLBs, | |
| 167 | +otherwise rmap_write_protect will find a read-only spte, even though the | |
| 168 | +writable spte might be cached on a CPU's TLB. | |
| 169 | + | |
| 170 | +As mentioned before, the spte can be updated to writable out of mmu-lock on | |
| 171 | +fast page fault path, in order to easily audit the path, we see if TLBs need | |
| 172 | +be flushed caused by this reason in mmu_spte_update() since this is a common | |
| 173 | +function to update spte (present -> present). | |
| 174 | + | |
| 175 | +Since the spte is "volatile" if it can be updated out of mmu-lock, we always | |
| 176 | +atomically update the spte, the race caused by fast page fault can be avoided, | |
| 177 | +See the comments in spte_has_volatile_bits() and mmu_spte_update(). | |
| 178 | + | |
| 179 | +Lockless Access Tracking: | |
| 180 | + | |
| 181 | +This is used for Intel CPUs that are using EPT but do not support the EPT A/D | |
| 182 | +bits. In this case, when the KVM MMU notifier is called to track accesses to a | |
| 183 | +page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present | |
| 184 | +by clearing the RWX bits in the PTE and storing the original R & X bits in | |
| 185 | +some unused/ignored bits. In addition, the SPTE_SPECIAL_MASK is also set on the | |
| 186 | +PTE (using the ignored bit 62). When the VM tries to access the page later on, | |
| 187 | +a fault is generated and the fast page fault mechanism described above is used | |
| 188 | +to atomically restore the PTE to a Present state. The W bit is not saved when | |
| 189 | +the PTE is marked for access tracking and during restoration to the Present | |
| 190 | +state, the W bit is set depending on whether or not it was a write access. If | |
| 191 | +it wasn't, then the W bit will remain clear until a write access happens, at | |
| 192 | +which time it will be set using the Dirty tracking mechanism described above. | |
| 193 | + | |
| 194 | +3. Reference | |
| 195 | +------------ | |
| 196 | + | |
| 197 | +:Name: kvm_lock | |
| 198 | +:Type: mutex | |
| 199 | +:Arch: any | |
| 200 | +:Protects: - vm_list | |
| 201 | + | |
| 202 | +:Name: kvm_count_lock | |
| 203 | +:Type: raw_spinlock_t | |
| 204 | +:Arch: any | |
| 205 | +:Protects: - hardware virtualization enable/disable | |
| 206 | +:Comment: 'raw' because hardware enabling/disabling must be atomic /wrt | |
| 207 | + migration. | |
| 208 | + | |
| 209 | +:Name: kvm_arch::tsc_write_lock | |
| 210 | +:Type: raw_spinlock | |
| 211 | +:Arch: x86 | |
| 212 | +:Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset} | |
| 213 | + - tsc offset in vmcb | |
| 214 | +:Comment: 'raw' because updating the tsc offsets must not be preempted. | |
| 215 | + | |
| 216 | +:Name: kvm->mmu_lock | |
| 217 | +:Type: spinlock_t | |
| 218 | +:Arch: any | |
| 219 | +:Protects: -shadow page/shadow tlb entry | |
| 220 | +:Comment: it is a spinlock since it is used in mmu notifier. | |
| 221 | + | |
| 222 | +:Name: kvm->srcu | |
| 223 | +:Type: srcu lock | |
| 224 | +:Arch: any | |
| 225 | +:Protects: - kvm->memslots | |
| 226 | + - kvm->buses | |
| 227 | +:Comment: The srcu read lock must be held while accessing memslots (e.g. | |
| 228 | + when using gfn_to_* functions) and while accessing in-kernel | |
| 229 | + MMIO/PIO address->device structure mapping (kvm->buses). | |
| 230 | + The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu | |
| 231 | + if it is needed by multiple functions. | |
| 232 | + | |
| 233 | +:Name: blocked_vcpu_on_cpu_lock | |
| 234 | +:Type: spinlock_t | |
| 235 | +:Arch: x86 | |
| 236 | +:Protects: blocked_vcpu_on_cpu | |
| 237 | +:Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts. | |
| 238 | + When VT-d posted-interrupts is supported and the VM has assigned | |
| 239 | + devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu | |
| 240 | + protected by blocked_vcpu_on_cpu_lock, when VT-d hardware issues | |
| 241 | + wakeup notification event since external interrupts from the | |
| 242 | + assigned devices happens, we will find the vCPU on the list to | |
| 243 | + wakeup. | |
| @@ -1,215 +0,0 @@ | ||
| 1 | −KVM Lock Overview | |
| 2 | −================= | |
| 3 | − | |
| 4 | −1. Acquisition Orders | |
| 5 | −--------------------- | |
| 6 | − | |
| 7 | −The acquisition orders for mutexes are as follows: | |
| 8 | − | |
| 9 | −- kvm->lock is taken outside vcpu->mutex | |
| 10 | − | |
| 11 | −- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock | |
| 12 | − | |
| 13 | −- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring | |
| 14 | − them together is quite rare. | |
| 15 | − | |
| 16 | −On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock. | |
| 17 | − | |
| 18 | −Everything else is a leaf: no other lock is taken inside the critical | |
| 19 | −sections. | |
| 20 | − | |
| 21 | −2: Exception | |
| 22 | −------------ | |
| 23 | − | |
| 24 | −Fast page fault: | |
| 25 | − | |
| 26 | −Fast page fault is the fast path which fixes the guest page fault out of | |
| 27 | −the mmu-lock on x86. Currently, the page fault can be fast in one of the | |
| 28 | −following two cases: | |
| 29 | − | |
| 30 | −1. Access Tracking: The SPTE is not present, but it is marked for access | |
| 31 | −tracking i.e. the SPTE_SPECIAL_MASK is set. That means we need to | |
| 32 | −restore the saved R/X bits. This is described in more detail later below. | |
| 33 | − | |
| 34 | −2. Write-Protection: The SPTE is present and the fault is | |
| 35 | −caused by write-protect. That means we just need to change the W bit of the | |
| 36 | −spte. | |
| 37 | − | |
| 38 | −What we use to avoid all the race is the SPTE_HOST_WRITEABLE bit and | |
| 39 | −SPTE_MMU_WRITEABLE bit on the spte: | |
| 40 | −- SPTE_HOST_WRITEABLE means the gfn is writable on host. | |
| 41 | −- SPTE_MMU_WRITEABLE means the gfn is writable on mmu. The bit is set when | |
| 42 | − the gfn is writable on guest mmu and it is not write-protected by shadow | |
| 43 | − page write-protection. | |
| 44 | − | |
| 45 | −On fast page fault path, we will use cmpxchg to atomically set the spte W | |
| 46 | −bit if spte.SPTE_HOST_WRITEABLE = 1 and spte.SPTE_WRITE_PROTECT = 1, or | |
| 47 | −restore the saved R/X bits if VMX_EPT_TRACK_ACCESS mask is set, or both. This | |
| 48 | −is safe because whenever changing these bits can be detected by cmpxchg. | |
| 49 | − | |
| 50 | −But we need carefully check these cases: | |
| 51 | −1): The mapping from gfn to pfn | |
| 52 | −The mapping from gfn to pfn may be changed since we can only ensure the pfn | |
| 53 | −is not changed during cmpxchg. This is a ABA problem, for example, below case | |
| 54 | −will happen: | |
| 55 | − | |
| 56 | −At the beginning: | |
| 57 | −gpte = gfn1 | |
| 58 | −gfn1 is mapped to pfn1 on host | |
| 59 | −spte is the shadow page table entry corresponding with gpte and | |
| 60 | −spte = pfn1 | |
| 61 | − | |
| 62 | − VCPU 0 VCPU0 | |
| 63 | −on fast page fault path: | |
| 64 | − | |
| 65 | − old_spte = *spte; | |
| 66 | − pfn1 is swapped out: | |
| 67 | − spte = 0; | |
| 68 | − | |
| 69 | − pfn1 is re-alloced for gfn2. | |
| 70 | − | |
| 71 | − gpte is changed to point to | |
| 72 | − gfn2 by the guest: | |
| 73 | − spte = pfn1; | |
| 74 | − | |
| 75 | − if (cmpxchg(spte, old_spte, old_spte+W) | |
| 76 | − mark_page_dirty(vcpu->kvm, gfn1) | |
| 77 | − OOPS!!! | |
| 78 | − | |
| 79 | −We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap. | |
| 80 | − | |
| 81 | −For direct sp, we can easily avoid it since the spte of direct sp is fixed | |
| 82 | −to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic() | |
| 83 | −to pin gfn to pfn, because after gfn_to_pfn_atomic(): | |
| 84 | −- We have held the refcount of pfn that means the pfn can not be freed and | |
| 85 | − be reused for another gfn. | |
| 86 | −- The pfn is writable that means it can not be shared between different gfns | |
| 87 | − by KSM. | |
| 88 | − | |
| 89 | −Then, we can ensure the dirty bitmaps is correctly set for a gfn. | |
| 90 | − | |
| 91 | −Currently, to simplify the whole things, we disable fast page fault for | |
| 92 | −indirect shadow page. | |
| 93 | − | |
| 94 | −2): Dirty bit tracking | |
| 95 | −In the origin code, the spte can be fast updated (non-atomically) if the | |
| 96 | −spte is read-only and the Accessed bit has already been set since the | |
| 97 | −Accessed bit and Dirty bit can not be lost. | |
| 98 | − | |
| 99 | −But it is not true after fast page fault since the spte can be marked | |
| 100 | −writable between reading spte and updating spte. Like below case: | |
| 101 | − | |
| 102 | −At the beginning: | |
| 103 | −spte.W = 0 | |
| 104 | −spte.Accessed = 1 | |
| 105 | − | |
| 106 | − VCPU 0 VCPU0 | |
| 107 | −In mmu_spte_clear_track_bits(): | |
| 108 | − | |
| 109 | − old_spte = *spte; | |
| 110 | − | |
| 111 | − /* 'if' condition is satisfied. */ | |
| 112 | − if (old_spte.Accessed == 1 && | |
| 113 | − old_spte.W == 0) | |
| 114 | − spte = 0ull; | |
| 115 | − on fast page fault path: | |
| 116 | − spte.W = 1 | |
| 117 | − memory write on the spte: | |
| 118 | − spte.Dirty = 1 | |
| 119 | − | |
| 120 | − | |
| 121 | − else | |
| 122 | − old_spte = xchg(spte, 0ull) | |
| 123 | − | |
| 124 | − | |
| 125 | − if (old_spte.Accessed == 1) | |
| 126 | − kvm_set_pfn_accessed(spte.pfn); | |
| 127 | − if (old_spte.Dirty == 1) | |
| 128 | − kvm_set_pfn_dirty(spte.pfn); | |
| 129 | − OOPS!!! | |
| 130 | − | |
| 131 | −The Dirty bit is lost in this case. | |
| 132 | − | |
| 133 | −In order to avoid this kind of issue, we always treat the spte as "volatile" | |
| 134 | −if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means, | |
| 135 | −the spte is always atomically updated in this case. | |
| 136 | − | |
| 137 | −3): flush tlbs due to spte updated | |
| 138 | −If the spte is updated from writable to readonly, we should flush all TLBs, | |
| 139 | −otherwise rmap_write_protect will find a read-only spte, even though the | |
| 140 | −writable spte might be cached on a CPU's TLB. | |
| 141 | − | |
| 142 | −As mentioned before, the spte can be updated to writable out of mmu-lock on | |
| 143 | −fast page fault path, in order to easily audit the path, we see if TLBs need | |
| 144 | −be flushed caused by this reason in mmu_spte_update() since this is a common | |
| 145 | −function to update spte (present -> present). | |
| 146 | − | |
| 147 | −Since the spte is "volatile" if it can be updated out of mmu-lock, we always | |
| 148 | −atomically update the spte, the race caused by fast page fault can be avoided, | |
| 149 | −See the comments in spte_has_volatile_bits() and mmu_spte_update(). | |
| 150 | − | |
| 151 | −Lockless Access Tracking: | |
| 152 | − | |
| 153 | −This is used for Intel CPUs that are using EPT but do not support the EPT A/D | |
| 154 | −bits. In this case, when the KVM MMU notifier is called to track accesses to a | |
| 155 | −page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present | |
| 156 | −by clearing the RWX bits in the PTE and storing the original R & X bits in | |
| 157 | −some unused/ignored bits. In addition, the SPTE_SPECIAL_MASK is also set on the | |
| 158 | −PTE (using the ignored bit 62). When the VM tries to access the page later on, | |
| 159 | −a fault is generated and the fast page fault mechanism described above is used | |
| 160 | −to atomically restore the PTE to a Present state. The W bit is not saved when | |
| 161 | −the PTE is marked for access tracking and during restoration to the Present | |
| 162 | −state, the W bit is set depending on whether or not it was a write access. If | |
| 163 | −it wasn't, then the W bit will remain clear until a write access happens, at | |
| 164 | −which time it will be set using the Dirty tracking mechanism described above. | |
| 165 | − | |
| 166 | −3. Reference | |
| 167 | −------------ | |
| 168 | − | |
| 169 | −Name: kvm_lock | |
| 170 | −Type: mutex | |
| 171 | −Arch: any | |
| 172 | −Protects: - vm_list | |
| 173 | − | |
| 174 | −Name: kvm_count_lock | |
| 175 | −Type: raw_spinlock_t | |
| 176 | −Arch: any | |
| 177 | −Protects: - hardware virtualization enable/disable | |
| 178 | −Comment: 'raw' because hardware enabling/disabling must be atomic /wrt | |
| 179 | − migration. | |
| 180 | − | |
| 181 | −Name: kvm_arch::tsc_write_lock | |
| 182 | −Type: raw_spinlock | |
| 183 | −Arch: x86 | |
| 184 | −Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset} | |
| 185 | − - tsc offset in vmcb | |
| 186 | −Comment: 'raw' because updating the tsc offsets must not be preempted. | |
| 187 | − | |
| 188 | −Name: kvm->mmu_lock | |
| 189 | −Type: spinlock_t | |
| 190 | −Arch: any | |
| 191 | −Protects: -shadow page/shadow tlb entry | |
| 192 | −Comment: it is a spinlock since it is used in mmu notifier. | |
| 193 | − | |
| 194 | −Name: kvm->srcu | |
| 195 | −Type: srcu lock | |
| 196 | −Arch: any | |
| 197 | −Protects: - kvm->memslots | |
| 198 | − - kvm->buses | |
| 199 | −Comment: The srcu read lock must be held while accessing memslots (e.g. | |
| 200 | − when using gfn_to_* functions) and while accessing in-kernel | |
| 201 | − MMIO/PIO address->device structure mapping (kvm->buses). | |
| 202 | − The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu | |
| 203 | − if it is needed by multiple functions. | |
| 204 | − | |
| 205 | −Name: blocked_vcpu_on_cpu_lock | |
| 206 | −Type: spinlock_t | |
| 207 | −Arch: x86 | |
| 208 | −Protects: blocked_vcpu_on_cpu | |
| 209 | −Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts. | |
| 210 | − When VT-d posted-interrupts is supported and the VM has assigned | |
| 211 | − devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu | |
| 212 | − protected by blocked_vcpu_on_cpu_lock, when VT-d hardware issues | |
| 213 | − wakeup notification event since external interrupts from the | |
| 214 | − assigned devices happens, we will find the vCPU on the list to | |
| 215 | − wakeup. | |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +====================== | |
| 1 | 4 | The x86 kvm shadow mmu |
| 2 | 5 | ====================== |
| 3 | 6 | |
| @@ -7,27 +10,37 @@ physical addresses to host physical addresses. · 3 unmodified lines | ||
| 7 | 10 | |
| 8 | 11 | The mmu code attempts to satisfy the following requirements: |
| 9 | 12 | |
| 10 | −- correctness: the guest should not be able to determine that it is running | |
| 13 | +- correctness: | |
| 14 | + the guest should not be able to determine that it is running | |
| 11 | 15 | on an emulated mmu except for timing (we attempt to comply |
| 12 | 16 | with the specification, not emulate the characteristics of |
| 13 | 17 | a particular implementation such as tlb size) |
| 14 | −- security: the guest must not be able to touch host memory not assigned | |
| 18 | +- security: | |
| 19 | + the guest must not be able to touch host memory not assigned | |
| 15 | 20 | to it |
| 16 | −- performance: minimize the performance penalty imposed by the mmu | |
| 17 | −- scaling: need to scale to large memory and large vcpu guests | |
| 18 | −- hardware: support the full range of x86 virtualization hardware | |
| 19 | −- integration: Linux memory management code must be in control of guest memory | |
| 21 | +- performance: | |
| 22 | + minimize the performance penalty imposed by the mmu | |
| 23 | +- scaling: | |
| 24 | + need to scale to large memory and large vcpu guests | |
| 25 | +- hardware: | |
| 26 | + support the full range of x86 virtualization hardware | |
| 27 | +- integration: | |
| 28 | + Linux memory management code must be in control of guest memory | |
| 20 | 29 | so that swapping, page migration, page merging, transparent |
| 21 | 30 | hugepages, and similar features work without change |
| 22 | −- dirty tracking: report writes to guest memory to enable live migration | |
| 31 | +- dirty tracking: | |
| 32 | + report writes to guest memory to enable live migration | |
| 23 | 33 | and framebuffer-based displays |
| 24 | −- footprint: keep the amount of pinned kernel memory low (most memory | |
| 34 | +- footprint: | |
| 35 | + keep the amount of pinned kernel memory low (most memory | |
| 25 | 36 | should be shrinkable) |
| 26 | −- reliability: avoid multipage or GFP_ATOMIC allocations | |
| 37 | +- reliability: | |
| 38 | + avoid multipage or GFP_ATOMIC allocations | |
| 27 | 39 | |
| 28 | 40 | Acronyms |
| 29 | 41 | ======== |
| 30 | 42 | |
| 43 | +==== ==================================================================== | |
| 31 | 44 | pfn host page frame number |
| 32 | 45 | hpa host physical address |
| 33 | 46 | hva host virtual address |
| @@ -41,6 +54,7 @@ pte page table entry (used also to refer generically to paging structure · 7 unmodified lines | ||
| 41 | 54 | gpte guest pte (referring to gfns) |
| 42 | 55 | spte shadow pte (referring to pfns) |
| 43 | 56 | tdp two dimensional paging (vendor neutral term for NPT and EPT) |
| 57 | +==== ==================================================================== | |
| 44 | 58 | |
| 45 | 59 | Virtual and real hardware supported |
| 46 | 60 | =================================== |
| @@ -90,11 +104,13 @@ Events · 43 unmodified lines | ||
| 90 | 104 | The mmu is driven by events, some from the guest, some from the host. |
| 91 | 105 | |
| 92 | 106 | Guest generated events: |
| 107 | + | |
| 93 | 108 | - writes to control registers (especially cr3) |
| 94 | 109 | - invlpg/invlpga instruction execution |
| 95 | 110 | - access to missing or protected translations |
| 96 | 111 | |
| 97 | 112 | Host generated events: |
| 113 | + | |
| 98 | 114 | - changes in the gpa->hpa translation (either through gpa->hva changes or |
| 99 | 115 | through hva->hpa changes) |
| 100 | 116 | - memory pressure (the shrinker) |
| @@ -117,16 +133,19 @@ Leaf ptes point at guest pages. · 16 unmodified lines | ||
| 117 | 133 | The following table shows translations encoded by leaf ptes, with higher-level |
| 118 | 134 | translations in parentheses: |
| 119 | 135 | |
| 120 | − Non-nested guests: | |
| 136 | + Non-nested guests:: | |
| 137 | + | |
| 121 | 138 | nonpaging: gpa->hpa |
| 122 | 139 | paging: gva->gpa->hpa |
| 123 | 140 | paging, tdp: (gva->)gpa->hpa |
| 124 | − Nested guests: | |
| 141 | + | |
| 142 | + Nested guests:: | |
| 143 | + | |
| 125 | 144 | non-tdp: ngva->gpa->hpa (*) |
| 126 | 145 | tdp: (ngva->)ngpa->gpa->hpa |
| 127 | 146 | |
| 128 | −(*) the guest hypervisor will encode the ngva->gpa translation into its page | |
| 129 | − tables if npt is not present | |
| 147 | + (*) the guest hypervisor will encode the ngva->gpa translation into its page | |
| 148 | + tables if npt is not present | |
| 130 | 149 | |
| 131 | 150 | Shadow pages contain the following information: |
| 132 | 151 | role.level: |
| @@ -291,28 +310,41 @@ Handling a page fault is performed as follows: · 158 unmodified lines | ||
| 291 | 310 | |
| 292 | 311 | - if the RSV bit of the error code is set, the page fault is caused by guest |
| 293 | 312 | accessing MMIO and cached MMIO information is available. |
| 313 | + | |
| 294 | 314 | - walk shadow page table |
| 295 | 315 | - check for valid generation number in the spte (see "Fast invalidation of |
| 296 | 316 | MMIO sptes" below) |
| 297 | 317 | - cache the information to vcpu->arch.mmio_gva, vcpu->arch.mmio_access and |
| 298 | 318 | vcpu->arch.mmio_gfn, and call the emulator |
| 319 | + | |
| 299 | 320 | - If both P bit and R/W bit of error code are set, this could possibly |
| 300 | 321 | be handled as a "fast page fault" (fixed without taking the MMU lock). See |
| 301 | 322 | the description in Documentation/virt/kvm/locking.txt. |
| 323 | + | |
| 302 | 324 | - if needed, walk the guest page tables to determine the guest translation |
| 303 | 325 | (gva->gpa or ngpa->gpa) |
| 326 | + | |
| 304 | 327 | - if permissions are insufficient, reflect the fault back to the guest |
| 328 | + | |
| 305 | 329 | - determine the host page |
| 330 | + | |
| 306 | 331 | - if this is an mmio request, there is no host page; cache the info to |
| 307 | 332 | vcpu->arch.mmio_gva, vcpu->arch.mmio_access and vcpu->arch.mmio_gfn |
| 333 | + | |
| 308 | 334 | - walk the shadow page table to find the spte for the translation, |
| 309 | 335 | instantiating missing intermediate page tables as necessary |
| 336 | + | |
| 310 | 337 | - If this is an mmio request, cache the mmio info to the spte and set some |
| 311 | 338 | reserved bit on the spte (see callers of kvm_mmu_set_mmio_spte_mask) |
| 339 | + | |
| 312 | 340 | - try to unsynchronize the page |
| 341 | + | |
| 313 | 342 | - if successful, we can let the guest continue and modify the gpte |
| 343 | + | |
| 314 | 344 | - emulate the instruction |
| 345 | + | |
| 315 | 346 | - if failed, unshadow the page and let the guest continue |
| 347 | + | |
| 316 | 348 | - update any translations that were modified by the instruction |
| 317 | 349 | |
| 318 | 350 | invlpg handling: |
| @@ -324,10 +356,12 @@ invlpg handling: · 5 unmodified lines | ||
| 324 | 356 | Guest control register updates: |
| 325 | 357 | |
| 326 | 358 | - mov to cr3 |
| 359 | + | |
| 327 | 360 | - look up new shadow roots |
| 328 | 361 | - synchronize newly reachable shadow pages |
| 329 | 362 | |
| 330 | 363 | - mov to cr0/cr4/efer |
| 364 | + | |
| 331 | 365 | - set up mmu context for new paging mode |
| 332 | 366 | - look up new shadow roots |
| 333 | 367 | - synchronize newly reachable shadow pages |
| @@ -358,6 +392,7 @@ on fault type: · 24 unmodified lines | ||
| 358 | 392 | (user write faults generate a #PF) |
| 359 | 393 | |
| 360 | 394 | In the first case there are two additional complications: |
| 395 | + | |
| 361 | 396 | - if CR4.SMEP is enabled: since we've turned the page into a kernel page, |
| 362 | 397 | the kernel may now execute it. We handle this by also setting spte.nx. |
| 363 | 398 | 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 | 482 | - NPT presentation from KVM Forum 2008 |
| 448 | 483 | http://www.linux-kvm.org/images/c/c8/KvmForum2008%24kdf2008_21.pdf |
| 449 | − | |
| @@ -1,6 +1,10 @@ | ||
| 1 | −KVM-specific MSRs. | |
| 2 | −Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010 | |
| 3 | −===================================================== | |
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +================= | |
| 4 | +KVM-specific MSRs | |
| 5 | +================= | |
| 6 | + | |
| 7 | +:Author: Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010 | |
| 4 | 8 | |
| 5 | 9 | KVM 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 | ||
| 9 | 13 | but they are deprecated and their use is discouraged. |
| 10 | 14 | |
| 11 | 15 | Custom MSR list |
| 12 | −-------- | |
| 16 | +--------------- | |
| 13 | 17 | |
| 14 | 18 | The current supported Custom MSR list is: |
| 15 | 19 | |
| 16 | −MSR_KVM_WALL_CLOCK_NEW: 0x4b564d00 | |
| 20 | +MSR_KVM_WALL_CLOCK_NEW: | |
| 21 | + 0x4b564d00 | |
| 17 | 22 | |
| 18 | − data: 4-byte alignment physical address of a memory area which must be | |
| 23 | +data: | |
| 24 | + 4-byte alignment physical address of a memory area which must be | |
| 19 | 25 | 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 | 29 | u32 version; |
| 24 | 30 | u32 sec; |
| 25 | 31 | u32 nsec; |
| 26 | − } __attribute__((__packed__)); | |
| 32 | + } __attribute__((__packed__)); | |
| 27 | 33 | |
| 28 | 34 | whose data will be filled in by the hypervisor. The hypervisor is only |
| 29 | 35 | guaranteed to update this data at the moment of MSR write. |
| 30 | 36 | Users that want to reliably query this information more than once have |
| 31 | 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 grabbing | |
| 39 | + version: | |
| 40 | + guest has to check version before and after grabbing | |
| 34 | 41 | time information and check that they are both equal and even. |
| 35 | 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 | 50 | In order to get the current wallclock time, the system_time from |
| 42 | 51 | MSR_KVM_SYSTEM_TIME_NEW needs to be added. |
| @@ -47,13 +56,15 @@ MSR_KVM_WALL_CLOCK_NEW: 0x4b564d00 · 4 unmodified lines | ||
| 47 | 56 | Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid |
| 48 | 57 | leaf prior to usage. |
| 49 | 58 | |
| 50 | −MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 | |
| 59 | +MSR_KVM_SYSTEM_TIME_NEW: | |
| 60 | + 0x4b564d01 | |
| 51 | 61 | |
| 52 | − data: 4-byte aligned physical address of a memory area which must be in | |
| 62 | +data: | |
| 63 | + 4-byte aligned physical address of a memory area which must be in | |
| 53 | 64 | 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 | 68 | u32 version; |
| 58 | 69 | u32 pad0; |
| 59 | 70 | u64 tsc_timestamp; |
| @@ -62,7 +73,7 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 2 unmodified lines | ||
| 62 | 73 | s8 tsc_shift; |
| 63 | 74 | u8 flags; |
| 64 | 75 | u8 pad[2]; |
| 65 | − } __attribute__((__packed__)); /* 32 bytes */ | |
| 76 | + } __attribute__((__packed__)); /* 32 bytes */ | |
| 66 | 77 | |
| 67 | 78 | whose data will be filled in by the hypervisor periodically. Only one |
| 68 | 79 | 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 | 84 | Fields have the following meanings: |
| 74 | 85 | |
| 75 | − version: guest has to check version before and after grabbing | |
| 86 | + version: | |
| 87 | + guest has to check version before and after grabbing | |
| 76 | 88 | time information and check that they are both equal and even. |
| 77 | 89 | An odd version indicates an in-progress update. |
| 78 | 90 | |
| 79 | − tsc_timestamp: the tsc value at the current VCPU at the time | |
| 91 | + tsc_timestamp: | |
| 92 | + the tsc value at the current VCPU at the time | |
| 80 | 93 | of the update of this structure. Guests can subtract this value |
| 81 | 94 | from current tsc to derive a notion of elapsed time since the |
| 82 | 95 | structure update. |
| 83 | 96 | |
| 84 | − system_time: a host notion of monotonic time, including sleep | |
| 97 | + system_time: | |
| 98 | + a host notion of monotonic time, including sleep | |
| 85 | 99 | time at the time this structure was last updated. Unit is |
| 86 | 100 | nanoseconds. |
| 87 | 101 | |
| 88 | − tsc_to_system_mul: multiplier to be used when converting | |
| 102 | + tsc_to_system_mul: | |
| 103 | + multiplier to be used when converting | |
| 89 | 104 | tsc-related quantity to nanoseconds |
| 90 | 105 | |
| 91 | − tsc_shift: shift to be used when converting tsc-related | |
| 106 | + tsc_shift: | |
| 107 | + shift to be used when converting tsc-related | |
| 92 | 108 | quantity to nanoseconds. This shift will ensure that |
| 93 | 109 | multiplication with tsc_to_system_mul does not overflow. |
| 94 | 110 | 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 | 113 | The conversion from tsc to nanoseconds involves an additional |
| 98 | 114 | 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 | 117 | time = (current_tsc - tsc_timestamp) |
| 102 | 118 | if (tsc_shift >= 0) |
| @@ -106,29 +122,34 @@ MSR_KVM_SYSTEM_TIME_NEW: 0x4b564d01 · 3 unmodified lines | ||
| 106 | 122 | time = (time * tsc_to_system_mul) >> 32 |
| 107 | 123 | time = time + system_time |
| 108 | 124 | |
| 109 | − flags: bits in this field indicate extended capabilities | |
| 125 | + flags: | |
| 126 | + bits in this field indicate extended capabilities | |
| 110 | 127 | coordinated between the guest and the hypervisor. Availability |
| 111 | 128 | of specific flags has to be checked in 0x40000001 cpuid leaf. |
| 112 | 129 | Current flags are: |
| 113 | 130 | |
| 114 | − flag bit | cpuid bit | meaning | |
| 115 | − ------------------------------------------------------------- | |
| 116 | − | | time measures taken across | |
| 117 | − 0 | 24 | multiple cpus are guaranteed to | |
| 118 | − | | be monotonic | |
| 119 | − ------------------------------------------------------------- | |
| 120 | − | | guest vcpu has been paused by | |
| 121 | − 1 | N/A | the host | |
| 122 | − | | See 4.70 in api.txt | |
| 123 | − ------------------------------------------------------------- | |
| 131 | + | |
| 132 | + +-----------+--------------+----------------------------------+ | |
| 133 | + | flag bit | cpuid bit | meaning | | |
| 134 | + +-----------+--------------+----------------------------------+ | |
| 135 | + | | | time measures taken across | | |
| 136 | + | 0 | 24 | multiple cpus are guaranteed to | | |
| 137 | + | | | be monotonic | | |
| 138 | + +-----------+--------------+----------------------------------+ | |
| 139 | + | | | guest vcpu has been paused by | | |
| 140 | + | 1 | N/A | the host | | |
| 141 | + | | | See 4.70 in api.txt | | |
| 142 | + +-----------+--------------+----------------------------------+ | |
| 124 | 143 | |
| 125 | 144 | Availability of this MSR must be checked via bit 3 in 0x4000001 cpuid |
| 126 | 145 | leaf prior to usage. |
| 127 | 146 | |
| 128 | 147 | |
| 129 | −MSR_KVM_WALL_CLOCK: 0x11 | |
| 148 | +MSR_KVM_WALL_CLOCK: | |
| 149 | + 0x11 | |
| 130 | 150 | |
| 131 | − data and functioning: same as MSR_KVM_WALL_CLOCK_NEW. Use that instead. | |
| 151 | +data and functioning: | |
| 152 | + same as MSR_KVM_WALL_CLOCK_NEW. Use that instead. | |
| 132 | 153 | |
| 133 | 154 | This MSR falls outside the reserved KVM range and may be removed in the |
| 134 | 155 | future. Its usage is deprecated. |
| @@ -136,9 +157,11 @@ MSR_KVM_WALL_CLOCK: 0x11 · 1 unmodified line | ||
| 136 | 157 | Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid |
| 137 | 158 | leaf prior to usage. |
| 138 | 159 | |
| 139 | −MSR_KVM_SYSTEM_TIME: 0x12 | |
| 160 | +MSR_KVM_SYSTEM_TIME: | |
| 161 | + 0x12 | |
| 140 | 162 | |
| 141 | − data and functioning: same as MSR_KVM_SYSTEM_TIME_NEW. Use that instead. | |
| 163 | +data and functioning: | |
| 164 | + same as MSR_KVM_SYSTEM_TIME_NEW. Use that instead. | |
| 142 | 165 | |
| 143 | 166 | This MSR falls outside the reserved KVM range and may be removed in the |
| 144 | 167 | future. Its usage is deprecated. |
| @@ -146,7 +169,7 @@ MSR_KVM_SYSTEM_TIME: 0x12 · 1 unmodified line | ||
| 146 | 169 | Availability of this MSR must be checked via bit 0 in 0x4000001 cpuid |
| 147 | 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 | 174 | if (!kvm_para_available()) /* refer to cpuid.txt */ |
| 152 | 175 | return NON_PRESENT; |
| @@ -163,8 +186,11 @@ MSR_KVM_SYSTEM_TIME: 0x12 · 10 unmodified lines | ||
| 163 | 186 | } else |
| 164 | 187 | return NON_PRESENT; |
| 165 | 188 | |
| 166 | −MSR_KVM_ASYNC_PF_EN: 0x4b564d02 | |
| 167 | − data: Bits 63-6 hold 64-byte aligned physical address of a | |
| 189 | +MSR_KVM_ASYNC_PF_EN: | |
| 190 | + 0x4b564d02 | |
| 191 | + | |
| 192 | +data: | |
| 193 | + Bits 63-6 hold 64-byte aligned physical address of a | |
| 168 | 194 | 64 byte memory area which must be in guest RAM and must be |
| 169 | 195 | zeroed. Bits 5-3 are reserved and should be zero. Bit 0 is 1 |
| 170 | 196 | 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 | 226 | Currently type 2 APF will be always delivered on the same vcpu as |
| 201 | 227 | type 1 was, but guest should not rely on that. |
| 202 | 228 | |
| 203 | −MSR_KVM_STEAL_TIME: 0x4b564d03 | |
| 229 | +MSR_KVM_STEAL_TIME: | |
| 230 | + 0x4b564d03 | |
| 204 | 231 | |
| 205 | − data: 64-byte alignment physical address of a memory area which must be | |
| 232 | +data: | |
| 233 | + 64-byte alignment physical address of a memory area which must be | |
| 206 | 234 | 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 | 238 | __u64 steal; |
| 211 | 239 | __u32 version; |
| 212 | 240 | __u32 flags; |
| 213 | 241 | __u8 preempted; |
| 214 | 242 | __u8 u8_pad[3]; |
| 215 | 243 | __u32 pad[11]; |
| 216 | − } | |
| 244 | + } | |
| 217 | 245 | |
| 218 | 246 | whose data will be filled in by the hypervisor periodically. Only one |
| 219 | 247 | 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 | 253 | Fields have the following meanings: |
| 226 | 254 | |
| 227 | − version: a sequence counter. In other words, guest has to check | |
| 255 | + version: | |
| 256 | + a sequence counter. In other words, guest has to check | |
| 228 | 257 | this field before and after grabbing time information and make |
| 229 | 258 | sure they are both equal and even. An odd version indicates an |
| 230 | 259 | in-progress update. |
| 231 | 260 | |
| 232 | − flags: At this point, always zero. May be used to indicate | |
| 261 | + flags: | |
| 262 | + At this point, always zero. May be used to indicate | |
| 233 | 263 | changes in this structure in the future. |
| 234 | 264 | |
| 235 | − steal: the amount of time in which this vCPU did not run, in | |
| 265 | + steal: | |
| 266 | + the amount of time in which this vCPU did not run, in | |
| 236 | 267 | nanoseconds. Time during which the vcpu is idle, will not be |
| 237 | 268 | reported as steal time. |
| 238 | 269 | |
| 239 | − preempted: indicate the vCPU who owns this struct is running or | |
| 270 | + preempted: | |
| 271 | + indicate the vCPU who owns this struct is running or | |
| 240 | 272 | not. Non-zero values mean the vCPU has been preempted. Zero |
| 241 | 273 | means the vCPU is not preempted. NOTE, it is always zero if the |
| 242 | 274 | the hypervisor doesn't support this field. |
| 243 | 275 | |
| 244 | −MSR_KVM_EOI_EN: 0x4b564d04 | |
| 245 | − data: Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0 | |
| 276 | +MSR_KVM_EOI_EN: | |
| 277 | + 0x4b564d04 | |
| 278 | + | |
| 279 | +data: | |
| 280 | + Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0 | |
| 246 | 281 | when disabled. Bit 1 is reserved and must be zero. When PV end of |
| 247 | 282 | interrupt is enabled (bit 0 set), bits 63-2 hold a 4-byte aligned |
| 248 | 283 | 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 | 309 | clear it using a single CPU instruction, such as test and clear, or |
| 275 | 310 | compare and exchange. |
| 276 | 311 | |
| 277 | −MSR_KVM_POLL_CONTROL: 0x4b564d05 | |
| 312 | +MSR_KVM_POLL_CONTROL: | |
| 313 | + 0x4b564d05 | |
| 314 | + | |
| 278 | 315 | Control host-side polling. |
| 279 | 316 | |
| 280 | − data: Bit 0 enables (1) or disables (0) host-side HLT polling logic. | |
| 317 | +data: | |
| 318 | + Bit 0 enables (1) or disables (0) host-side HLT polling logic. | |
| 281 | 319 | |
| 282 | 320 | KVM guests can request the host not to poll on HLT, for example if |
| 283 | 321 | they are performing polling themselves. |
| 284 | − | |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +========== | |
| 1 | 4 | Nested VMX |
| 2 | 5 | ========== |
| 3 | 6 | |
| @@ -41,9 +44,9 @@ No modifications are required to user space (qemu). However, qemu's default · 37 unmodified lines | ||
| 41 | 44 | emulated CPU type (qemu64) does not list the "VMX" CPU feature, so it must be |
| 42 | 45 | explicitly 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 | |
| 49 | 52 | ABIs |
| @@ -75,6 +78,8 @@ of this structure changes, this can break live migration across KVM versions. · 25 unmodified lines | ||
| 75 | 78 | VMCS12_REVISION (from vmx.c) should be changed if struct vmcs12 or its inner |
| 76 | 79 | struct shadow_vmcs is ever changed. |
| 77 | 80 | |
| 81 | +:: | |
| 82 | + | |
| 78 | 83 | typedef u64 natural_width; |
| 79 | 84 | struct __packed vmcs12 { |
| 80 | 85 | /* According to the Intel spec, a VMCS region must start with |
| @@ -220,21 +225,21 @@ Authors · 139 unmodified lines | ||
| 220 | 225 | ------- |
| 221 | 226 | |
| 222 | 227 | These patches were written by: |
| 223 | − Abel Gordon, abelg <at> il.ibm.com | |
| 224 | − Nadav Har'El, nyh <at> il.ibm.com | |
| 225 | − Orit Wasserman, oritw <at> il.ibm.com | |
| 226 | − Ben-Ami Yassor, benami <at> il.ibm.com | |
| 227 | − Muli Ben-Yehuda, muli <at> il.ibm.com | |
| 228 | + - Abel Gordon, abelg <at> il.ibm.com | |
| 229 | + - Nadav Har'El, nyh <at> il.ibm.com | |
| 230 | + - Orit Wasserman, oritw <at> il.ibm.com | |
| 231 | + - Ben-Ami Yassor, benami <at> il.ibm.com | |
| 232 | + - Muli Ben-Yehuda, muli <at> il.ibm.com | |
| 228 | 233 | |
| 229 | 234 | With contributions by: |
| 230 | − Anthony Liguori, aliguori <at> us.ibm.com | |
| 231 | − Mike Day, mdday <at> us.ibm.com | |
| 232 | − Michael Factor, factor <at> il.ibm.com | |
| 233 | − Zvi Dubitzky, dubi <at> il.ibm.com | |
| 235 | + - Anthony Liguori, aliguori <at> us.ibm.com | |
| 236 | + - Mike Day, mdday <at> us.ibm.com | |
| 237 | + - Michael Factor, factor <at> il.ibm.com | |
| 238 | + - Zvi Dubitzky, dubi <at> il.ibm.com | |
| 234 | 239 | |
| 235 | 240 | And valuable reviews by: |
| 236 | − Avi Kivity, avi <at> redhat.com | |
| 237 | − Gleb Natapov, gleb <at> redhat.com | |
| 238 | − Marcelo Tosatti, mtosatti <at> redhat.com | |
| 239 | − Kevin Tian, kevin.tian <at> intel.com | |
| 240 | − and others. | |
| 241 | + - Avi Kivity, avi <at> redhat.com | |
| 242 | + - Gleb Natapov, gleb <at> redhat.com | |
| 243 | + - Marcelo Tosatti, mtosatti <at> redhat.com | |
| 244 | + - Kevin Tian, kevin.tian <at> intel.com | |
| 245 | + - and others. | |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +================================= | |
| 1 | 4 | The 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 | |
| 35 | 38 | The parameters are as follows: |
| 36 | 39 | |
| 40 | + ======== ================ ================ | |
| 37 | 41 | Register IN OUT |
| 38 | − | |
| 42 | + ======== ================ ================ | |
| 39 | 43 | r0 - volatile |
| 40 | 44 | r3 1st parameter Return code |
| 41 | 45 | r4 2nd parameter 1st output value |
| @@ -47,6 +51,7 @@ The parameters are as follows: · 5 unmodified lines | ||
| 47 | 51 | r10 8th parameter 7th output value |
| 48 | 52 | r11 hypercall number 8th output value |
| 49 | 53 | r12 - volatile |
| 54 | + ======== ================ ================ | |
| 50 | 55 | |
| 51 | 56 | Hypercall definitions are shared in generic code, so the same hypercall numbers |
| 52 | 57 | apply for x86 and powerpc alike with the exception that each KVM hypercall |
| @@ -54,11 +59,13 @@ also needs to be ORed with the KVM vendor code which is (42 << 16). · 1 unmodified line | ||
| 54 | 59 | |
| 55 | 60 | Return codes can be as follows: |
| 56 | 61 | |
| 62 | + ==== ========================= | |
| 57 | 63 | Code Meaning |
| 58 | − | |
| 64 | + ==== ========================= | |
| 59 | 65 | 0 Success |
| 60 | 66 | 12 Hypercall not implemented |
| 61 | 67 | <0 Error |
| 68 | + ==== ========================= | |
| 62 | 69 | |
| 63 | 70 | The magic page |
| 64 | 71 | ============== |
| @@ -72,7 +79,7 @@ desired location. The first parameter indicates the effective address when the · 7 unmodified lines | ||
| 72 | 79 | MMU is enabled. The second parameter indicates the address in real mode, if |
| 73 | 80 | applicable to the target. For now, we always map the page to -4096. This way we |
| 74 | 81 | can access it using absolute load and store functions. The following |
| 75 | −instruction reads the first field of the magic page: | |
| 82 | +instruction reads the first field of the magic page:: | |
| 76 | 83 | |
| 77 | 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 | |
| 94 | 101 | The following enhancements to the magic page are currently available: |
| 95 | 102 | |
| 103 | + ============================ ======================================= | |
| 96 | 104 | KVM_MAGIC_FEAT_SR Maps SR registers r/w in the magic page |
| 97 | 105 | KVM_MAGIC_FEAT_MAS0_TO_SPRG7 Maps MASn, ESR, PIR and high SPRGs |
| 106 | + ============================ ======================================= | |
| 98 | 107 | |
| 99 | 108 | For enhanced features in the magic page, please check for the existence of the |
| 100 | 109 | feature before using them! |
| @@ -121,8 +130,8 @@ when entering the guest or don't have any impact on the hypervisor's behavior. · 20 unmodified lines | ||
| 121 | 130 | |
| 122 | 131 | The following bits are safe to be set inside the guest: |
| 123 | 132 | |
| 124 | − MSR_EE | |
| 125 | − MSR_RI | |
| 133 | + - MSR_EE | |
| 134 | + - MSR_RI | |
| 126 | 135 | |
| 127 | 136 | If 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 | ||
| 138 | 147 | also act on the shared page. So calling privileged instructions still works as |
| 139 | 148 | before. |
| 140 | 149 | |
| 150 | +======================= ================================ | |
| 141 | 151 | From To |
| 142 | −==== == | |
| 143 | − | |
| 152 | +======================= ================================ | |
| 144 | 153 | mfmsr rX ld rX, magic_page->msr |
| 145 | 154 | mfsprg rX, 0 ld rX, magic_page->sprg0 |
| 146 | 155 | mfsprg rX, 1 ld rX, magic_page->sprg1 |
| @@ -173,7 +182,7 @@ mtsrin rX, rY b <special mtsrin section> · 26 unmodified lines | ||
| 173 | 182 | |
| 174 | 183 | [BookE only] |
| 175 | 184 | wrteei [0|1] b <special wrteei section> |
| 176 | − | |
| 185 | +======================= ================================ | |
| 177 | 186 | |
| 178 | 187 | Some instructions require more logic to determine what's going on than a load |
| 179 | 188 | or store instruction can deliver. To enable patching of those, we keep some |
| @@ -191,6 +200,7 @@ for example. · 11 unmodified lines | ||
| 191 | 200 | |
| 192 | 201 | Hypercall ABIs in KVM on PowerPC |
| 193 | 202 | ================================= |
| 203 | + | |
| 194 | 204 | 1) KVM hypercalls (ePAPR) |
| 195 | 205 | |
| 196 | 206 | These are ePAPR compliant hypercall implementation (mentioned above). Even |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +================================ | |
| 1 | 4 | Review checklist for kvm patches |
| 2 | 5 | ================================ |
| 3 | 6 | |
| @@ -1,3 +1,6 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +============================= | |
| 1 | 4 | The 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 | ||
| 16 | 19 | all supported DIAGNOSE calls need to be handled by either KVM or its |
| 17 | 20 | userspace. |
| 18 | 21 | |
| 19 | −All DIAGNOSE calls supported by KVM use the RS-a format: | |
| 22 | +All DIAGNOSE calls supported by KVM use the RS-a format:: | |
| 20 | 23 | |
| 21 | −-------------------------------------- | |
| 22 | −| '83' | R1 | R3 | B2 | D2 | | |
| 23 | −-------------------------------------- | |
| 24 | −0 8 12 16 20 31 | |
| 24 | + -------------------------------------- | |
| 25 | + | '83' | R1 | R3 | B2 | D2 | | |
| 26 | + -------------------------------------- | |
| 27 | + 0 8 12 16 20 31 | |
| 25 | 28 | |
| 26 | 29 | The second-operand address (obtained by the base/displacement calculation) |
| 27 | 30 | is not used to address data. Instead, bits 48-63 of this address specify |
| @@ -1,17 +1,21 @@ | ||
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | |
| 2 | − Timekeeping Virtualization for X86-Based Architectures | |
| 3 | +====================================================== | |
| 4 | +Timekeeping Virtualization for X86-Based Architectures | |
| 5 | +====================================================== | |
| 3 | 6 | |
| 4 | − Zachary Amsden <zamsden@redhat.com> | |
| 5 | − Copyright (c) 2010, Red Hat. All rights reserved. | |
| 7 | +:Author: Zachary Amsden <zamsden@redhat.com> | |
| 8 | +:Copyright: (c) 2010, Red Hat. All rights reserved. | |
| 6 | 9 | |
| 7 | −1) Overview | |
| 8 | −2) Timing Devices | |
| 9 | −3) TSC Hardware | |
| 10 | −4) Virtualization Problems | |
| 10 | +.. Contents | |
| 11 | 11 | |
| 12 | −========================================================================= | |
| 12 | + 1) Overview | |
| 13 | + 2) Timing Devices | |
| 14 | + 3) TSC Hardware | |
| 15 | + 4) Virtualization Problems | |
| 13 | 16 | |
| 14 | −1) Overview | |
| 17 | +1. Overview | |
| 18 | +=========== | |
| 15 | 19 | |
| 16 | 20 | One of the most complicated parts of the X86 platform, and specifically, |
| 17 | 21 | the virtualization of this platform is the plethora of timing devices available |
| @@ -27,15 +31,15 @@ The purpose of this document is to collect data and information relevant to · 9 unmodified lines | ||
| 27 | 31 | timekeeping which may be difficult to find elsewhere, specifically, |
| 28 | 32 | information relevant to KVM and hardware-based virtualization. |
| 29 | 33 | |
| 30 | −========================================================================= | |
| 31 | − | |
| 32 | −2) Timing Devices | |
| 34 | +2. Timing Devices | |
| 35 | +================= | |
| 33 | 36 | |
| 34 | 37 | First we discuss the basic hardware devices available. TSC and the related |
| 35 | 38 | KVM clock are special enough to warrant a full exposition and are described in |
| 36 | 39 | the following section. |
| 37 | 40 | |
| 38 | −2.1) i8254 - PIT | |
| 41 | +2.1. i8254 - PIT | |
| 42 | +---------------- | |
| 39 | 43 | |
| 40 | 44 | One of the first timer devices available is the programmable interrupt timer, |
| 41 | 45 | or PIT. The PIT has a fixed frequency 1.193182 MHz base clock and three |
| @@ -50,13 +54,13 @@ The PIT uses I/O ports 0x40 - 0x43. Access to the 16-bit counters is done · 8 unmodified lines | ||
| 50 | 54 | using single or multiple byte access to the I/O ports. There are 6 modes |
| 51 | 55 | available, but not all modes are available to all timers, as only timer 2 |
| 52 | 56 | has a connected gate input, required for modes 1 and 5. The gate line is |
| 53 | −controlled by port 61h, bit 0, as illustrated in the following diagram. | |
| 57 | +controlled by port 61h, bit 0, as illustrated in the following diagram:: | |
| 54 | 58 | |
| 55 | − -------------- ---------------- | |
| 56 | −| | | | | |
| 57 | −| 1.1932 MHz |---------->| CLOCK OUT | ---------> IRQ 0 | |
| 58 | −| Clock | | | | | |
| 59 | − -------------- | +->| GATE TIMER 0 | | |
| 59 | + -------------- ---------------- | |
| 60 | + | | | | | |
| 61 | + | 1.1932 MHz|---------->| CLOCK OUT | ---------> IRQ 0 | |
| 62 | + | Clock | | | | | |
| 63 | + -------------- | +->| GATE TIMER 0 | | |
| 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 | 75 | |------>| CLOCK OUT | ---------> Port 61h, bit 5 |
| 72 | 76 | | | | |
| 73 | −Port 61h, bit 0 ---------->| GATE TIMER 2 | \_.---- ____ | |
| 77 | + Port 61h, bit 0 -------->| GATE TIMER 2 | \_.---- ____ | |
| 74 | 78 | ---------------- _| )--|LPF|---Speaker |
| 75 | 79 | / *---- \___/ |
| 76 | −Port 61h, bit 1 -----------------------------------/ | |
| 80 | + Port 61h, bit 1 ---------------------------------/ | |
| 77 | 81 | |
| 78 | 82 | The timer modes are now described. |
| 79 | 83 | |
| 80 | −Mode 0: Single Timeout. This is a one-shot software timeout that counts down | |
| 84 | +Mode 0: Single Timeout. | |
| 85 | + This is a one-shot software timeout that counts down | |
| 81 | 86 | when the gate is high (always true for timers 0 and 1). When the count |
| 82 | 87 | reaches zero, the output goes high. |
| 83 | 88 | |
| 84 | −Mode 1: Triggered One-shot. The output is initially set high. When the gate | |
| 89 | +Mode 1: Triggered One-shot. | |
| 90 | + The output is initially set high. When the gate | |
| 85 | 91 | line is set high, a countdown is initiated (which does not stop if the gate is |
| 86 | 92 | lowered), during which the output is set low. When the count reaches zero, |
| 87 | 93 | the output goes high. |
| 88 | 94 | |
| 89 | −Mode 2: Rate Generator. The output is initially set high. When the countdown | |
| 95 | +Mode 2: Rate Generator. | |
| 96 | + The output is initially set high. When the countdown | |
| 90 | 97 | reaches 1, the output goes low for one count and then returns high. The value |
| 91 | 98 | is reloaded and the countdown automatically resumes. If the gate line goes |
| 92 | 99 | low, the count is halted. If the output is low when the gate is lowered, the |
| 93 | 100 | output automatically goes high (this only affects timer 2). |
| 94 | 101 | |
| 95 | −Mode 3: Square Wave. This generates a high / low square wave. The count | |
| 102 | +Mode 3: Square Wave. | |
| 103 | + This generates a high / low square wave. The count | |
| 96 | 104 | determines the length of the pulse, which alternates between high and low |
| 97 | 105 | when zero is reached. The count only proceeds when gate is high and is |
| 98 | 106 | 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 | 111 | values are not observed when reading. This is the intended mode for timer 2, |
| 104 | 112 | which generates sine-like tones by low-pass filtering the square wave output. |
| 105 | 113 | |
| 106 | −Mode 4: Software Strobe. After programming this mode and loading the counter, | |
| 114 | +Mode 4: Software Strobe. | |
| 115 | + After programming this mode and loading the counter, | |
| 107 | 116 | the output remains high until the counter reaches zero. Then the output |
| 108 | 117 | goes low for 1 clock cycle and returns high. The counter is not reloaded. |
| 109 | 118 | Counting only occurs when gate is high. |
| 110 | 119 | |
| 111 | −Mode 5: Hardware Strobe. After programming and loading the counter, the | |
| 120 | +Mode 5: Hardware Strobe. | |
| 121 | + After programming and loading the counter, the | |
| 112 | 122 | output remains high. When the gate is raised, a countdown is initiated |
| 113 | 123 | (which does not stop if the gate is lowered). When the counter reaches zero, |
| 114 | 124 | 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 | ||
| 118 | 128 | command port, 0x43 is used to set the counter and mode for each of the three |
| 119 | 129 | timers. |
| 120 | 130 | |
| 121 | −PIT commands, issued to port 0x43, using the following bit encoding: | |
| 131 | +PIT commands, issued to port 0x43, using the following bit encoding:: | |
| 122 | 132 | |
| 123 | −Bit 7-4: Command (See table below) | |
| 124 | −Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined) | |
| 125 | −Bit 0 : Binary (0) / BCD (1) | |
| 133 | + Bit 7-4: Command (See table below) | |
| 134 | + Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined) | |
| 135 | + Bit 0 : Binary (0) / BCD (1) | |
| 126 | 136 | |
| 127 | −Command table: | |
| 137 | +Command table:: | |
| 128 | 138 | |
| 129 | −0000 - Latch Timer 0 count for port 0x40 | |
| 139 | + 0000 - Latch Timer 0 count for port 0x40 | |
| 130 | 140 | sample and hold the count to be read in port 0x40; |
| 131 | 141 | additional commands ignored until counter is read; |
| 132 | 142 | mode bits ignored. |
| 133 | 143 | |
| 134 | −0001 - Set Timer 0 LSB mode for port 0x40 | |
| 144 | + 0001 - Set Timer 0 LSB mode for port 0x40 | |
| 135 | 145 | set timer to read LSB only and force MSB to zero; |
| 136 | 146 | mode bits set timer mode |
| 137 | 147 | |
| 138 | −0010 - Set Timer 0 MSB mode for port 0x40 | |
| 148 | + 0010 - Set Timer 0 MSB mode for port 0x40 | |
| 139 | 149 | set timer to read MSB only and force LSB to zero; |
| 140 | 150 | mode bits set timer mode |
| 141 | 151 | |
| 142 | −0011 - Set Timer 0 16-bit mode for port 0x40 | |
| 152 | + 0011 - Set Timer 0 16-bit mode for port 0x40 | |
| 143 | 153 | set timer to read / write LSB first, then MSB; |
| 144 | 154 | mode bits set timer mode |
| 145 | 155 | |
| 146 | −0100 - Latch Timer 1 count for port 0x41 - as described above | |
| 147 | −0101 - Set Timer 1 LSB mode for port 0x41 - as described above | |
| 148 | −0110 - Set Timer 1 MSB mode for port 0x41 - as described above | |
| 149 | −0111 - Set Timer 1 16-bit mode for port 0x41 - as described above | |
| 156 | + 0100 - Latch Timer 1 count for port 0x41 - as described above | |
| 157 | + 0101 - Set Timer 1 LSB mode for port 0x41 - as described above | |
| 158 | + 0110 - Set Timer 1 MSB mode for port 0x41 - as described above | |
| 159 | + 0111 - Set Timer 1 16-bit mode for port 0x41 - as described above | |
| 150 | 160 | |
| 151 | −1000 - Latch Timer 2 count for port 0x42 - as described above | |
| 152 | −1001 - Set Timer 2 LSB mode for port 0x42 - as described above | |
| 153 | −1010 - Set Timer 2 MSB mode for port 0x42 - as described above | |
| 154 | −1011 - Set Timer 2 16-bit mode for port 0x42 as described above | |
| 161 | + 1000 - Latch Timer 2 count for port 0x42 - as described above | |
| 162 | + 1001 - Set Timer 2 LSB mode for port 0x42 - as described above | |
| 163 | + 1010 - Set Timer 2 MSB mode for port 0x42 - as described above | |
| 164 | + 1011 - Set Timer 2 16-bit mode for port 0x42 as described above | |
| 155 | 165 | |
| 156 | −1101 - General counter latch | |
| 166 | + 1101 - General counter latch | |
| 157 | 167 | Latch combination of counters into corresponding ports |
| 158 | 168 | Bit 3 = Counter 2 |
| 159 | 169 | Bit 2 = Counter 1 |
| 160 | 170 | Bit 1 = Counter 0 |
| 161 | 171 | Bit 0 = Unused |
| 162 | 172 | |
| 163 | −1110 - Latch timer status | |
| 173 | + 1110 - Latch timer status | |
| 164 | 174 | Latch combination of counter mode into corresponding ports |
| 165 | 175 | Bit 3 = Counter 2 |
| 166 | 176 | Bit 2 = Counter 1 |
| @@ -177,7 +187,8 @@ Command table: · 10 unmodified lines | ||
| 177 | 187 | Bit 3-1 = Mode |
| 178 | 188 | Bit 0 = Binary (0) / BCD mode (1) |
| 179 | 189 | |
| 180 | −2.2) RTC | |
| 190 | +2.2. RTC | |
| 191 | +-------- | |
| 181 | 192 | |
| 182 | 193 | The second device which was available in the original PC was the MC146818 real |
| 183 | 194 | time clock. The original device is now obsolete, and usually emulated by the |
| @@ -201,21 +212,21 @@ in progress, as indicated in the status register. · 17 unmodified lines | ||
| 201 | 212 | The clock uses a 32.768kHz crystal, so bits 6-4 of register A should be |
| 202 | 213 | programmed to a 32kHz divider if the RTC is to count seconds. |
| 203 | 214 | |
| 204 | −This is the RAM map originally used for the RTC/CMOS: | |
| 205 | − | |
| 206 | −Location Size Description | |
| 207 | −------------------------------------------ | |
| 208 | −00h byte Current second (BCD) | |
| 209 | −01h byte Seconds alarm (BCD) | |
| 210 | −02h byte Current minute (BCD) | |
| 211 | −03h byte Minutes alarm (BCD) | |
| 212 | −04h byte Current hour (BCD) | |
| 213 | −05h byte Hours alarm (BCD) | |
| 214 | −06h byte Current day of week (BCD) | |
| 215 | −07h byte Current day of month (BCD) | |
| 216 | −08h byte Current month (BCD) | |
| 217 | −09h byte Current year (BCD) | |
| 218 | −0Ah byte Register A | |
| 215 | +This is the RAM map originally used for the RTC/CMOS:: | |
| 216 | + | |
| 217 | + Location Size Description | |
| 218 | + ------------------------------------------ | |
| 219 | + 00h byte Current second (BCD) | |
| 220 | + 01h byte Seconds alarm (BCD) | |
| 221 | + 02h byte Current minute (BCD) | |
| 222 | + 03h byte Minutes alarm (BCD) | |
| 223 | + 04h byte Current hour (BCD) | |
| 224 | + 05h byte Hours alarm (BCD) | |
| 225 | + 06h byte Current day of week (BCD) | |
| 226 | + 07h byte Current day of month (BCD) | |
| 227 | + 08h byte Current month (BCD) | |
| 228 | + 09h byte Current year (BCD) | |
| 229 | + 0Ah byte Register A | |
| 219 | 230 | bit 7 = Update in progress |
| 220 | 231 | bit 6-4 = Divider for clock |
| 221 | 232 | 000 = 4.194 MHz |
| @@ -234,7 +245,7 @@ Location Size Description · 12 unmodified lines | ||
| 234 | 245 | 1101 = 125 mS |
| 235 | 246 | 1110 = 250 mS |
| 236 | 247 | 1111 = 500 mS |
| 237 | −0Bh byte Register B | |
| 248 | + 0Bh byte Register B | |
| 238 | 249 | bit 7 = Run (0) / Halt (1) |
| 239 | 250 | bit 6 = Periodic interrupt enable |
| 240 | 251 | bit 5 = Alarm interrupt enable |
| @@ -243,19 +254,20 @@ Location Size Description · 2 unmodified lines | ||
| 243 | 254 | bit 2 = BCD calendar (0) / Binary (1) |
| 244 | 255 | bit 1 = 12-hour mode (0) / 24-hour mode (1) |
| 245 | 256 | bit 0 = 0 (DST off) / 1 (DST enabled) |
| 246 | −OCh byte Register C (read only) | |
| 257 | + OCh byte Register C (read only) | |
| 247 | 258 | bit 7 = interrupt request flag (IRQF) |
| 248 | 259 | bit 6 = periodic interrupt flag (PF) |
| 249 | 260 | bit 5 = alarm interrupt flag (AF) |
| 250 | 261 | bit 4 = update interrupt flag (UF) |
| 251 | 262 | bit 3-0 = reserved |
| 252 | −ODh byte Register D (read only) | |
| 263 | + ODh byte Register D (read only) | |
| 253 | 264 | bit 7 = RTC has power |
| 254 | 265 | bit 6-0 = reserved |
| 255 | −32h byte Current century BCD (*) | |
| 266 | + 32h byte Current century BCD (*) | |
| 256 | 267 | (*) location vendor specific and now determined from ACPI global tables |
| 257 | 268 | |
| 258 | −2.3) APIC | |
| 269 | +2.3. APIC | |
| 270 | +--------- | |
| 259 | 271 | |
| 260 | 272 | On Pentium and later processors, an on-board timer is available to each CPU |
| 261 | 273 | as part of the Advanced Programmable Interrupt Controller. The APIC is |
| @@ -276,7 +288,8 @@ timer is programmed through the LVT (local vector timer) register, is capable · 14 unmodified lines | ||
| 276 | 288 | of one-shot or periodic operation, and is based on the bus clock divided down |
| 277 | 289 | by the programmable divider register. |
| 278 | 290 | |
| 279 | −2.4) HPET | |
| 291 | +2.4. HPET | |
| 292 | +--------- | |
| 280 | 293 | |
| 281 | 294 | HPET is quite complex, and was originally intended to replace the PIT / RTC |
| 282 | 295 | support of the X86 PC. It remains to be seen whether that will be the case, as |
| @@ -297,7 +310,8 @@ indicated through ACPI tables by the BIOS. · 14 unmodified lines | ||
| 297 | 310 | Detailed specification of the HPET is beyond the current scope of this |
| 298 | 311 | document, as it is also very well documented elsewhere. |
| 299 | 312 | |
| 300 | −2.5) Offboard Timers | |
| 313 | +2.5. Offboard Timers | |
| 314 | +-------------------- | |
| 301 | 315 | |
| 302 | 316 | Several cards, both proprietary (watchdog boards) and commonplace (e1000) have |
| 303 | 317 | timing chips built into the cards which may have registers which are accessible |
| @@ -307,9 +321,8 @@ general frowned upon as not playing by the agreed rules of the game. Such a · 3 unmodified lines | ||
| 307 | 321 | timer device would require additional support to be virtualized properly and is |
| 308 | 322 | not considered important at this time as no known operating system does this. |
| 309 | 323 | |
| 310 | −========================================================================= | |
| 311 | − | |
| 312 | −3) TSC Hardware | |
| 324 | +3. TSC Hardware | |
| 325 | +=============== | |
| 313 | 326 | |
| 314 | 327 | The TSC or time stamp counter is relatively simple in theory; it counts |
| 315 | 328 | instruction cycles issued by the processor, which can be used as a measure of |
| @@ -340,7 +353,8 @@ allows the guest visible TSC to be offset by a constant. Newer implementations · 24 unmodified lines | ||
| 340 | 353 | promise to allow the TSC to additionally be scaled, but this hardware is not |
| 341 | 354 | yet widely available. |
| 342 | 355 | |
| 343 | −3.1) TSC synchronization | |
| 356 | +3.1. TSC synchronization | |
| 357 | +------------------------ | |
| 344 | 358 | |
| 345 | 359 | The TSC is a CPU-local clock in most implementations. This means, on SMP |
| 346 | 360 | platforms, the TSCs of different CPUs may start at different times depending |
| @@ -357,7 +371,8 @@ practice, getting a perfectly synchronized TSC will not be possible unless all · 10 unmodified lines | ||
| 357 | 371 | values are read from the same clock, which generally only is possible on single |
| 358 | 372 | socket systems or those with special hardware support. |
| 359 | 373 | |
| 360 | −3.2) TSC and CPU hotplug | |
| 374 | +3.2. TSC and CPU hotplug | |
| 375 | +------------------------ | |
| 361 | 376 | |
| 362 | 377 | As touched on already, CPUs which arrive later than the boot time of the system |
| 363 | 378 | may not have a TSC value that is synchronized with the rest of the system. |
| @@ -367,7 +382,8 @@ a guarantee. This can have the effect of bringing a system from a state where · 3 unmodified lines | ||
| 367 | 382 | TSC is synchronized back to a state where TSC synchronization flaws, however |
| 368 | 383 | small, may be exposed to the OS and any virtualization environment. |
| 369 | 384 | |
| 370 | −3.3) TSC and multi-socket / NUMA | |
| 385 | +3.3. TSC and multi-socket / NUMA | |
| 386 | +-------------------------------- | |
| 371 | 387 | |
| 372 | 388 | Multi-socket systems, especially large multi-socket systems are likely to have |
| 373 | 389 | individual clocksources rather than a single, universally distributed clock. |
| @@ -385,7 +401,8 @@ standards for telecommunications and computer equipment. · 11 unmodified lines | ||
| 385 | 401 | It is recommended not to trust the TSCs to remain synchronized on NUMA or |
| 386 | 402 | multiple socket systems for these reasons. |
| 387 | 403 | |
| 388 | −3.4) TSC and C-states | |
| 404 | +3.4. TSC and C-states | |
| 405 | +--------------------- | |
| 389 | 406 | |
| 390 | 407 | C-states, or idling states of the processor, especially C1E and deeper sleep |
| 391 | 408 | states may be problematic for TSC as well. The TSC may stop advancing in such |
| @@ -396,7 +413,8 @@ based on CPU and chipset identifications. · 4 unmodified lines | ||
| 396 | 413 | The TSC in such a case may be corrected by catching it up to a known external |
| 397 | 414 | clocksource. |
| 398 | 415 | |
| 399 | −3.5) TSC frequency change / P-states | |
| 416 | +3.5. TSC frequency change / P-states | |
| 417 | +------------------------------------ | |
| 400 | 418 | |
| 401 | 419 | To make things slightly more interesting, some CPUs may change frequency. They |
| 402 | 420 | may or may not run the TSC at the same rate, and because the frequency change |
| @@ -416,14 +434,16 @@ other processors. In such cases, the TSC on halted CPUs could advance faster · 13 unmodified lines | ||
| 416 | 434 | than that of non-halted processors. AMD Turion processors are known to have |
| 417 | 435 | this problem. |
| 418 | 436 | |
| 419 | −3.6) TSC and STPCLK / T-states | |
| 437 | +3.6. TSC and STPCLK / T-states | |
| 438 | +------------------------------ | |
| 420 | 439 | |
| 421 | 440 | External signals given to the processor may also have the effect of stopping |
| 422 | 441 | the TSC. This is typically done for thermal emergency power control to prevent |
| 423 | 442 | an overheating condition, and typically, there is no way to detect that this |
| 424 | 443 | condition has happened. |
| 425 | 444 | |
| 426 | −3.7) TSC virtualization - VMX | |
| 445 | +3.7. TSC virtualization - VMX | |
| 446 | +----------------------------- | |
| 427 | 447 | |
| 428 | 448 | VMX provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP |
| 429 | 449 | instructions, which is enough for full virtualization of TSC in any manner. In |
| @@ -431,14 +451,16 @@ addition, VMX allows passing through the host TSC plus an additional TSC_OFFSET · 1 unmodified line | ||
| 431 | 451 | field specified in the VMCS. Special instructions must be used to read and |
| 432 | 452 | write the VMCS field. |
| 433 | 453 | |
| 434 | −3.8) TSC virtualization - SVM | |
| 454 | +3.8. TSC virtualization - SVM | |
| 455 | +----------------------------- | |
| 435 | 456 | |
| 436 | 457 | SVM provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP |
| 437 | 458 | instructions, which is enough for full virtualization of TSC in any manner. In |
| 438 | 459 | addition, SVM allows passing through the host TSC plus an additional offset |
| 439 | 460 | field specified in the SVM control block. |
| 440 | 461 | |
| 441 | −3.9) TSC feature bits in Linux | |
| 462 | +3.9. TSC feature bits in Linux | |
| 463 | +------------------------------ | |
| 442 | 464 | |
| 443 | 465 | In summary, there is no way to guarantee the TSC remains in perfect |
| 444 | 466 | synchronization unless it is explicitly guaranteed by the architecture. Even |
| @@ -448,13 +470,16 @@ despite being locally consistent. · 3 unmodified lines | ||
| 448 | 470 | The following feature bits are used by Linux to signal various TSC attributes, |
| 449 | 471 | but they can only be taken to be meaningful for UP or single node systems. |
| 450 | 472 | |
| 451 | −X86_FEATURE_TSC : The TSC is available in hardware | |
| 452 | −X86_FEATURE_RDTSCP : The RDTSCP instruction is available | |
| 453 | −X86_FEATURE_CONSTANT_TSC : The TSC rate is unchanged with P-states | |
| 454 | −X86_FEATURE_NONSTOP_TSC : The TSC does not stop in C-states | |
| 455 | −X86_FEATURE_TSC_RELIABLE : TSC sync checks are skipped (VMware) | |
| 473 | +========================= ======================================= | |
| 474 | +X86_FEATURE_TSC The TSC is available in hardware | |
| 475 | +X86_FEATURE_RDTSCP The RDTSCP instruction is available | |
| 476 | +X86_FEATURE_CONSTANT_TSC The TSC rate is unchanged with P-states | |
| 477 | +X86_FEATURE_NONSTOP_TSC The TSC does not stop in C-states | |
| 478 | +X86_FEATURE_TSC_RELIABLE TSC sync checks are skipped (VMware) | |
| 479 | +========================= ======================================= | |
| 456 | 480 | |
| 457 | −4) Virtualization Problems | |
| 481 | +4. Virtualization Problems | |
| 482 | +========================== | |
| 458 | 483 | |
| 459 | 484 | Timekeeping is especially problematic for virtualization because a number of |
| 460 | 485 | challenges arise. The most obvious problem is that time is now shared between |
| @@ -473,7 +498,8 @@ BIOS, but not in such an extreme fashion. However, the fact that SMM mode may · 12 unmodified lines | ||
| 473 | 498 | cause similar problems to virtualization makes it a good justification for |
| 474 | 499 | solving many of these problems on bare metal. |
| 475 | 500 | |
| 476 | −4.1) Interrupt clocking | |
| 501 | +4.1. Interrupt clocking | |
| 502 | +----------------------- | |
| 477 | 503 | |
| 478 | 504 | One of the most immediate problems that occurs with legacy operating systems |
| 479 | 505 | is that the system timekeeping routines are often designed to keep track of |
| @@ -502,7 +528,8 @@ thus requires interrupt slewing to keep proper time. It does use a low enough · 22 unmodified lines | ||
| 502 | 528 | rate (ed: is it 18.2 Hz?) however that it has not yet been a problem in |
| 503 | 529 | practice. |
| 504 | 530 | |
| 505 | −4.2) TSC sampling and serialization | |
| 531 | +4.2. TSC sampling and serialization | |
| 532 | +----------------------------------- | |
| 506 | 533 | |
| 507 | 534 | As the highest precision time source available, the cycle counter of the CPU |
| 508 | 535 | has aroused much interest from developers. As explained above, this timer has |
| @@ -524,7 +551,8 @@ it may be necessary for an implementation to guard against "backwards" reads of · 15 unmodified lines | ||
| 524 | 551 | the TSC as seen from other CPUs, even in an otherwise perfectly synchronized |
| 525 | 552 | system. |
| 526 | 553 | |
| 527 | −4.3) Timespec aliasing | |
| 554 | +4.3. Timespec aliasing | |
| 555 | +---------------------- | |
| 528 | 556 | |
| 529 | 557 | Additionally, this lack of serialization from the TSC poses another challenge |
| 530 | 558 | when using results of the TSC when measured against another time source. As |
| @@ -548,7 +576,8 @@ This aliasing requires care in the computation and recalibration of kvmclock · 17 unmodified lines | ||
| 548 | 576 | and any other values derived from TSC computation (such as TSC virtualization |
| 549 | 577 | itself). |
| 550 | 578 | |
| 551 | −4.4) Migration | |
| 579 | +4.4. Migration | |
| 580 | +-------------- | |
| 552 | 581 | |
| 553 | 582 | Migration of a virtual machine raises problems for timekeeping in two ways. |
| 554 | 583 | First, the migration itself may take time, during which interrupts cannot be |
| @@ -566,7 +595,8 @@ always be caught up to the original rate. KVM clock avoids these problems by · 11 unmodified lines | ||
| 566 | 595 | simply storing multipliers and offsets against the TSC for the guest to convert |
| 567 | 596 | back into nanosecond resolution values. |
| 568 | 597 | |
| 569 | −4.5) Scheduling | |
| 598 | +4.5. Scheduling | |
| 599 | +--------------- | |
| 570 | 600 | |
| 571 | 601 | Since scheduling may be based on precise timing and firing of interrupts, the |
| 572 | 602 | scheduling algorithms of an operating system may be adversely affected by |
| @@ -579,7 +609,8 @@ In an attempt to work around this, several implementations have provided a · 6 unmodified lines | ||
| 579 | 609 | paravirtualized scheduler clock, which reveals the true amount of CPU time for |
| 580 | 610 | which a virtual machine has been running. |
| 581 | 611 | |
| 582 | −4.6) Watchdogs | |
| 612 | +4.6. Watchdogs | |
| 613 | +-------------- | |
| 583 | 614 | |
| 584 | 615 | Watchdog timers, such as the lock detector in Linux may fire accidentally when |
| 585 | 616 | running under hardware virtualization due to timer interrupts being delayed or |
| @@ -587,7 +618,8 @@ misinterpretation of the passage of real time. Usually, these warnings are · 1 unmodified line | ||
| 587 | 618 | spurious and can be ignored, but in some circumstances it may be necessary to |
| 588 | 619 | disable such detection. |
| 589 | 620 | |
| 590 | −4.7) Delays and precision timing | |
| 621 | +4.7. Delays and precision timing | |
| 622 | +-------------------------------- | |
| 591 | 623 | |
| 592 | 624 | Precise timing and delays may not be possible in a virtualized system. This |
| 593 | 625 | can happen if the system is controlling physical hardware, or issues delays to |
| @@ -600,7 +632,8 @@ The second issue may cause performance problems, but this is unlikely to be a · 6 unmodified lines | ||
| 600 | 632 | significant issue. In many cases these delays may be eliminated through |
| 601 | 633 | configuration or paravirtualization. |
| 602 | 634 | |
| 603 | −4.8) Covert channels and leaks | |
| 635 | +4.8. Covert channels and leaks | |
| 636 | +------------------------------ | |
| 604 | 637 | |
| 605 | 638 | In addition to the above problems, time information will inevitably leak to the |
| 606 | 639 | guest about the host in anything but a perfect implementation of virtualized |
| @@ -1,12 +1,17 @@ | ||
| 1 | − User Mode Linux HOWTO | |
| 2 | − User Mode Linux Core Team | |
| 3 | − Mon Nov 18 14:16:16 EST 2002 | |
| 1 | +.. SPDX-License-Identifier: GPL-2.0 | |
| 4 | 2 | |
| 5 | − This document describes the use and abuse of Jeff Dike's User Mode | |
| 6 | − Linux: a port of the Linux kernel as a normal Intel Linux process. | |
| 7 | − ______________________________________________________________________ | |
| 3 | +===================== | |
| 4 | +User Mode Linux HOWTO | |
| 5 | +===================== | |
| 8 | 6 | |
| 9 | − Table of Contents | |
| 7 | +:Author: User Mode Linux Core Team | |
| 8 | +:Last-updated: Sat Jan 25 16:07:55 CET 2020 | |
| 9 | + | |
| 10 | +This document describes the use and abuse of Jeff Dike's User Mode | |
| 11 | +Linux: a port of the Linux kernel as a normal Intel Linux process. | |
| 12 | + | |
| 13 | + | |
| 14 | +.. Table of Contents | |
| 10 | 15 | |
| 11 | 16 | 1. Introduction |
| 12 | 17 | |
| @@ -132,19 +137,19 @@ · 119 unmodified lines | ||
| 132 | 137 | 15.5 Other contributions |
| 133 | 138 | |
| 134 | 139 | |
| 135 | − ______________________________________________________________________ | |
| 136 | − | |
| 137 | − 1. Introduction | |
| 140 | +1. Introduction | |
| 141 | +================ | |
| 138 | 142 | |
| 139 | 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? | |
| 147 | +1.1. How is User Mode Linux Different? | |
| 148 | +--------------------------------------- | |
| 144 | 149 | |
| 145 | 150 | Normally, the Linux Kernel talks straight to your hardware (video |
| 146 | 151 | 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 | 167 | 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 | 169 | from now on), like any other program. Programs can then run inside |
| 165 | 170 | 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? | |
| 189 | +1.2. Why Would I Want User Mode Linux? | |
| 190 | +--------------------------------------- | |
| 185 | 191 | |
| 186 | 192 | |
| 187 | 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 | − | |
| 209 | − 2. Compiling the kernel and modules | |
| 215 | +2. Compiling the kernel and modules | |
| 216 | +==================================== | |
| 210 | 217 | |
| 211 | 218 | |
| 212 | 219 | |
| 213 | 220 | |
| 214 | − 2.1. Compiling the kernel | |
| 221 | +2.1. Compiling the kernel | |
| 222 | +-------------------------- | |
| 215 | 223 | |
| 216 | 224 | |
| 217 | 225 | Compiling the user mode kernel is just like compiling any other |
| 218 | − kernel. Let's go through the steps, using 2.4.0-prerelease (current | |
| 219 | − as of this writing) as an example: | |
| 220 | − | |
| 221 | − | |
| 222 | − 1. Download the latest UML patch from | |
| 223 | − | |
| 224 | − the download page <http://user-mode-linux.sourceforge.net/ | |
| 225 | − | |
| 226 | − In this example, the file is uml-patch-2.4.0-prerelease.bz2. | |
| 226 | + kernel. | |
| 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 | 230 | such as: |
| 231 | 231 | |
| 232 | − ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2 | |
| 233 | − <ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2> | |
| 234 | − . | |
| 235 | − | |
| 236 | − | |
| 237 | − 3. Make a directory and unpack the kernel into it. | |
| 238 | − | |
| 232 | + https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.14.tar.xz | |
| 239 | 233 | |
| 234 | + 2. Make a directory and unpack the kernel into it:: | |
| 240 | 235 | |
| 241 | 236 | host% |
| 242 | 237 | mkdir ~/uml |
| 243 | 238 | |
| 244 | − | |
| 245 | − | |
| 246 | − | |
| 247 | − | |
| 248 | − | |
| 249 | 239 | host% |
| 250 | 240 | 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 | 242 | host% |
| 275 | − bzcat uml-patch-2.4.0-prerelease.bz2 | patch -p1 | |
| 243 | + tar xvf linux-5.4.14.tar.xz | |
| 276 | 244 | |
| 277 | 245 | |
| 278 | − | |
| 279 | − | |
| 280 | − | |
| 281 | − | |
| 282 | − 5. Run your favorite config; `make xconfig ARCH=um' is the most | |
| 283 | − convenient. `make config ARCH=um' and 'make menuconfig ARCH=um' | |
| 246 | + 3. Run your favorite config; ``make xconfig ARCH=um`` is the most | |
| 247 | + convenient. ``make config ARCH=um`` and ``make menuconfig ARCH=um`` | |
| 284 | 248 | will work as well. The defaults will give you a useful kernel. If |
| 285 | 249 | you want to change something, go ahead, it probably won't hurt |
| 286 | 250 | anything. |
| @@ -288,44 +252,20 @@ · 1 unmodified line | ||
| 288 | 252 | |
| 289 | 253 | Note: If the host is configured with a 2G/2G address space split |
| 290 | 254 | rather than the usual 3G/1G split, then the packaged UML binaries |
| 291 | − will not run. They will immediately segfault. See ``UML on 2G/2G | |
| 292 | − hosts'' for the scoop on running UML on your system. | |
| 293 | − | |
| 294 | − | |
| 295 | − | |
| 296 | − 6. Finish with `make linux ARCH=um': the result is a file called | |
| 297 | − `linux' in the top directory of your source tree. | |
| 298 | − | |
| 299 | − Make sure that you don't build this kernel in /usr/src/linux. On some | |
| 300 | − distributions, /usr/include/asm is a link into this pool. The user- | |
| 301 | − mode build changes the other end of that link, and things that include | |
| 302 | − <asm/anything.h> stop compiling. | |
| 303 | − | |
| 304 | − The sources are also available from cvs at the project's cvs page, | |
| 305 | − which has directions on getting the sources. You can also browse the | |
| 306 | − CVS pool from there. | |
| 255 | + will not run. They will immediately segfault. See | |
| 256 | + :ref:`UML_on_2G/2G_hosts` for the scoop on running UML on your system. | |
| 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 | − | |
| 319 | − | |
| 320 | − | |
| 321 | − where 'x' is the version in your pool. Note that you will not get the | |
| 322 | − bug fixes and enhancements that have gone into subsequent releases. | |
| 323 | − | |
| 324 | − | |
| 325 | − 2.2. Compiling and installing kernel modules | |
| 264 | +2.2. Compiling and installing kernel modules | |
| 265 | +--------------------------------------------- | |
| 326 | 266 | |
| 327 | 267 | 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 | 271 | host% make modules ARCH=um |
| @@ -337,12 +277,12 @@ · 5 unmodified lines | ||
| 337 | 277 | the user-mode pool. Modules from the native kernel won't work. |
| 338 | 278 | |
| 339 | 279 | 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 | 282 | You can also get the kernel build process to install them as follows: |
| 343 | 283 | |
| 344 | 284 | 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 | 288 | host% mount root_fs mnt -o loop |
| @@ -352,7 +292,7 @@ · 3 unmodified lines | ||
| 352 | 292 | |
| 353 | 293 | |
| 354 | 294 | |
| 355 | − 2. run | |
| 295 | + 2. run:: | |
| 356 | 296 | |
| 357 | 297 | |
| 358 | 298 | host% |
| @@ -363,7 +303,7 @@ · 4 unmodified lines | ||
| 363 | 303 | |
| 364 | 304 | |
| 365 | 305 | |
| 366 | − 3. unmount the filesystem | |
| 306 | + 3. unmount the filesystem:: | |
| 367 | 307 | |
| 368 | 308 | |
| 369 | 309 | host% umount mnt |
| @@ -381,27 +321,28 @@ · 11 unmodified lines | ||
| 381 | 321 | as modules, especially filesystems and network protocols and filters, |
| 382 | 322 | so most symbols which need to be exported probably already are. |
| 383 | 323 | However, if you do find symbols that need exporting, let us |
| 384 | − <http://user-mode-linux.sourceforge.net/> know, and | |
| 324 | + know at http://user-mode-linux.sourceforge.net/, and | |
| 385 | 325 | they'll be "taken care of". |
| 386 | 326 | |
| 387 | 327 | |
| 388 | 328 | |
| 389 | − 2.3. Compiling and installing uml_utilities | |
| 329 | +2.3. Compiling and installing uml_utilities | |
| 330 | +-------------------------------------------- | |
| 390 | 331 | |
| 391 | 332 | Many features of the UML kernel require a user-space helper program, |
| 392 | 333 | so a uml_utilities package is distributed separately from the kernel |
| 393 | 334 | patch which provides these helpers. Included within this is: |
| 394 | 335 | |
| 395 | − o port-helper - Used by consoles which connect to xterms or ports | |
| 336 | + - port-helper - Used by consoles which connect to xterms or ports | |
| 396 | 337 | |
| 397 | − o tunctl - Configuration tool to create and delete tap devices | |
| 338 | + - tunctl - Configuration tool to create and delete tap devices | |
| 398 | 339 | |
| 399 | − o uml_net - Setuid binary for automatic tap device configuration | |
| 340 | + - uml_net - Setuid binary for automatic tap device configuration | |
| 400 | 341 | |
| 401 | − o uml_switch - User-space virtual switch required for daemon | |
| 342 | + - uml_switch - User-space virtual switch required for daemon | |
| 402 | 343 | transport |
| 403 | 344 | |
| 404 | − The uml_utilities tree is compiled with: | |
| 345 | + The uml_utilities tree is compiled with:: | |
| 405 | 346 | |
| 406 | 347 | |
| 407 | 348 | host# |
| @@ -423,38 +364,42 @@ · 15 unmodified lines | ||
| 423 | 364 | |
| 424 | 365 | |
| 425 | 366 | |
| 426 | − 3. Running UML and logging in | |
| 367 | +3. Running UML and logging in | |
| 368 | +============================== | |
| 427 | 369 | |
| 428 | 370 | |
| 429 | 371 | |
| 430 | − 3.1. Running UML | |
| 372 | +3.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 | 378 | Booting UML is straightforward. Simply run 'linux': it will try to |
| 436 | − mount the file `root_fs' in the current directory. You do not need to | |
| 437 | − run it as root. If your root filesystem is not named `root_fs', then | |
| 438 | − you need to put a `ubd0=root_fs_whatever' switch on the linux command | |
| 379 | + mount the file ``root_fs`` in the current directory. You do not need to | |
| 380 | + run it as root. If your root filesystem is not named ``root_fs``, then | |
| 381 | + you need to put a ``ubd0=root_fs_whatever`` switch on the linux command | |
| 439 | 382 | line. |
| 440 | 383 | |
| 441 | 384 | |
| 442 | 385 | You will need a filesystem to boot UML from. There are a number |
| 443 | − available for download from here <http://user-mode- | |
| 444 | − linux.sourceforge.net/> . There are also several tools | |
| 445 | − <http://user-mode-linux.sourceforge.net/> which can be | |
| 386 | + available for download from http://user-mode-linux.sourceforge.net. | |
| 387 | + There are also several tools at | |
| 388 | + http://user-mode-linux.sourceforge.net/ which can be | |
| 446 | 389 | used to generate UML-compatible filesystem images from media. |
| 447 | 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 split | |
| 393 | +Note: | |
| 394 | + If the host is configured with a 2G/2G address space split | |
| 451 | 395 | 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 | 397 | for the scoop on running UML on your system. |
| 454 | 398 | |
| 455 | 399 | |
| 456 | 400 | |
| 457 | − 3.2. Logging in | |
| 401 | +3.2. Logging in | |
| 402 | +---------------- | |
| 458 | 403 | |
| 459 | 404 | |
| 460 | 405 | |
| @@ -468,22 +413,22 @@ · 7 unmodified lines | ||
| 468 | 413 | |
| 469 | 414 | There are a couple of other ways to log in: |
| 470 | 415 | |
| 471 | − o On a virtual console | |
| 416 | + - On a virtual console | |
| 472 | 417 | |
| 473 | 418 | |
| 474 | 419 | |
| 475 | 420 | Each virtual console that is configured (i.e. the device exists in |
| 476 | 421 | /dev and /etc/inittab runs a getty on it) will come up in its own |
| 477 | − xterm. If you get tired of the xterms, read ``Setting up serial | |
| 478 | − lines and consoles'' to see how to attach the consoles to | |
| 479 | − something else, like host ptys. | |
| 422 | + xterm. If you get tired of the xterms, read | |
| 423 | + :ref:`setting_up_serial_lines_and_consoles` to see how to attach | |
| 424 | + the consoles to something else, like host ptys. | |
| 480 | 425 | |
| 481 | 426 | |
| 482 | 427 | |
| 483 | − o Over the serial line | |
| 428 | + - 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 | 440 | Attach your favorite terminal program to the corresponding tty. I.e. |
| 496 | − for minicom, the command would be | |
| 441 | + for minicom, the command would be:: | |
| 497 | 442 | |
| 498 | 443 | |
| 499 | 444 | host% minicom -o -p /dev/ttyp1 |
| @@ -503,37 +448,40 @@ · 3 unmodified lines | ||
| 503 | 448 | |
| 504 | 449 | |
| 505 | 450 | |
| 506 | − o Over the net | |
| 451 | + - Over the net | |
| 507 | 452 | |
| 508 | 453 | |
| 509 | 454 | If the network is running, then you can telnet to the virtual |
| 510 | − machine and log in to it. See ``Setting up the network'' to learn | |
| 455 | + machine and log in to it. See :ref:`Setting_up_the_network` to learn | |
| 511 | 456 | about setting up a virtual network. |
| 512 | 457 | |
| 513 | 458 | When you're done using it, run halt, and the kernel will bring itself |
| 514 | 459 | down and the process will exit. |
| 515 | 460 | |
| 516 | 461 | |
| 517 | − 3.3. Examples | |
| 462 | +3.3. Examples | |
| 463 | +-------------- | |
| 518 | 464 | |
| 519 | 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 | |
| 477 | +4. UML on 2G/2G hosts | |
| 478 | +====================== | |
| 530 | 479 | |
| 531 | − 4. UML on 2G/2G hosts | |
| 532 | 480 | |
| 533 | 481 | |
| 534 | 482 | |
| 535 | − | |
| 536 | − 4.1. Introduction | |
| 483 | +4.1. Introduction | |
| 484 | +------------------ | |
| 537 | 485 | |
| 538 | 486 | |
| 539 | 487 | 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 problem | |
| 497 | +4.2. The problem | |
| 498 | +----------------- | |
| 550 | 499 | |
| 551 | 500 | |
| 552 | 501 | 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 solution | |
| 510 | +4.3. The solution | |
| 511 | +------------------ | |
| 562 | 512 | |
| 563 | 513 | |
| 564 | 514 | The fix for this is to rebuild UML from source after enabling |
| 565 | 515 | CONFIG_HOST_2G_2G (under 'General Setup'). This will cause UML to |
| 566 | 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'' if | |
| 517 | + where it will run fine. See :ref:`Compiling_the_kernel_and_modules` if | |
| 568 | 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 | − | |
| 579 | − 5. Setting up serial lines and consoles | |
| 529 | +5. Setting up serial lines and consoles | |
| 530 | +======================================== | |
| 580 | 531 | |
| 581 | 532 | |
| 582 | 533 | 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 | 537 | You can attach them to host ptys, ttys, file descriptors, and ports. |
| 587 | − This allows you to do things like | |
| 538 | + This allows you to do things like: | |
| 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 pty | |
| 542 | + - hook two virtual machines together by having one attach to a pty | |
| 592 | 543 | and having the other attach to the corresponding tty |
| 593 | 544 | |
| 594 | − o make a virtual machine accessible from the net by attaching a | |
| 545 | + - make a virtual machine accessible from the net by attaching a | |
| 595 | 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 device | |
| 553 | +5.1. Specifying the device | |
| 554 | +--------------------------- | |
| 603 | 555 | |
| 604 | 556 | Devices are specified with "con" or "ssl" (console or serial line, |
| 605 | 557 | respectively), optionally with a device number if you are talking |
| @@ -613,7 +565,7 @@ · 7 unmodified lines | ||
| 613 | 565 | |
| 614 | 566 | A specific device name will override a less general "con=" or "ssl=". |
| 615 | 567 | 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 | 571 | 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 channel | |
| 581 | +5.2. Specifying the channel | |
| 582 | +---------------------------- | |
| 630 | 583 | |
| 631 | 584 | There are a number of different types of channels to attach a UML |
| 632 | 585 | device to, each with a different way of specifying exactly what to |
| 633 | 586 | attach to. |
| 634 | 587 | |
| 635 | − o pseudo-terminals - device=pty pts terminals - device=pts | |
| 588 | + - pseudo-terminals - device=pty pts terminals - device=pts | |
| 636 | 589 | |
| 637 | 590 | |
| 638 | 591 | This will cause UML to allocate a free host pseudo-terminal for the |
| @@ -640,23 +593,23 @@ · 1 unmodified line | ||
| 640 | 593 | log. You access it by attaching a terminal program to the |
| 641 | 594 | corresponding tty: |
| 642 | 595 | |
| 643 | − o screen /dev/pts/n | |
| 596 | + - screen /dev/pts/n | |
| 644 | 597 | |
| 645 | − o screen /dev/ttyxx | |
| 598 | + - screen /dev/ttyxx | |
| 646 | 599 | |
| 647 | − o minicom -o -p /dev/ttyxx - minicom seems not able to handle pts | |
| 600 | + - minicom -o -p /dev/ttyxx - minicom seems not able to handle pts | |
| 648 | 601 | 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 file | |
| 609 | + - terminals - device=tty:tty device file | |
| 657 | 610 | |
| 658 | 611 | |
| 659 | − This will make UML attach the device to the specified tty (i.e | |
| 612 | + This will make UML attach the device to the specified tty (i.e:: | |
| 660 | 613 | |
| 661 | 614 | |
| 662 | 615 | con1=tty:/dev/tty3 |
| @@ -672,7 +625,7 @@ · 9 unmodified lines | ||
| 672 | 625 | |
| 673 | 626 | |
| 674 | 627 | |
| 675 | − o xterms - device=xterm | |
| 628 | + - xterms - device=xterm | |
| 676 | 629 | |
| 677 | 630 | |
| 678 | 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 number | |
| 637 | + - Port - device=port:port number | |
| 685 | 638 | |
| 686 | 639 | |
| 687 | 640 | This will attach the UML devices to the specified host port. |
| 688 | 641 | Attaching console 1 to the host's port 9000 would be done like |
| 689 | − this: | |
| 642 | + this:: | |
| 690 | 643 | |
| 691 | 644 | |
| 692 | 645 | 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 | 653 | 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- | |
| 706 | − net session gets a different device. If there are more telnets to a | |
| 658 | + You access these devices by telnetting to that port. Each active | |
| 659 | + telnet session gets a different device. If there are more telnets to a | |
| 707 | 660 | port than UML devices attached to it, then the extra telnet sessions |
| 708 | 661 | will block until an existing telnet detaches, or until another device |
| 709 | 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 descriptor | |
| 681 | + - already-existing file descriptors - device=file descriptor | |
| 729 | 682 | |
| 730 | 683 | |
| 731 | 684 | If you set up a file descriptor on the UML command line, you can |
| 732 | 685 | attach a UML device to it. This is most commonly used to put the |
| 733 | 686 | 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 | 690 | con0=fd:0,fd:1 con=pts |
| @@ -743,7 +696,7 @@ · 5 unmodified lines | ||
| 743 | 696 | |
| 744 | 697 | |
| 745 | 698 | |
| 746 | − o Nothing - device=null | |
| 699 | + - Nothing - device=null | |
| 747 | 700 | |
| 748 | 701 | |
| 749 | 702 | 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=none | |
| 710 | + - None - device=none | |
| 758 | 711 | |
| 759 | 712 | |
| 760 | 713 | This causes the device to disappear. |
| @@ -762,7 +715,7 @@ · 1 unmodified line | ||
| 762 | 715 | |
| 763 | 716 | |
| 764 | 717 | 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 | 721 | ssl3=tty:/dev/tty2,xterm |
| @@ -785,14 +738,15 @@ · 16 unmodified lines | ||
| 785 | 738 | |
| 786 | 739 | |
| 787 | 740 | |
| 788 | − 5.3. Examples | |
| 741 | +5.3. Examples | |
| 742 | +-------------- | |
| 789 | 743 | |
| 790 | 744 | There are a number of interesting things you can do with this |
| 791 | 745 | capability. |
| 792 | 746 | |
| 793 | 747 | |
| 794 | 748 | 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 | 752 | con=pty con0=fd:0,fd:1 |
| @@ -802,7 +756,7 @@ · 3 unmodified lines | ||
| 802 | 756 | |
| 803 | 757 | This will make a UML console take over an unused host virtual console, |
| 804 | 758 | 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 | 762 | con1=tty:/dev/tty6 |
| @@ -813,7 +767,7 @@ · 4 unmodified lines | ||
| 813 | 767 | You can attach two virtual machines together with what amounts to a |
| 814 | 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 | 773 | ssl1=pty |
| @@ -825,7 +779,7 @@ · 5 unmodified lines | ||
| 825 | 779 | that it got /dev/ptyp1). |
| 826 | 780 | |
| 827 | 781 | Boot the other UML with a serial line attached to the corresponding |
| 828 | − tty - | |
| 782 | + tty:: | |
| 829 | 783 | |
| 830 | 784 | |
| 831 | 785 | ssl1=tty:/dev/ttyp1 |
| @@ -838,7 +792,10 @@ · 6 unmodified lines | ||
| 838 | 792 | prompt of the other virtual machine. |
| 839 | 793 | |
| 840 | 794 | |
| 841 | − 6. Setting up the network | |
| 795 | +.. _setting_up_the_network: | |
| 796 | + | |
| 797 | +6. Setting up the network | |
| 798 | +========================== | |
| 842 | 799 | |
| 843 | 800 | |
| 844 | 801 | |
| @@ -858,19 +815,19 @@ · 13 unmodified lines | ||
| 858 | 815 | There are currently five transport types available for a UML virtual |
| 859 | 816 | machine to exchange packets with other hosts: |
| 860 | 817 | |
| 861 | − o ethertap | |
| 818 | + - ethertap | |
| 862 | 819 | |
| 863 | − o TUN/TAP | |
| 820 | + - TUN/TAP | |
| 864 | 821 | |
| 865 | − o Multicast | |
| 822 | + - Multicast | |
| 866 | 823 | |
| 867 | − o a switch daemon | |
| 824 | + - a switch daemon | |
| 868 | 825 | |
| 869 | − o slip | |
| 826 | + - slip | |
| 870 | 827 | |
| 871 | − o slirp | |
| 828 | + - slirp | |
| 872 | 829 | |
| 873 | − o pcap | |
| 830 | + - pcap | |
| 874 | 831 | |
| 875 | 832 | The TUN/TAP, ethertap, slip, and slirp transports allow a UML |
| 876 | 833 | instance to exchange packets with the host. They may be directed |
| @@ -893,28 +850,28 @@ · 16 unmodified lines | ||
| 893 | 850 | With so many host transports, which one should you use? Here's when |
| 894 | 851 | you should use each one: |
| 895 | 852 | |
| 896 | − o ethertap - if you want access to the host networking and it is | |
| 853 | + - ethertap - if you want access to the host networking and it is | |
| 897 | 854 | running 2.2 |
| 898 | 855 | |
| 899 | − o TUN/TAP - if you want access to the host networking and it is | |
| 856 | + - TUN/TAP - if you want access to the host networking and it is | |
| 900 | 857 | running 2.4. Also, the TUN/TAP transport is able to use a |
| 901 | 858 | preconfigured device, allowing it to avoid using the setuid uml_net |
| 902 | 859 | helper, which is a security advantage. |
| 903 | 860 | |
| 904 | − o Multicast - if you want a purely virtual network and you don't want | |
| 861 | + - Multicast - if you want a purely virtual network and you don't want | |
| 905 | 862 | to set up anything but the UML |
| 906 | 863 | |
| 907 | − o a switch daemon - if you want a purely virtual network and you | |
| 864 | + - a switch daemon - if you want a purely virtual network and you | |
| 908 | 865 | don't mind running the daemon in order to get somewhat better |
| 909 | 866 | performance |
| 910 | 867 | |
| 911 | − o slip - there is no particular reason to run the slip backend unless | |
| 868 | + - slip - there is no particular reason to run the slip backend unless | |
| 912 | 869 | 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 setup | |
| 871 | + - slirp - if you don't have root access on the host to setup | |
| 915 | 872 | 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 for | |
| 874 | + - pcap - not much use for actual network connectivity, but great for | |
| 918 | 875 | monitoring traffic on the host |
| 919 | 876 | |
| 920 | 877 | Ethertap is available on 2.4 and works fine. TUN/TAP is preferred |
| @@ -926,7 +883,8 @@ · 5 unmodified lines | ||
| 926 | 883 | exploit the helper's root privileges. |
| 927 | 884 | |
| 928 | 885 | |
| 929 | − 6.1. General setup | |
| 886 | +6.1. General setup | |
| 887 | +------------------- | |
| 930 | 888 | |
| 931 | 889 | First, you must have the virtual network enabled in your UML. If are |
| 932 | 890 | running a prebuilt kernel from this site, everything is already |
| @@ -938,7 +896,7 @@ · 5 unmodified lines | ||
| 938 | 896 | The next step is to provide a network device to the virtual machine. |
| 939 | 897 | This is done by describing it on the kernel command line. |
| 940 | 898 | |
| 941 | − The general format is | |
| 899 | + The general format is:: | |
| 942 | 900 | |
| 943 | 901 | |
| 944 | 902 | eth <n> = <transport> , <transport args> |
| @@ -947,7 +905,7 @@ · 2 unmodified lines | ||
| 947 | 905 | |
| 948 | 906 | |
| 949 | 907 | 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 | 911 | 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 | 938 | 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 | 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 daemons | |
| 956 | +6.2. Userspace daemons | |
| 957 | +----------------------- | |
| 999 | 958 | |
| 1000 | 959 | You will likely need the setuid helper, or the switch daemon, or both. |
| 1001 | 960 | 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 addresses | |
| 973 | +6.3. Specifying ethernet addresses | |
| 974 | +----------------------------------- | |
| 1015 | 975 | |
| 1016 | 976 | Below, you will see that the TUN/TAP, ethertap, and daemon interfaces |
| 1017 | 977 | allow you to specify hardware addresses for the virtual ethernet |
| @@ -1023,21 +983,21 @@ · 5 unmodified lines | ||
| 1023 | 983 | sufficient to guarantee a unique hardware address for the device. A |
| 1024 | 984 | couple of exceptions are: |
| 1025 | 985 | |
| 1026 | − o Another set of virtual ethernet devices are on the same network and | |
| 986 | + - Another set of virtual ethernet devices are on the same network and | |
| 1027 | 987 | they are assigned hardware addresses using a different scheme which |
| 1028 | 988 | 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't | |
| 990 | + - You aren't going to use the device for IP networking, so you don't | |
| 1031 | 991 | assign the device an IP address |
| 1032 | 992 | |
| 1033 | 993 | If you let the driver provide the hardware address, you should make |
| 1034 | 994 | 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# | |
| 1040 | − ifconfig eth0 192.168.0.250 up | |
| 999 | + UML# | |
| 1000 | + 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 setup | |
| 1012 | +6.4. UML interface setup | |
| 1013 | +------------------------- | |
| 1053 | 1014 | |
| 1054 | 1015 | Once the network devices have been described on the command line, you |
| 1055 | 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 | 1022 | UML# ifconfig ethn ip-address up |
| @@ -1067,7 +1028,7 @@ · 5 unmodified lines | ||
| 1067 | 1028 | |
| 1068 | 1029 | |
| 1069 | 1030 | To reach the rest of the world, you should set a default route to the |
| 1070 | − host: | |
| 1031 | + host:: | |
| 1071 | 1032 | |
| 1072 | 1033 | |
| 1073 | 1034 | 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 | 1042 | UML# route add default gw 192.168.0.4 |
| @@ -1097,29 +1058,25 @@ · 15 unmodified lines | ||
| 1097 | 1058 | Note: If you can't communicate with other hosts on your physical |
| 1098 | 1059 | ethernet, it's probably because of a network route that's |
| 1099 | 1060 | 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 Iface | |
| 1106 | − 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 | |
| 1066 | + Destination Gateway Genmask Flags Metric Ref Use Iface | |
| 1067 | + 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 | |
| 1107 | 1068 | |
| 1108 | 1069 | |
| 1109 | 1070 | |
| 1110 | 1071 | |
| 1111 | 1072 | 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 | 1076 | UML# |
| 1116 | 1077 | route del -net 192.168.0.0 dev eth0 netmask 255.255.255.0 |
| 1117 | 1078 | |
| 1118 | 1079 | |
| 1119 | − | |
| 1120 | − | |
| 1121 | − | |
| 1122 | − | |
| 1123 | 1080 | UML# |
| 1124 | 1081 | 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. Multicast | |
| 1091 | +6.5. Multicast | |
| 1092 | +--------------- | |
| 1135 | 1093 | |
| 1136 | 1094 | The simplest way to set up a virtual network between multiple UMLs is |
| 1137 | 1095 | to use the mcast transport. This was written by Harald Welte and is |
| @@ -1142,7 +1100,7 @@ · 4 unmodified lines | ||
| 1142 | 1100 | messages when you bring the device up inside UML. |
| 1143 | 1101 | |
| 1144 | 1102 | |
| 1145 | − To use it, run two UMLs with | |
| 1103 | + To use it, run two UMLs with:: | |
| 1146 | 1104 | |
| 1147 | 1105 | |
| 1148 | 1106 | eth0=mcast |
| @@ -1151,16 +1109,12 @@ · 2 unmodified lines | ||
| 1151 | 1109 | |
| 1152 | 1110 | |
| 1153 | 1111 | 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 | 1115 | UML1# ifconfig eth0 192.168.0.254 |
| 1158 | 1116 | |
| 1159 | 1117 | |
| 1160 | − | |
| 1161 | − | |
| 1162 | − | |
| 1163 | − | |
| 1164 | 1118 | UML2# ifconfig eth0 192.168.0.253 |
| 1165 | 1119 | |
| 1166 | 1120 | |
| @@ -1168,7 +1122,7 @@ · 1 unmodified line | ||
| 1168 | 1122 | |
| 1169 | 1123 | and they should be able to talk to each other. |
| 1170 | 1124 | |
| 1171 | − The full set of command line options for this transport are | |
| 1125 | + 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 | 1134 | There is also a related point-to-point only "ucast" transport. |
| 1186 | 1135 | This is useful when your network does not support multicast, and |
| 1187 | 1136 | all network connections are simple point to point links. |
| 1188 | 1137 | |
| 1189 | − The full set of command line options for this transport are | |
| 1138 | + The full set of command line options for this transport are:: | |
| 1190 | 1139 | |
| 1191 | 1140 | |
| 1192 | 1141 | 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 helper | |
| 1146 | +6.6. TUN/TAP with the uml_net helper | |
| 1147 | +------------------------------------- | |
| 1198 | 1148 | |
| 1199 | 1149 | TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the |
| 1200 | 1150 | host. The TUN/TAP backend has been in UML since 2.4.9-3um. |
| @@ -1216,7 +1166,7 @@ · 15 unmodified lines | ||
| 1216 | 1166 | kernel or as the tun.o module. |
| 1217 | 1167 | |
| 1218 | 1168 | The format of the command line switch to attach a device to a TUN/TAP |
| 1219 | − device is | |
| 1169 | + device is:: | |
| 1220 | 1170 | |
| 1221 | 1171 | |
| 1222 | 1172 | eth <n> =tuntap,,, <IP address> |
| @@ -1226,7 +1176,7 @@ · 3 unmodified lines | ||
| 1226 | 1176 | |
| 1227 | 1177 | For example, this argument will attach the UML's eth0 to the next |
| 1228 | 1178 | available tap device and assign an ethernet address to it based on its |
| 1229 | − IP address | |
| 1179 | + IP address:: | |
| 1230 | 1180 | |
| 1231 | 1181 | |
| 1232 | 1182 | eth0=tuntap,,,192.168.0.254 |
| @@ -1247,10 +1197,10 @@ · 14 unmodified lines | ||
| 1247 | 1197 | There are a couple potential problems with running the TUN/TAP |
| 1248 | 1198 | 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 host | |
| 1200 | + - TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host | |
| 1251 | 1201 | kernel or use the ethertap transport. |
| 1252 | 1202 | |
| 1253 | − o With an upgraded kernel, TUN/TAP may fail with | |
| 1203 | + - With an upgraded kernel, TUN/TAP may fail with:: | |
| 1254 | 1204 | |
| 1255 | 1205 | |
| 1256 | 1206 | File descriptor in bad state |
| @@ -1263,13 +1213,12 @@ · 6 unmodified lines | ||
| 1263 | 1213 | make sure that /usr/src/linux points to the headers for the running |
| 1264 | 1214 | kernel. |
| 1265 | 1215 | |
| 1266 | − These were pointed out by Tim Robinson <timro at trkr dot net> in | |
| 1267 | − <http://www.geocrawler.com/> name="this uml- | |
| 1268 | − user post"> . | |
| 1216 | + These were pointed out by Tim Robinson <timro at trkr dot net> in the past. | |
| 1269 | 1217 | |
| 1270 | 1218 | |
| 1271 | 1219 | |
| 1272 | − 6.7. TUN/TAP with a preconfigured tap device | |
| 1220 | +6.7. TUN/TAP with a preconfigured tap device | |
| 1221 | +--------------------------------------------- | |
| 1273 | 1222 | |
| 1274 | 1223 | If you prefer not to have UML use uml_net (which is somewhat |
| 1275 | 1224 | insecure), with UML 2.4.17-11, you can set up a TUN/TAP device |
| @@ -1277,8 +1226,8 @@ · 1 unmodified line | ||
| 1277 | 1226 | there is no need for root assistance. Setting up the device is done |
| 1278 | 1227 | as follows: |
| 1279 | 1228 | |
| 1280 | − o Create the device with tunctl (available from the UML utilities | |
| 1281 | − tarball) | |
| 1229 | + - Create the device with tunctl (available from the UML utilities | |
| 1230 | + tarball):: | |
| 1282 | 1231 | |
| 1283 | 1232 | |
| 1284 | 1233 | |
| @@ -1291,8 +1240,8 @@ · 6 unmodified lines | ||
| 1291 | 1240 | where uid is the user id or username that UML will be run as. This |
| 1292 | 1241 | will tell you what device was created. |
| 1293 | 1242 | |
| 1294 | − o Configure the device IP (change IP addresses and device name to | |
| 1295 | − suit) | |
| 1243 | + - Configure the device IP (change IP addresses and device name to | |
| 1244 | + suit):: | |
| 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 are | |
| 1307 | − other ways of doing the same thing | |
| 1255 | + - Set up routing and arping if desired - this is my recipe, there are | |
| 1256 | + other ways of doing the same thing:: | |
| 1308 | 1257 | |
| 1309 | 1258 | |
| 1310 | 1259 | host# |
| @@ -1313,19 +1262,9 @@ · 2 unmodified lines | ||
| 1313 | 1262 | host# |
| 1314 | 1263 | route add -host 192.168.0.253 dev tap0 |
| 1315 | 1264 | |
| 1316 | − | |
| 1317 | − | |
| 1318 | − | |
| 1319 | − | |
| 1320 | − | |
| 1321 | 1265 | host# |
| 1322 | 1266 | bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp' |
| 1323 | 1267 | |
| 1324 | − | |
| 1325 | − | |
| 1326 | − | |
| 1327 | − | |
| 1328 | − | |
| 1329 | 1268 | host# |
| 1330 | 1269 | arp -Ds 192.168.0.253 eth0 pub |
| 1331 | 1270 | |
| @@ -1338,76 +1277,43 @@ · 6 unmodified lines | ||
| 1338 | 1277 | utility which reads the information from a config file and sets up |
| 1339 | 1278 | devices at boot time. |
| 1340 | 1279 | |
| 1341 | − o Rather than using up two IPs and ARPing for one of them, you can | |
| 1280 | + - Rather than using up two IPs and ARPing for one of them, you can | |
| 1342 | 1281 | also provide direct access to your LAN by the UML by using a |
| 1343 | − bridge. | |
| 1282 | + bridge:: | |
| 1344 | 1283 | |
| 1345 | 1284 | |
| 1346 | 1285 | host# |
| 1347 | 1286 | brctl addbr br0 |
| 1348 | 1287 | |
| 1349 | 1288 | |
| 1350 | − | |
| 1351 | − | |
| 1352 | − | |
| 1353 | − | |
| 1354 | 1289 | host# |
| 1355 | 1290 | ifconfig eth0 0.0.0.0 promisc up |
| 1356 | 1291 | |
| 1357 | 1292 | |
| 1358 | − | |
| 1359 | − | |
| 1360 | − | |
| 1361 | − | |
| 1362 | 1293 | host# |
| 1363 | 1294 | ifconfig tap0 0.0.0.0 promisc up |
| 1364 | 1295 | |
| 1365 | 1296 | |
| 1366 | − | |
| 1367 | − | |
| 1368 | − | |
| 1369 | − | |
| 1370 | 1297 | host# |
| 1371 | 1298 | ifconfig br0 192.168.0.1 netmask 255.255.255.0 up |
| 1372 | 1299 | |
| 1373 | 1300 | |
| 1374 | − | |
| 1375 | − | |
| 1376 | − | |
| 1377 | − | |
| 1378 | − | |
| 1379 | − host# | |
| 1380 | − brctl stp br0 off | |
| 1381 | − | |
| 1382 | − | |
| 1383 | − | |
| 1384 | − | |
| 1301 | + host# | |
| 1302 | + brctl stp br0 off | |
| 1385 | 1303 | |
| 1386 | 1304 | |
| 1387 | 1305 | host# |
| 1388 | 1306 | brctl setfd br0 1 |
| 1389 | 1307 | |
| 1390 | 1308 | |
| 1391 | − | |
| 1392 | − | |
| 1393 | − | |
| 1394 | − | |
| 1395 | 1309 | host# |
| 1396 | 1310 | brctl sethello br0 1 |
| 1397 | 1311 | |
| 1398 | 1312 | |
| 1399 | − | |
| 1400 | − | |
| 1401 | − | |
| 1402 | − | |
| 1403 | 1313 | host# |
| 1404 | 1314 | brctl addif br0 eth0 |
| 1405 | 1315 | |
| 1406 | 1316 | |
| 1407 | − | |
| 1408 | − | |
| 1409 | − | |
| 1410 | − | |
| 1411 | 1317 | host# |
| 1412 | 1318 | brctl addif br0 tap0 |
| 1413 | 1319 | |
| @@ -1417,12 +1323,12 @@ · 3 unmodified lines | ||
| 1417 | 1323 | Note that 'br0' should be setup using ifconfig with the existing IP |
| 1418 | 1324 | address of eth0, as eth0 no longer has its own IP. |
| 1419 | 1325 | |
| 1420 | − o | |
| 1326 | + - | |
| 1421 | 1327 | |
| 1422 | 1328 | |
| 1423 | 1329 | Also, the /dev/net/tun device must be writable by the user running |
| 1424 | 1330 | UML in order for the UML to use the device that's been configured |
| 1425 | − for it. The simplest thing to do is | |
| 1331 | + for it. The simplest thing to do is:: | |
| 1426 | 1332 | |
| 1427 | 1333 | |
| 1428 | 1334 | host# chmod 666 /dev/net/tun |
| @@ -1438,14 +1344,14 @@ · 9 unmodified lines | ||
| 1438 | 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 | 1348 | (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the |
| 1443 | 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 | 1353 | If you don't want that tap device any more, you can make it non- |
| 1448 | − persistent with | |
| 1354 | + persistent with:: | |
| 1449 | 1355 | |
| 1450 | 1356 | |
| 1451 | 1357 | host# tunctl -d tap device |
| @@ -1455,7 +1361,7 @@ · 3 unmodified lines | ||
| 1455 | 1361 | |
| 1456 | 1362 | Finally, tunctl has a -b (for brief mode) switch which causes it to |
| 1457 | 1363 | 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 | 1367 | host# TAP=`tunctl -u 1000 -b` |
| @@ -1465,7 +1371,8 @@ · 3 unmodified lines | ||
| 1465 | 1371 | |
| 1466 | 1372 | |
| 1467 | 1373 | |
| 1468 | − 6.8. Ethertap | |
| 1374 | +6.8. Ethertap | |
| 1375 | +-------------- | |
| 1469 | 1376 | |
| 1470 | 1377 | Ethertap is the general mechanism on 2.2 for userspace processes to |
| 1471 | 1378 | exchange packets with the kernel. |
| @@ -1473,7 +1380,7 @@ · 1 unmodified line | ||
| 1473 | 1380 | |
| 1474 | 1381 | |
| 1475 | 1382 | To use this transport, you need to describe the virtual network device |
| 1476 | − on the UML command line. The general format for this is | |
| 1383 | + on the UML command line. The general format for this is:: | |
| 1477 | 1384 | |
| 1478 | 1385 | |
| 1479 | 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 example | |
| 1391 | + So, the previous example:: | |
| 1485 | 1392 | |
| 1486 | 1393 | |
| 1487 | 1394 | eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254 |
| @@ -1521,7 +1428,7 @@ · 33 unmodified lines | ||
| 1521 | 1428 | |
| 1522 | 1429 | If you want to set things up yourself, you need to make sure that the |
| 1523 | 1430 | 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 | 1434 | 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 | 1442 | mknod /dev/tap0 c 36 0 + 16 |
| @@ -1539,7 +1446,7 @@ · 3 unmodified lines | ||
| 1539 | 1446 | |
| 1540 | 1447 | You also need to make sure that the host kernel has ethertap support. |
| 1541 | 1448 | 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 | 1452 | host# |
| @@ -1549,7 +1456,7 @@ · 3 unmodified lines | ||
| 1549 | 1456 | |
| 1550 | 1457 | |
| 1551 | 1458 | will give you the tap0 interface. To get the tap1 interface, you need |
| 1552 | − to run | |
| 1459 | + to run:: | |
| 1553 | 1460 | |
| 1554 | 1461 | |
| 1555 | 1462 | host# |
| @@ -1561,7 +1468,8 @@ · 5 unmodified lines | ||
| 1561 | 1468 | |
| 1562 | 1469 | |
| 1563 | 1470 | |
| 1564 | − 6.9. The switch daemon | |
| 1471 | +6.9. The switch daemon | |
| 1472 | +----------------------- | |
| 1565 | 1473 | |
| 1566 | 1474 | Note: This is the daemon formerly known as uml_router, but which was |
| 1567 | 1475 | renamed so the network weenies of the world would stop growling at me. |
| @@ -1577,7 +1485,7 @@ · 9 unmodified lines | ||
| 1577 | 1485 | sockets. |
| 1578 | 1486 | |
| 1579 | 1487 | |
| 1580 | − If you want it to listen on a different pair of sockets, use | |
| 1488 | + If you want it to listen on a different pair of sockets, use:: | |
| 1581 | 1489 | |
| 1582 | 1490 | |
| 1583 | 1491 | -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, use | |
| 1497 | + If you want it to act as a hub rather than a switch, use:: | |
| 1590 | 1498 | |
| 1591 | 1499 | |
| 1592 | 1500 | -hub |
| @@ -1596,7 +1504,7 @@ · 3 unmodified lines | ||
| 1596 | 1504 | |
| 1597 | 1505 | |
| 1598 | 1506 | If you want the switch to be connected to host networking (allowing |
| 1599 | − the umls to get access to the outside world through the host), use | |
| 1507 | + the umls to get access to the outside world through the host), use:: | |
| 1600 | 1508 | |
| 1601 | 1509 | |
| 1602 | 1510 | -tap tap0 |
| @@ -1610,7 +1518,7 @@ · 7 unmodified lines | ||
| 1610 | 1518 | device than tap0, specify that instead of tap0. |
| 1611 | 1519 | |
| 1612 | 1520 | |
| 1613 | − uml_switch can be backgrounded as follows | |
| 1521 | + uml_switch can be backgrounded as follows:: | |
| 1614 | 1522 | |
| 1615 | 1523 | |
| 1616 | 1524 | host% |
| @@ -1623,7 +1531,7 @@ · 6 unmodified lines | ||
| 1623 | 1531 | stdin for EOF. When it sees that, it exits. |
| 1624 | 1532 | |
| 1625 | 1533 | |
| 1626 | − The general format of the kernel command line switch is | |
| 1534 | + The general format of the kernel command line switch is:: | |
| 1627 | 1535 | |
| 1628 | 1536 | |
| 1629 | 1537 | |
| @@ -1639,7 +1547,8 @@ · 9 unmodified lines | ||
| 1639 | 1547 | how to communicate with the daemon. You should only specify them if |
| 1640 | 1548 | you told the daemon to use different sockets than the default. So, if |
| 1641 | 1549 | you ran the daemon with no arguments, running the UML on the same |
| 1642 | − machine with | |
| 1550 | + machine with:: | |
| 1551 | + | |
| 1643 | 1552 | eth0=daemon |
| 1644 | 1553 | |
| 1645 | 1554 | |
| @@ -1649,7 +1558,8 @@ · 3 unmodified lines | ||
| 1649 | 1558 | |
| 1650 | 1559 | |
| 1651 | 1560 | |
| 1652 | − 6.10. Slip | |
| 1561 | +6.10. Slip | |
| 1562 | +----------- | |
| 1653 | 1563 | |
| 1654 | 1564 | Slip is another, less general, mechanism for a process to communicate |
| 1655 | 1565 | with the host networking. In contrast to the ethertap interface, |
| @@ -1658,7 +1568,7 @@ · 2 unmodified lines | ||
| 1658 | 1568 | IP. |
| 1659 | 1569 | |
| 1660 | 1570 | |
| 1661 | − The general format of the command line switch is | |
| 1571 | + 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. Slirp | |
| 1594 | +6.11. Slirp | |
| 1595 | +------------ | |
| 1685 | 1596 | |
| 1686 | 1597 | slirp uses an external program, usually /usr/bin/slirp, to provide IP |
| 1687 | 1598 | only networking connectivity through the host. This is similar to IP |
| @@ -1691,7 +1602,7 @@ · 3 unmodified lines | ||
| 1691 | 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 | 1627 | The eth0 interface on UML should be set up with the IP 10.2.0.15, |
| 1717 | 1628 | although you can use anything as long as it is not used by a network |
| 1718 | 1629 | you will be connecting to. The default route on UML should be set to |
| 1719 | − use | |
| 1630 | + use:: | |
| 1720 | 1631 | |
| 1721 | 1632 | |
| 1722 | 1633 | UML# |
| @@ -1737,10 +1648,11 @@ · 14 unmodified lines | ||
| 1737 | 1648 | |
| 1738 | 1649 | |
| 1739 | 1650 | |
| 1740 | − 6.12. pcap | |
| 1651 | +6.12. pcap | |
| 1652 | +----------- | |
| 1741 | 1653 | |
| 1742 | 1654 | 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 | 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 yourself | |
| 1692 | +6.13. Setting up the host yourself | |
| 1693 | +----------------------------------- | |
| 1781 | 1694 | |
| 1782 | 1695 | If you don't specify an address for the host side of the ethertap or |
| 1783 | 1696 | slip device, UML won't do any setup on the host. So this is what is |
| @@ -1785,19 +1698,15 @@ · 1 unmodified line | ||
| 1785 | 1698 | 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your |
| 1786 | 1699 | own network): |
| 1787 | 1700 | |
| 1788 | − o The device needs to be configured with its IP address. Tap devices | |
| 1701 | + - The device needs to be configured with its IP address. Tap devices | |
| 1789 | 1702 | are also configured with an mtu of 1484. Slip devices are |
| 1790 | 1703 | configured with a point-to-point address pointing at the UML ip |
| 1791 | − address. | |
| 1704 | + address:: | |
| 1792 | 1705 | |
| 1793 | 1706 | |
| 1794 | 1707 | host# ifconfig tap0 arp mtu 1484 192.168.0.251 up |
| 1795 | 1708 | |
| 1796 | 1709 | |
| 1797 | − | |
| 1798 | − | |
| 1799 | − | |
| 1800 | − | |
| 1801 | 1710 | host# |
| 1802 | 1711 | 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 | 1720 | 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, | |
| 1818 | − proxy arp is set up for it. | |
| 1726 | + - To allow other hosts on your network to see the virtual machine, | |
| 1727 | + proxy arp is set up for it:: | |
| 1819 | 1728 | |
| 1820 | 1729 | |
| 1821 | 1730 | 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 | 1739 | 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 Machines | |
| 1750 | +7. Sharing Filesystems between Virtual Machines | |
| 1751 | +================================================ | |
| 1842 | 1752 | |
| 1843 | 1753 | |
| 1844 | 1754 | |
| 1845 | 1755 | |
| 1846 | − 7.1. A warning | |
| 1756 | +7.1. A warning | |
| 1757 | +--------------- | |
| 1847 | 1758 | |
| 1848 | 1759 | Don't attempt to share filesystems simply by booting two UMLs from the |
| 1849 | 1760 | 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 devices | |
| 1765 | +7.2. Using layered block devices | |
| 1766 | +--------------------------------- | |
| 1855 | 1767 | |
| 1856 | 1768 | The way to share a filesystem between two virtual machines is to use |
| 1857 | 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 | 1786 | 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 | 1790 | ubd0=root_fs_cow,root_fs_debian_22 |
| @@ -1883,7 +1795,7 @@ · 4 unmodified lines | ||
| 1883 | 1795 | where 'root_fs_cow' is the private COW file and 'root_fs_debian_22' is |
| 1884 | 1796 | the existing shared filesystem. The COW file need not exist. If it |
| 1885 | 1797 | 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 | 1801 | ubd0=root_fs_cow |
| @@ -1896,14 +1808,16 @@ · 6 unmodified lines | ||
| 1896 | 1808 | |
| 1897 | 1809 | |
| 1898 | 1810 | |
| 1899 | − 7.3. Note! | |
| 1811 | +7.3. Note! | |
| 1812 | +----------- | |
| 1900 | 1813 | |
| 1901 | 1814 | When checking the size of the COW file in order to see the gobs of |
| 1902 | 1815 | space that you're saving, make sure you use 'ls -ls' to see the actual |
| 1903 | 1816 | disk consumption rather than the length of the file. The COW file is |
| 1904 | 1817 | sparse, so the length will be very different from the disk usage. |
| 1905 | 1818 | Here is a 'ls -l' of a COW file and backing file from one boot and |
| 1906 | − shutdown: | |
| 1819 | + shutdown:: | |
| 1820 | + | |
| 1907 | 1821 | host% ls -l cow.debian debian2.2 |
| 1908 | 1822 | -rw-r--r-- 1 jdike jdike 492504064 Aug 6 21:16 cow.debian |
| 1909 | 1823 | -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 | 1831 | host% ls -ls cow.debian debian2.2 |
| @@ -1926,7 +1840,8 @@ · 8 unmodified lines | ||
| 1926 | 1840 | |
| 1927 | 1841 | |
| 1928 | 1842 | |
| 1929 | − 7.4. Another warning | |
| 1843 | +7.4. Another warning | |
| 1844 | +--------------------- | |
| 1930 | 1845 | |
| 1931 | 1846 | Once a filesystem is being used as a readonly backing file for a COW |
| 1932 | 1847 | 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 file | |
| 1870 | +7.5. uml_moo : Merging a COW file with its backing file | |
| 1871 | +-------------------------------------------------------- | |
| 1956 | 1872 | |
| 1957 | 1873 | Depending on how you use UML and COW devices, it may be advisable to |
| 1958 | 1874 | 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 is | |
| 1880 | + The utility that does this is uml_moo. Its usage is:: | |
| 1965 | 1881 | |
| 1966 | 1882 | |
| 1967 | 1883 | host% uml_moo COW file new backing file |
| @@ -1991,8 +1907,8 @@ · 23 unmodified lines | ||
| 1991 | 1907 | |
| 1992 | 1908 | uml_moo is installed with the UML deb and RPM. If you didn't install |
| 1993 | 1909 | UML from one of those packages, you can also get it from the UML |
| 1994 | − utilities <http://user-mode-linux.sourceforge.net/ | |
| 1995 | − utilities> tar file in tools/moo. | |
| 1910 | + utilities http://user-mode-linux.sourceforge.net/utilities tar file | |
| 1911 | + in tools/moo. | |
| 1996 | 1912 | |
| 1997 | 1913 | |
| 1998 | 1914 | |
| @@ -2001,7 +1917,8 @@ · 2 unmodified lines | ||
| 2001 | 1917 | |
| 2002 | 1918 | |
| 2003 | 1919 | |
| 2004 | − 8. Creating filesystems | |
| 1920 | +8. Creating filesystems | |
| 1921 | +======================== | |
| 2005 | 1922 | |
| 2006 | 1923 | |
| 2007 | 1924 | You may want to create and mount new UML filesystems, either because |
| @@ -2015,13 +1932,14 @@ · 7 unmodified lines | ||
| 2015 | 1932 | should be easy to translate to the filesystem of your choice. |
| 2016 | 1933 | |
| 2017 | 1934 | |
| 2018 | − 8.1. Create the filesystem file | |
| 1935 | +8.1. Create the filesystem file | |
| 1936 | +================================ | |
| 2019 | 1937 | |
| 2020 | 1938 | dd is your friend. All you need to do is tell dd to create an empty |
| 2021 | 1939 | file of the appropriate size. I usually make it sparse to save time |
| 2022 | 1940 | and to avoid allocating disk space until it's actually used. For |
| 2023 | 1941 | example, the following command will create a sparse 100 meg file full |
| 2024 | − of zeroes. | |
| 1942 | + of zeroes:: | |
| 2025 | 1943 | |
| 2026 | 1944 | |
| 2027 | 1945 | host% |
| @@ -2034,9 +1952,9 @@ · 6 unmodified lines | ||
| 2034 | 1952 | |
| 2035 | 1953 | 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_filesystem | |
| 1957 | + ubd4=new_filesystem | |
| 2040 | 1958 | |
| 2041 | 1959 | |
| 2042 | 1960 | |
| @@ -2053,7 +1971,7 @@ · 10 unmodified lines | ||
| 2053 | 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 | 1977 | 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 | 2001 | UML# |
| @@ -2096,7 +2014,8 @@ · 12 unmodified lines | ||
| 2096 | 2014 | |
| 2097 | 2015 | |
| 2098 | 2016 | |
| 2099 | − 9. Host file access | |
| 2017 | +9. Host file access | |
| 2018 | +==================== | |
| 2100 | 2019 | |
| 2101 | 2020 | |
| 2102 | 2021 | If you want to access files on the host machine from inside UML, you |
| @@ -2112,10 +2031,11 @@ · 9 unmodified lines | ||
| 2112 | 2031 | files contained in it just as you would on the host. |
| 2113 | 2032 | |
| 2114 | 2033 | |
| 2115 | − 9.1. Using hostfs | |
| 2034 | +9.1. Using hostfs | |
| 2035 | +------------------ | |
| 2116 | 2036 | |
| 2117 | 2037 | To begin with, make sure that hostfs is available inside the virtual |
| 2118 | − machine with | |
| 2038 | + machine with:: | |
| 2119 | 2039 | |
| 2120 | 2040 | |
| 2121 | 2041 | UML# cat /proc/filesystems |
| @@ -2127,7 +2047,7 @@ · 5 unmodified lines | ||
| 2127 | 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 | 2053 | UML# mount none /mnt/host -t hostfs |
| @@ -2139,7 +2059,7 @@ · 5 unmodified lines | ||
| 2139 | 2059 | |
| 2140 | 2060 | |
| 2141 | 2061 | 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 | 2065 | 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 filesystem | |
| 2074 | +9.2. hostfs as the root filesystem | |
| 2075 | +----------------------------------- | |
| 2155 | 2076 | |
| 2156 | 2077 | It's possible to boot from a directory hierarchy on the host using |
| 2157 | 2078 | hostfs rather than using the standard filesystem in a file. |
| 2158 | 2079 | |
| 2159 | 2080 | 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 | 2084 | host# mount root_fs uml_root_dir -o loop |
| @@ -2166,15 +2087,15 @@ · 2 unmodified lines | ||
| 2166 | 2087 | |
| 2167 | 2088 | |
| 2168 | 2089 | 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 1 | |
| 2092 | + /dev/ubd/0 / hostfs defaults 1 1 | |
| 2172 | 2093 | |
| 2173 | 2094 | |
| 2174 | 2095 | |
| 2175 | 2096 | |
| 2176 | 2097 | 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 | 2101 | host# find . -uid 0 -exec chown jdike {} \; |
| @@ -2183,7 +2104,7 @@ · 2 unmodified lines | ||
| 2183 | 2104 | |
| 2184 | 2105 | |
| 2185 | 2106 | 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 | 2110 | ubd0=/path/to/uml/root/directory |
| @@ -2194,41 +2115,35 @@ · 4 unmodified lines | ||
| 2194 | 2115 | UML should then boot as it does normally. |
| 2195 | 2116 | |
| 2196 | 2117 | |
| 2197 | − 9.3. Building hostfs | |
| 2118 | +9.3. Building hostfs | |
| 2119 | +--------------------- | |
| 2198 | 2120 | |
| 2199 | 2121 | If you need to build hostfs because it's not in your kernel, you have |
| 2200 | 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 | 2129 | 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 | 2135 | Reconfigure the kernel and set the 'Host filesystem' option under |
| 2214 | 2136 | be in arch/um/fs/hostfs/hostfs.o. Install that in |
| 2215 | − /lib/modules/`uname -r`/fs in the virtual machine, boot it up, and | |
| 2137 | + ``/lib/modules/$(uname -r)/fs`` in the virtual machine, boot it up, and:: | |
| 2216 | 2138 | |
| 2217 | 2139 | |
| 2218 | 2140 | UML# insmod hostfs |
| 2219 | 2141 | |
| 2220 | 2142 | |
| 2143 | +.. _The_Management_Console: | |
| 2221 | 2144 | |
| 2222 | − | |
| 2223 | − | |
| 2224 | − | |
| 2225 | − | |
| 2226 | − | |
| 2227 | − | |
| 2228 | − | |
| 2229 | − | |
| 2230 | − | |
| 2231 | − 10. The Management Console | |
| 2145 | +10. The Management Console | |
| 2146 | +=========================== | |
| 2232 | 2147 | |
| 2233 | 2148 | |
| 2234 | 2149 | |
| @@ -2240,15 +2155,15 @@ · 5 unmodified lines | ||
| 2240 | 2155 | |
| 2241 | 2156 | There are a number of things you can do with the mconsole interface: |
| 2242 | 2157 | |
| 2243 | − o get the kernel version | |
| 2158 | + - get the kernel version | |
| 2244 | 2159 | |
| 2245 | − o add and remove devices | |
| 2160 | + - add and remove devices | |
| 2246 | 2161 | |
| 2247 | − o halt or reboot the machine | |
| 2162 | + - halt or reboot the machine | |
| 2248 | 2163 | |
| 2249 | − o Send SysRq commands | |
| 2164 | + - Send SysRq commands | |
| 2250 | 2165 | |
| 2251 | − o Pause and resume the UML | |
| 2166 | + - Pause and resume the UML | |
| 2252 | 2167 | |
| 2253 | 2168 | |
| 2254 | 2169 | You need the mconsole client (uml_mconsole) which is present in CVS |
| @@ -2257,7 +2172,7 @@ · 2 unmodified lines | ||
| 2257 | 2172 | |
| 2258 | 2173 | |
| 2259 | 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 | 2178 | 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 | 2186 | umid=debian |
| @@ -2273,7 +2188,7 @@ · 1 unmodified line | ||
| 2273 | 2188 | |
| 2274 | 2189 | |
| 2275 | 2190 | |
| 2276 | − you'll see this | |
| 2191 | + you'll see this:: | |
| 2277 | 2192 | |
| 2278 | 2193 | |
| 2279 | 2194 | mconsole initialized on /home/jdike/.uml/debian/mconsole |
| @@ -2282,7 +2197,7 @@ · 2 unmodified lines | ||
| 2282 | 2197 | |
| 2283 | 2198 | |
| 2284 | 2199 | 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 | 2203 | host% uml_mconsole debian |
| @@ -2290,7 +2205,7 @@ · 1 unmodified line | ||
| 2290 | 2205 | |
| 2291 | 2206 | |
| 2292 | 2207 | |
| 2293 | − or | |
| 2208 | + or:: | |
| 2294 | 2209 | |
| 2295 | 2210 | |
| 2296 | 2211 | host% uml_mconsole /home/jdike/.uml/debian/mconsole |
| @@ -2300,30 +2215,31 @@ · 3 unmodified lines | ||
| 2300 | 2215 | |
| 2301 | 2216 | You'll get a prompt, at which you can run one of these commands: |
| 2302 | 2217 | |
| 2303 | − o version | |
| 2218 | + - version | |
| 2304 | 2219 | |
| 2305 | − o halt | |
| 2220 | + - halt | |
| 2306 | 2221 | |
| 2307 | − o reboot | |
| 2222 | + - reboot | |
| 2308 | 2223 | |
| 2309 | − o config | |
| 2224 | + - config | |
| 2310 | 2225 | |
| 2311 | − o remove | |
| 2226 | + - remove | |
| 2312 | 2227 | |
| 2313 | − o sysrq | |
| 2228 | + - sysrq | |
| 2314 | 2229 | |
| 2315 | − o help | |
| 2230 | + - help | |
| 2316 | 2231 | |
| 2317 | − o cad | |
| 2232 | + - cad | |
| 2318 | 2233 | |
| 2319 | − o stop | |
| 2234 | + - stop | |
| 2320 | 2235 | |
| 2321 | − o go | |
| 2236 | + - go | |
| 2322 | 2237 | |
| 2323 | 2238 | |
| 2324 | − 10.1. version | |
| 2239 | +10.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 | 2245 | (mconsole) version |
| @@ -2342,11 +2258,12 @@ · 12 unmodified lines | ||
| 2342 | 2258 | |
| 2343 | 2259 | |
| 2344 | 2260 | |
| 2345 | − 10.2. halt and reboot | |
| 2261 | +10.2. halt and reboot | |
| 2262 | +---------------------- | |
| 2346 | 2263 | |
| 2347 | 2264 | These take no arguments. They shut the machine down immediately, with |
| 2348 | 2265 | 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 | 2269 | (mconsole) halt |
| @@ -2357,34 +2274,36 @@ · 4 unmodified lines | ||
| 2357 | 2274 | |
| 2358 | 2275 | |
| 2359 | 2276 | |
| 2360 | − 10.3. config | |
| 2277 | +10.3. config | |
| 2278 | +------------- | |
| 2361 | 2279 | |
| 2362 | 2280 | "config" adds a new device to the virtual machine. Currently the ubd |
| 2363 | 2281 | 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) | |
| 2370 | − config ubd3=/home/jdike/incoming/roots/root_fs_debian22 | |
| 2287 | + (mconsole) | |
| 2288 | + config ubd3=/home/jdike/incoming/roots/root_fs_debian22 | |
| 2371 | 2289 | |
| 2372 | − OK | |
| 2373 | − (mconsole) config eth1=mcast | |
| 2374 | − OK | |
| 2290 | + OK | |
| 2291 | + (mconsole) config eth1=mcast | |
| 2292 | + OK | |
| 2375 | 2293 | |
| 2376 | 2294 | |
| 2377 | 2295 | |
| 2378 | 2296 | |
| 2379 | 2297 | |
| 2380 | 2298 | |
| 2381 | − 10.4. remove | |
| 2299 | +10.4. remove | |
| 2300 | +------------- | |
| 2382 | 2301 | |
| 2383 | 2302 | "remove" deletes a device from the system. Its argument is just the |
| 2384 | 2303 | name of the device to be removed. The device must be idle in whatever |
| 2385 | 2304 | sense the driver considers necessary. In the case of the ubd driver, |
| 2386 | 2305 | 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 | 2309 | (mconsole) remove ubd3 |
| @@ -2397,7 +2316,8 @@ · 6 unmodified lines | ||
| 2397 | 2316 | |
| 2398 | 2317 | |
| 2399 | 2318 | |
| 2400 | − 10.5. sysrq | |
| 2319 | +10.5. sysrq | |
| 2320 | +------------ | |
| 2401 | 2321 | |
| 2402 | 2322 | This takes one argument, which is a single letter. It calls the |
| 2403 | 2323 | 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. help | |
| 2330 | +10.6. help | |
| 2331 | +----------- | |
| 2411 | 2332 | |
| 2412 | 2333 | "help" returns a string listing the valid commands and what each one |
| 2413 | 2334 | does. |
| 2414 | 2335 | |
| 2415 | 2336 | |
| 2416 | 2337 | |
| 2417 | − 10.7. cad | |
| 2338 | +10.7. cad | |
| 2339 | +---------- | |
| 2418 | 2340 | |
| 2419 | 2341 | This invokes the Ctl-Alt-Del action on init. What exactly this ends |
| 2420 | 2342 | up doing is up to /etc/inittab. Normally, it reboots the machine. |
| 2421 | 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 this | |
| 2344 | + then find the section of inittab that looks like this:: | |
| 2423 | 2345 | |
| 2424 | 2346 | |
| 2425 | 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. stop | |
| 2357 | +10.8. stop | |
| 2358 | +----------- | |
| 2436 | 2359 | |
| 2437 | 2360 | This puts the UML in a loop reading mconsole requests until a 'go' |
| 2438 | 2361 | 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. go | |
| 2374 | +10.9. go | |
| 2375 | +--------- | |
| 2452 | 2376 | |
| 2453 | 2377 | This resumes a UML after being paused by a 'stop' command. Note that |
| 2454 | 2378 | 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 | − | |
| 2465 | − 11. Kernel debugging | |
| 2389 | +11. Kernel debugging | |
| 2390 | +===================== | |
| 2466 | 2391 | |
| 2467 | 2392 | |
| 2468 | 2393 | Note: The interface that makes debugging, as described here, possible |
| @@ -2477,15 +2402,16 @@ · 8 unmodified lines | ||
| 2477 | 2402 | |
| 2478 | 2403 | |
| 2479 | 2404 | 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 | 2406 | Make sure that you enable CONFIG_DEBUGSYM and CONFIG_PT_PROXY during |
| 2482 | − the config. These will compile the kernel with -g, and enable the | |
| 2407 | + the config. These will compile the kernel with ``-g``, and enable the | |
| 2483 | 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 gdb | |
| 2413 | +11.1. Starting the kernel under gdb | |
| 2414 | +------------------------------------ | |
| 2489 | 2415 | |
| 2490 | 2416 | You can have the kernel running under the control of gdb from the |
| 2491 | 2417 | beginning by putting 'debug' on the command line. You will get an |
| @@ -2498,7 +2424,11 @@ · 6 unmodified lines | ||
| 2498 | 2424 | There is a transcript of a debugging session here <debug- |
| 2499 | 2425 | session.html> , with breakpoints being set in the scheduler and in an |
| 2500 | 2426 | interrupt handler. |
| 2501 | − 11.2. Examining sleeping processes | |
| 2427 | + | |
| 2428 | + | |
| 2429 | +11.2. Examining sleeping processes | |
| 2430 | +----------------------------------- | |
| 2431 | + | |
| 2502 | 2432 | |
| 2503 | 2433 | Not every bug is evident in the currently running process. Sometimes, |
| 2504 | 2434 | processes hang in the kernel when they shouldn't because they've |
| @@ -2516,7 +2446,7 @@ · 11 unmodified lines | ||
| 2516 | 2446 | |
| 2517 | 2447 | Now what you do is this: |
| 2518 | 2448 | |
| 2519 | − o detach from the current thread | |
| 2449 | + - detach from the current thread:: | |
| 2520 | 2450 | |
| 2521 | 2451 | |
| 2522 | 2452 | (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 in | |
| 2458 | + - attach to the thread you are interested in:: | |
| 2529 | 2459 | |
| 2530 | 2460 | |
| 2531 | 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 interest | |
| 2467 | + - look at its stack and anything else of interest:: | |
| 2538 | 2468 | |
| 2539 | 2469 | |
| 2540 | 2470 | (UML gdb) bt |
| @@ -2545,18 +2475,14 @@ · 4 unmodified lines | ||
| 2545 | 2475 | Note that you can't do anything at this point that requires that a |
| 2546 | 2476 | process execute, e.g. calling a function |
| 2547 | 2477 | |
| 2548 | − o when you're done looking at that process, reattach to the current | |
| 2549 | − thread and continue it | |
| 2478 | + - when you're done looking at that process, reattach to the current | |
| 2479 | + thread and continue it:: | |
| 2550 | 2480 | |
| 2551 | 2481 | |
| 2552 | 2482 | (UML gdb) |
| 2553 | 2483 | att 1 |
| 2554 | 2484 | |
| 2555 | 2485 | |
| 2556 | − | |
| 2557 | − | |
| 2558 | − | |
| 2559 | − | |
| 2560 | 2486 | (UML gdb) |
| 2561 | 2487 | c |
| 2562 | 2488 | |
| @@ -2569,12 +2495,13 @@ · 6 unmodified lines | ||
| 2569 | 2495 | |
| 2570 | 2496 | |
| 2571 | 2497 | |
| 2572 | − 11.3. Running ddd on UML | |
| 2498 | +11.3. Running ddd on UML | |
| 2499 | +------------------------- | |
| 2573 | 2500 | |
| 2574 | 2501 | ddd works on UML, but requires a special kludge. The process goes |
| 2575 | 2502 | like this: |
| 2576 | 2503 | |
| 2577 | − o Start ddd | |
| 2504 | + - Start ddd:: | |
| 2578 | 2505 | |
| 2579 | 2506 | |
| 2580 | 2507 | 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 the | |
| 2513 | + - With ps, get the pid of the gdb that ddd started. You can ask the | |
| 2587 | 2514 | gdb to tell you, but for some reason that confuses things and |
| 2588 | 2515 | causes a hang. |
| 2589 | 2516 | |
| 2590 | − o run UML with 'debug=parent gdb-pid=<pid>' added to the command line | |
| 2517 | + - run UML with 'debug=parent gdb-pid=<pid>' added to the command line | |
| 2591 | 2518 | - 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 like | |
| 2520 | + - type 'att 1' to the ddd gdb and you will see something like:: | |
| 2594 | 2521 | |
| 2595 | 2522 | |
| 2596 | 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 just | |
| 2532 | + - At this point, type 'c', UML will boot up, and you can use ddd just | |
| 2606 | 2533 | as you do on any other process. |
| 2607 | 2534 | |
| 2608 | 2535 | |
| 2609 | 2536 | |
| 2610 | − 11.4. Debugging modules | |
| 2537 | +11.4. Debugging modules | |
| 2538 | +------------------------ | |
| 2539 | + | |
| 2611 | 2540 | |
| 2612 | 2541 | gdb has support for debugging code which is dynamically loaded into |
| 2613 | 2542 | the process. This support is what is needed to debug kernel modules |
| @@ -2629,7 +2558,8 @@ · 15 unmodified lines | ||
| 2629 | 2558 | |
| 2630 | 2559 | |
| 2631 | 2560 | 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 | 2563 | set MODULE_PATHS { |
| 2634 | 2564 | "fat" "/usr/src/uml/linux-2.4.18/fs/fat/fat.o" |
| 2635 | 2565 | "isofs" "/usr/src/uml/linux-2.4.18/fs/isofs/isofs.o" |
| @@ -2641,9 +2571,7 @@ · 5 unmodified lines | ||
| 2641 | 2571 | |
| 2642 | 2572 | You change that to list the names and paths of the modules that you |
| 2643 | 2573 | are going to debug. Then you run it from the toplevel directory of |
| 2644 | − your UML pool and it basically tells you what to do: | |
| 2645 | − | |
| 2646 | − | |
| 2574 | + your UML pool and it basically tells you what to do:: | |
| 2647 | 2575 | |
| 2648 | 2576 | |
| 2649 | 2577 | ******** GDB pid is 21903 ******** |
| @@ -2666,7 +2594,7 @@ · 16 unmodified lines | ||
| 2666 | 2594 | |
| 2667 | 2595 | |
| 2668 | 2596 | 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 | 2600 | Attaching to program: /home/jdike/linux/2.4/um/./linux, process 1 |
| @@ -2678,63 +2606,48 @@ · 5 unmodified lines | ||
| 2678 | 2606 | |
| 2679 | 2607 | |
| 2680 | 2608 | At this point, you debug normally. When you insmod something, the |
| 2681 | − expect magic will kick in and you'll see something like: | |
| 2682 | − | |
| 2683 | − | |
| 2684 | − | |
| 2685 | − | |
| 2686 | − | |
| 2687 | − | |
| 2688 | − | |
| 2689 | − | |
| 2690 | − | |
| 2691 | − | |
| 2692 | − | |
| 2693 | − | |
| 2694 | − | |
| 2695 | − | |
| 2696 | − | |
| 2697 | − | |
| 2698 | − | |
| 2699 | − *** Module hostfs loaded *** | |
| 2700 | − Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs", | |
| 2701 | − mod_user=0x8070e00) at module.c:349 | |
| 2702 | − 349 char *name, *n_name, *name_tmp = NULL; | |
| 2703 | − (UML gdb) finish | |
| 2704 | − Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs", | |
| 2705 | − mod_user=0x8070e00) at module.c:349 | |
| 2706 | − 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411 | |
| 2707 | − 411 else res = EXECUTE_SYSCALL(syscall, regs); | |
| 2708 | − Value returned is $1 = 0 | |
| 2709 | − (UML gdb) | |
| 2710 | − p/x (int)module_list + module_list->size_of_struct | |
| 2711 | − | |
| 2712 | − $2 = 0xa9021054 | |
| 2713 | − (UML gdb) symbol-file ./linux | |
| 2714 | − Load new symbol table from "./linux"? (y or n) y | |
| 2715 | − Reading symbols from ./linux... | |
| 2716 | − done. | |
| 2717 | − (UML gdb) | |
| 2718 | − add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054 | |
| 2719 | − | |
| 2720 | − add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at | |
| 2721 | − .text_addr = 0xa9021054 | |
| 2722 | − (y or n) y | |
| 2723 | − | |
| 2724 | − Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o... | |
| 2725 | − done. | |
| 2726 | − (UML gdb) p *module_list | |
| 2727 | − $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs", | |
| 2728 | − size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1, | |
| 2729 | − nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0, | |
| 2730 | − init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>, | |
| 2731 | − ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0, | |
| 2732 | − persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0, | |
| 2733 | − kallsyms_end = 0x0, | |
| 2734 | − archdata_start = 0x1b855 <Address 0x1b855 out of bounds>, | |
| 2735 | − archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>, | |
| 2736 | − kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>} | |
| 2737 | − >> Finished loading symbols for hostfs ... | |
| 2609 | + expect magic will kick in and you'll see something like:: | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + *** Module hostfs loaded *** | |
| 2613 | + Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs", | |
| 2614 | + mod_user=0x8070e00) at module.c:349 | |
| 2615 | + 349 char *name, *n_name, *name_tmp = NULL; | |
| 2616 | + (UML gdb) finish | |
| 2617 | + Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs", | |
| 2618 | + mod_user=0x8070e00) at module.c:349 | |
| 2619 | + 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411 | |
| 2620 | + 411 else res = EXECUTE_SYSCALL(syscall, regs); | |
| 2621 | + Value returned is $1 = 0 | |
| 2622 | + (UML gdb) | |
| 2623 | + p/x (int)module_list + module_list->size_of_struct | |
| 2624 | + | |
| 2625 | + $2 = 0xa9021054 | |
| 2626 | + (UML gdb) symbol-file ./linux | |
| 2627 | + Load new symbol table from "./linux"? (y or n) y | |
| 2628 | + Reading symbols from ./linux... | |
| 2629 | + done. | |
| 2630 | + (UML gdb) | |
| 2631 | + add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054 | |
| 2632 | + | |
| 2633 | + add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at | |
| 2634 | + .text_addr = 0xa9021054 | |
| 2635 | + (y or n) y | |
| 2636 | + | |
| 2637 | + Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o... | |
| 2638 | + done. | |
| 2639 | + (UML gdb) p *module_list | |
| 2640 | + $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs", | |
| 2641 | + size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1, | |
| 2642 | + nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0, | |
| 2643 | + init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>, | |
| 2644 | + ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0, | |
| 2645 | + persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0, | |
| 2646 | + kallsyms_end = 0x0, | |
| 2647 | + archdata_start = 0x1b855 <Address 0x1b855 out of bounds>, | |
| 2648 | + archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>, | |
| 2649 | + kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>} | |
| 2650 | + >> Finished loading symbols for hostfs ... | |
| 2738 | 2651 | |
| 2739 | 2652 | |
| 2740 | 2653 | |
| @@ -2744,7 +2657,7 @@ · 3 unmodified lines | ||
| 2744 | 2657 | |
| 2745 | 2658 | |
| 2746 | 2659 | 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 | 2663 | (UML gdb) p module_list |
| @@ -2758,12 +2671,12 @@ · 7 unmodified lines | ||
| 2758 | 2671 | the name fields until find the module you want to debug. Take the |
| 2759 | 2672 | address of that structure, and add module.size_of_struct (which in |
| 2760 | 2673 | 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) | |
| 2766 | − printf "%#x\n", (int)module_list module_list->size_of_struct | |
| 2678 | + (UML gdb) | |
| 2679 | + printf "%#x\n", (int)module_list module_list->size_of_struct | |
| 2767 | 2680 | |
| 2768 | 2681 | |
| 2769 | 2682 | |
| @@ -2771,7 +2684,7 @@ · 1 unmodified line | ||
| 2771 | 2684 | The offset from the module start occasionally changes (before 2.4.0, |
| 2772 | 2685 | it was module.size_of_struct + 4), so it's a good idea to check the |
| 2773 | 2686 | init and cleanup addresses once in a while, as describe below. Now |
| 2774 | − do: | |
| 2687 | + do:: | |
| 2775 | 2688 | |
| 2776 | 2689 | |
| 2777 | 2690 | (UML gdb) |
| @@ -2786,7 +2699,7 @@ · 8 unmodified lines | ||
| 2786 | 2699 | If there's any doubt that you got the offset right, like breakpoints |
| 2787 | 2700 | appear not to work, or they're appearing in the wrong place, you can |
| 2788 | 2701 | 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 | 2705 | init = 0x588066b0 <init_hostfs>, cleanup = 0x588066c0 <exit_hostfs> |
| @@ -2801,7 +2714,7 @@ · 8 unmodified lines | ||
| 2801 | 2714 | |
| 2802 | 2715 | When you want to load in a new version of the module, you need to get |
| 2803 | 2716 | 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 | 2720 | (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 | 2728 | (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 kernel | |
| 2739 | +11.5. Attaching gdb to the kernel | |
| 2740 | +---------------------------------- | |
| 2827 | 2741 | |
| 2828 | 2742 | If you don't have the kernel running under gdb, you can attach gdb to |
| 2829 | 2743 | 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 | 2746 | 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 | 2754 | host% kill -USR1 20093 |
| @@ -2845,7 +2760,7 @@ · 5 unmodified lines | ||
| 2845 | 2760 | |
| 2846 | 2761 | |
| 2847 | 2762 | 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 | 2766 | (mconsole) (mconsole) config gdb=xterm |
| @@ -2857,7 +2772,8 @@ · 5 unmodified lines | ||
| 2857 | 2772 | |
| 2858 | 2773 | |
| 2859 | 2774 | |
| 2860 | − 11.6. Using alternate debuggers | |
| 2775 | +11.6. Using alternate debuggers | |
| 2776 | +-------------------------------- | |
| 2861 | 2777 | |
| 2862 | 2778 | UML has support for attaching to an already running debugger rather |
| 2863 | 2779 | than starting gdb itself. This is present in CVS as of 17 Apr 2001. |
| @@ -2886,7 +2802,7 @@ · 22 unmodified lines | ||
| 2886 | 2802 | An example of an alternate debugger is strace. You can strace the |
| 2887 | 2803 | actual kernel as follows: |
| 2888 | 2804 | |
| 2889 | − o Run the following in a shell | |
| 2805 | + - Run the following in a shell:: | |
| 2890 | 2806 | |
| 2891 | 2807 | |
| 2892 | 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 out | |
| 2813 | + - Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out | |
| 2898 | 2814 | by the previous command |
| 2899 | 2815 | |
| 2900 | − o Hit return in the shell, and UML will start running, and strace | |
| 2816 | + - Hit return in the shell, and UML will start running, and strace | |
| 2901 | 2817 | output will start accumulating in the output file. |
| 2902 | 2818 | |
| 2903 | − Note that this is different from running | |
| 2819 | + Note that this is different from running:: | |
| 2904 | 2820 | |
| 2905 | 2821 | |
| 2906 | 2822 | host% strace ./linux |
| @@ -2917,95 +2833,57 @@ · 10 unmodified lines | ||
| 2917 | 2833 | |
| 2918 | 2834 | |
| 2919 | 2835 | |
| 2920 | − 12. Kernel debugging examples | |
| 2836 | +12. Kernel debugging examples | |
| 2837 | +============================== | |
| 2921 | 2838 | |
| 2922 | − 12.1. The case of the hung fsck | |
| 2839 | +12.1. The case of the hung fsck | |
| 2840 | +-------------------------------- | |
| 2923 | 2841 | |
| 2924 | 2842 | When booting up the kernel, fsck failed, and dropped me into a shell |
| 2925 | − to fix things up. I ran fsck -y, which hung: | |
| 2926 | − | |
| 2927 | − | |
| 2928 | − | |
| 2929 | − | |
| 2930 | − | |
| 2931 | − | |
| 2932 | − | |
| 2933 | − | |
| 2934 | − | |
| 2935 | − | |
| 2936 | − | |
| 2937 | − | |
| 2938 | − | |
| 2939 | − | |
| 2940 | − | |
| 2941 | − | |
| 2942 | − | |
| 2943 | − | |
| 2944 | − | |
| 2945 | − | |
| 2946 | − | |
| 2947 | − | |
| 2948 | − | |
| 2949 | − | |
| 2950 | − | |
| 2843 | + to fix things up. I ran fsck -y, which hung:: | |
| 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 | − | |
| 2962 | − | |
| 2963 | − Setting hostname uml [ OK ] | |
| 2964 | − Checking root filesystem | |
| 2965 | − /dev/fhd0 was not cleanly unmounted, check forced. | |
| 2966 | − Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. | |
| 2967 | − | |
| 2968 | − /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. | |
| 2969 | − (i.e., without -a or -p options) | |
| 2970 | − [ FAILED ] | |
| 2971 | − | |
| 2972 | − *** An error occurred during the file system check. | |
| 2973 | − *** Dropping you to a shell; the system will reboot | |
| 2974 | − *** when you leave the shell. | |
| 2975 | − Give root password for maintenance | |
| 2976 | − (or type Control-D for normal startup): | |
| 2977 | − | |
| 2978 | − [root@uml /root]# fsck -y /dev/fhd0 | |
| 2979 | − fsck -y /dev/fhd0 | |
| 2980 | − Parallelizing fsck version 1.14 (9-Jan-1999) | |
| 2981 | − e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09 | |
| 2982 | − /dev/fhd0 contains a file system with errors, check forced. | |
| 2983 | − Pass 1: Checking inodes, blocks, and sizes | |
| 2984 | − Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes | |
| 2985 | − | |
| 2986 | − Inode 19780, i_blocks is 1548, should be 540. Fix? yes | |
| 2987 | − | |
| 2988 | − Pass 2: Checking directory structure | |
| 2989 | − Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes | |
| 2990 | − | |
| 2991 | − Directory inode 11858, block 0, offset 0: directory corrupted | |
| 2992 | − Salvage? yes | |
| 2993 | − | |
| 2994 | − Missing '.' in directory inode 11858. | |
| 2995 | − Fix? yes | |
| 2996 | − | |
| 2997 | − Missing '..' in directory inode 11858. | |
| 2998 | − Fix? yes | |
| 2999 | − | |
| 3000 | − | |
| 3001 | − | |
| 2880 | + Missing '..' in directory inode 11858. | |
| 2881 | + Fix? yes | |
| 3002 | 2882 | |
| 3003 | 2883 | |
| 3004 | 2884 | The standard drill in this sort of situation is to fire up gdb on the |
| 3005 | 2885 | signal thread, which, in this case, was pid 1935. In another window, |
| 3006 | − I run gdb and attach pid 1935. | |
| 3007 | − | |
| 3008 | − | |
| 2886 | + I run gdb and attach pid 1935:: | |
| 3009 | 2887 | |
| 3010 | 2888 | |
| 3011 | 2889 | ~/linux/2.3.26/um 1016: gdb linux |
| @@ -3022,11 +2900,7 @@ · 10 unmodified lines | ||
| 3022 | 2900 | 0x100756d9 in __wait4 () |
| 3023 | 2901 | |
| 3024 | 2902 | |
| 3025 | − | |
| 3026 | − | |
| 3027 | − | |
| 3028 | − | |
| 3029 | − Let's see what's currently running: | |
| 2903 | + Let's see what's currently running:: | |
| 3030 | 2904 | |
| 3031 | 2905 | |
| 3032 | 2906 | |
| @@ -3041,7 +2915,7 @@ · 8 unmodified lines | ||
| 3041 | 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 | 2945 | The interesting things here are the fact that its .thread.syscall.id |
| 3074 | 2946 | is __NR_write (see the big switch in arch/um/kernel/syscall_kern.c or |
| 3075 | 2947 | the defines in include/asm-um/arch/unistd.h), and that it never |
| @@ -3081,30 +2953,20 @@ · 5 unmodified lines | ||
| 3081 | 2953 | The fact that it never returned from write means that its stack should |
| 3082 | 2954 | be fairly interesting. Its pid is 1980 (.thread.extern_pid). That |
| 3083 | 2955 | process is being ptraced by the signal thread, so it must be detached |
| 3084 | − before gdb can attach it: | |
| 3085 | − | |
| 3086 | − | |
| 3087 | − | |
| 3088 | − | |
| 3089 | − | |
| 3090 | − | |
| 2956 | + before gdb can attach it:: | |
| 3091 | 2957 | |
| 3092 | 2958 | |
| 3093 | 2959 | |
| 2960 | + (gdb) call detach(1980) | |
| 3094 | 2961 | |
| 3095 | − (gdb) call detach(1980) | |
| 3096 | − | |
| 3097 | − Program received signal SIGSEGV, Segmentation fault. | |
| 3098 | − <function called from gdb> | |
| 3099 | − The program being debugged stopped while in a function called from GDB. | |
| 3100 | − When the function (detach) is done executing, GDB will silently | |
| 3101 | − stop (instead of continuing to evaluate the expression containing | |
| 3102 | − the function call). | |
| 3103 | − (gdb) call detach(1980) | |
| 3104 | − $15 = 0 | |
| 3105 | − | |
| 3106 | − | |
| 3107 | − | |
| 2962 | + Program received signal SIGSEGV, Segmentation fault. | |
| 2963 | + <function called from gdb> | |
| 2964 | + The program being debugged stopped while in a function called from GDB. | |
| 2965 | + When the function (detach) is done executing, GDB will silently | |
| 2966 | + stop (instead of continuing to evaluate the expression containing | |
| 2967 | + the function call). | |
| 2968 | + (gdb) call detach(1980) | |
| 2969 | + $15 = 0 | |
| 3108 | 2970 | |
| 3109 | 2971 | |
| 3110 | 2972 | The first detach segfaults for some reason, and the second one |
| @@ -3112,7 +2974,7 @@ · 1 unmodified line | ||
| 3112 | 2974 | |
| 3113 | 2975 | |
| 3114 | 2976 | 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 | 2980 | (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 0x50000800 | |
| 3021 | + - The first faulting address (frame 11) is 0x50000800:: | |
| 3160 | 3022 | |
| 3161 | − (gdb) p (void *)1342179328 | |
| 3162 | − $16 = (void *) 0x50000800 | |
| 3023 | + (gdb) p (void *)1342179328 | |
| 3024 | + $16 = (void *) 0x50000800 | |
| 3163 | 3025 | |
| 3164 | 3026 | |
| 3165 | 3027 | |
| @@ -3175,7 +3037,7 @@ · 9 unmodified lines | ||
| 3175 | 3037 | |
| 3176 | 3038 | However, the more immediate problem is that second segfault and I'm |
| 3177 | 3039 | 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 | 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 | 3092 | (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 | 3104 | (gdb) i line *$20 |
| @@ -3249,7 +3111,7 @@ · 6 unmodified lines | ||
| 3249 | 3111 | |
| 3250 | 3112 | |
| 3251 | 3113 | 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 | 3150 | 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:50 | |
| 3294 | − 50 handle_mm_fault(current, vma, address, is_write); | |
| 3295 | − (gdb) call pgd_offset_proc(vma->vm_mm, address) | |
| 3296 | − $22 = (pgd_t *) 0x80a548c | |
| 3155 | + #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:50 | |
| 3156 | + 50 handle_mm_fault(current, vma, address, is_write); | |
| 3157 | + (gdb) call pgd_offset_proc(vma->vm_mm, address) | |
| 3158 | + $22 = (pgd_t *) 0x80a548c | |
| 3297 | 3159 | |
| 3298 | 3160 | |
| 3299 | 3161 | |
| 3300 | 3162 | |
| 3301 | 3163 | |
| 3302 | 3164 | 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 | 3168 | (gdb) p *vma |
| @@ -3325,12 +3187,9 @@ · 18 unmodified lines | ||
| 3325 | 3187 | |
| 3326 | 3188 | |
| 3327 | 3189 | |
| 3328 | − | |
| 3329 | − | |
| 3330 | 3190 | This also pretty bogus. With all of the 0x80xxxxx and 0xaffffxxx |
| 3331 | 3191 | addresses, this is looking like a stack was plonked down on top of |
| 3332 | − these structures. Maybe it's a stack overflow from the next page: | |
| 3333 | − | |
| 3192 | + these structures. Maybe it's a stack overflow from the next page:: | |
| 3334 | 3193 | |
| 3335 | 3194 | |
| 3336 | 3195 | (gdb) p vma |
| @@ -3338,52 +3197,36 @@ · 1 unmodified line | ||
| 3338 | 3197 | |
| 3339 | 3198 | |
| 3340 | 3199 | |
| 3341 | − | |
| 3342 | − | |
| 3343 | 3200 | That's towards the lower quarter of the page, so that would have to |
| 3344 | − have been pretty heavy stack overflow: | |
| 3345 | − | |
| 3346 | − | |
| 3347 | − | |
| 3348 | − | |
| 3349 | − | |
| 3350 | − | |
| 3351 | − | |
| 3352 | − | |
| 3353 | − | |
| 3354 | − | |
| 3355 | − | |
| 3356 | − | |
| 3357 | − | |
| 3358 | − | |
| 3359 | − (gdb) x/100x $25 | |
| 3360 | − 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c | |
| 3361 | − 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000 | |
| 3362 | − 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a | |
| 3363 | − 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000 | |
| 3364 | − 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3365 | − 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3366 | − 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000 | |
| 3367 | − 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3368 | − 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3369 | − 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3370 | − 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3371 | − 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3372 | − 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3373 | − 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3374 | − 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3375 | − 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3376 | − 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000 | |
| 3377 | − 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3378 | − 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3379 | − 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3380 | − 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3381 | − 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3382 | − 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3383 | − 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3384 | − 0x507d25b4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3385 | − | |
| 3386 | − | |
| 3201 | + have been pretty heavy stack overflow:: | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + (gdb) x/100x $25 | |
| 3205 | + 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c | |
| 3206 | + 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000 | |
| 3207 | + 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a | |
| 3208 | + 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000 | |
| 3209 | + 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3210 | + 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3211 | + 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000 | |
| 3212 | + 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3213 | + 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3214 | + 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3215 | + 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3216 | + 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3217 | + 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3218 | + 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3219 | + 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3220 | + 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3221 | + 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000 | |
| 3222 | + 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3223 | + 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3224 | + 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3225 | + 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3226 | + 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3227 | + 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3228 | + 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3229 | + 0x507d25b4: 0x00000000 0x00000000 0x00000000 0x00000000 | |
| 3387 | 3230 | |
| 3388 | 3231 | |
| 3389 | 3232 | |
| @@ -3399,65 +3242,53 @@ · 9 unmodified lines | ||
| 3399 | 3242 | on will be somewhat clearer. |
| 3400 | 3243 | |
| 3401 | 3244 | |
| 3402 | − 12.2. Episode 2: The case of the hung fsck | |
| 3245 | +12.2. Episode 2: The case of the hung fsck | |
| 3246 | +------------------------------------------- | |
| 3403 | 3247 | |
| 3404 | 3248 | After setting a trap in the SEGV handler for accesses to the signal |
| 3405 | 3249 | thread's stack, I reran the kernel. |
| 3406 | 3250 | |
| 3407 | 3251 | |
| 3408 | − fsck hung again, this time by hitting the trap: | |
| 3409 | − | |
| 3410 | − | |
| 3252 | + fsck hung again, this time by hitting the trap:: | |
| 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 | − | |
| 3423 | − | |
| 3424 | − | |
| 3425 | − Setting hostname uml [ OK ] | |
| 3426 | − Checking root filesystem | |
| 3427 | − /dev/fhd0 contains a file system with errors, check forced. | |
| 3428 | − Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. | |
| 3429 | − | |
| 3430 | − /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. | |
| 3431 | − (i.e., without -a or -p options) | |
| 3432 | − [ FAILED ] | |
| 3433 | − | |
| 3434 | − *** An error occurred during the file system check. | |
| 3435 | − *** Dropping you to a shell; the system will reboot | |
| 3436 | − *** when you leave the shell. | |
| 3437 | − Give root password for maintenance | |
| 3438 | − (or type Control-D for normal startup): | |
| 3439 | − | |
| 3440 | − [root@uml /root]# fsck -y /dev/fhd0 | |
| 3441 | − fsck -y /dev/fhd0 | |
| 3442 | − Parallelizing fsck version 1.14 (9-Jan-1999) | |
| 3443 | − e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09 | |
| 3444 | − /dev/fhd0 contains a file system with errors, check forced. | |
| 3445 | − Pass 1: Checking inodes, blocks, and sizes | |
| 3446 | − Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes | |
| 3447 | − | |
| 3448 | − Pass 2: Checking directory structure | |
| 3449 | − Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes | |
| 3450 | − | |
| 3451 | − Directory inode 11858, block 0, offset 0: directory corrupted | |
| 3452 | − Salvage? yes | |
| 3453 | − | |
| 3454 | − Missing '.' in directory inode 11858. | |
| 3455 | − Fix? yes | |
| 3456 | − | |
| 3457 | − Missing '..' in directory inode 11858. | |
| 3458 | − Fix? yes | |
| 3459 | − | |
| 3460 | − Untested (4127) [100fe44c]: trap_kern.c line 31 | |
| 3291 | + Untested (4127) [100fe44c]: trap_kern.c line 31 | |
| 3461 | 3292 | |
| 3462 | 3293 | |
| 3463 | 3294 | |
| @@ -3465,7 +3296,7 @@ · 1 unmodified line | ||
| 3465 | 3296 | |
| 3466 | 3297 | I need to get the signal thread to detach from pid 4127 so that I can |
| 3467 | 3298 | 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 | 3302 | kill -USR1 4127 |
| @@ -3474,31 +3305,20 @@ · 2 unmodified lines | ||
| 3474 | 3305 | |
| 3475 | 3306 | |
| 3476 | 3307 | |
| 3477 | − Now I can run gdb on it: | |
| 3478 | − | |
| 3479 | − | |
| 3480 | − | |
| 3481 | − | |
| 3482 | − | |
| 3483 | − | |
| 3484 | − | |
| 3308 | + Now I can run gdb on it:: | |
| 3485 | 3309 | |
| 3486 | 3310 | |
| 3487 | − | |
| 3488 | − | |
| 3489 | − | |
| 3490 | − | |
| 3491 | − ~/linux/2.3.26/um 1034: gdb linux | |
| 3492 | − GNU gdb 4.17.0.11 with Linux support | |
| 3493 | − Copyright 1998 Free Software Foundation, Inc. | |
| 3494 | − GDB is free software, covered by the GNU General Public License, and you are | |
| 3495 | − welcome to change it and/or distribute copies of it under certain conditions. | |
| 3496 | − Type "show copying" to see the conditions. | |
| 3497 | − There is absolutely no warranty for GDB. Type "show warranty" for details. | |
| 3498 | − This GDB was configured as "i386-redhat-linux"... | |
| 3499 | − (gdb) att 4127 | |
| 3500 | − Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127 | |
| 3501 | − 0x10075891 in __libc_nanosleep () | |
| 3311 | + ~/linux/2.3.26/um 1034: gdb linux | |
| 3312 | + GNU gdb 4.17.0.11 with Linux support | |
| 3313 | + Copyright 1998 Free Software Foundation, Inc. | |
| 3314 | + GDB is free software, covered by the GNU General Public License, and you are | |
| 3315 | + welcome to change it and/or distribute copies of it under certain conditions. | |
| 3316 | + Type "show copying" to see the conditions. | |
| 3317 | + There is absolutely no warranty for GDB. Type "show warranty" for details. | |
| 3318 | + This GDB was configured as "i386-redhat-linux"... | |
| 3319 | + (gdb) att 4127 | |
| 3320 | + Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127 | |
| 3321 | + 0x10075891 in __libc_nanosleep () | |
| 3502 | 3322 | |
| 3503 | 3323 | |
| 3504 | 3324 | |
| @@ -3506,7 +3326,7 @@ · 1 unmodified line | ||
| 3506 | 3326 | |
| 3507 | 3327 | The backtrace shows that it was in a write and that the fault address |
| 3508 | 3328 | (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 | 3332 | (gdb) bt |
| @@ -3540,58 +3360,48 @@ · 27 unmodified lines | ||
| 3540 | 3360 | |
| 3541 | 3361 | |
| 3542 | 3362 | |
| 3543 | − | |
| 3544 | − | |
| 3545 | 3363 | Going up the stack to the segv_handler frame and looking at where in |
| 3546 | 3364 | the code the access happened shows that it happened near line 110 of |
| 3547 | − block_dev.c: | |
| 3548 | − | |
| 3549 | − | |
| 3550 | − | |
| 3551 | − | |
| 3552 | − | |
| 3553 | − | |
| 3554 | − | |
| 3555 | − | |
| 3556 | − | |
| 3557 | − (gdb) up | |
| 3558 | − #1 0x1007584d in __sleep (seconds=1000000) | |
| 3559 | − at ../sysdeps/unix/sysv/linux/sleep.c:78 | |
| 3560 | − ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory. | |
| 3561 | − (gdb) | |
| 3562 | − #2 0x1006ce9a in stop () at user_util.c:191 | |
| 3563 | − 191 while(1) sleep(1000000); | |
| 3564 | − (gdb) | |
| 3565 | − #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31 | |
| 3566 | − 31 KERN_UNTESTED(); | |
| 3567 | − (gdb) | |
| 3568 | − #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174 | |
| 3569 | − 174 segv(sc->cr2, sc->err & 2); | |
| 3570 | − (gdb) p *sc | |
| 3571 | − $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43, | |
| 3572 | − __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484, | |
| 3573 | − esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14, | |
| 3574 | − err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070, | |
| 3575 | − esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0, | |
| 3576 | − cr2 = 1342179328} | |
| 3577 | − (gdb) p (void *)268550834 | |
| 3578 | − $2 = (void *) 0x1001c2b2 | |
| 3579 | − (gdb) i sym $2 | |
| 3580 | − block_write + 1090 in section .text | |
| 3581 | − (gdb) i line *$2 | |
| 3582 | − Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h" | |
| 3583 | − starts at address 0x1001c2a1 <block_write+1073> | |
| 3584 | − and ends at 0x1001c2bf <block_write+1103>. | |
| 3585 | − (gdb) i line *0x1001c2c0 | |
| 3586 | − Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103> | |
| 3587 | − and ends at 0x1001c2e3 <block_write+1139>. | |
| 3588 | − | |
| 3589 | − | |
| 3365 | + block_dev.c:: | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + (gdb) up | |
| 3370 | + #1 0x1007584d in __sleep (seconds=1000000) | |
| 3371 | + at ../sysdeps/unix/sysv/linux/sleep.c:78 | |
| 3372 | + ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory. | |
| 3373 | + (gdb) | |
| 3374 | + #2 0x1006ce9a in stop () at user_util.c:191 | |
| 3375 | + 191 while(1) sleep(1000000); | |
| 3376 | + (gdb) | |
| 3377 | + #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31 | |
| 3378 | + 31 KERN_UNTESTED(); | |
| 3379 | + (gdb) | |
| 3380 | + #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174 | |
| 3381 | + 174 segv(sc->cr2, sc->err & 2); | |
| 3382 | + (gdb) p *sc | |
| 3383 | + $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43, | |
| 3384 | + __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484, | |
| 3385 | + esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14, | |
| 3386 | + err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070, | |
| 3387 | + esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0, | |
| 3388 | + cr2 = 1342179328} | |
| 3389 | + (gdb) p (void *)268550834 | |
| 3390 | + $2 = (void *) 0x1001c2b2 | |
| 3391 | + (gdb) i sym $2 | |
| 3392 | + block_write + 1090 in section .text | |
| 3393 | + (gdb) i line *$2 | |
| 3394 | + Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h" | |
| 3395 | + starts at address 0x1001c2a1 <block_write+1073> | |
| 3396 | + and ends at 0x1001c2bf <block_write+1103>. | |
| 3397 | + (gdb) i line *0x1001c2c0 | |
| 3398 | + Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103> | |
| 3399 | + and ends at 0x1001c2e3 <block_write+1139>. | |
| 3590 | 3400 | |
| 3591 | 3401 | |
| 3592 | 3402 | |
| 3593 | 3403 | 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 | 3407 | 107 count -= chars; |
| @@ -3601,10 +3411,8 @@ · 3 unmodified lines | ||
| 3601 | 3411 | |
| 3602 | 3412 | |
| 3603 | 3413 | |
| 3604 | − | |
| 3605 | − | |
| 3606 | 3414 | 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 | 3418 | p = offset + bh->b_data; |
| @@ -3615,24 +3423,22 @@ · 4 unmodified lines | ||
| 3615 | 3423 | |
| 3616 | 3424 | I need to figure out what bh is, and it just so happens that bh is |
| 3617 | 3425 | passed as an argument to mark_buffer_uptodate and mark_buffer_dirty a |
| 3618 | − few lines later, so I do a little disassembly: | |
| 3619 | − | |
| 3620 | − | |
| 3426 | + few lines later, so I do a little disassembly:: | |
| 3621 | 3427 | |
| 3622 | 3428 | |
| 3623 | − (gdb) disas 0x1001c2bf 0x1001c2e0 | |
| 3624 | − Dump of assembler code from 0x1001c2bf to 0x1001c2d0: | |
| 3625 | − 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp) | |
| 3626 | − 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx | |
| 3627 | − 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx) | |
| 3628 | − 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx) | |
| 3629 | − 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx | |
| 3630 | − 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx | |
| 3631 | − 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139> | |
| 3632 | − 0x1001c2d8 <block_write+1128>: pushl $0x0 | |
| 3633 | − 0x1001c2da <block_write+1130>: pushl %edx | |
| 3634 | − 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty> | |
| 3635 | − End of assembler dump. | |
| 3429 | + (gdb) disas 0x1001c2bf 0x1001c2e0 | |
| 3430 | + Dump of assembler code from 0x1001c2bf to 0x1001c2d0: | |
| 3431 | + 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp) | |
| 3432 | + 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx | |
| 3433 | + 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx) | |
| 3434 | + 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx) | |
| 3435 | + 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx | |
| 3436 | + 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx | |
| 3437 | + 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139> | |
| 3438 | + 0x1001c2d8 <block_write+1128>: pushl $0x0 | |
| 3439 | + 0x1001c2da <block_write+1130>: pushl %edx | |
| 3440 | + 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty> | |
| 3441 | + End of assembler dump. | |
| 3636 | 3442 | |
| 3637 | 3443 | |
| 3638 | 3444 | |
| @@ -3640,7 +3446,7 @@ · 1 unmodified line | ||
| 3640 | 3446 | |
| 3641 | 3447 | At that point, bh is in %edx (address 0x1001c2da), which is calculated |
| 3642 | 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 | 3452 | (gdb) p (void *)1342631484 |
| @@ -3657,7 +3463,7 @@ · 10 unmodified lines | ||
| 3657 | 3463 | |
| 3658 | 3464 | |
| 3659 | 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 | 3469 | (gdb) p *((struct buffer_head *)0x50100200) |
| @@ -3682,18 +3488,18 @@ · 18 unmodified lines | ||
| 3682 | 3488 | |
| 3683 | 3489 | The b_page field is a pointer to the page_struct representing the |
| 3684 | 3490 | 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_page | |
| 3690 | − $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0, | |
| 3691 | − index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = { | |
| 3692 | − next = 0x50008460, prev = 0x50019350}, wait = { | |
| 3693 | − lock = <optimized out or zero length>, task_list = {next = 0x50004024, | |
| 3694 | − prev = 0x50004024}, __magic = 1342193708, __creator = 0}, | |
| 3695 | − pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280, | |
| 3696 | − zone = 0x100c5160} | |
| 3495 | + (gdb) p *$13.b_page | |
| 3496 | + $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0, | |
| 3497 | + index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = { | |
| 3498 | + next = 0x50008460, prev = 0x50019350}, wait = { | |
| 3499 | + lock = <optimized out or zero length>, task_list = {next = 0x50004024, | |
| 3500 | + prev = 0x50004024}, __magic = 1342193708, __creator = 0}, | |
| 3501 | + pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280, | |
| 3502 | + zone = 0x100c5160} | |
| 3697 | 3503 | |
| 3698 | 3504 | |
| 3699 | 3505 | |
| @@ -3702,7 +3508,7 @@ · 2 unmodified lines | ||
| 3702 | 3508 | Some sanity-checking: the virtual field shows the "virtual" address of |
| 3703 | 3509 | this page, which in this kernel is the same as its "physical" address, |
| 3704 | 3510 | 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 | 3527 | 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 | 3531 | (gdb) p (void *)132 |
| @@ -3739,7 +3545,7 @@ · 13 unmodified lines | ||
| 3739 | 3545 | |
| 3740 | 3546 | |
| 3741 | 3547 | 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 | 3570 | 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 work | |
| 3597 | +13. 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 source | |
| 3603 | +13.1. Strange compilation errors when you build from source | |
| 3604 | +------------------------------------------------------------ | |
| 3797 | 3605 | |
| 3798 | 3606 | As of test11, it is necessary to have "ARCH=um" in the environment or |
| 3799 | 3607 | on the make command line for all steps in building UML, including |
| 3800 | 3608 | clean, distclean, or mrproper, config, menuconfig, or xconfig, dep, |
| 3801 | 3609 | and linux. If you forget for any of them, the i386 build seems to |
| 3802 | − contaminate the UML build. If this happens, start from scratch with | |
| 3610 | + contaminate the UML build. If this happens, start from scratch with:: | |
| 3803 | 3611 | |
| 3804 | 3612 | |
| 3805 | 3613 | host% |
| @@ -3811,7 +3619,7 @@ · 5 unmodified lines | ||
| 3811 | 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 | 3625 | 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- | |
| 3828 | − tem | |
| 3635 | +13.3. A variety of panics and hangs with /tmp on a reiserfs filesystem | |
| 3636 | +----------------------------------------------------------------------- | |
| 3829 | 3637 | |
| 3830 | 3638 | I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27. |
| 3831 | − Panics preceded by | |
| 3639 | + Panics preceded by:: | |
| 3832 | 3640 | |
| 3833 | 3641 | |
| 3834 | 3642 | 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 filesystem | |
| 3665 | +13.5. UML doesn't work when /tmp is an NFS filesystem | |
| 3666 | +------------------------------------------------------ | |
| 3858 | 3667 | |
| 3859 | 3668 | This seems to be a similar situation with the ReiserFS problem above. |
| 3860 | 3669 | Some versions of NFS seems not to handle mmap correctly, which UML |
| 3861 | 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 support | |
| 3673 | +13.6. UML hangs on boot when compiled with gprof support | |
| 3674 | +--------------------------------------------------------- | |
| 3865 | 3675 | |
| 3866 | 3676 | If you build UML with gprof support and, early in the boot, it does |
| 3867 | − this | |
| 3677 | + this:: | |
| 3868 | 3678 | |
| 3869 | 3679 | |
| 3870 | 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 startup | |
| 3691 | +13.7. syslogd dies with a SIGTERM on startup | |
| 3692 | +--------------------------------------------- | |
| 3882 | 3693 | |
| 3883 | 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 | 3698 | /etc/rc2.d/S10sysklogd: line 49: 93 Terminated |
| @@ -3891,23 +3702,21 @@ · 3 unmodified lines | ||
| 3891 | 3702 | |
| 3892 | 3703 | |
| 3893 | 3704 | This is a syslogd bug. There's a race between a parent process |
| 3894 | − installing a signal handler and its child sending the signal. See | |
| 3895 | − this uml-devel post <http://www.geocrawler.com/lists/3/Source- | |
| 3896 | − Forge/709/0/6612801> for the details. | |
| 3705 | + installing a signal handler and its child sending the signal. | |
| 3897 | 3706 | |
| 3898 | 3707 | |
| 3899 | 3708 | |
| 3900 | − 13.8. TUN/TAP networking doesn't work on a 2.4 host | |
| 3709 | +13.8. TUN/TAP networking doesn't work on a 2.4 host | |
| 3710 | +---------------------------------------------------- | |
| 3901 | 3711 | |
| 3902 | − There are a couple of problems which were | |
| 3903 | − <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed | |
| 3904 | − out"> by Tim Robinson <timro at trkr dot net> | |
| 3712 | + There are a couple of problems which were reported by | |
| 3713 | + Tim Robinson <timro at trkr dot net> | |
| 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 | 3716 | The fix is to upgrade to something more recent and then read the |
| 3908 | 3717 | next item. |
| 3909 | 3718 | |
| 3910 | − o If you see | |
| 3719 | + - If you see:: | |
| 3911 | 3720 | |
| 3912 | 3721 | |
| 3913 | 3722 | 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 the | |
| 3925 | − net | |
| 3733 | +13.9. You can network to the host but not to other machines on the net | |
| 3734 | +======================================================================= | |
| 3926 | 3735 | |
| 3927 | 3736 | If you can connect to the host, and the host can connect to UML, but |
| 3928 | 3737 | you cannot connect to any other machines, then you may need to enable |
| @@ -3930,7 +3739,7 @@ · 1 unmodified line | ||
| 3930 | 3739 | using private IP addresses (192.168.x.x or 10.x.x.x) for host/UML |
| 3931 | 3740 | networking, rather than the public address space that your host is |
| 3932 | 3741 | 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 | 3745 | host% |
| @@ -3944,11 +3753,11 @@ · 7 unmodified lines | ||
| 3944 | 3753 | |
| 3945 | 3754 | |
| 3946 | 3755 | 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 | 3759 | 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 | 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 scream | |
| 3784 | +13.10. I have no root and I want to scream | |
| 3785 | +=========================================== | |
| 3976 | 3786 | |
| 3977 | 3787 | Thanks to Birgit Wahlich for telling me about this strange one. It |
| 3978 | 3788 | 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.h | |
| 3800 | +13.11. UML build conflict between ptrace.h and ucontext.h | |
| 3801 | +========================================================== | |
| 3991 | 3802 | |
| 3992 | 3803 | On some older systems, /usr/include/asm/ptrace.h and |
| 3993 | 3804 | /usr/include/sys/ucontext.h define the same names. So, when they're |
| 3994 | 3805 | 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 | 3808 | /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 BogoMips | |
| 3822 | +13.12. The UML BogoMips is exactly half the host's BogoMips | |
| 3823 | +------------------------------------------------------------ | |
| 4011 | 3824 | |
| 4012 | 3825 | On i386 kernels, there are two ways of running the loop that is used |
| 4013 | 3826 | 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 segfaults | |
| 3835 | +13.13. When you run UML, it immediately segfaults | |
| 3836 | +-------------------------------------------------- | |
| 4023 | 3837 | |
| 4024 | 3838 | If the host is configured with the 2G/2G address space split, that's |
| 4025 | − why. See ``UML on 2G/2G hosts'' for the details on getting UML to | |
| 3839 | + why. See ref:`UML_on_2G/2G_hosts` for the details on getting UML to | |
| 4026 | 3840 | run on your host. |
| 4027 | 3841 | |
| 4028 | 3842 | |
| 4029 | 3843 | |
| 4030 | − 13.14. xterms appear, then immediately disappear | |
| 3844 | +13.14. xterms appear, then immediately disappear | |
| 3845 | +------------------------------------------------- | |
| 4031 | 3846 | |
| 4032 | 3847 | If you're running an up to date kernel with an old release of |
| 4033 | 3848 | 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 behavior | |
| 3857 | +13.15. Any other panic, hang, or strange behavior | |
| 3858 | +-------------------------------------------------- | |
| 4043 | 3859 | |
| 4044 | 3860 | If you're seeing truly strange behavior, such as hangs or panics that |
| 4045 | 3861 | happen in random places, or you try running the debugger to see what's |
| @@ -4057,9 +3873,13 @@ · 11 unmodified lines | ||
| 4057 | 3873 | it and that a fix is imminent. |
| 4058 | 3874 | |
| 4059 | 3875 | |
| 4060 | − If you want to be super-helpful, read ``Diagnosing Problems'' and | |
| 3876 | + If you want to be super-helpful, read :ref:`Diagnosing_Problems` and | |
| 4061 | 3877 | follow the instructions contained therein. |
| 4062 | − 14. Diagnosing Problems | |
| 3878 | + | |
| 3879 | +.. _Diagnosing_Problems: | |
| 3880 | + | |
| 3881 | +14. Diagnosing Problems | |
| 3882 | +======================== | |
| 4063 | 3883 | |
| 4064 | 3884 | |
| 4065 | 3885 | If you get UML to crash, hang, or otherwise misbehave, you should |
| @@ -4074,21 +3894,22 @@ · 8 unmodified lines | ||
| 4074 | 3894 | |
| 4075 | 3895 | For any diagnosis, you're going to need to build a debugging kernel. |
| 4076 | 3896 | The binaries from this site aren't debuggable. If you haven't done |
| 4077 | − this before, read about ``Compiling the kernel and modules'' and | |
| 4078 | − ``Kernel debugging'' UML first. | |
| 3897 | + this before, read about :ref:`Compiling_the_kernel_and_modules` and | |
| 3898 | + :ref:`Kernel_debugging` UML first. | |
| 4079 | 3899 | |
| 4080 | 3900 | |
| 4081 | − 14.1. Case 1 : Normal kernel panics | |
| 3901 | +14.1. Case 1 : Normal kernel panics | |
| 3902 | +------------------------------------ | |
| 4082 | 3903 | |
| 4083 | 3904 | The most common case is for a normal thread to panic. To debug this, |
| 4084 | 3905 | you will need to run it under the debugger (add 'debug' to the command |
| 4085 | 3906 | line). An xterm will start up with gdb running inside it. Continue |
| 4086 | − it when it stops in start_kernel and make it crash. Now ^C gdb and | |
| 3907 | + it when it stops in start_kernel and make it crash. Now ``^C gdb`` and | |
| 4087 | 3908 | |
| 4088 | 3909 | |
| 4089 | 3910 | If the panic was a "Kernel mode fault", then there will be a segv |
| 4090 | 3911 | 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 | 3915 | (UML gdb) backtrace |
| @@ -4107,7 +3928,7 @@ · 12 unmodified lines | ||
| 4107 | 3928 | |
| 4108 | 3929 | |
| 4109 | 3930 | 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 | 3934 | (UML gdb) i sym 268849158 |
| @@ -4115,7 +3936,7 @@ · 1 unmodified line | ||
| 4115 | 3936 | |
| 4116 | 3937 | |
| 4117 | 3938 | |
| 4118 | − and | |
| 3939 | + and:: | |
| 4119 | 3940 | |
| 4120 | 3941 | |
| 4121 | 3942 | (UML gdb) i line *268849158 |
| @@ -4128,7 +3949,8 @@ · 6 unmodified lines | ||
| 4128 | 3949 | to get that information from the faulting ip. |
| 4129 | 3950 | |
| 4130 | 3951 | |
| 4131 | − 14.2. Case 2 : Tracing thread panics | |
| 3952 | +14.2. Case 2 : Tracing thread panics | |
| 3953 | +------------------------------------- | |
| 4132 | 3954 | |
| 4133 | 3955 | The less common and more painful case is when the tracing thread |
| 4134 | 3956 | panics. In this case, the kernel debugger will be useless because it |
| @@ -4136,7 +3958,7 @@ · 1 unmodified line | ||
| 4136 | 3958 | do is get a backtrace from the tracing thread. This is done by |
| 4137 | 3959 | figuring out what its pid is, firing up gdb, and attaching it to that |
| 4138 | 3960 | 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 | 3964 | tracing thread pid = 15851 |
| @@ -4145,7 +3967,7 @@ · 2 unmodified lines | ||
| 4145 | 3967 | |
| 4146 | 3968 | |
| 4147 | 3969 | or by running ps on the host and finding the line that looks like |
| 4148 | − this: | |
| 3970 | + this:: | |
| 4149 | 3971 | |
| 4150 | 3972 | |
| 4151 | 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 | 3986 | 14.3. Case 3 : Tracing thread panics caused by other threads |
| 4165 | 3987 | |
| 4166 | 3988 | 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 | 3992 | wait_for_stop failed to wait for <pid> to stop with <signal number> |
| @@ -4177,7 +3999,7 @@ · 6 unmodified lines | ||
| 4177 | 3999 | debugger is defunct and without some fancy footwork, another gdb can't |
| 4178 | 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 | 4005 | 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 | 4013 | (host gdb) call detach(pid) |
| @@ -4193,7 +4015,7 @@ · 1 unmodified line | ||
| 4193 | 4015 | |
| 4194 | 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 | 4021 | (host gdb) detach |
| @@ -4209,7 +4031,7 @@ · 9 unmodified lines | ||
| 4209 | 4031 | |
| 4210 | 4032 | |
| 4211 | 4033 | If gdb hangs when attaching to that process, go back to a shell and |
| 4212 | − do: | |
| 4034 | + do:: | |
| 4213 | 4035 | |
| 4214 | 4036 | |
| 4215 | 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 | 4046 | (host gdb) backtrace |
| @@ -4227,13 +4049,14 @@ · 2 unmodified lines | ||
| 4227 | 4049 | |
| 4228 | 4050 | |
| 4229 | 4051 | |
| 4230 | − 14.4. Case 4 : Hangs | |
| 4052 | +14.4. Case 4 : Hangs | |
| 4053 | +--------------------- | |
| 4231 | 4054 | |
| 4232 | 4055 | Hangs seem to be fairly rare, but they sometimes happen. When a hang |
| 4233 | 4056 | happens, we need a backtrace from the offending process. Run the |
| 4234 | 4057 | kernel debugger as described in case 1 and get a backtrace. If the |
| 4235 | 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 | 4062 | #0 0x100b1401 in __libc_nanosleep () |
| @@ -4257,7 +4080,8 @@ · 17 unmodified lines | ||
| 4257 | 4080 | |
| 4258 | 4081 | |
| 4259 | 4082 | |
| 4260 | − 15. Thanks | |
| 4083 | +15. Thanks | |
| 4084 | +=========== | |
| 4261 | 4085 | |
| 4262 | 4086 | |
| 4263 | 4087 | A number of people have helped this project in various ways, and this |
| @@ -4274,20 +4098,21 @@ · 10 unmodified lines | ||
| 4274 | 4098 | bookkeeping lapses and I forget about contributions. |
| 4275 | 4099 | |
| 4276 | 4100 | |
| 4277 | − 15.1. Code and Documentation | |
| 4101 | +15.1. Code and Documentation | |
| 4102 | +----------------------------- | |
| 4278 | 4103 | |
| 4279 | 4104 | Rusty Russell <rusty at linuxcare.com.au> - |
| 4280 | 4105 | |
| 4281 | − o wrote the HOWTO <http://user-mode- | |
| 4282 | − linux.sourceforge.net/UserModeLinux-HOWTO.html> | |
| 4106 | + - wrote the HOWTO | |
| 4107 | + http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO.html | |
| 4283 | 4108 | |
| 4284 | − o prodded me into making this project official and putting it on | |
| 4109 | + - prodded me into making this project official and putting it on | |
| 4285 | 4110 | SourceForge |
| 4286 | 4111 | |
| 4287 | − o came up with the way cool UML logo <http://user-mode- | |
| 4288 | − linux.sourceforge.net/uml-small.png> | |
| 4112 | + - came up with the way cool UML logo | |
| 4113 | + http://user-mode-linux.sourceforge.net/uml-small.png | |
| 4289 | 4114 | |
| 4290 | − o redid the config process | |
| 4115 | + - redid the config process | |
| 4291 | 4116 | |
| 4292 | 4117 | |
| 4293 | 4118 | Peter Moulder <reiter at netspace.net.au> - Fixed my config and build |
| @@ -4296,34 +4121,32 @@ · 2 unmodified lines | ||
| 4296 | 4121 | |
| 4297 | 4122 | Bill Stearns <wstearns at pobox.com> - |
| 4298 | 4123 | |
| 4299 | − o HOWTO updates | |
| 4124 | + - HOWTO updates | |
| 4300 | 4125 | |
| 4301 | − o lots of bug reports | |
| 4126 | + - lots of bug reports | |
| 4302 | 4127 | |
| 4303 | − o lots of testing | |
| 4128 | + - lots of testing | |
| 4304 | 4129 | |
| 4305 | − o dedicated a box (uml.ists.dartmouth.edu) to support UML development | |
| 4130 | + - dedicated a box (uml.ists.dartmouth.edu) to support UML development | |
| 4306 | 4131 | |
| 4307 | − o wrote the mkrootfs script, which allows bootable filesystems of | |
| 4132 | + - wrote the mkrootfs script, which allows bootable filesystems of | |
| 4308 | 4133 | RPM-based distributions to be cranked out |
| 4309 | 4134 | |
| 4310 | − o cranked out a large number of filesystems with said script | |
| 4135 | + - cranked out a large number of filesystems with said script | |
| 4311 | 4136 | |
| 4312 | 4137 | |
| 4313 | 4138 | Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver |
| 4314 | 4139 | and associated usermode tools |
| 4315 | 4140 | |
| 4316 | − Lars Brinkhoff <http://lars.nocrew.org/> - Contributed the ptrace | |
| 4317 | − proxy from his own project <http://a386.nocrew.org/> to allow easier | |
| 4318 | − kernel debugging | |
| 4141 | + Lars Brinkhoff http://lars.nocrew.org/ - Contributed the ptrace | |
| 4142 | + proxy from his own project to allow easier kernel debugging | |
| 4319 | 4143 | |
| 4320 | 4144 | |
| 4321 | 4145 | Andrea Arcangeli <andrea at suse.de> - Redid some of the early boot |
| 4322 | 4146 | 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/> - Did | |
| 4326 | − the first UML port to Linux/ppc | |
| 4149 | + Chris Emerson - Did the first UML port to Linux/ppc | |
| 4327 | 4150 | |
| 4328 | 4151 | |
| 4329 | 4152 | Harald Welte <laforge at gnumonks.org> - Wrote the multicast |
| @@ -4338,7 +4161,7 @@ · 8 unmodified lines | ||
| 4338 | 4161 | wrote the iomem emulation support |
| 4339 | 4162 | |
| 4340 | 4163 | |
| 4341 | − Henrik Nordstrom <http://hem.passagen.se/hno/> - Provided a variety | |
| 4164 | + Henrik Nordstrom http://hem.passagen.se/hno/ - Provided a variety | |
| 4342 | 4165 | of patches, fixes, and clues |
| 4343 | 4166 | |
| 4344 | 4167 | |
| @@ -4373,190 +4196,193 @@ · 28 unmodified lines | ||
| 4373 | 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 | 4202 | which is a great way of keeping the UML user community on top of |
| 4380 | 4203 | UML goings-on. |
| 4381 | 4204 | |
| 4382 | − o Site documentation and updates | |
| 4205 | + - Site documentation and updates | |
| 4383 | 4206 | |
| 4384 | − o Nifty little UML management daemon UMLd | |
| 4385 | − <http://uml.openconsultancy.com/umld/> | |
| 4207 | + - Nifty little UML management daemon UMLd | |
| 4386 | 4208 | |
| 4387 | − o Lots of testing and bug reports | |
| 4209 | + - Lots of testing and bug reports | |
| 4388 | 4210 | |
| 4389 | 4211 | |
| 4390 | 4212 | |
| 4391 | 4213 | |
| 4392 | − 15.2. Flushing out bugs | |
| 4214 | +15.2. Flushing out bugs | |
| 4215 | +------------------------ | |
| 4393 | 4216 | |
| 4394 | 4217 | |
| 4395 | 4218 | |
| 4396 | − o Yuri Pudgorodsky | |
| 4219 | + - Yuri Pudgorodsky | |
| 4397 | 4220 | |
| 4398 | − o Gerald Britton | |
| 4221 | + - Gerald Britton | |
| 4399 | 4222 | |
| 4400 | − o Ian Wehrman | |
| 4223 | + - Ian Wehrman | |
| 4401 | 4224 | |
| 4402 | − o Gord Lamb | |
| 4225 | + - Gord Lamb | |
| 4403 | 4226 | |
| 4404 | − o Eugene Koontz | |
| 4227 | + - Eugene Koontz | |
| 4405 | 4228 | |
| 4406 | − o John H. Hartman | |
| 4229 | + - John H. Hartman | |
| 4407 | 4230 | |
| 4408 | − o Anders Karlsson | |
| 4231 | + - Anders Karlsson | |
| 4409 | 4232 | |
| 4410 | − o Daniel Phillips | |
| 4233 | + - Daniel Phillips | |
| 4411 | 4234 | |
| 4412 | − o John Fremlin | |
| 4235 | + - John Fremlin | |
| 4413 | 4236 | |
| 4414 | − o Rainer Burgstaller | |
| 4237 | + - Rainer Burgstaller | |
| 4415 | 4238 | |
| 4416 | − o James Stevenson | |
| 4239 | + - James Stevenson | |
| 4417 | 4240 | |
| 4418 | − o Matt Clay | |
| 4241 | + - Matt Clay | |
| 4419 | 4242 | |
| 4420 | − o Cliff Jefferies | |
| 4243 | + - Cliff Jefferies | |
| 4421 | 4244 | |
| 4422 | − o Geoff Hoff | |
| 4245 | + - Geoff Hoff | |
| 4423 | 4246 | |
| 4424 | − o Lennert Buytenhek | |
| 4247 | + - Lennert Buytenhek | |
| 4425 | 4248 | |
| 4426 | − o Al Viro | |
| 4249 | + - Al Viro | |
| 4427 | 4250 | |
| 4428 | − o Frank Klingenhoefer | |
| 4251 | + - Frank Klingenhoefer | |
| 4429 | 4252 | |
| 4430 | − o Livio Baldini Soares | |
| 4253 | + - Livio Baldini Soares | |
| 4431 | 4254 | |
| 4432 | − o Jon Burgess | |
| 4255 | + - Jon Burgess | |
| 4433 | 4256 | |
| 4434 | − o Petru Paler | |
| 4257 | + - Petru Paler | |
| 4435 | 4258 | |
| 4436 | − o Paul | |
| 4259 | + - Paul | |
| 4437 | 4260 | |
| 4438 | − o Chris Reahard | |
| 4261 | + - Chris Reahard | |
| 4439 | 4262 | |
| 4440 | − o Sverker Nilsson | |
| 4263 | + - Sverker Nilsson | |
| 4441 | 4264 | |
| 4442 | − o Gong Su | |
| 4265 | + - Gong Su | |
| 4443 | 4266 | |
| 4444 | − o johan verrept | |
| 4267 | + - johan verrept | |
| 4445 | 4268 | |
| 4446 | − o Bjorn Eriksson | |
| 4269 | + - Bjorn Eriksson | |
| 4447 | 4270 | |
| 4448 | − o Lorenzo Allegrucci | |
| 4271 | + - Lorenzo Allegrucci | |
| 4449 | 4272 | |
| 4450 | − o Muli Ben-Yehuda | |
| 4273 | + - Muli Ben-Yehuda | |
| 4451 | 4274 | |
| 4452 | − o David Mansfield | |
| 4275 | + - David Mansfield | |
| 4453 | 4276 | |
| 4454 | − o Howard Goff | |
| 4277 | + - Howard Goff | |
| 4455 | 4278 | |
| 4456 | − o Mike Anderson | |
| 4279 | + - Mike Anderson | |
| 4457 | 4280 | |
| 4458 | − o John Byrne | |
| 4281 | + - John Byrne | |
| 4459 | 4282 | |
| 4460 | − o Sapan J. Batia | |
| 4283 | + - Sapan J. Batia | |
| 4461 | 4284 | |
| 4462 | − o Iris Huang | |
| 4285 | + - Iris Huang | |
| 4463 | 4286 | |
| 4464 | − o Jan Hudec | |
| 4287 | + - Jan Hudec | |
| 4465 | 4288 | |
| 4466 | − o Voluspa | |
| 4289 | + - Voluspa | |
| 4467 | 4290 | |
| 4468 | 4291 | |
| 4469 | 4292 | |
| 4470 | 4293 | |
| 4471 | − 15.3. Buglets and clean-ups | |
| 4294 | +15.3. Buglets and clean-ups | |
| 4295 | +---------------------------- | |
| 4472 | 4296 | |
| 4473 | 4297 | |
| 4474 | 4298 | |
| 4475 | − o Dave Zarzycki | |
| 4299 | + - Dave Zarzycki | |
| 4476 | 4300 | |
| 4477 | − o Adam Lazur | |
| 4301 | + - Adam Lazur | |
| 4478 | 4302 | |
| 4479 | − o Boria Feigin | |
| 4303 | + - Boria Feigin | |
| 4480 | 4304 | |
| 4481 | − o Brian J. Murrell | |
| 4305 | + - Brian J. Murrell | |
| 4482 | 4306 | |
| 4483 | − o JS | |
| 4307 | + - JS | |
| 4484 | 4308 | |
| 4485 | − o Roman Zippel | |
| 4309 | + - Roman Zippel | |
| 4486 | 4310 | |
| 4487 | − o Wil Cooley | |
| 4311 | + - Wil Cooley | |
| 4488 | 4312 | |
| 4489 | − o Ayelet Shemesh | |
| 4313 | + - Ayelet Shemesh | |
| 4490 | 4314 | |
| 4491 | − o Will Dyson | |
| 4315 | + - Will Dyson | |
| 4492 | 4316 | |
| 4493 | − o Sverker Nilsson | |
| 4317 | + - Sverker Nilsson | |
| 4494 | 4318 | |
| 4495 | − o dvorak | |
| 4319 | + - dvorak | |
| 4496 | 4320 | |
| 4497 | − o v.naga srinivas | |
| 4321 | + - v.naga srinivas | |
| 4498 | 4322 | |
| 4499 | − o Shlomi Fish | |
| 4323 | + - Shlomi Fish | |
| 4500 | 4324 | |
| 4501 | − o Roger Binns | |
| 4325 | + - Roger Binns | |
| 4502 | 4326 | |
| 4503 | − o johan verrept | |
| 4327 | + - johan verrept | |
| 4504 | 4328 | |
| 4505 | − o MrChuoi | |
| 4329 | + - MrChuoi | |
| 4506 | 4330 | |
| 4507 | − o Peter Cleve | |
| 4331 | + - Peter Cleve | |
| 4508 | 4332 | |
| 4509 | − o Vincent Guffens | |
| 4333 | + - Vincent Guffens | |
| 4510 | 4334 | |
| 4511 | − o Nathan Scott | |
| 4335 | + - Nathan Scott | |
| 4512 | 4336 | |
| 4513 | − o Patrick Caulfield | |
| 4337 | + - Patrick Caulfield | |
| 4514 | 4338 | |
| 4515 | − o jbearce | |
| 4339 | + - jbearce | |
| 4516 | 4340 | |
| 4517 | − o Catalin Marinas | |
| 4341 | + - Catalin Marinas | |
| 4518 | 4342 | |
| 4519 | − o Shane Spencer | |
| 4343 | + - Shane Spencer | |
| 4520 | 4344 | |
| 4521 | − o Zou Min | |
| 4345 | + - Zou Min | |
| 4522 | 4346 | |
| 4523 | 4347 | |
| 4524 | − o Ryan Boder | |
| 4348 | + - Ryan Boder | |
| 4525 | 4349 | |
| 4526 | − o Lorenzo Colitti | |
| 4350 | + - Lorenzo Colitti | |
| 4527 | 4351 | |
| 4528 | − o Gwendal Grignou | |
| 4352 | + - Gwendal Grignou | |
| 4529 | 4353 | |
| 4530 | − o Andre' Breiler | |
| 4354 | + - Andre' Breiler | |
| 4531 | 4355 | |
| 4532 | − o Tsutomu Yasuda | |
| 4356 | + - Tsutomu Yasuda | |
| 4533 | 4357 | |
| 4534 | 4358 | |
| 4535 | 4359 | |
| 4536 | − 15.4. Case Studies | |
| 4360 | +15.4. Case Studies | |
| 4361 | +------------------- | |
| 4537 | 4362 | |
| 4538 | 4363 | |
| 4539 | − o Jon Wright | |
| 4364 | + - Jon Wright | |
| 4540 | 4365 | |
| 4541 | − o William McEwan | |
| 4366 | + - William McEwan | |
| 4542 | 4367 | |
| 4543 | − o Michael Richardson | |
| 4368 | + - Michael Richardson | |
| 4544 | 4369 | |
| 4545 | 4370 | |
| 4546 | 4371 | |
| 4547 | − 15.5. Other contributions | |
| 4372 | +15.5. Other contributions | |
| 4373 | +-------------------------- | |
| 4548 | 4374 | |
| 4549 | 4375 | |
| 4550 | 4376 | Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script |
| 4551 | 4377 | work with RH 6.2. |
| 4552 | 4378 | |
| 4553 | 4379 | Michael Jennings <mikejen at hevanet.com> sent in some material which |
| 4554 | − is now gracing the top of the index page <http://user-mode- | |
| 4555 | − linux.sourceforge.net/> of this site. | |
| 4380 | + is now gracing the top of the index page | |
| 4381 | + http://user-mode-linux.sourceforge.net/ of this site. | |
| 4556 | 4382 | |
| 4557 | − SGI <http://www.sgi.com> (and more specifically Ralf Baechle <ralf at | |
| 4558 | − uni-koblenz.de> ) gave me an account on oss.sgi.com | |
| 4559 | − <http://www.oss.sgi.com> . The bandwidth there made it possible to | |
| 4383 | + SGI (and more specifically Ralf Baechle <ralf at | |
| 4384 | + uni-koblenz.de> ) gave me an account on oss.sgi.com. | |
| 4385 | + The bandwidth there made it possible to | |
| 4560 | 4386 | produce most of the filesystems available on the project download |
| 4561 | 4387 | page. |
| 4562 | 4388 | |
| @@ -4573,17 +4399,5 @@ · 10 unmodified lines | ||
| 4573 | 4399 | |
| 4574 | 4400 | Chris Reahard built a specialized root filesystem for running a DNS |
| 4575 | 4401 | server jailed inside UML. It's available from the download |
| 4576 | − <http://user-mode-linux.sourceforge.net/dl-sf.html> page in the Jail | |
| 4402 | + http://user-mode-linux.sourceforge.net/old/dl-sf.html page in the Jail | |
| 4577 | 4403 | Filesystems section. |
| 4578 | − | |
| 4579 | − | |
| 4580 | − | |
| 4581 | − | |
| 4582 | − | |
| 4583 | − | |
| 4584 | − | |
| 4585 | − | |
| 4586 | − | |
| 4587 | − | |
| 4588 | − | |
| 4589 | − | |
| @@ -19,7 +19,6 @@ x86-specific Documentation · 18 unmodified lines | ||
| 19 | 19 | tlb |
| 20 | 20 | mtrr |
| 21 | 21 | pat |
| 22 | − intel_mpx | |
| 23 | 22 | intel-iommu |
| 24 | 23 | intel_txt |
| 25 | 24 | amd-memory-encryption |
| @@ -2796,11 +2796,11 @@ F: drivers/block/aoe/ · 2795 unmodified lines | ||
| 2796 | 2796 | |
| 2797 | 2797 | ATHEROS 71XX/9XXX GPIO DRIVER |
| 2798 | 2798 | M: Alban Bedel <albeu@free.fr> |
| 2799 | +S: Maintained | |
| 2799 | 2800 | W: https://github.com/AlbanBedel/linux |
| 2800 | 2801 | T: git git://github.com/AlbanBedel/linux |
| 2801 | −S: Maintained | |
| 2802 | −F: drivers/gpio/gpio-ath79.c | |
| 2803 | 2802 | F: Documentation/devicetree/bindings/gpio/gpio-ath79.txt |
| 2803 | +F: drivers/gpio/gpio-ath79.c | |
| 2804 | 2804 | |
| 2805 | 2805 | ATHEROS 71XX/9XXX USB PHY DRIVER |
| 2806 | 2806 | M: Alban Bedel <albeu@free.fr> |
| @@ -3422,8 +3422,8 @@ BROADCOM BRCMSTB GPIO DRIVER · 615 unmodified lines | ||
| 3422 | 3422 | M: Gregory Fong <gregory.0xf0@gmail.com> |
| 3423 | 3423 | L: bcm-kernel-feedback-list@broadcom.com |
| 3424 | 3424 | S: Supported |
| 3425 | −F: drivers/gpio/gpio-brcmstb.c | |
| 3426 | 3425 | F: Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt |
| 3426 | +F: drivers/gpio/gpio-brcmstb.c | |
| 3427 | 3427 | |
| 3428 | 3428 | BROADCOM BRCMSTB I2C DRIVER |
| 3429 | 3429 | M: Kamal Dasu <kdasu.kdev@gmail.com> |
| @@ -3481,8 +3481,8 @@ BROADCOM KONA GPIO DRIVER · 51 unmodified lines | ||
| 3481 | 3481 | M: Ray Jui <rjui@broadcom.com> |
| 3482 | 3482 | L: bcm-kernel-feedback-list@broadcom.com |
| 3483 | 3483 | S: Supported |
| 3484 | −F: drivers/gpio/gpio-bcm-kona.c | |
| 3485 | 3484 | F: Documentation/devicetree/bindings/gpio/brcm,kona-gpio.txt |
| 3485 | +F: drivers/gpio/gpio-bcm-kona.c | |
| 3486 | 3486 | |
| 3487 | 3487 | BROADCOM NETXTREME-E ROCE DRIVER |
| 3488 | 3488 | M: Selvin Xavier <selvin.xavier@broadcom.com> |
| @@ -3597,8 +3597,8 @@ F: sound/pci/bt87x.c · 108 unmodified lines | ||
| 3597 | 3597 | |
| 3598 | 3598 | BT8XXGPIO DRIVER |
| 3599 | 3599 | M: Michael Buesch <m@bues.ch> |
| 3600 | −W: http://bu3sch.de/btgpio.php | |
| 3601 | 3600 | S: Maintained |
| 3601 | +W: http://bu3sch.de/btgpio.php | |
| 3602 | 3602 | F: drivers/gpio/gpio-bt8xx.c |
| 3603 | 3603 | |
| 3604 | 3604 | BTRFS FILE SYSTEM |
| @@ -3649,6 +3649,7 @@ F: sound/pci/oxygen/ · 44 unmodified lines | ||
| 3649 | 3649 | |
| 3650 | 3650 | C-SKY ARCHITECTURE |
| 3651 | 3651 | M: Guo Ren <guoren@kernel.org> |
| 3652 | +L: linux-csky@vger.kernel.org | |
| 3652 | 3653 | T: git https://github.com/c-sky/csky-linux.git |
| 3653 | 3654 | S: Supported |
| 3654 | 3655 | F: arch/csky/ |
| @@ -3909,7 +3910,7 @@ S: Supported · 254 unmodified lines | ||
| 3909 | 3910 | F: Documentation/filesystems/ceph.txt |
| 3910 | 3911 | F: fs/ceph/ |
| 3911 | 3912 | |
| 3912 | −CERTIFICATE HANDLING: | |
| 3913 | +CERTIFICATE HANDLING | |
| 3913 | 3914 | M: David Howells <dhowells@redhat.com> |
| 3914 | 3915 | M: David Woodhouse <dwmw2@infradead.org> |
| 3915 | 3916 | L: keyrings@vger.kernel.org |
| @@ -3919,7 +3920,7 @@ F: certs/ · 3 unmodified lines | ||
| 3919 | 3920 | F: scripts/sign-file.c |
| 3920 | 3921 | F: scripts/extract-cert.c |
| 3921 | 3922 | |
| 3922 | −CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM: | |
| 3923 | +CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM | |
| 3923 | 3924 | L: devel@driverdev.osuosl.org |
| 3924 | 3925 | S: Obsolete |
| 3925 | 3926 | F: drivers/staging/wusbcore/ |
| @@ -5932,12 +5933,12 @@ S: Maintained · 2006 unmodified lines | ||
| 5932 | 5933 | F: drivers/media/dvb-frontends/ec100* |
| 5933 | 5934 | |
| 5934 | 5935 | ECRYPT FILE SYSTEM |
| 5935 | −M: Tyler Hicks <tyhicks@canonical.com> | |
| 5936 | +M: Tyler Hicks <code@tyhicks.com> | |
| 5936 | 5937 | L: ecryptfs@vger.kernel.org |
| 5937 | 5938 | W: http://ecryptfs.org |
| 5938 | 5939 | W: https://launchpad.net/ecryptfs |
| 5939 | 5940 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git |
| 5940 | −S: Supported | |
| 5941 | +S: Odd Fixes | |
| 5941 | 5942 | F: Documentation/filesystems/ecryptfs.txt |
| 5942 | 5943 | F: fs/ecryptfs/ |
| 5943 | 5944 | |
| @@ -7047,7 +7048,7 @@ L: kvm@vger.kernel.org · 1103 unmodified lines | ||
| 7047 | 7048 | S: Supported |
| 7048 | 7049 | F: drivers/uio/uio_pci_generic.c |
| 7049 | 7050 | |
| 7050 | −GENERIC VDSO LIBRARY: | |
| 7051 | +GENERIC VDSO LIBRARY | |
| 7051 | 7052 | M: Andy Lutomirski <luto@kernel.org> |
| 7052 | 7053 | M: Thomas Gleixner <tglx@linutronix.de> |
| 7053 | 7054 | M: Vincenzo Frascino <vincenzo.frascino@arm.com> |
| @@ -7143,18 +7144,18 @@ GPIO SUBSYSTEM · 89 unmodified lines | ||
| 7143 | 7144 | M: Linus Walleij <linus.walleij@linaro.org> |
| 7144 | 7145 | M: Bartosz Golaszewski <bgolaszewski@baylibre.com> |
| 7145 | 7146 | L: linux-gpio@vger.kernel.org |
| 7146 | −T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git | |
| 7147 | 7147 | S: Maintained |
| 7148 | +T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git | |
| 7149 | +F: Documentation/ABI/obsolete/sysfs-gpio | |
| 7150 | +F: Documentation/ABI/testing/gpio-cdev | |
| 7151 | +F: Documentation/admin-guide/gpio/ | |
| 7148 | 7152 | F: Documentation/devicetree/bindings/gpio/ |
| 7149 | 7153 | F: Documentation/driver-api/gpio/ |
| 7150 | −F: Documentation/admin-guide/gpio/ | |
| 7151 | −F: Documentation/ABI/testing/gpio-cdev | |
| 7152 | −F: Documentation/ABI/obsolete/sysfs-gpio | |
| 7153 | 7154 | F: drivers/gpio/ |
| 7155 | +F: include/asm-generic/gpio.h | |
| 7154 | 7156 | F: include/linux/gpio/ |
| 7155 | 7157 | F: include/linux/gpio.h |
| 7156 | 7158 | F: include/linux/of_gpio.h |
| 7157 | −F: include/asm-generic/gpio.h | |
| 7158 | 7159 | F: include/uapi/linux/gpio.h |
| 7159 | 7160 | F: tools/gpio/ |
| 7160 | 7161 | |
| @@ -8055,8 +8056,8 @@ F: drivers/scsi/ips.* · 894 unmodified lines | ||
| 8055 | 8056 | ICH LPC AND GPIO DRIVER |
| 8056 | 8057 | M: Peter Tyser <ptyser@xes-inc.com> |
| 8057 | 8058 | S: Maintained |
| 8058 | −F: drivers/mfd/lpc_ich.c | |
| 8059 | 8059 | F: drivers/gpio/gpio-ich.c |
| 8060 | +F: drivers/mfd/lpc_ich.c | |
| 8060 | 8061 | |
| 8061 | 8062 | ICY I2C DRIVER |
| 8062 | 8063 | M: Max Staudt <max@enpas.org> |
| @@ -8392,7 +8393,7 @@ M: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> · 329 unmodified lines | ||
| 8392 | 8393 | M: Rodrigo Vivi <rodrigo.vivi@intel.com> |
| 8393 | 8394 | L: intel-gfx@lists.freedesktop.org |
| 8394 | 8395 | W: https://01.org/linuxgraphics/ |
| 8395 | −B: https://01.org/linuxgraphics/documentation/how-report-bugs | |
| 8396 | +B: https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs | |
| 8396 | 8397 | C: irc://chat.freenode.net/intel-gfx |
| 8397 | 8398 | Q: http://patchwork.freedesktop.org/project/intel-gfx/ |
| 8398 | 8399 | T: git git://anongit.freedesktop.org/drm-intel |
| @@ -9278,7 +9279,7 @@ F: include/keys/trusted-type.h · 879 unmodified lines | ||
| 9278 | 9279 | F: security/keys/trusted.c |
| 9279 | 9280 | F: include/keys/trusted.h |
| 9280 | 9281 | |
| 9281 | −KEYS/KEYRINGS: | |
| 9282 | +KEYS/KEYRINGS | |
| 9282 | 9283 | M: David Howells <dhowells@redhat.com> |
| 9283 | 9284 | M: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
| 9284 | 9285 | L: keyrings@vger.kernel.org |
| @@ -11114,14 +11115,12 @@ S: Maintained · 1829 unmodified lines | ||
| 11114 | 11115 | F: drivers/usb/image/microtek.* |
| 11115 | 11116 | |
| 11116 | 11117 | MIPS |
| 11117 | −M: Ralf Baechle <ralf@linux-mips.org> | |
| 11118 | −M: Paul Burton <paulburton@kernel.org> | |
| 11118 | +M: Thomas Bogendoerfer <tsbogend@alpha.franken.de> | |
| 11119 | 11119 | L: linux-mips@vger.kernel.org |
| 11120 | 11120 | W: http://www.linux-mips.org/ |
| 11121 | −T: git git://git.linux-mips.org/pub/scm/ralf/linux.git | |
| 11122 | 11121 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git |
| 11123 | 11122 | Q: http://patchwork.linux-mips.org/project/linux-mips/list/ |
| 11124 | −S: Supported | |
| 11123 | +S: Maintained | |
| 11125 | 11124 | F: Documentation/devicetree/bindings/mips/ |
| 11126 | 11125 | F: Documentation/mips/ |
| 11127 | 11126 | F: arch/mips/ |
| @@ -11485,7 +11484,7 @@ F: drivers/scsi/mac_scsi.* · 357 unmodified lines | ||
| 11485 | 11484 | F: drivers/scsi/sun3_scsi.* |
| 11486 | 11485 | F: drivers/scsi/sun3_scsi_vme.c |
| 11487 | 11486 | |
| 11488 | −NCSI LIBRARY: | |
| 11487 | +NCSI LIBRARY | |
| 11489 | 11488 | M: Samuel Mendoza-Jonas <sam@mendozajonas.com> |
| 11490 | 11489 | S: Maintained |
| 11491 | 11490 | F: net/ncsi/ |
| @@ -12741,7 +12740,7 @@ M: Tom Joseph <tjoseph@cadence.com> · 1249 unmodified lines | ||
| 12741 | 12740 | L: linux-pci@vger.kernel.org |
| 12742 | 12741 | S: Maintained |
| 12743 | 12742 | F: Documentation/devicetree/bindings/pci/cdns,*.txt |
| 12744 | −F: drivers/pci/controller/pcie-cadence* | |
| 12743 | +F: drivers/pci/controller/cadence/ | |
| 12745 | 12744 | |
| 12746 | 12745 | PCI DRIVER FOR FREESCALE LAYERSCAPE |
| 12747 | 12746 | M: Minghuan Lian <minghuan.Lian@nxp.com> |
| @@ -13513,7 +13512,7 @@ L: linuxppc-dev@lists.ozlabs.org · 765 unmodified lines | ||
| 13513 | 13512 | S: Maintained |
| 13514 | 13513 | F: drivers/block/ps3vram.c |
| 13515 | 13514 | |
| 13516 | −PSAMPLE PACKET SAMPLING SUPPORT: | |
| 13515 | +PSAMPLE PACKET SAMPLING SUPPORT | |
| 13517 | 13516 | M: Yotam Gigi <yotam.gi@gmail.com> |
| 13518 | 13517 | S: Maintained |
| 13519 | 13518 | F: net/psample |
| @@ -14583,10 +14582,10 @@ F: drivers/media/pci/saa7146/ · 1063 unmodified lines | ||
| 14583 | 14582 | F: include/media/drv-intf/saa7146* |
| 14584 | 14583 | |
| 14585 | 14584 | SAFESETID SECURITY MODULE |
| 14586 | −M: Micah Morton <mortonm@chromium.org> | |
| 14587 | −S: Supported | |
| 14588 | −F: security/safesetid/ | |
| 14589 | −F: Documentation/admin-guide/LSM/SafeSetID.rst | |
| 14585 | +M: Micah Morton <mortonm@chromium.org> | |
| 14586 | +S: Supported | |
| 14587 | +F: security/safesetid/ | |
| 14588 | +F: Documentation/admin-guide/LSM/SafeSetID.rst | |
| 14590 | 14589 | |
| 14591 | 14590 | SAMSUNG AUDIO (ASoC) DRIVERS |
| 14592 | 14591 | M: Krzysztof Kozlowski <krzk@kernel.org> |
| @@ -16076,8 +16075,8 @@ F: Documentation/devicetree/bindings/reset/snps,axs10x-reset.txt · 1483 unmodified lines | ||
| 16076 | 16075 | SYNOPSYS CREG GPIO DRIVER |
| 16077 | 16076 | M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> |
| 16078 | 16077 | S: Maintained |
| 16079 | −F: drivers/gpio/gpio-creg-snps.c | |
| 16080 | 16078 | F: Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt |
| 16079 | +F: drivers/gpio/gpio-creg-snps.c | |
| 16081 | 16080 | |
| 16082 | 16081 | SYNOPSYS DESIGNWARE 8250 UART DRIVER |
| 16083 | 16082 | R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| @@ -16088,8 +16087,8 @@ SYNOPSYS DESIGNWARE APB GPIO DRIVER · 4 unmodified lines | ||
| 16088 | 16087 | M: Hoan Tran <hoan@os.amperecomputing.com> |
| 16089 | 16088 | L: linux-gpio@vger.kernel.org |
| 16090 | 16089 | S: Maintained |
| 16091 | −F: drivers/gpio/gpio-dwapb.c | |
| 16092 | 16090 | F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt |
| 16091 | +F: drivers/gpio/gpio-dwapb.c | |
| 16093 | 16092 | |
| 16094 | 16093 | SYNOPSYS DESIGNWARE AXI DMAC DRIVER |
| 16095 | 16094 | M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> |
| @@ -16553,8 +16552,8 @@ M: Michael Jamet <michael.jamet@intel.com> · 457 unmodified lines | ||
| 16553 | 16552 | M: Mika Westerberg <mika.westerberg@linux.intel.com> |
| 16554 | 16553 | M: Yehezkel Bernat <YehezkelShB@gmail.com> |
| 16555 | 16554 | L: linux-usb@vger.kernel.org |
| 16556 | −T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git | |
| 16557 | 16555 | S: Maintained |
| 16556 | +T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git | |
| 16558 | 16557 | F: Documentation/admin-guide/thunderbolt.rst |
| 16559 | 16558 | F: drivers/thunderbolt/ |
| 16560 | 16559 | F: include/linux/thunderbolt.h |
| @@ -17081,7 +17080,7 @@ S: Maintained · 520 unmodified lines | ||
| 17081 | 17080 | F: Documentation/admin-guide/ufs.rst |
| 17082 | 17081 | F: fs/ufs/ |
| 17083 | 17082 | |
| 17084 | −UHID USERSPACE HID IO DRIVER: | |
| 17083 | +UHID USERSPACE HID IO DRIVER | |
| 17085 | 17084 | M: David Herrmann <dh.herrmann@googlemail.com> |
| 17086 | 17085 | L: linux-input@vger.kernel.org |
| 17087 | 17086 | S: Maintained |
| @@ -17095,18 +17094,18 @@ S: Maintained · 7 unmodified lines | ||
| 17095 | 17094 | F: drivers/usb/common/ulpi.c |
| 17096 | 17095 | F: include/linux/ulpi/ |
| 17097 | 17096 | |
| 17098 | −ULTRA-WIDEBAND (UWB) SUBSYSTEM: | |
| 17097 | +ULTRA-WIDEBAND (UWB) SUBSYSTEM | |
| 17099 | 17098 | L: devel@driverdev.osuosl.org |
| 17100 | 17099 | S: Obsolete |
| 17101 | 17100 | F: drivers/staging/uwb/ |
| 17102 | 17101 | |
| 17103 | −UNICODE SUBSYSTEM: | |
| 17102 | +UNICODE SUBSYSTEM | |
| 17104 | 17103 | M: Gabriel Krisman Bertazi <krisman@collabora.com> |
| 17105 | 17104 | L: linux-fsdevel@vger.kernel.org |
| 17106 | 17105 | S: Supported |
| 17107 | 17106 | F: fs/unicode/ |
| 17108 | 17107 | |
| 17109 | −UNICORE32 ARCHITECTURE: | |
| 17108 | +UNICORE32 ARCHITECTURE | |
| 17110 | 17109 | M: Guan Xuetao <gxt@pku.edu.cn> |
| 17111 | 17110 | W: http://mprc.pku.edu.cn/~guanxuetao/linux |
| 17112 | 17111 | S: Maintained |
| @@ -17393,11 +17392,14 @@ F: drivers/usb/ · 280 unmodified lines | ||
| 17393 | 17392 | F: include/linux/usb.h |
| 17394 | 17393 | F: include/linux/usb/ |
| 17395 | 17394 | |
| 17396 | −USB TYPEC PI3USB30532 MUX DRIVER | |
| 17397 | −M: Hans de Goede <hdegoede@redhat.com> | |
| 17395 | +USB TYPEC BUS FOR ALTERNATE MODES | |
| 17396 | +M: Heikki Krogerus <heikki.krogerus@linux.intel.com> | |
| 17398 | 17397 | L: linux-usb@vger.kernel.org |
| 17399 | 17398 | S: Maintained |
| 17400 | −F: drivers/usb/typec/mux/pi3usb30532.c | |
| 17399 | +F: Documentation/ABI/testing/sysfs-bus-typec | |
| 17400 | +F: Documentation/driver-api/usb/typec_bus.rst | |
| 17401 | +F: drivers/usb/typec/altmodes/ | |
| 17402 | +F: include/linux/usb/typec_altmode.h | |
| 17401 | 17403 | |
| 17402 | 17404 | USB TYPEC CLASS |
| 17403 | 17405 | M: Heikki Krogerus <heikki.krogerus@linux.intel.com> |
| @@ -17408,14 +17410,11 @@ F: Documentation/driver-api/usb/typec.rst · 4 unmodified lines | ||
| 17408 | 17410 | F: drivers/usb/typec/ |
| 17409 | 17411 | F: include/linux/usb/typec.h |
| 17410 | 17412 | |
| 17411 | −USB TYPEC BUS FOR ALTERNATE MODES | |
| 17412 | −M: Heikki Krogerus <heikki.krogerus@linux.intel.com> | |
| 17413 | +USB TYPEC PI3USB30532 MUX DRIVER | |
| 17414 | +M: Hans de Goede <hdegoede@redhat.com> | |
| 17413 | 17415 | L: linux-usb@vger.kernel.org |
| 17414 | 17416 | S: Maintained |
| 17415 | −F: Documentation/ABI/testing/sysfs-bus-typec | |
| 17416 | −F: Documentation/driver-api/usb/typec_bus.rst | |
| 17417 | −F: drivers/usb/typec/altmodes/ | |
| 17418 | −F: include/linux/usb/typec_altmode.h | |
| 17417 | +F: drivers/usb/typec/mux/pi3usb30532.c | |
| 17419 | 17418 | |
| 17420 | 17419 | USB TYPEC PORT CONTROLLER DRIVERS |
| 17421 | 17420 | M: Guenter Roeck <linux@roeck-us.net> |
| @@ -17792,7 +17791,7 @@ F: include/linux/vbox_utils.h · 370 unmodified lines | ||
| 17792 | 17791 | F: include/uapi/linux/vbox*.h |
| 17793 | 17792 | F: drivers/virt/vboxguest/ |
| 17794 | 17793 | |
| 17795 | −VIRTUAL BOX SHARED FOLDER VFS DRIVER: | |
| 17794 | +VIRTUAL BOX SHARED FOLDER VFS DRIVER | |
| 17796 | 17795 | M: Hans de Goede <hdegoede@redhat.com> |
| 17797 | 17796 | L: linux-fsdevel@vger.kernel.org |
| 17798 | 17797 | S: Maintained |
| @@ -18415,8 +18414,8 @@ M: Nandor Han <nandor.han@ge.com> · 616 unmodified lines | ||
| 18415 | 18414 | M: Semi Malinen <semi.malinen@ge.com> |
| 18416 | 18415 | L: linux-gpio@vger.kernel.org |
| 18417 | 18416 | S: Maintained |
| 18418 | −F: drivers/gpio/gpio-xra1403.c | |
| 18419 | 18417 | F: Documentation/devicetree/bindings/gpio/gpio-xra1403.txt |
| 18418 | +F: drivers/gpio/gpio-xra1403.c | |
| 18420 | 18419 | |
| 18421 | 18420 | XTENSA XTFPGA PLATFORM SUPPORT |
| 18422 | 18421 | M: Max Filippov <jcmvbkbc@gmail.com> |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | VERSION = 5 |
| 3 | 3 | PATCHLEVEL = 6 |
| 4 | 4 | SUBLEVEL = 0 |
| 5 | −EXTRAVERSION = -rc1 | |
| 5 | +EXTRAVERSION = -rc4 | |
| 6 | 6 | NAME = Kleptomaniac Octopus |
| 7 | 7 | |
| 8 | 8 | # *DOCUMENTATION* |
| @@ -68,6 +68,7 @@ unexport GREP_OPTIONS · 59 unmodified lines | ||
| 68 | 68 | # |
| 69 | 69 | # If KBUILD_VERBOSE equals 0 then the above command will be hidden. |
| 70 | 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 | 73 | # To put more focus on warnings, be less verbose as default |
| 73 | 74 | # Use 'make V=1' to see the full commands |
| @@ -1238,7 +1239,7 @@ ifneq ($(dtstree),) · 1164 unmodified lines | ||
| 1238 | 1239 | %.dtb: include/config/kernel.release scripts_dtc |
| 1239 | 1240 | $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ |
| 1240 | 1241 | |
| 1241 | −PHONY += dtbs dtbs_install dt_binding_check | |
| 1242 | +PHONY += dtbs dtbs_install dtbs_check | |
| 1242 | 1243 | dtbs dtbs_check: include/config/kernel.release scripts_dtc |
| 1243 | 1244 | $(Q)$(MAKE) $(build)=$(dtstree) |
| 1244 | 1245 | |
| @@ -1258,6 +1259,7 @@ PHONY += scripts_dtc · 13 unmodified lines | ||
| 1258 | 1259 | scripts_dtc: scripts_basic |
| 1259 | 1260 | $(Q)$(MAKE) $(build)=scripts/dtc |
| 1260 | 1261 | |
| 1262 | +PHONY += dt_binding_check | |
| 1261 | 1263 | dt_binding_check: scripts_dtc |
| 1262 | 1264 | $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings |
| 1263 | 1265 | |
| @@ -178,9 +178,6 @@ · 177 unmodified lines | ||
| 178 | 178 | phy-mode = "rgmii"; |
| 179 | 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 | 181 | snps,reset-gpio = <&pio0 7 0>; |
| 185 | 182 | snps,reset-active-low; |
| 186 | 183 | snps,reset-delays-us = <0 10000 1000000>; |
| @@ -46,7 +46,7 @@ · 45 unmodified lines | ||
| 46 | 46 | /* DAC */ |
| 47 | 47 | format = "i2s"; |
| 48 | 48 | mclk-fs = <256>; |
| 49 | − frame-inversion = <1>; | |
| 49 | + frame-inversion; | |
| 50 | 50 | cpu { |
| 51 | 51 | sound-dai = <&sti_uni_player2>; |
| 52 | 52 | }; |
| @@ -11,8 +11,6 @@ CONFIG_SLAB=y · 10 unmodified lines | ||
| 11 | 11 | CONFIG_MODULES=y |
| 12 | 12 | CONFIG_MODULE_UNLOAD=y |
| 13 | 13 | # CONFIG_BLK_DEV_BSG is not set |
| 14 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 15 | −# CONFIG_IOSCHED_CFQ is not set | |
| 16 | 14 | CONFIG_ARCH_PXA=y |
| 17 | 15 | CONFIG_ARCH_GUMSTIX=y |
| 18 | 16 | CONFIG_PCCARD=y |
| @@ -25,7 +25,6 @@ CONFIG_EMBEDDED=y · 24 unmodified lines | ||
| 25 | 25 | CONFIG_PROFILING=y |
| 26 | 26 | CONFIG_MODULES=y |
| 27 | 27 | CONFIG_MODULE_UNLOAD=y |
| 28 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 29 | 28 | CONFIG_ARCH_AXXIA=y |
| 30 | 29 | CONFIG_GPIO_PCA953X=y |
| 31 | 30 | CONFIG_ARM_LPAE=y |
| @@ -7,7 +7,6 @@ CONFIG_EMBEDDED=y · 6 unmodified lines | ||
| 7 | 7 | CONFIG_SLOB=y |
| 8 | 8 | CONFIG_JUMP_LABEL=y |
| 9 | 9 | CONFIG_PARTITION_ADVANCED=y |
| 10 | −# CONFIG_IOSCHED_CFQ is not set | |
| 11 | 10 | CONFIG_ARCH_CLPS711X=y |
| 12 | 11 | CONFIG_ARCH_AUTCPU12=y |
| 13 | 12 | CONFIG_ARCH_CDB89712=y |
| @@ -17,7 +17,7 @@ CONFIG_MODULE_UNLOAD=y · 16 unmodified lines | ||
| 17 | 17 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 18 | 18 | CONFIG_MODVERSIONS=y |
| 19 | 19 | # CONFIG_BLK_DEV_BSG is not set |
| 20 | −CONFIG_IOSCHED_CFQ=m | |
| 20 | +CONFIG_IOSCHED_BFQ=m | |
| 21 | 21 | CONFIG_ARCH_MULTI_V6=y |
| 22 | 22 | #CONFIG_ARCH_MULTI_V7 is not set |
| 23 | 23 | CONFIG_ARCH_CNS3XXX=y |
| @@ -43,7 +43,6 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y · 42 unmodified lines | ||
| 43 | 43 | CONFIG_USB_MON=y |
| 44 | 44 | CONFIG_USB_STORAGE=y |
| 45 | 45 | CONFIG_MMC=y |
| 46 | −# CONFIG_MMC_BLOCK_BOUNCE is not set | |
| 47 | 46 | CONFIG_MMC_PXA=y |
| 48 | 47 | CONFIG_EXT3_FS=y |
| 49 | 48 | CONFIG_NFS_FS=y |
| @@ -7,8 +7,6 @@ CONFIG_EXPERT=y · 6 unmodified lines | ||
| 7 | 7 | # CONFIG_BASE_FULL is not set |
| 8 | 8 | # CONFIG_EPOLL is not set |
| 9 | 9 | CONFIG_SLOB=y |
| 10 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 11 | −# CONFIG_IOSCHED_CFQ is not set | |
| 12 | 10 | CONFIG_ARCH_SA1100=y |
| 13 | 11 | CONFIG_SA1100_COLLIE=y |
| 14 | 12 | CONFIG_PCCARD=y |
| @@ -15,8 +15,6 @@ CONFIG_MODULE_UNLOAD=y · 14 unmodified lines | ||
| 15 | 15 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 16 | 16 | CONFIG_MODVERSIONS=y |
| 17 | 17 | CONFIG_PARTITION_ADVANCED=y |
| 18 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 19 | −# CONFIG_IOSCHED_CFQ is not set | |
| 20 | 18 | CONFIG_ARCH_MULTIPLATFORM=y |
| 21 | 19 | CONFIG_ARCH_MULTI_V7=n |
| 22 | 20 | CONFIG_ARCH_MULTI_V5=y |
| @@ -12,8 +12,6 @@ CONFIG_EMBEDDED=y · 11 unmodified lines | ||
| 12 | 12 | # CONFIG_VM_EVENT_COUNTERS is not set |
| 13 | 13 | # CONFIG_SLUB_DEBUG is not set |
| 14 | 14 | # CONFIG_BLK_DEV_BSG is not set |
| 15 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 16 | −# CONFIG_IOSCHED_CFQ is not set | |
| 17 | 15 | # CONFIG_MMU is not set |
| 18 | 16 | CONFIG_ARM_SINGLE_ARMV7M=y |
| 19 | 17 | CONFIG_ARCH_EFM32=y |
| @@ -11,7 +11,6 @@ CONFIG_MODULE_UNLOAD=y · 10 unmodified lines | ||
| 11 | 11 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 12 | 12 | # CONFIG_BLK_DEV_BSG is not set |
| 13 | 13 | CONFIG_PARTITION_ADVANCED=y |
| 14 | −# CONFIG_IOSCHED_CFQ is not set | |
| 15 | 14 | CONFIG_ARCH_EP93XX=y |
| 16 | 15 | CONFIG_CRUNCH=y |
| 17 | 16 | CONFIG_MACH_ADSSPHERE=y |
| @@ -9,8 +9,6 @@ CONFIG_MODULES=y · 8 unmodified lines | ||
| 9 | 9 | CONFIG_MODULE_UNLOAD=y |
| 10 | 10 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 11 | 11 | # CONFIG_BLK_DEV_BSG is not set |
| 12 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 13 | −# CONFIG_IOSCHED_CFQ is not set | |
| 14 | 12 | CONFIG_ARCH_PXA=y |
| 15 | 13 | CONFIG_ARCH_PXA_ESERIES=y |
| 16 | 14 | # CONFIG_ARM_THUMB is not set |
| @@ -14,7 +14,6 @@ CONFIG_MODULE_UNLOAD=y · 13 unmodified lines | ||
| 14 | 14 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 15 | 15 | CONFIG_MODVERSIONS=y |
| 16 | 16 | # CONFIG_BLK_DEV_BSG is not set |
| 17 | −# CONFIG_IOSCHED_CFQ is not set | |
| 18 | 17 | CONFIG_ARCH_PXA=y |
| 19 | 18 | CONFIG_PXA_EZX=y |
| 20 | 19 | CONFIG_NO_HZ=y |
| @@ -5,8 +5,6 @@ CONFIG_LOG_BUF_SHIFT=14 · 4 unmodified lines | ||
| 5 | 5 | CONFIG_BLK_DEV_INITRD=y |
| 6 | 6 | CONFIG_MODULES=y |
| 7 | 7 | # CONFIG_BLK_DEV_BSG is not set |
| 8 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 9 | −# CONFIG_IOSCHED_CFQ is not set | |
| 10 | 8 | CONFIG_ARCH_SA1100=y |
| 11 | 9 | CONFIG_SA1100_H3600=y |
| 12 | 10 | CONFIG_PCCARD=y |
| @@ -10,7 +10,6 @@ CONFIG_MODULES=y · 9 unmodified lines | ||
| 10 | 10 | CONFIG_MODULE_UNLOAD=y |
| 11 | 11 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 12 | 12 | # CONFIG_BLK_DEV_BSG is not set |
| 13 | −# CONFIG_IOSCHED_CFQ is not set | |
| 14 | 13 | CONFIG_ARCH_PXA=y |
| 15 | 14 | CONFIG_MACH_H5000=y |
| 16 | 15 | CONFIG_AEABI=y |
| @@ -13,7 +13,6 @@ CONFIG_MODULE_UNLOAD=y · 12 unmodified lines | ||
| 13 | 13 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 14 | 14 | CONFIG_MODVERSIONS=y |
| 15 | 15 | # CONFIG_BLK_DEV_BSG is not set |
| 16 | −# CONFIG_IOSCHED_CFQ is not set | |
| 17 | 16 | CONFIG_ARCH_PXA=y |
| 18 | 17 | CONFIG_MACH_INTELMOTE2=y |
| 19 | 18 | CONFIG_NO_HZ=y |
| @@ -32,8 +32,6 @@ CONFIG_KPROBES=y · 31 unmodified lines | ||
| 32 | 32 | CONFIG_MODULES=y |
| 33 | 33 | CONFIG_MODULE_UNLOAD=y |
| 34 | 34 | # CONFIG_BLK_DEV_BSG is not set |
| 35 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 36 | −# CONFIG_IOSCHED_CFQ is not set | |
| 37 | 35 | CONFIG_NET=y |
| 38 | 36 | CONFIG_PACKET=y |
| 39 | 37 | CONFIG_UNIX=y |
| @@ -1,4 +1,3 @@ | ||
| 1 | −CONFIG_CROSS_COMPILE="arm-linux-gnueabihf-" | |
| 2 | 1 | CONFIG_HIGH_RES_TIMERS=y |
| 3 | 2 | CONFIG_PREEMPT=y |
| 4 | 3 | CONFIG_BLK_DEV_INITRD=y |
| @@ -28,10 +27,7 @@ CONFIG_FLASH_SIZE=0x00080000 · 23 unmodified lines | ||
| 28 | 27 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
| 29 | 28 | CONFIG_ZBOOT_ROM_BSS=0x0 |
| 30 | 29 | CONFIG_ARM_APPENDED_DTB=y |
| 31 | −# CONFIG_LBDAF is not set | |
| 32 | 30 | # CONFIG_BLK_DEV_BSG is not set |
| 33 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 34 | −# CONFIG_IOSCHED_CFQ is not set | |
| 35 | 31 | CONFIG_BINFMT_FLAT=y |
| 36 | 32 | CONFIG_BINFMT_ZFLAT=y |
| 37 | 33 | CONFIG_BINFMT_SHARED_FLAT=y |
| @@ -9,8 +9,6 @@ CONFIG_SLAB=y · 8 unmodified lines | ||
| 9 | 9 | CONFIG_MODULES=y |
| 10 | 10 | CONFIG_MODULE_UNLOAD=y |
| 11 | 11 | # CONFIG_BLK_DEV_BSG is not set |
| 12 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 13 | −# CONFIG_IOSCHED_CFQ is not set | |
| 14 | 12 | CONFIG_ARCH_PXA=y |
| 15 | 13 | CONFIG_MACH_H4700=y |
| 16 | 14 | CONFIG_MACH_MAGICIAN=y |
| @@ -15,7 +15,6 @@ CONFIG_EMBEDDED=y · 14 unmodified lines | ||
| 15 | 15 | # CONFIG_SLUB_DEBUG is not set |
| 16 | 16 | # CONFIG_COMPAT_BRK is not set |
| 17 | 17 | # CONFIG_BLK_DEV_BSG is not set |
| 18 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 19 | 18 | CONFIG_ARCH_MULTI_V4=y |
| 20 | 19 | # CONFIG_ARCH_MULTI_V7 is not set |
| 21 | 20 | CONFIG_ARCH_MOXART=y |
| @@ -25,8 +25,6 @@ CONFIG_MODULE_UNLOAD=y · 24 unmodified lines | ||
| 25 | 25 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 26 | 26 | CONFIG_MODVERSIONS=y |
| 27 | 27 | CONFIG_BLK_DEV_INTEGRITY=y |
| 28 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 29 | −# CONFIG_IOSCHED_CFQ is not set | |
| 30 | 28 | CONFIG_NET=y |
| 31 | 29 | CONFIG_PACKET=y |
| 32 | 30 | CONFIG_UNIX=y |
| @@ -18,8 +18,6 @@ CONFIG_MODULES=y · 17 unmodified lines | ||
| 18 | 18 | CONFIG_MODULE_UNLOAD=y |
| 19 | 19 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 20 | 20 | # CONFIG_BLK_DEV_BSG is not set |
| 21 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 22 | −# CONFIG_IOSCHED_CFQ is not set | |
| 23 | 21 | CONFIG_ARCH_OMAP=y |
| 24 | 22 | CONFIG_ARCH_OMAP1=y |
| 25 | 23 | CONFIG_OMAP_RESET_CLOCKS=y |
| @@ -7,8 +7,6 @@ CONFIG_SLAB=y · 6 unmodified lines | ||
| 7 | 7 | CONFIG_MODULES=y |
| 8 | 8 | CONFIG_MODULE_UNLOAD=y |
| 9 | 9 | # CONFIG_BLK_DEV_BSG is not set |
| 10 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 11 | −# CONFIG_IOSCHED_CFQ is not set | |
| 12 | 10 | CONFIG_ARCH_PXA=y |
| 13 | 11 | CONFIG_ARCH_PXA_PALM=y |
| 14 | 12 | # CONFIG_MACH_PALMTX is not set |
| @@ -13,8 +13,6 @@ CONFIG_MODULES=y · 12 unmodified lines | ||
| 13 | 13 | CONFIG_MODULE_UNLOAD=y |
| 14 | 14 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 15 | 15 | # CONFIG_BLK_DEV_BSG is not set |
| 16 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 17 | −# CONFIG_IOSCHED_CFQ is not set | |
| 18 | 16 | CONFIG_ARCH_PXA=y |
| 19 | 17 | CONFIG_MACH_PCM027=y |
| 20 | 18 | CONFIG_MACH_PCM990_BASEBOARD=y |
| @@ -6,8 +6,6 @@ CONFIG_EXPERT=y · 5 unmodified lines | ||
| 6 | 6 | # CONFIG_HOTPLUG is not set |
| 7 | 7 | # CONFIG_SHMEM is not set |
| 8 | 8 | CONFIG_MODULES=y |
| 9 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 10 | −# CONFIG_IOSCHED_CFQ is not set | |
| 11 | 9 | CONFIG_ARCH_SA1100=y |
| 12 | 10 | CONFIG_SA1100_PLEB=y |
| 13 | 11 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
| @@ -8,7 +8,6 @@ CONFIG_SLAB=y · 7 unmodified lines | ||
| 8 | 8 | CONFIG_MODULES=y |
| 9 | 9 | CONFIG_MODULE_UNLOAD=y |
| 10 | 10 | # CONFIG_BLK_DEV_BSG is not set |
| 11 | −# CONFIG_IOSCHED_CFQ is not set | |
| 12 | 11 | CONFIG_ARCH_MULTI_V6=y |
| 13 | 12 | CONFIG_ARCH_REALVIEW=y |
| 14 | 13 | CONFIG_MACH_REALVIEW_EB=y |
| @@ -14,8 +14,6 @@ CONFIG_MODULE_FORCE_LOAD=y · 13 unmodified lines | ||
| 14 | 14 | CONFIG_MODULE_UNLOAD=y |
| 15 | 15 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 16 | 16 | # CONFIG_BLK_DEV_BSG is not set |
| 17 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 18 | −# CONFIG_IOSCHED_CFQ is not set | |
| 19 | 17 | CONFIG_ARCH_AT91=y |
| 20 | 18 | CONFIG_SOC_SAMA5D2=y |
| 21 | 19 | CONFIG_SOC_SAMA5D3=y |
| @@ -182,7 +180,6 @@ CONFIG_USB_GADGET=y · 160 unmodified lines | ||
| 182 | 180 | CONFIG_USB_ATMEL_USBA=y |
| 183 | 181 | CONFIG_USB_G_SERIAL=y |
| 184 | 182 | CONFIG_MMC=y |
| 185 | −# CONFIG_MMC_BLOCK_BOUNCE is not set | |
| 186 | 183 | CONFIG_MMC_SDHCI=y |
| 187 | 184 | CONFIG_MMC_SDHCI_PLTFM=y |
| 188 | 185 | CONFIG_MMC_SDHCI_OF_AT91=y |
| @@ -14,8 +14,6 @@ CONFIG_EMBEDDED=y · 13 unmodified lines | ||
| 14 | 14 | # CONFIG_VM_EVENT_COUNTERS is not set |
| 15 | 15 | # CONFIG_SLUB_DEBUG is not set |
| 16 | 16 | # CONFIG_BLK_DEV_BSG is not set |
| 17 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 18 | −# CONFIG_IOSCHED_CFQ is not set | |
| 19 | 17 | # CONFIG_MMU is not set |
| 20 | 18 | CONFIG_ARCH_STM32=y |
| 21 | 19 | CONFIG_CPU_V7M_NUM_IRQ=240 |
| @@ -85,6 +85,7 @@ CONFIG_BATTERY_AXP20X=y · 84 unmodified lines | ||
| 85 | 85 | CONFIG_AXP20X_POWER=y |
| 86 | 86 | CONFIG_THERMAL=y |
| 87 | 87 | CONFIG_CPU_THERMAL=y |
| 88 | +CONFIG_SUN8I_THERMAL=y | |
| 88 | 89 | CONFIG_WATCHDOG=y |
| 89 | 90 | CONFIG_SUNXI_WATCHDOG=y |
| 90 | 91 | CONFIG_MFD_AC100=y |
| @@ -11,7 +11,6 @@ CONFIG_MODULES=y · 10 unmodified lines | ||
| 11 | 11 | CONFIG_MODULE_UNLOAD=y |
| 12 | 12 | # CONFIG_BLK_DEV_BSG is not set |
| 13 | 13 | CONFIG_PARTITION_ADVANCED=y |
| 14 | −# CONFIG_IOSCHED_CFQ is not set | |
| 15 | 14 | # CONFIG_ARCH_MULTI_V7 is not set |
| 16 | 15 | CONFIG_ARCH_U300=y |
| 17 | 16 | CONFIG_MACH_U300_SPIDUMMY=y |
| @@ -46,7 +45,6 @@ CONFIG_FB=y · 28 unmodified lines | ||
| 46 | 45 | CONFIG_BACKLIGHT_CLASS_DEVICE=y |
| 47 | 46 | # CONFIG_USB_SUPPORT is not set |
| 48 | 47 | CONFIG_MMC=y |
| 49 | −# CONFIG_MMC_BLOCK_BOUNCE is not set | |
| 50 | 48 | CONFIG_MMC_ARMMMCI=y |
| 51 | 49 | CONFIG_RTC_CLASS=y |
| 52 | 50 | # CONFIG_RTC_HCTOSYS is not set |
| @@ -15,8 +15,6 @@ CONFIG_OPROFILE=y · 14 unmodified lines | ||
| 15 | 15 | CONFIG_MODULES=y |
| 16 | 16 | CONFIG_MODULE_UNLOAD=y |
| 17 | 17 | # CONFIG_BLK_DEV_BSG is not set |
| 18 | −# CONFIG_IOSCHED_DEADLINE is not set | |
| 19 | −# CONFIG_IOSCHED_CFQ is not set | |
| 20 | 18 | CONFIG_ARCH_VEXPRESS=y |
| 21 | 19 | CONFIG_ARCH_VEXPRESS_DCSCB=y |
| 22 | 20 | CONFIG_ARCH_VEXPRESS_TC2_PM=y |
| @@ -9,7 +9,6 @@ CONFIG_SLAB=y · 8 unmodified lines | ||
| 9 | 9 | CONFIG_MODULES=y |
| 10 | 10 | CONFIG_MODULE_UNLOAD=y |
| 11 | 11 | # CONFIG_BLK_DEV_BSG is not set |
| 12 | −# CONFIG_IOSCHED_CFQ is not set | |
| 13 | 12 | CONFIG_ARCH_PXA=y |
| 14 | 13 | CONFIG_ARCH_VIPER=y |
| 15 | 14 | CONFIG_IWMMXT=y |
| @@ -4,7 +4,6 @@ CONFIG_LOG_BUF_SHIFT=13 · 3 unmodified lines | ||
| 4 | 4 | CONFIG_MODULES=y |
| 5 | 5 | CONFIG_MODULE_UNLOAD=y |
| 6 | 6 | # CONFIG_BLK_DEV_BSG is not set |
| 7 | −# CONFIG_IOSCHED_CFQ is not set | |
| 8 | 7 | CONFIG_ARCH_PXA=y |
| 9 | 8 | CONFIG_MACH_ARCOM_ZEUS=y |
| 10 | 9 | CONFIG_PCCARD=m |
| @@ -137,7 +136,6 @@ CONFIG_USB_MASS_STORAGE=m · 126 unmodified lines | ||
| 137 | 136 | CONFIG_USB_G_SERIAL=m |
| 138 | 137 | CONFIG_USB_G_PRINTER=m |
| 139 | 138 | CONFIG_MMC=y |
| 140 | −# CONFIG_MMC_BLOCK_BOUNCE is not set | |
| 141 | 139 | CONFIG_MMC_PXA=y |
| 142 | 140 | CONFIG_NEW_LEDS=y |
| 143 | 141 | CONFIG_LEDS_CLASS=m |
| @@ -16,7 +16,6 @@ CONFIG_EMBEDDED=y · 15 unmodified lines | ||
| 16 | 16 | CONFIG_PERF_EVENTS=y |
| 17 | 17 | CONFIG_SLAB=y |
| 18 | 18 | # CONFIG_BLK_DEV_BSG is not set |
| 19 | −# CONFIG_IOSCHED_CFQ is not set | |
| 20 | 19 | CONFIG_ARCH_ZX=y |
| 21 | 20 | CONFIG_SOC_ZX296702=y |
| 22 | 21 | # CONFIG_SWP_EMULATE is not set |
| @@ -392,9 +392,6 @@ static inline void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu) {} · 391 unmodified lines | ||
| 392 | 392 | static inline void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) {} |
| 393 | 393 | static inline void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu) {} |
| 394 | 394 | |
| 395 | −static inline void kvm_arm_vhe_guest_enter(void) {} | |
| 396 | −static inline void kvm_arm_vhe_guest_exit(void) {} | |
| 397 | − | |
| 398 | 395 | #define KVM_BP_HARDEN_UNKNOWN -1 |
| 399 | 396 | #define KVM_BP_HARDEN_WA_NEEDED 0 |
| 400 | 397 | #define KVM_BP_HARDEN_NOT_REQUIRED 1 |
| @@ -78,13 +78,10 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old, · 77 unmodified lines | ||
| 78 | 78 | { |
| 79 | 79 | unsigned long replaced; |
| 80 | 80 | |
| 81 | − if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) { | |
| 81 | + if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) | |
| 82 | 82 | old = __opcode_to_mem_thumb32(old); |
| 83 | − new = __opcode_to_mem_thumb32(new); | |
| 84 | − } else { | |
| 83 | + else | |
| 85 | 84 | old = __opcode_to_mem_arm(old); |
| 86 | − new = __opcode_to_mem_arm(new); | |
| 87 | − } | |
| 88 | 85 | |
| 89 | 86 | if (validate) { |
| 90 | 87 | if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE)) |
| @@ -16,10 +16,10 @@ struct patch { · 15 unmodified lines | ||
| 16 | 16 | unsigned int insn; |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | +#ifdef CONFIG_MMU | |
| 19 | 20 | static DEFINE_RAW_SPINLOCK(patch_lock); |
| 20 | 21 | |
| 21 | 22 | static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) |
| 22 | − __acquires(&patch_lock) | |
| 23 | 23 | { |
| 24 | 24 | unsigned int uintaddr = (uintptr_t) addr; |
| 25 | 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 | 35 | if (flags) |
| 36 | 36 | raw_spin_lock_irqsave(&patch_lock, *flags); |
| 37 | − else | |
| 38 | − __acquire(&patch_lock); | |
| 39 | 37 | |
| 40 | 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 | |
| 45 | 43 | static void __kprobes patch_unmap(int fixmap, unsigned long *flags) |
| 46 | − __releases(&patch_lock) | |
| 47 | 44 | { |
| 48 | 45 | clear_fixmap(fixmap); |
| 49 | 46 | |
| 50 | 47 | if (flags) |
| 51 | 48 | raw_spin_unlock_irqrestore(&patch_lock, *flags); |
| 52 | − else | |
| 53 | − __release(&patch_lock); | |
| 54 | 49 | } |
| 50 | +#else | |
| 51 | +static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) | |
| 52 | +{ | |
| 53 | + return addr; | |
| 54 | +} | |
| 55 | +static void __kprobes patch_unmap(int fixmap, unsigned long *flags) { } | |
| 56 | +#endif | |
| 55 | 57 | |
| 56 | 58 | void __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 | 67 | if (remap) |
| 66 | 68 | waddr = patch_map(addr, FIX_TEXT_POKE0, &flags); |
| 67 | − else | |
| 68 | − __acquire(&patch_lock); | |
| 69 | 69 | |
| 70 | 70 | if (thumb2 && __opcode_is_thumb16(insn)) { |
| 71 | 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 | 102 | if (waddr != addr) { |
| 103 | 103 | flush_kernel_vmap_range(waddr, twopage ? size / 2 : size); |
| 104 | 104 | patch_unmap(FIX_TEXT_POKE0, &flags); |
| 105 | − } else | |
| 106 | − __release(&patch_lock); | |
| 105 | + } | |
| 107 | 106 | |
| 108 | 107 | flush_icache_range((uintptr_t)(addr), |
| 109 | 108 | (uintptr_t)(addr) + size); |
| @@ -11,7 +11,7 @@ config ARCH_NPCM7XX · 10 unmodified lines | ||
| 11 | 11 | depends on ARCH_MULTI_V7 |
| 12 | 12 | select PINCTRL_NPCM7XX |
| 13 | 13 | select NPCM7XX_TIMER |
| 14 | − select ARCH_REQUIRE_GPIOLIB | |
| 14 | + select GPIOLIB | |
| 15 | 15 | select CACHE_L2X0 |
| 16 | 16 | select ARM_GIC |
| 17 | 17 | select HAVE_ARM_TWD if SMP |
| @@ -161,10 +161,10 @@ · 160 unmodified lines | ||
| 161 | 161 | bus-range = <0x0 0x1>; |
| 162 | 162 | reg = <0x0 0x40000000 0x0 0x10000000>; |
| 163 | 163 | ranges = <0x2000000 0x0 0x50000000 0x0 0x50000000 0x0 0x10000000>; |
| 164 | − interrupt-map = <0 0 0 1 &gic GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>, | |
| 165 | − <0 0 0 2 &gic GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>, | |
| 166 | − <0 0 0 3 &gic GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>, | |
| 167 | − <0 0 0 4 &gic GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>; | |
| 164 | + interrupt-map = <0 0 0 1 &gic 0 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>, | |
| 165 | + <0 0 0 2 &gic 0 0 GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>, | |
| 166 | + <0 0 0 3 &gic 0 0 GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>, | |
| 167 | + <0 0 0 4 &gic 0 0 GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>; | |
| 168 | 168 | interrupt-map-mask = <0x0 0x0 0x0 0x7>; |
| 169 | 169 | msi-map = <0x0 &its 0x0 0x10000>; |
| 170 | 170 | iommu-map = <0x0 &smmu 0x0 0x10000>; |
| @@ -452,6 +452,7 @@ CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y · 451 unmodified lines | ||
| 452 | 452 | CONFIG_CPU_THERMAL=y |
| 453 | 453 | CONFIG_THERMAL_EMULATION=y |
| 454 | 454 | CONFIG_QORIQ_THERMAL=m |
| 455 | +CONFIG_SUN8I_THERMAL=y | |
| 455 | 456 | CONFIG_ROCKCHIP_THERMAL=m |
| 456 | 457 | CONFIG_RCAR_THERMAL=y |
| 457 | 458 | CONFIG_RCAR_GEN3_THERMAL=y |
| @@ -547,6 +548,7 @@ CONFIG_ROCKCHIP_DW_MIPI_DSI=y · 89 unmodified lines | ||
| 547 | 548 | CONFIG_ROCKCHIP_INNO_HDMI=y |
| 548 | 549 | CONFIG_DRM_RCAR_DU=m |
| 549 | 550 | CONFIG_DRM_SUN4I=m |
| 551 | +CONFIG_DRM_SUN6I_DSI=m | |
| 550 | 552 | CONFIG_DRM_SUN8I_DW_HDMI=m |
| 551 | 553 | CONFIG_DRM_SUN8I_MIXER=m |
| 552 | 554 | CONFIG_DRM_MSM=m |
| @@ -681,7 +683,7 @@ CONFIG_RTC_DRV_SNVS=m · 128 unmodified lines | ||
| 681 | 683 | CONFIG_RTC_DRV_IMX_SC=m |
| 682 | 684 | CONFIG_RTC_DRV_XGENE=y |
| 683 | 685 | CONFIG_DMADEVICES=y |
| 684 | −CONFIG_DMA_BCM2835=m | |
| 686 | +CONFIG_DMA_BCM2835=y | |
| 685 | 687 | CONFIG_DMA_SUN6I=m |
| 686 | 688 | CONFIG_FSL_EDMA=y |
| 687 | 689 | CONFIG_IMX_SDMA=y |
| @@ -32,7 +32,7 @@ static inline void gic_write_eoir(u32 irq) · 31 unmodified lines | ||
| 32 | 32 | isb(); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | −static inline void gic_write_dir(u32 irq) | |
| 35 | +static __always_inline void gic_write_dir(u32 irq) | |
| 36 | 36 | { |
| 37 | 37 | write_sysreg_s(irq, SYS_ICC_DIR_EL1); |
| 38 | 38 | isb(); |
| @@ -69,7 +69,7 @@ static inline int icache_is_aliasing(void) · 68 unmodified lines | ||
| 69 | 69 | return test_bit(ICACHEF_ALIASING, &__icache_flags); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | −static inline int icache_is_vpipt(void) | |
| 72 | +static __always_inline int icache_is_vpipt(void) | |
| 73 | 73 | { |
| 74 | 74 | return test_bit(ICACHEF_VPIPT, &__icache_flags); |
| 75 | 75 | } |
| @@ -145,7 +145,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *, · 144 unmodified lines | ||
| 145 | 145 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 |
| 146 | 146 | extern void flush_dcache_page(struct page *); |
| 147 | 147 | |
| 148 | −static inline void __flush_icache_all(void) | |
| 148 | +static __always_inline void __flush_icache_all(void) | |
| 149 | 149 | { |
| 150 | 150 | if (cpus_have_const_cap(ARM64_HAS_CACHE_DIC)) |
| 151 | 151 | return; |
| @@ -435,13 +435,13 @@ cpuid_feature_extract_signed_field(u64 features, int field) · 434 unmodified lines | ||
| 435 | 435 | return cpuid_feature_extract_signed_field_width(features, field, 4); |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | −static inline unsigned int __attribute_const__ | |
| 438 | +static __always_inline unsigned int __attribute_const__ | |
| 439 | 439 | cpuid_feature_extract_unsigned_field_width(u64 features, int field, int width) |
| 440 | 440 | { |
| 441 | 441 | return (u64)(features << (64 - width - field)) >> (64 - width); |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | −static inline unsigned int __attribute_const__ | |
| 444 | +static __always_inline unsigned int __attribute_const__ | |
| 445 | 445 | cpuid_feature_extract_unsigned_field(u64 features, int field) |
| 446 | 446 | { |
| 447 | 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 | 564 | return val == 0x1; |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | −static inline bool system_supports_fpsimd(void) | |
| 567 | +static __always_inline bool system_supports_fpsimd(void) | |
| 568 | 568 | { |
| 569 | 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 | 575 | !cpus_have_const_cap(ARM64_HAS_PAN); |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | −static inline bool system_supports_sve(void) | |
| 578 | +static __always_inline bool system_supports_sve(void) | |
| 579 | 579 | { |
| 580 | 580 | return IS_ENABLED(CONFIG_ARM64_SVE) && |
| 581 | 581 | cpus_have_const_cap(ARM64_SVE); |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | −static inline bool system_supports_cnp(void) | |
| 584 | +static __always_inline bool system_supports_cnp(void) | |
| 585 | 585 | { |
| 586 | 586 | return IS_ENABLED(CONFIG_ARM64_CNP) && |
| 587 | 587 | cpus_have_const_cap(ARM64_HAS_CNP); |
| @@ -33,7 +33,6 @@ static inline u32 disr_to_esr(u64 disr) · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | asmlinkage void enter_from_user_mode(void); |
| 35 | 35 | void do_mem_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs); |
| 36 | −void do_sp_pc_abort(unsigned long addr, unsigned int esr, struct pt_regs *regs); | |
| 37 | 36 | void do_undefinstr(struct pt_regs *regs); |
| 38 | 37 | asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr); |
| 39 | 38 | void do_debug_exception(unsigned long addr_if_watchpoint, unsigned int esr, |
| @@ -47,7 +46,4 @@ void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr); · 7 unmodified lines | ||
| 47 | 46 | void do_cp15instr(unsigned int esr, struct pt_regs *regs); |
| 48 | 47 | void do_el0_svc(struct pt_regs *regs); |
| 49 | 48 | void do_el0_svc_compat(struct pt_regs *regs); |
| 50 | −void do_el0_ia_bp_hardening(unsigned long addr, unsigned int esr, | |
| 51 | − struct pt_regs *regs); | |
| 52 | − | |
| 53 | 49 | #endif /* __ASM_EXCEPTION_H */ |
| @@ -34,7 +34,7 @@ static inline void __raw_writew(u16 val, volatile void __iomem *addr) · 33 unmodified lines | ||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | #define __raw_writel __raw_writel |
| 37 | −static inline void __raw_writel(u32 val, volatile void __iomem *addr) | |
| 37 | +static __always_inline void __raw_writel(u32 val, volatile void __iomem *addr) | |
| 38 | 38 | { |
| 39 | 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 | 71 | #define __raw_readl __raw_readl |
| 72 | −static inline u32 __raw_readl(const volatile void __iomem *addr) | |
| 72 | +static __always_inline u32 __raw_readl(const volatile void __iomem *addr) | |
| 73 | 73 | { |
| 74 | 74 | u32 val; |
| 75 | 75 | asm volatile(ALTERNATIVE("ldr %w0, [%1]", |
| @@ -36,7 +36,7 @@ void kvm_inject_undef32(struct kvm_vcpu *vcpu); · 35 unmodified lines | ||
| 36 | 36 | void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr); |
| 37 | 37 | void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr); |
| 38 | 38 | |
| 39 | −static inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu) | |
| 39 | +static __always_inline bool vcpu_el1_is_32bit(struct kvm_vcpu *vcpu) | |
| 40 | 40 | { |
| 41 | 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 | 127 | vcpu->arch.vsesr_el2 = vsesr; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | −static inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu) | |
| 130 | +static __always_inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu) | |
| 131 | 131 | { |
| 132 | 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 | 153 | *__vcpu_elr_el1(vcpu) = v; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | −static inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu) | |
| 156 | +static __always_inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu) | |
| 157 | 157 | { |
| 158 | 158 | return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pstate; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | −static inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu) | |
| 161 | +static __always_inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu) | |
| 162 | 162 | { |
| 163 | 163 | return !!(*vcpu_cpsr(vcpu) & PSR_MODE32_BIT); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | −static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu) | |
| 166 | +static __always_inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu) | |
| 167 | 167 | { |
| 168 | 168 | if (vcpu_mode_is_32bit(vcpu)) |
| 169 | 169 | return kvm_condition_valid32(vcpu); |
| @@ -181,13 +181,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu) · 11 unmodified lines | ||
| 181 | 181 | * coming from a read of ESR_EL2. Otherwise, it may give the wrong result on |
| 182 | 182 | * AArch32 with banked registers. |
| 183 | 183 | */ |
| 184 | −static inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu, | |
| 184 | +static __always_inline unsigned long vcpu_get_reg(const struct kvm_vcpu *vcpu, | |
| 185 | 185 | u8 reg_num) |
| 186 | 186 | { |
| 187 | 187 | return (reg_num == 31) ? 0 : vcpu_gp_regs(vcpu)->regs.regs[reg_num]; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | −static inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num, | |
| 190 | +static __always_inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num, | |
| 191 | 191 | unsigned long val) |
| 192 | 192 | { |
| 193 | 193 | if (reg_num != 31) |
| @@ -264,12 +264,12 @@ static inline bool vcpu_mode_priv(const struct kvm_vcpu *vcpu) · 70 unmodified lines | ||
| 264 | 264 | return mode != PSR_MODE_EL0t; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | −static inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu) | |
| 267 | +static __always_inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu) | |
| 268 | 268 | { |
| 269 | 269 | return vcpu->arch.fault.esr_el2; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | −static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) | |
| 272 | +static __always_inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) | |
| 273 | 273 | { |
| 274 | 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 | 279 | return -1; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | −static inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu) | |
| 282 | +static __always_inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu) | |
| 283 | 283 | { |
| 284 | 284 | return vcpu->arch.fault.far_el2; |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | −static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu) | |
| 287 | +static __always_inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu) | |
| 288 | 288 | { |
| 289 | 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 | 299 | return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | −static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu) | |
| 302 | +static __always_inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu) | |
| 303 | 303 | { |
| 304 | 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 | 319 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SF); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | −static inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu) | |
| 322 | +static __always_inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu) | |
| 323 | 323 | { |
| 324 | 324 | return (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | −static inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu) | |
| 327 | +static __always_inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu) | |
| 328 | 328 | { |
| 329 | 329 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_S1PTW); |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | −static inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu) | |
| 332 | +static __always_inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu) | |
| 333 | 333 | { |
| 334 | 334 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WNR) || |
| 335 | 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 | 340 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_CM); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | −static inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu) | |
| 343 | +static __always_inline unsigned int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu) | |
| 344 | 344 | { |
| 345 | 345 | return 1 << ((kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SAS) >> ESR_ELx_SAS_SHIFT); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /* This one is not specific to Data Abort */ |
| 349 | −static inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu) | |
| 349 | +static __always_inline bool kvm_vcpu_trap_il_is32bit(const struct kvm_vcpu *vcpu) | |
| 350 | 350 | { |
| 351 | 351 | return !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_IL); |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | −static inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu) | |
| 354 | +static __always_inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu) | |
| 355 | 355 | { |
| 356 | 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 | 361 | return kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_IABT_LOW; |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | −static inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu) | |
| 364 | +static __always_inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu) | |
| 365 | 365 | { |
| 366 | 366 | return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC; |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | −static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu) | |
| 369 | +static __always_inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu) | |
| 370 | 370 | { |
| 371 | 371 | return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_FSC_TYPE; |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | −static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) | |
| 374 | +static __always_inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu) | |
| 375 | 375 | { |
| 376 | 376 | switch (kvm_vcpu_trap_get_fault(vcpu)) { |
| 377 | 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 | |
| 393 | −static inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu) | |
| 393 | +static __always_inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu) | |
| 394 | 394 | { |
| 395 | 395 | u32 esr = kvm_vcpu_get_hsr(vcpu); |
| 396 | 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 | 504 | return data; /* Leave LE untouched */ |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | −static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr) | |
| 507 | +static __always_inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr) | |
| 508 | 508 | { |
| 509 | 509 | if (vcpu_mode_is_32bit(vcpu)) |
| 510 | 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 | 519 | * Skip an instruction which has been emulated at hyp while most guest sysregs |
| 520 | 520 | * are live. |
| 521 | 521 | */ |
| 522 | −static inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu) | |
| 522 | +static __always_inline void __hyp_text __kvm_skip_instr(struct kvm_vcpu *vcpu) | |
| 523 | 523 | { |
| 524 | 524 | *vcpu_pc(vcpu) = read_sysreg_el2(SYS_ELR); |
| 525 | 525 | vcpu->arch.ctxt.gp_regs.regs.pstate = read_sysreg_el2(SYS_SPSR); |
| @@ -626,38 +626,6 @@ static inline void kvm_set_pmu_events(u32 set, struct perf_event_attr *attr) {} · 625 unmodified lines | ||
| 626 | 626 | static inline void kvm_clr_pmu_events(u32 clr) {} |
| 627 | 627 | #endif |
| 628 | 628 | |
| 629 | −static inline void kvm_arm_vhe_guest_enter(void) | |
| 630 | −{ | |
| 631 | − local_daif_mask(); | |
| 632 | − | |
| 633 | − /* | |
| 634 | − * Having IRQs masked via PMR when entering the guest means the GIC | |
| 635 | − * will not signal the CPU of interrupts of lower priority, and the | |
| 636 | − * only way to get out will be via guest exceptions. | |
| 637 | − * Naturally, we want to avoid this. | |
| 638 | − * | |
| 639 | − * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a | |
| 640 | − * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU. | |
| 641 | − */ | |
| 642 | − pmr_sync(); | |
| 643 | −} | |
| 644 | − | |
| 645 | −static inline void kvm_arm_vhe_guest_exit(void) | |
| 646 | −{ | |
| 647 | − /* | |
| 648 | − * local_daif_restore() takes care to properly restore PSTATE.DAIF | |
| 649 | − * and the GIC PMR if the host is using IRQ priorities. | |
| 650 | − */ | |
| 651 | − local_daif_restore(DAIF_PROCCTX_NOIRQ); | |
| 652 | − | |
| 653 | − /* | |
| 654 | − * When we exit from the guest we change a number of CPU configuration | |
| 655 | − * parameters, such as traps. Make sure these changes take effect | |
| 656 | − * before running the host or additional guests. | |
| 657 | − */ | |
| 658 | − isb(); | |
| 659 | −} | |
| 660 | − | |
| 661 | 629 | #define KVM_BP_HARDEN_UNKNOWN -1 |
| 662 | 630 | #define KVM_BP_HARDEN_WA_NEEDED 0 |
| 663 | 631 | #define KVM_BP_HARDEN_NOT_REQUIRED 1 |
| @@ -47,6 +47,13 @@ · 46 unmodified lines | ||
| 47 | 47 | #define read_sysreg_el2(r) read_sysreg_elx(r, _EL2, _EL1) |
| 48 | 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 | + | |
| 50 | 57 | int __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu); |
| 51 | 58 | |
| 52 | 59 | void __vgic_v3_save_state(struct kvm_vcpu *vcpu); |
| @@ -93,7 +93,7 @@ void kvm_update_va_mask(struct alt_instr *alt, · 92 unmodified lines | ||
| 93 | 93 | __le32 *origptr, __le32 *updptr, int nr_inst); |
| 94 | 94 | void kvm_compute_layout(void); |
| 95 | 95 | |
| 96 | −static inline unsigned long __kern_hyp_va(unsigned long v) | |
| 96 | +static __always_inline unsigned long __kern_hyp_va(unsigned long v) | |
| 97 | 97 | { |
| 98 | 98 | asm volatile(ALTERNATIVE_CB("and %0, %0, #1\n" |
| 99 | 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 | ||
| 473 | 473 | extern void *__kvm_bp_vect_base; |
| 474 | 474 | extern int __kvm_harden_el2_vector_slot; |
| 475 | 475 | |
| 476 | +/* This is only called on a VHE system */ | |
| 476 | 477 | static inline void *kvm_get_hyp_vector(void) |
| 477 | 478 | { |
| 478 | 479 | struct bp_hardening_data *data = arm64_get_bp_hardening_data(); |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | #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 | 11 | #include <linux/compiler_types.h> |
| 12 | 12 | #include <linux/export.h> |
| @@ -213,7 +213,7 @@ static inline unsigned long kaslr_offset(void) · 212 unmodified lines | ||
| 213 | 213 | ((__force __typeof__(addr))sign_extend64((__force u64)(addr), 55)) |
| 214 | 214 | |
| 215 | 215 | #define untagged_addr(addr) ({ \ |
| 216 | − u64 __addr = (__force u64)addr; \ | |
| 216 | + u64 __addr = (__force u64)(addr); \ | |
| 217 | 217 | __addr &= __untagged_addr(__addr); \ |
| 218 | 218 | (__force __typeof__(addr))__addr; \ |
| 219 | 219 | }) |
| @@ -18,6 +18,10 @@ · 17 unmodified lines | ||
| 18 | 18 | * See: |
| 19 | 19 | * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net |
| 20 | 20 | */ |
| 21 | −#define vcpu_is_preempted(cpu) false | |
| 21 | +#define vcpu_is_preempted vcpu_is_preempted | |
| 22 | +static inline bool vcpu_is_preempted(int cpu) | |
| 23 | +{ | |
| 24 | + return false; | |
| 25 | +} | |
| 22 | 26 | |
| 23 | 27 | #endif /* __ASM_SPINLOCK_H */ |
| @@ -83,7 +83,7 @@ static inline bool is_kernel_in_hyp_mode(void) · 82 unmodified lines | ||
| 83 | 83 | return read_sysreg(CurrentEL) == CurrentEL_EL2; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | −static inline bool has_vhe(void) | |
| 86 | +static __always_inline bool has_vhe(void) | |
| 87 | 87 | { |
| 88 | 88 | if (cpus_have_const_cap(ARM64_HAS_VIRT_HOST_EXTN)) |
| 89 | 89 | return true; |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <linux/sched.h> |
| 12 | 12 | #include <linux/types.h> |
| 13 | 13 | |
| 14 | +#include <asm/archrandom.h> | |
| 14 | 15 | #include <asm/cacheflush.h> |
| 15 | 16 | #include <asm/fixmap.h> |
| 16 | 17 | #include <asm/kernel-pgtable.h> |
| @@ -466,6 +466,13 @@ static void ssbs_thread_switch(struct task_struct *next) · 465 unmodified lines | ||
| 466 | 466 | if (unlikely(next->flags & PF_KTHREAD)) |
| 467 | 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 | 476 | /* If the mitigation is enabled, then we leave SSBS clear. */ |
| 470 | 477 | if ((arm64_get_ssbd_state() == ARM64_SSBD_FORCE_ENABLE) || |
| 471 | 478 | test_tsk_thread_flag(next, TIF_SSBD)) |
| @@ -608,8 +615,6 @@ long get_tagged_addr_ctrl(void) · 136 unmodified lines | ||
| 608 | 615 | * only prevents the tagged address ABI enabling via prctl() and does not |
| 609 | 616 | * disable it for tasks that already opted in to the relaxed ABI. |
| 610 | 617 | */ |
| 611 | −static int zero; | |
| 612 | −static int one = 1; | |
| 613 | 618 | |
| 614 | 619 | static 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 | 623 | .data = &tagged_addr_disabled, |
| 619 | 624 | .maxlen = sizeof(int), |
| 620 | 625 | .proc_handler = proc_dointvec_minmax, |
| 621 | − .extra1 = &zero, | |
| 622 | − .extra2 = &one, | |
| 626 | + .extra1 = SYSCTL_ZERO, | |
| 627 | + .extra2 = SYSCTL_ONE, | |
| 623 | 628 | }, |
| 624 | 629 | { } |
| 625 | 630 | }; |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #include <linux/irq.h> |
| 24 | 24 | #include <linux/delay.h> |
| 25 | 25 | #include <linux/clocksource.h> |
| 26 | −#include <linux/clk-provider.h> | |
| 26 | +#include <linux/of_clk.h> | |
| 27 | 27 | #include <linux/acpi.h> |
| 28 | 28 | |
| 29 | 29 | #include <clocksource/arm_arch_timer.h> |
| @@ -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 | 627 | /* Switch to the guest for VHE systems running in EL2 */ |
| 628 | −int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) | |
| 628 | +static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) | |
| 629 | 629 | { |
| 630 | 630 | struct kvm_cpu_context *host_ctxt; |
| 631 | 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 | 679 | return exit_code; |
| 680 | 680 | } |
| 681 | −NOKPROBE_SYMBOL(kvm_vcpu_run_vhe); | |
| 681 | +NOKPROBE_SYMBOL(__kvm_vcpu_run_vhe); | |
| 682 | + | |
| 683 | +int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) | |
| 684 | +{ | |
| 685 | + int ret; | |
| 686 | + | |
| 687 | + local_daif_mask(); | |
| 688 | + | |
| 689 | + /* | |
| 690 | + * Having IRQs masked via PMR when entering the guest means the GIC | |
| 691 | + * will not signal the CPU of interrupts of lower priority, and the | |
| 692 | + * only way to get out will be via guest exceptions. | |
| 693 | + * Naturally, we want to avoid this. | |
| 694 | + * | |
| 695 | + * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a | |
| 696 | + * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU. | |
| 697 | + */ | |
| 698 | + pmr_sync(); | |
| 699 | + | |
| 700 | + ret = __kvm_vcpu_run_vhe(vcpu); | |
| 701 | + | |
| 702 | + /* | |
| 703 | + * local_daif_restore() takes care to properly restore PSTATE.DAIF | |
| 704 | + * and the GIC PMR if the host is using IRQ priorities. | |
| 705 | + */ | |
| 706 | + local_daif_restore(DAIF_PROCCTX_NOIRQ); | |
| 707 | + | |
| 708 | + /* | |
| 709 | + * When we exit from the guest we change a number of CPU configuration | |
| 710 | + * parameters, such as traps. Make sure these changes take effect | |
| 711 | + * before running the host or additional guests. | |
| 712 | + */ | |
| 713 | + isb(); | |
| 714 | + | |
| 715 | + return ret; | |
| 716 | +} | |
| 682 | 717 | |
| 683 | 718 | /* Switch to the guest for legacy non-VHE systems */ |
| 684 | 719 | int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu) |
| @@ -69,14 +69,14 @@ int __hyp_text __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu) · 68 unmodified lines | ||
| 69 | 69 | u32 data = vcpu_get_reg(vcpu, rd); |
| 70 | 70 | if (__is_be(vcpu)) { |
| 71 | 71 | /* guest pre-swabbed data, undo this for writel() */ |
| 72 | − data = swab32(data); | |
| 72 | + data = __kvm_swab32(data); | |
| 73 | 73 | } |
| 74 | 74 | writel_relaxed(data, addr); |
| 75 | 75 | } else { |
| 76 | 76 | u32 data = readl_relaxed(addr); |
| 77 | 77 | if (__is_be(vcpu)) { |
| 78 | 78 | /* guest expects swabbed data */ |
| 79 | − data = swab32(data); | |
| 79 | + data = __kvm_swab32(data); | |
| 80 | 80 | } |
| 81 | 81 | vcpu_set_reg(vcpu, rd, data); |
| 82 | 82 | } |
| @@ -9,7 +9,6 @@ config CSKY · 8 unmodified lines | ||
| 9 | 9 | select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2 |
| 10 | 10 | select COMMON_CLK |
| 11 | 11 | select CLKSRC_MMIO |
| 12 | − select CLKSRC_OF | |
| 13 | 12 | select CSKY_MPINTC if CPU_CK860 |
| 14 | 13 | select CSKY_MP_TIMER if CPU_CK860 |
| 15 | 14 | select CSKY_APB_INTC |
| @@ -37,6 +36,7 @@ config CSKY · 21 unmodified lines | ||
| 37 | 36 | select GX6605S_TIMER if CPU_CK610 |
| 38 | 37 | select HAVE_ARCH_TRACEHOOK |
| 39 | 38 | select HAVE_ARCH_AUDITSYSCALL |
| 39 | + select HAVE_COPY_THREAD_TLS | |
| 40 | 40 | select HAVE_DYNAMIC_FTRACE |
| 41 | 41 | select HAVE_FUNCTION_TRACER |
| 42 | 42 | select HAVE_FUNCTION_GRAPH_TRACER |
| @@ -47,8 +47,8 @@ config CSKY · 4 unmodified lines | ||
| 47 | 47 | select HAVE_PERF_EVENTS |
| 48 | 48 | select HAVE_PERF_REGS |
| 49 | 49 | select HAVE_PERF_USER_STACK_DUMP |
| 50 | − select HAVE_DMA_API_DEBUG | |
| 51 | 50 | select HAVE_DMA_CONTIGUOUS |
| 51 | + select HAVE_STACKPROTECTOR | |
| 52 | 52 | select HAVE_SYSCALL_TRACEPOINTS |
| 53 | 53 | select MAY_HAVE_SPARSE_IRQ |
| 54 | 54 | select MODULES_USE_ELF_RELA if MODULES |
| @@ -59,6 +59,11 @@ config CSKY · 4 unmodified lines | ||
| 59 | 59 | select TIMER_OF |
| 60 | 60 | select USB_ARCH_HAS_EHCI |
| 61 | 61 | 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 | |
| 63 | 68 | config CPU_HAS_CACHEV2 |
| 64 | 69 | bool |
| @@ -75,7 +80,7 @@ config CPU_HAS_TLBI · 10 unmodified lines | ||
| 75 | 80 | config CPU_HAS_LDSTEX |
| 76 | 81 | bool |
| 77 | 82 | 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 | |
| 80 | 85 | config CPU_NEED_TLBSYNC |
| 81 | 86 | bool |
| @@ -188,6 +193,40 @@ config CPU_PM_STOP · 106 unmodified lines | ||
| 188 | 193 | bool "stop" |
| 189 | 194 | endchoice |
| 190 | 195 | |
| 196 | +menuconfig HAVE_TCM | |
| 197 | + bool "Tightly-Coupled/Sram Memory" | |
| 198 | + select GENERIC_ALLOCATOR | |
| 199 | + help | |
| 200 | + The implementation are not only used by TCM (Tightly-Coupled Meory) | |
| 201 | + but also used by sram on SOC bus. It follow existed linux tcm | |
| 202 | + software interface, so that old tcm application codes could be | |
| 203 | + re-used directly. | |
| 204 | + | |
| 205 | +if HAVE_TCM | |
| 206 | +config ITCM_RAM_BASE | |
| 207 | + hex "ITCM ram base" | |
| 208 | + default 0xffffffff | |
| 209 | + | |
| 210 | +config ITCM_NR_PAGES | |
| 211 | + int "Page count of ITCM size: NR*4KB" | |
| 212 | + range 1 256 | |
| 213 | + default 32 | |
| 214 | + | |
| 215 | +config HAVE_DTCM | |
| 216 | + bool "DTCM Support" | |
| 217 | + | |
| 218 | +config DTCM_RAM_BASE | |
| 219 | + hex "DTCM ram base" | |
| 220 | + depends on HAVE_DTCM | |
| 221 | + default 0xffffffff | |
| 222 | + | |
| 223 | +config DTCM_NR_PAGES | |
| 224 | + int "Page count of DTCM size: NR*4KB" | |
| 225 | + depends on HAVE_DTCM | |
| 226 | + range 1 256 | |
| 227 | + default 32 | |
| 228 | +endif | |
| 229 | + | |
| 191 | 230 | config CPU_HAS_VDSP |
| 192 | 231 | bool "CPU has VDSP coprocessor" |
| 193 | 232 | depends on CPU_HAS_FPU && CPU_HAS_FPUV2 |
| @@ -196,6 +235,10 @@ config CPU_HAS_FPU · 2 unmodified lines | ||
| 196 | 235 | bool "CPU has FPU coprocessor" |
| 197 | 236 | depends on CPU_CK807 || CPU_CK810 || CPU_CK860 |
| 198 | 237 | |
| 238 | +config CPU_HAS_ICACHE_INS | |
| 239 | + bool "CPU has Icache invalidate instructions" | |
| 240 | + depends on CPU_HAS_CACHEV2 | |
| 241 | + | |
| 199 | 242 | config CPU_HAS_TEE |
| 200 | 243 | bool "CPU has Trusted Execution Environment" |
| 201 | 244 | depends on CPU_CK810 |
| @@ -235,4 +278,6 @@ config HOTPLUG_CPU · 33 unmodified lines | ||
| 235 | 278 | Say N if you want to disable CPU hotplug. |
| 236 | 279 | endmenu |
| 237 | 280 | |
| 281 | +source "arch/csky/Kconfig.platforms" | |
| 282 | + | |
| 238 | 283 | source "kernel/Kconfig.hz" |
| @@ -0,0 +1,9 @@ | ||
| 1 | +menu "Platform drivers selection" | |
| 2 | + | |
| 3 | +config ARCH_CSKY_DW_APB_ICTL | |
| 4 | + bool "Select dw-apb interrupt controller" | |
| 5 | + select DW_APB_ICTL | |
| 6 | + default y | |
| 7 | + help | |
| 8 | + This enables support for snps dw-apb-ictl | |
| 9 | +endmenu | |
| @@ -48,9 +48,8 @@ extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, u · 47 unmodified lines | ||
| 48 | 48 | |
| 49 | 49 | #define flush_icache_page(vma, page) do {} while (0); |
| 50 | 50 | #define flush_icache_range(start, end) cache_wbinv_range(start, end) |
| 51 | − | |
| 52 | −#define flush_icache_user_range(vma,page,addr,len) \ | |
| 53 | − flush_dcache_page(page) | |
| 51 | +#define flush_icache_mm_range(mm, start, end) cache_wbinv_range(start, end) | |
| 52 | +#define flush_icache_deferred(mm) do {} while (0); | |
| 54 | 53 | |
| 55 | 54 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
| 56 | 55 | do { \ |
| @@ -16,14 +16,16 @@ · 15 unmodified lines | ||
| 16 | 16 | #define LSAVE_A4 40 |
| 17 | 17 | #define LSAVE_A5 44 |
| 18 | 18 | |
| 19 | +#define usp ss1 | |
| 20 | + | |
| 19 | 21 | .macro USPTOKSP |
| 20 | − mtcr sp, ss1 | |
| 22 | + mtcr sp, usp | |
| 21 | 23 | mfcr sp, ss0 |
| 22 | 24 | .endm |
| 23 | 25 | |
| 24 | 26 | .macro KSPTOUSP |
| 25 | 27 | mtcr sp, ss0 |
| 26 | − mfcr sp, ss1 | |
| 28 | + mfcr sp, usp | |
| 27 | 29 | .endm |
| 28 | 30 | |
| 29 | 31 | .macro SAVE_ALL epc_inc |
| @@ -45,7 +47,13 @@ · 15 unmodified lines | ||
| 45 | 47 | add lr, r13 |
| 46 | 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 | 55 | mfcr lr, ss1 |
| 56 | +2: | |
| 49 | 57 | stw lr, (sp, 16) |
| 50 | 58 | |
| 51 | 59 | stw a0, (sp, 20) |
| @@ -79,9 +87,10 @@ · 27 unmodified lines | ||
| 79 | 87 | ldw a0, (sp, 12) |
| 80 | 88 | mtcr a0, epsr |
| 81 | 89 | btsti a0, 31 |
| 90 | + bt 1f | |
| 82 | 91 | ldw a0, (sp, 16) |
| 83 | 92 | mtcr a0, ss1 |
| 84 | − | |
| 93 | +1: | |
| 85 | 94 | ldw a0, (sp, 24) |
| 86 | 95 | ldw a1, (sp, 28) |
| 87 | 96 | ldw a2, (sp, 32) |
| @@ -102,9 +111,9 @@ · 14 unmodified lines | ||
| 102 | 111 | addi sp, 32 |
| 103 | 112 | addi sp, 8 |
| 104 | 113 | |
| 105 | − bt 1f | |
| 114 | + bt 2f | |
| 106 | 115 | KSPTOUSP |
| 107 | −1: | |
| 116 | +2: | |
| 108 | 117 | rte |
| 109 | 118 | .endm |
| 110 | 119 | |
| @@ -6,46 +6,80 @@ · 5 unmodified lines | ||
| 6 | 6 | #include <linux/mm.h> |
| 7 | 7 | #include <asm/cache.h> |
| 8 | 8 | |
| 9 | −void flush_icache_page(struct vm_area_struct *vma, struct page *page) | |
| 9 | +void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |
| 10 | + pte_t *pte) | |
| 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); | |
| 18 | −} | |
| 22 | + addr = (unsigned long) kmap_atomic(page); | |
| 19 | 23 | |
| 20 | −void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | |
| 21 | − unsigned long vaddr, int len) | |
| 22 | −{ | |
| 23 | − unsigned long kaddr; | |
| 24 | + dcache_wb_range(addr, addr + PAGE_SIZE); | |
| 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); | |
| 32 | +void flush_icache_deferred(struct mm_struct *mm) | |
| 33 | +{ | |
| 34 | + unsigned int cpu = smp_processor_id(); | |
| 35 | + cpumask_t *mask = &mm->context.icache_stale_mask; | |
| 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 | |
| 32 | −void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |
| 33 | − pte_t *pte) | |
| 48 | +void flush_icache_mm_range(struct mm_struct *mm, | |
| 49 | + unsigned long start, unsigned long end) | |
| 34 | 50 | { |
| 35 | − unsigned long addr, pfn; | |
| 36 | − struct page *page; | |
| 51 | + unsigned int cpu; | |
| 52 | + cpumask_t others, *mask; | |
| 37 | 53 | |
| 38 | − pfn = pte_pfn(*pte); | |
| 39 | − if (unlikely(!pfn_valid(pfn))) | |
| 40 | − return; | |
| 54 | + preempt_disable(); | |
| 41 | 55 | |
| 42 | − page = pfn_to_page(pfn); | |
| 43 | − if (page == ZERO_PAGE(0)) | |
| 56 | +#ifdef CONFIG_CPU_HAS_ICACHE_INS | |
| 57 | + if (mm == current->mm) { | |
| 58 | + icache_inv_range(start, end); | |
| 59 | + preempt_enable(); | |
| 44 | 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 | } |
| @@ -13,24 +13,27 @@ · 12 unmodified lines | ||
| 13 | 13 | #define flush_cache_all() do { } while (0) |
| 14 | 14 | #define flush_cache_mm(mm) do { } while (0) |
| 15 | 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) \ | |
| 18 | − do { \ | |
| 19 | − if (vma->vm_flags & VM_EXEC) \ | |
| 20 | − icache_inv_all(); \ | |
| 21 | − } while (0) | |
| 19 | +#define PG_dcache_clean PG_arch_1 | |
| 20 | + | |
| 21 | +#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 | |
| 22 | +static inline void flush_dcache_page(struct page *page) | |
| 23 | +{ | |
| 24 | + if (test_bit(PG_dcache_clean, &page->flags)) | |
| 25 | + clear_bit(PG_dcache_clean, &page->flags); | |
| 26 | +} | |
| 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 | 28 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
| 27 | 29 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
| 30 | +#define flush_icache_page(vma, page) do { } while (0) | |
| 28 | 31 | |
| 29 | 32 | #define flush_icache_range(start, end) cache_wbinv_range(start, end) |
| 30 | 33 | |
| 31 | −void flush_icache_page(struct vm_area_struct *vma, struct page *page); | |
| 32 | −void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | |
| 33 | − unsigned long vaddr, int len); | |
| 34 | +void flush_icache_mm_range(struct mm_struct *mm, | |
| 35 | + unsigned long start, unsigned long end); | |
| 36 | +void flush_icache_deferred(struct mm_struct *mm); | |
| 34 | 37 | |
| 35 | 38 | #define flush_cache_vmap(start, end) do { } while (0) |
| 36 | 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 | 41 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ |
| 39 | 42 | do { \ |
| 40 | 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 | 51 | } while (0) |
| 43 | 52 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
| 44 | 53 | memcpy(dst, src, len) |
| @@ -31,7 +31,13 @@ · 30 unmodified lines | ||
| 31 | 31 | |
| 32 | 32 | mfcr lr, epsr |
| 33 | 33 | stw lr, (sp, 12) |
| 34 | + btsti lr, 31 | |
| 35 | + bf 1f | |
| 36 | + addi lr, sp, 152 | |
| 37 | + br 2f | |
| 38 | +1: | |
| 34 | 39 | mfcr lr, usp |
| 40 | +2: | |
| 35 | 41 | stw lr, (sp, 16) |
| 36 | 42 | |
| 37 | 43 | stw a0, (sp, 20) |
| @@ -64,8 +70,10 @@ · 26 unmodified lines | ||
| 64 | 70 | mtcr a0, epc |
| 65 | 71 | ldw a0, (sp, 12) |
| 66 | 72 | mtcr a0, epsr |
| 73 | + btsti a0, 31 | |
| 67 | 74 | ldw a0, (sp, 16) |
| 68 | 75 | mtcr a0, usp |
| 76 | + mtcr a0, ss0 | |
| 69 | 77 | |
| 70 | 78 | #ifdef CONFIG_CPU_HAS_HILO |
| 71 | 79 | ldw a0, (sp, 140) |
| @@ -86,6 +94,9 @@ · 14 unmodified lines | ||
| 86 | 94 | addi sp, 40 |
| 87 | 95 | ldm r16-r30, (sp) |
| 88 | 96 | addi sp, 72 |
| 97 | + bf 1f | |
| 98 | + mfcr sp, ss0 | |
| 99 | +1: | |
| 89 | 100 | rte |
| 90 | 101 | .endm |
| 91 | 102 | |
| @@ -10,9 +10,6 @@ CONFIG_BSD_PROCESS_ACCT=y · 9 unmodified lines | ||
| 10 | 10 | CONFIG_BSD_PROCESS_ACCT_V3=y |
| 11 | 11 | CONFIG_MODULES=y |
| 12 | 12 | CONFIG_MODULE_UNLOAD=y |
| 13 | −CONFIG_DEFAULT_DEADLINE=y | |
| 14 | −CONFIG_CPU_CK807=y | |
| 15 | −CONFIG_CPU_HAS_FPU=y | |
| 16 | 13 | CONFIG_NET=y |
| 17 | 14 | CONFIG_PACKET=y |
| 18 | 15 | CONFIG_UNIX=y |
| @@ -27,10 +24,7 @@ CONFIG_SERIAL_NONSTANDARD=y · 8 unmodified lines | ||
| 27 | 24 | CONFIG_SERIAL_8250=y |
| 28 | 25 | CONFIG_SERIAL_8250_CONSOLE=y |
| 29 | 26 | CONFIG_SERIAL_OF_PLATFORM=y |
| 30 | −CONFIG_TTY_PRINTK=y | |
| 31 | 27 | # CONFIG_VGA_CONSOLE is not set |
| 32 | −CONFIG_CSKY_MPTIMER=y | |
| 33 | −CONFIG_GX6605S_TIMER=y | |
| 34 | 28 | CONFIG_PM_DEVFREQ=y |
| 35 | 29 | CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y |
| 36 | 30 | CONFIG_DEVFREQ_GOV_PERFORMANCE=y |
| @@ -56,6 +50,4 @@ CONFIG_CRAMFS=y · 19 unmodified lines | ||
| 56 | 50 | CONFIG_ROMFS_FS=y |
| 57 | 51 | CONFIG_NFS_FS=y |
| 58 | 52 | CONFIG_PRINTK_TIME=y |
| 59 | −CONFIG_DEBUG_INFO=y | |
| 60 | −CONFIG_DEBUG_FS=y | |
| 61 | 53 | CONFIG_MAGIC_SYSRQ=y |
| @@ -28,7 +28,6 @@ generic-y += local64.h · 27 unmodified lines | ||
| 28 | 28 | generic-y += mm-arch-hooks.h |
| 29 | 29 | generic-y += mmiowb.h |
| 30 | 30 | generic-y += module.h |
| 31 | −generic-y += pci.h | |
| 32 | 31 | generic-y += percpu.h |
| 33 | 32 | generic-y += preempt.h |
| 34 | 33 | generic-y += qrwlock.h |
| @@ -16,6 +16,7 @@ void dcache_wb_line(unsigned long start); · 15 unmodified lines | ||
| 16 | 16 | |
| 17 | 17 | void icache_inv_range(unsigned long start, unsigned long end); |
| 18 | 18 | void icache_inv_all(void); |
| 19 | +void local_icache_inv_all(void *priv); | |
| 19 | 20 | |
| 20 | 21 | void dcache_wb_range(unsigned long start, unsigned long end); |
| 21 | 22 | void dcache_wbinv_all(void); |
| @@ -4,6 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | #ifndef __ASM_CSKY_CACHEFLUSH_H |
| 5 | 5 | #define __ASM_CSKY_CACHEFLUSH_H |
| 6 | 6 | |
| 7 | +#include <linux/mm.h> | |
| 7 | 8 | #include <abi/cacheflush.h> |
| 8 | 9 | |
| 9 | 10 | #endif /* __ASM_CSKY_CACHEFLUSH_H */ |
| @@ -5,12 +5,16 @@ · 4 unmodified lines | ||
| 5 | 5 | #define __ASM_CSKY_FIXMAP_H |
| 6 | 6 | |
| 7 | 7 | #include <asm/page.h> |
| 8 | +#include <asm/memory.h> | |
| 8 | 9 | #ifdef CONFIG_HIGHMEM |
| 9 | 10 | #include <linux/threads.h> |
| 10 | 11 | #include <asm/kmap_types.h> |
| 11 | 12 | #endif |
| 12 | 13 | |
| 13 | 14 | enum fixed_addresses { |
| 15 | +#ifdef CONFIG_HAVE_TCM | |
| 16 | + FIX_TCM = TCM_NR_PAGES, | |
| 17 | +#endif | |
| 14 | 18 | #ifdef CONFIG_HIGHMEM |
| 15 | 19 | FIX_KMAP_BEGIN, |
| 16 | 20 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1, |
| @@ -18,10 +22,13 @@ enum fixed_addresses { · 1 unmodified line | ||
| 18 | 22 | __end_of_fixed_addresses |
| 19 | 23 | }; |
| 20 | 24 | |
| 21 | −#define FIXADDR_TOP 0xffffc000 | |
| 22 | 25 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) |
| 23 | 26 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
| 24 | 27 | |
| 25 | 28 | #include <asm-generic/fixmap.h> |
| 26 | 29 | |
| 30 | +extern void fixrange_init(unsigned long start, unsigned long end, | |
| 31 | + pgd_t *pgd_base); | |
| 32 | +extern void __init fixaddr_init(void); | |
| 33 | + | |
| 27 | 34 | #endif /* __ASM_CSKY_FIXMAP_H */ |
| @@ -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 | |
| @@ -7,6 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | typedef struct { |
| 8 | 8 | atomic64_t asid; |
| 9 | 9 | void *vdso; |
| 10 | + cpumask_t icache_stale_mask; | |
| 10 | 11 | } mm_context_t; |
| 11 | 12 | |
| 12 | 13 | #endif /* __ASM_CSKY_MMU_H */ |
| @@ -43,5 +43,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, · 42 unmodified lines | ||
| 43 | 43 | |
| 44 | 44 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); |
| 45 | 45 | write_mmu_entryhi(next->context.asid.counter); |
| 46 | + | |
| 47 | + flush_icache_deferred(next); | |
| 46 | 48 | } |
| 47 | 49 | #endif /* __ASM_CSKY_MMU_CONTEXT_H */ |
| @@ -0,0 +1,34 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ | |
| 2 | + | |
| 3 | +#ifndef __ASM_CSKY_PCI_H | |
| 4 | +#define __ASM_CSKY_PCI_H | |
| 5 | + | |
| 6 | +#include <linux/types.h> | |
| 7 | +#include <linux/slab.h> | |
| 8 | +#include <linux/dma-mapping.h> | |
| 9 | + | |
| 10 | +#include <asm/io.h> | |
| 11 | + | |
| 12 | +#define PCIBIOS_MIN_IO 0 | |
| 13 | +#define PCIBIOS_MIN_MEM 0 | |
| 14 | + | |
| 15 | +/* C-SKY shim does not initialize PCI bus */ | |
| 16 | +#define pcibios_assign_all_busses() 1 | |
| 17 | + | |
| 18 | +extern int isa_dma_bridge_buggy; | |
| 19 | + | |
| 20 | +#ifdef CONFIG_PCI | |
| 21 | +static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |
| 22 | +{ | |
| 23 | + /* no legacy IRQ on csky */ | |
| 24 | + return -ENODEV; | |
| 25 | +} | |
| 26 | + | |
| 27 | +static inline int pci_proc_domain(struct pci_bus *bus) | |
| 28 | +{ | |
| 29 | + /* always show the domain in /proc */ | |
| 30 | + return 1; | |
| 31 | +} | |
| 32 | +#endif /* CONFIG_PCI */ | |
| 33 | + | |
| 34 | +#endif /* __ASM_CSKY_PCI_H */ | |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | #define __ASM_CSKY_PGTABLE_H |
| 6 | 6 | |
| 7 | 7 | #include <asm/fixmap.h> |
| 8 | +#include <asm/memory.h> | |
| 8 | 9 | #include <asm/addrspace.h> |
| 9 | 10 | #include <abi/pgtable-bits.h> |
| 10 | 11 | #include <asm-generic/pgtable-nopmd.h> |
| @@ -16,11 +17,6 @@ · 5 unmodified lines | ||
| 16 | 17 | #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) |
| 17 | 18 | #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 | 21 | * C-SKY is two-level paging structure: |
| 26 | 22 | */ |
| @@ -0,0 +1,29 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ | |
| 2 | +#ifndef _ASM_STACKPROTECTOR_H | |
| 3 | +#define _ASM_STACKPROTECTOR_H 1 | |
| 4 | + | |
| 5 | +#include <linux/random.h> | |
| 6 | +#include <linux/version.h> | |
| 7 | + | |
| 8 | +extern unsigned long __stack_chk_guard; | |
| 9 | + | |
| 10 | +/* | |
| 11 | + * Initialize the stackprotector canary value. | |
| 12 | + * | |
| 13 | + * NOTE: this must only be called from functions that never return, | |
| 14 | + * and it must always be inlined. | |
| 15 | + */ | |
| 16 | +static __always_inline void boot_init_stack_canary(void) | |
| 17 | +{ | |
| 18 | + unsigned long canary; | |
| 19 | + | |
| 20 | + /* Try to get a semi random initial value. */ | |
| 21 | + get_random_bytes(&canary, sizeof(canary)); | |
| 22 | + canary ^= LINUX_VERSION_CODE; | |
| 23 | + canary &= CANARY_MASK; | |
| 24 | + | |
| 25 | + current->stack_canary = canary; | |
| 26 | + __stack_chk_guard = current->stack_canary; | |
| 27 | +} | |
| 28 | + | |
| 29 | +#endif /* __ASM_SH_STACKPROTECTOR_H */ | |
| @@ -0,0 +1,24 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ | |
| 2 | + | |
| 3 | +#ifndef __ASM_CSKY_TCM_H | |
| 4 | +#define __ASM_CSKY_TCM_H | |
| 5 | + | |
| 6 | +#ifndef CONFIG_HAVE_TCM | |
| 7 | +#error "You should not be including tcm.h unless you have a TCM!" | |
| 8 | +#endif | |
| 9 | + | |
| 10 | +#include <linux/compiler.h> | |
| 11 | + | |
| 12 | +/* Tag variables with this */ | |
| 13 | +#define __tcmdata __section(.tcm.data) | |
| 14 | +/* Tag constants with this */ | |
| 15 | +#define __tcmconst __section(.tcm.rodata) | |
| 16 | +/* Tag functions inside TCM called from outside TCM with this */ | |
| 17 | +#define __tcmfunc __section(.tcm.text) noinline | |
| 18 | +/* Tag function inside TCM called from inside TCM with this */ | |
| 19 | +#define __tcmlocalfunc __section(.tcm.text) | |
| 20 | + | |
| 21 | +void *tcm_alloc(size_t len); | |
| 22 | +void tcm_free(void *addr, size_t len); | |
| 23 | + | |
| 24 | +#endif | |
| @@ -1,7 +1,10 @@ | ||
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 2 | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
| 3 | 3 | |
| 4 | +#define __ARCH_WANT_STAT64 | |
| 5 | +#define __ARCH_WANT_NEW_STAT | |
| 4 | 6 | #define __ARCH_WANT_SYS_CLONE |
| 7 | +#define __ARCH_WANT_SYS_CLONE3 | |
| 5 | 8 | #define __ARCH_WANT_SET_GET_RLIMIT |
| 6 | 9 | #define __ARCH_WANT_TIME32_SYSCALLS |
| 7 | 10 | #include <asm-generic/unistd.h> |
| @@ -17,10 +17,12 @@ ENTRY(csky_cmpxchg) · 16 unmodified lines | ||
| 17 | 17 | mfcr a3, epc |
| 18 | 18 | addi a3, TRAP0_SIZE |
| 19 | 19 | |
| 20 | − subi sp, 8 | |
| 20 | + subi sp, 16 | |
| 21 | 21 | stw a3, (sp, 0) |
| 22 | 22 | mfcr a3, epsr |
| 23 | 23 | stw a3, (sp, 4) |
| 24 | + mfcr a3, usp | |
| 25 | + stw a3, (sp, 8) | |
| 24 | 26 | |
| 25 | 27 | psrset ee |
| 26 | 28 | #ifdef CONFIG_CPU_HAS_LDSTEX |
| @@ -47,7 +49,9 @@ ENTRY(csky_cmpxchg) · 20 unmodified lines | ||
| 47 | 49 | mtcr a3, epc |
| 48 | 50 | ldw a3, (sp, 4) |
| 49 | 51 | mtcr a3, epsr |
| 50 | − addi sp, 8 | |
| 52 | + ldw a3, (sp, 8) | |
| 53 | + mtcr a3, usp | |
| 54 | + addi sp, 16 | |
| 51 | 55 | KSPTOUSP |
| 52 | 56 | rte |
| 53 | 57 | END(csky_cmpxchg) |
| @@ -16,6 +16,12 @@ · 15 unmodified lines | ||
| 16 | 16 | |
| 17 | 17 | struct cpuinfo_csky cpu_data[NR_CPUS]; |
| 18 | 18 | |
| 19 | +#ifdef CONFIG_STACKPROTECTOR | |
| 20 | +#include <linux/stackprotector.h> | |
| 21 | +unsigned long __stack_chk_guard __read_mostly; | |
| 22 | +EXPORT_SYMBOL(__stack_chk_guard); | |
| 23 | +#endif | |
| 24 | + | |
| 19 | 25 | asmlinkage void ret_from_fork(void); |
| 20 | 26 | asmlinkage 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 | 40 | return sw->r15; |
| 35 | 41 | } |
| 36 | 42 | |
| 37 | −int copy_thread(unsigned long clone_flags, | |
| 43 | +int copy_thread_tls(unsigned long clone_flags, | |
| 38 | 44 | unsigned long usp, |
| 39 | 45 | unsigned long kthread_arg, |
| 40 | − struct task_struct *p) | |
| 46 | + struct task_struct *p, | |
| 47 | + unsigned long tls) | |
| 41 | 48 | { |
| 42 | 49 | struct switch_stack *childstack; |
| 43 | 50 | struct pt_regs *childregs = task_pt_regs(p); |
| @@ -64,7 +71,7 @@ int copy_thread(unsigned long clone_flags, · 20 unmodified lines | ||
| 64 | 71 | childregs->usp = usp; |
| 65 | 72 | if (clone_flags & CLONE_SETTLS) |
| 66 | 73 | task_thread_info(p)->tp_value = childregs->tls |
| 67 | − = childregs->regs[0]; | |
| 74 | + = tls; | |
| 68 | 75 | |
| 69 | 76 | childregs->a0 = 0; |
| 70 | 77 | childstack->r15 = (unsigned long) ret_from_fork; |
| @@ -47,9 +47,6 @@ static void __init csky_memblock_init(void) · 46 unmodified lines | ||
| 47 | 47 | signed long size; |
| 48 | 48 | |
| 49 | 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 | 51 | early_init_fdt_reserve_self(); |
| 55 | 52 | early_init_fdt_scan_reserved_mem(); |
| @@ -133,6 +130,8 @@ void __init setup_arch(char **cmdline_p) · 77 unmodified lines | ||
| 133 | 130 | |
| 134 | 131 | sparse_init(); |
| 135 | 132 | |
| 133 | + fixaddr_init(); | |
| 134 | + | |
| 136 | 135 | #ifdef CONFIG_HIGHMEM |
| 137 | 136 | kmap_init(); |
| 138 | 137 | #endif |
| @@ -120,7 +120,7 @@ void __init setup_smp_ipi(void) · 119 unmodified lines | ||
| 120 | 120 | int rc; |
| 121 | 121 | |
| 122 | 122 | if (ipi_irq == 0) |
| 123 | − panic("%s IRQ mapping failed\n", __func__); | |
| 123 | + return; | |
| 124 | 124 | |
| 125 | 125 | rc = request_percpu_irq(ipi_irq, handle_ipi, "IPI Interrupt", |
| 126 | 126 | &ipi_dummy_dev); |
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
| 3 | 3 | |
| 4 | −#include <linux/clk-provider.h> | |
| 5 | 4 | #include <linux/clocksource.h> |
| 5 | +#include <linux/of_clk.h> | |
| 6 | 6 | |
| 7 | 7 | void __init time_init(void) |
| 8 | 8 | { |
| @@ -2,6 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | #include <asm/vmlinux.lds.h> |
| 4 | 4 | #include <asm/page.h> |
| 5 | +#include <asm/memory.h> | |
| 5 | 6 | |
| 6 | 7 | OUTPUT_ARCH(csky) |
| 7 | 8 | ENTRY(_start) |
| @@ -53,6 +54,54 @@ SECTIONS · 45 unmodified lines | ||
| 53 | 54 | RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
| 54 | 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 | 105 | EXCEPTION_TABLE(L1_CACHE_BYTES) |
| 57 | 106 | BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES) |
| 58 | 107 | VBR_BASE |
| @@ -1,8 +1,10 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | 2 | ifeq ($(CONFIG_CPU_HAS_CACHEV2),y) |
| 3 | 3 | obj-y += cachev2.o |
| 4 | +CFLAGS_REMOVE_cachev2.o = $(CC_FLAGS_FTRACE) | |
| 4 | 5 | else |
| 5 | 6 | obj-y += cachev1.o |
| 7 | +CFLAGS_REMOVE_cachev1.o = $(CC_FLAGS_FTRACE) | |
| 6 | 8 | endif |
| 7 | 9 | |
| 8 | 10 | obj-y += dma-mapping.o |
| @@ -14,3 +16,4 @@ obj-y += syscache.o · 5 unmodified lines | ||
| 14 | 16 | obj-y += tlb.o |
| 15 | 17 | obj-y += asid.o |
| 16 | 18 | obj-y += context.o |
| 19 | +obj-$(CONFIG_HAVE_TCM) += tcm.o | |
| @@ -94,6 +94,11 @@ void icache_inv_all(void) · 93 unmodified lines | ||
| 94 | 94 | cache_op_all(INS_CACHE|CACHE_INV, 0); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | +void local_icache_inv_all(void *priv) | |
| 98 | +{ | |
| 99 | + cache_op_all(INS_CACHE|CACHE_INV, 0); | |
| 100 | +} | |
| 101 | + | |
| 97 | 102 | void dcache_wb_range(unsigned long start, unsigned long end) |
| 98 | 103 | { |
| 99 | 104 | cache_op_range(start, end, DATA_CACHE|CACHE_CLR, 0); |
| @@ -3,15 +3,25 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | #include <linux/spinlock.h> |
| 5 | 5 | #include <linux/smp.h> |
| 6 | +#include <linux/mm.h> | |
| 6 | 7 | #include <asm/cache.h> |
| 7 | 8 | #include <asm/barrier.h> |
| 8 | 9 | |
| 9 | −inline void dcache_wb_line(unsigned long start) | |
| 10 | +#define INS_CACHE (1 << 0) | |
| 11 | +#define CACHE_INV (1 << 4) | |
| 12 | + | |
| 13 | +void local_icache_inv_all(void *priv) | |
| 10 | 14 | { |
| 11 | − asm volatile("dcache.cval1 %0\n"::"r"(start):"memory"); | |
| 15 | + mtcr("cr17", INS_CACHE|CACHE_INV); | |
| 12 | 16 | sync_is(); |
| 13 | 17 | } |
| 14 | 18 | |
| 19 | +void icache_inv_all(void) | |
| 20 | +{ | |
| 21 | + on_each_cpu(local_icache_inv_all, NULL, 1); | |
| 22 | +} | |
| 23 | + | |
| 24 | +#ifdef CONFIG_CPU_HAS_ICACHE_INS | |
| 15 | 25 | void icache_inv_range(unsigned long start, unsigned long end) |
| 16 | 26 | { |
| 17 | 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 | 30 | asm volatile("icache.iva %0\n"::"r"(i):"memory"); |
| 21 | 31 | sync_is(); |
| 22 | 32 | } |
| 23 | − | |
| 24 | −void icache_inv_all(void) | |
| 33 | +#else | |
| 34 | +void icache_inv_range(unsigned long start, unsigned long end) | |
| 25 | 35 | { |
| 26 | − asm volatile("icache.ialls\n":::"memory"); | |
| 27 | − sync_is(); | |
| 36 | + icache_inv_all(); | |
| 28 | 37 | } |
| 38 | +#endif | |
| 29 | 39 | |
| 30 | −void dcache_wb_range(unsigned long start, unsigned long end) | |
| 40 | +inline void dcache_wb_line(unsigned long start) | |
| 31 | 41 | { |
| 32 | − unsigned long i = start & ~(L1_CACHE_BYTES - 1); | |
| 33 | − | |
| 34 | − for (; i < end; i += L1_CACHE_BYTES) | |
| 35 | − asm volatile("dcache.cval1 %0\n"::"r"(i):"memory"); | |
| 42 | + asm volatile("dcache.cval1 %0\n"::"r"(start):"memory"); | |
| 36 | 43 | sync_is(); |
| 37 | 44 | } |
| 38 | 45 | |
| 39 | −void dcache_inv_range(unsigned long start, unsigned long end) | |
| 46 | +void dcache_wb_range(unsigned long start, unsigned long end) | |
| 40 | 47 | { |
| 41 | 48 | unsigned long i = start & ~(L1_CACHE_BYTES - 1); |
| 42 | 49 | |
| 43 | 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 | 52 | sync_is(); |
| 46 | 53 | } |
| 47 | 54 | |
| 48 | 55 | void cache_wbinv_range(unsigned long start, unsigned long end) |
| 49 | 56 | { |
| 50 | − unsigned long i = start & ~(L1_CACHE_BYTES - 1); | |
| 51 | − | |
| 52 | − for (; i < end; i += L1_CACHE_BYTES) | |
| 53 | − asm volatile("dcache.cval1 %0\n"::"r"(i):"memory"); | |
| 54 | − sync_is(); | |
| 55 | − | |
| 56 | − i = start & ~(L1_CACHE_BYTES - 1); | |
| 57 | − for (; i < end; i += L1_CACHE_BYTES) | |
| 58 | − asm volatile("icache.iva %0\n"::"r"(i):"memory"); | |
| 59 | − sync_is(); | |
| 57 | + dcache_wb_range(start, end); | |
| 58 | + icache_inv_range(start, end); | |
| 60 | 59 | } |
| 61 | 60 | EXPORT_SYMBOL(cache_wbinv_range); |
| 62 | 61 | |
| @@ -117,85 +117,29 @@ struct page *kmap_atomic_to_page(void *ptr) · 116 unmodified lines | ||
| 117 | 117 | return pte_page(*pte); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | −static void __init fixrange_init(unsigned long start, unsigned long end, | |
| 121 | − pgd_t *pgd_base) | |
| 120 | +static void __init kmap_pages_init(void) | |
| 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 | 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 | − | |
| 161 | −void __init fixaddr_kmap_pages_init(void) | |
| 162 | −{ | |
| 163 | − unsigned long vaddr; | |
| 164 | − pgd_t *pgd_base; | |
| 165 | −#ifdef CONFIG_HIGHMEM | |
| 166 | 123 | pgd_t *pgd; |
| 167 | 124 | pmd_t *pmd; |
| 168 | 125 | pud_t *pud; |
| 169 | 126 | pte_t *pte; |
| 170 | −#endif | |
| 171 | − pgd_base = swapper_pg_dir; | |
| 172 | − | |
| 173 | − /* | |
| 174 | − * Fixed mappings: | |
| 175 | − */ | |
| 176 | − vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; | |
| 177 | − fixrange_init(vaddr, 0, pgd_base); | |
| 178 | − | |
| 179 | −#ifdef CONFIG_HIGHMEM | |
| 180 | − /* | |
| 181 | − * Permanent kmaps: | |
| 182 | − */ | |
| 127 | + | |
| 183 | 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 | 131 | pgd = swapper_pg_dir + __pgd_offset(vaddr); |
| 187 | 132 | pud = (pud_t *)pgd; |
| 188 | 133 | pmd = pmd_offset(pud, vaddr); |
| 189 | 134 | pte = pte_offset_kernel(pmd, vaddr); |
| 190 | 135 | pkmap_page_table = pte; |
| 191 | −#endif | |
| 192 | 136 | } |
| 193 | 137 | |
| 194 | 138 | void __init kmap_init(void) |
| 195 | 139 | { |
| 196 | 140 | unsigned long vaddr; |
| 197 | 141 | |
| 198 | − fixaddr_kmap_pages_init(); | |
| 142 | + kmap_pages_init(); | |
| 199 | 143 | |
| 200 | 144 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN); |
| 201 | 145 | |
| @@ -19,6 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <linux/swap.h> |
| 20 | 20 | #include <linux/proc_fs.h> |
| 21 | 21 | #include <linux/pfn.h> |
| 22 | +#include <linux/initrd.h> | |
| 22 | 23 | |
| 23 | 24 | #include <asm/setup.h> |
| 24 | 25 | #include <asm/cachectl.h> |
| @@ -31,10 +32,50 @@ · 6 unmodified lines | ||
| 31 | 32 | |
| 32 | 33 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss; |
| 33 | 34 | pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss; |
| 35 | +EXPORT_SYMBOL(invalid_pte_table); | |
| 34 | 36 | unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] |
| 35 | 37 | __page_aligned_bss; |
| 36 | 38 | EXPORT_SYMBOL(empty_zero_page); |
| 37 | 39 | |
| 40 | +#ifdef CONFIG_BLK_DEV_INITRD | |
| 41 | +static void __init setup_initrd(void) | |
| 42 | +{ | |
| 43 | + unsigned long size; | |
| 44 | + | |
| 45 | + if (initrd_start >= initrd_end) { | |
| 46 | + pr_err("initrd not found or empty"); | |
| 47 | + goto disable; | |
| 48 | + } | |
| 49 | + | |
| 50 | + if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) { | |
| 51 | + pr_err("initrd extends beyond end of memory"); | |
| 52 | + goto disable; | |
| 53 | + } | |
| 54 | + | |
| 55 | + size = initrd_end - initrd_start; | |
| 56 | + | |
| 57 | + if (memblock_is_region_reserved(__pa(initrd_start), size)) { | |
| 58 | + pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region", | |
| 59 | + __pa(initrd_start), size); | |
| 60 | + goto disable; | |
| 61 | + } | |
| 62 | + | |
| 63 | + memblock_reserve(__pa(initrd_start), size); | |
| 64 | + | |
| 65 | + pr_info("Initial ramdisk at: 0x%p (%lu bytes)\n", | |
| 66 | + (void *)(initrd_start), size); | |
| 67 | + | |
| 68 | + initrd_below_start_ok = 1; | |
| 69 | + | |
| 70 | + return; | |
| 71 | + | |
| 72 | +disable: | |
| 73 | + initrd_start = initrd_end = 0; | |
| 74 | + | |
| 75 | + pr_err(" - disabling initrd\n"); | |
| 76 | +} | |
| 77 | +#endif | |
| 78 | + | |
| 38 | 79 | void __init mem_init(void) |
| 39 | 80 | { |
| 40 | 81 | #ifdef CONFIG_HIGHMEM |
| @@ -46,6 +87,10 @@ void __init mem_init(void) · 5 unmodified lines | ||
| 46 | 87 | #endif |
| 47 | 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 | 94 | memblock_free_all(); |
| 50 | 95 | |
| 51 | 96 | #ifdef CONFIG_HIGHMEM |
| @@ -101,3 +146,50 @@ void __init pre_mmu_init(void) · 49 unmodified lines | ||
| 101 | 146 | /* Setup page mask to 4k */ |
| 102 | 147 | write_mmu_pagemask(0); |
| 103 | 148 | } |
| 149 | + | |
| 150 | +void __init fixrange_init(unsigned long start, unsigned long end, | |
| 151 | + pgd_t *pgd_base) | |
| 152 | +{ | |
| 153 | + pgd_t *pgd; | |
| 154 | + pud_t *pud; | |
| 155 | + pmd_t *pmd; | |
| 156 | + pte_t *pte; | |
| 157 | + int i, j, k; | |
| 158 | + unsigned long vaddr; | |
| 159 | + | |
| 160 | + vaddr = start; | |
| 161 | + i = __pgd_offset(vaddr); | |
| 162 | + j = __pud_offset(vaddr); | |
| 163 | + k = __pmd_offset(vaddr); | |
| 164 | + pgd = pgd_base + i; | |
| 165 | + | |
| 166 | + for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { | |
| 167 | + pud = (pud_t *)pgd; | |
| 168 | + for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) { | |
| 169 | + pmd = (pmd_t *)pud; | |
| 170 | + for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { | |
| 171 | + if (pmd_none(*pmd)) { | |
| 172 | + pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); | |
| 173 | + if (!pte) | |
| 174 | + panic("%s: Failed to allocate %lu bytes align=%lx\n", | |
| 175 | + __func__, PAGE_SIZE, | |
| 176 | + PAGE_SIZE); | |
| 177 | + | |
| 178 | + set_pmd(pmd, __pmd(__pa(pte))); | |
| 179 | + BUG_ON(pte != pte_offset_kernel(pmd, 0)); | |
| 180 | + } | |
| 181 | + vaddr += PMD_SIZE; | |
| 182 | + } | |
| 183 | + k = 0; | |
| 184 | + } | |
| 185 | + j = 0; | |
| 186 | + } | |
| 187 | +} | |
| 188 | + | |
| 189 | +void __init fixaddr_init(void) | |
| 190 | +{ | |
| 191 | + unsigned long vaddr; | |
| 192 | + | |
| 193 | + vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; | |
| 194 | + fixrange_init(vaddr, vaddr + PMD_SIZE, swapper_pg_dir); | |
| 195 | +} | |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | #include <linux/syscalls.h> |
| 5 | 5 | #include <asm/page.h> |
| 6 | −#include <asm/cache.h> | |
| 6 | +#include <asm/cacheflush.h> | |
| 7 | 7 | #include <asm/cachectl.h> |
| 8 | 8 | |
| 9 | 9 | SYSCALL_DEFINE3(cacheflush, |
| @@ -13,17 +13,14 @@ SYSCALL_DEFINE3(cacheflush, · 3 unmodified lines | ||
| 13 | 13 | { |
| 14 | 14 | switch (cache) { |
| 15 | 15 | case ICACHE: |
| 16 | − icache_inv_range((unsigned long)addr, | |
| 17 | − (unsigned long)addr + bytes); | |
| 18 | − break; | |
| 16 | + case BCACHE: | |
| 17 | + flush_icache_mm_range(current->mm, | |
| 18 | + (unsigned long)addr, | |
| 19 | + (unsigned long)addr + bytes); | |
| 19 | 20 | case DCACHE: |
| 20 | 21 | dcache_wb_range((unsigned long)addr, |
| 21 | 22 | (unsigned long)addr + bytes); |
| 22 | 23 | break; |
| 23 | − case BCACHE: | |
| 24 | − cache_wbinv_range((unsigned long)addr, | |
| 25 | − (unsigned long)addr + bytes); | |
| 26 | − break; | |
| 27 | 24 | default: |
| 28 | 25 | return -EINVAL; |
| 29 | 26 | } |
| @@ -0,0 +1,169 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +#include <linux/highmem.h> | |
| 4 | +#include <linux/genalloc.h> | |
| 5 | +#include <asm/tlbflush.h> | |
| 6 | +#include <asm/fixmap.h> | |
| 7 | + | |
| 8 | +#if (CONFIG_ITCM_RAM_BASE == 0xffffffff) | |
| 9 | +#error "You should define ITCM_RAM_BASE" | |
| 10 | +#endif | |
| 11 | + | |
| 12 | +#ifdef CONFIG_HAVE_DTCM | |
| 13 | +#if (CONFIG_DTCM_RAM_BASE == 0xffffffff) | |
| 14 | +#error "You should define DTCM_RAM_BASE" | |
| 15 | +#endif | |
| 16 | + | |
| 17 | +#if (CONFIG_DTCM_RAM_BASE == CONFIG_ITCM_RAM_BASE) | |
| 18 | +#error "You should define correct DTCM_RAM_BASE" | |
| 19 | +#endif | |
| 20 | +#endif | |
| 21 | + | |
| 22 | +extern char __tcm_start, __tcm_end, __dtcm_start; | |
| 23 | + | |
| 24 | +static struct gen_pool *tcm_pool; | |
| 25 | + | |
| 26 | +static void __init tcm_mapping_init(void) | |
| 27 | +{ | |
| 28 | + pte_t *tcm_pte; | |
| 29 | + unsigned long vaddr, paddr; | |
| 30 | + int i; | |
| 31 | + | |
| 32 | + paddr = CONFIG_ITCM_RAM_BASE; | |
| 33 | + | |
| 34 | + if (pfn_valid(PFN_DOWN(CONFIG_ITCM_RAM_BASE))) | |
| 35 | + goto panic; | |
| 36 | + | |
| 37 | +#ifndef CONFIG_HAVE_DTCM | |
| 38 | + for (i = 0; i < TCM_NR_PAGES; i++) { | |
| 39 | +#else | |
| 40 | + for (i = 0; i < CONFIG_ITCM_NR_PAGES; i++) { | |
| 41 | +#endif | |
| 42 | + vaddr = __fix_to_virt(FIX_TCM - i); | |
| 43 | + | |
| 44 | + tcm_pte = | |
| 45 | + pte_offset_kernel((pmd_t *)pgd_offset_k(vaddr), vaddr); | |
| 46 | + | |
| 47 | + set_pte(tcm_pte, pfn_pte(__phys_to_pfn(paddr), PAGE_KERNEL)); | |
| 48 | + | |
| 49 | + flush_tlb_one(vaddr); | |
| 50 | + | |
| 51 | + paddr = paddr + PAGE_SIZE; | |
| 52 | + } | |
| 53 | + | |
| 54 | +#ifdef CONFIG_HAVE_DTCM | |
| 55 | + if (pfn_valid(PFN_DOWN(CONFIG_DTCM_RAM_BASE))) | |
| 56 | + goto panic; | |
| 57 | + | |
| 58 | + paddr = CONFIG_DTCM_RAM_BASE; | |
| 59 | + | |
| 60 | + for (i = 0; i < CONFIG_DTCM_NR_PAGES; i++) { | |
| 61 | + vaddr = __fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES - i); | |
| 62 | + | |
| 63 | + tcm_pte = | |
| 64 | + pte_offset_kernel((pmd_t *) pgd_offset_k(vaddr), vaddr); | |
| 65 | + | |
| 66 | + set_pte(tcm_pte, pfn_pte(__phys_to_pfn(paddr), PAGE_KERNEL)); | |
| 67 | + | |
| 68 | + flush_tlb_one(vaddr); | |
| 69 | + | |
| 70 | + paddr = paddr + PAGE_SIZE; | |
| 71 | + } | |
| 72 | +#endif | |
| 73 | + | |
| 74 | +#ifndef CONFIG_HAVE_DTCM | |
| 75 | + memcpy((void *)__fix_to_virt(FIX_TCM), | |
| 76 | + &__tcm_start, &__tcm_end - &__tcm_start); | |
| 77 | + | |
| 78 | + pr_info("%s: mapping tcm va:0x%08lx to pa:0x%08x\n", | |
| 79 | + __func__, __fix_to_virt(FIX_TCM), CONFIG_ITCM_RAM_BASE); | |
| 80 | + | |
| 81 | + pr_info("%s: __tcm_start va:0x%08lx size:%d\n", | |
| 82 | + __func__, (unsigned long)&__tcm_start, &__tcm_end - &__tcm_start); | |
| 83 | +#else | |
| 84 | + memcpy((void *)__fix_to_virt(FIX_TCM), | |
| 85 | + &__tcm_start, &__dtcm_start - &__tcm_start); | |
| 86 | + | |
| 87 | + pr_info("%s: mapping itcm va:0x%08lx to pa:0x%08x\n", | |
| 88 | + __func__, __fix_to_virt(FIX_TCM), CONFIG_ITCM_RAM_BASE); | |
| 89 | + | |
| 90 | + pr_info("%s: __itcm_start va:0x%08lx size:%d\n", | |
| 91 | + __func__, (unsigned long)&__tcm_start, &__dtcm_start - &__tcm_start); | |
| 92 | + | |
| 93 | + memcpy((void *)__fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES), | |
| 94 | + &__dtcm_start, &__tcm_end - &__dtcm_start); | |
| 95 | + | |
| 96 | + pr_info("%s: mapping dtcm va:0x%08lx to pa:0x%08x\n", | |
| 97 | + __func__, __fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES), | |
| 98 | + CONFIG_DTCM_RAM_BASE); | |
| 99 | + | |
| 100 | + pr_info("%s: __dtcm_start va:0x%08lx size:%d\n", | |
| 101 | + __func__, (unsigned long)&__dtcm_start, &__tcm_end - &__dtcm_start); | |
| 102 | + | |
| 103 | +#endif | |
| 104 | + return; | |
| 105 | +panic: | |
| 106 | + panic("TCM init error"); | |
| 107 | +} | |
| 108 | + | |
| 109 | +void *tcm_alloc(size_t len) | |
| 110 | +{ | |
| 111 | + unsigned long vaddr; | |
| 112 | + | |
| 113 | + if (!tcm_pool) | |
| 114 | + return NULL; | |
| 115 | + | |
| 116 | + vaddr = gen_pool_alloc(tcm_pool, len); | |
| 117 | + if (!vaddr) | |
| 118 | + return NULL; | |
| 119 | + | |
| 120 | + return (void *) vaddr; | |
| 121 | +} | |
| 122 | +EXPORT_SYMBOL(tcm_alloc); | |
| 123 | + | |
| 124 | +void tcm_free(void *addr, size_t len) | |
| 125 | +{ | |
| 126 | + gen_pool_free(tcm_pool, (unsigned long) addr, len); | |
| 127 | +} | |
| 128 | +EXPORT_SYMBOL(tcm_free); | |
| 129 | + | |
| 130 | +static int __init tcm_setup_pool(void) | |
| 131 | +{ | |
| 132 | +#ifndef CONFIG_HAVE_DTCM | |
| 133 | + u32 pool_size = (u32) (TCM_NR_PAGES * PAGE_SIZE) | |
| 134 | + - (u32) (&__tcm_end - &__tcm_start); | |
| 135 | + | |
| 136 | + u32 tcm_pool_start = __fix_to_virt(FIX_TCM) | |
| 137 | + + (u32) (&__tcm_end - &__tcm_start); | |
| 138 | +#else | |
| 139 | + u32 pool_size = (u32) (CONFIG_DTCM_NR_PAGES * PAGE_SIZE) | |
| 140 | + - (u32) (&__tcm_end - &__dtcm_start); | |
| 141 | + | |
| 142 | + u32 tcm_pool_start = __fix_to_virt(FIX_TCM - CONFIG_ITCM_NR_PAGES) | |
| 143 | + + (u32) (&__tcm_end - &__dtcm_start); | |
| 144 | +#endif | |
| 145 | + int ret; | |
| 146 | + | |
| 147 | + tcm_pool = gen_pool_create(2, -1); | |
| 148 | + | |
| 149 | + ret = gen_pool_add(tcm_pool, tcm_pool_start, pool_size, -1); | |
| 150 | + if (ret) { | |
| 151 | + pr_err("%s: gen_pool add failed!\n", __func__); | |
| 152 | + return ret; | |
| 153 | + } | |
| 154 | + | |
| 155 | + pr_info("%s: Added %d bytes @ 0x%08x to memory pool\n", | |
| 156 | + __func__, pool_size, tcm_pool_start); | |
| 157 | + | |
| 158 | + return 0; | |
| 159 | +} | |
| 160 | + | |
| 161 | +static int __init tcm_init(void) | |
| 162 | +{ | |
| 163 | + tcm_mapping_init(); | |
| 164 | + | |
| 165 | + tcm_setup_pool(); | |
| 166 | + | |
| 167 | + return 0; | |
| 168 | +} | |
| 169 | +arch_initcall(tcm_init); | |
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | #include <dt-bindings/clock/jz4740-cgu.h> |
| 3 | +#include <dt-bindings/clock/ingenic,tcu.h> | |
| 3 | 4 | |
| 4 | 5 | / { |
| 5 | 6 | #address-cells = <1>; |
| @@ -45,14 +46,6 @@ · 39 unmodified lines | ||
| 45 | 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 | 49 | tcu: timer@10002000 { |
| 57 | 50 | compatible = "ingenic,jz4740-tcu", "simple-mfd"; |
| 58 | 51 | reg = <0x10002000 0x1000>; |
| @@ -73,6 +66,14 @@ · 14 unmodified lines | ||
| 73 | 66 | |
| 74 | 67 | interrupt-parent = <&intc>; |
| 75 | 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 | 79 | rtc_dev: rtc@10003000 { |
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | #include <dt-bindings/clock/jz4780-cgu.h> |
| 3 | +#include <dt-bindings/clock/ingenic,tcu.h> | |
| 3 | 4 | #include <dt-bindings/dma/jz4780-dma.h> |
| 4 | 5 | |
| 5 | 6 | / { |
| @@ -67,6 +68,14 @@ · 61 unmodified lines | ||
| 67 | 68 | |
| 68 | 69 | interrupt-parent = <&intc>; |
| 69 | 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 | 81 | rtc_dev: rtc@10003000 { |
| @@ -348,14 +357,6 @@ · 275 unmodified lines | ||
| 348 | 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 | 360 | nemc: nemc@13410000 { |
| 360 | 361 | compatible = "ingenic,jz4780-nemc"; |
| 361 | 362 | reg = <0x13410000 0x10000>; |
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | +#include <dt-bindings/clock/ingenic,tcu.h> | |
| 2 | 3 | #include <dt-bindings/clock/x1000-cgu.h> |
| 3 | 4 | #include <dt-bindings/dma/x1000-dma.h> |
| 4 | 5 | |
| @@ -72,7 +73,7 @@ · 67 unmodified lines | ||
| 72 | 73 | compatible = "ingenic,x1000-watchdog", "ingenic,jz4780-watchdog"; |
| 73 | 74 | reg = <0x0 0x10>; |
| 74 | 75 | |
| 75 | − clocks = <&cgu X1000_CLK_RTCLK>; | |
| 76 | + clocks = <&tcu TCU_CLK_WDT>; | |
| 76 | 77 | clock-names = "wdt"; |
| 77 | 78 | }; |
| 78 | 79 | }; |
| @@ -158,7 +159,6 @@ · 79 unmodified lines | ||
| 158 | 159 | i2c0: i2c-controller@10050000 { |
| 159 | 160 | compatible = "ingenic,x1000-i2c"; |
| 160 | 161 | reg = <0x10050000 0x1000>; |
| 161 | − | |
| 162 | 162 | #address-cells = <1>; |
| 163 | 163 | #size-cells = <0>; |
| 164 | 164 | |
| @@ -173,7 +173,6 @@ · 8 unmodified lines | ||
| 173 | 173 | i2c1: i2c-controller@10051000 { |
| 174 | 174 | compatible = "ingenic,x1000-i2c"; |
| 175 | 175 | reg = <0x10051000 0x1000>; |
| 176 | − | |
| 177 | 176 | #address-cells = <1>; |
| 178 | 177 | #size-cells = <0>; |
| 179 | 178 | |
| @@ -188,7 +187,6 @@ · 8 unmodified lines | ||
| 188 | 187 | i2c2: i2c-controller@10052000 { |
| 189 | 188 | compatible = "ingenic,x1000-i2c"; |
| 190 | 189 | reg = <0x10052000 0x1000>; |
| 191 | − | |
| 192 | 190 | #address-cells = <1>; |
| 193 | 191 | #size-cells = <0>; |
| 194 | 192 | |
| @@ -155,9 +155,11 @@ · 154 unmodified lines | ||
| 155 | 155 | * effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use |
| 156 | 156 | * optimized memory barrier primitives."). Here we specify that the affected |
| 157 | 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 | 161 | #ifdef CONFIG_CPU_CAVIUM_OCTEON |
| 160 | −# define __SYNC_rpt(type) (1 + (type == __SYNC_wmb)) | |
| 162 | +# define __SYNC_rpt(type) (1 - (type == __SYNC_wmb)) | |
| 161 | 163 | #else |
| 162 | 164 | # define __SYNC_rpt(type) 1 |
| 163 | 165 | #endif |
| @@ -134,7 +134,7 @@ void release_vpe(struct vpe *v) · 133 unmodified lines | ||
| 134 | 134 | { |
| 135 | 135 | list_del(&v->list); |
| 136 | 136 | if (v->load_addr) |
| 137 | − release_progmem(v); | |
| 137 | + release_progmem(v->load_addr); | |
| 138 | 138 | kfree(v); |
| 139 | 139 | } |
| 140 | 140 | |
| @@ -33,6 +33,7 @@ endif · 32 unmodified lines | ||
| 33 | 33 | cflags-vdso := $(ccflags-vdso) \ |
| 34 | 34 | $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ |
| 35 | 35 | -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \ |
| 36 | + -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \ | |
| 36 | 37 | -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \ |
| 37 | 38 | $(call cc-option, -fno-asynchronous-unwind-tables) \ |
| 38 | 39 | $(call cc-option, -fno-stack-protector) |
| @@ -51,6 +52,8 @@ endif · 12 unmodified lines | ||
| 51 | 52 | |
| 52 | 53 | CFLAGS_REMOVE_vgettimeofday.o = -pg |
| 53 | 54 | |
| 55 | +DISABLE_VDSO := n | |
| 56 | + | |
| 54 | 57 | # |
| 55 | 58 | # For the pre-R6 code in arch/mips/vdso/vdso.h for locating |
| 56 | 59 | # 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 | ||
| 64 | 67 | ifndef CONFIG_CPU_MIPSR6 |
| 65 | 68 | ifeq ($(call ld-ifversion, -lt, 225000000, y),y) |
| 66 | 69 | $(warning MIPS VDSO requires binutils >= 2.25) |
| 67 | − obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y)) | |
| 68 | − ccflags-vdso += -DDISABLE_MIPS_VDSO | |
| 70 | + DISABLE_VDSO := y | |
| 69 | 71 | endif |
| 70 | 72 | endif |
| 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 | +# | |
| 79 | +ifdef CONFIG_CPU_MICROMIPS | |
| 80 | + DISABLE_VDSO := y | |
| 81 | +endif | |
| 82 | + | |
| 83 | +ifeq ($(DISABLE_VDSO),y) | |
| 84 | + obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y)) | |
| 85 | + ccflags-vdso += -DDISABLE_MIPS_VDSO | |
| 86 | +endif | |
| 87 | + | |
| 72 | 88 | # VDSO linker flags. |
| 73 | 89 | VDSO_LDFLAGS := \ |
| 74 | 90 | -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \ |
| @@ -81,12 +97,18 @@ GCOV_PROFILE := n · 6 unmodified lines | ||
| 81 | 97 | UBSAN_SANITIZE := n |
| 82 | 98 | KCOV_INSTRUMENT := n |
| 83 | 99 | |
| 100 | +# Check that we don't have PIC 'jalr t9' calls left | |
| 101 | +quiet_cmd_vdso_mips_check = VDSOCHK $@ | |
| 102 | + cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | egrep -h "jalr.*t9" > /dev/null; \ | |
| 103 | + then (echo >&2 "$@: PIC 'jalr t9' calls are not supported"; \ | |
| 104 | + rm -f $@; /bin/false); fi | |
| 105 | + | |
| 84 | 106 | # |
| 85 | 107 | # Shared build commands. |
| 86 | 108 | # |
| 87 | 109 | |
| 88 | 110 | quiet_cmd_vdsold_and_vdso_check = LD $@ |
| 89 | − cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check) | |
| 111 | + cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check); $(cmd_vdso_mips_check) | |
| 90 | 112 | |
| 91 | 113 | quiet_cmd_vdsold = VDSO $@ |
| 92 | 114 | cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \ |
| @@ -295,8 +295,13 @@ static inline bool pfn_valid(unsigned long pfn) · 294 unmodified lines | ||
| 295 | 295 | /* |
| 296 | 296 | * Some number of bits at the level of the page table that points to |
| 297 | 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 | 303 | #define HUGEPD_SHIFT_MASK 0x3f |
| 304 | +#endif | |
| 300 | 305 | |
| 301 | 306 | #ifndef __ASSEMBLY__ |
| 302 | 307 | |
| @@ -168,6 +168,10 @@ struct thread_struct { · 167 unmodified lines | ||
| 168 | 168 | unsigned long srr1; |
| 169 | 169 | unsigned long dar; |
| 170 | 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 | 175 | #endif |
| 172 | 176 | /* Debug Registers */ |
| 173 | 177 | struct debug_reg debug; |
| @@ -132,6 +132,18 @@ int main(void) · 131 unmodified lines | ||
| 132 | 132 | OFFSET(SRR1, thread_struct, srr1); |
| 133 | 133 | OFFSET(DAR, thread_struct, dar); |
| 134 | 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 | 147 | #endif |
| 136 | 148 | #ifdef CONFIG_SPE |
| 137 | 149 | OFFSET(THREAD_EVR0, thread_struct, evr[0]); |
| @@ -1184,6 +1184,17 @@ void eeh_handle_special_event(void) · 1183 unmodified lines | ||
| 1184 | 1184 | eeh_pe_state_mark(pe, EEH_PE_RECOVERING); |
| 1185 | 1185 | eeh_handle_normal_event(pe); |
| 1186 | 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 | 1198 | pci_lock_rescan_remove(); |
| 1188 | 1199 | list_for_each_entry(hose, &hose_list, list_node) { |
| 1189 | 1200 | phb_pe = eeh_phb_pe_get(hose); |
| @@ -1192,16 +1203,6 @@ void eeh_handle_special_event(void) · 2 unmodified lines | ||
| 1192 | 1203 | (phb_pe->state & EEH_PE_RECOVERING)) |
| 1193 | 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 | 1206 | bus = eeh_pe_bus_get(phb_pe); |
| 1206 | 1207 | if (!bus) { |
| 1207 | 1208 | pr_err("%s: Cannot find PCI bus for " |
| @@ -783,7 +783,7 @@ fast_exception_return: · 782 unmodified lines | ||
| 783 | 783 | 1: lis r3,exc_exit_restart_end@ha |
| 784 | 784 | addi r3,r3,exc_exit_restart_end@l |
| 785 | 785 | cmplw r12,r3 |
| 786 | −#if CONFIG_PPC_BOOK3S_601 | |
| 786 | +#ifdef CONFIG_PPC_BOOK3S_601 | |
| 787 | 787 | bge 2b |
| 788 | 788 | #else |
| 789 | 789 | bge 3f |
| @@ -791,7 +791,7 @@ fast_exception_return: · 1 unmodified line | ||
| 791 | 791 | lis r4,exc_exit_restart@ha |
| 792 | 792 | addi r4,r4,exc_exit_restart@l |
| 793 | 793 | cmplw r12,r4 |
| 794 | −#if CONFIG_PPC_BOOK3S_601 | |
| 794 | +#ifdef CONFIG_PPC_BOOK3S_601 | |
| 795 | 795 | blt 2b |
| 796 | 796 | #else |
| 797 | 797 | blt 3f |
| @@ -1354,12 +1354,17 @@ _GLOBAL(enter_rtas) · 556 unmodified lines | ||
| 1354 | 1354 | mtspr SPRN_SRR0,r8 |
| 1355 | 1355 | mtspr SPRN_SRR1,r9 |
| 1356 | 1356 | RFI |
| 1357 | −1: tophys(r9,r1) | |
| 1357 | +1: tophys_novmstack r9, r1 | |
| 1358 | +#ifdef CONFIG_VMAP_STACK | |
| 1359 | + li r0, MSR_KERNEL & ~MSR_IR /* can take DTLB miss */ | |
| 1360 | + mtmsr r0 | |
| 1361 | + isync | |
| 1362 | +#endif | |
| 1358 | 1363 | lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */ |
| 1359 | 1364 | lwz r9,8(r9) /* original msr value */ |
| 1360 | 1365 | addi r1,r1,INT_FRAME_SIZE |
| 1361 | 1366 | li r0,0 |
| 1362 | − tophys(r7, r2) | |
| 1367 | + tophys_novmstack r7, r2 | |
| 1363 | 1368 | stw r0, THREAD + RTAS_SP(r7) |
| 1364 | 1369 | mtspr SPRN_SRR0,r8 |
| 1365 | 1370 | mtspr SPRN_SRR1,r9 |
| @@ -290,17 +290,55 @@ MachineCheck: · 289 unmodified lines | ||
| 290 | 290 | 7: EXCEPTION_PROLOG_2 |
| 291 | 291 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 292 | 292 | #ifdef CONFIG_PPC_CHRP |
| 293 | − bne cr1,1f | |
| 293 | +#ifdef CONFIG_VMAP_STACK | |
| 294 | + mfspr r4, SPRN_SPRG_THREAD | |
| 295 | + tovirt(r4, r4) | |
| 296 | + lwz r4, RTAS_SP(r4) | |
| 297 | + cmpwi cr1, r4, 0 | |
| 294 | 298 | #endif |
| 295 | − EXC_XFER_STD(0x200, machine_check_exception) | |
| 296 | −#ifdef CONFIG_PPC_CHRP | |
| 297 | −1: b machine_check_in_rtas | |
| 299 | + beq cr1, machine_check_tramp | |
| 300 | + b machine_check_in_rtas | |
| 301 | +#else | |
| 302 | + b machine_check_tramp | |
| 298 | 303 | #endif |
| 299 | 304 | |
| 300 | 305 | /* Data access exception. */ |
| 301 | 306 | . = 0x300 |
| 302 | 307 | DO_KVM 0x300 |
| 303 | 308 | DataAccess: |
| 309 | +#ifdef CONFIG_VMAP_STACK | |
| 310 | + mtspr SPRN_SPRG_SCRATCH0,r10 | |
| 311 | + mfspr r10, SPRN_SPRG_THREAD | |
| 312 | +BEGIN_MMU_FTR_SECTION | |
| 313 | + stw r11, THR11(r10) | |
| 314 | + mfspr r10, SPRN_DSISR | |
| 315 | + mfcr r11 | |
| 316 | +#ifdef CONFIG_PPC_KUAP | |
| 317 | + andis. r10, r10, (DSISR_BAD_FAULT_32S | DSISR_DABRMATCH | DSISR_PROTFAULT)@h | |
| 318 | +#else | |
| 319 | + andis. r10, r10, (DSISR_BAD_FAULT_32S | DSISR_DABRMATCH)@h | |
| 320 | +#endif | |
| 321 | + mfspr r10, SPRN_SPRG_THREAD | |
| 322 | + beq hash_page_dsi | |
| 323 | +.Lhash_page_dsi_cont: | |
| 324 | + mtcr r11 | |
| 325 | + lwz r11, THR11(r10) | |
| 326 | +END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) | |
| 327 | + mtspr SPRN_SPRG_SCRATCH1,r11 | |
| 328 | + mfspr r11, SPRN_DAR | |
| 329 | + stw r11, DAR(r10) | |
| 330 | + mfspr r11, SPRN_DSISR | |
| 331 | + stw r11, DSISR(r10) | |
| 332 | + mfspr r11, SPRN_SRR0 | |
| 333 | + stw r11, SRR0(r10) | |
| 334 | + mfspr r11, SPRN_SRR1 /* check whether user or kernel */ | |
| 335 | + stw r11, SRR1(r10) | |
| 336 | + mfcr r10 | |
| 337 | + andi. r11, r11, MSR_PR | |
| 338 | + | |
| 339 | + EXCEPTION_PROLOG_1 | |
| 340 | + b handle_page_fault_tramp_1 | |
| 341 | +#else /* CONFIG_VMAP_STACK */ | |
| 304 | 342 | EXCEPTION_PROLOG handle_dar_dsisr=1 |
| 305 | 343 | get_and_save_dar_dsisr_on_stack r4, r5, r11 |
| 306 | 344 | BEGIN_MMU_FTR_SECTION |
| @@ -316,11 +354,32 @@ BEGIN_MMU_FTR_SECTION · 9 unmodified lines | ||
| 316 | 354 | FTR_SECTION_ELSE |
| 317 | 355 | b handle_page_fault_tramp_2 |
| 318 | 356 | ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE) |
| 357 | +#endif /* CONFIG_VMAP_STACK */ | |
| 319 | 358 | |
| 320 | 359 | /* Instruction access exception. */ |
| 321 | 360 | . = 0x400 |
| 322 | 361 | DO_KVM 0x400 |
| 323 | 362 | InstructionAccess: |
| 363 | +#ifdef CONFIG_VMAP_STACK | |
| 364 | + mtspr SPRN_SPRG_SCRATCH0,r10 | |
| 365 | + mtspr SPRN_SPRG_SCRATCH1,r11 | |
| 366 | + mfspr r10, SPRN_SPRG_THREAD | |
| 367 | + mfspr r11, SPRN_SRR0 | |
| 368 | + stw r11, SRR0(r10) | |
| 369 | + mfspr r11, SPRN_SRR1 /* check whether user or kernel */ | |
| 370 | + stw r11, SRR1(r10) | |
| 371 | + mfcr r10 | |
| 372 | +BEGIN_MMU_FTR_SECTION | |
| 373 | + andis. r11, r11, SRR1_ISI_NOPT@h /* no pte found? */ | |
| 374 | + bne hash_page_isi | |
| 375 | +.Lhash_page_isi_cont: | |
| 376 | + mfspr r11, SPRN_SRR1 /* check whether user or kernel */ | |
| 377 | +END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) | |
| 378 | + andi. r11, r11, MSR_PR | |
| 379 | + | |
| 380 | + EXCEPTION_PROLOG_1 | |
| 381 | + EXCEPTION_PROLOG_2 | |
| 382 | +#else /* CONFIG_VMAP_STACK */ | |
| 324 | 383 | EXCEPTION_PROLOG |
| 325 | 384 | andis. r0,r9,SRR1_ISI_NOPT@h /* no pte found? */ |
| 326 | 385 | beq 1f /* if so, try to put a PTE */ |
| @@ -329,6 +388,7 @@ InstructionAccess: · 2 unmodified lines | ||
| 329 | 388 | BEGIN_MMU_FTR_SECTION |
| 330 | 389 | bl hash_page |
| 331 | 390 | END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) |
| 391 | +#endif /* CONFIG_VMAP_STACK */ | |
| 332 | 392 | 1: mr r4,r12 |
| 333 | 393 | andis. r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */ |
| 334 | 394 | stw r4, _DAR(r11) |
| @@ -344,7 +404,7 @@ Alignment: · 9 unmodified lines | ||
| 344 | 404 | EXCEPTION_PROLOG handle_dar_dsisr=1 |
| 345 | 405 | save_dar_dsisr_on_stack r4, r5, r11 |
| 346 | 406 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 347 | − EXC_XFER_STD(0x600, alignment_exception) | |
| 407 | + b alignment_exception_tramp | |
| 348 | 408 | |
| 349 | 409 | /* Program check exception */ |
| 350 | 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 | 706 | . = 0x3000 |
| 647 | 707 | |
| 708 | +machine_check_tramp: | |
| 709 | + EXC_XFER_STD(0x200, machine_check_exception) | |
| 710 | + | |
| 711 | +alignment_exception_tramp: | |
| 712 | + EXC_XFER_STD(0x600, alignment_exception) | |
| 713 | + | |
| 648 | 714 | handle_page_fault_tramp_1: |
| 715 | +#ifdef CONFIG_VMAP_STACK | |
| 716 | + EXCEPTION_PROLOG_2 handle_dar_dsisr=1 | |
| 717 | +#endif | |
| 649 | 718 | lwz r4, _DAR(r11) |
| 650 | 719 | lwz r5, _DSISR(r11) |
| 651 | 720 | /* fall through */ |
| 652 | 721 | handle_page_fault_tramp_2: |
| 653 | 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 | + | |
| 753 | +hash_page_dsi: | |
| 754 | + save_regs_thread r10 | |
| 755 | + mfdsisr r3 | |
| 756 | + mfdar r4 | |
| 757 | + mfsrr0 r5 | |
| 758 | + mfsrr1 r9 | |
| 759 | + rlwinm r3, r3, 32 - 15, _PAGE_RW /* DSISR_STORE -> _PAGE_RW */ | |
| 760 | + bl hash_page | |
| 761 | + mfspr r10, SPRN_SPRG_THREAD | |
| 762 | + restore_regs_thread r10 | |
| 763 | + b .Lhash_page_dsi_cont | |
| 764 | + | |
| 765 | +hash_page_isi: | |
| 766 | + mr r11, r10 | |
| 767 | + mfspr r10, SPRN_SPRG_THREAD | |
| 768 | + save_regs_thread r10 | |
| 769 | + li r3, 0 | |
| 770 | + lwz r4, SRR0(r10) | |
| 771 | + lwz r9, SRR1(r10) | |
| 772 | + bl hash_page | |
| 773 | + mfspr r10, SPRN_SPRG_THREAD | |
| 774 | + restore_regs_thread r10 | |
| 775 | + mr r10, r11 | |
| 776 | + b .Lhash_page_isi_cont | |
| 777 | + | |
| 778 | + .globl fast_hash_page_return | |
| 779 | +fast_hash_page_return: | |
| 780 | + andis. r10, r9, SRR1_ISI_NOPT@h /* Set on ISI, cleared on DSI */ | |
| 781 | + mfspr r10, SPRN_SPRG_THREAD | |
| 782 | + restore_regs_thread r10 | |
| 783 | + bne 1f | |
| 784 | + | |
| 785 | + /* DSI */ | |
| 786 | + mtcr r11 | |
| 787 | + lwz r11, THR11(r10) | |
| 788 | + mfspr r10, SPRN_SPRG_SCRATCH0 | |
| 789 | + SYNC | |
| 790 | + RFI | |
| 791 | + | |
| 792 | +1: /* ISI */ | |
| 793 | + mtcr r11 | |
| 794 | + mfspr r11, SPRN_SPRG_SCRATCH1 | |
| 795 | + mfspr r10, SPRN_SPRG_SCRATCH0 | |
| 796 | + SYNC | |
| 797 | + RFI | |
| 798 | + | |
| 655 | 799 | stack_overflow: |
| 656 | 800 | vmap_stack_overflow_exception |
| 801 | +#endif | |
| 657 | 802 | |
| 658 | 803 | AltiVecUnavailable: |
| 659 | 804 | EXCEPTION_PROLOG |
| @@ -64,11 +64,25 @@ · 63 unmodified lines | ||
| 64 | 64 | .endm |
| 65 | 65 | |
| 66 | 66 | .macro EXCEPTION_PROLOG_2 handle_dar_dsisr=0 |
| 67 | +#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S) | |
| 68 | +BEGIN_MMU_FTR_SECTION | |
| 69 | + mtcr r10 | |
| 70 | +FTR_SECTION_ELSE | |
| 71 | + stw r10, _CCR(r11) | |
| 72 | +ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE) | |
| 73 | +#else | |
| 67 | 74 | stw r10,_CCR(r11) /* save registers */ |
| 75 | +#endif | |
| 76 | + mfspr r10, SPRN_SPRG_SCRATCH0 | |
| 68 | 77 | stw r12,GPR12(r11) |
| 69 | 78 | stw r9,GPR9(r11) |
| 70 | − mfspr r10,SPRN_SPRG_SCRATCH0 | |
| 71 | 79 | stw r10,GPR10(r11) |
| 80 | +#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S) | |
| 81 | +BEGIN_MMU_FTR_SECTION | |
| 82 | + mfcr r10 | |
| 83 | + stw r10, _CCR(r11) | |
| 84 | +END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) | |
| 85 | +#endif | |
| 72 | 86 | mfspr r12,SPRN_SPRG_SCRATCH1 |
| 73 | 87 | stw r12,GPR11(r11) |
| 74 | 88 | mflr r10 |
| @@ -83,6 +97,11 @@ · 8 unmodified lines | ||
| 83 | 97 | stw r10, _DSISR(r11) |
| 84 | 98 | .endif |
| 85 | 99 | lwz r9, SRR1(r12) |
| 100 | +#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_PPC_BOOK3S) | |
| 101 | +BEGIN_MMU_FTR_SECTION | |
| 102 | + andi. r10, r9, MSR_PR | |
| 103 | +END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) | |
| 104 | +#endif | |
| 86 | 105 | lwz r12, SRR0(r12) |
| 87 | 106 | #else |
| 88 | 107 | mfspr r12,SPRN_SRR0 |
| @@ -256,7 +256,7 @@ InstructionTLBMiss: · 255 unmodified lines | ||
| 256 | 256 | * set. All other Linux PTE bits control the behavior |
| 257 | 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 | 260 | rlwimi r10, r10, 4, 0x0400 /* Copy _PAGE_EXEC into bit 21 */ |
| 261 | 261 | ori r10, r10, RPN_PATTERN | 0x200 /* Set 22 and 24-27 */ |
| 262 | 262 | mtspr SPRN_MI_RPN, r10 /* Update TLB entry */ |
| @@ -166,7 +166,11 @@ BEGIN_FTR_SECTION · 165 unmodified lines | ||
| 166 | 166 | mfspr r9,SPRN_HID0 |
| 167 | 167 | andis. r9,r9,HID0_NAP@h |
| 168 | 168 | beq 1f |
| 169 | +#ifdef CONFIG_VMAP_STACK | |
| 170 | + addis r9, r11, nap_save_msscr0@ha | |
| 171 | +#else | |
| 169 | 172 | addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha |
| 173 | +#endif | |
| 170 | 174 | lwz r9,nap_save_msscr0@l(r9) |
| 171 | 175 | mtspr SPRN_MSSCR0, r9 |
| 172 | 176 | sync |
| @@ -174,7 +178,11 @@ BEGIN_FTR_SECTION · 1 unmodified line | ||
| 174 | 178 | 1: |
| 175 | 179 | END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR) |
| 176 | 180 | BEGIN_FTR_SECTION |
| 181 | +#ifdef CONFIG_VMAP_STACK | |
| 182 | + addis r9, r11, nap_save_hid1@ha | |
| 183 | +#else | |
| 177 | 184 | addis r9,r11,(nap_save_hid1-KERNELBASE)@ha |
| 185 | +#endif | |
| 178 | 186 | lwz r9,nap_save_hid1@l(r9) |
| 179 | 187 | mtspr SPRN_HID1, r9 |
| 180 | 188 | END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX) |
| @@ -200,14 +200,27 @@ unsigned long get_tm_stackpointer(struct task_struct *tsk) · 199 unmodified lines | ||
| 200 | 200 | * normal/non-checkpointed stack pointer. |
| 201 | 201 | */ |
| 202 | 202 | |
| 203 | + unsigned long ret = tsk->thread.regs->gpr[1]; | |
| 204 | + | |
| 203 | 205 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
| 204 | 206 | BUG_ON(tsk != current); |
| 205 | 207 | |
| 206 | 208 | if (MSR_TM_ACTIVE(tsk->thread.regs->msr)) { |
| 209 | + preempt_disable(); | |
| 207 | 210 | tm_reclaim_current(TM_CAUSE_SIGNAL); |
| 208 | 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 | 224 | #endif |
| 212 | − return tsk->thread.regs->gpr[1]; | |
| 225 | + return ret; | |
| 213 | 226 | } |
| @@ -489,19 +489,11 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, · 488 unmodified lines | ||
| 489 | 489 | */ |
| 490 | 490 | static int save_tm_user_regs(struct pt_regs *regs, |
| 491 | 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 | 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 | 497 | /* Save both sets of general registers */ |
| 506 | 498 | if (save_general_regs(¤t->thread.ckpt_regs, frame) |
| 507 | 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 | 904 | int sigret; |
| 913 | 905 | unsigned long tramp; |
| 914 | 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 | 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 | 941 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
| 946 | 942 | tm_frame = &rt_sf->uc_transact.uc_mcontext; |
| 947 | − if (MSR_TM_ACTIVE(regs->msr)) { | |
| 943 | + if (MSR_TM_ACTIVE(msr)) { | |
| 948 | 944 | if (__put_user((unsigned long)&rt_sf->uc_transact, |
| 949 | 945 | &rt_sf->uc.uc_link) || |
| 950 | 946 | __put_user((unsigned long)tm_frame, |
| 951 | 947 | &rt_sf->uc_transact.uc_regs)) |
| 952 | 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 | 950 | goto badframe; |
| 955 | 951 | } |
| 956 | 952 | else |
| @@ -1369,6 +1365,10 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 412 unmodified lines | ||
| 1369 | 1365 | int sigret; |
| 1370 | 1366 | unsigned long tramp; |
| 1371 | 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 | 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 | 1403 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
| 1404 | 1404 | tm_mctx = &frame->mctx_transact; |
| 1405 | − if (MSR_TM_ACTIVE(regs->msr)) { | |
| 1405 | + if (MSR_TM_ACTIVE(msr)) { | |
| 1406 | 1406 | if (save_tm_user_regs(regs, &frame->mctx, &frame->mctx_transact, |
| 1407 | − sigret)) | |
| 1407 | + sigret, msr)) | |
| 1408 | 1408 | goto badframe; |
| 1409 | 1409 | } |
| 1410 | 1410 | else |
| @@ -192,7 +192,8 @@ static long setup_sigcontext(struct sigcontext __user *sc, · 191 unmodified lines | ||
| 192 | 192 | static long setup_tm_sigcontexts(struct sigcontext __user *sc, |
| 193 | 193 | struct sigcontext __user *tm_sc, |
| 194 | 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 | 198 | /* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the |
| 198 | 199 | * 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 | 208 | elf_vrreg_t __user *tm_v_regs = sigcontext_vmx_regs(tm_sc); |
| 208 | 209 | #endif |
| 209 | 210 | struct pt_regs *regs = tsk->thread.regs; |
| 210 | − unsigned long msr = tsk->thread.regs->msr; | |
| 211 | 211 | long err = 0; |
| 212 | 212 | |
| 213 | 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 | 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 | 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 | 225 | #ifdef CONFIG_ALTIVEC |
| 233 | 226 | err |= __put_user(v_regs, &sc->v_regs); |
| 234 | 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 | 817 | unsigned long newsp = 0; |
| 825 | 818 | long err = 0; |
| 826 | 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 | 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 | 838 | err |= __put_user(0, &frame->uc.uc_flags); |
| 842 | 839 | err |= __save_altstack(&frame->uc.uc_stack, regs->gpr[1]); |
| 843 | 840 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
| 844 | − if (MSR_TM_ACTIVE(regs->msr)) { | |
| 841 | + if (MSR_TM_ACTIVE(msr)) { | |
| 845 | 842 | /* The ucontext_t passed to userland points to the second |
| 846 | 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 | 846 | err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext, |
| 850 | 847 | &frame->uc_transact.uc_mcontext, |
| 851 | 848 | tsk, ksig->sig, NULL, |
| 852 | − (unsigned long)ksig->ka.sa.sa_handler); | |
| 849 | + (unsigned long)ksig->ka.sa.sa_handler, | |
| 850 | + msr); | |
| 853 | 851 | } else |
| 854 | 852 | #endif |
| 855 | 853 | { |
| @@ -25,12 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <asm/feature-fixups.h> |
| 26 | 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 | 28 | #ifdef CONFIG_SMP |
| 35 | 29 | .section .bss |
| 36 | 30 | .align 2 |
| @@ -53,8 +47,8 @@ mmu_hash_lock: · 16 unmodified lines | ||
| 53 | 47 | .text |
| 54 | 48 | _GLOBAL(hash_page) |
| 55 | 49 | #ifdef CONFIG_SMP |
| 56 | − lis r8, (mmu_hash_lock - ADDR_OFFSET)@h | |
| 57 | − ori r8, r8, (mmu_hash_lock - ADDR_OFFSET)@l | |
| 50 | + lis r8, (mmu_hash_lock - PAGE_OFFSET)@h | |
| 51 | + ori r8, r8, (mmu_hash_lock - PAGE_OFFSET)@l | |
| 58 | 52 | lis r0,0x0fff |
| 59 | 53 | b 10f |
| 60 | 54 | 11: lwz r6,0(r8) |
| @@ -72,12 +66,9 @@ _GLOBAL(hash_page) · 11 unmodified lines | ||
| 72 | 66 | cmplw 0,r4,r0 |
| 73 | 67 | ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */ |
| 74 | 68 | mfspr r5, SPRN_SPRG_PGDIR /* phys page-table root */ |
| 75 | −#ifdef CONFIG_VMAP_STACK | |
| 76 | − tovirt(r5, r5) | |
| 77 | −#endif | |
| 78 | 69 | blt+ 112f /* assume user more likely */ |
| 79 | − lis r5, (swapper_pg_dir - ADDR_OFFSET)@ha /* if kernel address, use */ | |
| 80 | − addi r5 ,r5 ,(swapper_pg_dir - ADDR_OFFSET)@l /* kernel page table */ | |
| 70 | + lis r5, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ | |
| 71 | + addi r5 ,r5 ,(swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ | |
| 81 | 72 | rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */ |
| 82 | 73 | 112: |
| 83 | 74 | #ifndef CONFIG_PTE_64BIT |
| @@ -89,9 +80,6 @@ _GLOBAL(hash_page) · 5 unmodified lines | ||
| 89 | 80 | lwzx r8,r8,r5 /* Get L1 entry */ |
| 90 | 81 | rlwinm. r8,r8,0,0,20 /* extract pt base address */ |
| 91 | 82 | #endif |
| 92 | −#ifdef CONFIG_VMAP_STACK | |
| 93 | − tovirt(r8, r8) | |
| 94 | −#endif | |
| 95 | 83 | #ifdef CONFIG_SMP |
| 96 | 84 | beq- hash_page_out /* return if no mapping */ |
| 97 | 85 | #else |
| @@ -143,30 +131,36 @@ retry: · 45 unmodified lines | ||
| 143 | 131 | bne- retry /* retry if someone got there first */ |
| 144 | 132 | |
| 145 | 133 | mfsrin r3,r4 /* get segment reg for segment */ |
| 134 | +#ifndef CONFIG_VMAP_STACK | |
| 146 | 135 | mfctr r0 |
| 147 | 136 | stw r0,_CTR(r11) |
| 137 | +#endif | |
| 148 | 138 | bl create_hpte /* add the hash table entry */ |
| 149 | 139 | |
| 150 | 140 | #ifdef CONFIG_SMP |
| 151 | 141 | eieio |
| 152 | − lis r8, (mmu_hash_lock - ADDR_OFFSET)@ha | |
| 142 | + lis r8, (mmu_hash_lock - PAGE_OFFSET)@ha | |
| 153 | 143 | li r0,0 |
| 154 | − stw r0, (mmu_hash_lock - ADDR_OFFSET)@l(r8) | |
| 144 | + stw r0, (mmu_hash_lock - PAGE_OFFSET)@l(r8) | |
| 155 | 145 | #endif |
| 156 | 146 | |
| 147 | +#ifdef CONFIG_VMAP_STACK | |
| 148 | + b fast_hash_page_return | |
| 149 | +#else | |
| 157 | 150 | /* Return from the exception */ |
| 158 | 151 | lwz r5,_CTR(r11) |
| 159 | 152 | mtctr r5 |
| 160 | 153 | lwz r0,GPR0(r11) |
| 161 | 154 | lwz r8,GPR8(r11) |
| 162 | 155 | b fast_exception_return |
| 156 | +#endif | |
| 163 | 157 | |
| 164 | 158 | #ifdef CONFIG_SMP |
| 165 | 159 | hash_page_out: |
| 166 | 160 | eieio |
| 167 | − lis r8, (mmu_hash_lock - ADDR_OFFSET)@ha | |
| 161 | + lis r8, (mmu_hash_lock - PAGE_OFFSET)@ha | |
| 168 | 162 | li r0,0 |
| 169 | − stw r0, (mmu_hash_lock - ADDR_OFFSET)@l(r8) | |
| 163 | + stw r0, (mmu_hash_lock - PAGE_OFFSET)@l(r8) | |
| 170 | 164 | blr |
| 171 | 165 | #endif /* CONFIG_SMP */ |
| 172 | 166 | |
| @@ -341,7 +335,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 168 unmodified lines | ||
| 341 | 335 | patch_site 1f, patch__hash_page_A1 |
| 342 | 336 | patch_site 2f, patch__hash_page_A2 |
| 343 | 337 | /* Get the address of the primary PTE group in the hash table (r3) */ |
| 344 | −0: lis r0, (Hash_base - ADDR_OFFSET)@h /* base address of hash table */ | |
| 338 | +0: lis r0, (Hash_base - PAGE_OFFSET)@h /* base address of hash table */ | |
| 345 | 339 | 1: rlwimi r0,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */ |
| 346 | 340 | 2: rlwinm r3,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */ |
| 347 | 341 | xor r3,r3,r0 /* make primary hash */ |
| @@ -355,10 +349,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 7 unmodified lines | ||
| 355 | 349 | beq+ 10f /* no PTE: go look for an empty slot */ |
| 356 | 350 | tlbie r4 |
| 357 | 351 | |
| 358 | − lis r4, (htab_hash_searches - ADDR_OFFSET)@ha | |
| 359 | − lwz r6, (htab_hash_searches - ADDR_OFFSET)@l(r4) | |
| 352 | + lis r4, (htab_hash_searches - PAGE_OFFSET)@ha | |
| 353 | + lwz r6, (htab_hash_searches - PAGE_OFFSET)@l(r4) | |
| 360 | 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 | 357 | /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */ |
| 364 | 358 | mtctr r0 |
| @@ -390,10 +384,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) · 25 unmodified lines | ||
| 390 | 384 | beq+ found_empty |
| 391 | 385 | |
| 392 | 386 | /* update counter of times that the primary PTEG is full */ |
| 393 | − lis r4, (primary_pteg_full - ADDR_OFFSET)@ha | |
| 394 | − lwz r6, (primary_pteg_full - ADDR_OFFSET)@l(r4) | |
| 387 | + lis r4, (primary_pteg_full - PAGE_OFFSET)@ha | |
| 388 | + lwz r6, (primary_pteg_full - PAGE_OFFSET)@l(r4) | |
| 395 | 389 | 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 | 392 | patch_site 0f, patch__hash_page_C |
| 399 | 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 | 421 | * lockup here but that shouldn't happen |
| 428 | 422 | */ |
| 429 | 423 | |
| 430 | −1: lis r4, (next_slot - ADDR_OFFSET)@ha /* get next evict slot */ | |
| 431 | − lwz r6, (next_slot - ADDR_OFFSET)@l(r4) | |
| 424 | +1: lis r4, (next_slot - PAGE_OFFSET)@ha /* get next evict slot */ | |
| 425 | + lwz r6, (next_slot - PAGE_OFFSET)@l(r4) | |
| 432 | 426 | addi r6,r6,HPTE_SIZE /* search for candidate */ |
| 433 | 427 | andi. r6,r6,7*HPTE_SIZE |
| 434 | 428 | stw r6,next_slot@l(r4) |
| @@ -413,7 +413,7 @@ void __init MMU_init_hw(void) · 412 unmodified lines | ||
| 413 | 413 | void __init MMU_init_hw_patch(void) |
| 414 | 414 | { |
| 415 | 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 | 418 | if (ppc_md.progress) |
| 419 | 419 | ppc_md.progress("hash:patch", 0x345); |
| @@ -425,11 +425,6 @@ void __init MMU_init_hw_patch(void) · 5 unmodified lines | ||
| 425 | 425 | /* |
| 426 | 426 | * 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 | 428 | modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16); |
| 434 | 429 | modify_instruction_site(&patch__hash_page_A1, 0x7c0, hash_mb << 6); |
| 435 | 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 | 435 | * Patch up the instructions in hashtable.S:flush_hash_page |
| 441 | 436 | */ |
| 442 | − modify_instruction_site(&patch__flush_hash_A0, 0xffff, | |
| 443 | − ((unsigned int)Hash - PAGE_OFFSET) >> 16); | |
| 437 | + modify_instruction_site(&patch__flush_hash_A0, 0xffff, hash >> 16); | |
| 444 | 438 | modify_instruction_site(&patch__flush_hash_A1, 0x7c0, hash_mb << 6); |
| 445 | 439 | modify_instruction_site(&patch__flush_hash_A2, 0x7c0, hash_mb2 << 6); |
| 446 | 440 | modify_instruction_site(&patch__flush_hash_B, 0xffff, hmask); |
| @@ -53,20 +53,24 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, · 52 unmodified lines | ||
| 53 | 53 | if (pshift >= pdshift) { |
| 54 | 54 | cachep = PGT_CACHE(PTE_T_ORDER); |
| 55 | 55 | num_hugepd = 1 << (pshift - pdshift); |
| 56 | + new = NULL; | |
| 56 | 57 | } else if (IS_ENABLED(CONFIG_PPC_8xx)) { |
| 57 | − cachep = PGT_CACHE(PTE_INDEX_SIZE); | |
| 58 | + cachep = NULL; | |
| 58 | 59 | num_hugepd = 1; |
| 60 | + new = pte_alloc_one(mm); | |
| 59 | 61 | } else { |
| 60 | 62 | cachep = PGT_CACHE(pdshift - pshift); |
| 61 | 63 | num_hugepd = 1; |
| 64 | + new = NULL; | |
| 62 | 65 | } |
| 63 | 66 | |
| 64 | − if (!cachep) { | |
| 67 | + if (!cachep && !new) { | |
| 65 | 68 | WARN_ONCE(1, "No page table cache created for hugetlb tables"); |
| 66 | 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 | 75 | BUG_ON(pshift > HUGEPD_SHIFT_MASK); |
| 72 | 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 | 101 | if (i < num_hugepd) { |
| 98 | 102 | for (i = i - 1 ; i >= 0; i--, hpdp--) |
| 99 | 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 | 108 | } else { |
| 102 | 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 | 331 | if (shift >= pdshift) |
| 325 | 332 | hugepd_free(tlb, hugepte); |
| 326 | 333 | else if (IS_ENABLED(CONFIG_PPC_8xx)) |
| 327 | − pgtable_free_tlb(tlb, hugepte, | |
| 328 | − get_hugepd_cache_index(PTE_INDEX_SIZE)); | |
| 334 | + pgtable_free_tlb(tlb, hugepte, 0); | |
| 329 | 335 | else |
| 330 | 336 | pgtable_free_tlb(tlb, hugepte, |
| 331 | 337 | get_hugepd_cache_index(pdshift - shift)); |
| @@ -639,12 +645,13 @@ static int __init hugetlbpage_init(void) · 307 unmodified lines | ||
| 639 | 645 | * if we have pdshift and shift value same, we don't |
| 640 | 646 | * use pgt cache for hugepd. |
| 641 | 647 | */ |
| 642 | − if (pdshift > shift && IS_ENABLED(CONFIG_PPC_8xx)) | |
| 643 | − pgtable_cache_add(PTE_INDEX_SIZE); | |
| 644 | − else if (pdshift > shift) | |
| 645 | − pgtable_cache_add(pdshift - shift); | |
| 646 | − else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || IS_ENABLED(CONFIG_PPC_8xx)) | |
| 648 | + if (pdshift > shift) { | |
| 649 | + if (!IS_ENABLED(CONFIG_PPC_8xx)) | |
| 650 | + pgtable_cache_add(pdshift - shift); | |
| 651 | + } else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || | |
| 652 | + IS_ENABLED(CONFIG_PPC_8xx)) { | |
| 647 | 653 | pgtable_cache_add(PTE_T_ORDER); |
| 654 | + } | |
| 648 | 655 | |
| 649 | 656 | configured = true; |
| 650 | 657 | } |
| @@ -185,8 +185,7 @@ u8 __initdata early_hash[256 << 10] __aligned(256 << 10) = {0}; · 184 unmodified lines | ||
| 185 | 185 | |
| 186 | 186 | static void __init kasan_early_hash_table(void) |
| 187 | 187 | { |
| 188 | − unsigned int hash = IS_ENABLED(CONFIG_VMAP_STACK) ? (unsigned int)early_hash : | |
| 189 | − __pa(early_hash); | |
| 188 | + unsigned int hash = __pa(early_hash); | |
| 190 | 189 | |
| 191 | 190 | modify_instruction_site(&patch__hash_page_A0, 0xffff, hash >> 16); |
| 192 | 191 | modify_instruction_site(&patch__flush_hash_A0, 0xffff, hash >> 16); |
| @@ -3435,6 +3435,11 @@ getstring(char *s, int size) · 3434 unmodified lines | ||
| 3435 | 3435 | int c; |
| 3436 | 3436 | |
| 3437 | 3437 | c = skipbl(); |
| 3438 | + if (c == '\n') { | |
| 3439 | + *s = 0; | |
| 3440 | + return; | |
| 3441 | + } | |
| 3442 | + | |
| 3438 | 3443 | do { |
| 3439 | 3444 | if( size > 1 ){ |
| 3440 | 3445 | *s++ = c; |
| @@ -1,2 +1,4 @@ | ||
| 1 | 1 | Image |
| 2 | 2 | Image.gz |
| 3 | +loader | |
| 4 | +loader.lds | |
| @@ -72,6 +72,16 @@ · 71 unmodified lines | ||
| 72 | 72 | #define EXC_LOAD_PAGE_FAULT 13 |
| 73 | 73 | #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 | 85 | /* symbolic CSR names: */ |
| 76 | 86 | #define CSR_CYCLE 0xc00 |
| 77 | 87 | #define CSR_TIME 0xc01 |
| @@ -100,6 +110,8 @@ · 22 unmodified lines | ||
| 100 | 110 | #define CSR_MCAUSE 0x342 |
| 101 | 111 | #define CSR_MTVAL 0x343 |
| 102 | 112 | #define CSR_MIP 0x344 |
| 113 | +#define CSR_PMPCFG0 0x3a0 | |
| 114 | +#define CSR_PMPADDR0 0x3b0 | |
| 103 | 115 | #define CSR_MHARTID 0xf14 |
| 104 | 116 | |
| 105 | 117 | #ifdef CONFIG_RISCV_M_MODE |
| @@ -58,6 +58,12 @@ _start_kernel: · 57 unmodified lines | ||
| 58 | 58 | /* Reset all registers except ra, a0, a1 */ |
| 59 | 59 | 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 | 68 | * The hartid in a0 is expected later on, and we have no firmware |
| 63 | 69 | * to hand it to us. |
| @@ -156,6 +156,6 @@ void __init trap_init(void) · 155 unmodified lines | ||
| 156 | 156 | csr_write(CSR_SCRATCH, 0); |
| 157 | 157 | /* Set the exception vector address */ |
| 158 | 158 | csr_write(CSR_TVEC, &handle_exception); |
| 159 | − /* Enable all interrupts */ | |
| 160 | − csr_write(CSR_IE, -1); | |
| 159 | + /* Enable interrupts */ | |
| 160 | + csr_write(CSR_IE, IE_SIE | IE_EIE); | |
| 161 | 161 | } |
| @@ -19,18 +19,20 @@ asmlinkage void __init kasan_early_init(void) · 18 unmodified lines | ||
| 19 | 19 | for (i = 0; i < PTRS_PER_PTE; ++i) |
| 20 | 20 | set_pte(kasan_early_shadow_pte + i, |
| 21 | 21 | mk_pte(virt_to_page(kasan_early_shadow_page), |
| 22 | − PAGE_KERNEL)); | |
| 22 | + PAGE_KERNEL)); | |
| 23 | 23 | |
| 24 | 24 | for (i = 0; i < PTRS_PER_PMD; ++i) |
| 25 | 25 | set_pmd(kasan_early_shadow_pmd + i, |
| 26 | − pfn_pmd(PFN_DOWN(__pa((uintptr_t)kasan_early_shadow_pte)), | |
| 27 | − __pgprot(_PAGE_TABLE))); | |
| 26 | + pfn_pmd(PFN_DOWN | |
| 27 | + (__pa((uintptr_t) kasan_early_shadow_pte)), | |
| 28 | + __pgprot(_PAGE_TABLE))); | |
| 28 | 29 | |
| 29 | 30 | for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END; |
| 30 | 31 | i += PGDIR_SIZE, ++pgd) |
| 31 | 32 | set_pgd(pgd, |
| 32 | − pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))), | |
| 33 | − __pgprot(_PAGE_TABLE))); | |
| 33 | + pfn_pgd(PFN_DOWN | |
| 34 | + (__pa(((uintptr_t) kasan_early_shadow_pmd))), | |
| 35 | + __pgprot(_PAGE_TABLE))); | |
| 34 | 36 | |
| 35 | 37 | /* init for swapper_pg_dir */ |
| 36 | 38 | pgd = pgd_offset_k(KASAN_SHADOW_START); |
| @@ -38,37 +40,43 @@ asmlinkage void __init kasan_early_init(void) · 1 unmodified line | ||
| 38 | 40 | for (i = KASAN_SHADOW_START; i < KASAN_SHADOW_END; |
| 39 | 41 | i += PGDIR_SIZE, ++pgd) |
| 40 | 42 | set_pgd(pgd, |
| 41 | − pfn_pgd(PFN_DOWN(__pa(((uintptr_t)kasan_early_shadow_pmd))), | |
| 42 | − __pgprot(_PAGE_TABLE))); | |
| 43 | + pfn_pgd(PFN_DOWN | |
| 44 | + (__pa(((uintptr_t) kasan_early_shadow_pmd))), | |
| 45 | + __pgprot(_PAGE_TABLE))); | |
| 43 | 46 | |
| 44 | 47 | flush_tlb_all(); |
| 45 | 48 | } |
| 46 | 49 | |
| 47 | 50 | static void __init populate(void *start, void *end) |
| 48 | 51 | { |
| 49 | − unsigned long i; | |
| 52 | + unsigned long i, offset; | |
| 50 | 53 | unsigned long vaddr = (unsigned long)start & PAGE_MASK; |
| 51 | 54 | unsigned long vend = PAGE_ALIGN((unsigned long)end); |
| 52 | 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 | 58 | unsigned long n_pmds = |
| 54 | − (n_pages % PTRS_PER_PTE) ? n_pages / PTRS_PER_PTE + 1 : | |
| 55 | − n_pages / PTRS_PER_PTE; | |
| 59 | + ((n_ptes + PTRS_PER_PMD) & -PTRS_PER_PMD) / PTRS_PER_PMD; | |
| 60 | + | |
| 61 | + pte_t *pte = | |
| 62 | + memblock_alloc(n_ptes * PTRS_PER_PTE * sizeof(pte_t), PAGE_SIZE); | |
| 63 | + pmd_t *pmd = | |
| 64 | + memblock_alloc(n_pmds * PTRS_PER_PMD * sizeof(pmd_t), PAGE_SIZE); | |
| 56 | 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 | 67 | for (i = 0; i < n_pages; i++) { |
| 61 | 68 | phys_addr_t phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE); |
| 62 | − | |
| 63 | − set_pte(pte + i, pfn_pte(PHYS_PFN(phys), PAGE_KERNEL)); | |
| 69 | + set_pte(&pte[i], pfn_pte(PHYS_PFN(phys), PAGE_KERNEL)); | |
| 64 | 70 | } |
| 65 | 71 | |
| 66 | − for (i = 0; i < n_pmds; ++pgd, i += PTRS_PER_PMD) | |
| 67 | − set_pgd(pgd, pfn_pgd(PFN_DOWN(__pa(((uintptr_t)(pmd + i)))), | |
| 72 | + for (i = 0, offset = 0; i < n_ptes; i++, offset += PTRS_PER_PTE) | |
| 73 | + set_pmd(&pmd[i], | |
| 74 | + pfn_pmd(PFN_DOWN(__pa(&pte[offset])), | |
| 68 | 75 | __pgprot(_PAGE_TABLE))); |
| 69 | 76 | |
| 70 | − for (i = 0; i < n_pages; ++pmd, i += PTRS_PER_PTE) | |
| 71 | − set_pmd(pmd, pfn_pmd(PFN_DOWN(__pa((uintptr_t)(pte + i))), | |
| 77 | + for (i = 0, offset = 0; i < n_pmds; i++, offset += PTRS_PER_PMD) | |
| 78 | + set_pgd(&pgd[i], | |
| 79 | + pfn_pgd(PFN_DOWN(__pa(&pmd[offset])), | |
| 72 | 80 | __pgprot(_PAGE_TABLE))); |
| 73 | 81 | |
| 74 | 82 | flush_tlb_all(); |
| @@ -81,7 +89,8 @@ void __init kasan_init(void) · 6 unmodified lines | ||
| 81 | 89 | unsigned long i; |
| 82 | 90 | |
| 83 | 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 | 95 | for_each_memblock(memory, reg) { |
| 87 | 96 | void *start = (void *)__va(reg->base); |
| @@ -90,14 +99,14 @@ void __init kasan_init(void) · 2 unmodified lines | ||
| 90 | 99 | if (start >= end) |
| 91 | 100 | break; |
| 92 | 101 | |
| 93 | − populate(kasan_mem_to_shadow(start), | |
| 94 | − kasan_mem_to_shadow(end)); | |
| 102 | + populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end)); | |
| 95 | 103 | }; |
| 96 | 104 | |
| 97 | 105 | for (i = 0; i < PTRS_PER_PTE; i++) |
| 98 | 106 | set_pte(&kasan_early_shadow_pte[i], |
| 99 | 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 | 111 | memset(kasan_early_shadow_page, 0, PAGE_SIZE); |
| 103 | 112 | init_task.kasan_depth = 0; |
| @@ -146,7 +146,7 @@ all: bzImage · 145 unmodified lines | ||
| 146 | 146 | #KBUILD_IMAGE is necessary for packaging targets like rpm-pkg, deb-pkg... |
| 147 | 147 | KBUILD_IMAGE := $(boot)/bzImage |
| 148 | 148 | |
| 149 | −install: vmlinux | |
| 149 | +install: | |
| 150 | 150 | $(Q)$(MAKE) $(build)=$(boot) $@ |
| 151 | 151 | |
| 152 | 152 | bzImage: vmlinux |
| @@ -70,7 +70,7 @@ $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE · 69 unmodified lines | ||
| 70 | 70 | $(obj)/startup.a: $(OBJECTS) FORCE |
| 71 | 71 | $(call if_changed,ar) |
| 72 | 72 | |
| 73 | −install: $(CONFIGURE) $(obj)/bzImage | |
| 73 | +install: | |
| 74 | 74 | sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ |
| 75 | 75 | System.map "$(INSTALL_PATH)" |
| 76 | 76 | |
| @@ -75,7 +75,7 @@ static unsigned long get_random(unsigned long limit) · 74 unmodified lines | ||
| 75 | 75 | *(unsigned long *) prng.parm_block ^= seed; |
| 76 | 76 | for (i = 0; i < 16; i++) { |
| 77 | 77 | cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block, |
| 78 | − (char *) entropy, (char *) entropy, | |
| 78 | + (u8 *) entropy, (u8 *) entropy, | |
| 79 | 79 | sizeof(entropy)); |
| 80 | 80 | memcpy(prng.parm_block, entropy, sizeof(entropy)); |
| 81 | 81 | } |
| @@ -15,7 +15,8 @@ void uv_query_info(void) · 14 unmodified lines | ||
| 15 | 15 | if (!test_facility(158)) |
| 16 | 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 | 20 | return; |
| 20 | 21 | |
| 21 | 22 | if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) && |
| @@ -53,6 +53,7 @@ CONFIG_VFIO_AP=m · 52 unmodified lines | ||
| 53 | 53 | CONFIG_CRASH_DUMP=y |
| 54 | 54 | CONFIG_HIBERNATION=y |
| 55 | 55 | CONFIG_PM_DEBUG=y |
| 56 | +CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y | |
| 56 | 57 | CONFIG_CMM=m |
| 57 | 58 | CONFIG_APPLDATA_BASE=y |
| 58 | 59 | CONFIG_KVM=m |
| @@ -474,7 +475,6 @@ CONFIG_NLMON=m · 415 unmodified lines | ||
| 474 | 475 | # CONFIG_NET_VENDOR_EMULEX is not set |
| 475 | 476 | # CONFIG_NET_VENDOR_EZCHIP is not set |
| 476 | 477 | # CONFIG_NET_VENDOR_GOOGLE is not set |
| 477 | −# CONFIG_NET_VENDOR_HP is not set | |
| 478 | 478 | # CONFIG_NET_VENDOR_HUAWEI is not set |
| 479 | 479 | # CONFIG_NET_VENDOR_INTEL is not set |
| 480 | 480 | # CONFIG_NET_VENDOR_MARVELL is not set |
| @@ -684,7 +684,6 @@ CONFIG_CRYPTO_ADIANTUM=m · 203 unmodified lines | ||
| 684 | 684 | CONFIG_CRYPTO_XCBC=m |
| 685 | 685 | CONFIG_CRYPTO_VMAC=m |
| 686 | 686 | CONFIG_CRYPTO_CRC32=m |
| 687 | −CONFIG_CRYPTO_XXHASH=m | |
| 688 | 687 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 689 | 688 | CONFIG_CRYPTO_RMD128=m |
| 690 | 689 | CONFIG_CRYPTO_RMD160=m |
| @@ -748,7 +747,6 @@ CONFIG_DEBUG_INFO_DWARF4=y · 57 unmodified lines | ||
| 748 | 747 | CONFIG_GDB_SCRIPTS=y |
| 749 | 748 | CONFIG_FRAME_WARN=1024 |
| 750 | 749 | CONFIG_HEADERS_INSTALL=y |
| 751 | −CONFIG_HEADERS_CHECK=y | |
| 752 | 750 | CONFIG_DEBUG_SECTION_MISMATCH=y |
| 753 | 751 | CONFIG_MAGIC_SYSRQ=y |
| 754 | 752 | CONFIG_DEBUG_PAGEALLOC=y |
| @@ -772,9 +770,9 @@ CONFIG_DEBUG_MEMORY_INIT=y · 17 unmodified lines | ||
| 772 | 770 | CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m |
| 773 | 771 | CONFIG_DEBUG_PER_CPU_MAPS=y |
| 774 | 772 | CONFIG_DEBUG_SHIRQ=y |
| 773 | +CONFIG_PANIC_ON_OOPS=y | |
| 775 | 774 | CONFIG_DETECT_HUNG_TASK=y |
| 776 | 775 | CONFIG_WQ_WATCHDOG=y |
| 777 | −CONFIG_PANIC_ON_OOPS=y | |
| 778 | 776 | CONFIG_DEBUG_TIMEKEEPING=y |
| 779 | 777 | CONFIG_PROVE_LOCKING=y |
| 780 | 778 | CONFIG_LOCK_STAT=y |
| @@ -783,9 +781,20 @@ CONFIG_DEBUG_ATOMIC_SLEEP=y · 2 unmodified lines | ||
| 783 | 781 | CONFIG_DEBUG_LOCKING_API_SELFTESTS=y |
| 784 | 782 | CONFIG_DEBUG_SG=y |
| 785 | 783 | CONFIG_DEBUG_NOTIFIERS=y |
| 784 | +CONFIG_BUG_ON_DATA_CORRUPTION=y | |
| 786 | 785 | CONFIG_DEBUG_CREDENTIALS=y |
| 787 | 786 | CONFIG_RCU_TORTURE_TEST=m |
| 788 | 787 | CONFIG_RCU_CPU_STALL_TIMEOUT=300 |
| 788 | +CONFIG_LATENCYTOP=y | |
| 789 | +CONFIG_FUNCTION_PROFILER=y | |
| 790 | +CONFIG_STACK_TRACER=y | |
| 791 | +CONFIG_IRQSOFF_TRACER=y | |
| 792 | +CONFIG_PREEMPT_TRACER=y | |
| 793 | +CONFIG_SCHED_TRACER=y | |
| 794 | +CONFIG_FTRACE_SYSCALLS=y | |
| 795 | +CONFIG_BLK_DEV_IO_TRACE=y | |
| 796 | +CONFIG_HIST_TRIGGERS=y | |
| 797 | +CONFIG_S390_PTDUMP=y | |
| 789 | 798 | CONFIG_NOTIFIER_ERROR_INJECTION=m |
| 790 | 799 | CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m |
| 791 | 800 | CONFIG_FAULT_INJECTION=y |
| @@ -796,15 +805,6 @@ CONFIG_FAIL_IO_TIMEOUT=y · 4 unmodified lines | ||
| 796 | 805 | CONFIG_FAIL_FUTEX=y |
| 797 | 806 | CONFIG_FAULT_INJECTION_DEBUG_FS=y |
| 798 | 807 | CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y |
| 799 | −CONFIG_LATENCYTOP=y | |
| 800 | −CONFIG_IRQSOFF_TRACER=y | |
| 801 | −CONFIG_PREEMPT_TRACER=y | |
| 802 | −CONFIG_SCHED_TRACER=y | |
| 803 | −CONFIG_FTRACE_SYSCALLS=y | |
| 804 | −CONFIG_STACK_TRACER=y | |
| 805 | −CONFIG_BLK_DEV_IO_TRACE=y | |
| 806 | −CONFIG_FUNCTION_PROFILER=y | |
| 807 | −CONFIG_HIST_TRIGGERS=y | |
| 808 | 808 | CONFIG_LKDTM=m |
| 809 | 809 | CONFIG_TEST_LIST_SORT=y |
| 810 | 810 | CONFIG_TEST_SORT=y |
| @@ -814,5 +814,3 @@ CONFIG_INTERVAL_TREE_TEST=m · 3 unmodified lines | ||
| 814 | 814 | CONFIG_PERCPU_TEST=m |
| 815 | 815 | CONFIG_ATOMIC64_SELFTEST=y |
| 816 | 816 | CONFIG_TEST_BPF=m |
| 817 | −CONFIG_BUG_ON_DATA_CORRUPTION=y | |
| 818 | −CONFIG_S390_PTDUMP=y | |
| @@ -53,6 +53,7 @@ CONFIG_VFIO_AP=m · 52 unmodified lines | ||
| 53 | 53 | CONFIG_CRASH_DUMP=y |
| 54 | 54 | CONFIG_HIBERNATION=y |
| 55 | 55 | CONFIG_PM_DEBUG=y |
| 56 | +CONFIG_PROTECTED_VIRTUALIZATION_GUEST=y | |
| 56 | 57 | CONFIG_CMM=m |
| 57 | 58 | CONFIG_APPLDATA_BASE=y |
| 58 | 59 | CONFIG_KVM=m |
| @@ -470,7 +471,6 @@ CONFIG_NLMON=m · 411 unmodified lines | ||
| 470 | 471 | # CONFIG_NET_VENDOR_EMULEX is not set |
| 471 | 472 | # CONFIG_NET_VENDOR_EZCHIP is not set |
| 472 | 473 | # CONFIG_NET_VENDOR_GOOGLE is not set |
| 473 | −# CONFIG_NET_VENDOR_HP is not set | |
| 474 | 474 | # CONFIG_NET_VENDOR_HUAWEI is not set |
| 475 | 475 | # CONFIG_NET_VENDOR_INTEL is not set |
| 476 | 476 | # CONFIG_NET_VENDOR_MARVELL is not set |
| @@ -677,7 +677,6 @@ CONFIG_CRYPTO_ADIANTUM=m · 200 unmodified lines | ||
| 677 | 677 | CONFIG_CRYPTO_XCBC=m |
| 678 | 678 | CONFIG_CRYPTO_VMAC=m |
| 679 | 679 | CONFIG_CRYPTO_CRC32=m |
| 680 | −CONFIG_CRYPTO_XXHASH=m | |
| 681 | 680 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 682 | 681 | CONFIG_CRYPTO_RMD128=m |
| 683 | 682 | CONFIG_CRYPTO_RMD160=m |
| @@ -739,18 +738,18 @@ CONFIG_DEBUG_SECTION_MISMATCH=y · 55 unmodified lines | ||
| 739 | 738 | CONFIG_MAGIC_SYSRQ=y |
| 740 | 739 | CONFIG_DEBUG_MEMORY_INIT=y |
| 741 | 740 | CONFIG_PANIC_ON_OOPS=y |
| 741 | +CONFIG_BUG_ON_DATA_CORRUPTION=y | |
| 742 | 742 | CONFIG_RCU_TORTURE_TEST=m |
| 743 | 743 | CONFIG_RCU_CPU_STALL_TIMEOUT=60 |
| 744 | 744 | CONFIG_LATENCYTOP=y |
| 745 | +CONFIG_FUNCTION_PROFILER=y | |
| 746 | +CONFIG_STACK_TRACER=y | |
| 745 | 747 | CONFIG_SCHED_TRACER=y |
| 746 | 748 | CONFIG_FTRACE_SYSCALLS=y |
| 747 | −CONFIG_STACK_TRACER=y | |
| 748 | 749 | CONFIG_BLK_DEV_IO_TRACE=y |
| 749 | −CONFIG_FUNCTION_PROFILER=y | |
| 750 | 750 | CONFIG_HIST_TRIGGERS=y |
| 751 | +CONFIG_S390_PTDUMP=y | |
| 751 | 752 | CONFIG_LKDTM=m |
| 752 | 753 | CONFIG_PERCPU_TEST=m |
| 753 | 754 | CONFIG_ATOMIC64_SELFTEST=y |
| 754 | 755 | CONFIG_TEST_BPF=m |
| 755 | −CONFIG_BUG_ON_DATA_CORRUPTION=y | |
| 756 | −CONFIG_S390_PTDUMP=y | |
| @@ -42,7 +42,7 @@ void __storage_key_init_range(unsigned long start, unsigned long end); · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | static 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 | 46 | __storage_key_init_range(start, end); |
| 47 | 47 | } |
| 48 | 48 | |
| @@ -84,7 +84,6 @@ void s390_update_cpu_mhz(void); · 83 unmodified lines | ||
| 84 | 84 | void cpu_detect_mhz_feature(void); |
| 85 | 85 | |
| 86 | 86 | extern const struct seq_operations cpuinfo_op; |
| 87 | −extern int sysctl_ieee_emulation_warnings; | |
| 88 | 87 | extern void execve_tail(void); |
| 89 | 88 | extern void __bpon(void); |
| 90 | 89 | |
| @@ -201,7 +201,7 @@ struct slib { · 200 unmodified lines | ||
| 201 | 201 | * @scount: SBAL count |
| 202 | 202 | * @sflags: whole SBAL flags |
| 203 | 203 | * @length: length |
| 204 | − * @addr: address | |
| 204 | + * @addr: absolute data address | |
| 205 | 205 | */ |
| 206 | 206 | struct qdio_buffer_element { |
| 207 | 207 | u8 eflags; |
| @@ -211,7 +211,7 @@ struct qdio_buffer_element { · 3 unmodified lines | ||
| 211 | 211 | u8 scount; |
| 212 | 212 | u8 sflags; |
| 213 | 213 | u32 length; |
| 214 | − void *addr; | |
| 214 | + u64 addr; | |
| 215 | 215 | } __attribute__ ((packed, aligned(16))); |
| 216 | 216 | |
| 217 | 217 | /** |
| @@ -227,7 +227,7 @@ struct qdio_buffer { · 9 unmodified lines | ||
| 227 | 227 | * @sbal: absolute SBAL address |
| 228 | 228 | */ |
| 229 | 229 | struct sl_element { |
| 230 | − unsigned long sbal; | |
| 230 | + u64 sbal; | |
| 231 | 231 | } __attribute__ ((packed)); |
| 232 | 232 | |
| 233 | 233 | /** |
| @@ -155,7 +155,7 @@ static inline void get_tod_clock_ext(char *clk) · 154 unmodified lines | ||
| 155 | 155 | |
| 156 | 156 | static 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 | 160 | get_tod_clock_ext(clk); |
| 161 | 161 | return *((unsigned long long *)&clk[1]); |
| @@ -29,9 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | #define __PAGE_OFFSET __PAGE_OFFSET_BASE |
| 30 | 30 | #include "../../mm/ident_map.c" |
| 31 | 31 | |
| 32 | −/* Used by pgtable.h asm code to force instruction serialization. */ | |
| 33 | −unsigned long __force_order; | |
| 34 | − | |
| 35 | 32 | /* Used to track our page table allocation area. */ |
| 36 | 33 | struct alloc_pgt_data { |
| 37 | 34 | unsigned char *pgt_buf; |
| @@ -250,6 +250,7 @@ static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] = · 249 unmodified lines | ||
| 250 | 250 | [PERF_COUNT_HW_CPU_CYCLES] = 0x0076, |
| 251 | 251 | [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, |
| 252 | 252 | [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60, |
| 253 | + [PERF_COUNT_HW_CACHE_MISSES] = 0x0964, | |
| 253 | 254 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2, |
| 254 | 255 | [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3, |
| 255 | 256 | [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x0287, |
| @@ -4765,6 +4765,7 @@ __init int intel_pmu_init(void) · 4764 unmodified lines | ||
| 4765 | 4765 | break; |
| 4766 | 4766 | |
| 4767 | 4767 | case INTEL_FAM6_ATOM_TREMONT_D: |
| 4768 | + case INTEL_FAM6_ATOM_TREMONT: | |
| 4768 | 4769 | x86_pmu.late_ack = true; |
| 4769 | 4770 | memcpy(hw_cache_event_ids, glp_hw_cache_event_ids, |
| 4770 | 4771 | sizeof(hw_cache_event_ids)); |
| @@ -40,17 +40,18 @@ · 39 unmodified lines | ||
| 40 | 40 | * Model specific counters: |
| 41 | 41 | * MSR_CORE_C1_RES: CORE C1 Residency Counter |
| 42 | 42 | * perf code: 0x00 |
| 43 | − * Available model: SLM,AMT,GLM,CNL | |
| 43 | + * Available model: SLM,AMT,GLM,CNL,TNT | |
| 44 | 44 | * Scope: Core (each processor core has a MSR) |
| 45 | 45 | * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter |
| 46 | 46 | * perf code: 0x01 |
| 47 | 47 | * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM, |
| 48 | − * CNL,KBL,CML | |
| 48 | + * CNL,KBL,CML,TNT | |
| 49 | 49 | * Scope: Core |
| 50 | 50 | * MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter |
| 51 | 51 | * perf code: 0x02 |
| 52 | 52 | * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, |
| 53 | − * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL | |
| 53 | + * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL, | |
| 54 | + * TNT | |
| 54 | 55 | * Scope: Core |
| 55 | 56 | * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter |
| 56 | 57 | * perf code: 0x03 |
| @@ -60,17 +61,18 @@ · 3 unmodified lines | ||
| 60 | 61 | * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter. |
| 61 | 62 | * perf code: 0x00 |
| 62 | 63 | * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, |
| 63 | − * KBL,CML,ICL,TGL | |
| 64 | + * KBL,CML,ICL,TGL,TNT | |
| 64 | 65 | * Scope: Package (physical package) |
| 65 | 66 | * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter. |
| 66 | 67 | * perf code: 0x01 |
| 67 | 68 | * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL, |
| 68 | − * GLM,CNL,KBL,CML,ICL,TGL | |
| 69 | + * GLM,CNL,KBL,CML,ICL,TGL,TNT | |
| 69 | 70 | * Scope: Package (physical package) |
| 70 | 71 | * MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter. |
| 71 | 72 | * perf code: 0x02 |
| 72 | − * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW | |
| 73 | − * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL | |
| 73 | + * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, | |
| 74 | + * SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL, | |
| 75 | + * TNT | |
| 74 | 76 | * Scope: Package (physical package) |
| 75 | 77 | * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter. |
| 76 | 78 | * perf code: 0x03 |
| @@ -87,7 +89,8 @@ · 10 unmodified lines | ||
| 87 | 89 | * Scope: Package (physical package) |
| 88 | 90 | * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter. |
| 89 | 91 | * perf code: 0x06 |
| 90 | − * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL | |
| 92 | + * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL, | |
| 93 | + * TNT | |
| 91 | 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 | 644 | X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT, glm_cstates), |
| 642 | 645 | X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_D, glm_cstates), |
| 643 | − | |
| 644 | 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 | 650 | X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_L, icl_cstates), |
| 647 | 651 | X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE, icl_cstates), |
| @@ -1714,6 +1714,8 @@ intel_pmu_save_and_restart_reload(struct perf_event *event, int count) · 1713 unmodified lines | ||
| 1714 | 1714 | old = ((s64)(prev_raw_count << shift) >> shift); |
| 1715 | 1715 | local64_add(new - old + count * period, &event->count); |
| 1716 | 1716 | |
| 1717 | + local64_set(&hwc->period_left, -new); | |
| 1718 | + | |
| 1717 | 1719 | perf_event_update_userpage(event); |
| 1718 | 1720 | |
| 1719 | 1721 | return 0; |
| @@ -75,8 +75,9 @@ static bool test_intel(int idx, void *data) · 74 unmodified lines | ||
| 75 | 75 | |
| 76 | 76 | case INTEL_FAM6_ATOM_GOLDMONT: |
| 77 | 77 | case INTEL_FAM6_ATOM_GOLDMONT_D: |
| 78 | − | |
| 79 | 78 | case INTEL_FAM6_ATOM_GOLDMONT_PLUS: |
| 79 | + case INTEL_FAM6_ATOM_TREMONT_D: | |
| 80 | + case INTEL_FAM6_ATOM_TREMONT: | |
| 80 | 81 | |
| 81 | 82 | case INTEL_FAM6_XEON_PHI_KNL: |
| 82 | 83 | case INTEL_FAM6_XEON_PHI_KNM: |
| @@ -19,7 +19,14 @@ struct task_struct; · 18 unmodified lines | ||
| 19 | 19 | void io_bitmap_share(struct task_struct *tsk); |
| 20 | 20 | void io_bitmap_exit(void); |
| 21 | 21 | |
| 22 | −void tss_update_io_bitmap(void); | |
| 22 | +void native_tss_update_io_bitmap(void); | |
| 23 | + | |
| 24 | +#ifdef CONFIG_PARAVIRT_XXL | |
| 25 | +#include <asm/paravirt.h> | |
| 26 | +#else | |
| 27 | +#define tss_update_io_bitmap native_tss_update_io_bitmap | |
| 28 | +#endif | |
| 29 | + | |
| 23 | 30 | #else |
| 24 | 31 | static inline void io_bitmap_share(struct task_struct *tsk) { } |
| 25 | 32 | static inline void io_bitmap_exit(void) { } |
| @@ -292,6 +292,14 @@ enum x86emul_mode { · 291 unmodified lines | ||
| 292 | 292 | #define X86EMUL_SMM_MASK (1 << 6) |
| 293 | 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 | + */ | |
| 299 | +struct fastop; | |
| 300 | + | |
| 301 | +typedef void (*fastop_t)(struct fastop *); | |
| 302 | + | |
| 295 | 303 | struct x86_emulate_ctxt { |
| 296 | 304 | const struct x86_emulate_ops *ops; |
| 297 | 305 | |
| @@ -324,7 +332,10 @@ struct x86_emulate_ctxt { · 26 unmodified lines | ||
| 324 | 332 | struct operand src; |
| 325 | 333 | struct operand src2; |
| 326 | 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 | 339 | int (*check_perm)(struct x86_emulate_ctxt *ctxt); |
| 329 | 340 | /* |
| 330 | 341 | * The following six fields are cleared together, |
| @@ -781,9 +781,19 @@ struct kvm_vcpu_arch { · 780 unmodified lines | ||
| 781 | 781 | u64 msr_kvm_poll_control; |
| 782 | 782 | |
| 783 | 783 | /* |
| 784 | − * Indicate whether the access faults on its page table in guest | |
| 785 | − * which is set when fix page fault and used to detect unhandeable | |
| 786 | − * instruction. | |
| 784 | + * Indicates the guest is trying to write a gfn that contains one or | |
| 785 | + * more of the PTEs used to translate the write itself, i.e. the access | |
| 786 | + * is changing its own translation in the guest page tables. KVM exits | |
| 787 | + * to userspace if emulation of the faulting instruction fails and this | |
| 788 | + * flag is set, as KVM cannot make forward progress. | |
| 789 | + * | |
| 790 | + * If emulation fails for a write to guest page tables, KVM unprotects | |
| 791 | + * (zaps) the shadow page for the target gfn and resumes the guest to | |
| 792 | + * retry the non-emulatable instruction (on hardware). Unprotecting the | |
| 793 | + * gfn doesn't allow forward progress for a self-changing access because | |
| 794 | + * doing so also zaps the translation for the gfn, i.e. retrying the | |
| 795 | + * instruction will hit a !PRESENT fault, which results in a new shadow | |
| 796 | + * page and sends KVM back to square one. | |
| 787 | 797 | */ |
| 788 | 798 | bool write_fault_to_shadow_pgtable; |
| 789 | 799 | |
| @@ -1112,6 +1122,7 @@ struct kvm_x86_ops { · 322 unmodified lines | ||
| 1112 | 1122 | int (*handle_exit)(struct kvm_vcpu *vcpu, |
| 1113 | 1123 | enum exit_fastpath_completion exit_fastpath); |
| 1114 | 1124 | int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu); |
| 1125 | + void (*update_emulated_instruction)(struct kvm_vcpu *vcpu); | |
| 1115 | 1126 | void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask); |
| 1116 | 1127 | u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu); |
| 1117 | 1128 | void (*patch_hypercall)(struct kvm_vcpu *vcpu, |
| @@ -1136,7 +1147,7 @@ struct kvm_x86_ops { · 18 unmodified lines | ||
| 1136 | 1147 | void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap); |
| 1137 | 1148 | void (*set_virtual_apic_mode)(struct kvm_vcpu *vcpu); |
| 1138 | 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 | 1151 | int (*sync_pir_to_irr)(struct kvm_vcpu *vcpu); |
| 1141 | 1152 | int (*set_tss_addr)(struct kvm *kvm, unsigned int addr); |
| 1142 | 1153 | int (*set_identity_map_addr)(struct kvm *kvm, u64 ident_addr); |
| @@ -512,6 +512,8 @@ · 511 unmodified lines | ||
| 512 | 512 | #define MSR_K7_HWCR 0xc0010015 |
| 513 | 513 | #define MSR_K7_HWCR_SMMLOCK_BIT 0 |
| 514 | 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 | 517 | #define MSR_K7_FID_VID_CTL 0xc0010041 |
| 516 | 518 | #define MSR_K7_FID_VID_STATUS 0xc0010042 |
| 517 | 519 | |
| @@ -295,6 +295,13 @@ static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) · 294 unmodified lines | ||
| 295 | 295 | PVOP_VCALL3(cpu.write_idt_entry, dt, entry, g); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | +#ifdef CONFIG_X86_IOPL_IOPERM | |
| 299 | +static inline void tss_update_io_bitmap(void) | |
| 300 | +{ | |
| 301 | + PVOP_VCALL0(cpu.update_io_bitmap); | |
| 302 | +} | |
| 303 | +#endif | |
| 304 | + | |
| 298 | 305 | static inline void paravirt_activate_mm(struct mm_struct *prev, |
| 299 | 306 | struct mm_struct *next) |
| 300 | 307 | { |
| @@ -140,6 +140,10 @@ struct pv_cpu_ops { · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 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 | 147 | void (*wbinvd)(void); |
| 144 | 148 | |
| 145 | 149 | /* cpuid emulation, mostly so that caps bits can be disabled */ |
| @@ -72,7 +72,7 @@ · 71 unmodified lines | ||
| 72 | 72 | #define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC) |
| 73 | 73 | #define SECONDARY_EXEC_PT_USE_GPA VMCS_CONTROL_BIT(PT_USE_GPA) |
| 74 | 74 | #define SECONDARY_EXEC_TSC_SCALING VMCS_CONTROL_BIT(TSC_SCALING) |
| 75 | −#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE 0x04000000 | |
| 75 | +#define SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE VMCS_CONTROL_BIT(USR_WAIT_PAUSE) | |
| 76 | 76 | |
| 77 | 77 | #define PIN_BASED_EXT_INTR_MASK VMCS_CONTROL_BIT(INTR_EXITING) |
| 78 | 78 | #define PIN_BASED_NMI_EXITING VMCS_CONTROL_BIT(NMI_EXITING) |
| @@ -81,6 +81,7 @@ · 80 unmodified lines | ||
| 81 | 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 | 82 | #define VMX_FEATURE_PT_USE_GPA ( 2*32+ 24) /* "" Processor Trace logs GPAs */ |
| 83 | 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 | 85 | #define VMX_FEATURE_ENCLV_EXITING ( 2*32+ 28) /* "" VM-Exit on ENCLV (leaf dependent) */ |
| 85 | 86 | |
| 86 | 87 | #endif /* _ASM_X86_VMXFEATURES_H */ |
| @@ -390,6 +390,7 @@ struct kvm_sync_regs { · 389 unmodified lines | ||
| 390 | 390 | #define KVM_STATE_NESTED_GUEST_MODE 0x00000001 |
| 391 | 391 | #define KVM_STATE_NESTED_RUN_PENDING 0x00000002 |
| 392 | 392 | #define KVM_STATE_NESTED_EVMCS 0x00000004 |
| 393 | +#define KVM_STATE_NESTED_MTF_PENDING 0x00000008 | |
| 393 | 394 | |
| 394 | 395 | #define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001 |
| 395 | 396 | #define KVM_STATE_NESTED_SMM_VMXON 0x00000002 |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | static const int amd_erratum_383[]; |
| 30 | 30 | static const int amd_erratum_400[]; |
| 31 | +static const int amd_erratum_1054[]; | |
| 31 | 32 | static 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 | 973 | /* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */ |
| 973 | 974 | if (!cpu_has(c, X86_FEATURE_XENPV)) |
| 974 | 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 | 987 | #ifdef CONFIG_X86_32 |
| @@ -1099,6 +1109,10 @@ static const int amd_erratum_400[] = · 121 unmodified lines | ||
| 1099 | 1109 | static const int amd_erratum_383[] = |
| 1100 | 1110 | AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf)); |
| 1101 | 1111 | |
| 1112 | +/* #1054: Instructions Retired Performance Counter May Be Inaccurate */ | |
| 1113 | +static const int amd_erratum_1054[] = | |
| 1114 | + AMD_OSVW_ERRATUM(0, AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf)); | |
| 1115 | + | |
| 1102 | 1116 | |
| 1103 | 1117 | static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) |
| 1104 | 1118 | { |
| @@ -445,7 +445,7 @@ static __always_inline void setup_pku(struct cpuinfo_x86 *c) · 444 unmodified lines | ||
| 445 | 445 | * cpuid bit to be set. We need to ensure that we |
| 446 | 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 | 451 | #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS |
| @@ -1163,9 +1163,12 @@ static const struct sysfs_ops threshold_ops = { · 1162 unmodified lines | ||
| 1163 | 1163 | .store = store, |
| 1164 | 1164 | }; |
| 1165 | 1165 | |
| 1166 | +static void threshold_block_release(struct kobject *kobj); | |
| 1167 | + | |
| 1166 | 1168 | static struct kobj_type threshold_ktype = { |
| 1167 | 1169 | .sysfs_ops = &threshold_ops, |
| 1168 | 1170 | .default_attrs = default_attrs, |
| 1171 | + .release = threshold_block_release, | |
| 1169 | 1172 | }; |
| 1170 | 1173 | |
| 1171 | 1174 | static const char *get_name(unsigned int bank, struct threshold_block *b) |
| @@ -1198,8 +1201,9 @@ static const char *get_name(unsigned int bank, struct threshold_block *b) · 26 unmodified lines | ||
| 1198 | 1201 | return buf_mcatype; |
| 1199 | 1202 | } |
| 1200 | 1203 | |
| 1201 | −static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, | |
| 1202 | − unsigned int block, u32 address) | |
| 1204 | +static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb, | |
| 1205 | + unsigned int bank, unsigned int block, | |
| 1206 | + u32 address) | |
| 1203 | 1207 | { |
| 1204 | 1208 | struct threshold_block *b = NULL; |
| 1205 | 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 | 1248 | INIT_LIST_HEAD(&b->miscj); |
| 1245 | 1249 | |
| 1246 | − if (per_cpu(threshold_banks, cpu)[bank]->blocks) { | |
| 1247 | − list_add(&b->miscj, | |
| 1248 | − &per_cpu(threshold_banks, cpu)[bank]->blocks->miscj); | |
| 1249 | − } else { | |
| 1250 | − per_cpu(threshold_banks, cpu)[bank]->blocks = b; | |
| 1251 | − } | |
| 1250 | + if (tb->blocks) | |
| 1251 | + list_add(&b->miscj, &tb->blocks->miscj); | |
| 1252 | + else | |
| 1253 | + tb->blocks = b; | |
| 1252 | 1254 | |
| 1253 | − err = kobject_init_and_add(&b->kobj, &threshold_ktype, | |
| 1254 | − per_cpu(threshold_banks, cpu)[bank]->kobj, | |
| 1255 | − get_name(bank, b)); | |
| 1255 | + err = kobject_init_and_add(&b->kobj, &threshold_ktype, tb->kobj, get_name(bank, b)); | |
| 1256 | 1256 | if (err) |
| 1257 | 1257 | goto out_free; |
| 1258 | 1258 | recurse: |
| @@ -1260,7 +1260,7 @@ recurse: · 1 unmodified line | ||
| 1260 | 1260 | if (!address) |
| 1261 | 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 | 1264 | if (err) |
| 1265 | 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 | 1345 | goto out_free; |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | − per_cpu(threshold_banks, cpu)[bank] = b; | |
| 1349 | − | |
| 1350 | 1348 | if (is_shared_bank(bank)) { |
| 1351 | 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)); | |
| 1361 | − if (!err) | |
| 1362 | − goto out; | |
| 1358 | + err = allocate_threshold_blocks(cpu, b, bank, 0, msr_ops.misc(bank)); | |
| 1359 | + if (err) | |
| 1360 | + goto out_free; | |
| 1361 | + | |
| 1362 | + per_cpu(threshold_banks, cpu)[bank] = b; | |
| 1363 | + | |
| 1364 | + return 0; | |
| 1363 | 1365 | |
| 1364 | 1366 | out_free: |
| 1365 | 1367 | kfree(b); |
| @@ -1368,8 +1370,12 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank) · 2 unmodified lines | ||
| 1368 | 1370 | return err; |
| 1369 | 1371 | } |
| 1370 | 1372 | |
| 1371 | −static void deallocate_threshold_block(unsigned int cpu, | |
| 1372 | − unsigned int bank) | |
| 1373 | +static void threshold_block_release(struct kobject *kobj) | |
| 1374 | +{ | |
| 1375 | + kfree(to_block(kobj)); | |
| 1376 | +} | |
| 1377 | + | |
| 1378 | +static void deallocate_threshold_block(unsigned int cpu, unsigned int bank) | |
| 1373 | 1379 | { |
| 1374 | 1380 | struct threshold_block *pos = NULL; |
| 1375 | 1381 | struct threshold_block *tmp = NULL; |
| @@ -1379,13 +1385,11 @@ static void deallocate_threshold_block(unsigned int cpu, · 3 unmodified lines | ||
| 1379 | 1385 | return; |
| 1380 | 1386 | |
| 1381 | 1387 | list_for_each_entry_safe(pos, tmp, &head->blocks->miscj, miscj) { |
| 1382 | − kobject_put(&pos->kobj); | |
| 1383 | 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); | |
| 1388 | − per_cpu(threshold_banks, cpu)[bank]->blocks = NULL; | |
| 1392 | + kobject_put(&head->blocks->kobj); | |
| 1389 | 1393 | } |
| 1390 | 1394 | |
| 1391 | 1395 | static void __threshold_remove_blocks(struct threshold_bank *b) |
| @@ -10,8 +10,6 @@ extern struct boot_params boot_params; · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | static 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 | 13 | efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID; |
| 16 | 14 | efi_status_t status; |
| 17 | 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 | 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 | 27 | NULL, &size, &secboot); |
| 30 | 28 | if (status == EFI_NOT_FOUND) { |
| 31 | 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 | 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 | 40 | NULL, &size, &setupmode); |
| 43 | 41 | |
| 44 | 42 | if (status != EFI_SUCCESS) /* ignore unknown SetupMode */ |
| @@ -425,7 +425,29 @@ static void __init sev_map_percpu_data(void) · 424 unmodified lines | ||
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | +static bool pv_tlb_flush_supported(void) | |
| 429 | +{ | |
| 430 | + return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) && | |
| 431 | + !kvm_para_has_hint(KVM_HINTS_REALTIME) && | |
| 432 | + kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)); | |
| 433 | +} | |
| 434 | + | |
| 435 | +static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask); | |
| 436 | + | |
| 428 | 437 | #ifdef CONFIG_SMP |
| 438 | + | |
| 439 | +static bool pv_ipi_supported(void) | |
| 440 | +{ | |
| 441 | + return kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI); | |
| 442 | +} | |
| 443 | + | |
| 444 | +static bool pv_sched_yield_supported(void) | |
| 445 | +{ | |
| 446 | + return (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) && | |
| 447 | + !kvm_para_has_hint(KVM_HINTS_REALTIME) && | |
| 448 | + kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)); | |
| 449 | +} | |
| 450 | + | |
| 429 | 451 | #define KVM_IPI_CLUSTER_SIZE (2 * BITS_PER_LONG) |
| 430 | 452 | |
| 431 | 453 | static void __send_ipi_mask(const struct cpumask *mask, int vector) |
| @@ -490,12 +512,12 @@ static void kvm_send_ipi_mask(const struct cpumask *mask, int vector) · 58 unmodified lines | ||
| 490 | 512 | static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector) |
| 491 | 513 | { |
| 492 | 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 | 516 | const struct cpumask *local_mask; |
| 495 | 517 | |
| 496 | − cpumask_copy(&new_mask, mask); | |
| 497 | − cpumask_clear_cpu(this_cpu, &new_mask); | |
| 498 | − local_mask = &new_mask; | |
| 518 | + cpumask_copy(new_mask, mask); | |
| 519 | + cpumask_clear_cpu(this_cpu, new_mask); | |
| 520 | + local_mask = new_mask; | |
| 499 | 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 | 597 | update_intr_gate(X86_TRAP_PF, async_page_fault); |
| 576 | 598 | } |
| 577 | 599 | |
| 578 | −static DEFINE_PER_CPU(cpumask_var_t, __pv_tlb_mask); | |
| 579 | 600 | |
| 580 | 601 | static void kvm_flush_tlb_others(const struct cpumask *cpumask, |
| 581 | 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 | 604 | u8 state; |
| 584 | 605 | int cpu; |
| 585 | 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 | 609 | cpumask_copy(flushmask, cpumask); |
| 589 | 610 | /* |
| @@ -619,11 +640,10 @@ static void __init kvm_guest_init(void) · 29 unmodified lines | ||
| 619 | 640 | pv_ops.time.steal_clock = kvm_steal_clock; |
| 620 | 641 | } |
| 621 | 642 | |
| 622 | − if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) && | |
| 623 | − !kvm_para_has_hint(KVM_HINTS_REALTIME) && | |
| 624 | − kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) { | |
| 643 | + if (pv_tlb_flush_supported()) { | |
| 625 | 644 | pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others; |
| 626 | 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 | 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 | 652 | #ifdef CONFIG_SMP |
| 633 | 653 | smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus; |
| 634 | 654 | smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu; |
| 635 | − if (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) && | |
| 636 | − !kvm_para_has_hint(KVM_HINTS_REALTIME) && | |
| 637 | − kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) { | |
| 655 | + if (pv_sched_yield_supported()) { | |
| 638 | 656 | smp_ops.send_call_func_ipi = kvm_smp_send_call_func_ipi; |
| 639 | 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 | ||
| 700 | 718 | static void __init kvm_apic_init(void) |
| 701 | 719 | { |
| 702 | 720 | #if defined(CONFIG_SMP) |
| 703 | − if (kvm_para_has_feature(KVM_FEATURE_PV_SEND_IPI)) | |
| 721 | + if (pv_ipi_supported()) | |
| 704 | 722 | kvm_setup_pv_ipi(); |
| 705 | 723 | #endif |
| 706 | 724 | } |
| @@ -732,26 +750,31 @@ static __init int activate_jump_labels(void) · 25 unmodified lines | ||
| 732 | 750 | } |
| 733 | 751 | arch_initcall(activate_jump_labels); |
| 734 | 752 | |
| 735 | −static __init int kvm_setup_pv_tlb_flush(void) | |
| 753 | +static __init int kvm_alloc_cpumask(void) | |
| 736 | 754 | { |
| 737 | 755 | int cpu; |
| 756 | + bool alloc = false; | |
| 738 | 757 | |
| 739 | 758 | if (!kvm_para_available() || nopv) |
| 740 | 759 | return 0; |
| 741 | 760 | |
| 742 | − if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) && | |
| 743 | − !kvm_para_has_hint(KVM_HINTS_REALTIME) && | |
| 744 | − kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) { | |
| 761 | + if (pv_tlb_flush_supported()) | |
| 762 | + alloc = true; | |
| 763 | + | |
| 764 | +#if defined(CONFIG_SMP) | |
| 765 | + if (pv_ipi_supported()) | |
| 766 | + alloc = true; | |
| 767 | +#endif | |
| 768 | + | |
| 769 | + if (alloc) | |
| 745 | 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 | 772 | GFP_KERNEL, cpu_to_node(cpu)); |
| 748 | 773 | } |
| 749 | − pr_info("KVM setup pv remote TLB flush\n"); | |
| 750 | − } | |
| 751 | 774 | |
| 752 | 775 | return 0; |
| 753 | 776 | } |
| 754 | −arch_initcall(kvm_setup_pv_tlb_flush); | |
| 777 | +arch_initcall(kvm_alloc_cpumask); | |
| 755 | 778 | |
| 756 | 779 | #ifdef CONFIG_PARAVIRT_SPINLOCKS |
| 757 | 780 | |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <asm/timer.h> |
| 31 | 31 | #include <asm/special_insns.h> |
| 32 | 32 | #include <asm/tlb.h> |
| 33 | +#include <asm/io_bitmap.h> | |
| 33 | 34 | |
| 34 | 35 | /* |
| 35 | 36 | * 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 | 342 | .cpu.iret = native_iret, |
| 342 | 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 | 349 | .cpu.start_context_switch = paravirt_nop, |
| 345 | 350 | .cpu.end_context_switch = paravirt_nop, |
| 346 | 351 | |
| @@ -374,7 +374,7 @@ static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm) · 373 unmodified lines | ||
| 374 | 374 | /** |
| 375 | 375 | * tss_update_io_bitmap - Update I/O bitmap before exiting to usermode |
| 376 | 376 | */ |
| 377 | −void tss_update_io_bitmap(void) | |
| 377 | +void native_tss_update_io_bitmap(void) | |
| 378 | 378 | { |
| 379 | 379 | struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw); |
| 380 | 380 | struct thread_struct *t = ¤t->thread; |
| @@ -59,6 +59,19 @@ config KVM · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | If unsure, say N. |
| 61 | 61 | |
| 62 | +config KVM_WERROR | |
| 63 | + bool "Compile KVM with -Werror" | |
| 64 | + # KASAN may cause the build to fail due to larger frames | |
| 65 | + default y if X86_64 && !KASAN | |
| 66 | + # We use the dependency on !COMPILE_TEST to not be enabled | |
| 67 | + # blindly in allmodconfig or allyesconfig configurations | |
| 68 | + depends on (X86_64 && !KASAN) || !COMPILE_TEST | |
| 69 | + depends on EXPERT | |
| 70 | + help | |
| 71 | + Add -Werror to the build flags for (and only for) i915.ko. | |
| 72 | + | |
| 73 | + If in doubt, say "N". | |
| 74 | + | |
| 62 | 75 | config KVM_INTEL |
| 63 | 76 | tristate "KVM for Intel (and compatible) processors support" |
| 64 | 77 | depends on KVM && IA32_FEAT_CTL |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | |
| 3 | 3 | ccflags-y += -Iarch/x86/kvm |
| 4 | +ccflags-$(CONFIG_KVM_WERROR) += -Werror | |
| 4 | 5 | |
| 5 | 6 | KVM := ../../../virt/kvm |
| 6 | 7 | |
| @@ -191,25 +191,6 @@ · 190 unmodified lines | ||
| 191 | 191 | #define NR_FASTOP (ilog2(sizeof(ulong)) + 1) |
| 192 | 192 | #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 | − | |
| 211 | −struct fastop; | |
| 212 | − | |
| 213 | 194 | struct opcode { |
| 214 | 195 | u64 flags : 56; |
| 215 | 196 | u64 intercept : 8; |
| @@ -311,8 +292,19 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) · 95 unmodified lines | ||
| 311 | 292 | #define ON64(x) |
| 312 | 293 | #endif |
| 313 | 294 | |
| 314 | −typedef void (*fastop_t)(struct fastop *); | |
| 315 | − | |
| 295 | +/* | |
| 296 | + * fastop functions have a special calling convention: | |
| 297 | + * | |
| 298 | + * dst: rax (in/out) | |
| 299 | + * src: rdx (in/out) | |
| 300 | + * src2: rcx (in) | |
| 301 | + * flags: rflags (in/out) | |
| 302 | + * ex: rsi (in:fastop pointer, out:zero if exception) | |
| 303 | + * | |
| 304 | + * Moreover, they are all exactly FASTOP_SIZE bytes long, so functions for | |
| 305 | + * different operand sizes can be reached by calculation, rather than a jump | |
| 306 | + * table (which would be bigger than the code). | |
| 307 | + */ | |
| 316 | 308 | static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop); |
| 317 | 309 | |
| 318 | 310 | #define __FOP_FUNC(name) \ |
| @@ -5683,7 +5675,7 @@ special_insn: · 5364 unmodified lines | ||
| 5683 | 5675 | |
| 5684 | 5676 | if (ctxt->execute) { |
| 5685 | 5677 | if (ctxt->d & Fastop) |
| 5686 | − rc = fastop(ctxt, (fastop_t)ctxt->execute); | |
| 5678 | + rc = fastop(ctxt, ctxt->fop); | |
| 5687 | 5679 | else |
| 5688 | 5680 | rc = ctxt->execute(ctxt); |
| 5689 | 5681 | if (rc != X86EMUL_CONTINUE) |
| @@ -417,7 +417,7 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, · 416 unmodified lines | ||
| 417 | 417 | |
| 418 | 418 | kvm_set_msi_irq(vcpu->kvm, entry, &irq); |
| 419 | 419 | |
| 420 | − if (irq.level && | |
| 420 | + if (irq.trig_mode && | |
| 421 | 421 | kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT, |
| 422 | 422 | irq.dest_id, irq.dest_mode)) |
| 423 | 423 | __set_bit(irq.vector, ioapic_handled_vectors); |
| @@ -627,9 +627,11 @@ static inline bool pv_eoi_enabled(struct kvm_vcpu *vcpu) · 626 unmodified lines | ||
| 627 | 627 | static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu) |
| 628 | 628 | { |
| 629 | 629 | u8 val; |
| 630 | − if (pv_eoi_get_user(vcpu, &val) < 0) | |
| 630 | + if (pv_eoi_get_user(vcpu, &val) < 0) { | |
| 631 | 631 | printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n", |
| 632 | 632 | (unsigned long long)vcpu->arch.pv_eoi.msr_val); |
| 633 | + return false; | |
| 634 | + } | |
| 633 | 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 | 1048 | apic->regs + APIC_TMR); |
| 1047 | 1049 | } |
| 1048 | 1050 | |
| 1049 | − if (vcpu->arch.apicv_active) | |
| 1050 | − kvm_x86_ops->deliver_posted_interrupt(vcpu, vector); | |
| 1051 | − else { | |
| 1051 | + if (kvm_x86_ops->deliver_posted_interrupt(vcpu, vector)) { | |
| 1052 | 1052 | kvm_lapic_set_irr(vector, apic); |
| 1053 | − | |
| 1054 | 1053 | kvm_make_request(KVM_REQ_EVENT, vcpu); |
| 1055 | 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 | 1079 | result = 1; |
| 1081 | 1080 | /* assumes that there are only KVM_APIC_INIT/SIPI */ |
| 1082 | 1081 | apic->pending_events = (1UL << KVM_APIC_INIT); |
| 1083 | − /* make sure pending_events is visible before sending | |
| 1084 | − * the request */ | |
| 1085 | − smp_wmb(); | |
| 1086 | 1082 | kvm_make_request(KVM_REQ_EVENT, vcpu); |
| 1087 | 1083 | kvm_vcpu_kick(vcpu); |
| 1088 | 1084 | } |
| @@ -102,6 +102,19 @@ static inline void kvm_mmu_load_cr3(struct kvm_vcpu *vcpu) · 101 unmodified lines | ||
| 102 | 102 | kvm_get_active_pcid(vcpu)); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | +int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, | |
| 106 | + bool prefault); | |
| 107 | + | |
| 108 | +static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, | |
| 109 | + u32 err, bool prefault) | |
| 110 | +{ | |
| 111 | +#ifdef CONFIG_RETPOLINE | |
| 112 | + if (likely(vcpu->arch.mmu->page_fault == kvm_tdp_page_fault)) | |
| 113 | + return kvm_tdp_page_fault(vcpu, cr2_or_gpa, err, prefault); | |
| 114 | +#endif | |
| 115 | + return vcpu->arch.mmu->page_fault(vcpu, cr2_or_gpa, err, prefault); | |
| 116 | +} | |
| 117 | + | |
| 105 | 118 | /* |
| 106 | 119 | * Currently, we have two sorts of write-protection, a) the first one |
| 107 | 120 | * write-protects guest page to sync the guest modification, b) another one is |
| @@ -4219,8 +4219,8 @@ int kvm_handle_page_fault(struct kvm_vcpu *vcpu, u64 error_code, · 4218 unmodified lines | ||
| 4219 | 4219 | } |
| 4220 | 4220 | EXPORT_SYMBOL_GPL(kvm_handle_page_fault); |
| 4221 | 4221 | |
| 4222 | −static int tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, | |
| 4223 | − bool prefault) | |
| 4222 | +int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, | |
| 4223 | + bool prefault) | |
| 4224 | 4224 | { |
| 4225 | 4225 | int max_level; |
| 4226 | 4226 | |
| @@ -4925,7 +4925,7 @@ static void init_kvm_tdp_mmu(struct kvm_vcpu *vcpu) · 698 unmodified lines | ||
| 4925 | 4925 | return; |
| 4926 | 4926 | |
| 4927 | 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 | 4929 | context->sync_page = nonpaging_sync_page; |
| 4930 | 4930 | context->invlpg = nonpaging_invlpg; |
| 4931 | 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 | 5438 | if (r == RET_PF_INVALID) { |
| 5439 | − r = vcpu->arch.mmu->page_fault(vcpu, cr2_or_gpa, | |
| 5440 | − lower_32_bits(error_code), | |
| 5441 | − false); | |
| 5439 | + r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa, | |
| 5440 | + lower_32_bits(error_code), false); | |
| 5442 | 5441 | WARN_ON(r == RET_PF_INVALID); |
| 5443 | 5442 | } |
| 5444 | 5443 | |
| @@ -33,7 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT |
| 34 | 34 | #define PT_HAVE_ACCESSED_DIRTY(mmu) true |
| 35 | 35 | #ifdef CONFIG_X86_64 |
| 36 | − #define PT_MAX_FULL_LEVELS 4 | |
| 36 | + #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL | |
| 37 | 37 | #define CMPXCHG cmpxchg |
| 38 | 38 | #else |
| 39 | 39 | #define CMPXCHG cmpxchg64 |
| @@ -339,7 +339,7 @@ TRACE_EVENT( · 338 unmodified lines | ||
| 339 | 339 | /* These depend on page entry type, so compute them now. */ |
| 340 | 340 | __field(bool, r) |
| 341 | 341 | __field(bool, x) |
| 342 | − __field(u8, u) | |
| 342 | + __field(signed char, u) | |
| 343 | 343 | ), |
| 344 | 344 | |
| 345 | 345 | TP_fast_assign( |
| @@ -57,11 +57,13 @@ · 56 unmodified lines | ||
| 57 | 57 | MODULE_AUTHOR("Qumranet"); |
| 58 | 58 | MODULE_LICENSE("GPL"); |
| 59 | 59 | |
| 60 | +#ifdef MODULE | |
| 60 | 61 | static const struct x86_cpu_id svm_cpu_id[] = { |
| 61 | 62 | X86_FEATURE_MATCH(X86_FEATURE_SVM), |
| 62 | 63 | {} |
| 63 | 64 | }; |
| 64 | 65 | MODULE_DEVICE_TABLE(x86cpu, svm_cpu_id); |
| 66 | +#endif | |
| 65 | 67 | |
| 66 | 68 | #define IOPM_ALLOC_ORDER 2 |
| 67 | 69 | #define MSRPM_ALLOC_ORDER 1 |
| @@ -1005,33 +1007,32 @@ static void svm_cpu_uninit(int cpu) · 937 unmodified lines | ||
| 1005 | 1007 | static int svm_cpu_init(int cpu) |
| 1006 | 1008 | { |
| 1007 | 1009 | struct svm_cpu_data *sd; |
| 1008 | − int r; | |
| 1009 | 1010 | |
| 1010 | 1011 | sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL); |
| 1011 | 1012 | if (!sd) |
| 1012 | 1013 | return -ENOMEM; |
| 1013 | 1014 | sd->cpu = cpu; |
| 1014 | − r = -ENOMEM; | |
| 1015 | 1015 | sd->save_area = alloc_page(GFP_KERNEL); |
| 1016 | 1016 | if (!sd->save_area) |
| 1017 | − goto err_1; | |
| 1017 | + goto free_cpu_data; | |
| 1018 | 1018 | |
| 1019 | 1019 | if (svm_sev_enabled()) { |
| 1020 | − r = -ENOMEM; | |
| 1021 | 1020 | sd->sev_vmcbs = kmalloc_array(max_sev_asid + 1, |
| 1022 | 1021 | sizeof(void *), |
| 1023 | 1022 | GFP_KERNEL); |
| 1024 | 1023 | if (!sd->sev_vmcbs) |
| 1025 | − goto err_1; | |
| 1024 | + goto free_save_area; | |
| 1026 | 1025 | } |
| 1027 | 1026 | |
| 1028 | 1027 | per_cpu(svm_data, cpu) = sd; |
| 1029 | 1028 | |
| 1030 | 1029 | return 0; |
| 1031 | 1030 | |
| 1032 | −err_1: | |
| 1031 | +free_save_area: | |
| 1032 | + __free_page(sd->save_area); | |
| 1033 | +free_cpu_data: | |
| 1033 | 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 | 1351 | kvm_mmu_set_mmio_spte_mask(mask, mask, PT_WRITABLE_MASK | PT_USER_MASK); |
| 1351 | 1352 | } |
| 1352 | 1353 | |
| 1354 | +static void svm_hardware_teardown(void) | |
| 1355 | +{ | |
| 1356 | + int cpu; | |
| 1357 | + | |
| 1358 | + if (svm_sev_enabled()) { | |
| 1359 | + bitmap_free(sev_asid_bitmap); | |
| 1360 | + bitmap_free(sev_reclaim_asid_bitmap); | |
| 1361 | + | |
| 1362 | + sev_flush_asids(); | |
| 1363 | + } | |
| 1364 | + | |
| 1365 | + for_each_possible_cpu(cpu) | |
| 1366 | + svm_cpu_uninit(cpu); | |
| 1367 | + | |
| 1368 | + __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER); | |
| 1369 | + iopm_base = 0; | |
| 1370 | +} | |
| 1371 | + | |
| 1353 | 1372 | static __init int svm_hardware_setup(void) |
| 1354 | 1373 | { |
| 1355 | 1374 | int cpu; |
| @@ -1463,29 +1482,10 @@ static __init int svm_hardware_setup(void) · 107 unmodified lines | ||
| 1463 | 1482 | return 0; |
| 1464 | 1483 | |
| 1465 | 1484 | err: |
| 1466 | − __free_pages(iopm_pages, IOPM_ALLOC_ORDER); | |
| 1467 | − iopm_base = 0; | |
| 1485 | + svm_hardware_teardown(); | |
| 1468 | 1486 | return r; |
| 1469 | 1487 | } |
| 1470 | 1488 | |
| 1471 | −static __exit void svm_hardware_unsetup(void) | |
| 1472 | −{ | |
| 1473 | − int cpu; | |
| 1474 | − | |
| 1475 | − if (svm_sev_enabled()) { | |
| 1476 | − bitmap_free(sev_asid_bitmap); | |
| 1477 | − bitmap_free(sev_reclaim_asid_bitmap); | |
| 1478 | − | |
| 1479 | − sev_flush_asids(); | |
| 1480 | − } | |
| 1481 | − | |
| 1482 | − for_each_possible_cpu(cpu) | |
| 1483 | − svm_cpu_uninit(cpu); | |
| 1484 | − | |
| 1485 | − __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER); | |
| 1486 | − iopm_base = 0; | |
| 1487 | −} | |
| 1488 | − | |
| 1489 | 1489 | static void init_seg(struct vmcb_seg *seg) |
| 1490 | 1490 | { |
| 1491 | 1491 | seg->selector = 0; |
| @@ -2175,7 +2175,6 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 683 unmodified lines | ||
| 2175 | 2175 | u32 dummy; |
| 2176 | 2176 | u32 eax = 1; |
| 2177 | 2177 | |
| 2178 | − vcpu->arch.microcode_version = 0x01000065; | |
| 2179 | 2178 | svm->spec_ctrl = 0; |
| 2180 | 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 | ||
| 2197 | 2196 | static int avic_init_vcpu(struct vcpu_svm *svm) |
| 2198 | 2197 | { |
| 2199 | 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 | 2202 | return 0; |
| 2203 | 2203 | |
| 2204 | 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 | 2266 | init_vmcb(svm); |
| 2267 | 2267 | |
| 2268 | 2268 | svm_init_osvw(vcpu); |
| 2269 | + vcpu->arch.microcode_version = 0x01000065; | |
| 2269 | 2270 | |
| 2270 | 2271 | return 0; |
| 2271 | 2272 | |
| @@ -5232,6 +5233,9 @@ static void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) · 2960 unmodified lines | ||
| 5232 | 5233 | struct vmcb *vmcb = svm->vmcb; |
| 5233 | 5234 | bool activated = kvm_vcpu_apicv_active(vcpu); |
| 5234 | 5235 | |
| 5236 | + if (!avic) | |
| 5237 | + return; | |
| 5238 | + | |
| 5235 | 5239 | if (activated) { |
| 5236 | 5240 | /** |
| 5237 | 5241 | * 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 | 5259 | return; |
| 5256 | 5260 | } |
| 5257 | 5261 | |
| 5258 | −static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) | |
| 5262 | +static int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) | |
| 5259 | 5263 | { |
| 5264 | + if (!vcpu->arch.apicv_active) | |
| 5265 | + return -1; | |
| 5266 | + | |
| 5260 | 5267 | kvm_lapic_set_irr(vec, vcpu->arch.apic); |
| 5261 | 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 | 5275 | put_cpu(); |
| 5269 | 5276 | } else |
| 5270 | 5277 | kvm_vcpu_wake_up(vcpu); |
| 5278 | + | |
| 5279 | + return 0; | |
| 5271 | 5280 | } |
| 5272 | 5281 | |
| 5273 | 5282 | static bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu) |
| @@ -7378,7 +7387,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 2104 unmodified lines | ||
| 7378 | 7387 | .cpu_has_kvm_support = has_svm, |
| 7379 | 7388 | .disabled_by_bios = is_disabled, |
| 7380 | 7389 | .hardware_setup = svm_hardware_setup, |
| 7381 | − .hardware_unsetup = svm_hardware_unsetup, | |
| 7390 | + .hardware_unsetup = svm_hardware_teardown, | |
| 7382 | 7391 | .check_processor_compatibility = svm_check_processor_compat, |
| 7383 | 7392 | .hardware_enable = svm_hardware_enable, |
| 7384 | 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 | 7442 | .run = svm_vcpu_run, |
| 7434 | 7443 | .handle_exit = handle_exit, |
| 7435 | 7444 | .skip_emulated_instruction = skip_emulated_instruction, |
| 7445 | + .update_emulated_instruction = NULL, | |
| 7436 | 7446 | .set_interrupt_shadow = svm_set_interrupt_shadow, |
| 7437 | 7447 | .get_interrupt_shadow = svm_get_interrupt_shadow, |
| 7438 | 7448 | .patch_hypercall = svm_patch_hypercall, |
| @@ -12,6 +12,7 @@ extern bool __read_mostly enable_ept; · 11 unmodified lines | ||
| 12 | 12 | extern bool __read_mostly enable_unrestricted_guest; |
| 13 | 13 | extern bool __read_mostly enable_ept_ad_bits; |
| 14 | 14 | extern bool __read_mostly enable_pml; |
| 15 | +extern bool __read_mostly enable_apicv; | |
| 15 | 16 | extern int __read_mostly pt_mode; |
| 16 | 17 | |
| 17 | 18 | #define PT_MODE_SYSTEM 0 |
| @@ -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 | |
| 547 | −static inline void enable_x2apic_msr_intercepts(unsigned long *msr_bitmap) { | |
| 547 | +static inline void enable_x2apic_msr_intercepts(unsigned long *msr_bitmap) | |
| 548 | +{ | |
| 548 | 549 | int msr; |
| 549 | 550 | |
| 550 | 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 switch | |
| 1985 | + * Clean fields data can't be used on VMLAUNCH and when we switch | |
| 1985 | 1986 | * between different L2 guests as KVM keeps a single VMCS12 per L1. |
| 1986 | 1987 | */ |
| 1987 | 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 | 3161 | * or KVM_SET_NESTED_STATE). Otherwise it's called from vmlaunch/vmresume. |
| 3161 | 3162 | * |
| 3162 | 3163 | * Returns: |
| 3163 | − * NVMX_ENTRY_SUCCESS: Entered VMX non-root mode | |
| 3164 | − * NVMX_ENTRY_VMFAIL: Consistency check VMFail | |
| 3165 | − * NVMX_ENTRY_VMEXIT: Consistency check VMExit | |
| 3166 | − * NVMX_ENTRY_KVM_INTERNAL_ERROR: KVM internal error | |
| 3164 | + * NVMX_VMENTRY_SUCCESS: Entered VMX non-root mode | |
| 3165 | + * NVMX_VMENTRY_VMFAIL: Consistency check VMFail | |
| 3166 | + * NVMX_VMENTRY_VMEXIT: Consistency check VMExit | |
| 3167 | + * NVMX_VMENTRY_KVM_INTERNAL_ERROR: KVM internal error | |
| 3167 | 3168 | */ |
| 3168 | 3169 | enum nvmx_vmentry_status nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu, |
| 3169 | 3170 | bool from_vmentry) |
| @@ -3575,25 +3576,80 @@ static void nested_vmx_inject_exception_vmexit(struct kvm_vcpu *vcpu, · 405 unmodified lines | ||
| 3575 | 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 | + */ | |
| 3585 | +static inline bool vmx_pending_dbg_trap(struct kvm_vcpu *vcpu) | |
| 3586 | +{ | |
| 3587 | + return vcpu->arch.exception.pending && | |
| 3588 | + vcpu->arch.exception.nr == DB_VECTOR && | |
| 3589 | + vcpu->arch.exception.payload; | |
| 3590 | +} | |
| 3591 | + | |
| 3592 | +/* | |
| 3593 | + * Certain VM-exits set the 'pending debug exceptions' field to indicate a | |
| 3594 | + * recognized #DB (data or single-step) that has yet to be delivered. Since KVM | |
| 3595 | + * represents these debug traps with a payload that is said to be compatible | |
| 3596 | + * with the 'pending debug exceptions' field, write the payload to the VMCS | |
| 3597 | + * field if a VM-exit is delivered before the debug trap. | |
| 3598 | + */ | |
| 3599 | +static void nested_vmx_update_pending_dbg(struct kvm_vcpu *vcpu) | |
| 3600 | +{ | |
| 3601 | + if (vmx_pending_dbg_trap(vcpu)) | |
| 3602 | + vmcs_writel(GUEST_PENDING_DBG_EXCEPTIONS, | |
| 3603 | + vcpu->arch.exception.payload); | |
| 3604 | +} | |
| 3605 | + | |
| 3578 | 3606 | static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr) |
| 3579 | 3607 | { |
| 3580 | 3608 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
| 3581 | 3609 | unsigned long exit_qual; |
| 3582 | 3610 | bool block_nested_events = |
| 3583 | 3611 | vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu); |
| 3612 | + bool mtf_pending = vmx->nested.mtf_pending; | |
| 3584 | 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 | 3621 | if (lapic_in_kernel(vcpu) && |
| 3587 | 3622 | test_bit(KVM_APIC_INIT, &apic->pending_events)) { |
| 3588 | 3623 | if (block_nested_events) |
| 3589 | 3624 | return -EBUSY; |
| 3625 | + nested_vmx_update_pending_dbg(vcpu); | |
| 3590 | 3626 | clear_bit(KVM_APIC_INIT, &apic->pending_events); |
| 3591 | 3627 | nested_vmx_vmexit(vcpu, EXIT_REASON_INIT_SIGNAL, 0, 0); |
| 3592 | 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 | 3651 | if (vcpu->arch.exception.pending && |
| 3596 | − nested_vmx_check_exception(vcpu, &exit_qual)) { | |
| 3652 | + nested_vmx_check_exception(vcpu, &exit_qual)) { | |
| 3597 | 3653 | if (block_nested_events) |
| 3598 | 3654 | return -EBUSY; |
| 3599 | 3655 | nested_vmx_inject_exception_vmexit(vcpu, exit_qual); |
| @@ -5256,24 +5312,17 @@ fail: · 1656 unmodified lines | ||
| 5256 | 5312 | return 1; |
| 5257 | 5313 | } |
| 5258 | 5314 | |
| 5259 | − | |
| 5260 | −static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, | |
| 5261 | − struct vmcs12 *vmcs12) | |
| 5315 | +/* | |
| 5316 | + * Return true if an IO instruction with the specified port and size should cause | |
| 5317 | + * a VM-exit into L1. | |
| 5318 | + */ | |
| 5319 | +bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port, | |
| 5320 | + int size) | |
| 5262 | 5321 | { |
| 5263 | − unsigned long exit_qualification; | |
| 5322 | + struct vmcs12 *vmcs12 = get_vmcs12(vcpu); | |
| 5264 | 5323 | gpa_t bitmap, last_bitmap; |
| 5265 | − unsigned int port; | |
| 5266 | − int size; | |
| 5267 | 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 | 5326 | last_bitmap = (gpa_t)-1; |
| 5278 | 5327 | b = -1; |
| 5279 | 5328 | |
| @@ -5300,8 +5349,26 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, · 20 unmodified lines | ||
| 5300 | 5349 | return false; |
| 5301 | 5350 | } |
| 5302 | 5351 | |
| 5352 | +static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, | |
| 5353 | + struct vmcs12 *vmcs12) | |
| 5354 | +{ | |
| 5355 | + unsigned long exit_qualification; | |
| 5356 | + unsigned short port; | |
| 5357 | + int size; | |
| 5358 | + | |
| 5359 | + if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) | |
| 5360 | + return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING); | |
| 5361 | + | |
| 5362 | + exit_qualification = vmcs_readl(EXIT_QUALIFICATION); | |
| 5363 | + | |
| 5364 | + port = exit_qualification >> 16; | |
| 5365 | + size = (exit_qualification & 7) + 1; | |
| 5366 | + | |
| 5367 | + return nested_vmx_check_io_bitmaps(vcpu, port, size); | |
| 5368 | +} | |
| 5369 | + | |
| 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 | 5372 | * rather than handle it ourselves in L0. I.e., check whether L1 expressed |
| 5306 | 5373 | * disinterest in the current event (read or write a specific MSR) by using an |
| 5307 | 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 | 5751 | if (vmx->nested.nested_run_pending) |
| 5685 | 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 | 5933 | vmx->nested.nested_run_pending = |
| 5864 | 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 | 5939 | ret = -EINVAL; |
| 5867 | 5940 | if (nested_cpu_has_shadow_vmcs(vmcs12) && |
| 5868 | 5941 | vmcs12->vmcs_link_pointer != -1ull) { |
| @@ -5920,8 +5993,7 @@ void nested_vmx_set_vmcs_shadowing_bitmap(void) · 51 unmodified lines | ||
| 5920 | 5993 | * bit in the high half is on if the corresponding bit in the control field |
| 5921 | 5994 | * may be on. See also vmx_control_verify(). |
| 5922 | 5995 | */ |
| 5923 | −void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps, | |
| 5924 | − bool apicv) | |
| 5996 | +void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps) | |
| 5925 | 5997 | { |
| 5926 | 5998 | /* |
| 5927 | 5999 | * 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 | 6020 | PIN_BASED_EXT_INTR_MASK | |
| 5949 | 6021 | PIN_BASED_NMI_EXITING | |
| 5950 | 6022 | PIN_BASED_VIRTUAL_NMIS | |
| 5951 | − (apicv ? PIN_BASED_POSTED_INTR : 0); | |
| 6023 | + (enable_apicv ? PIN_BASED_POSTED_INTR : 0); | |
| 5952 | 6024 | msrs->pinbased_ctls_high |= |
| 5953 | 6025 | PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR | |
| 5954 | 6026 | PIN_BASED_VMX_PREEMPTION_TIMER; |
| @@ -17,8 +17,7 @@ enum nvmx_vmentry_status { · 16 unmodified lines | ||
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | void vmx_leave_nested(struct kvm_vcpu *vcpu); |
| 20 | −void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps, | |
| 21 | − bool apicv); | |
| 20 | +void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps); | |
| 22 | 21 | void nested_vmx_hardware_unsetup(void); |
| 23 | 22 | __init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *)); |
| 24 | 23 | void nested_vmx_set_vmcs_shadowing_bitmap(void); |
| @@ -34,6 +33,8 @@ int vmx_get_vmx_msr(struct nested_vmx_msrs *msrs, u32 msr_index, u64 *pdata); · 9 unmodified lines | ||
| 34 | 33 | int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification, |
| 35 | 34 | u32 vmx_instruction_info, bool wr, int len, gva_t *ret); |
| 36 | 35 | void nested_vmx_pmu_entry_exit_ctls_update(struct kvm_vcpu *vcpu); |
| 36 | +bool nested_vmx_check_io_bitmaps(struct kvm_vcpu *vcpu, unsigned int port, | |
| 37 | + int size); | |
| 37 | 38 | |
| 38 | 39 | static 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 | 176 | return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS; |
| 176 | 177 | } |
| 177 | 178 | |
| 179 | +static inline int nested_cpu_has_mtf(struct vmcs12 *vmcs12) | |
| 180 | +{ | |
| 181 | + return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG); | |
| 182 | +} | |
| 183 | + | |
| 178 | 184 | static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12) |
| 179 | 185 | { |
| 180 | 186 | return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT); |
| @@ -64,11 +64,13 @@ · 63 unmodified lines | ||
| 64 | 64 | MODULE_AUTHOR("Qumranet"); |
| 65 | 65 | MODULE_LICENSE("GPL"); |
| 66 | 66 | |
| 67 | +#ifdef MODULE | |
| 67 | 68 | static const struct x86_cpu_id vmx_cpu_id[] = { |
| 68 | 69 | X86_FEATURE_MATCH(X86_FEATURE_VMX), |
| 69 | 70 | {} |
| 70 | 71 | }; |
| 71 | 72 | MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id); |
| 73 | +#endif | |
| 72 | 74 | |
| 73 | 75 | bool __read_mostly enable_vpid = 1; |
| 74 | 76 | module_param_named(vpid, enable_vpid, bool, 0444); |
| @@ -95,7 +97,7 @@ module_param(emulate_invalid_guest_state, bool, S_IRUGO); · 20 unmodified lines | ||
| 95 | 97 | static bool __read_mostly fasteoi = 1; |
| 96 | 98 | module_param(fasteoi, bool, S_IRUGO); |
| 97 | 99 | |
| 98 | −static bool __read_mostly enable_apicv = 1; | |
| 100 | +bool __read_mostly enable_apicv = 1; | |
| 99 | 101 | module_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 | 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 | 1184 | if (vmx->guest_state_loaded) |
| 1179 | 1185 | return; |
| 1180 | 1186 | |
| @@ -1599,6 +1605,40 @@ static int skip_emulated_instruction(struct kvm_vcpu *vcpu) · 418 unmodified lines | ||
| 1599 | 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 | + */ | |
| 1613 | +static void vmx_update_emulated_instruction(struct kvm_vcpu *vcpu) | |
| 1614 | +{ | |
| 1615 | + struct vmcs12 *vmcs12 = get_vmcs12(vcpu); | |
| 1616 | + struct vcpu_vmx *vmx = to_vmx(vcpu); | |
| 1617 | + | |
| 1618 | + if (!is_guest_mode(vcpu)) | |
| 1619 | + return; | |
| 1620 | + | |
| 1621 | + /* | |
| 1622 | + * Per the SDM, MTF takes priority over debug-trap exceptions besides | |
| 1623 | + * T-bit traps. As instruction emulation is completed (i.e. at the | |
| 1624 | + * instruction boundary), any #DB exception pending delivery must be a | |
| 1625 | + * debug-trap. Record the pending MTF state to be delivered in | |
| 1626 | + * vmx_check_nested_events(). | |
| 1627 | + */ | |
| 1628 | + if (nested_cpu_has_mtf(vmcs12) && | |
| 1629 | + (!vcpu->arch.exception.pending || | |
| 1630 | + vcpu->arch.exception.nr == DB_VECTOR)) | |
| 1631 | + vmx->nested.mtf_pending = true; | |
| 1632 | + else | |
| 1633 | + vmx->nested.mtf_pending = false; | |
| 1634 | +} | |
| 1635 | + | |
| 1636 | +static int vmx_skip_emulated_instruction(struct kvm_vcpu *vcpu) | |
| 1637 | +{ | |
| 1638 | + vmx_update_emulated_instruction(vcpu); | |
| 1639 | + return skip_emulated_instruction(vcpu); | |
| 1640 | +} | |
| 1641 | + | |
| 1602 | 1642 | static 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 | |
| 2948 | 2988 | static 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 | 2993 | if (cpu_has_vmx_ept_5levels() && (cpuid_maxphyaddr(vcpu) > 48)) |
| 2951 | 2994 | return 5; |
| 2952 | 2995 | return 4; |
| @@ -3815,24 +3858,29 @@ static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, · 862 unmodified lines | ||
| 3815 | 3858 | * 2. If target vcpu isn't running(root mode), kick it to pick up the |
| 3816 | 3859 | * interrupt from PIR in next vmentry. |
| 3817 | 3860 | */ |
| 3818 | −static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) | |
| 3861 | +static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) | |
| 3819 | 3862 | { |
| 3820 | 3863 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
| 3821 | 3864 | int r; |
| 3822 | 3865 | |
| 3823 | 3866 | r = vmx_deliver_nested_posted_interrupt(vcpu, vector); |
| 3824 | 3867 | if (!r) |
| 3825 | − return; | |
| 3868 | + return 0; | |
| 3869 | + | |
| 3870 | + if (!vcpu->arch.apicv_active) | |
| 3871 | + return -1; | |
| 3826 | 3872 | |
| 3827 | 3873 | if (pi_test_and_set_pir(vector, &vmx->pi_desc)) |
| 3828 | − return; | |
| 3874 | + return 0; | |
| 3829 | 3875 | |
| 3830 | 3876 | /* If a previous notification has sent the IPI, nothing to do. */ |
| 3831 | 3877 | if (pi_test_and_set_on(&vmx->pi_desc)) |
| 3832 | − return; | |
| 3878 | + return 0; | |
| 3833 | 3879 | |
| 3834 | 3880 | if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false)) |
| 3835 | 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 | 4287 | vmx->msr_ia32_umwait_control = 0; |
| 4240 | 4288 | |
| 4241 | − vcpu->arch.microcode_version = 0x100000000ULL; | |
| 4242 | 4289 | vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val(); |
| 4243 | 4290 | vmx->hv_deadline_tsc = -1; |
| 4244 | 4291 | kvm_set_cr8(vcpu, 0); |
| @@ -6480,8 +6527,11 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 2235 unmodified lines | ||
| 6480 | 6527 | vmcs_write32(PLE_WINDOW, vmx->ple_window); |
| 6481 | 6528 | } |
| 6482 | 6529 | |
| 6483 | − if (vmx->nested.need_vmcs12_to_shadow_sync) | |
| 6484 | − nested_sync_vmcs12_to_shadow(vcpu); | |
| 6530 | + /* | |
| 6531 | + * We did this in prepare_switch_to_guest, because it needs to | |
| 6532 | + * be within srcu_read_lock. | |
| 6533 | + */ | |
| 6534 | + WARN_ON_ONCE(vmx->nested.need_vmcs12_to_shadow_sync); | |
| 6485 | 6535 | |
| 6486 | 6536 | if (kvm_register_is_dirty(vcpu, VCPU_REGS_RSP)) |
| 6487 | 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 | 6806 | if (nested) |
| 6757 | 6807 | nested_vmx_setup_ctls_msrs(&vmx->nested.msrs, |
| 6758 | − vmx_capability.ept, | |
| 6759 | − kvm_vcpu_apicv_active(vcpu)); | |
| 6808 | + vmx_capability.ept); | |
| 6760 | 6809 | else |
| 6761 | 6810 | memset(&vmx->nested.msrs, 0, sizeof(vmx->nested.msrs)); |
| 6762 | 6811 | |
| 6763 | 6812 | vmx->nested.posted_intr_nv = -1; |
| 6764 | 6813 | vmx->nested.current_vmptr = -1ull; |
| 6765 | 6814 | |
| 6815 | + vcpu->arch.microcode_version = 0x100000000ULL; | |
| 6766 | 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 | 6886 | if (setup_vmcs_config(&vmcs_conf, &vmx_cap) < 0) |
| 6837 | 6887 | return -EIO; |
| 6838 | 6888 | if (nested) |
| 6839 | − nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept, | |
| 6840 | − enable_apicv); | |
| 6889 | + nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept); | |
| 6841 | 6890 | if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) { |
| 6842 | 6891 | printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n", |
| 6843 | 6892 | smp_processor_id()); |
| @@ -7098,6 +7147,40 @@ static void vmx_request_immediate_exit(struct kvm_vcpu *vcpu) · 254 unmodified lines | ||
| 7098 | 7147 | to_vmx(vcpu)->req_immediate_exit = true; |
| 7099 | 7148 | } |
| 7100 | 7149 | |
| 7150 | +static int vmx_check_intercept_io(struct kvm_vcpu *vcpu, | |
| 7151 | + struct x86_instruction_info *info) | |
| 7152 | +{ | |
| 7153 | + struct vmcs12 *vmcs12 = get_vmcs12(vcpu); | |
| 7154 | + unsigned short port; | |
| 7155 | + bool intercept; | |
| 7156 | + int size; | |
| 7157 | + | |
| 7158 | + if (info->intercept == x86_intercept_in || | |
| 7159 | + info->intercept == x86_intercept_ins) { | |
| 7160 | + port = info->src_val; | |
| 7161 | + size = info->dst_bytes; | |
| 7162 | + } else { | |
| 7163 | + port = info->dst_val; | |
| 7164 | + size = info->src_bytes; | |
| 7165 | + } | |
| 7166 | + | |
| 7167 | + /* | |
| 7168 | + * If the 'use IO bitmaps' VM-execution control is 0, IO instruction | |
| 7169 | + * VM-exits depend on the 'unconditional IO exiting' VM-execution | |
| 7170 | + * control. | |
| 7171 | + * | |
| 7172 | + * Otherwise, IO instruction VM-exits are controlled by the IO bitmaps. | |
| 7173 | + */ | |
| 7174 | + if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) | |
| 7175 | + intercept = nested_cpu_has(vmcs12, | |
| 7176 | + CPU_BASED_UNCOND_IO_EXITING); | |
| 7177 | + else | |
| 7178 | + intercept = nested_vmx_check_io_bitmaps(vcpu, port, size); | |
| 7179 | + | |
| 7180 | + /* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */ | |
| 7181 | + return intercept ? X86EMUL_UNHANDLEABLE : X86EMUL_CONTINUE; | |
| 7182 | +} | |
| 7183 | + | |
| 7101 | 7184 | static int vmx_check_intercept(struct kvm_vcpu *vcpu, |
| 7102 | 7185 | struct x86_instruction_info *info, |
| 7103 | 7186 | enum x86_intercept_stage stage) |
| @@ -7105,19 +7188,45 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu, · 1 unmodified line | ||
| 7105 | 7188 | struct vmcs12 *vmcs12 = get_vmcs12(vcpu); |
| 7106 | 7189 | struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt; |
| 7107 | 7190 | |
| 7191 | + switch (info->intercept) { | |
| 7108 | 7192 | /* |
| 7109 | 7193 | * RDPID causes #UD if disabled through secondary execution controls. |
| 7110 | 7194 | * Because it is marked as EmulateOnUD, we need to intercept it here. |
| 7111 | 7195 | */ |
| 7112 | − if (info->intercept == x86_intercept_rdtscp && | |
| 7113 | − !nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) { | |
| 7114 | − ctxt->exception.vector = UD_VECTOR; | |
| 7115 | − ctxt->exception.error_code_valid = false; | |
| 7116 | − return X86EMUL_PROPAGATE_FAULT; | |
| 7117 | − } | |
| 7196 | + case x86_intercept_rdtscp: | |
| 7197 | + if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDTSCP)) { | |
| 7198 | + ctxt->exception.vector = UD_VECTOR; | |
| 7199 | + ctxt->exception.error_code_valid = false; | |
| 7200 | + return X86EMUL_PROPAGATE_FAULT; | |
| 7201 | + } | |
| 7202 | + break; | |
| 7203 | + | |
| 7204 | + case x86_intercept_in: | |
| 7205 | + case x86_intercept_ins: | |
| 7206 | + case x86_intercept_out: | |
| 7207 | + case x86_intercept_outs: | |
| 7208 | + return vmx_check_intercept_io(vcpu, info); | |
| 7209 | + | |
| 7210 | + case x86_intercept_lgdt: | |
| 7211 | + case x86_intercept_lidt: | |
| 7212 | + case x86_intercept_lldt: | |
| 7213 | + case x86_intercept_ltr: | |
| 7214 | + case x86_intercept_sgdt: | |
| 7215 | + case x86_intercept_sidt: | |
| 7216 | + case x86_intercept_sldt: | |
| 7217 | + case x86_intercept_str: | |
| 7218 | + if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_DESC)) | |
| 7219 | + return X86EMUL_CONTINUE; | |
| 7220 | + | |
| 7221 | + /* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */ | |
| 7222 | + break; | |
| 7118 | 7223 | |
| 7119 | 7224 | /* TODO: check more intercepts... */ |
| 7120 | − return X86EMUL_CONTINUE; | |
| 7225 | + default: | |
| 7226 | + break; | |
| 7227 | + } | |
| 7228 | + | |
| 7229 | + return X86EMUL_UNHANDLEABLE; | |
| 7121 | 7230 | } |
| 7122 | 7231 | |
| 7123 | 7232 | #ifdef CONFIG_X86_64 |
| @@ -7699,7 +7808,7 @@ static __init int hardware_setup(void) · 575 unmodified lines | ||
| 7699 | 7808 | |
| 7700 | 7809 | if (nested) { |
| 7701 | 7810 | nested_vmx_setup_ctls_msrs(&vmcs_config.nested, |
| 7702 | − vmx_capability.ept, enable_apicv); | |
| 7811 | + vmx_capability.ept); | |
| 7703 | 7812 | |
| 7704 | 7813 | r = nested_vmx_hardware_setup(kvm_vmx_exit_handlers); |
| 7705 | 7814 | if (r) |
| @@ -7783,7 +7892,8 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 77 unmodified lines | ||
| 7783 | 7892 | |
| 7784 | 7893 | .run = vmx_vcpu_run, |
| 7785 | 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 | 7897 | .set_interrupt_shadow = vmx_set_interrupt_shadow, |
| 7788 | 7898 | .get_interrupt_shadow = vmx_get_interrupt_shadow, |
| 7789 | 7899 | .patch_hypercall = vmx_patch_hypercall, |
| @@ -150,6 +150,9 @@ struct nested_vmx { · 149 unmodified lines | ||
| 150 | 150 | /* L2 must run next, and mustn't decide to exit to L1. */ |
| 151 | 151 | bool nested_run_pending; |
| 152 | 152 | |
| 153 | + /* Pending MTF VM-exit into L1. */ | |
| 154 | + bool mtf_pending; | |
| 155 | + | |
| 153 | 156 | struct loaded_vmcs vmcs02; |
| 154 | 157 | |
| 155 | 158 | /* |
| @@ -438,6 +438,14 @@ void kvm_deliver_exception_payload(struct kvm_vcpu *vcpu) · 437 unmodified lines | ||
| 438 | 438 | * for #DB exceptions under VMX. |
| 439 | 439 | */ |
| 440 | 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 | 449 | break; |
| 442 | 450 | case PF_VECTOR: |
| 443 | 451 | vcpu->arch.cr2 = payload; |
| @@ -490,19 +498,7 @@ static void kvm_multiple_exception(struct kvm_vcpu *vcpu, · 46 unmodified lines | ||
| 490 | 498 | vcpu->arch.exception.error_code = error_code; |
| 491 | 499 | vcpu->arch.exception.has_payload = has_payload; |
| 492 | 500 | vcpu->arch.exception.payload = payload; |
| 493 | − /* | |
| 494 | − * In guest mode, payload delivery should be deferred, | |
| 495 | − * so that the L1 hypervisor can intercept #PF before | |
| 496 | − * CR2 is modified (or intercept #DB before DR6 is | |
| 497 | − * modified under nVMX). However, for ABI | |
| 498 | − * compatibility with KVM_GET_VCPU_EVENTS and | |
| 499 | − * KVM_SET_VCPU_EVENTS, we can't delay payload | |
| 500 | − * delivery unless userspace has enabled this | |
| 501 | − * functionality via the per-VM capability, | |
| 502 | − * KVM_CAP_EXCEPTION_PAYLOAD. | |
| 503 | − */ | |
| 504 | − if (!vcpu->kvm->arch.exception_payload_enabled || | |
| 505 | − !is_guest_mode(vcpu)) | |
| 501 | + if (!is_guest_mode(vcpu)) | |
| 506 | 502 | kvm_deliver_exception_payload(vcpu); |
| 507 | 503 | return; |
| 508 | 504 | } |
| @@ -2448,7 +2444,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 1939 unmodified lines | ||
| 2448 | 2444 | vcpu->hv_clock.tsc_timestamp = tsc_timestamp; |
| 2449 | 2445 | vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset; |
| 2450 | 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 | 2449 | /* If the host uses TSC clocksource, then it is stable */ |
| 2454 | 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 | 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 | 3810 | * The API doesn't provide the instruction length for software |
| 3800 | 3811 | * exceptions, so don't report them. As long as the guest RIP |
| @@ -6880,6 +6891,8 @@ restart: · 3079 unmodified lines | ||
| 6880 | 6891 | kvm_rip_write(vcpu, ctxt->eip); |
| 6881 | 6892 | if (r && ctxt->tf) |
| 6882 | 6893 | r = kvm_vcpu_do_singlestep(vcpu); |
| 6894 | + if (kvm_x86_ops->update_emulated_instruction) | |
| 6895 | + kvm_x86_ops->update_emulated_instruction(vcpu); | |
| 6883 | 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 | 7191 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { |
| 7179 | 7192 | #ifdef CONFIG_CPU_FREQ |
| 7180 | − struct cpufreq_policy policy; | |
| 7193 | + struct cpufreq_policy *policy; | |
| 7181 | 7194 | int cpu; |
| 7182 | 7195 | |
| 7183 | − memset(&policy, 0, sizeof(policy)); | |
| 7184 | 7196 | cpu = get_cpu(); |
| 7185 | − cpufreq_get_policy(&policy, cpu); | |
| 7186 | − if (policy.cpuinfo.max_freq) | |
| 7187 | − max_tsc_khz = policy.cpuinfo.max_freq; | |
| 7197 | + policy = cpufreq_cpu_get(cpu); | |
| 7198 | + if (policy && policy->cpuinfo.max_freq) | |
| 7199 | + max_tsc_khz = policy->cpuinfo.max_freq; | |
| 7188 | 7200 | put_cpu(); |
| 7201 | + cpufreq_cpu_put(policy); | |
| 7189 | 7202 | #endif |
| 7190 | 7203 | cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block, |
| 7191 | 7204 | CPUFREQ_TRANSITION_NOTIFIER); |
| @@ -7295,12 +7308,12 @@ int kvm_arch_init(void *opaque) · 103 unmodified lines | ||
| 7295 | 7308 | } |
| 7296 | 7309 | |
| 7297 | 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 | 7312 | r = -EOPNOTSUPP; |
| 7300 | 7313 | goto out; |
| 7301 | 7314 | } |
| 7302 | 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 | 7317 | r = -EOPNOTSUPP; |
| 7305 | 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 | 8956 | kvm_rip_write(vcpu, ctxt->eip); |
| 8944 | 8957 | kvm_set_rflags(vcpu, ctxt->eflags); |
| 8945 | − kvm_make_request(KVM_REQ_EVENT, vcpu); | |
| 8946 | 8958 | return 1; |
| 8947 | 8959 | } |
| 8948 | 8960 | EXPORT_SYMBOL_GPL(kvm_task_switch); |
| @@ -10182,7 +10194,7 @@ void kvm_arch_async_page_ready(struct kvm_vcpu *vcpu, struct kvm_async_pf *work) · 1233 unmodified lines | ||
| 10182 | 10194 | work->arch.cr3 != vcpu->arch.mmu->get_cr3(vcpu)) |
| 10183 | 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 | |
| 10188 | 10200 | static inline u32 kvm_async_pf_hash_fn(gfn_t gfn) |
| @@ -363,13 +363,8 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m, · 362 unmodified lines | ||
| 363 | 363 | { |
| 364 | 364 | const struct ptdump_range ptdump_ranges[] = { |
| 365 | 365 | #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 | 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 | 368 | #else |
| 374 | 369 | {0, ~0UL}, |
| 375 | 370 | #endif |
| @@ -180,7 +180,7 @@ void efi_sync_low_kernel_mappings(void) · 179 unmodified lines | ||
| 180 | 180 | static inline phys_addr_t |
| 181 | 181 | virt_to_phys_or_null_size(void *va, unsigned long size) |
| 182 | 182 | { |
| 183 | − bool bad_size; | |
| 183 | + phys_addr_t pa; | |
| 184 | 184 | |
| 185 | 185 | if (!va) |
| 186 | 186 | return 0; |
| @@ -188,16 +188,13 @@ virt_to_phys_or_null_size(void *va, unsigned long size) · 1 unmodified line | ||
| 188 | 188 | if (virt_addr_valid(va)) |
| 189 | 189 | return virt_to_phys(va); |
| 190 | 190 | |
| 191 | − /* | |
| 192 | − * A fully aligned variable on the stack is guaranteed not to | |
| 193 | − * cross a page bounary. Try to catch strings on the stack by | |
| 194 | − * checking that 'size' is a power of two. | |
| 195 | − */ | |
| 196 | − bad_size = size > PAGE_SIZE || !is_power_of_2(size); | |
| 191 | + pa = slow_virt_to_phys(va); | |
| 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 | 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 | |
| 569 | 566 | static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc) |
| 570 | 567 | { |
| 571 | − efi_status_t status; | |
| 572 | − u32 phys_tm, phys_tc; | |
| 573 | − unsigned long flags; | |
| 574 | − | |
| 575 | − spin_lock(&rtc_lock); | |
| 576 | − spin_lock_irqsave(&efi_runtime_lock, flags); | |
| 577 | − | |
| 578 | − phys_tm = virt_to_phys_or_null(tm); | |
| 579 | − phys_tc = virt_to_phys_or_null(tc); | |
| 580 | − | |
| 581 | − status = efi_thunk(get_time, phys_tm, phys_tc); | |
| 582 | − | |
| 583 | − spin_unlock_irqrestore(&efi_runtime_lock, flags); | |
| 584 | − spin_unlock(&rtc_lock); | |
| 585 | − | |
| 586 | − return status; | |
| 568 | + return EFI_UNSUPPORTED; | |
| 587 | 569 | } |
| 588 | 570 | |
| 589 | 571 | static efi_status_t efi_thunk_set_time(efi_time_t *tm) |
| 590 | 572 | { |
| 591 | − efi_status_t status; | |
| 592 | − u32 phys_tm; | |
| 593 | − unsigned long flags; | |
| 594 | − | |
| 595 | − spin_lock(&rtc_lock); | |
| 596 | − spin_lock_irqsave(&efi_runtime_lock, flags); | |
| 597 | − | |
| 598 | − phys_tm = virt_to_phys_or_null(tm); | |
| 599 | − | |
| 600 | − status = efi_thunk(set_time, phys_tm); | |
| 601 | − | |
| 602 | − spin_unlock_irqrestore(&efi_runtime_lock, flags); | |
| 603 | − spin_unlock(&rtc_lock); | |
| 604 | − | |
| 605 | − return status; | |
| 573 | + return EFI_UNSUPPORTED; | |
| 606 | 574 | } |
| 607 | 575 | |
| 608 | 576 | static efi_status_t |
| 609 | 577 | efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending, |
| 610 | 578 | efi_time_t *tm) |
| 611 | 579 | { |
| 612 | − efi_status_t status; | |
| 613 | − u32 phys_enabled, phys_pending, phys_tm; | |
| 614 | − unsigned long flags; | |
| 615 | − | |
| 616 | − spin_lock(&rtc_lock); | |
| 617 | − spin_lock_irqsave(&efi_runtime_lock, flags); | |
| 618 | − | |
| 619 | − phys_enabled = virt_to_phys_or_null(enabled); | |
| 620 | − phys_pending = virt_to_phys_or_null(pending); | |
| 621 | − phys_tm = virt_to_phys_or_null(tm); | |
| 622 | − | |
| 623 | − status = efi_thunk(get_wakeup_time, phys_enabled, | |
| 624 | − phys_pending, phys_tm); | |
| 625 | − | |
| 626 | − spin_unlock_irqrestore(&efi_runtime_lock, flags); | |
| 627 | − spin_unlock(&rtc_lock); | |
| 628 | − | |
| 629 | − return status; | |
| 580 | + return EFI_UNSUPPORTED; | |
| 630 | 581 | } |
| 631 | 582 | |
| 632 | 583 | static efi_status_t |
| 633 | 584 | efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) |
| 634 | 585 | { |
| 635 | − efi_status_t status; | |
| 636 | − u32 phys_tm; | |
| 637 | − unsigned long flags; | |
| 638 | − | |
| 639 | − spin_lock(&rtc_lock); | |
| 640 | − spin_lock_irqsave(&efi_runtime_lock, flags); | |
| 641 | − | |
| 642 | − phys_tm = virt_to_phys_or_null(tm); | |
| 643 | − | |
| 644 | − status = efi_thunk(set_wakeup_time, enabled, phys_tm); | |
| 645 | − | |
| 646 | − spin_unlock_irqrestore(&efi_runtime_lock, flags); | |
| 647 | − spin_unlock(&rtc_lock); | |
| 648 | − | |
| 649 | − return status; | |
| 586 | + return EFI_UNSUPPORTED; | |
| 650 | 587 | } |
| 651 | 588 | |
| 652 | 589 | static unsigned long efi_name_size(efi_char16_t *name) |
| @@ -658,6 +595,8 @@ static efi_status_t · 5 unmodified lines | ||
| 658 | 595 | efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor, |
| 659 | 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 | 600 | efi_status_t status; |
| 662 | 601 | u32 phys_name, phys_vendor, phys_attr; |
| 663 | 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 | 605 | spin_lock_irqsave(&efi_runtime_lock, flags); |
| 667 | 606 | |
| 607 | + *vnd = *vendor; | |
| 608 | + | |
| 668 | 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 | 611 | phys_name = virt_to_phys_or_null_size(name, efi_name_size(name)); |
| 671 | 612 | phys_attr = virt_to_phys_or_null(attr); |
| 672 | 613 | phys_data = virt_to_phys_or_null_size(data, *data_size); |
| 673 | 614 | |
| 674 | − status = efi_thunk(get_variable, phys_name, phys_vendor, | |
| 675 | − phys_attr, phys_data_size, phys_data); | |
| 615 | + if (!phys_name || (data && !phys_data)) | |
| 616 | + status = EFI_INVALID_PARAMETER; | |
| 617 | + else | |
| 618 | + status = efi_thunk(get_variable, phys_name, phys_vendor, | |
| 619 | + phys_attr, phys_data_size, phys_data); | |
| 676 | 620 | |
| 677 | 621 | spin_unlock_irqrestore(&efi_runtime_lock, flags); |
| 678 | 622 | |
| @@ -683,19 +627,25 @@ static efi_status_t · 4 unmodified lines | ||
| 683 | 627 | efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor, |
| 684 | 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 | 632 | u32 phys_name, phys_vendor, phys_data; |
| 687 | 633 | efi_status_t status; |
| 688 | 634 | unsigned long flags; |
| 689 | 635 | |
| 690 | 636 | spin_lock_irqsave(&efi_runtime_lock, flags); |
| 691 | 637 | |
| 638 | + *vnd = *vendor; | |
| 639 | + | |
| 692 | 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 | 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 */ | |
| 697 | − status = efi_thunk(set_variable, phys_name, phys_vendor, | |
| 698 | − attr, data_size, phys_data); | |
| 644 | + if (!phys_name || !phys_data) | |
| 645 | + status = EFI_INVALID_PARAMETER; | |
| 646 | + else | |
| 647 | + status = efi_thunk(set_variable, phys_name, phys_vendor, | |
| 648 | + attr, data_size, phys_data); | |
| 699 | 649 | |
| 700 | 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 | 657 | u32 attr, unsigned long data_size, |
| 708 | 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 | 662 | u32 phys_name, phys_vendor, phys_data; |
| 711 | 663 | efi_status_t status; |
| 712 | 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 | 666 | if (!spin_trylock_irqsave(&efi_runtime_lock, flags)) |
| 715 | 667 | return EFI_NOT_READY; |
| 716 | 668 | |
| 669 | + *vnd = *vendor; | |
| 670 | + | |
| 717 | 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 | 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 */ | |
| 722 | − status = efi_thunk(set_variable, phys_name, phys_vendor, | |
| 723 | − attr, data_size, phys_data); | |
| 675 | + if (!phys_name || !phys_data) | |
| 676 | + status = EFI_INVALID_PARAMETER; | |
| 677 | + else | |
| 678 | + status = efi_thunk(set_variable, phys_name, phys_vendor, | |
| 679 | + attr, data_size, phys_data); | |
| 724 | 680 | |
| 725 | 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 | 688 | efi_char16_t *name, |
| 733 | 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 | 693 | efi_status_t status; |
| 736 | 694 | u32 phys_name_size, phys_name, phys_vendor; |
| 737 | 695 | unsigned long flags; |
| 738 | 696 | |
| 739 | 697 | spin_lock_irqsave(&efi_runtime_lock, flags); |
| 740 | 698 | |
| 699 | + *vnd = *vendor; | |
| 700 | + | |
| 741 | 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 | 703 | phys_name = virt_to_phys_or_null_size(name, *name_size); |
| 744 | 704 | |
| 745 | − status = efi_thunk(get_next_variable, phys_name_size, | |
| 746 | − phys_name, phys_vendor); | |
| 705 | + if (!phys_name) | |
| 706 | + status = EFI_INVALID_PARAMETER; | |
| 707 | + else | |
| 708 | + status = efi_thunk(get_next_variable, phys_name_size, | |
| 709 | + phys_name, phys_vendor); | |
| 747 | 710 | |
| 748 | 711 | spin_unlock_irqrestore(&efi_runtime_lock, flags); |
| 749 | 712 | |
| 713 | + *vendor = *vnd; | |
| 750 | 714 | return status; |
| 751 | 715 | } |
| 752 | 716 | |
| 753 | 717 | static efi_status_t |
| 754 | 718 | efi_thunk_get_next_high_mono_count(u32 *count) |
| 755 | 719 | { |
| 756 | − efi_status_t status; | |
| 757 | − u32 phys_count; | |
| 758 | − unsigned long flags; | |
| 759 | − | |
| 760 | − spin_lock_irqsave(&efi_runtime_lock, flags); | |
| 761 | − | |
| 762 | − phys_count = virt_to_phys_or_null(count); | |
| 763 | − status = efi_thunk(get_next_high_mono_count, phys_count); | |
| 764 | − | |
| 765 | − spin_unlock_irqrestore(&efi_runtime_lock, flags); | |
| 766 | − | |
| 767 | − return status; | |
| 720 | + return EFI_UNSUPPORTED; | |
| 768 | 721 | } |
| 769 | 722 | |
| 770 | 723 | static void |
| @@ -72,6 +72,9 @@ · 71 unmodified lines | ||
| 72 | 72 | #include <asm/mwait.h> |
| 73 | 73 | #include <asm/pci_x86.h> |
| 74 | 74 | #include <asm/cpu.h> |
| 75 | +#ifdef CONFIG_X86_IOPL_IOPERM | |
| 76 | +#include <asm/io_bitmap.h> | |
| 77 | +#endif | |
| 75 | 78 | |
| 76 | 79 | #ifdef CONFIG_ACPI |
| 77 | 80 | #include <linux/acpi.h> |
| @@ -837,6 +840,25 @@ static void xen_load_sp0(unsigned long sp0) · 759 unmodified lines | ||
| 837 | 840 | this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0); |
| 838 | 841 | } |
| 839 | 842 | |
| 843 | +#ifdef CONFIG_X86_IOPL_IOPERM | |
| 844 | +static void xen_update_io_bitmap(void) | |
| 845 | +{ | |
| 846 | + struct physdev_set_iobitmap iobitmap; | |
| 847 | + struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw); | |
| 848 | + | |
| 849 | + native_tss_update_io_bitmap(); | |
| 850 | + | |
| 851 | + iobitmap.bitmap = (uint8_t *)(&tss->x86_tss) + | |
| 852 | + tss->x86_tss.io_bitmap_base; | |
| 853 | + if (tss->x86_tss.io_bitmap_base == IO_BITMAP_OFFSET_INVALID) | |
| 854 | + iobitmap.nr_ports = 0; | |
| 855 | + else | |
| 856 | + iobitmap.nr_ports = IO_BITMAP_BITS; | |
| 857 | + | |
| 858 | + HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap); | |
| 859 | +} | |
| 860 | +#endif | |
| 861 | + | |
| 840 | 862 | static 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 | ||
| 896 | 918 | static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high) |
| 897 | 919 | { |
| 898 | 920 | int ret; |
| 921 | +#ifdef CONFIG_X86_64 | |
| 922 | + unsigned int which; | |
| 923 | + u64 base; | |
| 924 | +#endif | |
| 899 | 925 | |
| 900 | 926 | ret = 0; |
| 901 | 927 | |
| 902 | 928 | switch (msr) { |
| 903 | 929 | #ifdef CONFIG_X86_64 |
| 904 | − unsigned which; | |
| 905 | − u64 base; | |
| 906 | − | |
| 907 | 930 | case MSR_FS_BASE: which = SEGBASE_FS; goto set; |
| 908 | 931 | case MSR_KERNEL_GS_BASE: which = SEGBASE_GS_USER; goto set; |
| 909 | 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 | 1069 | .write_idt_entry = xen_write_idt_entry, |
| 1047 | 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 | 1075 | .io_delay = xen_io_delay, |
| 1050 | 1076 | |
| 1051 | 1077 | /* Xen takes care of %gs when switching to usermode for us */ |
| @@ -412,7 +412,7 @@ void blk_insert_flush(struct request *rq) · 411 unmodified lines | ||
| 412 | 412 | */ |
| 413 | 413 | if ((policy & REQ_FSEQ_DATA) && |
| 414 | 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 | 416 | return; |
| 417 | 417 | } |
| 418 | 418 | |
| @@ -361,13 +361,19 @@ static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx, · 360 unmodified lines | ||
| 361 | 361 | bool has_sched, |
| 362 | 362 | struct request *rq) |
| 363 | 363 | { |
| 364 | − /* dispatch flush rq directly */ | |
| 365 | − if (rq->rq_flags & RQF_FLUSH_SEQ) { | |
| 366 | − spin_lock(&hctx->lock); | |
| 367 | − list_add(&rq->queuelist, &hctx->dispatch); | |
| 368 | − spin_unlock(&hctx->lock); | |
| 364 | + /* | |
| 365 | + * dispatch flush and passthrough rq directly | |
| 366 | + * | |
| 367 | + * passthrough request has to be added to hctx->dispatch directly. | |
| 368 | + * For some reason, device may be in one situation which can't | |
| 369 | + * handle FS request, so STS_RESOURCE is always returned and the | |
| 370 | + * FS request will be added to hctx->dispatch. However passthrough | |
| 371 | + * request may be required at that time for fixing the problem. If | |
| 372 | + * passthrough request is added to scheduler queue, there isn't any | |
| 373 | + * chance to dispatch it given we prioritize requests in hctx->dispatch. | |
| 374 | + */ | |
| 375 | + if ((rq->rq_flags & RQF_FLUSH_SEQ) || blk_rq_is_passthrough(rq)) | |
| 369 | 376 | return true; |
| 370 | − } | |
| 371 | 377 | |
| 372 | 378 | if (has_sched) |
| 373 | 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 | 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 | 402 | goto run; |
| 403 | + } | |
| 396 | 404 | |
| 397 | 405 | if (e && e->type->ops.insert_requests) { |
| 398 | 406 | LIST_HEAD(list); |
| @@ -183,8 +183,8 @@ found_tag: · 182 unmodified lines | ||
| 183 | 183 | return tag + tag_offset; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | −void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags, | |
| 187 | − struct blk_mq_ctx *ctx, unsigned int tag) | |
| 186 | +void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx, | |
| 187 | + unsigned int tag) | |
| 188 | 188 | { |
| 189 | 189 | if (!blk_mq_tag_is_reserved(tags, tag)) { |
| 190 | 190 | const int real_tag = tag - tags->nr_reserved_tags; |
| @@ -26,8 +26,8 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int r · 25 unmodified lines | ||
| 26 | 26 | extern void blk_mq_free_tags(struct blk_mq_tags *tags); |
| 27 | 27 | |
| 28 | 28 | extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data); |
| 29 | −extern void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags, | |
| 30 | − struct blk_mq_ctx *ctx, unsigned int tag); | |
| 29 | +extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx, | |
| 30 | + unsigned int tag); | |
| 31 | 31 | extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx, |
| 32 | 32 | struct blk_mq_tags **tags, |
| 33 | 33 | unsigned int depth, bool can_grow); |
| @@ -477,9 +477,9 @@ static void __blk_mq_free_request(struct request *rq) · 476 unmodified lines | ||
| 477 | 477 | blk_pm_mark_last_busy(rq); |
| 478 | 478 | rq->mq_hctx = NULL; |
| 479 | 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 | 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 | 483 | blk_mq_sched_restart(hctx); |
| 484 | 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 | 735 | * merge. |
| 736 | 736 | */ |
| 737 | 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 | 739 | else |
| 740 | 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 | 1286 | q->mq_ops->commit_rqs(hctx); |
| 1287 | 1287 | |
| 1288 | 1288 | spin_lock(&hctx->lock); |
| 1289 | − list_splice_init(list, &hctx->dispatch); | |
| 1289 | + list_splice_tail_init(list, &hctx->dispatch); | |
| 1290 | 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 | 1677 | * Should only be used carefully, when the caller knows we want to |
| 1678 | 1678 | * bypass a potential IO scheduler on the target device. |
| 1679 | 1679 | */ |
| 1680 | −void blk_mq_request_bypass_insert(struct request *rq, bool run_queue) | |
| 1680 | +void blk_mq_request_bypass_insert(struct request *rq, bool at_head, | |
| 1681 | + bool run_queue) | |
| 1681 | 1682 | { |
| 1682 | 1683 | struct blk_mq_hw_ctx *hctx = rq->mq_hctx; |
| 1683 | 1684 | |
| 1684 | 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 | 1690 | spin_unlock(&hctx->lock); |
| 1687 | 1691 | |
| 1688 | 1692 | if (run_queue) |
| @@ -1849,7 +1853,7 @@ insert: · 160 unmodified lines | ||
| 1849 | 1853 | if (bypass_insert) |
| 1850 | 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 | 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 | 1881 | ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false, true); |
| 1878 | 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 | 1884 | else if (ret != BLK_STS_OK) |
| 1881 | 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 | 1914 | if (ret != BLK_STS_OK) { |
| 1911 | 1915 | if (ret == BLK_STS_RESOURCE || |
| 1912 | 1916 | ret == BLK_STS_DEV_RESOURCE) { |
| 1913 | − blk_mq_request_bypass_insert(rq, | |
| 1917 | + blk_mq_request_bypass_insert(rq, false, | |
| 1914 | 1918 | list_empty(list)); |
| 1915 | 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 | |
| 3400 | 3404 | static unsigned long blk_mq_poll_nsecs(struct request_queue *q, |
| 3401 | − struct blk_mq_hw_ctx *hctx, | |
| 3402 | 3405 | struct request *rq) |
| 3403 | 3406 | { |
| 3404 | 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 | |
| 3433 | 3436 | static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, |
| 3434 | − struct blk_mq_hw_ctx *hctx, | |
| 3435 | 3437 | struct request *rq) |
| 3436 | 3438 | { |
| 3437 | 3439 | struct hrtimer_sleeper hs; |
| @@ -3451,7 +3453,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, · 13 unmodified lines | ||
| 3451 | 3453 | if (q->poll_nsec > 0) |
| 3452 | 3454 | nsecs = q->poll_nsec; |
| 3453 | 3455 | else |
| 3454 | − nsecs = blk_mq_poll_nsecs(q, hctx, rq); | |
| 3456 | + nsecs = blk_mq_poll_nsecs(q, rq); | |
| 3455 | 3457 | |
| 3456 | 3458 | if (!nsecs) |
| 3457 | 3459 | return false; |
| @@ -3506,7 +3508,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q, · 48 unmodified lines | ||
| 3506 | 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 | /** |
| @@ -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 | */ |
| 67 | 67 | void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, |
| 68 | 68 | bool at_head); |
| 69 | −void blk_mq_request_bypass_insert(struct request *rq, bool run_queue); | |
| 69 | +void blk_mq_request_bypass_insert(struct request *rq, bool at_head, | |
| 70 | + bool run_queue); | |
| 70 | 71 | void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx, |
| 71 | 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 | ||
| 199 | 200 | static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx, |
| 200 | 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 | 204 | rq->tag = -1; |
| 204 | 205 | |
| 205 | 206 | if (rq->rq_flags & RQF_MQ_INFLIGHT) { |
| @@ -136,8 +136,6 @@ config CRYPTO_USER · 135 unmodified lines | ||
| 136 | 136 | Userspace configuration for cryptographic instantiations such as |
| 137 | 137 | cbc(aes). |
| 138 | 138 | |
| 139 | −if CRYPTO_MANAGER2 | |
| 140 | − | |
| 141 | 139 | config CRYPTO_MANAGER_DISABLE_TESTS |
| 142 | 140 | bool "Disable run-time self tests" |
| 143 | 141 | default y |
| @@ -155,8 +153,6 @@ config CRYPTO_MANAGER_EXTRA_TESTS · 11 unmodified lines | ||
| 155 | 153 | This is intended for developer use only, as these tests take much |
| 156 | 154 | longer to run than the normal self tests. |
| 157 | 155 | |
| 158 | −endif # if CRYPTO_MANAGER2 | |
| 159 | − | |
| 160 | 156 | config CRYPTO_GF128MUL |
| 161 | 157 | tristate |
| 162 | 158 | |
| @@ -26,7 +26,7 @@ const char *const hash_algo_name[HASH_ALGO__LAST] = { · 25 unmodified lines | ||
| 26 | 26 | [HASH_ALGO_TGR_128] = "tgr128", |
| 27 | 27 | [HASH_ALGO_TGR_160] = "tgr160", |
| 28 | 28 | [HASH_ALGO_TGR_192] = "tgr192", |
| 29 | − [HASH_ALGO_SM3_256] = "sm3-256", | |
| 29 | + [HASH_ALGO_SM3_256] = "sm3", | |
| 30 | 30 | [HASH_ALGO_STREEBOG_256] = "streebog256", |
| 31 | 31 | [HASH_ALGO_STREEBOG_512] = "streebog512", |
| 32 | 32 | }; |
| @@ -4436,6 +4436,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 4435 unmodified lines | ||
| 4436 | 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 | 4448 | .alg = "cbcmac(aes)", |
| 4440 | 4449 | .fips_allowed = 1, |
| 4441 | 4450 | .test = alg_test_hash, |
| @@ -4587,6 +4596,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 145 unmodified lines | ||
| 4587 | 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 | 4608 | .alg = "cts(cbc(aes))", |
| 4591 | 4609 | .test = alg_test_skcipher, |
| 4592 | 4610 | .fips_allowed = 1, |
| @@ -4879,6 +4897,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 286 unmodified lines | ||
| 4879 | 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 | 4909 | .alg = "ecdh", |
| 4883 | 4910 | .test = alg_test_kpp, |
| 4884 | 4911 | .fips_allowed = 1, |
| @@ -5465,6 +5492,15 @@ static const struct alg_test_desc alg_test_descs[] = { · 580 unmodified lines | ||
| 5465 | 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 | 5504 | .alg = "xts4096(paes)", |
| 5469 | 5505 | .test = alg_test_null, |
| 5470 | 5506 | .fips_allowed = 1, |
| @@ -55,12 +55,14 @@ static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat) · 54 unmodified lines | ||
| 55 | 55 | } |
| 56 | 56 | #endif |
| 57 | 57 | |
| 58 | +static bool acpi_no_watchdog; | |
| 59 | + | |
| 58 | 60 | static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void) |
| 59 | 61 | { |
| 60 | 62 | const struct acpi_table_wdat *wdat = NULL; |
| 61 | 63 | acpi_status status; |
| 62 | 64 | |
| 63 | − if (acpi_disabled) | |
| 65 | + if (acpi_disabled || acpi_no_watchdog) | |
| 64 | 66 | return NULL; |
| 65 | 67 | |
| 66 | 68 | status = acpi_get_table(ACPI_SIG_WDAT, 0, |
| @@ -88,6 +90,14 @@ bool acpi_has_watchdog(void) · 21 unmodified lines | ||
| 88 | 90 | } |
| 89 | 91 | EXPORT_SYMBOL_GPL(acpi_has_watchdog); |
| 90 | 92 | |
| 93 | +/* ACPI watchdog can be disabled on boot command line */ | |
| 94 | +static int __init disable_acpi_watchdog(char *str) | |
| 95 | +{ | |
| 96 | + acpi_no_watchdog = true; | |
| 97 | + return 1; | |
| 98 | +} | |
| 99 | +__setup("acpi_no_watchdog", disable_acpi_watchdog); | |
| 100 | + | |
| 91 | 101 | void __init acpi_watchdog_init(void) |
| 92 | 102 | { |
| 93 | 103 | const struct acpi_wdat_entry *entries; |
| @@ -126,12 +136,11 @@ void __init acpi_watchdog_init(void) · 32 unmodified lines | ||
| 126 | 136 | gas = &entries[i].register_region; |
| 127 | 137 | |
| 128 | 138 | res.start = gas->address; |
| 139 | + res.end = res.start + ACPI_ACCESS_BYTE_WIDTH(gas->access_width) - 1; | |
| 129 | 140 | if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
| 130 | 141 | res.flags = IORESOURCE_MEM; |
| 131 | − res.end = res.start + ALIGN(gas->access_width, 4) - 1; | |
| 132 | 142 | } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { |
| 133 | 143 | res.flags = IORESOURCE_IO; |
| 134 | − res.end = res.start + gas->access_width - 1; | |
| 135 | 144 | } else { |
| 136 | 145 | pr_warn("Unsupported address space: %u\n", |
| 137 | 146 | gas->space_id); |
| @@ -101,6 +101,8 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void); · 100 unmodified lines | ||
| 101 | 101 | |
| 102 | 102 | acpi_status acpi_hw_enable_all_wakeup_gpes(void); |
| 103 | 103 | |
| 104 | +u8 acpi_hw_check_all_gpes(void); | |
| 105 | + | |
| 104 | 106 | acpi_status |
| 105 | 107 | acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
| 106 | 108 | struct acpi_gpe_block_info *gpe_block, |
| @@ -265,4 +265,49 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) · 264 unmodified lines | ||
| 265 | 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 | + | |
| 280 | +u32 acpi_any_fixed_event_status_set(void) | |
| 281 | +{ | |
| 282 | + acpi_status status; | |
| 283 | + u32 in_status; | |
| 284 | + u32 in_enable; | |
| 285 | + u32 i; | |
| 286 | + | |
| 287 | + status = acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &in_enable); | |
| 288 | + if (ACPI_FAILURE(status)) { | |
| 289 | + return (FALSE); | |
| 290 | + } | |
| 291 | + | |
| 292 | + status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &in_status); | |
| 293 | + if (ACPI_FAILURE(status)) { | |
| 294 | + return (FALSE); | |
| 295 | + } | |
| 296 | + | |
| 297 | + /* | |
| 298 | + * Check for all possible Fixed Events and dispatch those that are active | |
| 299 | + */ | |
| 300 | + for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { | |
| 301 | + | |
| 302 | + /* Both the status and enable bits must be on for this event */ | |
| 303 | + | |
| 304 | + if ((in_status & acpi_gbl_fixed_event_info[i].status_bit_mask) && | |
| 305 | + (in_enable & acpi_gbl_fixed_event_info[i].enable_bit_mask)) { | |
| 306 | + return (TRUE); | |
| 307 | + } | |
| 308 | + } | |
| 309 | + | |
| 310 | + return (FALSE); | |
| 311 | +} | |
| 312 | + | |
| 268 | 313 | #endif /* !ACPI_REDUCED_HARDWARE */ |
| @@ -795,6 +795,38 @@ acpi_status acpi_enable_all_wakeup_gpes(void) · 794 unmodified lines | ||
| 795 | 795 | |
| 796 | 796 | ACPI_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 | + ******************************************************************************/ | |
| 810 | +u32 acpi_any_gpe_status_set(void) | |
| 811 | +{ | |
| 812 | + acpi_status status; | |
| 813 | + u8 ret; | |
| 814 | + | |
| 815 | + ACPI_FUNCTION_TRACE(acpi_any_gpe_status_set); | |
| 816 | + | |
| 817 | + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | |
| 818 | + if (ACPI_FAILURE(status)) { | |
| 819 | + return (FALSE); | |
| 820 | + } | |
| 821 | + | |
| 822 | + ret = acpi_hw_check_all_gpes(); | |
| 823 | + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); | |
| 824 | + | |
| 825 | + return (ret); | |
| 826 | +} | |
| 827 | + | |
| 828 | +ACPI_EXPORT_SYMBOL(acpi_any_gpe_status_set) | |
| 829 | + | |
| 798 | 830 | /******************************************************************************* |
| 799 | 831 | * |
| 800 | 832 | * FUNCTION: acpi_install_gpe_block |
| @@ -444,6 +444,53 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, · 443 unmodified lines | ||
| 444 | 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 | + | |
| 460 | +static acpi_status | |
| 461 | +acpi_hw_get_gpe_block_status(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |
| 462 | + struct acpi_gpe_block_info *gpe_block, | |
| 463 | + void *ret_ptr) | |
| 464 | +{ | |
| 465 | + struct acpi_gpe_register_info *gpe_register_info; | |
| 466 | + u64 in_enable, in_status; | |
| 467 | + acpi_status status; | |
| 468 | + u8 *ret = ret_ptr; | |
| 469 | + u32 i; | |
| 470 | + | |
| 471 | + /* Examine each GPE Register within the block */ | |
| 472 | + | |
| 473 | + for (i = 0; i < gpe_block->register_count; i++) { | |
| 474 | + gpe_register_info = &gpe_block->register_info[i]; | |
| 475 | + | |
| 476 | + status = acpi_hw_read(&in_enable, | |
| 477 | + &gpe_register_info->enable_address); | |
| 478 | + if (ACPI_FAILURE(status)) { | |
| 479 | + continue; | |
| 480 | + } | |
| 481 | + | |
| 482 | + status = acpi_hw_read(&in_status, | |
| 483 | + &gpe_register_info->status_address); | |
| 484 | + if (ACPI_FAILURE(status)) { | |
| 485 | + continue; | |
| 486 | + } | |
| 487 | + | |
| 488 | + *ret |= in_enable & in_status; | |
| 489 | + } | |
| 490 | + | |
| 491 | + return (AE_OK); | |
| 492 | +} | |
| 493 | + | |
| 447 | 494 | /****************************************************************************** |
| 448 | 495 | * |
| 449 | 496 | * FUNCTION: acpi_hw_disable_all_gpes |
| @@ -510,4 +557,28 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void) · 60 unmodified lines | ||
| 510 | 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 | + | |
| 573 | +u8 acpi_hw_check_all_gpes(void) | |
| 574 | +{ | |
| 575 | + u8 ret = 0; | |
| 576 | + | |
| 577 | + ACPI_FUNCTION_TRACE(acpi_hw_check_all_gpes); | |
| 578 | + | |
| 579 | + (void)acpi_ev_walk_gpe_list(acpi_hw_get_gpe_block_status, &ret); | |
| 580 | + | |
| 581 | + return (ret != 0); | |
| 582 | +} | |
| 583 | + | |
| 513 | 584 | #endif /* !ACPI_REDUCED_HARDWARE */ |
| @@ -179,6 +179,7 @@ EXPORT_SYMBOL(first_ec); · 178 unmodified lines | ||
| 179 | 179 | |
| 180 | 180 | static struct acpi_ec *boot_ec; |
| 181 | 181 | static bool boot_ec_is_ecdt = false; |
| 182 | +static struct workqueue_struct *ec_wq; | |
| 182 | 183 | static struct workqueue_struct *ec_query_wq; |
| 183 | 184 | |
| 184 | 185 | static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ |
| @@ -469,7 +470,7 @@ static void acpi_ec_submit_query(struct acpi_ec *ec) · 284 unmodified lines | ||
| 469 | 470 | ec_dbg_evt("Command(%s) submitted/blocked", |
| 470 | 471 | acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); |
| 471 | 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 | 536 | #ifdef CONFIG_PM_SLEEP |
| 536 | 537 | static void __acpi_ec_flush_work(void) |
| 537 | 538 | { |
| 538 | − flush_scheduled_work(); /* flush ec->work */ | |
| 539 | + drain_workqueue(ec_wq); /* flush ec->work */ | |
| 539 | 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 | |
| 557 | 558 | void acpi_ec_flush_work(void) |
| 558 | 559 | { |
| 559 | − /* Without ec_query_wq there is nothing to flush. */ | |
| 560 | − if (!ec_query_wq) | |
| 560 | + /* Without ec_wq there is nothing to flush. */ | |
| 561 | + if (!ec_wq) | |
| 561 | 562 | return; |
| 562 | 563 | |
| 563 | 564 | __acpi_ec_flush_work(); |
| @@ -2107,25 +2108,33 @@ static struct acpi_driver acpi_ec_driver = { · 1543 unmodified lines | ||
| 2107 | 2108 | .drv.pm = &acpi_ec_pm, |
| 2108 | 2109 | }; |
| 2109 | 2110 | |
| 2110 | −static inline int acpi_ec_query_init(void) | |
| 2111 | +static void acpi_ec_destroy_workqueues(void) | |
| 2111 | 2112 | { |
| 2112 | − if (!ec_query_wq) { | |
| 2113 | − ec_query_wq = alloc_workqueue("kec_query", 0, | |
| 2114 | − ec_max_queries); | |
| 2115 | − if (!ec_query_wq) | |
| 2116 | − return -ENODEV; | |
| 2113 | + if (ec_wq) { | |
| 2114 | + destroy_workqueue(ec_wq); | |
| 2115 | + ec_wq = NULL; | |
| 2117 | 2116 | } |
| 2118 | − return 0; | |
| 2119 | −} | |
| 2120 | − | |
| 2121 | −static inline void acpi_ec_query_exit(void) | |
| 2122 | −{ | |
| 2123 | 2117 | if (ec_query_wq) { |
| 2124 | 2118 | destroy_workqueue(ec_query_wq); |
| 2125 | 2119 | ec_query_wq = NULL; |
| 2126 | 2120 | } |
| 2127 | 2121 | } |
| 2128 | 2122 | |
| 2123 | +static int acpi_ec_init_workqueues(void) | |
| 2124 | +{ | |
| 2125 | + if (!ec_wq) | |
| 2126 | + ec_wq = alloc_ordered_workqueue("kec", 0); | |
| 2127 | + | |
| 2128 | + if (!ec_query_wq) | |
| 2129 | + ec_query_wq = alloc_workqueue("kec_query", 0, ec_max_queries); | |
| 2130 | + | |
| 2131 | + if (!ec_wq || !ec_query_wq) { | |
| 2132 | + acpi_ec_destroy_workqueues(); | |
| 2133 | + return -ENODEV; | |
| 2134 | + } | |
| 2135 | + return 0; | |
| 2136 | +} | |
| 2137 | + | |
| 2129 | 2138 | static const struct dmi_system_id acpi_ec_no_wakeup[] = { |
| 2130 | 2139 | { |
| 2131 | 2140 | .ident = "Thinkpad X1 Carbon 6th", |
| @@ -2156,8 +2165,7 @@ int __init acpi_ec_init(void) · 24 unmodified lines | ||
| 2156 | 2165 | int result; |
| 2157 | 2166 | int ecdt_fail, dsdt_fail; |
| 2158 | 2167 | |
| 2159 | − /* register workqueue for _Qxx evaluations */ | |
| 2160 | − result = acpi_ec_query_init(); | |
| 2168 | + result = acpi_ec_init_workqueues(); | |
| 2161 | 2169 | if (result) |
| 2162 | 2170 | return result; |
| 2163 | 2171 | |
| @@ -2188,6 +2196,6 @@ static void __exit acpi_ec_exit(void) · 24 unmodified lines | ||
| 2188 | 2196 | { |
| 2189 | 2197 | |
| 2190 | 2198 | acpi_bus_unregister_driver(&acpi_ec_driver); |
| 2191 | − acpi_ec_query_exit(); | |
| 2199 | + acpi_ec_destroy_workqueues(); | |
| 2192 | 2200 | } |
| 2193 | 2201 | #endif /* 0 */ |
| @@ -990,21 +990,41 @@ static void acpi_s2idle_sync(void) · 989 unmodified lines | ||
| 990 | 990 | acpi_os_wait_events_complete(); /* synchronize Notify handling */ |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | −static void acpi_s2idle_wake(void) | |
| 993 | +static bool acpi_s2idle_wake(void) | |
| 994 | 994 | { |
| 995 | − /* | |
| 996 | − * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the SCI has | |
| 997 | − * not triggered while suspended, so bail out. | |
| 998 | − */ | |
| 999 | − if (!acpi_sci_irq_valid() || | |
| 1000 | − irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) | |
| 1001 | − return; | |
| 995 | + if (!acpi_sci_irq_valid()) | |
| 996 | + return pm_wakeup_pending(); | |
| 997 | + | |
| 998 | + while (pm_wakeup_pending()) { | |
| 999 | + /* | |
| 1000 | + * If IRQD_WAKEUP_ARMED is set for the SCI at this point, the | |
| 1001 | + * SCI has not triggered while suspended, so bail out (the | |
| 1002 | + * wakeup is pending anyway and the SCI is not the source of | |
| 1003 | + * it). | |
| 1004 | + */ | |
| 1005 | + if (irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) | |
| 1006 | + return true; | |
49 more lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
File renamed without changes.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 67 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 113 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 207 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 163 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 602 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 294 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 203 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 116 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 100 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 70 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 103 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 143 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 106 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 89 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 151 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 88 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 216 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 131 lines aren’t shown here.
This diff is large: its 106 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 209 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 570 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 206 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 630 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 485 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 183 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 358 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 344 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 83 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 142 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 266 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 296 lines aren’t shown here.
This diff is large: its 1150 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 90 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 115 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 125 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 86 lines aren’t shown here.
This diff is large: its 102 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 66 lines aren’t shown here.
This diff is large: its 127 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 208 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 74 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 90 lines aren’t shown here.
This diff is large: its 153 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 135 lines aren’t shown here.
This diff is large: its 303 lines aren’t shown here.
This diff is large: its 273 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 1164 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 113 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 243 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 94 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 173 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 156 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 144 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 123 lines aren’t shown here.
This diff is large: its 160 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 125 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 66 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 126 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 336 lines aren’t shown here.
This diff is large: its 114 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 425 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 132 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 102 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 189 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 109 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 1139 lines aren’t shown here.
This diff is large: its 238 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 67 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 735 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 210 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 192 lines aren’t shown here.
This diff is large: its 4 lines aren’t shown here.
This diff is large: its 4 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 318 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 156 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 97 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 303 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 298 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 162 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 143 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 83 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.