mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: David Matlack <dmatlack@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, stable@vger.kernel.org,
	Abhishek Sahu <abhsahu@nvidia.com>,
	Raghavendra Rao Ananta <rananta@google.com>,
	Shuah Khan <shuah@kernel.org>,
	alex@shazbot.org
Subject: Re: [PATCH 5/5] vfio: selftests: Add test for device power state transitions
Date: Tue, 3 Nov 2026 15:35:53 -0700	[thread overview]
Message-ID: <20261103153553.6caa7d7d@shazbot.org> (raw)
In-Reply-To: <20261029203324.1637772-6-dmatlack@google.com>

On Thu, 29 Oct 2026 20:33:24 +0000
David Matlack <dmatlack@google.com> wrote:
> +/*
> + * Put the device into D3hot via config space and then close it. VFIO must
> + * return the device to D0 when it is closed.
> + */

But we're only testing that it's re-opened into D0, there are multiple
ways that could have happened.  It's pretty common that a guest
shutdown might put devices into a low power state and it's brought back
to D0 on close, on reset, on the next open, or even on the reset in
open.  So I don't think we're testing what we claim to test here.  I'm
not sure this specific D0 transition is observable, even if we were to
resort to pci-sysfs.  Thanks,

Alex

> +TEST_F(vfio_pci_power_state_test, close_in_d3hot)
> +{
> +	power_state_set(self->device, self->pm_cap, D3HOT);
> +	ASSERT_EQ(power_state_get(self->device, self->pm_cap), D3HOT);
> +
> +	vfio_pci_device_cleanup(self->device);
> +
> +	self->device = vfio_pci_device_init(device_bdf, self->iommu);
> +	ASSERT_EQ(power_state_get(self->device, self->pm_cap), D0);
> +}

      reply	other threads:[~2026-11-03 22:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 20:33 [PATCH 0/5] vfio/pci: Fix power state race with SR-IOV enablement David Matlack
2026-10-29 20:33 ` [PATCH 1/5] vfio/pci: Hold memory_lock for all calls to vfio_pci_set_power_state() David Matlack
2026-10-29 20:33 ` [PATCH 2/5] vfio/pci: Annotate lockless accesses to vdev->sriov_active David Matlack
2026-10-29 20:33 ` [PATCH 3/5] vfio: selftests: Add vfio_pci_find_capability() David Matlack
2026-10-29 20:33 ` [PATCH 4/5] vfio: selftests: Add sysfs_kernel_warn_count_get() David Matlack
2026-10-29 20:33 ` [PATCH 5/5] vfio: selftests: Add test for device power state transitions David Matlack
2026-11-03 22:35   ` Alex Williamson [this message]

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=20261103153553.6caa7d7d@shazbot.org \
    --to=alex@shazbot.org \
    --cc=abhsahu@nvidia.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rananta@google.com \
    --cc=shuah@kernel.org \
    --cc=stable@vger.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®