KVM: Do not pin pages tracked by gfn=>pfn caches
authorSean Christopherson <seanjc@google.com>
Fri, 29 Apr 2022 21:00:25 +0000 (21:00 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 May 2022 09:23:44 +0000 (05:23 -0400)
commit85165781c5d900d97052be1d2723f6929d56768d
tree53f6265abd41eeff11990edf884eb52fe8d68d7f
parent58cd407ca4c6278cf9f9d09a2e663bf645b0c982
KVM: Do not pin pages tracked by gfn=>pfn caches

Put the reference to any struct page mapped/tracked by a gfn=>pfn cache
upon inserting the pfn into its associated cache, as opposed to putting
the reference only when the cache is done using the pfn.  In other words,
don't pin pages while they're in the cache.  One of the major roles of
the gfn=>pfn cache is to play nicely with invalidation events, i.e. it
exists in large part so that KVM doesn't rely on pinning pages.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220429210025.3293691-9-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/pfncache.c