All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	Will Deacon <will@kernel.org>,
	Suzuki K Poulose <suzuki.poulose@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 v3 0/4] Add guest_memfd support for arm64
Date: Fri, 17 Jul 2026 09:54:43 +0100	[thread overview]
Message-ID: <alnt02jMIecD76kt@raptor> (raw)
In-Reply-To: <20260712142536.1391557-1-fuad.tabba@linux.dev>

Hi,

On Sun, Jul 12, 2026 at 03:25:32PM +0100, Fuad Tabba wrote:
> Hi folks,
> 
> Changes since v2 [1]:
> - Assert guest_memfd >= 0 in kvm__register_ram_guest_memfd() (Alexandru)
> - Don't split line after = sign (Alexandru)
> - Disable MTE when --guest-memfd is used (Alexandru)
> - Carried Reviewed-bys
> 
> Changes since v1 [2]:
> - Use kvm_userspace_memory_region2 only for guest_memfd slots (Suzuki)
> - Check KVM_CAP_GUEST_MEMFD before KVM_CAP_GUEST_MEMFD_FLAGS (Alexandru)
> - Close guest_memfd fd after unmapping at teardown (Alexandru)
> - Carried Reviewed-bys
> 
> Due to popular demand, i.e., Alexandru asking me about it, I repolished my
> guest_memfd support series. The one I sent years ago was stale and
> over-engineered, so this is a fresh start instead.
> 
> This series adds support for backing guest RAM with guest_memfd on
> arm64, for non-protected VMs under both regular KVM and pKVM.
> 
> The first two patches are standalone fixes in the code this series
> builds on: an uninitialized return value in kvm__for_each_mem_bank(),
> and doubled newlines in die() messages. Patch 3 adds guest_memfd
> plumbing to kvm__register_mem(), using kvm_userspace_memory_region2
> only for guest_memfd-backed slots.
> 
> A new --guest-memfd option creates guest RAM from a guest_memfd with
> mmap support (GUEST_MEMFD_FLAG_MMAP and GUEST_MEMFD_FLAG_INIT_SHARED,
> Linux 6.18+), maps it to provide the userspace mapping, and registers
> it with KVM_SET_USER_MEMORY_REGION2.
> 
> Protected VMs need in-place shared/private conversion of guest_memfd,
> which is still in progress in the kernel [3], so --protected rejects
> the option.
> 
> Based on kvmtool master (ca0ddafa941d).

Looks good to me:

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>

Tested it on an Orion O6 board, by booting a VM with guest_memfd. And also
used it as a base for testing the MTE + guest_memfd patch [1]:

Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>

[1] https://lore.kernel.org/kvmarm/20260714110756.116950-1-alexandru.elisei@arm.com/

Thanks,
Alex

> 
> Cheers,
> /fuad
> 
> [1] https://lore.kernel.org/all/20260708182239.1489297-1-fuad.tabba@linux.dev/
> [2] https://lore.kernel.org/all/20260706083555.302972-1-fuad.tabba@linux.dev/
> [3] https://lore.kernel.org/all/20260618-gmem-inplace-conversion-v8-0-9d2959357853@google.com/
> 
> Fuad Tabba (4):
>   Initialize the return value in kvm__for_each_mem_bank()
>   Remove newline from end of die() aborts
>   Add support for registering guest_memfd-backed memory regions
>   arm64: Add --guest-memfd option to back guest RAM with guest_memfd
> 
>  arm64/include/kvm/kvm-config-arch.h |  5 ++-
>  arm64/kvm.c                         | 44 +++++++++++++++++++++++----
>  hw/cfi_flash.c                      |  2 +-
>  include/kvm/kvm.h                   | 17 +++++++++--
>  include/kvm/util.h                  |  1 +
>  kvm.c                               | 42 ++++++++++++++++++--------
>  util/util.c                         | 47 ++++++++++++++++++++++++++---
>  7 files changed, 131 insertions(+), 27 deletions(-)
> 
> -- 
> 2.39.5
> 
> 

  parent reply	other threads:[~2026-07-17  8:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 14:25 [PATCH kvmtool v3 0/4] Add guest_memfd support for arm64 Fuad Tabba
2026-07-12 14:25 ` [PATCH kvmtool v3 1/4] Initialize the return value in kvm__for_each_mem_bank() Fuad Tabba
2026-07-12 14:25 ` [PATCH kvmtool v3 2/4] Remove newline from end of die() aborts Fuad Tabba
2026-07-12 14:25 ` [PATCH kvmtool v3 3/4] Add support for registering guest_memfd-backed memory regions Fuad Tabba
2026-07-12 14:25 ` [PATCH kvmtool v3 4/4] arm64: Add --guest-memfd option to back guest RAM with guest_memfd Fuad Tabba
2026-07-17  8:54 ` Alexandru Elisei [this message]
2026-07-17 10:28 ` [PATCH kvmtool v3 0/4] Add guest_memfd support for arm64 Suzuki K Poulose

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=alnt02jMIecD76kt@raptor \
    --to=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=suzuki.poulose@arm.com \
    --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 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.