Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev,
	djbw@kernel.org, iweiny@kernel.org, mclapinski@google.com,
	rppt@kernel.org, joao.m.martins@oracle.com, jic23@kernel.org,
	gourry@gourry.net, john@groves.net, rick.p.edgecombe@intel.com
Subject: Re: [RFC PATCH 00/12] dax: Add DAX to guest memfd support for KVM
Date: Thu, 23 Apr 2026 11:21:14 -0700	[thread overview]
Message-ID: <a1b05f3c-9c79-42f5-af29-5e719a3d0900@intel.com> (raw)
In-Reply-To: <70f67490-8caa-4839-a2e2-75c3b0c08b15@intel.com>



On 4/23/26 11:08 AM, Dave Jiang wrote:
> 
> 
> On 4/23/26 10:27 AM, Pasha Tatashin wrote:
>> Hi Dave,
>>
> Hi Pasha,
> 
>> On 04-23 10:02, Dave Jiang wrote:
>>> This RFC series is created as a proof of concept to connect device DAX to guest
>>> memory by riding on top of guest memfd in order to prove out that device DAX
>>> can be used as guest memory. The series seeks to jump start a discussion on
>>> if there are interests in creating a DAX bridge to utilize CXL memory for guest
>>> memory until the N_PRIVATE implementation by Gregory [1] is available upstream
>>> and DAX users are ready to move to the new scheme. Once there's an established
>>> consensus of interest, we can move the discussion to the best way to implement
>>> the DAX bridge and the future of device DAX as guest.
>>
>> I cannot speak to the CXL/DAX use case, but I can provide perspective 
>> from a persistence point of view. Currently, as a temporary workaround, 
>> we are using emulated pmem in DevDax mode for live update purposes. 
>> However, going forward, our plan is to switch to regular memory and use 
>> LUO + memfd/guestmemfd backed by regular RAM to preserve resources.

I also want to mention that while I'm motivated by CXL backing, the enabling is DAX backed by any backend.

DJ

