static void vtd_update_iotlb(IntelIOMMUState *s, uint16_t source_id,

                             uint16_t domain_id, hwaddr addr, uint64_t slpte,

                             bool read_flags, bool write_flags)

{

    VTDIOTLBEntry *entry = g_malloc(sizeof(*entry));

    uint64_t *key = g_malloc(sizeof(*key));

    uint64_t gfn = addr >> VTD_PAGE_SHIFT_4K;



    VTD_DPRINTF(CACHE, "update iotlb sid 0x%"PRIx16 " gpa 0x%"PRIx64

                " slpte 0x%"PRIx64 " did 0x%"PRIx16, source_id, addr, slpte,

                domain_id);

    if (g_hash_table_size(s->iotlb) >= VTD_IOTLB_MAX_SIZE) {

        VTD_DPRINTF(CACHE, "iotlb exceeds size limit, forced to reset");

        vtd_reset_iotlb(s);

    }



    entry->gfn = gfn;

    entry->domain_id = domain_id;

    entry->slpte = slpte;

    entry->read_flags = read_flags;

    entry->write_flags = write_flags;

    *key = gfn | ((uint64_t)(source_id) << VTD_IOTLB_SID_SHIFT);

    g_hash_table_replace(s->iotlb, key, entry);

}

static void vtd_update_iotlb(IntelIOMMUState *s, uint16_t source_id,

                             uint16_t domain_id, hwaddr addr, uint64_t slpte,

                             bool read_flags, bool write_flags)

{

    VTDIOTLBEntry *entry = g_malloc(sizeof(*entry));

    uint64_t *key = g_malloc(sizeof(*key));

    uint64_t gfn = addr >> VTD_PAGE_SHIFT_4K;



    VTD_DPRINTF(CACHE, "update iotlb sid 0x%"PRIx16 " gpa 0x%"PRIx64

                " slpte 0x%"PRIx64 " did 0x%"PRIx16, source_id, addr, slpte,

                domain_id);

    if (g_hash_table_size(s->iotlb) >= VTD_IOTLB_MAX_SIZE) {

        VTD_DPRINTF(CACHE, "iotlb exceeds size limit, forced to reset");

        vtd_reset_iotlb(s);

    }



    entry->gfn = gfn;

    entry->domain_id = domain_id;

    entry->slpte = slpte;

    entry->read_flags = read_flags;

    entry->write_flags = write_flags;

    *key = gfn | ((uint64_t)(source_id) << VTD_IOTLB_SID_SHIFT);

    g_hash_table_replace(s->iotlb, key, entry);

}

static void FUNC_0(IntelIOMMUState *VAR_0, uint16_t VAR_1,

                             uint16_t VAR_2, hwaddr VAR_3, uint64_t VAR_4,

                             bool VAR_5, bool VAR_6)

{

    VTDIOTLBEntry *entry = g_malloc(sizeof(*entry));

    uint64_t *key = g_malloc(sizeof(*key));

    uint64_t gfn = VAR_3 >> VTD_PAGE_SHIFT_4K;



    VTD_DPRINTF(CACHE, "update iotlb sid 0x%"PRIx16 " gpa 0x%"PRIx64

                " VAR_4 0x%"PRIx64 " did 0x%"PRIx16, VAR_1, VAR_3, VAR_4,

                VAR_2);

    if (g_hash_table_size(VAR_0->iotlb) >= VTD_IOTLB_MAX_SIZE) {

        VTD_DPRINTF(CACHE, "iotlb exceeds size limit, forced to reset");

        vtd_reset_iotlb(VAR_0);

    }



    entry->gfn = gfn;

    entry->VAR_2 = VAR_2;

    entry->VAR_4 = VAR_4;

    entry->VAR_5 = VAR_5;

    entry->VAR_6 = VAR_6;

    *key = gfn | ((uint64_t)(VAR_1) << VTD_IOTLB_SID_SHIFT);

    g_hash_table_replace(VAR_0->iotlb, key, entry);

}

static void FUNC_0(IntelIOMMUState *VAR_0, uint16_t VAR_1,
uint16_t VAR_2, hwaddr VAR_3, uint64_t VAR_4,
bool VAR_5, bool VAR_6)
{ VTDIOTLBEntry *entry = g_malloc(sizeof(*entry)); uint64_t *key = g_malloc(sizeof(*key)); uint64_t gfn = VAR_3 >> VTD_PAGE_SHIFT_4K; VTD_DPRINTF(CACHE, "update iotlb sid 0x%"PRIx16 " gpa 0x%"PRIx64
" VAR_4 0x%"PRIx64 " did 0x%"PRIx16, VAR_1, VAR_3, VAR_4,
VAR_2); if (g_hash_table_size(VAR_0->iotlb) >= VTD_IOTLB_MAX_SIZE) { VTD_DPRINTF(CACHE, "iotlb exceeds size limit, forced to reset"); vtd_reset_iotlb(VAR_0); } entry->gfn = gfn; entry->VAR_2 = VAR_2; entry->VAR_4 = VAR_4; entry->VAR_5 = VAR_5; entry->VAR_6 = VAR_6; *key = gfn | ((uint64_t)(VAR_1) << VTD_IOTLB_SID_SHIFT); g_hash_table_replace(VAR_0->iotlb, key, entry); }