summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-04-30 00:00:22 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-25 12:23:42 +0300
commit3ba2c95ea180740b16281fa43a3ee5f47279c0ed (patch)
tree81e9f15077530a931e7c2fcf30b557f89be4802f /virt
parent3dddf65b4f4c451c345d34ae85bdf1791a746e49 (diff)
downloadlinux-3ba2c95ea180740b16281fa43a3ee5f47279c0ed.tar.xz
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>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/pfncache.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c
index 40cbe90d52e0..05cb0bcbf662 100644
--- a/virt/kvm/pfncache.c
+++ b/virt/kvm/pfncache.c
@@ -179,8 +179,6 @@ int kvm_gfn_to_pfn_cache_refresh(struct kvm *kvm, struct gfn_to_pfn_cache *gpc,
ret = -EFAULT;
goto out;
}
-
- gpc->uhva += page_offset;
}
/*