linux/virt/kvm
Paolo Bonzini 66a644c09f KVM: guest_memfd: abstract how prepared folios are recorded
Right now, large folios are not supported in guest_memfd, and therefore the order
used by kvm_gmem_populate() is always 0.  In this scenario, using the up-to-date
bit to track prepared-ness is nice and easy because we have one bit available
per page.

In the future, however, we might have large pages that are partially populated;
for example, in the case of SEV-SNP, if a large page has both shared and private
areas inside, it is necessary to populate it at a granularity that is smaller
than that of the guest_memfd's backing store.  In that case we will have
to track preparedness at a 4K level, probably as a bitmap.

In preparation for that, do not use explicitly folio_test_uptodate() and
folio_mark_uptodate().  Return the state of the page directly from
__kvm_gmem_get_pfn(), so that it is expected to apply to 2^N pages
with N=*max_order.  The function to mark a range as prepared for now
takes just a folio, but is expected to take also an index and order
(or something like that) when large pages are introduced.

Thanks to Michael Roth for pointing out the issue with large pages.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-07-26 14:46:15 -04:00
..
async_pf.c Revert "KVM: async_pf: avoid recursive flushing of work items" 2024-06-03 08:55:55 -07:00
async_pf.h
binary_stats.c KVM: stats: remove dead stores 2021-08-13 03:35:15 -04:00
coalesced_mmio.c KVM: destruct kvm_io_device while unregistering it from kvm_io_bus 2023-06-13 14:18:09 -07:00
coalesced_mmio.h
dirty_ring.c KVM: Discard zero mask with function kvm_dirty_ring_reset 2024-06-20 17:20:11 -04:00
eventfd.c Generic: 2024-01-17 13:03:37 -08:00
guest_memfd.c KVM: guest_memfd: abstract how prepared folios are recorded 2024-07-26 14:46:15 -04:00
irqchip.c KVM: Setup empty IRQ routing when creating a VM 2024-06-11 14:18:34 -07:00
Kconfig KVM: rename CONFIG_HAVE_KVM_GMEM_* to CONFIG_HAVE_KVM_ARCH_GMEM_* 2024-07-26 14:46:14 -04:00
kvm_main.c KVM: extend kvm_range_has_memory_attributes() to check subset of attributes 2024-07-26 14:46:15 -04:00
kvm_mm.h KVM: Drop unused @may_block param from gfn_to_pfn_cache_invalidate_start() 2024-04-11 12:58:53 -07:00
Makefile.kvm KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory 2023-11-14 08:01:03 -05:00
pfncache.c KVM: Validate hva in kvm_gpc_activate_hva() to fix __kvm_gpc_refresh() WARN 2024-06-28 08:31:46 -07:00
vfio.c KVM: Treat the device list as an rculist 2024-04-25 13:19:55 +01:00
vfio.h