All of lore.kernel.org
 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 1/6] selftests/vfio: allow selecting IOMMU backend from environment
Date: Fri, 03 Jul 2026 08:06:37 +0000	[thread overview]
Message-ID: <20260703080637.E13621F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260703032806.40946-2-nnmlinux@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] A syntax error is introduced at the end of the file due to stray duplicated code.
- [Low] The macro `MODE_VFIO_SPAPR_TCE_V2_IOMMU` is referenced but never defined, breaking the build on PowerPC.
--

commit 711defe4ecc8034b88efefbbf07a52494153b474
Author: Narayana Murty N <nnmlinux@linux.ibm.com>

selftests/vfio: allow selecting IOMMU backend from environment
    
This commit adds support for selecting the IOMMU mode through the
VFIO_SELFTESTS_IOMMU_MODE environment variable. It validates the environment
variable against a list of supported modes, including sPAPR TCE v2 on PowerPC.

> diff --git a/tools/testing/selftests/vfio/lib/libvfio.c b/tools/testing/selftests/vfio/lib/libvfio.c
> index 3a3d1ed635c1d..617c8dc7288ca 100644
> --- a/tools/testing/selftests/vfio/lib/libvfio.c
> +++ b/tools/testing/selftests/vfio/lib/libvfio.c

[ ... ]

> @@ -101,3 +101,42 @@ void *mmap_reserve(size_t size, size_t align, size_t offset)
>  
>  	return map_align;
>  }
> +
> +static const char *get_iommu_mode_env(void)
> +{
> +	const char *mode;
> +	static const char * const valid_modes[] = {
> +		MODE_VFIO_TYPE1_IOMMU,
> +		MODE_VFIO_TYPE1V2_IOMMU,
> +		MODE_IOMMUFD_COMPAT_TYPE1,
> +		MODE_IOMMUFD_COMPAT_TYPE1V2,
> +		MODE_IOMMUFD,
> +#ifdef __powerpc__
> +		MODE_VFIO_SPAPR_TCE_V2_IOMMU,

[Severity: Low]
Does this break the build on PowerPC because MODE_VFIO_SPAPR_TCE_V2_IOMMU is
referenced but never defined?

I notice this is fixed in a later commit
8dfc3e7df9b7153c07746fbc4679447d70174937 ("selftests/vfio: add sPAPR TCE v2
IOMMU mode"), but introducing an undefined identifier here will cause git
bisect failures for PowerPC builds.

> +#endif
> +	};

[ ... ]

> +const char *vfio_selftests_get_iommu_mode(void)
> +{
> +	return get_iommu_mode_env();
> +}
> +
> +	return map_align;
> +}

[Severity: Low]
Is this stray return statement and closing brace a copy-paste error?

It causes a syntax error at the file scope. I see this is removed in a later
commit 2deeaa397a1d09614f068ff5ae82a0732c573cd4 ("selftests/vfio: add sPAPR
TCE v2 DMA window helpers"), but having it in this patch breaks the build
and git bisect.

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

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

Thread overview: 21+ 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 [this message]
2026-07-06 21:49   ` David Matlack
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
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-06 22:04   ` David Matlack
2026-07-06 22:17   ` David Matlack
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-06 22:33   ` David Matlack
2026-07-06 22:41     ` David Matlack
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-06 22:47   ` David Matlack
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
2026-07-06 22:55 ` David Matlack

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=20260703080637.E13621F00A3A@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 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.