diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2018-01-21 11:42:56 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-04-20 11:32:23 -0400 |
commit | 85bd0ba1ff9875798fad94218b627ea9f768f3c3 (patch) | |
tree | 7a1d8741a980a8d8d0a235c1784b2121634a9265 /arch/arm/include/uapi | |
parent | bf9a41377d14f565764022470e14aae72559589a (diff) |
arm/arm64: KVM: Add PSCI version selection API
Although we've implemented PSCI 0.1, 0.2 and 1.0, we expose either 0.1
or 1.0 to a guest, defaulting to the latest version of the PSCI
implementation that is compatible with the requested version. This is
no different from doing a firmware upgrade on KVM.
But in order to give a chance to hypothetical badly implemented guests
that would have a fit by discovering something other than PSCI 0.2,
let's provide a new API that allows userspace to pick one particular
version of the API.
This is implemented as a new class of "firmware" registers, where
we expose the PSCI version. This allows the PSCI version to be
save/restored as part of a guest migration, and also set to
any supported version if the guest requires it.
Cc: stable@vger.kernel.org #4.16
Reviewed-by: Christoffer Dall <cdall@kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include/uapi')
-rw-r--r-- | arch/arm/include/uapi/asm/kvm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h index 2ba95d6fe852..caae4843cb70 100644 --- a/arch/arm/include/uapi/asm/kvm.h +++ b/arch/arm/include/uapi/asm/kvm.h | |||
@@ -195,6 +195,12 @@ struct kvm_arch_memory_slot { | |||
195 | #define KVM_REG_ARM_VFP_FPINST 0x1009 | 195 | #define KVM_REG_ARM_VFP_FPINST 0x1009 |
196 | #define KVM_REG_ARM_VFP_FPINST2 0x100A | 196 | #define KVM_REG_ARM_VFP_FPINST2 0x100A |
197 | 197 | ||
198 | /* KVM-as-firmware specific pseudo-registers */ | ||
199 | #define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT) | ||
200 | #define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \ | ||
201 | KVM_REG_ARM_FW | ((r) & 0xffff)) | ||
202 | #define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0) | ||
203 | |||
198 | /* Device Control API: ARM VGIC */ | 204 | /* Device Control API: ARM VGIC */ |
199 | #define KVM_DEV_ARM_VGIC_GRP_ADDR 0 | 205 | #define KVM_DEV_ARM_VGIC_GRP_ADDR 0 |
200 | #define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1 | 206 | #define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1 |