aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/kvm_types.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2021-11-15 16:50:27 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2021-11-18 02:03:45 -0500
commit357a18ad230f0867791b788d2b1d6f280f6f6e61 (patch)
tree2281ebb8d7f2f2cf48f1ea72c257324d94b77254 /include/linux/kvm_types.h
parentKVM: nVMX: Use a gfn_to_hva_cache for vmptrld (diff)
downloadwireguard-linux-357a18ad230f0867791b788d2b1d6f280f6f6e61.tar.xz
wireguard-linux-357a18ad230f0867791b788d2b1d6f280f6f6e61.zip
KVM: Kill kvm_map_gfn() / kvm_unmap_gfn() and gfn_to_pfn_cache
In commit 7e2175ebd695 ("KVM: x86: Fix recording of guest steal time / preempted status") I removed the only user of these functions because it was basically impossible to use them safely. There are two stages to the GFN->PFN mapping; first through the KVM memslots to a userspace HVA and then through the page tables to translate that HVA to an underlying PFN. Invalidations of the former were being handled correctly, but no attempt was made to use the MMU notifiers to invalidate the cache when the HVA->GFN mapping changed. As a prelude to reinventing the gfn_to_pfn_cache with more usable semantics, rip it out entirely and untangle the implementation of the unsafe kvm_vcpu_map()/kvm_vcpu_unmap() functions from it. All current users of kvm_vcpu_map() also look broken right now, and will be dealt with separately. They broadly fall into two classes: * Those which map, access the data and immediately unmap. This is mostly gratuitous and could just as well use the existing user HVA, and could probably benefit from a gfn_to_hva_cache as they do so. * Those which keep the mapping around for a longer time, perhaps even using the PFN directly from the guest. These will need to be converted to the new gfn_to_pfn_cache and then kvm_vcpu_map() can be removed too. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Message-Id: <20211115165030.7422-8-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/kvm_types.h')
-rw-r--r--include/linux/kvm_types.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h
index 2237abb93ccd..234eab059839 100644
--- a/include/linux/kvm_types.h
+++ b/include/linux/kvm_types.h
@@ -53,13 +53,6 @@ struct gfn_to_hva_cache {
struct kvm_memory_slot *memslot;
};
-struct gfn_to_pfn_cache {
- u64 generation;
- gfn_t gfn;
- kvm_pfn_t pfn;
- bool dirty;
-};
-
#ifdef KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE
/*
* Memory caches are used to preallocate memory ahead of various MMU flows,