]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Do not incorporate page offset into gfn=>pfn cache user address
authorSean Christopherson <seanjc@google.com>
Fri, 29 Apr 2022 21:00:22 +0000 (21:00 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 May 2022 09:23:42 +0000 (05:23 -0400)
commit896655a49f077eeef059ba15e8e9fee2610df832
tree81e9f15077530a931e7c2fcf30b557f89be4802f
parentb87d23981b607c47023dcef62695434bdf2f1b96
KVM: Do not incorporate page offset into gfn=>pfn cache user address

Don't adjust the userspace address in the gfn=>pfn cache by the page
offset from the gpa.  KVM should never use the user address directly, and
all KVM operations that translate a user address to something else
require the user address to be page aligned.  Ignoring the offset will
allow the cache to reuse a gfn=>hva translation in the unlikely event
that the page offset of the gpa changes, but the gfn does not.  And more
importantly, not having to (un)adjust the user address will simplify a
future bug fix.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220429210025.3293691-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/pfncache.c