aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual/kvm/api.txt
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2013-04-02 12:46:31 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2013-06-12 11:42:19 -0400
commit379e04c79e8a9ded8a202f1e266f0c5830185bea (patch)
tree09dfa9d3bb03413329924fe4a077a3811a684891 /Documentation/virtual/kvm/api.txt
parent0d854a60b1d7d39a37b25dd28f63cfa0df637b91 (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/kvm/api.txt')
-rw-r--r--Documentation/virtual/kvm/api.txt58
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).
2804.11 KVM_GET_REGS 2804.11 KVM_GET_REGS
281 281
282Capability: basic 282Capability: basic
283Architectures: all except ARM 283Architectures: all except ARM, arm64
284Type: vcpu ioctl 284Type: vcpu ioctl
285Parameters: struct kvm_regs (out) 285Parameters: struct kvm_regs (out)
286Returns: 0 on success, -1 on error 286Returns: 0 on success, -1 on error
@@ -301,7 +301,7 @@ struct kvm_regs {
3014.12 KVM_SET_REGS 3014.12 KVM_SET_REGS
302 302
303Capability: basic 303Capability: basic
304Architectures: all except ARM 304Architectures: all except ARM, arm64
305Type: vcpu ioctl 305Type: vcpu ioctl
306Parameters: struct kvm_regs (in) 306Parameters: struct kvm_regs (in)
307Returns: 0 on success, -1 on error 307Returns: 0 on success, -1 on error
@@ -587,7 +587,7 @@ struct kvm_fpu {
5874.24 KVM_CREATE_IRQCHIP 5874.24 KVM_CREATE_IRQCHIP
588 588
589Capability: KVM_CAP_IRQCHIP 589Capability: KVM_CAP_IRQCHIP
590Architectures: x86, ia64, ARM 590Architectures: x86, ia64, ARM, arm64
591Type: vm ioctl 591Type: vm ioctl
592Parameters: none 592Parameters: none
593Returns: 0 on success, -1 on error 593Returns: 0 on success, -1 on error
@@ -595,14 +595,14 @@ Returns: 0 on success, -1 on error
595Creates an interrupt controller model in the kernel. On x86, creates a virtual 595Creates an interrupt controller model in the kernel. On x86, creates a virtual
596ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a 596ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a
597local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 597local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23
598only go to the IOAPIC. On ia64, a IOSAPIC is created. On ARM, a GIC is 598only go to the IOAPIC. On ia64, a IOSAPIC is created. On ARM/arm64, a GIC is
599created. 599created.
600 600
601 601
6024.25 KVM_IRQ_LINE 6024.25 KVM_IRQ_LINE
603 603
604Capability: KVM_CAP_IRQCHIP 604Capability: KVM_CAP_IRQCHIP
605Architectures: x86, ia64, arm 605Architectures: x86, ia64, arm, arm64
606Type: vm ioctl 606Type: vm ioctl
607Parameters: struct kvm_irq_level 607Parameters: struct kvm_irq_level
608Returns: 0 on success, -1 on error 608Returns: 0 on success, -1 on error
@@ -612,9 +612,10 @@ On some architectures it is required that an interrupt controller model has
612been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered 612been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered
613interrupts require the level to be set to 1 and then back to 0. 613interrupts require the level to be set to 1 and then back to 0.
614 614
615ARM can signal an interrupt either at the CPU level, or at the in-kernel irqchip 615ARM/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 616in-kernel irqchip (GIC), and for in-kernel irqchip can tell the GIC to
617specific cpus. The irq field is interpreted like this: 617use PPIs designated for specific cpus. The irq field is interpreted
618like 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:
1831ARM 64-bit FP registers have the following id bit patterns: 1832ARM 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
1836arm64 registers are mapped using the lower 32 bits. The upper 16 of
1837that is the register group type, or coprocessor number:
1838
1839arm64 core/FP-SIMD registers have the following id bit patterns. Note
1840that the size of the access is variable, as the kvm_regs structure
1841contains elements ranging from 32 to 128 bits. The index is a 32bit
1842value in the kvm_regs structure seen as a 32bit array.
1843 0x60x0 0000 0010 <index into the kvm_regs struct:16>
1844
1845arm64 CCSIDR registers are demultiplexed by CSSELR value:
1846 0x6020 0000 0011 00 <csselr:8>
1847
1848arm64 system registers have the following id bit patterns:
1849 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>
1850
18344.69 KVM_GET_ONE_REG 18514.69 KVM_GET_ONE_REG
1835 1852
1836Capability: KVM_CAP_ONE_REG 1853Capability: KVM_CAP_ONE_REG
@@ -2264,7 +2281,7 @@ current state. "addr" is ignored.
22644.77 KVM_ARM_VCPU_INIT 22814.77 KVM_ARM_VCPU_INIT
2265 2282
2266Capability: basic 2283Capability: basic
2267Architectures: arm 2284Architectures: arm, arm64
2268Type: vcpu ioctl 2285Type: vcpu ioctl
2269Parameters: struct struct kvm_vcpu_init (in) 2286Parameters: struct struct kvm_vcpu_init (in)
2270Returns: 0 on success; -1 on error 2287Returns: 0 on success; -1 on error
@@ -2283,12 +2300,14 @@ should be created before this ioctl is invoked.
2283Possible features: 2300Possible 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
22884.78 KVM_GET_REG_LIST 23074.78 KVM_GET_REG_LIST
2289 2308
2290Capability: basic 2309Capability: basic
2291Architectures: arm 2310Architectures: arm, arm64
2292Type: vcpu ioctl 2311Type: vcpu ioctl
2293Parameters: struct kvm_reg_list (in/out) 2312Parameters: struct kvm_reg_list (in/out)
2294Returns: 0 on success; -1 on error 2313Returns: 0 on success; -1 on error
@@ -2308,7 +2327,7 @@ KVM_GET_ONE_REG/KVM_SET_ONE_REG calls.
23084.80 KVM_ARM_SET_DEVICE_ADDR 23274.80 KVM_ARM_SET_DEVICE_ADDR
2309 2328
2310Capability: KVM_CAP_ARM_SET_DEVICE_ADDR 2329Capability: KVM_CAP_ARM_SET_DEVICE_ADDR
2311Architectures: arm 2330Architectures: arm, arm64
2312Type: vm ioctl 2331Type: vm ioctl
2313Parameters: struct kvm_arm_device_address (in) 2332Parameters: struct kvm_arm_device_address (in)
2314Returns: 0 on success, -1 on error 2333Returns: 0 on success, -1 on error
@@ -2329,18 +2348,19 @@ can access emulated or directly exposed devices, which the host kernel needs
2329to know about. The id field is an architecture specific identifier for a 2348to know about. The id field is an architecture specific identifier for a
2330specific device. 2349specific device.
2331 2350
2332ARM divides the id field into two parts, a device id and an address type id 2351ARM/arm64 divides the id field into two parts, a device id and an
2333specific to the individual device. 2352address 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
2338ARM currently only require this when using the in-kernel GIC support for the 2357ARM/arm64 currently only require this when using the in-kernel GIC
2339hardware VGIC features, using KVM_ARM_DEVICE_VGIC_V2 as the device id. When 2358support for the hardware VGIC features, using KVM_ARM_DEVICE_VGIC_V2
2340setting the base address for the guest's mapping of the VGIC virtual CPU 2359as the device id. When setting the base address for the guest's
2341and distributor interface, the ioctl must be called after calling 2360mapping of the VGIC virtual CPU and distributor interface, the ioctl
2342KVM_CREATE_IRQCHIP, but before calling KVM_RUN on any of the VCPUs. Calling 2361must be called after calling KVM_CREATE_IRQCHIP, but before calling
2343this ioctl twice for any of the base addresses will return -EEXIST. 2362KVM_RUN on any of the VCPUs. Calling this ioctl twice for any of the
2363base addresses will return -EEXIST.
2344 2364
23454.82 KVM_PPC_RTAS_DEFINE_TOKEN 23654.82 KVM_PPC_RTAS_DEFINE_TOKEN
2346 2366