All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Fabiano Rosas <farosas@suse.de>,
	Chenyi Qiang <chenyi.qiang@intel.com>,
	David Hildenbrand <david@redhat.com>,
	Alexey Kardashevskiy <aik@amd.com>,
	Juraj Marcin <jmarcin@redhat.com>
Subject: Re: [PATCH 4/8] memory: Rename RAM_GUEST_MEMFD to RAM_GUEST_MEMFD_PRIVATE
Date: Wed, 19 Nov 2025 22:45:23 +0800	[thread overview]
Message-ID: <e5a397a9-965e-4ef3-8ee2-b305a86df0fc@intel.com> (raw)
In-Reply-To: <aRZM3TyRU_kqcpVl@x1.local>

On 11/14/2025 5:25 AM, Peter Xu wrote:
> On Fri, Oct 24, 2025 at 05:17:20PM +0800, Xiaoyao Li wrote:
>> On 10/24/2025 2:59 AM, Peter Xu wrote:
>>> This name is too generic, and can conflict with in-place guest-memfd
>>> support.  Add a _PRIVATE suffix to show what it really means: it is always
>>> silently using an internal guest-memfd to back a shared host backend,
>>> rather than used in-place.
>>>
>>> This paves way for in-place guest-memfd, which means we can have a ramblock
>>> that allocates pages completely from guest-memfd (private or shared).
>>
>> It's for patch 4-7. Regarding the rename. How about:
>>
>> - RAM_GUEST_MEMFD => RAM_PRIVATE_MEMORY
>> - backend->guest_memfd => backend->private_memory
>> - machine_require_guest_memfd() => machine_require_private_memory()
>> - cgs->require_guest_memfd => cgs->require_private_memory
>>
>> For CoCo VMs, what they require is the support of private memory, while the
>> guest_memfd is how linux provides private memory support. But with mmap
>> support added to guest memfd, it can serve as shared/non-private memory as
>> well. Futher, in the future when in-place conversion support is implemented,
>> a single guest memfd can serve as both shared and private in different
>> parts. So guest_memfd_private will be confusing at that time.
> 
> That's more or less a valid point.
> 
> Said so, I think PRIVATE_MEMORY is confusing too v.s. RAM_PRIVATE.  See:
> 
> commit 6169f1193657d0ba630a2ce33cef639ae918bce4
> Author: Steve Sistare <steven.sistare@oracle.com>
> Date:   Wed Jan 15 11:00:31 2025 -0800
> 
>      memory: add RAM_PRIVATE
> 
> Not to mention its possible confusion against mmap(MAP_PRIVATE) which is
> even more well known (where here RAM_PRIVATE is exactly about it).
> 
> It'll not be a concern until private gmemfd will start to back shared
> memories, even if it happens (I believe it will, a matter of time..) IMHO
> it's still fine to use guest_memfd_private, because here private describes
> that the fd is a private FD (not the memory is private).  It's private
> because it's hidden inside each ramblock that matters.  Then a fd that is
> private can still back shared memories.
> 
> Would you mind I keep everything as-is for now?

I'm fine.

> Thanks,
> 



  reply	other threads:[~2025-11-19 14:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 18:59 [PATCH 0/8] KVM/hostmem: Support in-place guest-memfd as VM backends Peter Xu
2025-10-23 18:59 ` [PATCH 1/8] linux-headers: Update to v6.18-rc2 Peter Xu
2025-10-23 18:59 ` [PATCH 2/8] kvm: Allow kvm_guest_memfd_supported for non-private use case Peter Xu
2025-10-24  2:30   ` Xiaoyao Li
2025-11-13 21:05     ` Peter Xu
2025-11-13 21:08     ` Peter Xu
2025-11-19 14:40       ` Xiaoyao Li
2025-10-23 18:59 ` [PATCH 3/8] kvm: Detect guest-memfd flags supported Peter Xu
2025-10-24  3:52   ` Xiaoyao Li
2025-11-13 21:15     ` Peter Xu
2025-11-13 21:19       ` Peter Xu
2025-11-19 14:44         ` Xiaoyao Li
2025-10-23 18:59 ` [PATCH 4/8] memory: Rename RAM_GUEST_MEMFD to RAM_GUEST_MEMFD_PRIVATE Peter Xu
2025-10-24  9:17   ` Xiaoyao Li
2025-11-13 21:25     ` Peter Xu
2025-11-19 14:45       ` Xiaoyao Li [this message]
2025-10-23 18:59 ` [PATCH 5/8] memory: Rename memory_region_has_guest_memfd() to *_private() Peter Xu
2025-10-23 18:59 ` [PATCH 6/8] ramblock: Rename guest_memfd to guest_memfd_private Peter Xu
2025-10-23 18:59 ` [PATCH 7/8] hostmem: " Peter Xu
2025-10-23 18:59 ` [PATCH 8/8] hostmem: Support in-place guest memfd to back a VM Peter Xu
2025-10-24  9:01   ` Xiaoyao Li
2025-10-24 15:22     ` Peter Xu
2025-10-27  5:24       ` Xiaoyao Li
2025-11-13 21:53         ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5a397a9-965e-4ef3-8ee2-b305a86df0fc@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=aik@amd.com \
    --cc=chenyi.qiang@intel.com \
    --cc=david@redhat.com \
    --cc=farosas@suse.de \
    --cc=jmarcin@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.