Re: [PATCH 5/5] vfio: selftests: Add test for device power state transitions
From: David Matlack
Date: Wed Nov 04 2026 - 14:07:56 EST
On 2026-11-03 03:35 PM, Alex Williamson wrote:
> On Thu, 29 Oct 2026 20:33:24 +0000
> David Matlack <dmatlack@xxxxxxxxxx> 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.
You are right, this comment is not accurate. The goal of this test is
to exercise closing a device while it is in D3hot. The close should
succeed and the device should be in D0 after it is next opened. The
transition from D3hot to D0 could happen during close, open, or anywhere
in the middle, without changing the uAPI.
I'll fixup the comment, changelog, and test name in v2.