target-arm: Introduce per-CPU field for PSCI version
We require to know the PSCI version available to given CPU at potentially many places. Currently, we need to know PSCI version when generating DTB for virt machine. This patch introduce per-CPU 32bit field representing the PSCI version available to the CPU. The encoding of this 32bit field is same as described in PSCI v0.2 spec. Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org> Signed-off-by: Anup Patel <anup.patel@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1402901605-24551-8-git-send-email-pranavkumar@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
73542cf690
commit
dd032e3487
@ -94,6 +94,12 @@ typedef struct ARMCPU {
|
|||||||
/* 'compatible' string for this CPU for Linux device trees */
|
/* 'compatible' string for this CPU for Linux device trees */
|
||||||
const char *dtb_compatible;
|
const char *dtb_compatible;
|
||||||
|
|
||||||
|
/* PSCI version for this CPU
|
||||||
|
* Bits[31:16] = Major Version
|
||||||
|
* Bits[15:0] = Minor Version
|
||||||
|
*/
|
||||||
|
uint32_t psci_version;
|
||||||
|
|
||||||
/* Should CPU start in PSCI powered-off state? */
|
/* Should CPU start in PSCI powered-off state? */
|
||||||
bool start_powered_off;
|
bool start_powered_off;
|
||||||
|
|
||||||
|
@ -260,6 +260,7 @@ static void arm_cpu_initfn(Object *obj)
|
|||||||
* picky DTB consumer will also provide a helpful error message.
|
* picky DTB consumer will also provide a helpful error message.
|
||||||
*/
|
*/
|
||||||
cpu->dtb_compatible = "qemu,unknown";
|
cpu->dtb_compatible = "qemu,unknown";
|
||||||
|
cpu->psci_version = 1; /* By default assume PSCI v0.1 */
|
||||||
cpu->kvm_target = QEMU_KVM_ARM_TARGET_NONE;
|
cpu->kvm_target = QEMU_KVM_ARM_TARGET_NONE;
|
||||||
|
|
||||||
if (tcg_enabled() && !inited) {
|
if (tcg_enabled() && !inited) {
|
||||||
|
@ -184,6 +184,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
|
|||||||
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
|
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
|
||||||
}
|
}
|
||||||
if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
|
if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
|
||||||
|
cpu->psci_version = 2;
|
||||||
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
|
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
|
|||||||
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
|
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
|
||||||
}
|
}
|
||||||
if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
|
if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
|
||||||
|
cpu->psci_version = 2;
|
||||||
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
|
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user