Re: [PATCH RFC v3 03/88] mm: shmem: Implement guest_memfd provider operations for tmpfs
From: Christian Brauner
Date: Fri Nov 27 2026 - 07:56:31 EST
On Fri, Nov 20, 2026 at 06:34:34AM -0800, Sean Christopherson wrote:
> Eww. I really, really want to avoid having to update KVM just to recognize a
> new provider, and I shudder to think of the potential module dependency hell we
> could end up in.
I don't think you have to. LUO solves the same thing without file
operations:
* Providers register a handler with the core.
* The core asks each registered handler whether it owns the file:
liveupdate_register_file_handler(&memfd_luo_handler);
bool (*can_preserve)(struct liveupdate_file_handler *handler,
struct file *file);
You should just do the same here, I think. So put a small provider
registry into core code that is always built in and not into kvm.ko.
Providers register a handler with a ->can_connect(file) callback and kvm
walks the handlers when it's handed a file. This way kvm never needs to
know about individual providers and the providers only depend on the
registry but neither on kvm noor on each other.