From: sashiko-bot@kernel.org
To: "Farhan Ali" <alifm@linux.ibm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v16 3/7] PCI: Fail FLR when config space is inaccessible
Date: Thu, 14 May 2026 22:41:15 +0000 [thread overview]
Message-ID: <20260514224115.C8201C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514180059.1553-4-alifm@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Logic Error in Reset Capability Probing (Permanent Loss of FLR Support)
- [High] Un-ratelimited Warning Log Flooding (Denial of Service)
--
commit d8b99b3d5048ef035997beff7b1d31f361be5f9b
Author: Farhan Ali <alifm@linux.ibm.com>
PCI: Fail FLR when config space is inaccessible
This commit adds a check to validate if a device's config space is
accessible before performing an FLR reset. If the config space is not
accessible, the reset fails early.
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
[ ... ]
> @@ -4396,6 +4396,9 @@ int pcie_reset_flr(struct pci_dev *dev, bool probe)
> if (!(dev->devcap & PCI_EXP_DEVCAP_FLR))
> return -ENOTTY;
>
> + if (!pci_dev_config_accessible(dev, "FLR"))
Does this fast-fail path bypass the 60-second blocking timeout previously
enforced by pci_dev_wait() when reading ~0 from an inaccessible config
space?
Looking at pci_dev_config_accessible(), it prints an un-ratelimited warning
if the config space is inaccessible. If an unprivileged user or VM guest
repeatedly triggers a reset on a passed-through PCI device via the
VFIO_DEVICE_RESET ioctl, could this flood the kernel log and overwhelm the
host console?
> + return -ENOTTY;
> +
> if (probe)
> return 0;
If a device is temporarily inaccessible during system initialization or sysfs
writes when pcie_reset_flr() is called with probe=true, will this falsely
report that the device does not support FLR?
It appears this would cause the PCI subsystem to permanently omit the FLR
method from the device's cached capability list, preventing the device from
ever using FLR even after the link state recovers.
Does this also cause normal lockless capability queries to trigger active PCI
config reads and spurious kernel warnings?
Would it be better to move the accessibility check after the probe check?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260514180059.1553-1-alifm@linux.ibm.com?part=3
next prev parent reply other threads:[~2026-05-14 22:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 18:00 [PATCH v16 0/7] Error recovery for vfio-pci devices on s390x Farhan Ali
2026-05-14 18:00 ` [PATCH v16 1/7] PCI: Allow per function PCI slots to fix slot reset on s390 Farhan Ali
2026-05-14 21:36 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 2/7] PCI: Avoid saving config space state if inaccessible Farhan Ali
2026-05-14 22:08 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 3/7] PCI: Fail FLR when config space is inaccessible Farhan Ali
2026-05-14 22:41 ` sashiko-bot [this message]
2026-05-14 18:00 ` [PATCH v16 4/7] s390/pci: Store PCI error information for passthrough devices Farhan Ali
2026-05-14 22:53 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 5/7] vfio-pci/zdev: Add a device feature for error information Farhan Ali
2026-05-14 23:27 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 6/7] vfio/pci: Add a reset_done callback for vfio-pci driver Farhan Ali
2026-05-14 23:54 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 7/7] vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX Farhan Ali
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=20260514224115.C8201C2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alifm@linux.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.