Skip to content
Snippets Groups Projects
  1. Jun 17, 2024
  2. May 16, 2024
    • Elliot Berman's avatar
      mm/gup: Introduce exclusive GUP pinning · f2c887da
      Elliot Berman authored
      In arm64 pKVM and QuIC's Gunyah protected VM model, we want to support
      grabbing shmem user pages instead of using KVM's guestmemfd. When these
      pages are lent to a guest and made inaccessible to Linux, we need to
      ensure that the kernel doesn't try to access these pages: a fault occurs
      otherwise. To do this, we need to ensure that no page pins exist prior
      to lending the page to the guest.  Previously discussed in a PUCK
      session and in [1], we introduce the concept of "exclusive GUP pinning",
      which enforces that only one GUP pin is allowed when the flag is set.
      When FOLL_EXCLUSIVE is set, that corresponding pin ensures that no other
      pins have been made and sets a bias in the refcount that ensures no
      future pins (FOLL_EXCLUSIVE or otherwise) are allowed. This behavior
      doesn't affect FOLL_GET or any other folio refcount operations that
      don't go through the FOLL_PIN path.
      
      [1]: https://lore.kernel.org/all/20240319143119.GA2736@willie-the-truck/
      
      
      
      # Describe the purpose of this series. The information you put here
      # will be used by the project maintainer to make a decision whether
      # your patches should be reviewed, and in what priority order. Please be
      # very detailed and link to any relevant discussions or sites that the
      # maintainer can review to better understand your proposed changes. If you
      # only have a single patch in your series, the contents of the cover
      # letter will be appended to the "under-the-cut" portion of the patch.
      
      # Lines starting with # will be removed from the cover letter. You can
      # use them to add notes or reminders to yourself. If you want to use
      # markdown headers in your cover letter, start the line with ">#".
      
      # You can add trailers to the cover letter. Any email addresses found in
      # these trailers will be added to the addresses specified/generated
      # during the b4 send stage. You can also run "b4 prep --auto-to-cc" to
      # auto-populate the To: and Cc: trailers based on the code being
      # modified.
      
      To: Andrew Morton <akpm@linux-foundation.org>
      To: Shuah Khan <shuah@kernel.org>
      To: David Hildenbrand <david@redhat.com>
      To: Matthew Wilcox <willy@infradead.org>
      To: maz@kernel.org, will@kernel.org, qperret@google.com, keirf@google.com, seanjc@google.com, Vishal Annapurve <vannapurve@google.com>, Fuad Tabba <tabba@google.com>
      Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev
      Cc: linux-arm-msm@vger.kernel.org
      Cc: linux-mm@kvack.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Signed-off-by: default avatarElliot Berman <quic_eberman@quicinc.com>
      
      --- b4-submit-tracking ---
      # This section is used internally by b4 prep for tracking purposes.
      {
        "series": {
          "revision": 1,
          "change-id": "20240509-exclusive-gup-66259138bbff",
          "prefixes": [
            "RFC"
          ]
        }
      }
      f2c887da
  3. May 11, 2024
  4. May 07, 2024
Loading