From: Alex Williamson <alex@shazbot.org>
To: Guixin Liu <kanie@linux.alibaba.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>,
Pranjal Shrivastava <praan@google.com>,
Brett Creeley <brett.creeley@amd.com>,
Leon Romanovsky <leon@kernel.org>,
kvm@vger.kernel.org, xlpang@linux.alibaba.com,
oliver.yang@linux.alibaba.com, alex@shazbot.org
Subject: Re: [PATCH] vfio/pci: make nointxmask and disable_idle_d3 module params read-only
Date: Thu, 11 Jun 2026 12:32:00 -0600 [thread overview]
Message-ID: <20260611123200.4765b9cb@shazbot.org> (raw)
In-Reply-To: <20260610054734.3591169-1-kanie@linux.alibaba.com>
On Wed, 10 Jun 2026 13:47:34 +0800
Guixin Liu <kanie@linux.alibaba.com> wrote:
> The nointxmask and disable_idle_d3 module parameters are registered with
> S_IWUSR, exposing a writable node under /sys/module/vfio_pci/parameters/.
> However, writing to them at runtime has no effect on driver behaviour:
>
> - Both values are copied into vfio-pci-core's own static variables via
> vfio_pci_core_set_params(), which is only called once at module init
> time. A later write to the vfio_pci front-end variable is never
> propagated to the core.
>
> - disable_idle_d3 additionally gates paired runtime PM get/put calls
> across the probe/remove (register/unregister) and open/close
> (enable/disable) life cycles. Changing it at runtime would tear
> these pairs apart and leak or underflow the runtime PM usage counter.
>
> - nointxmask is latched into per-device state (vdev->nointx /
> vdev->pci_2_3) at device open time, so a later change can only affect
> newly opened devices and yields inconsistent behaviour.
>
> These parameters are effectively load-time constants. Drop the write
> permission so they match disable_vga, which is already read-only, and to
> stop misleading users into thinking they are runtime tunable.
>
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> ---
> drivers/vfio/pci/vfio_pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks for the patch, I think this actually highlights a broader
problem. Making disable_idle_d3 a read-only module parameter in
vfio-pci doesn't change that vfio-pci can be unload and reloaded with
different parameter values, therefore the gap is not closed. We need
to use per device setting, latched at device probe, which actually
also returns some value to these parameters being runtime modified.
This feature was inadvertently lost in the vfio-pci-core split.
I've copied you on the broader fix:
https://lore.kernel.org/kvm/20260611182528.4004073-1-alex.williamson@nvidia.com/T/#t
Thanks,
Alex
prev parent reply other threads:[~2026-06-11 18:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 5:47 [PATCH] vfio/pci: make nointxmask and disable_idle_d3 module params read-only Guixin Liu
2026-06-11 18:32 ` 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=20260611123200.4765b9cb@shazbot.org \
--to=alex@shazbot.org \
--cc=brett.creeley@amd.com \
--cc=jgg@ziepe.ca \
--cc=kanie@linux.alibaba.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=leon@kernel.org \
--cc=oliver.yang@linux.alibaba.com \
--cc=praan@google.com \
--cc=xlpang@linux.alibaba.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