static int kvm_arch_sync_sregs(CPUState *cenv)

{

    struct kvm_sregs sregs;

    int ret;



    if (cenv->excp_model == POWERPC_EXCP_BOOKE) {

        return 0;

    } else {

        if (!cap_segstate) {

            return 0;

        }

    }



    ret = kvm_vcpu_ioctl(cenv, KVM_GET_SREGS, &sregs);

    if (ret) {

        return ret;

    }



    sregs.pvr = cenv->spr[SPR_PVR];

    return kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);

}

static int kvm_arch_sync_sregs(CPUState *cenv)

{

    struct kvm_sregs sregs;

    int ret;



    if (cenv->excp_model == POWERPC_EXCP_BOOKE) {

        return 0;

    } else {

        if (!cap_segstate) {

            return 0;

        }

    }



    ret = kvm_vcpu_ioctl(cenv, KVM_GET_SREGS, &sregs);

    if (ret) {

        return ret;

    }



    sregs.pvr = cenv->spr[SPR_PVR];

    return kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);

}

static int FUNC_0(CPUState *VAR_0)

{

    struct kvm_sregs VAR_1;

    int VAR_2;



    if (VAR_0->excp_model == POWERPC_EXCP_BOOKE) {

        return 0;

    } else {

        if (!cap_segstate) {

            return 0;

        }

    }



    VAR_2 = kvm_vcpu_ioctl(VAR_0, KVM_GET_SREGS, &VAR_1);

    if (VAR_2) {

        return VAR_2;

    }



    VAR_1.pvr = VAR_0->spr[SPR_PVR];

    return kvm_vcpu_ioctl(VAR_0, KVM_SET_SREGS, &VAR_1);

}

static int FUNC_0(CPUState *VAR_0)
{ struct kvm_sregs VAR_1; int VAR_2; if (VAR_0->excp_model == POWERPC_EXCP_BOOKE) { return 0; } else { if (!cap_segstate) { return 0; } } VAR_2 = kvm_vcpu_ioctl(VAR_0, KVM_GET_SREGS, &VAR_1); if (VAR_2) { return VAR_2; } VAR_1.pvr = VAR_0->spr[SPR_PVR]; return kvm_vcpu_ioctl(VAR_0, KVM_SET_SREGS, &VAR_1); }