Lines Matching refs:walker
209 struct guest_walker *walker, in FNAME()
222 for (level = walker->max_level; level >= walker->level; --level) { in FNAME()
223 pte = orig_pte = walker->ptes[level - 1]; in FNAME()
224 table_gfn = walker->table_gfn[level - 1]; in FNAME()
225 ptep_user = walker->ptep_user[level - 1]; in FNAME()
231 if (level == walker->level && write_fault && in FNAME()
252 if (unlikely(!walker->pte_writable[level - 1])) in FNAME()
260 walker->ptes[level - 1] = pte; in FNAME()
268 static int FNAME(walk_addr_generic)(struct guest_walker *walker, in FNAME()
288 walker->level = mmu->root_level; in FNAME()
292 if (walker->level == PT32E_ROOT_LEVEL) { in FNAME()
294 trace_kvm_mmu_paging_element(pte, walker->level); in FNAME()
297 --walker->level; in FNAME()
300 walker->max_level = walker->level; in FNAME()
305 ++walker->level; in FNAME()
312 --walker->level; in FNAME()
314 index = PT_INDEX(addr, walker->level); in FNAME()
319 walker->table_gfn[walker->level - 1] = table_gfn; in FNAME()
320 walker->pte_gpa[walker->level - 1] = pte_gpa; in FNAME()
324 &walker->fault); in FNAME()
342 &walker->pte_writable[walker->level - 1]); in FNAME()
349 walker->ptep_user[walker->level - 1] = ptep_user; in FNAME()
351 trace_kvm_mmu_paging_element(pte, walker->level); in FNAME()
357 walker->level))) { in FNAME()
365 walker->ptes[walker->level - 1] = pte; in FNAME()
366 } while (!is_last_gpte(mmu, walker->level, pte)); in FNAME()
373 gfn = gpte_to_gfn_lvl(pte, walker->level); in FNAME()
374 gfn += (addr & PT_LVL_OFFSET_MASK(walker->level)) >> PAGE_SHIFT; in FNAME()
376 if (PTTYPE == 32 && walker->level == PT_DIRECTORY_LEVEL && is_cpuid_PSE36()) in FNAME()
379 real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn), access, &walker->fault); in FNAME()
383 walker->gfn = real_gpa >> PAGE_SHIFT; in FNAME()
397 ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker, write_fault); in FNAME()
404 walker->pt_access = pt_access; in FNAME()
405 walker->pte_access = pte_access; in FNAME()
416 walker->fault.vector = PF_VECTOR; in FNAME()
417 walker->fault.error_code_valid = true; in FNAME()
418 walker->fault.error_code = errcode; in FNAME()
438 walker->fault.address = addr; in FNAME()
439 walker->fault.nested_page_fault = mmu != vcpu->arch.walk_mmu; in FNAME()
441 trace_kvm_mmu_walker_error(walker->fault.error_code); in FNAME()
445 static int FNAME(walk_addr)(struct guest_walker *walker, in FNAME()
448 return FNAME(walk_addr_generic)(walker, vcpu, &vcpu->arch.mmu, addr, in FNAME()
453 static int FNAME(walk_addr_nested)(struct guest_walker *walker, in FNAME()
457 return FNAME(walk_addr_generic)(walker, vcpu, &vcpu->arch.nested_mmu, in FNAME()
666 struct guest_walker *walker, int user_fault, in FNAME()
670 gfn_t mask = ~(KVM_PAGES_PER_HPAGE(walker->level) - 1); in FNAME()
673 if (!(walker->pte_access & ACC_WRITE_MASK || in FNAME()
677 for (level = walker->level; level <= walker->max_level; level++) { in FNAME()
678 gfn_t gfn = walker->gfn ^ walker->table_gfn[level - 1]; in FNAME()
706 struct guest_walker walker; in FNAME() local
737 r = FNAME(walk_addr)(&walker, vcpu, addr, error_code); in FNAME()
745 inject_page_fault(vcpu, &walker.fault); in FNAME()
753 &walker, user_fault, &vcpu->arch.write_fault_to_shadow_pgtable); in FNAME()
755 if (walker.level >= PT_DIRECTORY_LEVEL) in FNAME()
756 force_pt_level = mapping_level_dirty_bitmap(vcpu, walker.gfn) in FNAME()
761 level = min(walker.level, mapping_level(vcpu, walker.gfn)); in FNAME()
762 walker.gfn = walker.gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1); in FNAME()
768 if (try_async_pf(vcpu, prefault, walker.gfn, addr, &pfn, write_fault, in FNAME()
773 walker.gfn, pfn, walker.pte_access, &r)) in FNAME()
780 if (write_fault && !(walker.pte_access & ACC_WRITE_MASK) && in FNAME()
783 walker.pte_access |= ACC_WRITE_MASK; in FNAME()
784 walker.pte_access &= ~ACC_USER_MASK; in FNAME()
793 walker.pte_access &= ~ACC_EXEC_MASK; in FNAME()
803 transparent_hugepage_adjust(vcpu, &walker.gfn, &pfn, &level); in FNAME()
804 r = FNAME(fetch)(vcpu, addr, &walker, write_fault, in FNAME()
888 struct guest_walker walker; in FNAME() local
892 r = FNAME(walk_addr)(&walker, vcpu, vaddr, access); in FNAME()
895 gpa = gfn_to_gpa(walker.gfn); in FNAME()
898 *exception = walker.fault; in FNAME()
908 struct guest_walker walker; in FNAME() local
912 r = FNAME(walk_addr_nested)(&walker, vcpu, vaddr, access); in FNAME()
915 gpa = gfn_to_gpa(walker.gfn); in FNAME()
918 *exception = walker.fault; in FNAME()