>>
>> We are working on a patch series that we plan to send out in the coming 
>> weeks to preserve guestmemfd via LUO.
>>
>> By design, all resources that participate and need to be preserved 
>> across reboots for live update purposes must have FD handlers.
>>
>> Does your series allow DAX memory with 1G alignment (i.e. 1G pages) to 
>> back guest_memfd?  That is also an interesting use case, while HugeTLB 
>> support for guest_memfd is in progress, it still has not yet landed.
> 
> I just did a quick dirty hack to get 4k working. It may need some
> additional plumbing to enable 1G alignment. But I don't see any reason why
> that can't be done. Do you see any technical barriers? While it rides some
> of the paths to setup for gmem_fd, the faulting path is through DAX and does
> not go through the gmem. Maybe if we are actually implementing this, it may
> split out via clean dedicated DAX paths and not ride on top of gmem_fd? If
> we determine there is interest in doing this enabling, then at that time we
> can go to the next step and discuss how we want the interface to look like.
> 
> DJ
> 
>>
>>> I did the bare minimal to get the PoC to pass a modified version of KVM gmem
>>> selftest (guest_memfd_test) in order to prove out that DAX can go in the gmem
>>> path. A DAX char dev is created and the fd is passed in user space with
>>> vm_set_user_memory_region2(). The DAX region is passed in as a whole when used
>>> unlike memfd where any size can be passed in to be allocated.
>>>
>>> The folks on the cc line are people that Dan Williams has mentioned that may be
>>> of interest to this.
>>>
>>> [1]: https://lore.kernel.org/linux-cxl/aeWV1CvP9ImZ3eEG@gourry-fedora-PF4VCD3F/T/#t
>>>
>>>
>>> Dave Jiang (12):
>>>   dax: rate limit dev_dax_huge_fault() output
>>>   dax: Save the kva from memremap
>>>   dax: Add fallocate support to device dax
>>>   dax: Move dax_pgoff_to_phys() to dax bus to be used by dev dax
>>>   dax: Add dax_operations and supporting functions to device dax
>>>   dax: Add helper to determine if a 'struct file' supports dax
>>>   KVM: guest_memfd: Add setup of daxfd when binding gmem
>>>   fs: allow char dev to go through fallocate
>>>   dax: Add dax_get_dev_dax() helper function
>>>   kvm: Implement dax support for KVM faulting
>>>   kvm: Add daxfd support for supported flags
>>>   selftest/kvm: Add daxfd support for gmem selftest
>>>
>>>  arch/x86/kvm/Kconfig                          |   1 +
>>>  arch/x86/kvm/mmu/mmu.c                        |  48 ++-
>>>  drivers/dax/bus.c                             | 132 ++++++-
>>>  drivers/dax/dax-private.h                     |   8 +
>>>  drivers/dax/device.c                          |  80 +++--
>>>  fs/open.c                                     |   3 +-
>>>  include/linux/dax.h                           |  15 +
>>>  include/linux/kvm_host.h                      |  39 +++
>>>  include/uapi/linux/kvm.h                      |   4 +
>>>  tools/testing/selftests/kvm/Makefile.kvm      |   1 +
>>>  .../testing/selftests/kvm/guest_daxfd_test.c  | 329 ++++++++++++++++++
>>>  virt/kvm/Kconfig                              |   4 +
>>>  virt/kvm/guest_memfd.c                        |  92 ++++-
>>>  virt/kvm/kvm_main.c                           |   6 +
>>>  14 files changed, 711 insertions(+), 51 deletions(-)
>>>  create mode 100644 tools/testing/selftests/kvm/guest_daxfd_test.c
>>>
>>>
>>> base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
>>> -- 
>>> 2.53.0
>>>
> 
> 


  reply	other threads:[~2026-04-23 18:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 17:02 [RFC PATCH 00/12] dax: Add DAX to guest memfd support for KVM Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 01/12] dax: rate limit dev_dax_huge_fault() output Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 02/12] dax: Save the kva from memremap Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 03/12] dax: Add fallocate support to device dax Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 04/12] dax: Move dax_pgoff_to_phys() to dax bus to be used by dev dax Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 05/12] dax: Add dax_operations and supporting functions to device dax Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 06/12] dax: Add helper to determine if a 'struct file' supports dax Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 07/12] KVM: guest_memfd: Add setup of daxfd when binding gmem Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 08/12] fs: allow char dev to go through fallocate Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 09/12] dax: Add dax_get_dev_dax() helper function Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 10/12] kvm: Implement dax support for KVM faulting Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 11/12] kvm: Add daxfd support for supported flags Dave Jiang
2026-04-23 17:02 ` [RFC PATCH 12/12] selftest/kvm: Add daxfd support for gmem selftest Dave Jiang
2026-04-23 17:27 ` [RFC PATCH 00/12] dax: Add DAX to guest memfd support for KVM Pasha Tatashin
2026-04-23 18:08   ` Dave Jiang
2026-04-23 18:21     ` Dave Jiang [this message]
2026-04-24  3:43 ` Gregory Price
2026-04-24 17:38   ` Frank van der Linden
2026-04-29 13:21   ` Ira Weiny
2026-04-29 23:58     ` Gregory Price
2026-04-24 17:13 ` Frank van der Linden
2026-04-24 18:23   ` Dave Jiang
2026-04-24 20:01     ` Frank van der Linden
2026-04-24 20:59       ` Dave Jiang
2026-05-06 20:23     ` Ackerley Tng
2026-05-06 20:37       ` Dave Jiang
2026-05-08  1:09       ` Ira Weiny
2026-05-10 14:40         ` Gregory Price

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=a1b05f3c-9c79-42f5-af29-5e719a3d0900@intel.com \
    --to=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=gourry@gourry.net \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=joao.m.martins@oracle.com \
    --cc=john@groves.net \
    --cc=linux-cxl@vger.kernel.org \
    --cc=mclapinski@google.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=pasha.tatashin@soleen.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=rppt@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