1. Jan 31, 2018
  2. Jan 27, 2018
  3. Jan 11, 2018
    • Alex Williamson's avatar
      PCI/DPC: Fix shared interrupt handling · aa6ca5a9
      Alex Williamson authored
      
      
      DPC supports shared interrupts, but it plays very loosely with testing
      whether the interrupt is generated by DPC before generating spurious log
      messages, such as:
      
        dpc 0000:10:01.2:pcie010: DPC containment event, status:0x1f00 source:0x0000
      
      Testing the status register for zero or -1 is not sufficient when the
      device supports the RP PIO First Error Pointer register.  Change this to
      test whether the interrupt is enabled in the control register, retaining
      the device present test, and that the status reports the interrupt as
      signaled and DPC is triggered, clearing as a spurious interrupt otherwise.
      
      Additionally, since the interrupt is actually serviced by a workqueue,
      disable the interrupt in the control register until that completes or else
      we may never see it execute due to further incoming interrupts.  A software
      generated DPC floods the system otherwise.
      
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <helgaas@kernel.org>
      Reviewed-by: default avatarKeith Busch <keith.busch@intel.com>
      aa6ca5a9
  4. Dec 18, 2017
  5. Dec 17, 2017
  6. Dec 16, 2017
    • Linus Torvalds's avatar
      Revert "mm: replace p??_write with pte_access_permitted in fault + gup paths" · f6f37321
      Linus Torvalds authored
      This reverts commits 5c9d2d5c, c7da82b8, and e7fe7b5c.
      
      We'll probably need to revisit this, but basically we should not
      complicate the get_user_pages_fast() case, and checking the actual page
      table protection key bits will require more care anyway, since the
      protection keys depend on the exact state of the VM in question.
      
      Particularly when doing a "remote" page lookup (ie in somebody elses VM,
      not your own), you need to be much more careful than this was.  Dave
      Hansen says:
      
       "So, the underlying bug here is that we now a get_user_pages_remote()
        and then go ahead and do the p*_access_permitted() checks against the
        current PKRU. This was introduced recently with the addition of the
        new p??_access_permitted() calls.
      
        We have checks in the VMA path for the "remote" gups and we avoid
        consulting PKRU for them. This got missed in the pkeys selftests
        because I did a ptrace read, but not a *write*. I also didn't
        explicitly test it against something where a COW needed to be done"
      
      It's also not entirely clear that it makes sense to check the protection
      key bits at this level at all.  But one possible eventual solution is to
      make the get_user_pages_fast() case just abort if it sees protection key
      bits set, which makes us fall back to the regular get_user_pages() case,
      which then has a vma and can do the check there if we want to.
      
      We'll see.
      
      Somewhat related to this all: what we _do_ want to do some day is to
      check the PAGE_USER bit - it should obviously always be set for user
      pages, but it would be a good check to have back.  Because we have no
      generic way to test for it, we lost it as part of moving over from the
      architecture-specific x86 GUP implementation to the generic one in
      commit e585513b
      
       ("x86/mm/gup: Switch GUP to the generic
      get_user_page_fast() implementation").
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: "Jérôme Glisse" <jglisse@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f6f37321