static void spapr_reset_htab(sPAPRMachineState *spapr)

{

    long shift;

    int index;



    shift = kvmppc_reset_htab(spapr->htab_shift);

    if (shift < 0) {

        error_setg(&error_abort, "Failed to reset HTAB");

    } else if (shift > 0) {

        if (shift != spapr->htab_shift) {

            error_setg(&error_abort, "Requested HTAB allocation failed during reset");

        }



        /* Tell readers to update their file descriptor */

        if (spapr->htab_fd >= 0) {

            spapr->htab_fd_stale = true;

        }

    } else {

        memset(spapr->htab, 0, HTAB_SIZE(spapr));



        for (index = 0; index < HTAB_SIZE(spapr) / HASH_PTE_SIZE_64; index++) {

            DIRTY_HPTE(HPTE(spapr->htab, index));

        }

    }



    /* Update the RMA size if necessary */

    if (spapr->vrma_adjust) {

        spapr->rma_size = kvmppc_rma_size(spapr_node0_size(),

                                          spapr->htab_shift);

    }

}

static void spapr_reset_htab(sPAPRMachineState *spapr)

{

    long shift;

    int index;



    shift = kvmppc_reset_htab(spapr->htab_shift);

    if (shift < 0) {

        error_setg(&error_abort, "Failed to reset HTAB");

    } else if (shift > 0) {

        if (shift != spapr->htab_shift) {

            error_setg(&error_abort, "Requested HTAB allocation failed during reset");

        }



        

        if (spapr->htab_fd >= 0) {

            spapr->htab_fd_stale = true;

        }

    } else {

        memset(spapr->htab, 0, HTAB_SIZE(spapr));



        for (index = 0; index < HTAB_SIZE(spapr) / HASH_PTE_SIZE_64; index++) {

            DIRTY_HPTE(HPTE(spapr->htab, index));

        }

    }



    

    if (spapr->vrma_adjust) {

        spapr->rma_size = kvmppc_rma_size(spapr_node0_size(),

                                          spapr->htab_shift);

    }

}

static void FUNC_0(sPAPRMachineState *VAR_0)

{

    long VAR_1;

    int VAR_2;



    VAR_1 = kvmppc_reset_htab(VAR_0->htab_shift);

    if (VAR_1 < 0) {

        error_setg(&error_abort, "Failed to reset HTAB");

    } else if (VAR_1 > 0) {

        if (VAR_1 != VAR_0->htab_shift) {

            error_setg(&error_abort, "Requested HTAB allocation failed during reset");

        }



        

        if (VAR_0->htab_fd >= 0) {

            VAR_0->htab_fd_stale = true;

        }

    } else {

        memset(VAR_0->htab, 0, HTAB_SIZE(VAR_0));



        for (VAR_2 = 0; VAR_2 < HTAB_SIZE(VAR_0) / HASH_PTE_SIZE_64; VAR_2++) {

            DIRTY_HPTE(HPTE(VAR_0->htab, VAR_2));

        }

    }



    

    if (VAR_0->vrma_adjust) {

        VAR_0->rma_size = kvmppc_rma_size(spapr_node0_size(),

                                          VAR_0->htab_shift);

    }

}

static void FUNC_0(sPAPRMachineState *VAR_0)
{ long VAR_1; int VAR_2; VAR_1 = kvmppc_reset_htab(VAR_0->htab_shift); if (VAR_1 < 0) { error_setg(&error_abort, "Failed to reset HTAB"); } else if (VAR_1 > 0) { if (VAR_1 != VAR_0->htab_shift) { error_setg(&error_abort, "Requested HTAB allocation failed during reset"); } if (VAR_0->htab_fd >= 0) { VAR_0->htab_fd_stale = true; } } else { memset(VAR_0->htab, 0, HTAB_SIZE(VAR_0)); for (VAR_2 = 0; VAR_2 < HTAB_SIZE(VAR_0) / HASH_PTE_SIZE_64; VAR_2++) { DIRTY_HPTE(HPTE(VAR_0->htab, VAR_2)); } } if (VAR_0->vrma_adjust) { VAR_0->rma_size = kvmppc_rma_size(spapr_node0_size(),
VAR_0->htab_shift); } }