2 * Copyright © 2012-2014 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 #include <drm/i915_drm.h>
28 #include "i915_trace.h"
29 #include "intel_drv.h"
31 struct i915_mm_struct {
33 struct drm_device *dev;
34 struct i915_mmu_notifier *mn;
35 struct hlist_node node;
37 struct work_struct work;
40 #if defined(CONFIG_MMU_NOTIFIER)
41 #include <linux/interval_tree.h>
43 struct i915_mmu_notifier {
45 struct hlist_node node;
46 struct mmu_notifier mn;
47 struct rb_root objects;
48 struct list_head linear;
52 struct i915_mmu_object {
53 struct i915_mmu_notifier *mn;
54 struct interval_tree_node it;
55 struct list_head link;
56 struct drm_i915_gem_object *obj;
57 struct work_struct work;
62 static void __cancel_userptr__worker(struct work_struct *work)
64 struct i915_mmu_object *mo = container_of(work, typeof(*mo), work);
65 struct drm_i915_gem_object *obj = mo->obj;
66 struct drm_device *dev = obj->base.dev;
68 mutex_lock(&dev->struct_mutex);
69 /* Cancel any active worker and force us to re-evaluate gup */
70 obj->userptr.work = NULL;
72 if (obj->pages != NULL) {
73 struct drm_i915_private *dev_priv = to_i915(dev);
74 struct i915_vma *vma, *tmp;
75 bool was_interruptible;
77 was_interruptible = dev_priv->mm.interruptible;
78 dev_priv->mm.interruptible = false;
80 list_for_each_entry_safe(vma, tmp, &obj->vma_list, vma_link) {
81 int ret = i915_vma_unbind(vma);
82 WARN_ON(ret && ret != -EIO);
84 WARN_ON(i915_gem_object_put_pages(obj));
86 dev_priv->mm.interruptible = was_interruptible;
89 drm_gem_object_unreference(&obj->base);
90 mutex_unlock(&dev->struct_mutex);
93 static unsigned long cancel_userptr(struct i915_mmu_object *mo)
95 unsigned long end = mo->obj->userptr.ptr + mo->obj->base.size;
97 /* The mmu_object is released late when destroying the
98 * GEM object so it is entirely possible to gain a
99 * reference on an object in the process of being freed
100 * since our serialisation is via the spinlock and not
101 * the struct_mutex - and consequently use it after it
102 * is freed and then double free it.
104 if (mo->active && kref_get_unless_zero(&mo->obj->base.refcount)) {
105 schedule_work(&mo->work);
106 /* only schedule one work packet to avoid the refleak */
113 static void i915_gem_userptr_mn_invalidate_range_start(struct mmu_notifier *_mn,
114 struct mm_struct *mm,
118 struct i915_mmu_notifier *mn =
119 container_of(_mn, struct i915_mmu_notifier, mn);
120 struct i915_mmu_object *mo;
122 /* interval ranges are inclusive, but invalidate range is exclusive */
125 spin_lock(&mn->lock);
126 if (mn->has_linear) {
127 list_for_each_entry(mo, &mn->linear, link) {
128 if (mo->it.last < start || mo->it.start > end)
134 struct interval_tree_node *it;
136 it = interval_tree_iter_first(&mn->objects, start, end);
138 mo = container_of(it, struct i915_mmu_object, it);
139 start = cancel_userptr(mo);
140 it = interval_tree_iter_next(it, start, end);
143 spin_unlock(&mn->lock);
146 static const struct mmu_notifier_ops i915_gem_userptr_notifier = {
147 .invalidate_range_start = i915_gem_userptr_mn_invalidate_range_start,
150 static struct i915_mmu_notifier *
151 i915_mmu_notifier_create(struct mm_struct *mm)
153 struct i915_mmu_notifier *mn;
156 mn = kmalloc(sizeof(*mn), GFP_KERNEL);
158 return ERR_PTR(-ENOMEM);
160 spin_lock_init(&mn->lock);
161 mn->mn.ops = &i915_gem_userptr_notifier;
162 mn->objects = RB_ROOT;
163 INIT_LIST_HEAD(&mn->linear);
164 mn->has_linear = false;
166 /* Protected by mmap_sem (write-lock) */
167 ret = __mmu_notifier_register(&mn->mn, mm);
177 i915_mmu_notifier_add(struct drm_device *dev,
178 struct i915_mmu_notifier *mn,
179 struct i915_mmu_object *mo)
181 struct interval_tree_node *it;
184 /* By this point we have already done a lot of expensive setup that
185 * we do not want to repeat just because the caller (e.g. X) has a
186 * signal pending (and partly because of that expensive setup, X
187 * using an interrupt timer is likely to get stuck in an EINTR loop).
189 mutex_lock(&dev->struct_mutex);
191 /* Make sure we drop the final active reference (and thereby
192 * remove the objects from the interval tree) before we do
193 * the check for overlapping objects.
195 i915_gem_retire_requests(dev);
197 spin_lock(&mn->lock);
198 it = interval_tree_iter_first(&mn->objects,
199 mo->it.start, mo->it.last);
201 struct drm_i915_gem_object *obj;
203 /* We only need to check the first object in the range as it
204 * either has cancelled gup work queued and we need to
205 * return back to the user to give time for the gup-workers
206 * to flush their object references upon which the object will
207 * be removed from the interval-tree, or the the range is
208 * still in use by another client and the overlap is invalid.
210 * If we do have an overlap, we cannot use the interval tree
211 * for fast range invalidation.
214 obj = container_of(it, struct i915_mmu_object, it)->obj;
215 if (!obj->userptr.workers)
216 mn->has_linear = mo->is_linear = true;
220 interval_tree_insert(&mo->it, &mn->objects);
223 list_add(&mo->link, &mn->linear);
225 spin_unlock(&mn->lock);
226 mutex_unlock(&dev->struct_mutex);
231 static bool i915_mmu_notifier_has_linear(struct i915_mmu_notifier *mn)
233 struct i915_mmu_object *mo;
235 list_for_each_entry(mo, &mn->linear, link)
243 i915_mmu_notifier_del(struct i915_mmu_notifier *mn,
244 struct i915_mmu_object *mo)
246 spin_lock(&mn->lock);
249 mn->has_linear = i915_mmu_notifier_has_linear(mn);
251 interval_tree_remove(&mo->it, &mn->objects);
252 spin_unlock(&mn->lock);
256 i915_gem_userptr_release__mmu_notifier(struct drm_i915_gem_object *obj)
258 struct i915_mmu_object *mo;
260 mo = obj->userptr.mmu_object;
264 i915_mmu_notifier_del(mo->mn, mo);
267 obj->userptr.mmu_object = NULL;
270 static struct i915_mmu_notifier *
271 i915_mmu_notifier_find(struct i915_mm_struct *mm)
273 struct i915_mmu_notifier *mn = mm->mn;
279 down_write(&mm->mm->mmap_sem);
280 mutex_lock(&to_i915(mm->dev)->mm_lock);
281 if ((mn = mm->mn) == NULL) {
282 mn = i915_mmu_notifier_create(mm->mm);
286 mutex_unlock(&to_i915(mm->dev)->mm_lock);
287 up_write(&mm->mm->mmap_sem);
293 i915_gem_userptr_init__mmu_notifier(struct drm_i915_gem_object *obj,
296 struct i915_mmu_notifier *mn;
297 struct i915_mmu_object *mo;
300 if (flags & I915_USERPTR_UNSYNCHRONIZED)
301 return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;
303 if (WARN_ON(obj->userptr.mm == NULL))
306 mn = i915_mmu_notifier_find(obj->userptr.mm);
310 mo = kzalloc(sizeof(*mo), GFP_KERNEL);
315 mo->it.start = obj->userptr.ptr;
316 mo->it.last = mo->it.start + obj->base.size - 1;
318 INIT_WORK(&mo->work, __cancel_userptr__worker);
320 ret = i915_mmu_notifier_add(obj->base.dev, mn, mo);
326 obj->userptr.mmu_object = mo;
331 i915_mmu_notifier_free(struct i915_mmu_notifier *mn,
332 struct mm_struct *mm)
337 mmu_notifier_unregister(&mn->mn, mm);
345 i915_gem_userptr_release__mmu_notifier(struct drm_i915_gem_object *obj)
350 i915_gem_userptr_init__mmu_notifier(struct drm_i915_gem_object *obj,
353 if ((flags & I915_USERPTR_UNSYNCHRONIZED) == 0)
356 if (!capable(CAP_SYS_ADMIN))
363 i915_mmu_notifier_free(struct i915_mmu_notifier *mn,
364 struct mm_struct *mm)
372 static struct i915_mm_struct *
373 __i915_mm_struct_find(struct drm_i915_private *dev_priv, struct mm_struct *real)
375 struct i915_mm_struct *mm;
377 /* Protected by dev_priv->mm_lock */
378 hash_for_each_possible(dev_priv->mm_structs, mm, node, (unsigned long)real)
386 i915_gem_userptr_init__mm_struct(struct drm_i915_gem_object *obj)
388 struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
389 struct i915_mm_struct *mm;
392 /* During release of the GEM object we hold the struct_mutex. This
393 * precludes us from calling mmput() at that time as that may be
394 * the last reference and so call exit_mmap(). exit_mmap() will
395 * attempt to reap the vma, and if we were holding a GTT mmap
396 * would then call drm_gem_vm_close() and attempt to reacquire
397 * the struct mutex. So in order to avoid that recursion, we have
398 * to defer releasing the mm reference until after we drop the
399 * struct_mutex, i.e. we need to schedule a worker to do the clean
402 mutex_lock(&dev_priv->mm_lock);
403 mm = __i915_mm_struct_find(dev_priv, current->mm);
405 mm = kmalloc(sizeof(*mm), GFP_KERNEL);
411 kref_init(&mm->kref);
412 mm->dev = obj->base.dev;
414 mm->mm = current->mm;
415 atomic_inc(¤t->mm->mm_count);
419 /* Protected by dev_priv->mm_lock */
420 hash_add(dev_priv->mm_structs,
421 &mm->node, (unsigned long)mm->mm);
425 obj->userptr.mm = mm;
427 mutex_unlock(&dev_priv->mm_lock);
432 __i915_mm_struct_free__worker(struct work_struct *work)
434 struct i915_mm_struct *mm = container_of(work, typeof(*mm), work);
435 i915_mmu_notifier_free(mm->mn, mm->mm);
441 __i915_mm_struct_free(struct kref *kref)
443 struct i915_mm_struct *mm = container_of(kref, typeof(*mm), kref);
445 /* Protected by dev_priv->mm_lock */
447 mutex_unlock(&to_i915(mm->dev)->mm_lock);
449 INIT_WORK(&mm->work, __i915_mm_struct_free__worker);
450 schedule_work(&mm->work);
454 i915_gem_userptr_release__mm_struct(struct drm_i915_gem_object *obj)
456 if (obj->userptr.mm == NULL)
459 kref_put_mutex(&obj->userptr.mm->kref,
460 __i915_mm_struct_free,
461 &to_i915(obj->base.dev)->mm_lock);
462 obj->userptr.mm = NULL;
466 struct get_pages_work {
467 struct work_struct work;
468 struct drm_i915_gem_object *obj;
469 struct task_struct *task;
472 #if IS_ENABLED(CONFIG_SWIOTLB)
473 #define swiotlb_active() swiotlb_nr_tbl()
475 #define swiotlb_active() 0
480 st_set_pages(struct sg_table **st, struct page **pvec, int num_pages)
482 struct scatterlist *sg;
485 *st = kmalloc(sizeof(**st), GFP_KERNEL);
489 if (swiotlb_active()) {
490 ret = sg_alloc_table(*st, num_pages, GFP_KERNEL);
494 for_each_sg((*st)->sgl, sg, num_pages, n)
495 sg_set_page(sg, pvec[n], PAGE_SIZE, 0);
497 ret = sg_alloc_table_from_pages(*st, pvec, num_pages,
498 0, num_pages << PAGE_SHIFT,
513 __i915_gem_userptr_set_pages(struct drm_i915_gem_object *obj,
514 struct page **pvec, int num_pages)
518 ret = st_set_pages(&obj->pages, pvec, num_pages);
522 ret = i915_gem_gtt_prepare_object(obj);
524 sg_free_table(obj->pages);
533 __i915_gem_userptr_set_active(struct drm_i915_gem_object *obj,
538 /* During mm_invalidate_range we need to cancel any userptr that
539 * overlaps the range being invalidated. Doing so requires the
540 * struct_mutex, and that risks recursion. In order to cause
541 * recursion, the user must alias the userptr address space with
542 * a GTT mmapping (possible with a MAP_FIXED) - then when we have
543 * to invalidate that mmaping, mm_invalidate_range is called with
544 * the userptr address *and* the struct_mutex held. To prevent that
545 * we set a flag under the i915_mmu_notifier spinlock to indicate
546 * whether this object is valid.
548 #if defined(CONFIG_MMU_NOTIFIER)
549 if (obj->userptr.mmu_object == NULL)
552 spin_lock(&obj->userptr.mmu_object->mn->lock);
553 /* In order to serialise get_pages with an outstanding
554 * cancel_userptr, we must drop the struct_mutex and try again.
556 if (!value || !work_pending(&obj->userptr.mmu_object->work))
557 obj->userptr.mmu_object->active = value;
560 spin_unlock(&obj->userptr.mmu_object->mn->lock);
567 __i915_gem_userptr_get_pages_worker(struct work_struct *_work)
569 struct get_pages_work *work = container_of(_work, typeof(*work), work);
570 struct drm_i915_gem_object *obj = work->obj;
571 struct drm_device *dev = obj->base.dev;
572 const int npages = obj->base.size >> PAGE_SHIFT;
579 pvec = kmalloc(npages*sizeof(struct page *),
580 GFP_TEMPORARY | __GFP_NOWARN | __GFP_NORETRY);
582 pvec = drm_malloc_ab(npages, sizeof(struct page *));
584 struct mm_struct *mm = obj->userptr.mm->mm;
586 down_read(&mm->mmap_sem);
587 while (pinned < npages) {
588 ret = get_user_pages(work->task, mm,
589 obj->userptr.ptr + pinned * PAGE_SIZE,
591 !obj->userptr.read_only, 0,
592 pvec + pinned, NULL);
598 up_read(&mm->mmap_sem);
601 mutex_lock(&dev->struct_mutex);
602 if (obj->userptr.work == &work->work) {
603 if (pinned == npages) {
604 ret = __i915_gem_userptr_set_pages(obj, pvec, npages);
606 list_add_tail(&obj->global_list,
607 &to_i915(dev)->mm.unbound_list);
608 obj->get_page.sg = obj->pages->sgl;
609 obj->get_page.last = 0;
613 obj->userptr.work = ERR_PTR(ret);
615 __i915_gem_userptr_set_active(obj, false);
618 obj->userptr.workers--;
619 drm_gem_object_unreference(&obj->base);
620 mutex_unlock(&dev->struct_mutex);
622 release_pages(pvec, pinned, 0);
623 drm_free_large(pvec);
625 put_task_struct(work->task);
630 __i915_gem_userptr_get_pages_schedule(struct drm_i915_gem_object *obj,
633 struct get_pages_work *work;
635 /* Spawn a worker so that we can acquire the
636 * user pages without holding our mutex. Access
637 * to the user pages requires mmap_sem, and we have
638 * a strict lock ordering of mmap_sem, struct_mutex -
639 * we already hold struct_mutex here and so cannot
640 * call gup without encountering a lock inversion.
642 * Userspace will keep on repeating the operation
643 * (thanks to EAGAIN) until either we hit the fast
644 * path or the worker completes. If the worker is
645 * cancelled or superseded, the task is still run
646 * but the results ignored. (This leads to
647 * complications that we may have a stray object
648 * refcount that we need to be wary of when
649 * checking for existing objects during creation.)
650 * If the worker encounters an error, it reports
651 * that error back to this function through
652 * obj->userptr.work = ERR_PTR.
654 if (obj->userptr.workers >= I915_GEM_USERPTR_MAX_WORKERS)
657 work = kmalloc(sizeof(*work), GFP_KERNEL);
661 obj->userptr.work = &work->work;
662 obj->userptr.workers++;
665 drm_gem_object_reference(&obj->base);
667 work->task = current;
668 get_task_struct(work->task);
670 INIT_WORK(&work->work, __i915_gem_userptr_get_pages_worker);
671 schedule_work(&work->work);
678 i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj)
680 const int num_pages = obj->base.size >> PAGE_SHIFT;
685 /* If userspace should engineer that these pages are replaced in
686 * the vma between us binding this page into the GTT and completion
687 * of rendering... Their loss. If they change the mapping of their
688 * pages they need to create a new bo to point to the new vma.
690 * However, that still leaves open the possibility of the vma
691 * being copied upon fork. Which falls under the same userspace
692 * synchronisation issue as a regular bo, except that this time
693 * the process may not be expecting that a particular piece of
694 * memory is tied to the GPU.
696 * Fortunately, we can hook into the mmu_notifier in order to
697 * discard the page references prior to anything nasty happening
698 * to the vma (discard or cloning) which should prevent the more
699 * egregious cases from causing harm.
701 if (IS_ERR(obj->userptr.work)) {
702 /* active flag will have been dropped already by the worker */
703 ret = PTR_ERR(obj->userptr.work);
704 obj->userptr.work = NULL;
707 if (obj->userptr.work)
708 /* active flag should still be held for the pending work */
711 /* Let the mmu-notifier know that we have begun and need cancellation */
712 ret = __i915_gem_userptr_set_active(obj, true);
718 if (obj->userptr.mm->mm == current->mm) {
719 pvec = kmalloc(num_pages*sizeof(struct page *),
720 GFP_TEMPORARY | __GFP_NOWARN | __GFP_NORETRY);
722 pvec = drm_malloc_ab(num_pages, sizeof(struct page *));
724 __i915_gem_userptr_set_active(obj, false);
729 pinned = __get_user_pages_fast(obj->userptr.ptr, num_pages,
730 !obj->userptr.read_only, pvec);
735 ret = pinned, pinned = 0;
736 else if (pinned < num_pages)
737 ret = __i915_gem_userptr_get_pages_schedule(obj, &active);
739 ret = __i915_gem_userptr_set_pages(obj, pvec, num_pages);
741 __i915_gem_userptr_set_active(obj, active);
742 release_pages(pvec, pinned, 0);
744 drm_free_large(pvec);
749 i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj)
751 struct sg_page_iter sg_iter;
753 BUG_ON(obj->userptr.work != NULL);
754 __i915_gem_userptr_set_active(obj, false);
756 if (obj->madv != I915_MADV_WILLNEED)
759 i915_gem_gtt_finish_object(obj);
761 for_each_sg_page(obj->pages->sgl, &sg_iter, obj->pages->nents, 0) {
762 struct page *page = sg_page_iter_page(&sg_iter);
765 set_page_dirty(page);
767 mark_page_accessed(page);
768 page_cache_release(page);
772 sg_free_table(obj->pages);
777 i915_gem_userptr_release(struct drm_i915_gem_object *obj)
779 i915_gem_userptr_release__mmu_notifier(obj);
780 i915_gem_userptr_release__mm_struct(obj);
784 i915_gem_userptr_dmabuf_export(struct drm_i915_gem_object *obj)
786 if (obj->userptr.mmu_object)
789 return i915_gem_userptr_init__mmu_notifier(obj, 0);
792 static const struct drm_i915_gem_object_ops i915_gem_userptr_ops = {
793 .flags = I915_GEM_OBJECT_HAS_STRUCT_PAGE,
794 .get_pages = i915_gem_userptr_get_pages,
795 .put_pages = i915_gem_userptr_put_pages,
796 .dmabuf_export = i915_gem_userptr_dmabuf_export,
797 .release = i915_gem_userptr_release,
801 * Creates a new mm object that wraps some normal memory from the process
802 * context - user memory.
804 * We impose several restrictions upon the memory being mapped
806 * 1. It must be page aligned (both start/end addresses, i.e ptr and size).
807 * 2. It must be normal system memory, not a pointer into another map of IO
808 * space (e.g. it must not be a GTT mmapping of another object).
809 * 3. We only allow a bo as large as we could in theory map into the GTT,
810 * that is we limit the size to the total size of the GTT.
811 * 4. The bo is marked as being snoopable. The backing pages are left
812 * accessible directly by the CPU, but reads and writes by the GPU may
813 * incur the cost of a snoop (unless you have an LLC architecture).
815 * Synchronisation between multiple users and the GPU is left to userspace
816 * through the normal set-domain-ioctl. The kernel will enforce that the
817 * GPU relinquishes the VMA before it is returned back to the system
818 * i.e. upon free(), munmap() or process termination. However, the userspace
819 * malloc() library may not immediately relinquish the VMA after free() and
820 * instead reuse it whilst the GPU is still reading and writing to the VMA.
823 * Also note, that the object created here is not currently a "first class"
824 * object, in that several ioctls are banned. These are the CPU access
825 * ioctls: mmap(), pwrite and pread. In practice, you are expected to use
826 * direct access via your pointer rather than use those ioctls. Another
827 * restriction is that we do not allow userptr surfaces to be pinned to the
828 * hardware and so we reject any attempt to create a framebuffer out of a
831 * If you think this is a good interface to use to pass GPU memory between
832 * drivers, please use dma-buf instead. In fact, wherever possible use
836 i915_gem_userptr_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
838 struct drm_i915_gem_userptr *args = data;
839 struct drm_i915_gem_object *obj;
843 if (args->flags & ~(I915_USERPTR_READ_ONLY |
844 I915_USERPTR_UNSYNCHRONIZED))
847 if (offset_in_page(args->user_ptr | args->user_size))
850 if (!access_ok(args->flags & I915_USERPTR_READ_ONLY ? VERIFY_READ : VERIFY_WRITE,
851 (char __user *)(unsigned long)args->user_ptr, args->user_size))
854 if (args->flags & I915_USERPTR_READ_ONLY) {
855 /* On almost all of the current hw, we cannot tell the GPU that a
856 * page is readonly, so this is just a placeholder in the uAPI.
861 obj = i915_gem_object_alloc(dev);
865 drm_gem_private_object_init(dev, &obj->base, args->user_size);
866 i915_gem_object_init(obj, &i915_gem_userptr_ops);
867 obj->cache_level = I915_CACHE_LLC;
868 obj->base.write_domain = I915_GEM_DOMAIN_CPU;
869 obj->base.read_domains = I915_GEM_DOMAIN_CPU;
871 obj->userptr.ptr = args->user_ptr;
872 obj->userptr.read_only = !!(args->flags & I915_USERPTR_READ_ONLY);
874 /* And keep a pointer to the current->mm for resolving the user pages
875 * at binding. This means that we need to hook into the mmu_notifier
876 * in order to detect if the mmu is destroyed.
878 ret = i915_gem_userptr_init__mm_struct(obj);
880 ret = i915_gem_userptr_init__mmu_notifier(obj, args->flags);
882 ret = drm_gem_handle_create(file, &obj->base, &handle);
884 /* drop reference from allocate - handle holds it now */
885 drm_gem_object_unreference_unlocked(&obj->base);
889 args->handle = handle;
895 i915_gem_init_userptr(struct drm_device *dev)
897 struct drm_i915_private *dev_priv = to_i915(dev);
898 lockinit(&dev_priv->mm_lock, "i915dmm", 0, LK_CANRECURSE);
900 hash_init(dev_priv->mm_structs);