mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 2/2] selftests: iommu: skip when the mock device is not there
Date: Wed, 9 Sep 2026 13:33:47 -0300	[thread overview]
Message-ID: <20260909163347.GA4146467@nvidia.com> (raw)
In-Reply-To: <20260908214825.2682078-2-eva.kurchatova@virtuozzo.com>

On Wed, Sep 09, 2026 at 12:48:12AM +0300, Eva Kurchatova wrote:
> Both iommufd tests need the mock device the iommufd module registers
> under CONFIG_IOMMUFD_TEST, and they open /dev/iommu in every fixture
> without checking, so on a kernel that does not provide it every case
> fails on the open.
> 
> Checking the open is not enough on its own. /dev/iommu appears as soon
> as the iommufd module is loaded, which says nothing about the mock
> device: the release config here is CONFIG_IOMMUFD=m with
> CONFIG_IOMMUFD_TEST unset, so the open succeeds and the tests fail later
> in the ioctls that drive the mock device instead. Only the debug config
> sets CONFIG_IOMMUFD_TEST.
> 
> /sys/bus/iommufd_mock covers both, it exists only once the module is
> loaded and the kernel was built with CONFIG_IOMMUFD_TEST. Check for it
> once before handing over to the harness, rather than in each of the
> fixtures, and report a skip. test_harness_run() is what TEST_HARNESS_MAIN
> calls anyway, so the tests still run exactly as they did.
> 
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
> ---
>  tools/testing/selftests/iommu/iommufd.c          | 15 ++++++++++++++-
>  tools/testing/selftests/iommu/iommufd_fail_nth.c | 15 ++++++++++++++-
>  2 files changed, 28 insertions(+), 2 deletions(-)

Applied thanks

Jason

  reply	other threads:[~2026-09-09 16:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 21:48 [PATCH 1/2] selftests: iommu: suppress -Warray-bounds in _test_cmd_get_hw_info Eva Kurchatova
2026-09-08 21:48 ` [PATCH 2/2] selftests: iommu: skip when the mock device is not there Eva Kurchatova
2026-09-09 16:33   ` Jason Gunthorpe [this message]
2026-09-09 16:31 ` [PATCH 1/2] selftests: iommu: suppress -Warray-bounds in _test_cmd_get_hw_info Jason Gunthorpe

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=20260909163347.GA4146467@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=iommu@lists.linux.dev \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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®