Lines Matching refs:lvl

100  * - lvl is the level to build;
107 ctx_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx,
123 pg_sz = pglvl_page_size(tbl->pglvl, lvl);
124 if (lvl != tbl->leaf) {
126 ctx_idmap_nextlvl(tbl, lvl + 1, base + i, f);
130 if (lvl == tbl->leaf) {
319 * the level lvl.
322 ctx_pgtbl_pte_off(struct dmar_ctx *ctx, dmar_gaddr_t base, int lvl)
325 base >>= DMAR_PAGE_SHIFT + (ctx->pglvl - lvl - 1) * DMAR_NPTEPGSHIFT;
332 * lvl.
335 ctx_pgtbl_get_pindex(struct dmar_ctx *ctx, dmar_gaddr_t base, int lvl)
340 KASSERT(lvl >= 0 && lvl < ctx->pglvl, ("wrong lvl %p %d", ctx, lvl));
342 for (pidx = idx = 0, i = 0; i < lvl; i++, pidx = idx)
348 ctx_pgtbl_map_pte(struct dmar_ctx *ctx, dmar_gaddr_t base, int lvl, int flags,
359 idx = ctx_pgtbl_get_pindex(ctx, base, lvl);
369 KASSERT(lvl > 0, ("lost root page table page %p", ctx));
390 ptep = ctx_pgtbl_map_pte(ctx, base, lvl - 1, flags,
409 pte += ctx_pgtbl_pte_off(ctx, base, lvl);
421 int lvl;
433 for (lvl = 0, c = 0, superpage = false;; lvl++) {
434 pg_sz = ctx_page_size(ctx, lvl);
436 if (lvl == ctx->pglvl - 1)
442 if (!ctx_is_sp_lvl(ctx, lvl))
468 KASSERT(pg_sz > 0, ("pg_sz 0 lvl %d", lvl));
469 pte = ctx_pgtbl_map_pte(ctx, base, lvl, flags, &idx, &sf);
551 int lvl, int flags, dmar_pte_t *pte, struct sf_buf **sf, bool free_fs);
554 ctx_free_pgtbl_pde(struct dmar_ctx *ctx, dmar_gaddr_t base, int lvl, int flags)
561 pde = ctx_pgtbl_map_pte(ctx, base, lvl, flags, &idx, &sf);
562 ctx_unmap_clear_pte(ctx, base, lvl, flags, pde, &sf, true);
566 ctx_unmap_clear_pte(struct dmar_ctx *ctx, dmar_gaddr_t base, int lvl,
581 KASSERT(lvl != 0,
582 ("lost reference (lvl) on root pg ctx %p base %jx lvl %d",
583 ctx, (uintmax_t)base, lvl));
585 ("lost reference (idx) on root pg ctx %p base %jx lvl %d",
586 ctx, (uintmax_t)base, lvl));
588 ctx_free_pgtbl_pde(ctx, base, lvl - 1, flags);
602 int lvl;
632 for (lvl = 0; lvl < ctx->pglvl; lvl++) {
633 if (lvl != ctx->pglvl - 1 && !ctx_is_sp_lvl(ctx, lvl))
635 pg_sz = ctx_page_size(ctx, lvl);
638 pte = ctx_pgtbl_map_pte(ctx, base, lvl, flags,
642 ctx, (uintmax_t)base, lvl, flags));
644 lvl == ctx->pglvl - 1) {
645 ctx_unmap_clear_pte(ctx, base, lvl, flags,