aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/virtual/kvm/api.txt22
-rw-r--r--arch/arm/include/asm/kvm_arm.h1
-rw-r--r--arch/arm/include/asm/kvm_host.h15
-rw-r--r--arch/arm/include/asm/kvm_mmio.h22
-rw-r--r--arch/arm/include/uapi/asm/kvm.h3
-rw-r--r--arch/arm/kernel/asm-offsets.c4
-rw-r--r--arch/arm/kvm/Kconfig30
-rw-r--r--arch/arm/kvm/Makefile12
-rw-r--r--arch/arm/kvm/arm.c45
-rw-r--r--arch/arm/kvm/guest.c18
-rw-r--r--arch/arm/kvm/interrupts_head.S8
-rw-r--r--arch/arm/kvm/mmio.c64
-rw-r--r--arch/arm/kvm/mmu.c134
-rw-r--r--arch/arm/kvm/trace.h48
-rw-r--r--arch/arm64/include/asm/esr.h1
-rw-r--r--arch/arm64/include/asm/kvm_arm.h1
-rw-r--r--arch/arm64/include/asm/kvm_host.h15
-rw-r--r--arch/arm64/include/asm/kvm_mmio.h22
-rw-r--r--arch/arm64/include/uapi/asm/kvm.h3
-rw-r--r--arch/arm64/kvm/Kconfig18
-rw-r--r--arch/arm64/kvm/Makefile20
-rw-r--r--arch/powerpc/kvm/mpic.c12
-rw-r--r--arch/powerpc/kvm/powerpc.c4
-rw-r--r--arch/s390/kvm/diag.c2
-rw-r--r--arch/x86/kvm/Makefile2
-rw-r--r--arch/x86/kvm/i8254.c14
-rw-r--r--arch/x86/kvm/i8254.h2
-rw-r--r--arch/x86/kvm/i8259.c12
-rw-r--r--arch/x86/kvm/ioapic.c8
-rw-r--r--arch/x86/kvm/ioapic.h2
-rw-r--r--arch/x86/kvm/irq.h2
-rw-r--r--arch/x86/kvm/lapic.c4
-rw-r--r--arch/x86/kvm/lapic.h2
-rw-r--r--arch/x86/kvm/vmx.c2
-rw-r--r--arch/x86/kvm/x86.c13
-rw-r--r--include/kvm/arm_arch_timer.h31
-rw-r--r--include/kvm/arm_vgic.h117
-rw-r--r--include/kvm/iodev.h (renamed from virt/kvm/iodev.h)28
-rw-r--r--include/linux/kvm_host.h24
-rw-r--r--virt/kvm/arm/arch_timer.c45
-rw-r--r--virt/kvm/arm/vgic-v2-emul.c71
-rw-r--r--virt/kvm/arm/vgic-v3-emul.c246
-rw-r--r--virt/kvm/arm/vgic.c479
-rw-r--r--virt/kvm/arm/vgic.h37
-rw-r--r--virt/kvm/coalesced_mmio.c7
-rw-r--r--virt/kvm/eventfd.c9
-rw-r--r--virt/kvm/kvm_main.c34
47 files changed, 1012 insertions, 703 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 1490eb0ef798..57d25fdd3d7e 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -997,7 +997,7 @@ for vm-wide capabilities.
9974.38 KVM_GET_MP_STATE 9974.38 KVM_GET_MP_STATE
998 998
999Capability: KVM_CAP_MP_STATE 999Capability: KVM_CAP_MP_STATE
1000Architectures: x86, s390 1000Architectures: x86, s390, arm, arm64
1001Type: vcpu ioctl 1001Type: vcpu ioctl
1002Parameters: struct kvm_mp_state (out) 1002Parameters: struct kvm_mp_state (out)
1003Returns: 0 on success; -1 on error 1003Returns: 0 on success; -1 on error
@@ -1011,7 +1011,7 @@ uniprocessor guests).
1011 1011
1012Possible values are: 1012Possible values are:
1013 1013
1014 - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86] 1014 - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86,arm/arm64]
1015 - KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP) 1015 - KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP)
1016 which has not yet received an INIT signal [x86] 1016 which has not yet received an INIT signal [x86]
1017 - KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is 1017 - KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is
@@ -1020,7 +1020,7 @@ Possible values are:
1020 is waiting for an interrupt [x86] 1020 is waiting for an interrupt [x86]
1021 - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector 1021 - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector
1022 accessible via KVM_GET_VCPU_EVENTS) [x86] 1022 accessible via KVM_GET_VCPU_EVENTS) [x86]
1023 - KVM_MP_STATE_STOPPED: the vcpu is stopped [s390] 1023 - KVM_MP_STATE_STOPPED: the vcpu is stopped [s390,arm/arm64]
1024 - KVM_MP_STATE_CHECK_STOP: the vcpu is in a special error state [s390] 1024 - KVM_MP_STATE_CHECK_STOP: the vcpu is in a special error state [s390]
1025 - KVM_MP_STATE_OPERATING: the vcpu is operating (running or halted) 1025 - KVM_MP_STATE_OPERATING: the vcpu is operating (running or halted)
1026 [s390] 1026 [s390]
@@ -1031,11 +1031,15 @@ On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
1031in-kernel irqchip, the multiprocessing state must be maintained by userspace on 1031in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1032these architectures. 1032these architectures.
1033 1033
1034For arm/arm64:
1035
1036The only states that are valid are KVM_MP_STATE_STOPPED and
1037KVM_MP_STATE_RUNNABLE which reflect if the vcpu is paused or not.
1034 1038
10354.39 KVM_SET_MP_STATE 10394.39 KVM_SET_MP_STATE
1036 1040
1037Capability: KVM_CAP_MP_STATE 1041Capability: KVM_CAP_MP_STATE
1038Architectures: x86, s390 1042Architectures: x86, s390, arm, arm64
1039Type: vcpu ioctl 1043Type: vcpu ioctl
1040Parameters: struct kvm_mp_state (in) 1044Parameters: struct kvm_mp_state (in)
1041Returns: 0 on success; -1 on error 1045Returns: 0 on success; -1 on error
@@ -1047,6 +1051,10 @@ On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
1047in-kernel irqchip, the multiprocessing state must be maintained by userspace on 1051in-kernel irqchip, the multiprocessing state must be maintained by userspace on
1048these architectures. 1052these architectures.
1049 1053
1054For arm/arm64:
1055
1056The only states that are valid are KVM_MP_STATE_STOPPED and
1057KVM_MP_STATE_RUNNABLE which reflect if the vcpu should be paused or not.
1050 1058
10514.40 KVM_SET_IDENTITY_MAP_ADDR 10594.40 KVM_SET_IDENTITY_MAP_ADDR
1052 1060
@@ -2263,7 +2271,7 @@ into the hash PTE second double word).
22634.75 KVM_IRQFD 22714.75 KVM_IRQFD
2264 2272
2265Capability: KVM_CAP_IRQFD 2273Capability: KVM_CAP_IRQFD
2266Architectures: x86 s390 2274Architectures: x86 s390 arm arm64
2267Type: vm ioctl 2275Type: vm ioctl
2268Parameters: struct kvm_irqfd (in) 2276Parameters: struct kvm_irqfd (in)
2269Returns: 0 on success, -1 on error 2277Returns: 0 on success, -1 on error
@@ -2289,6 +2297,10 @@ Note that closing the resamplefd is not sufficient to disable the
2289irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment 2297irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment
2290and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. 2298and need not be specified with KVM_IRQFD_FLAG_DEASSIGN.
2291 2299
2300On ARM/ARM64, the gsi field in the kvm_irqfd struct specifies the Shared
2301Peripheral Interrupt (SPI) index, such that the GIC interrupt ID is
2302given by gsi + 32.
2303
22924.76 KVM_PPC_ALLOCATE_HTAB 23044.76 KVM_PPC_ALLOCATE_HTAB
2293 2305
2294Capability: KVM_CAP_PPC_ALLOC_HTAB 2306Capability: KVM_CAP_PPC_ALLOC_HTAB
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h
index 816db0bf2dd8..d995821f1698 100644
--- a/arch/arm/include/asm/kvm_arm.h
+++ b/arch/arm/include/asm/kvm_arm.h
@@ -185,6 +185,7 @@
185#define HSR_COND (0xfU << HSR_COND_SHIFT) 185#define HSR_COND (0xfU << HSR_COND_SHIFT)
186 186
187#define FSC_FAULT (0x04) 187#define FSC_FAULT (0x04)
188#define FSC_ACCESS (0x08)
188#define FSC_PERM (0x0c) 189#define FSC_PERM (0x0c)
189 190
190/* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */ 191/* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index 41008cd7c53f..d71607c16601 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -27,6 +27,8 @@
27#include <asm/fpstate.h> 27#include <asm/fpstate.h>
28#include <kvm/arm_arch_timer.h> 28#include <kvm/arm_arch_timer.h>
29 29
30#define __KVM_HAVE_ARCH_INTC_INITIALIZED
31
30#if defined(CONFIG_KVM_ARM_MAX_VCPUS) 32#if defined(CONFIG_KVM_ARM_MAX_VCPUS)
31#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS 33#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS
32#else 34#else
@@ -165,19 +167,10 @@ void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte);
165 167