From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Fuad Tabba <fuad.tabba@linux.dev>, kvm@vger.kernel.org
Cc: kvmarm@lists.linux.dev, Will Deacon <will@kernel.org>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Andre Przywara <andre.przywara@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Marc Zyngier <maz@kernel.org>, Fuad Tabba <tabba@google.com>
Subject: Re: [PATCH kvmtool v1 4/5] Add guest_memfd support to kvm__register_mem()
Date: Mon, 6 Jul 2026 12:13:45 +0100 [thread overview]
Message-ID: <ab60e6a1-e59a-4089-a6d4-386b83627b87@arm.com> (raw)
In-Reply-To: <5a699a28-07ce-4a6c-bc41-8b9bc7ca0d4a@arm.com>
On 06/07/2026 12:00, Suzuki K Poulose wrote:
> On 06/07/2026 09:35, Fuad Tabba wrote:
>> Add a guest_memfd file descriptor and offset to kvm__register_mem().
>> When guest_memfd >= 0, set KVM_MEM_GUEST_MEMFD and populate the
>> guest_memfd fields, binding the memslot to the file. This prepares
>> for backing guest RAM with guest_memfd on arm64.
>>
>> Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
>
> Looks good to me
>
> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Having another look... Thought of adding my comment, no changes to the
above.
>> int kvm__register_mem(struct kvm *kvm, u64 guest_phys, u64 size,
>> - void *userspace_addr, enum kvm_mem_type type)
>> + void *userspace_addr, int guest_memfd,
>> + u64 guest_memfd_offset, enum kvm_mem_type type)
>> {
>> struct kvm_mem_bank *merged = NULL;
>> struct kvm_mem_bank *bank;
>> @@ -327,6 +328,12 @@ int kvm__register_mem(struct kvm *kvm, u64
>> guest_phys, u64 size,
>> .userspace_addr = (unsigned long)userspace_addr,
>> };
>> + if (guest_memfd >= 0) {
>> + mem.flags |= KVM_MEM_GUEST_MEMFD;
>> + mem.guest_memfd = guest_memfd;
>> + mem.guest_memfd_offset = guest_memfd_offset;
>> + }
It may be worth capturing the fd and the offset in the mem_bank here,
but agree that can be added on the need basis and there are no users
of it for now, without conversion support.
Suzuki
>> +
>> ret = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION2, &mem);
>> if (ret < 0) {
>> ret = -errno;
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2026-07-06 11:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 8:35 [PATCH kvmtool v1 0/5] Add guest_memfd support for arm64 Fuad Tabba
2026-07-06 8:35 ` [PATCH kvmtool v1 1/5] Initialize the return value in kvm__for_each_mem_bank() Fuad Tabba
2026-07-06 8:35 ` [PATCH kvmtool v1 2/5] Remove newline from end of die() aborts Fuad Tabba
2026-07-06 10:53 ` Suzuki K Poulose
2026-07-06 10:57 ` Fuad Tabba
2026-07-06 8:35 ` [PATCH kvmtool v1 3/5] Use kvm_userspace_memory_region2 for all memory registration Fuad Tabba
2026-07-06 10:23 ` Suzuki K Poulose
2026-07-06 10:41 ` Fuad Tabba
2026-07-06 10:46 ` Will Deacon
2026-07-06 10:47 ` Fuad Tabba
2026-07-06 10:57 ` Alexandru Elisei
2026-07-06 10:59 ` Fuad Tabba
2026-07-06 8:35 ` [PATCH kvmtool v1 4/5] Add guest_memfd support to kvm__register_mem() Fuad Tabba
2026-07-06 11:00 ` Suzuki K Poulose
2026-07-06 11:13 ` Suzuki K Poulose [this message]
2026-07-06 11:25 ` Fuad Tabba
2026-07-06 12:34 ` Suzuki K Poulose
2026-07-06 8:35 ` [PATCH kvmtool v1 5/5] arm64: Add --guest-memfd option to back guest RAM with guest_memfd Fuad Tabba
2026-07-06 11:18 ` Suzuki K Poulose
2026-07-06 11:24 ` Fuad Tabba
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=ab60e6a1-e59a-4089-a6d4-386b83627b87@arm.com \
--to=suzuki.poulose@arm.com \
--cc=alexandru.elisei@arm.com \
--cc=andre.przywara@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=tabba@google.com \
--cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox