Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Reject 32-bit paddrs on ...



details:   https://anonhg.NetBSD.org/src/rev/72d3189bfc84
branches:  trunk
changeset: 795955:72d3189bfc84
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 14 13:59:19 2014 +0000

description:
Reject 32-bit paddrs on 965.

XXX Doing the check here is wrong; it serves only to report an
earlier problem, which is that there's on way to express constraints
on paddrs to uvm_obj_wirepages.  bus_dmamem_alloc can do this, but it
gives us pages out of thin air, not pages backing a uvm object.  I
was hoping this wouldn't manifest as a real problem, but evidently it
does.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 5e5431dd1b2a -r 72d3189bfc84 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Wed May 14 13:53:41 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Wed May 14 13:59:19 2014 +0000
@@ -2205,15 +2205,19 @@
        KASSERT(obj->igo_nsegs <= (obj->base.size / PAGE_SIZE));
 
        /*
-        * Check that the paddrs will fit in 40 bits.
+        * Check that the paddrs will fit in 40 bits, or 32 bits on i965.
         *
         * XXX This is wrong; we ought to pass this constraint to
         * bus_dmamem_wire_uvm_object instead.
         */
        TAILQ_FOREACH(page, &obj->igo_pageq, pageq.queue) {
-               if (VM_PAGE_TO_PHYS(page) & ~0xffffffffffULL) {
-                       DRM_ERROR("GEM physical address exceeds 40 bits"
+               const uint64_t mask =
+                   (IS_BROADWATER(dev) || IS_CRESTLINE(dev)?
+                       0xffffffffULL : 0xffffffffffULL);
+               if (VM_PAGE_TO_PHYS(page) & mask) {
+                       DRM_ERROR("GEM physical address exceeds %u bits"
                            ": %"PRIxMAX"\n",
+                           popcount64(mask),
                            (uintmax_t)VM_PAGE_TO_PHYS(page));
                        error = -EIO;
                        goto fail2;



Home | Main Index | Thread Index | Old Index