Commit dd032e34 authored by Pranavkumar Sawargaonkar's avatar Pranavkumar Sawargaonkar Committed by Peter Maydell
Browse files

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: default avatarPranavkumar Sawargaonkar <pranavkumar@linaro.org>
Signed-off-by: default avatarAnup Patel <anup.patel@linaro.org>
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Message-id: 1402901605-24551-8-git-send-email-pranavkumar@linaro.org
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 73542cf6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -94,6 +94,12 @@ typedef struct ARMCPU {
    /* 'compatible' string for this CPU for Linux device trees */
    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? */
    bool start_powered_off;

+1 −0
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ static void arm_cpu_initfn(Object *obj)
     * picky DTB consumer will also provide a helpful error message.
     */
    cpu->dtb_compatible = "qemu,unknown";
    cpu->psci_version = 1; /* By default assume PSCI v0.1 */
    cpu->kvm_target = QEMU_KVM_ARM_TARGET_NONE;

    if (tcg_enabled() && !inited) {
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
        cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
    }
    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;
    }

+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
        cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
    }
    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;
    }