@@ -198,7 +198,7 @@ struct intel_vgpu {
struct intel_vgpu_opregion opregion;
struct intel_vgpu_display display;
struct intel_vgpu_submission submission;
- struct radix_tree_root page_track_tree;
+ struct xarray page_track;
u32 hws_pga[I915_NUM_ENGINES];
struct dentry *debugfs;
@@ -34,7 +34,7 @@
struct intel_vgpu_page_track *intel_vgpu_find_page_track(
struct intel_vgpu *vgpu, unsigned long gfn)
{
- return radix_tree_lookup(&vgpu->page_track_tree, gfn);
+ return xa_load(&vgpu->page_track, gfn);
}
/**
@@ -64,7 +64,7 @@ int intel_vgpu_register_page_track(struct intel_vgpu *vgpu, unsigned long gfn,
track->handler = handler;
track->priv_data = priv;
- ret = radix_tree_insert(&vgpu->page_track_tree, gfn, track);
+ ret = xa_err(xa_store(&vgpu->page_track, gfn, track, GFP_KERNEL));
if (ret) {
kfree(track);
return ret;
@@ -84,7 +84,7 @@ void intel_vgpu_unregister_page_track(struct intel_vgpu *vgpu,
{
struct intel_vgpu_page_track *track;
- track = radix_tree_delete(&vgpu->page_track_tree, gfn);
+ track = xa_erase(&vgpu->page_track, gfn);
if (track) {
if (track->tracked)
intel_gvt_hypervisor_disable_page_track(vgpu, gfn);
@@ -382,7 +382,7 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
mutex_init(&vgpu->vgpu_lock);
mutex_init(&vgpu->dmabuf_lock);
INIT_LIST_HEAD(&vgpu->dmabuf_obj_list_head);
- INIT_RADIX_TREE(&vgpu->page_track_tree, GFP_KERNEL);
+ xa_init(&vgpu->page_track);
idr_init(&vgpu->object_idr);
intel_vgpu_init_cfg_space(vgpu, param->primary);
No locking changes. Signed-off-by: Matthew Wilcox <willy@infradead.org> --- drivers/gpu/drm/i915/gvt/gvt.h | 2 +- drivers/gpu/drm/i915/gvt/page_track.c | 6 +++--- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)