diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2013-01-20 18:28:13 -0500 |
---|---|---|
committer | Christoffer Dall <c.dall@virtualopensystems.com> | 2013-01-23 13:29:18 -0500 |
commit | aa024c2f35a07cc32e48c5f62a5807be01c09249 (patch) | |
tree | 0fd5b1963f2a7e455d94357ae49be5c8cbbf6395 /arch/arm/include/uapi | |
parent | 45e96ea6b369539a37040a8df9c59a39f073d9d6 (diff) |
KVM: ARM: Power State Coordination Interface implementation
Implement the PSCI specification (ARM DEN 0022A) to control
virtual CPUs being "powered" on or off.
PSCI/KVM is detected using the KVM_CAP_ARM_PSCI capability.
A virtual CPU can now be initialized in a "powered off" state,
using the KVM_ARM_VCPU_POWER_OFF feature flag.
The guest can use either SMC or HVC to execute a PSCI function.
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
Diffstat (limited to 'arch/arm/include/uapi')
-rw-r--r-- | arch/arm/include/uapi/asm/kvm.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h index bbb6b2328004..3303ff5adbf3 100644 --- a/arch/arm/include/uapi/asm/kvm.h +++ b/arch/arm/include/uapi/asm/kvm.h | |||
@@ -65,6 +65,8 @@ struct kvm_regs { | |||
65 | #define KVM_ARM_TARGET_CORTEX_A15 0 | 65 | #define KVM_ARM_TARGET_CORTEX_A15 0 |
66 | #define KVM_ARM_NUM_TARGETS 1 | 66 | #define KVM_ARM_NUM_TARGETS 1 |
67 | 67 | ||
68 | #define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */ | ||
69 | |||
68 | struct kvm_vcpu_init { | 70 | struct kvm_vcpu_init { |
69 | __u32 target; | 71 | __u32 target; |
70 | __u32 features[7]; | 72 | __u32 features[7]; |
@@ -145,4 +147,18 @@ struct kvm_arch_memory_slot { | |||
145 | /* Highest supported SPI, from VGIC_NR_IRQS */ | 147 | /* Highest supported SPI, from VGIC_NR_IRQS */ |
146 | #define KVM_ARM_IRQ_GIC_MAX 127 | 148 | #define KVM_ARM_IRQ_GIC_MAX 127 |
147 | 149 | ||
150 | /* PSCI interface */ | ||
151 | #define KVM_PSCI_FN_BASE 0x95c1ba5e | ||
152 | #define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n)) | ||
153 | |||
154 | #define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0) | ||
155 | #define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1) | ||
156 | #define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2) | ||
157 | #define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3) | ||
158 | |||
159 | #define KVM_PSCI_RET_SUCCESS 0 | ||
160 | #define KVM_PSCI_RET_NI ((unsigned long)-1) | ||
161 | #define KVM_PSCI_RET_INVAL ((unsigned long)-2) | ||
162 | #define KVM_PSCI_RET_DENIED ((unsigned long)-3) | ||
163 | |||
148 | #endif /* __ARM_KVM_H__ */ | 164 | #endif /* __ARM_KVM_H__ */ |