Ackerley Tng <[email protected]> writes: > Tarun Sahu <[email protected]> writes: > >> Introduce kvm_gmem_freeze() to freeze a guest_memfd inode's mapping, >> which prevents fallocate() operations and new page fault allocations >> during preservation. >> >> Use a global SRCU (`kvm_gmem_freeze_srcu`) to synchronize freeze state >> checkers without incurring per-fault locking overhead or risking per-CPU >> memory exhaustion (as per-CPU structure not counted in cgroup) from >> per-inode SRCU structures by faulty/compromised VMM. >> > > I wonder if everything to do with freezing should be gated behind > CONFIG_LIVEUPDATE_GUEST_MEMFD. What do people think?
Right now, Only liveupdate is the usecase. There was a discussion around the future usecase when IOMMU FD can use few pages from guest_memfd and will have to prevent punch_hole operation. But that will also avoid new faults. So freezing is not the solution here. A SEAL type solution like in memfd can be explored later. But this is very far in future so Plenty of time to discuss more ideas. On gating the freeze across CONFIG_LIVEUPDATE_GUEST_MEMFD sounds good Idea. As in future, there is a plan to remove the freeze at all from the preservation path. Before LIVEUPDATE, there was no usecase and in future, that usecase will also be gone. So gating it against the config makes sense. Would love to know what do people think? ~Tarun > >> Signed-off-by: Tarun Sahu <[email protected]> >> >> [...snip...] >>

