Re: [RFC PATCH 2/5] KVM: guest_memfd: Move gmem function declarations to dedicated guest_memfd.h
From: Sean Christopherson
Date: Thu Apr 30 2026 - 17:39:50 EST
On Thu, Apr 30, 2026, Ackerley Tng wrote:
> Sean Christopherson <seanjc@xxxxxxxxxx> writes:
>
> > Extract the gmem function declarations out of kvm_mm.h and into a dedicated
> > header, guest_memfd.h. This will allow creating a MAINTAINERS entry for
> > guest_memfd without having to rely on content pattern matching.
> >
>
> This also trims kvm_mm.h, which makes it easier to look stuff
> up. Thanks!
>
> Shall we do something similar for include/linux/kvm_host.h?
LOL, we can try. :-)
Not for linux/kvm_host.h, but I've tried to carve up x86's asm/kvm_host.h on
multiple occassions, and have failed miserably every time.
But linux/kvm_host.h is probably less intertwined? Though I think we should
split out headers if and only if there's substantial .c content as well. E.g.
if we add kvm_memslots.h, then I would also want kvm_memslots.c, because having
a dedicated headers while leaving the vast majority of memslots code in the
common kvm_main.c would be kludgy.