static void spapr_alloc_htab(sPAPRMachineState *spapr)

{

    long shift;

    int index;



    /* allocate hash page table.  For now we always make this 16mb,

     * later we should probably make it scale to the size of guest

     * RAM */



    shift = kvmppc_reset_htab(spapr->htab_shift);



    if (shift > 0) {

        /* Kernel handles htab, we don't need to allocate one */

        if (shift != spapr->htab_shift) {

            error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem");

        }



        spapr->htab_shift = shift;

        kvmppc_kern_htab = true;

    } else {

        /* Allocate htab */

        spapr->htab = qemu_memalign(HTAB_SIZE(spapr), HTAB_SIZE(spapr));



        /* And clear it */

        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));

        }

    }

}

static void spapr_alloc_htab(sPAPRMachineState *spapr)

{

    long shift;

    int index;



    







    shift = kvmppc_reset_htab(spapr->htab_shift);



    if (shift > 0) {

        

        if (shift != spapr->htab_shift) {

            error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem");

        }



        spapr->htab_shift = shift;

        kvmppc_kern_htab = true;

    } else {

        

        spapr->htab = qemu_memalign(HTAB_SIZE(spapr), HTAB_SIZE(spapr));



        

        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 (shift > 0) {     if (shift > 0) {
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) {

        

        if (VAR_1 != VAR_0->htab_shift) {

            error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem");

        }



        VAR_0->htab_shift = VAR_1;

        kvmppc_kern_htab = true;

    } else {

        

        VAR_0->htab = qemu_memalign(HTAB_SIZE(VAR_0), HTAB_SIZE(VAR_0));



        

        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));

        }

    }

}

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) { if (VAR_1 != VAR_0->htab_shift) { error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem"); } VAR_0->htab_shift = VAR_1; kvmppc_kern_htab = true; } else { VAR_0->htab = qemu_memalign(HTAB_SIZE(VAR_0), HTAB_SIZE(VAR_0)); 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)); } } }