Re: [PATCH v2 01/13] KVM: Rework KVM_CAP_GUEST_MEMFD_MMAP into KVM_CAP_GUEST_MEMFD_FLAGS

Sean Christopherson
2025-10-07T16:13:39Z

On Tue, Oct 07, 2025, Ackerley Tng wrote:
> Sean Christopherson <seanjc@google.com> writes:
> >> In this model, conditionally valid flags are always set,
> >
> > I followed everything except this snippet.
>
> I meant "conditionally valid" as in if GUEST_MEMFD_FLAG_BAR was valid
> only when GUEST_MEMFD_FLAG_FOO is set, then with this model, when
> KVM_CAP_GUEST_MEMFD_FLAGS is queried, would KVM return
> GUEST_MEMFD_FLAG_MMAP | GUEST_MEMFD_FLAG_FOO | GUEST_MEMFD_FLAG_BAR,
> where GUEST_MEMFD_FLAG_BAR is the conditionally valid flag?

Oh, conditional on other flags (or lack thereof). Yes, the capability would simply
enumerate all supported flags, it would not try to communicate which combinations
of flags are valid.