void ppc_hash64_set_external_hpt(PowerPCCPU *cpu, void *hpt, int shift,

                                 Error **errp)

{

    CPUPPCState *env = &cpu->env;

    Error *local_err = NULL;



    cpu_synchronize_state(CPU(cpu));



    env->external_htab = hpt;

    ppc_hash64_set_sdr1(cpu, (target_ulong)(uintptr_t)hpt | (shift - 18),

                        &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }



    /* Not strictly necessary, but makes it clearer that an external

     * htab is in use when debugging */

    env->htab_base = -1;



    if (kvm_enabled()) {

        if (kvmppc_put_books_sregs(cpu) < 0) {

            error_setg(errp, "Unable to update SDR1 in KVM");

        }

    }

}

void ppc_hash64_set_external_hpt(PowerPCCPU *cpu, void *hpt, int shift,

                                 Error **errp)

{

    CPUPPCState *env = &cpu->env;

    Error *local_err = NULL;



    cpu_synchronize_state(CPU(cpu));



    env->external_htab = hpt;

    ppc_hash64_set_sdr1(cpu, (target_ulong)(uintptr_t)hpt | (shift - 18),

                        &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }



    



    env->htab_base = -1;



    if (kvm_enabled()) {

        if (kvmppc_put_books_sregs(cpu) < 0) {

            error_setg(errp, "Unable to update SDR1 in KVM");

        }

    }

}

void FUNC_0(PowerPCCPU *VAR_0, void *VAR_1, int VAR_2,

                                 Error **VAR_3)

{

    CPUPPCState *env = &VAR_0->env;

    Error *local_err = NULL;



    cpu_synchronize_state(CPU(VAR_0));



    env->external_htab = VAR_1;

    ppc_hash64_set_sdr1(VAR_0, (target_ulong)(uintptr_t)VAR_1 | (VAR_2 - 18),

                        &local_err);

    if (local_err) {

        error_propagate(VAR_3, local_err);

        return;

    }



    



    env->htab_base = -1;



    if (kvm_enabled()) {

        if (kvmppc_put_books_sregs(VAR_0) < 0) {

            error_setg(VAR_3, "Unable to update SDR1 in KVM");

        }

    }

}

void FUNC_0(PowerPCCPU *VAR_0, void *VAR_1, int VAR_2,
Error **VAR_3)
{ CPUPPCState *env = &VAR_0->env; Error *local_err = NULL; cpu_synchronize_state(CPU(VAR_0)); env->external_htab = VAR_1; ppc_hash64_set_sdr1(VAR_0, (target_ulong)(uintptr_t)VAR_1 | (VAR_2 - 18),
&local_err); if (local_err) { error_propagate(VAR_3, local_err); return; } env->htab_base = -1; if (kvm_enabled()) { if (kvmppc_put_books_sregs(VAR_0) < 0) { error_setg(VAR_3, "Unable to update SDR1 in KVM"); } } }