def pages_equiv(conj, ctx, kernelstate): pn = util.FreshBitVec('pn', dt.pn_t) idx = util.FreshBitVec('page_index', 64) conj.append( z3.ForAll([pn, idx], z3.Implies( z3.And(is_pn_valid(pn), z3.ULT(idx, 512)), util.global_to_uf_dict(ctx, '@pages')[()]( util.i64(0), pn, idx) == kernelstate.pages[pn].data(idx)))) conj.append( z3.ForAll( [pn], z3.Implies( is_pn_valid(pn), util.global_field_element(ctx, '@page_desc_table', 'pid', pn) == kernelstate.pages[pn].owner))) conj.append( z3.ForAll( [pn], z3.Implies( is_pn_valid(pn), util.global_field_element(ctx, '@page_desc_table', 'type', pn) == kernelstate.pages[pn].type)))
def io_equiv(conj, ctx, kernelstate): port = util.FreshBitVec('port', dt.uint16_t) conj.append( z3.ForAll([port], util.global_to_uf_dict(ctx, '@io_table')[()]( util.i64(0), z3.ZeroExt(64 - port.size(), port)) == kernelstate.io[port].owner))
def vectors_equiv(conj, ctx, kernelstate): vector = util.FreshBitVec('vector', dt.uint8_t) conj.append( z3.ForAll([vector], util.global_to_uf_dict(ctx, '@vector_table')[()]( util.i64(0), z3.ZeroExt( 64 - vector.size(), vector)) == kernelstate.vectors[vector].owner))
def pci_equiv(conj, ctx, kernelstate): devid = util.FreshBitVec('devid', dt.devid_t) conj.append( z3.ForAll([devid], util.global_to_uf_dict(ctx, '@pci_table')[()]( util.i64(0), z3.ZeroExt(64 - devid.size(), devid)) == kernelstate.pci[devid].owner))