0001
0002
0003
0004
0005
0006
0007 #ifndef __KVM_ARM_PSCI_H__
0008 #define __KVM_ARM_PSCI_H__
0009
0010 #include <linux/kvm_host.h>
0011 #include <uapi/linux/psci.h>
0012
0013 #define KVM_ARM_PSCI_0_1 PSCI_VERSION(0, 1)
0014 #define KVM_ARM_PSCI_0_2 PSCI_VERSION(0, 2)
0015 #define KVM_ARM_PSCI_1_0 PSCI_VERSION(1, 0)
0016 #define KVM_ARM_PSCI_1_1 PSCI_VERSION(1, 1)
0017
0018 #define KVM_ARM_PSCI_LATEST KVM_ARM_PSCI_1_1
0019
0020 static inline int kvm_psci_version(struct kvm_vcpu *vcpu)
0021 {
0022
0023
0024
0025
0026
0027
0028
0029 if (test_bit(KVM_ARM_VCPU_PSCI_0_2, vcpu->arch.features)) {
0030 if (vcpu->kvm->arch.psci_version)
0031 return vcpu->kvm->arch.psci_version;
0032
0033 return KVM_ARM_PSCI_LATEST;
0034 }
0035
0036 return KVM_ARM_PSCI_0_1;
0037 }
0038
0039
0040 int kvm_psci_call(struct kvm_vcpu *vcpu);
0041
0042 #endif