1. 15 1月, 2019 1 次提交
  2. 11 1月, 2019 1 次提交
  3. 10 1月, 2019 7 次提交
  4. 09 1月, 2019 3 次提交
  5. 08 1月, 2019 3 次提交
  6. 07 1月, 2019 3 次提交
  7. 05 1月, 2019 3 次提交
    • C
      drm/i915: Remove partial attempt to swizzle on pread/pwrite · b9d126e7
      Chris Wilson 提交于
      Our attempt to account for bit17 swizzling of pread/pwrite onto tiled
      objects was flawed due to the simple fact that we do not always know the
      swizzling for a particular page (due to the swizzling varying based on
      location in certain unbalanced configurations). Furthermore, the
      pread/pwrite paths are now unbalanced in that we are required to use the
      GTT as in some cases we do not have direct CPU access to the backing
      physical pages (thus some paths trying to account for the swizzle, but
      others neglecting, chaos ensues).
      
      There are no known users who do use pread/pwrite into a tiled object
      (you need to manually detile anyway, so why now just use mmap and avoid
      the copy?) and no user bug reports to indicate that it is being used in
      the wild. As no one is hitting the buggy path, we can just remove the
      buggy code.
      
      v2: Just use the fault allowing kmap() + normal copy_(to|from)_user
      v3: Avoid int overflow in computing 'length' from 'remain' (Tvrtko)
      
      References: fe115628 ("drm/i915: Implement pwrite without struct-mutex")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Acked-by: NKenneth Graunke <kenneth@whitecape.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190105120758.9237-1-chris@chris-wilson.co.uk
      b9d126e7
    • L
      make 'user_access_begin()' do 'access_ok()' · 594cc251
      Linus Torvalds 提交于
      Originally, the rule used to be that you'd have to do access_ok()
      separately, and then user_access_begin() before actually doing the
      direct (optimized) user access.
      
      But experience has shown that people then decide not to do access_ok()
      at all, and instead rely on it being implied by other operations or
      similar.  Which makes it very hard to verify that the access has
      actually been range-checked.
      
      If you use the unsafe direct user accesses, hardware features (either
      SMAP - Supervisor Mode Access Protection - on x86, or PAN - Privileged
      Access Never - on ARM) do force you to use user_access_begin().  But
      nothing really forces the range check.
      
      By putting the range check into user_access_begin(), we actually force
      people to do the right thing (tm), and the range check vill be visible
      near the actual accesses.  We have way too long a history of people
      trying to avoid them.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      594cc251
    • L
      i915: fix missing user_access_end() in page fault exception case · 0b2c8f8b
      Linus Torvalds 提交于
      When commit fddcd00a ("drm/i915: Force the slow path after a
      user-write error") unified the error handling for various user access
      problems, it didn't do the user_access_end() that is needed for the
      unsafe_put_user() case.
      
      It's not a huge deal: a missed user_access_end() will only mean that
      SMAP protection isn't active afterwards, and for the error case we'll be
      returning to user mode soon enough anyway.  But it's wrong, and adding
      the proper user_access_end() is trivial enough (and doing it for the
      other error cases where it isn't needed doesn't hurt).
      
      I noticed it while doing the same prep-work for changing
      user_access_begin() that precipitated the access_ok() changes in commit
      96d4f267 ("Remove 'type' argument from access_ok() function").
      
      Fixes: fddcd00a ("drm/i915: Force the slow path after a user-write error")
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: stable@kernel.org # v4.20
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0b2c8f8b
  8. 04 1月, 2019 2 次提交
    • C
      drm/i915: Do not allow unwedging following a failed driver initialisation · 55c15512
      Chris Wilson 提交于
      If we declare the driver wedged during early initialisation, we leave
      the driver in an undefined state (with respect to GEM execution). As
      this leads to unexpected behaviour if we allow the user to unwedge the
      device (through debugfs, and performed by igt at test start), do not.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190103213340.1669-1-chris@chris-wilson.co.uk
      55c15512
    • L
      Remove 'type' argument from access_ok() function · 96d4f267
      Linus Torvalds 提交于
      Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
      of the user address range verification function since we got rid of the
      old racy i386-only code to walk page tables by hand.
      
      It existed because the original 80386 would not honor the write protect
      bit when in kernel mode, so you had to do COW by hand before doing any
      user access.  But we haven't supported that in a long time, and these
      days the 'type' argument is a purely historical artifact.
      
      A discussion about extending 'user_access_begin()' to do the range
      checking resulted this patch, because there is no way we're going to
      move the old VERIFY_xyz interface to that model.  And it's best done at
      the end of the merge window when I've done most of my merges, so let's
      just get this done once and for all.
      
      This patch was mostly done with a sed-script, with manual fix-ups for
      the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.
      
      There were a couple of notable cases:
      
       - csky still had the old "verify_area()" name as an alias.
      
       - the iter_iov code had magical hardcoded knowledge of the actual
         values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
         really used it)
      
       - microblaze used the type argument for a debug printout
      
      but other than those oddities this should be a total no-op patch.
      
      I tried to fix up all architectures, did fairly extensive grepping for
      access_ok() uses, and the changes are trivial, but I may have missed
      something.  Any missed conversion should be trivially fixable, though.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96d4f267
  9. 03 1月, 2019 3 次提交
  10. 02 1月, 2019 7 次提交
  11. 31 12月, 2018 7 次提交