]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: PPC: Use kvm_vcpu_map() to map guest memory to patch dcbz instructions
authorSean Christopherson <seanjc@google.com>
Thu, 10 Oct 2024 18:24:16 +0000 (11:24 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Oct 2024 17:00:49 +0000 (13:00 -0400)
commitee0fa693546decf6673a87e75dec39ed2ab1524b
tree8f367136685d364b4fbdcd183aaf9474983251e0
parent17b7dbaf183e9cc131bbf5311db8202d323aa667
KVM: PPC: Use kvm_vcpu_map() to map guest memory to patch dcbz instructions

Use kvm_vcpu_map() when patching dcbz in guest memory, as a regular GUP
isn't technically sufficient when writing to data in the target pages.
As per Documentation/core-api/pin_user_pages.rst:

      Correct (uses FOLL_PIN calls):
          pin_user_pages()
          write to the data within the pages
          unpin_user_pages()

      INCORRECT (uses FOLL_GET calls):
          get_user_pages()
          write to the data within the pages
          put_page()

As a happy bonus, using kvm_vcpu_{,un}map() takes care of creating a
mapping and marking the page dirty.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010182427.1434605-75-seanjc@google.com>
arch/powerpc/kvm/book3s_pr.c