diff options
| author | Marc Zyngier <marc.zyngier@arm.com> | 2013-04-02 12:46:31 -0400 |
|---|---|---|
| committer | Marc Zyngier <marc.zyngier@arm.com> | 2013-06-12 11:42:19 -0400 |
| commit | 379e04c79e8a9ded8a202f1e266f0c5830185bea (patch) | |
| tree | 09dfa9d3bb03413329924fe4a077a3811a684891 /Documentation/virtual | |
| parent | 0d854a60b1d7d39a37b25dd28f63cfa0df637b91 (diff) | |
arm64: KVM: userspace API documentation
Unsurprisingly, the arm64 userspace API is extremely similar to
the 32bit one, the only significant difference being the ONE_REG
register mapping.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'Documentation/virtual')
| -rw-r--r-- | Documentation/virtual/kvm/api.txt | 58 |
1 files changed, 39 insertions, 19 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 5f91eda91647..9bfadeb8be31 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
| @@ -280,7 +280,7 @@ kvm_run' (see below). | |||
| 280 | 4.11 KVM_GET_REGS | 280 | 4.11 KVM_GET_REGS |
| 281 | 281 | ||
| 282 | Capability: basic | 282 | Capability: basic |
| 283 | Architectures: all except ARM | 283 | Architectures: all except ARM, arm64 |
| 284 | Type: vcpu ioctl | 284 | Type: vcpu ioctl |
| 285 | Parameters: struct kvm_regs (out) | 285 | Parameters: struct kvm_regs (out) |
| 286 | Returns: 0 on success, -1 on error | 286 | Returns: 0 on success, -1 on error |
| @@ -301,7 +301,7 @@ struct kvm_regs { | |||
| 301 | 4.12 KVM_SET_REGS | 301 | 4.12 KVM_SET_REGS |
| 302 | 302 | ||
| 303 | Capability: basic | 303 | Capability: basic |
| 304 | Architectures: all except ARM | 304 | Architectures: all except ARM, arm64 |
| 305 | Type: vcpu ioctl | 305 | Type: vcpu ioctl |
| 306 | Parameters: struct kvm_regs (in) | 306 | Parameters: struct kvm_regs (in) |
| 307 | Returns: 0 on success, -1 on error | 307 | Returns: 0 on success, -1 on error |
| @@ -587,7 +587,7 @@ struct kvm_fpu { | |||
| 587 | 4.24 KVM_CREATE_IRQCHIP | 587 | 4.24 KVM_CREATE_IRQCHIP |
| 588 | 588 | ||
| 589 | Capability: KVM_CAP_IRQCHIP | 589 | Capability: KVM_CAP_IRQCHIP |
| 590 | Architectures: x86, ia64, ARM | 590 | Architectures: x86, ia64, ARM, arm64 |
| 591 | Type: vm ioctl | 591 | Type: vm ioctl |
| 592 | Parameters: none | 592 | Parameters: none |
| 593 | Returns: 0 on success, -1 on error | 593 | Returns: 0 on success, -1 on error |
| @@ -595,14 +595,14 @@ Returns: 0 on success, -1 on error | |||
| 595 | Creates an interrupt controller model in the kernel. On x86, creates a virtual | 595 | Creates an interrupt controller model in the kernel. On x86, creates a virtual |
| 596 | ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a | 596 | ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a |
| 597 | local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 | 597 | local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 |
| 598 | only go to the IOAPIC. On ia64, a IOSAPIC is created. On ARM, a GIC is | 598 | only go to the IOAPIC. On ia64, a IOSAPIC is created. On ARM/arm64, a GIC is |
| 599 | created. | 599 | created. |
| 600 | 600 | ||
| 601 | 601 | ||
| 602 | 4.25 KVM_IRQ_LINE | 602 | 4.25 KVM_IRQ_LINE |
| 603 | 603 | ||
| 604 | Capability: KVM_CAP_IRQCHIP | 604 | Capability: KVM_CAP_IRQCHIP |
| 605 | Architectures: x86, ia64, arm | 605 | Architectures: x86, ia64, arm, arm64 |
| 606 | Type: vm ioctl | 606 | Type: vm ioctl |
| 607 | Parameters: struct kvm_irq_level | 607 | Parameters: struct kvm_irq_level |
| 608 | Returns: 0 on success, -1 on error | 608 | Returns: 0 on success, -1 on error |
| @@ -612,9 +612,10 @@ On some architectures it is required that an interrupt controller model has | |||
| 612 | been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered | 612 | been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered |
| 613 | interrupts require the level to be set to 1 and then back to 0. | 613 | interrupts require the level to be set to 1 and then back to 0. |
| 614 | 614 | ||
| 615 | ARM can signal an interrupt either at the CPU level, or at the in-kernel irqchip | 615 | ARM/arm64 can signal an interrupt either at the CPU level, or at the |
| 616 | (GIC), and for in-kernel irqchip can tell the GIC to use PPIs designated for | 616 | in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to |
| 617 | specific cpus. The irq field is interpreted like this: | 617 | use PPIs designated for specific cpus. The irq field is interpreted |
| 618 | like this: | ||
| 618 | 619 | ||
| 619 | bits: | 31 ... 24 | 23 ... 16 | 15 ... 0 | | 620 | bits: | 31 ... 24 | 23 ... 16 | 15 ... 0 | |
| 620 | field: | irq_type | vcpu_index | irq_id | | 621 | field: | irq_type | vcpu_index | irq_id | |
| @@ -1831,6 +1832,22 @@ ARM 32-bit VFP control registers have the following id bit patterns: | |||
| 1831 | ARM 64-bit FP registers have the following id bit patterns: | 1832 | ARM 64-bit FP registers have the following id bit patterns: |
| 1832 | 0x4030 0000 0012 0 <regno:12> | 1833 | 0x4030 0000 0012 0 <regno:12> |
| 1833 | 1834 | ||
| 1835 | |||
| 1836 | arm64 registers are mapped using the lower 32 bits. The upper 16 of | ||
| 1837 | that is the register group type, or coprocessor number: | ||
| 1838 | |||
| 1839 | arm64 core/FP-SIMD registers have the following id bit patterns. Note | ||
| 1840 | that the size of the access is variable, as the kvm_regs structure | ||
| 1841 | contains elements ranging from 32 to 128 bits. The index is a 32bit | ||
| 1842 | value in the kvm_regs structure seen as a 32bit array. | ||
| 1843 | 0x60x0 0000 0010 <index into the kvm_regs struct:16> | ||
| 1844 | |||
| 1845 | arm64 CCSIDR registers are demultiplexed by CSSELR value: | ||
| 1846 | 0x6020 0000 0011 00 <csselr:8> | ||
| 1847 | |||
| 1848 | arm64 system registers have the following id bit patterns: | ||
| 1849 | 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3> | ||
| 1850 | |||
| 1834 | 4.69 KVM_GET_ONE_REG | 1851 | 4.69 KVM_GET_ONE_REG |
| 1835 | 1852 | ||
| 1836 | Capability: KVM_CAP_ONE_REG | 1853 | Capability: KVM_CAP_ONE_REG |
| @@ -2264,7 +2281,7 @@ current state. "addr" is ignored. | |||
| 2264 | 4.77 KVM_ARM_VCPU_INIT | 2281 | 4.77 KVM_ARM_VCPU_INIT |
| 2265 | 2282 | ||
| 2266 | Capability: basic | 2283 | Capability: basic |
| 2267 | Architectures: arm | 2284 | Architectures: arm, arm64 |
| 2268 | Type: vcpu ioctl | 2285 | Type: vcpu ioctl |
| 2269 | Parameters: struct struct kvm_vcpu_init (in) | 2286 | Parameters: struct struct kvm_vcpu_init (in) |
| 2270 | Returns: 0 on success; -1 on error | 2287 | Returns: 0 on success; -1 on error |
| @@ -2283,12 +2300,14 @@ should be created before this ioctl is invoked. | |||
| 2283 | Possible features: | 2300 | Possible features: |
| 2284 | - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. | 2301 | - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. |
| 2285 | Depends on KVM_CAP_ARM_PSCI. | 2302 | Depends on KVM_CAP_ARM_PSCI. |
| 2303 | - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode. | ||
| 2304 | Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only). | ||
| 2286 | 2305 | ||
| 2287 | 2306 | ||
| 2288 | 4.78 KVM_GET_REG_LIST | 2307 | 4.78 KVM_GET_REG_LIST |
| 2289 | 2308 | ||
| 2290 | Capability: basic | 2309 | Capability: basic |
| 2291 | Architectures: arm | 2310 | Architectures: arm, arm64 |
| 2292 | Type: vcpu ioctl | 2311 | Type: vcpu ioctl |
| 2293 | Parameters: struct kvm_reg_list (in/out) | 2312 | Parameters: struct kvm_reg_list (in/out) |
| 2294 | Returns: 0 on success; -1 on error | 2313 | Returns: 0 on success; -1 on error |
| @@ -2308,7 +2327,7 @@ KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. | |||
| 2308 | 4.80 KVM_ARM_SET_DEVICE_ADDR | 2327 | 4.80 KVM_ARM_SET_DEVICE_ADDR |
| 2309 | 2328 | ||
| 2310 | Capability: KVM_CAP_ARM_SET_DEVICE_ADDR | 2329 | Capability: KVM_CAP_ARM_SET_DEVICE_ADDR |
| 2311 | Architectures: arm | 2330 | Architectures: arm, arm64 |
| 2312 | Type: vm ioctl | 2331 | Type: vm ioctl |
| 2313 | Parameters: struct kvm_arm_device_address (in) | 2332 | Parameters: struct kvm_arm_device_address (in) |
| 2314 | Returns: 0 on success, -1 on error | 2333 | Returns: 0 on success, -1 on error |
| @@ -2329,18 +2348,19 @@ can access emulated or directly exposed devices, which the host kernel needs | |||
| 2329 | to know about. The id field is an architecture specific identifier for a | 2348 | to know about. The id field is an architecture specific identifier for a |
| 2330 | specific device. | 2349 | specific device. |
| 2331 | 2350 | ||
| 2332 | ARM divides the id field into two parts, a device id and an address type id | 2351 | ARM/arm64 divides the id field into two parts, a device id and an |
| 2333 | specific to the individual device. | 2352 | address type id specific to the individual device. |
| 2334 | 2353 | ||
| 2335 | bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 | | 2354 | bits: | 63 ... 32 | 31 ... 16 | 15 ... 0 | |
| 2336 | field: | 0x00000000 | device id | addr type id | | 2355 | field: | 0x00000000 | device id | addr type id | |
| 2337 | 2356 | ||
| 2338 | ARM currently only require this when using the in-kernel GIC support for the | 2357 | ARM/arm64 currently only require this when using the in-kernel GIC |
| 2339 | hardware VGIC features, using KVM_ARM_DEVICE_VGIC_V2 as the device id. When | 2358 | support for the hardware VGIC features, using KVM_ARM_DEVICE_VGIC_V2 |
| 2340 | setting the base address for the guest's mapping of the VGIC virtual CPU | 2359 | as the device id. When setting the base address for the guest's |
| 2341 | and distributor interface, the ioctl must be called after calling | 2360 | mapping of the VGIC virtual CPU and distributor interface, the ioctl |
| 2342 | KVM_CREATE_IRQCHIP, but before calling KVM_RUN on any of the VCPUs. Calling | 2361 | must be called after calling KVM_CREATE_IRQCHIP, but before calling |
| 2343 | this ioctl twice for any of the base addresses will return -EEXIST. | 2362 | KVM_RUN on any of the VCPUs. Calling this ioctl twice for any of the |
| 2363 | base addresses will return -EEXIST. | ||
| 2344 | 2364 | ||
| 2345 | 4.82 KVM_PPC_RTAS_DEFINE_TOKEN | 2365 | 4.82 KVM_PPC_RTAS_DEFINE_TOKEN |
| 2346 | 2366 | ||
