Lines Matching refs:ctx
26 typedef int (*kvm_pte_ops)(kvm_pte_t *pte, phys_addr_t addr, kvm_ptw_ctx *ctx);
90 static inline int kvm_need_flush(kvm_ptw_ctx *ctx)
92 return ctx->flag & _KVM_FLUSH_PGTABLE;
95 static inline kvm_pte_t *kvm_pgtable_offset(kvm_ptw_ctx *ctx, kvm_pte_t *table,
99 return table + ((addr >> ctx->pgtable_shift) & (PTRS_PER_PTE - 1));
102 static inline phys_addr_t kvm_pgtable_addr_end(kvm_ptw_ctx *ctx,
107 size = 0x1UL << ctx->pgtable_shift;
112 static inline int kvm_pte_present(kvm_ptw_ctx *ctx, kvm_pte_t *entry)
114 if (!ctx || ctx->level == 0)
117 return *entry != ctx->invalid_entry;
120 static inline int kvm_pte_none(kvm_ptw_ctx *ctx, kvm_pte_t *entry)
122 return *entry == ctx->invalid_entry;
125 static inline void kvm_ptw_enter(kvm_ptw_ctx *ctx)
127 ctx->level--;
128 ctx->pgtable_shift = ctx->pte_shifts[ctx->level];
129 ctx->invalid_entry = ctx->invalid_ptes[ctx->level];
132 static inline void kvm_ptw_exit(kvm_ptw_ctx *ctx)
134 ctx->level++;
135 ctx->pgtable_shift = ctx->pte_shifts[ctx->level];
136 ctx->invalid_entry = ctx->invalid_ptes[ctx->level];