mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Samiullah Khawaja <skhawaja@google.com>
To: Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: David Matlack <dmatlack@google.com>,
	kexec@lists.infradead.org,  linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	 linux-pci@vger.kernel.org,
	Adithya Jayachandran <ajayachandra@nvidia.com>,
	 Alexander Graf <graf@amazon.com>,
	Alex Williamson <alex@shazbot.org>,
	 Bjorn Helgaas <bhelgaas@google.com>,
	Chris Li <chrisl@kernel.org>,
	 David Rientjes <rientjes@google.com>,
	Jacob Pan <jacob.pan@linux.microsoft.com>,
	 Jason Gunthorpe <jgg@nvidia.com>,
	Jonathan Corbet <corbet@lwn.net>,
	 Josh Hilke <jrhilke@google.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	 Lukas Wunner <lukas@wunner.de>, Mike Rapoport <rppt@kernel.org>,
	Parav Pandit <parav@nvidia.com>,
	 Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pranjal Shrivastava <praan@google.com>,
	 Pratyush Yadav <pratyush@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	 Saeed Mahameed <saeedm@nvidia.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	 Vipin Sharma <vipinsh@google.com>, William Tu <witu@nvidia.com>,
	Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH v9 00/13] PCI: liveupdate: PCI core support for Live Update
Date: Fri, 25 Sep 2026 18:59:07 +0000	[thread overview]
Message-ID: <aratPy2p33MObulT@google.com> (raw)
In-Reply-To: <b1a845c3-3720-4ef6-8c97-8a40ee7bd286@linux.dev>

On Thu, Sep 24, 2026 at 09:47:03PM -0700, Zhu Yanjun wrote:
>
>在 2026/9/22 11:53, David Matlack 写道:
>>On Tue, Sep 22, 2026 at 11:36 AM Zhu Yanjun <yanjun.zhu@linux.dev> wrote:
>>>在 2026/9/18 13:06, David Matlack 写道:
>>>>Future Work
>>>>-----------
>>>>
>>>>Following this series, we expect to make further improvements to the PCI
>>>>core support for Live Update:
>>>>
>>>>    - Allow P2P across Live Update by avoiding resizing or moving
>>>>      preserved device BARs and preserving all upstream bridge windows.
>>>>
>>>>    - Support preserving Virtual Functions by preserving SR-IOV
>>>>      configuration on PFs and enumerating VFs after Live Update.
>>>Preserving the PCIe topology, bus numbers, ACS, and Bus Mastering across
>>>kexec is a foundational step for minimizing downtime.
>>>
>>>As we look toward complete end-to-end support for DMA preservation
>>>across Live Update—especially for VFIO device passthrough and dma-buf
>>>sharing scenarios—IOMMU table/domain preservation becomes crucial to
>>>prevent IOMMU page faults when devices continue performing DMA during kexec.
>>>
>>>I would like to ask about the current status and roadmap regarding IOMMU
>>>Live Update / KHO (Kexec Handover) support:
>>>
>>>Is there an ongoing effort or RFC series for IOMMU handover / page-table
>>>preservation currently in development or under discussion?
>>>
>>>How is the coordination between the PCI core Live Update mechanisms and
>>>the IOMMU subsystem being envisioned for preserving IOVA mappings (e.g.,
>>>restoring domains or handing over root tables)?
>>>
>>>Any pointers to active discussion threads, RFCs, or future plans
>>>regarding IOMMU participation in Live Update would be greatly appreciated.
>>The first IOMMU series to support Live update, can be found here:
>>
>>   https://lore.kernel.org/linux-iommu/20260921004834.2601285-1-skhawaja@google.com/
>
>After cloning the source code from samikhawaja/linux, branch 
>iommu/phase1-v5, I tested the VFIO live update functionality in my 
>local KVM environment and encountered the following issue.
>
>When I run the following commands to verify that VFIO live update 
>works correctly, I get the output shown below.
>
>I am currently testing with VFIO v5 and PCI core v9, and I am not sure 
>whether this behavior is expected.
>
>Interestingly, when I revert the following commit:
>
>vfio/pci: Preserve the iommufd state of the vfio cdev
>
>the issue disappears.
>
>Could you please let me know whether this is expected behavior, or 
>whether it indicates a problem with the current VFIO live update 
>implementation?
>
>"
>
>echo "vfio-pci" > /sys/bus/pci/devices/0000:00:04.0/driver_override
>
>echo "0000:00:04.0" > /sys/bus/pci/drivers/vfio-pci/bind
>Preserving device in session
>vfio_pci_liveupdate_kexec_test.c:122: Assertion Failure
>
>  Expression: ret == 0
>  Observed: 0xffffffffffffffea == 0
>  [errno: 22 - Invalid argument]
>"

Hi Yanjun,

Thanks for testing this.

