Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: alex@shazbot.org, dmatlack@google.com, shuah@kernel.org
Cc: amastro@fb.com, rananta@google.com, nnmlinux@linux.ibm.com,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, vaibhav@linux.ibm.com,
	sbhat@linux.ibm.com, harshpb@linux.ibm.com
Subject: [RFC PATCH 5/6] selftests/vfio: Accept sPAPR errno for DMA range overflow
Date: Thu,  2 Jul 2026 23:28:05 -0400	[thread overview]
Message-ID: <20260703032806.40946-6-nnmlinux@linux.ibm.com> (raw)
In-Reply-To: <20260703032806.40946-1-nnmlinux@linux.ibm.com>

Accept sPAPR errno for DMA range overflow

The DMA map limit test expects an overflowing IOVA range to fail with
-EOVERFLOW. That matches the Type1 and iommufd paths.

On sPAPR TCE v2, the same invalid range is rejected as outside the active
TCE window and currently returns -ENXIO. Treat that as the expected ppc
result for this RFC while keeping the existing -EOVERFLOW expectation for
other backends.

This keeps the overflow test enabled for sPAPR TCE v2 instead of skipping
it.

Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
---
 tools/testing/selftests/vfio/vfio_dma_mapping_test.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/testing/selftests/vfio/vfio_dma_mapping_test.c b/tools/testing/selftests/vfio/vfio_dma_mapping_test.c
index 4411fdbd56da..cd2d3276a46c 100644
--- a/tools/testing/selftests/vfio/vfio_dma_mapping_test.c
+++ b/tools/testing/selftests/vfio/vfio_dma_mapping_test.c
@@ -316,10 +316,18 @@ TEST_F(vfio_dma_map_limit_test, overflow)
 	region->size = self->mmap_size;
 
 	rc = __iommu_map(self->iommu, region);
+#ifdef __powerpc__
+	ASSERT_EQ(rc, -ENXIO);
+#else
 	ASSERT_EQ(rc, -EOVERFLOW);
+#endif
 
 	rc = __iommu_unmap(self->iommu, region, NULL);
+#ifdef __powerpc__
+	ASSERT_EQ(rc, -ENXIO);
+#else
 	ASSERT_EQ(rc, -EOVERFLOW);
+#endif
 }
 
 int main(int argc, char *argv[])
-- 
2.51.1


  parent reply	other threads:[~2026-07-03  7:53 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
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 ` Narayana Murty N [this message]
2026-07-03  8:08   ` [RFC PATCH 5/6] selftests/vfio: Accept sPAPR errno for DMA range overflow 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=20260703032806.40946-6-nnmlinux@linux.ibm.com \
    --to=nnmlinux@linux.ibm.com \
    --cc=alex@shazbot.org \
    --cc=amastro@fb.com \
    --cc=dmatlack@google.com \
    --cc=harshpb@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rananta@google.com \
    --cc=sbhat@linux.ibm.com \
    --cc=shuah@kernel.org \
    --cc=vaibhav@linux.ibm.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