void ppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr, Error **errp)

{

    const CompatInfo *compat = compat_by_pvr(compat_pvr);

    CPUPPCState *env = &cpu->env;

    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);

    uint64_t pcr;



    if (!compat_pvr) {

        pcr = 0;

    } else if (!compat) {

        error_setg(errp, "Unknown compatibility PVR 0x%08"PRIx32, compat_pvr);






    } else {

        pcr = compat->pcr;

    }



    cpu->compat_pvr = compat_pvr;

    env->spr[SPR_PCR] = pcr & pcc->pcr_mask;



    if (kvm_enabled()) {

        int ret = kvmppc_set_compat(cpu, cpu->compat_pvr);

        if (ret < 0) {

            error_setg_errno(errp, -ret,

                             "Unable to set CPU compatibility mode in KVM");

        }

    }

}
void ppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr, Error **errp)

{

    const CompatInfo *compat = compat_by_pvr(compat_pvr);

    CPUPPCState *env = &cpu->env;

    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);

    uint64_t pcr;



    if (!compat_pvr) {

        pcr = 0;

    } else if (!compat) {

        error_setg(errp, "Unknown compatibility PVR 0x%08"PRIx32, compat_pvr);






    } else {

        pcr = compat->pcr;

    }



    cpu->compat_pvr = compat_pvr;

    env->spr[SPR_PCR] = pcr & pcc->pcr_mask;



    if (kvm_enabled()) {

        int ret = kvmppc_set_compat(cpu, cpu->compat_pvr);

        if (ret < 0) {

            error_setg_errno(errp, -ret,

                             "Unable to set CPU compatibility mode in KVM");

        }

    }

}
void FUNC_0(PowerPCCPU *VAR_0, uint32_t VAR_1, Error **VAR_2)

{

    const CompatInfo *VAR_3 = compat_by_pvr(VAR_1);

    CPUPPCState *env = &VAR_0->env;

    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(VAR_0);

    uint64_t pcr;



    if (!VAR_1) {

        pcr = 0;

    } else if (!VAR_3) {

        error_setg(VAR_2, "Unknown compatibility PVR 0x%08"PRIx32, VAR_1);






    } else {

        pcr = VAR_3->pcr;

    }



    VAR_0->VAR_1 = VAR_1;

    env->spr[SPR_PCR] = pcr & pcc->pcr_mask;



    if (kvm_enabled()) {

        int VAR_4 = kvmppc_set_compat(VAR_0, VAR_0->VAR_1);

        if (VAR_4 < 0) {

            error_setg_errno(VAR_2, -VAR_4,

                             "Unable to set CPU compatibility mode in KVM");

        }

    }

}
void FUNC_0(PowerPCCPU *VAR_0, uint32_t VAR_1, Error **VAR_2)
{ const CompatInfo *VAR_3 = compat_by_pvr(VAR_1); CPUPPCState *env = &VAR_0->env; PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(VAR_0); uint64_t pcr; if (!VAR_1) { pcr = 0; } else if (!VAR_3) { error_setg(VAR_2, "Unknown compatibility PVR 0x%08"PRIx32, VAR_1); } else { pcr = VAR_3->pcr; } VAR_0->VAR_1 = VAR_1; env->spr[SPR_PCR] = pcr & pcc->pcr_mask; if (kvm_enabled()) { int VAR_4 = kvmppc_set_compat(VAR_0, VAR_0->VAR_1); if (VAR_4 < 0) { error_setg_errno(VAR_2, -VAR_4,
"Unable to set CPU compatibility mode in KVM"); } } }