From: sashiko-bot@kernel.org
To: "Simon Song" <xinmengs@nvidia.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2 1/1] vfio/pci: Remove the core dependency on driver data
Date: Wed, 30 Sep 2026 14:47:11 +0000 [thread overview]
Message-ID: <20260930144711.97CB91F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260930143641.4160785-2-xinmengs@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] pm: dev_pm_ops unconditionally assigned without pm_ptr()
--
commit 3f91e92ded670b6d793f7c9ea8fda1f011d465c3
Author: Simon Song <xinmengs@nvidia.com>
vfio/pci: Remove the core dependency on driver data
This commit introduces VFIO_PCI_CORE_DEFINE_CALLBACKS to generate wrapper
code for each vfio variant driver. It updates variant drivers to store their
private structures in driver_data and use the generated wrappers.
Link: https://lore.kernel.org/all/DLFD2ZDSK9YQ.3A4R66G8UJMD8@kernel.org/
[Severity: Low]
In drivers/vfio/pci/vfio_pci.c, inside the vfio_pci_driver definition
around line 260, the driver pm pointer is assigned directly to
&vfio_pci_pm_ops.
Does this unconditional assignment prevent the compiler from eliminating
the dev_pm_ops structure when CONFIG_PM is disabled? When PM support is
disabled, the dev_pm_ops structures will remain in the compiled binary as
dead code. As mandated by the PM subsystem guidelines, is it possible to
wrap the pointer assignment with pm_ptr() (for example,
.pm = pm_ptr(&vfio_pci_pm_ops)) so the dead structure is safely dropped?
[Severity: Low]
Similarly, in drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c around line
1728, the hisi_acc_vfio_pci_driver assigns the pm field to
&hisi_acc_vf_pm_ops without using the pm_ptr() macro wrapper. Does this
result in the same dead code issue when CONFIG_PM=n?
[Severity: Low]
In drivers/vfio/pci/ism/main.c around line 395, ism_vfio_pci_driver also
unconditionally assigns .pm = &ism_vfio_pm_ops. Should this also be
wrapped with pm_ptr() to ensure the dead code is eliminated?
[Severity: Low]
In drivers/vfio/pci/mlx5/main.c around line 1454, the mlx5vf_pci_driver
assigns .pm = &mlx5vf_pm_ops. Can we use pm_ptr(&mlx5vf_pm_ops) here as
well to avoid leaving an unused structure behind when power management
is disabled?
[Severity: Low]
In drivers/vfio/pci/nvgrace-gpu/main.c around line 1427, the
nvgrace_gpu_vfio_pci_driver directly assigns .pm = &nvgrace_gpu_pm_ops.
Would applying pm_ptr() here ensure consistency with PM guidelines and
allow the structure to be compiled out correctly?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260930143641.4160785-1-xinmengs@nvidia.com?part=1
next prev parent reply other threads:[~2026-09-30 14:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 14:36 [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song
2026-09-30 14:36 ` [PATCH v2 1/1] vfio/pci: Remove the core dependency on driver data Simon Song
2026-09-30 14:47 ` sashiko-bot [this message]
2026-09-30 17:40 ` Danilo Krummrich
2026-10-02 20:25 ` Simon Song
2026-09-30 15:32 ` [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song
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=20260930144711.97CB91F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xinmengs@nvidia.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