diff options
author | Olof Johansson <olof@lixom.net> | 2013-02-11 12:02:53 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-02-11 12:02:53 -0500 |
commit | 655e194cfee8ba89634228f97f1310df41b45cbb (patch) | |
tree | 85989f9f14ad53a3797ab5c70093a8181399e669 /Documentation | |
parent | 1e044f0490c9d9f26ebcdd3dc63e02790b798821 (diff) | |
parent | da141b67d29a05267a9a0d56bd7856b7f3f58d44 (diff) |
Merge branch 'for-rmk/virt/kvm/core' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into next/virt
* 'for-rmk/virt/kvm/core' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux:
KVM: ARM: Add maintainer entry for KVM/ARM
KVM: ARM: Power State Coordination Interface implementation
KVM: ARM: Handle I/O aborts
KVM: ARM: Handle guest faults in KVM
KVM: ARM: VFP userspace interface
KVM: ARM: Demux CCSIDR in the userspace API
KVM: ARM: User space API for getting/setting co-proc registers
KVM: ARM: Emulation framework and CP15 emulation
KVM: ARM: World-switch implementation
KVM: ARM: Inject IRQs and FIQs from userspace
KVM: ARM: Memory virtualization setup
KVM: ARM: Hypervisor initialization
KVM: ARM: Initial skeleton to compile KVM support
ARM: Section based HYP idmap
ARM: Add page table and page defines needed by KVM
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 99 |
1 files changed, 91 insertions, 8 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index a4df5535996b..c25439a58274 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -293,7 +293,7 @@ kvm_run' (see below). | |||
293 | 4.11 KVM_GET_REGS | 293 | 4.11 KVM_GET_REGS |
294 | 294 | ||
295 | Capability: basic | 295 | Capability: basic |
296 | Architectures: all | 296 | Architectures: all except ARM |
297 | Type: vcpu ioctl | 297 | Type: vcpu ioctl |
298 | Parameters: struct kvm_regs (out) | 298 | Parameters: struct kvm_regs (out) |
299 | Returns: 0 on success, -1 on error | 299 | Returns: 0 on success, -1 on error |
@@ -314,7 +314,7 @@ struct kvm_regs { | |||
314 | 4.12 KVM_SET_REGS | 314 | 4.12 KVM_SET_REGS |
315 | 315 | ||
316 | Capability: basic | 316 | Capability: basic |
317 | Architectures: all | 317 | Architectures: all except ARM |
318 | Type: vcpu ioctl | 318 | Type: vcpu ioctl |
319 | Parameters: struct kvm_regs (in) | 319 | Parameters: struct kvm_regs (in) |
320 | Returns: 0 on success, -1 on error | 320 | Returns: 0 on success, -1 on error |
@@ -600,7 +600,7 @@ struct kvm_fpu { | |||
600 | 4.24 KVM_CREATE_IRQCHIP | 600 | 4.24 KVM_CREATE_IRQCHIP |
601 | 601 | ||
602 | Capability: KVM_CAP_IRQCHIP | 602 | Capability: KVM_CAP_IRQCHIP |
603 | Architectures: x86, ia64 | 603 | Architectures: x86, ia64, ARM |
604 | Type: vm ioctl | 604 | Type: vm ioctl |
605 | Parameters: none | 605 | Parameters: none |
606 | Returns: 0 on success, -1 on error | 606 | Returns: 0 on success, -1 on error |
@@ -608,21 +608,39 @@ Returns: 0 on success, -1 on error | |||
608 | Creates an interrupt controller model in the kernel. On x86, creates a virtual | 608 | Creates an interrupt controller model in the kernel. On x86, creates a virtual |
609 | ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a | 609 | ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a |
610 | local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 | 610 | local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23 |
611 | only go to the IOAPIC. On ia64, a IOSAPIC is created. | 611 | only go to the IOAPIC. On ia64, a IOSAPIC is created. On ARM, a GIC is |
612 | created. | ||
612 | 613 | ||
613 | 614 | ||
614 | 4.25 KVM_IRQ_LINE | 615 | 4.25 KVM_IRQ_LINE |
615 | 616 | ||
616 | Capability: KVM_CAP_IRQCHIP | 617 | Capability: KVM_CAP_IRQCHIP |
617 | Architectures: x86, ia64 | 618 | Architectures: x86, ia64, arm |
618 | Type: vm ioctl | 619 | Type: vm ioctl |
619 | Parameters: struct kvm_irq_level | 620 | Parameters: struct kvm_irq_level |
620 | Returns: 0 on success, -1 on error | 621 | Returns: 0 on success, -1 on error |
621 | 622 | ||
622 | Sets the level of a GSI input to the interrupt controller model in the kernel. | 623 | Sets the level of a GSI input to the interrupt controller model in the kernel. |
623 | Requires that an interrupt controller model has been previously created with | 624 | On some architectures it is required that an interrupt controller model has |
624 | KVM_CREATE_IRQCHIP. Note that edge-triggered interrupts require the level | 625 | been previously created with KVM_CREATE_IRQCHIP. Note that edge-triggered |
625 | to be set to 1 and then back to 0. | 626 | interrupts require the level to be set to 1 and then back to 0. |
627 | |||
628 | ARM can signal an interrupt either at the CPU level, or at the in-kernel irqchip | ||
629 | (GIC), and for in-kernel irqchip can tell the GIC to use PPIs designated for | ||
630 | specific cpus. The irq field is interpreted like this: | ||
631 | |||
632 | bits: | 31 ... 24 | 23 ... 16 | 15 ... 0 | | ||
633 | field: | irq_type | vcpu_index | irq_id | | ||
634 | |||
635 | The irq_type field has the following values: | ||
636 | - irq_type[0]: out-of-kernel GIC: irq_id 0 is IRQ, irq_id 1 is FIQ | ||
637 | - irq_type[1]: in-kernel GIC: SPI, irq_id between 32 and 1019 (incl.) | ||
638 | (the vcpu_index field is ignored) | ||
639 | - irq_type[2]: in-kernel GIC: PPI, irq_id between 16 and 31 (incl.) | ||
640 | |||
641 | (The irq_id field thus corresponds nicely to the IRQ ID in the ARM GIC specs) | ||
642 | |||
643 | In both cases, level is used to raise/lower the line. | ||
626 | 644 | ||
627 | struct kvm_irq_level { | 645 | struct kvm_irq_level { |
628 | union { | 646 | union { |
@@ -1775,6 +1793,27 @@ registers, find a list below: | |||
1775 | PPC | KVM_REG_PPC_VPA_DTL | 128 | 1793 | PPC | KVM_REG_PPC_VPA_DTL | 128 |
1776 | PPC | KVM_REG_PPC_EPCR | 32 | 1794 | PPC | KVM_REG_PPC_EPCR | 32 |
1777 | 1795 | ||
1796 | ARM registers are mapped using the lower 32 bits. The upper 16 of that | ||
1797 | is the register group type, or coprocessor number: | ||
1798 | |||
1799 | ARM core registers have the following id bit patterns: | ||
1800 | 0x4002 0000 0010 <index into the kvm_regs struct:16> | ||
1801 | |||
1802 | ARM 32-bit CP15 registers have the following id bit patterns: | ||
1803 | 0x4002 0000 000F <zero:1> <crn:4> <crm:4> <opc1:4> <opc2:3> | ||
1804 | |||
1805 | ARM 64-bit CP15 registers have the following id bit patterns: | ||
1806 | 0x4003 0000 000F <zero:1> <zero:4> <crm:4> <opc1:4> <zero:3> | ||
1807 | |||
1808 | ARM CCSIDR registers are demultiplexed by CSSELR value: | ||
1809 | 0x4002 0000 0011 00 <csselr:8> | ||
1810 | |||
1811 | ARM 32-bit VFP control registers have the following id bit patterns: | ||
1812 | 0x4002 0000 0012 1 <regno:12> | ||
1813 | |||
1814 | ARM 64-bit FP registers have the following id bit patterns: | ||
1815 | 0x4002 0000 0012 0 <regno:12> | ||
1816 | |||
1778 | 4.69 KVM_GET_ONE_REG | 1817 | 4.69 KVM_GET_ONE_REG |
1779 | 1818 | ||
1780 | Capability: KVM_CAP_ONE_REG | 1819 | Capability: KVM_CAP_ONE_REG |
@@ -2127,6 +2166,50 @@ written, then `n_invalid' invalid entries, invalidating any previously | |||
2127 | valid entries found. | 2166 | valid entries found. |
2128 | 2167 | ||
2129 | 2168 | ||
2169 | 4.77 KVM_ARM_VCPU_INIT | ||
2170 | |||
2171 | Capability: basic | ||
2172 | Architectures: arm | ||
2173 | Type: vcpu ioctl | ||
2174 | Parameters: struct struct kvm_vcpu_init (in) | ||
2175 | Returns: 0 on success; -1 on error | ||
2176 | Errors: | ||
2177 | EINVAL: the target is unknown, or the combination of features is invalid. | ||
2178 | ENOENT: a features bit specified is unknown. | ||
2179 | |||
2180 | This tells KVM what type of CPU to present to the guest, and what | ||
2181 | optional features it should have. This will cause a reset of the cpu | ||
2182 | registers to their initial values. If this is not called, KVM_RUN will | ||
2183 | return ENOEXEC for that vcpu. | ||
2184 | |||
2185 | Note that because some registers reflect machine topology, all vcpus | ||
2186 | should be created before this ioctl is invoked. | ||
2187 | |||
2188 | Possible features: | ||
2189 | - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. | ||
2190 | Depends on KVM_CAP_ARM_PSCI. | ||
2191 | |||
2192 | |||
2193 | 4.78 KVM_GET_REG_LIST | ||
2194 | |||
2195 | Capability: basic | ||
2196 | Architectures: arm | ||
2197 | Type: vcpu ioctl | ||
2198 | Parameters: struct kvm_reg_list (in/out) | ||
2199 | Returns: 0 on success; -1 on error | ||
2200 | Errors: | ||
2201 | E2BIG: the reg index list is too big to fit in the array specified by | ||
2202 | the user (the number required will be written into n). | ||
2203 | |||
2204 | struct kvm_reg_list { | ||
2205 | __u64 n; /* number of registers in reg[] */ | ||
2206 | __u64 reg[0]; | ||
2207 | }; | ||
2208 | |||
2209 | This ioctl returns the guest registers that are supported for the | ||
2210 | KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. | ||
2211 | |||
2212 | |||
2130 | 5. The kvm_run structure | 2213 | 5. The kvm_run structure |
2131 | ------------------------ | 2214 | ------------------------ |
2132 | 2215 | ||