Lines Matching +full:gpa +full:- +full:0
2 * Copyright(c) 2011-2017 Intel Corporation. All rights reserved.
27 * intel_vgpu_find_page_track - find page track rcord of guest page
37 return radix_tree_lookup(&vgpu->page_track_tree, gfn); in intel_vgpu_find_page_track()
41 * intel_vgpu_register_page_track - register a guest page to be tacked
58 return -EEXIST; in intel_vgpu_register_page_track()
62 return -ENOMEM; in intel_vgpu_register_page_track()
64 track->handler = handler; in intel_vgpu_register_page_track()
65 track->priv_data = priv; in intel_vgpu_register_page_track()
67 ret = radix_tree_insert(&vgpu->page_track_tree, gfn, track); in intel_vgpu_register_page_track()
73 return 0; in intel_vgpu_register_page_track()
77 * intel_vgpu_unregister_page_track - unregister the tracked guest page
87 track = radix_tree_delete(&vgpu->page_track_tree, gfn); in intel_vgpu_unregister_page_track()
89 if (track->tracked) in intel_vgpu_unregister_page_track()
96 * intel_vgpu_enable_page_track - set write-protection on guest page
110 return -ENXIO; in intel_vgpu_enable_page_track()
112 if (track->tracked) in intel_vgpu_enable_page_track()
113 return 0; in intel_vgpu_enable_page_track()
118 track->tracked = true; in intel_vgpu_enable_page_track()
119 return 0; in intel_vgpu_enable_page_track()
123 * intel_vgpu_disable_page_track - cancel write-protection on guest page
137 return -ENXIO; in intel_vgpu_disable_page_track()
139 if (!track->tracked) in intel_vgpu_disable_page_track()
140 return 0; in intel_vgpu_disable_page_track()
145 track->tracked = false; in intel_vgpu_disable_page_track()
146 return 0; in intel_vgpu_disable_page_track()
150 * intel_vgpu_page_track_handler - called when write to write-protected page
152 * @gpa: the gpa of this write
159 int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa, in intel_vgpu_page_track_handler() argument
163 int ret = 0; in intel_vgpu_page_track_handler()
165 page_track = intel_vgpu_find_page_track(vgpu, gpa >> PAGE_SHIFT); in intel_vgpu_page_track_handler()
167 return -ENXIO; in intel_vgpu_page_track_handler()
169 if (unlikely(vgpu->failsafe)) { in intel_vgpu_page_track_handler()
171 intel_gvt_page_track_remove(vgpu, gpa >> PAGE_SHIFT); in intel_vgpu_page_track_handler()
173 ret = page_track->handler(page_track, gpa, data, bytes); in intel_vgpu_page_track_handler()
175 gvt_err("guest page write error, gpa %llx\n", gpa); in intel_vgpu_page_track_handler()