All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] iommu/vt-d: Add support to hitless replace IOMMU domain
@ 2026-01-07 20:17 Samiullah Khawaja
  2026-01-07 20:17 ` [PATCH 1/3] iommu/vt-d: Allow replacing no_pasid iommu_domain Samiullah Khawaja
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Samiullah Khawaja @ 2026-01-07 20:17 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon,
	Pasha Tatashin, Jason Gunthorpe, David Matlack
  Cc: Samiullah Khawaja, Robin Murphy, Pratyush Yadav, Kevin Tian,
	Alex Williamson, Shuah Khan, iommu, linux-kernel, kvm,
	Saeed Mahameed, Adithya Jayachandran, Parav Pandit,
	Leon Romanovsky, William Tu

Intel IOMMU Driver already supports replacing IOMMU domain hitlessly in
scalable mode. The support is not available in legacy mode and for
NO_PASID in scalable mode. This patch series adds the support for legacy
mode and NO_PASID scalable mode.

This is needed for the Live update IOMMU persistence to hotswap the
iommu domain after liveupdate:
https://lore.kernel.org/all/20251202230303.1017519-1-skhawaja@google.com/

The patch adds the support for scalable mode NO_PASID mode by using the
existing replace semantics. This works since in scalable mode the
context entries are not updated and only the pasid entries are updated.

The patch series also contains a vfio selftests for the iommu domain
replace using iommufd hwpt replace functionality.

Tested on a Host with scalable mode and on Qemu with legacy mode:

tools/testing/selftests/vfio/scripts/setup.sh <dsa_device_bdf>
tools/testing/selftests/vfio/vfio_iommufd_hwpt_replace_test <dsa_device_bdf>

TAP version 13
1..2
# Starting 2 tests from 2 test cases.
#  RUN           vfio_iommufd_replace_hwpt_test.domain_replace.memcpy ...
#            OK  vfio_iommufd_replace_hwpt_test.domain_replace.memcpy
ok 1 vfio_iommufd_replace_hwpt_test.domain_replace.memcpy
#  RUN           vfio_iommufd_replace_hwpt_test.noreplace.memcpy ...
#            OK  vfio_iommufd_replace_hwpt_test.noreplace.memcpy
ok 2 vfio_iommufd_replace_hwpt_test.noreplace.memcpy
# PASSED: 2 / 2 tests passed.
# Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0

Samiullah Khawaja (3):
  iommu/vt-d: Allow replacing no_pasid iommu_domain
  vfio: selftests: Add support of creating iommus from iommufd
  vfio: selftests: Add iommufd hwpt replace test

 drivers/iommu/intel/iommu.c                   | 107 +++++++++----
 tools/testing/selftests/vfio/Makefile         |   1 +
 .../vfio/lib/include/libvfio/iommu.h          |   2 +
 .../lib/include/libvfio/vfio_pci_device.h     |   2 +
 tools/testing/selftests/vfio/lib/iommu.c      |  60 ++++++-
 .../selftests/vfio/lib/vfio_pci_device.c      |  16 +-
 .../vfio/vfio_iommufd_hwpt_replace_test.c     | 151 ++++++++++++++++++
 7 files changed, 303 insertions(+), 36 deletions(-)
 create mode 100644 tools/testing/selftests/vfio/vfio_iommufd_hwpt_replace_test.c


base-commit: 6cd6c12031130a349a098dbeb19d8c3070d2dfbe
-- 
2.52.0.351.gbe84eed79e-goog


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] vfio: selftests: Add iommufd hwpt replace test
@ 2026-01-08 11:37 kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2026-01-08 11:37 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260107201800.2486137-4-skhawaja@google.com>
References: <20260107201800.2486137-4-skhawaja@google.com>
TO: Samiullah Khawaja <skhawaja@google.com>
TO: David Woodhouse <dwmw2@infradead.org>
TO: Lu Baolu <baolu.lu@linux.intel.com>
TO: Joerg Roedel <joro@8bytes.org>
TO: Will Deacon <will@kernel.org>
TO: Pasha Tatashin <pasha.tatashin@soleen.com>
TO: Jason Gunthorpe <jgg@ziepe.ca>
TO: David Matlack <dmatlack@google.com>
CC: Samiullah Khawaja <skhawaja@google.com>
CC: Robin Murphy <robin.murphy@arm.com>
CC: Pratyush Yadav <pratyush@kernel.org>
CC: Kevin Tian <kevin.tian@intel.com>
CC: Alex Williamson <alex@shazbot.org>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: iommu@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: kvm@vger.kernel.org
CC: Saeed Mahameed <saeedm@nvidia.com>
CC: Adithya Jayachandran <ajayachandra@nvidia.com>
CC: Parav Pandit <parav@nvidia.com>
CC: Leon Romanovsky <leonro@nvidia.com>
CC: William Tu <witu@nvidia.com>

Hi Samiullah,

kernel test robot noticed the following build errors:

[auto build test ERROR on 6cd6c12031130a349a098dbeb19d8c3070d2dfbe]

url:    https://github.com/intel-lab-lkp/linux/commits/Samiullah-Khawaja/iommu-vt-d-Allow-replacing-no_pasid-iommu_domain/20260108-041955
base:   6cd6c12031130a349a098dbeb19d8c3070d2dfbe
patch link:    https://lore.kernel.org/r/20260107201800.2486137-4-skhawaja%40google.com
patch subject: [PATCH 3/3] vfio: selftests: Add iommufd hwpt replace test
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: s390-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20260108/202601081206.dqP3SEbw-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260108/202601081206.dqP3SEbw-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202601081206.dqP3SEbw-lkp@intel.com/

All errors (new ones prefixed by >>):

>> tools/testing/selftests/vfio/vfio_iommufd_hwpt_replace_test.c:2:10: fatal error: sys/ioctl.h: No such file or directory
       2 | #include <sys/ioctl.h>
         |          ^~~~~~~~~~~~~
   compilation terminated.


vim +2 tools/testing/selftests/vfio/vfio_iommufd_hwpt_replace_test.c

fe33971532b06c Samiullah Khawaja 2026-01-07 @2  #include <sys/ioctl.h>
fe33971532b06c Samiullah Khawaja 2026-01-07  3  #include <sys/mman.h>
fe33971532b06c Samiullah Khawaja 2026-01-07  4  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-01-12  6:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07 20:17 [PATCH 0/3] iommu/vt-d: Add support to hitless replace IOMMU domain Samiullah Khawaja
2026-01-07 20:17 ` [PATCH 1/3] iommu/vt-d: Allow replacing no_pasid iommu_domain Samiullah Khawaja
2026-01-07 20:17 ` [PATCH 2/3] vfio: selftests: Add support of creating iommus from iommufd Samiullah Khawaja
2026-01-08  0:29   ` David Matlack
2026-01-09 21:39     ` Samiullah Khawaja
2026-01-07 20:18 ` [PATCH 3/3] vfio: selftests: Add iommufd hwpt replace test Samiullah Khawaja
2026-01-09  0:42   ` kernel test robot
2026-01-07 20:28 ` [PATCH 0/3] iommu/vt-d: Add support to hitless replace IOMMU domain Jason Gunthorpe
2026-01-07 20:46   ` Jason Gunthorpe
2026-01-09 20:06     ` Samiullah Khawaja
2026-01-11 22:14       ` Jason Gunthorpe
2026-01-12  6:57         ` Baolu Lu
  -- strict thread matches above, loose matches on Subject: below --
2026-01-08 11:37 [PATCH 3/3] vfio: selftests: Add iommufd hwpt replace test kernel test robot

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.