Lines Matching refs:uhva

36 		    gpc->uhva >= start && gpc->uhva < end) {  in gfn_to_pfn_cache_invalidate_start()
49 gpc->uhva >= start && gpc->uhva < end) in gfn_to_pfn_cache_invalidate_start()
60 static bool kvm_gpc_is_valid_len(gpa_t gpa, unsigned long uhva, in kvm_gpc_is_valid_len() argument
63 unsigned long offset = kvm_is_error_gpa(gpa) ? offset_in_page(uhva) : in kvm_gpc_is_valid_len()
87 if (kvm_is_error_hva(gpc->uhva)) in kvm_gpc_check()
90 if (!kvm_gpc_is_valid_len(gpc->gpa, gpc->uhva, len)) in kvm_gpc_check()
201 new_pfn = hva_to_pfn(gpc->uhva, false, false, NULL, true, NULL); in hva_to_pfn_retry()
231 gpc->khva = new_khva + offset_in_page(gpc->uhva); in hva_to_pfn_retry()
248 static int __kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, gpa_t gpa, unsigned long uhva) in __kvm_gpc_refresh() argument
259 if (WARN_ON_ONCE(kvm_is_error_gpa(gpa) == kvm_is_error_hva(uhva))) in __kvm_gpc_refresh()
273 old_uhva = PAGE_ALIGN_DOWN(gpc->uhva); in __kvm_gpc_refresh()
276 page_offset = offset_in_page(uhva); in __kvm_gpc_refresh()
280 gpc->uhva = PAGE_ALIGN_DOWN(uhva); in __kvm_gpc_refresh()
282 if (gpc->uhva != old_uhva) in __kvm_gpc_refresh()
290 kvm_is_error_hva(gpc->uhva)) { in __kvm_gpc_refresh()
296 gpc->uhva = gfn_to_hva_memslot(gpc->memslot, gfn); in __kvm_gpc_refresh()
298 if (kvm_is_error_hva(gpc->uhva)) { in __kvm_gpc_refresh()
307 if (gpc->uhva != old_uhva) in __kvm_gpc_refresh()
310 gpc->uhva = old_uhva; in __kvm_gpc_refresh()
315 gpc->uhva += page_offset; in __kvm_gpc_refresh()
360 unsigned long uhva; in kvm_gpc_refresh() local
364 if (!kvm_gpc_is_valid_len(gpc->gpa, gpc->uhva, len)) in kvm_gpc_refresh()
372 uhva = kvm_is_error_gpa(gpc->gpa) ? gpc->uhva : KVM_HVA_ERR_BAD; in kvm_gpc_refresh()
374 return __kvm_gpc_refresh(gpc, gpc->gpa, uhva); in kvm_gpc_refresh()
385 gpc->uhva = KVM_HVA_ERR_BAD; in kvm_gpc_init()
389 static int __kvm_gpc_activate(struct gfn_to_pfn_cache *gpc, gpa_t gpa, unsigned long uhva, in __kvm_gpc_activate() argument
394 if (!kvm_gpc_is_valid_len(gpa, uhva, len)) in __kvm_gpc_activate()
416 return __kvm_gpc_refresh(gpc, gpa, uhva); in __kvm_gpc_activate()
431 int kvm_gpc_activate_hva(struct gfn_to_pfn_cache *gpc, unsigned long uhva, unsigned long len) in kvm_gpc_activate_hva() argument
433 if (!access_ok((void __user *)uhva, len)) in kvm_gpc_activate_hva()
436 return __kvm_gpc_activate(gpc, INVALID_GPA, uhva, len); in kvm_gpc_activate_hva()