This is expected. With "vfio/pci: Preserve the iommufd state of the vfio
cdev", preserving a vfio cdev depends on the preservation of its
associated iommufd. Since the vfio_pci_liveupdate_kexec_test does not
preserve the associated iommufd, it fails with -EINVAL.

Note that the IOMMU persistence series does not update the
vfio_pci_liveupdate_kexec_test, with those extra bits, as it would
regress after_kexec() part of the test because the retrieval of iommufd
is not supported in phase1.

Please use tools/testing/selftests/iommu/iommufd_liveupdate_kexec_test
added in the last patch of the series, it sets up the iommufd and HWPT
preservation before preserving the vfio cdev.

The wip phase2 can be found here if you are interested.
https://github.com/samikhawaja/linux/tree/iommu/phase2-v1-wip

Thanks,
Sami

>
>Thanks a lot.
>
>Yanjun Zhu
>
>>
>>The IOMMU series builds on top of the PCI core support (this series)
>>and the VFIO series linked further up in the cover letter.
>
>-- 
>Best Regards,
>Yanjun.Zhu
>

  reply	other threads:[~2026-09-25 18:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 20:06 David Matlack
2026-09-18 20:06 ` [PATCH v9 01/13] PCI: liveupdate: Set up FLB handler for the PCI core David Matlack
2026-09-18 20:15   ` sashiko-bot
2026-09-25 19:55   ` Bjorn Helgaas
2026-09-18 20:06 ` [PATCH v9 02/13] PCI: liveupdate: Track outgoing preserved PCI devices David Matlack
2026-09-18 20:23   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 03/13] PCI: liveupdate: Track incoming " David Matlack
2026-09-18 20:20   ` sashiko-bot
2026-09-25 19:59   ` Bjorn Helgaas
2026-09-18 20:06 ` [PATCH v9 04/13] PCI: liveupdate: Document driver binding responsibilities David Matlack
2026-09-18 20:09   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 05/13] PCI: liveupdate: Auto-preserve upstream bridges across Live Update David Matlack
2026-09-18 20:14   ` sashiko-bot
2026-09-25 20:02   ` Bjorn Helgaas
2026-09-18 20:06 ` [PATCH v9 06/13] PCI: liveupdate: Preserve bus numbers during " David Matlack
2026-09-18 20:13   ` sashiko-bot
2026-09-25 20:04   ` Bjorn Helgaas
2026-09-18 20:06 ` [PATCH v9 07/13] PCI: Refactor matching logic for pci_dev_acs_ops David Matlack
2026-09-18 20:13   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 08/13] PCI: Save and restore the ACS Control register David Matlack
2026-09-18 20:15   ` sashiko-bot
2026-09-19  1:18   ` Alex Williamson
2026-09-21 20:36     ` David Matlack
2026-09-18 20:06 ` [PATCH v9 09/13] PCI: liveupdate: Adopt ACS controls in incoming preserved devices David Matlack
2026-09-18 20:13   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 10/13] PCI: liveupdate: Adopt ARI Forwarding Enable on preserved bridges David Matlack
2026-09-18 20:19   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 11/13] PCI: liveupdate: Freeze preservation status during shutdown David Matlack
2026-09-18 20:19   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 12/13] PCI: liveupdate: Do not disable bus mastering on preserved devices during kexec David Matlack
2026-09-18 20:17   ` sashiko-bot
2026-09-18 20:06 ` [PATCH v9 13/13] Documentation: PCI: Add documentation for Live Update David Matlack
2026-09-18 20:14   ` sashiko-bot
2026-09-22 18:36 ` [PATCH v9 00/13] PCI: liveupdate: PCI core support " Zhu Yanjun
2026-09-22 18:53   ` David Matlack
     [not found]     ` <d4547411-eeae-46c5-a30b-12d8cdde9329@linux.dev>
2026-09-24 21:59       ` David Matlack
2026-09-25  4:47     ` Zhu Yanjun
2026-09-25 18:59       ` Samiullah Khawaja [this message]
2026-09-22 18:54 ` Zhu Yanjun
2026-09-22 21:47   ` Zhu Yanjun

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=aratPy2p33MObulT@google.com \
    --to=skhawaja@google.com \
    --cc=ajayachandra@nvidia.com \
    --cc=alex@shazbot.org \
    --cc=bhelgaas@google.com \
    --cc=chrisl@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dmatlack@google.com \
    --cc=graf@amazon.com \
    --cc=jacob.pan@linux.microsoft.com \
    --cc=jgg@nvidia.com \
    --cc=jrhilke@google.com \
    --cc=kexec@lists.infradead.org \
    --cc=leonro@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=parav@nvidia.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=praan@google.com \
    --cc=pratyush@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rientjes@google.com \
    --cc=rppt@kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=skhan@linuxfoundation.org \
    --cc=vipinsh@google.com \
    --cc=witu@nvidia.com \
    --cc=yanjun.zhu@linux.dev \
    --cc=yi.l.liu@intel.com \
    /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

all inboxes | Powered by JetHome®