Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Narayana Murty N" <nnmlinux@linux.ibm.com>
Cc: kvm@vger.kernel.org
Subject: Re: [RFC PATCH 2/6] selftests/vfio: add sPAPR TCE v2 IOMMU mode
Date: Fri, 03 Jul 2026 08:09:51 +0000	[thread overview]
Message-ID: <20260703080951.7F2721F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260703032806.40946-3-nnmlinux@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The fallback default IOMMU mode remains hardcoded to MODE_IOMMUFD, causing test suites to crash out-of-the-box on PowerPC where IOMMUFD is not supported for VFIO.
--

commit 8dfc3e7df9b7153c07746fbc4679447d70174937
Author: Narayana Murty N <nnmlinux@linux.ibm.com>

selftests/vfio: add sPAPR TCE v2 IOMMU mode

Add a PowerPC-specific VFIO selftest IOMMU mode for sPAPR TCE v2.
The new mode uses the legacy VFIO container interface with
VFIO_SPAPR_TCE_v2_IOMMU.

[ ... ]

> diff --git a/tools/testing/selftests/vfio/lib/iommu.c b/tools/testing/selftests/vfio/lib/iommu.c
> index 035dac069d601..e86457a715bf7 100644
> --- a/tools/testing/selftests/vfio/lib/iommu.c
> +++ b/tools/testing/selftests/vfio/lib/iommu.c
> @@ -47,6 +47,13 @@ static const struct iommu_mode iommu_modes[] = {
>  	{
>  		.name = MODE_IOMMUFD,
>  	},
> +#ifdef __powerpc__
> +	{
> +		.name = MODE_VFIO_SPAPR_TCE_V2_IOMMU,
> +		.container_path = "/dev/vfio/vfio",
> +		.iommu_type = VFIO_SPAPR_TCE_v2_IOMMU,
> +	},
> +#endif
>  };

[Severity: Medium]
Since default_iommu_mode remains hardcoded to MODE_IOMMUFD earlier in this
file, does this cause test suites like vfio_pci_driver_test to crash
out-of-the-box on PowerPC systems?

For instance, device_has_selftests_driver() uses this default mode directly
before checking platform-specific fixtures:

tools/testing/selftests/vfio/vfio_pci_driver_test.c:device_has_selftests_driver() {
    ...
    iommu = iommu_init(default_iommu_mode);
    ...
}

If /dev/iommu cannot be opened or device bindings fail on PowerPC because
IOMMUFD isn't supported, does this trigger a failed assertion
(VFIO_ASSERT_GT(iommu->iommufd, 0)) and abort execution rather than
skipping gracefully?

Should default_iommu_mode be conditionally defined for PowerPC to use
MODE_VFIO_SPAPR_TCE_V2_IOMMU as the default fallback?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260703032806.40946-1-nnmlinux@linux.ibm.com?part=2

  reply	other threads:[~2026-07-03  8:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  3:28 [RFC PATCH 0/6] selftests/vfio: Add sPAPR TCE v2 coverage Narayana Murty N
2026-07-03  3:28 ` [RFC PATCH 1/6] selftests/vfio: allow selecting IOMMU backend from environment Narayana Murty N
2026-07-03  8:06   ` sashiko-bot
2026-07-03  3:28 ` [RFC PATCH 2/6] selftests/vfio: add sPAPR TCE v2 IOMMU mode Narayana Murty N
2026-07-03  8:09   ` sashiko-bot [this message]
2026-07-03  3:28 ` [RFC PATCH 3/6] selftests/vfio: add sPAPR TCE v2 DMA window helpers Narayana Murty N
2026-07-03  8:05   ` sashiko-bot
2026-07-03  3:28 ` [RFC PATCH 4/6] selftests/vfio: Exercise sPAPR DDW path for hugepage DMA mappings Narayana Murty N
2026-07-03  8:11   ` sashiko-bot
2026-07-03  3:28 ` [RFC PATCH 5/6] selftests/vfio: Accept sPAPR errno for DMA range overflow Narayana Murty N
2026-07-03  8:08   ` sashiko-bot
2026-07-03  3:28 ` [RFC PATCH 6/6] selftests/vfio: Enable VFIO selftests on ppc64 and ppc64le Narayana Murty N
2026-07-03  8:14   ` sashiko-bot
2026-07-03  8:28 ` [RFC PATCH 0/6] selftests/vfio: Add sPAPR TCE v2 coverage Harsh Prateek Bora

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=20260703080951.7F2721F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=nnmlinux@linux.ibm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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