Thread (55 messages) 55 messages, 7 authors, 2022-01-14

Re: [PATCH v3 kvm/queue 11/16] KVM: Add kvm_map_gfn_range

From: Chao Peng <hidden>
Date: 2021-12-31 02:34:20
Also in: kvm, linux-fsdevel, lkml, qemu-devel

On Fri, Dec 24, 2021 at 12:13:51PM +0800, Chao Peng wrote:
On Thu, Dec 23, 2021 at 06:06:19PM +0000, Sean Christopherson wrote:
quoted
On Thu, Dec 23, 2021, Chao Peng wrote:
quoted
This new function establishes the mapping in KVM page tables for a
given gfn range. It can be used in the memory fallocate callback for
memfd based memory to establish the mapping for KVM secondary MMU when
the pages are allocated in the memory backend.
NAK, under no circumstance should KVM install SPTEs in response to allocating
memory in a file.   The correct thing to do is to invalidate the gfn range
associated with the newly mapped range, i.e. wipe out any shared SPTEs associated
with the memslot.
Right, thanks.
BTW, I think the current fallocate() callback is just useless as long as
we don't want to install KVM SPTEs in response to allocating memory in a
file. The invalidation of the shared SPTEs should be notified through 
mmu_notifier of the shared memory backend, not memfd_notifier of the
private memory backend.

Thanks,
Chao
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help