From: sashiko-bot@kernel.org
To: "Jose Ignacio Tornos Martinez" <jtornosm@redhat.com>
Cc: kvm@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 7/7] ath12k: Use VFIO MSI cache when available
Date: Sun, 11 Oct 2026 08:02:39 +0000 [thread overview]
Message-ID: <sashiko-outbox-167115@kernel.org> (raw)
In-Reply-To: <20261011074514.515894-8-jtornosm@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] pci: unsafe linear scan of extended config space on baremetal
--
commit 7935697effd72af8780a5758936f11256bc2c6d5
Author: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
ath12k: Use VFIO MSI cache when available
This commit modifies the ath12k driver to search for a VFIO MSI cache in the
PCIe extended config space. It uses these cached host MSI physical addresses
for firmware configuration instead of guest IOVA addresses, resolving issues
when the device is passed through to a VM via VFIO.
> diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
> index f7879fb48d32e..8e92213fd3fce 100644
> --- a/drivers/net/wireless/ath/ath12k/pci.c
> +++ b/drivers/net/wireless/ath/ath12k/pci.c
[ ... ]
> @@ -811,6 +815,39 @@ static int ath12k_pci_msi_alloc(struct ath12k_pci *ab_pci)
>
> ath12k_info(ab, "MSI vectors: %d\n", num_vectors);
>
> + /*
> + * Try to get host MSI address from VFIO cache.
> + * When running on a VM, the ath12k firmware requires physical host
> + * MSI addresses and cannot handle guest IOVA addresses.
> + * qcom-vfio-pci writes host MSI values to extended config space with
> + * a magic signature "QMSI" for discovery. Search for it.
> + */
> + msi_offset = qcom_vfio_find_msi_cache(ab_pci->pdev);
[Severity: Medium]
Is it safe to unconditionally call qcom_vfio_find_msi_cache() on all setups,
including baremetal hardware?
This function performs a linear scan of the extended config space:
include/linux/qcom_vfio.h:qcom_vfio_find_msi_cache() {
...
for (offset = PCI_CFG_SPACE_SIZE;
offset <= PCI_CFG_SPACE_EXP_SIZE - QCOM_VFIO_MSI_SPACE_SIZE;
offset += 4) {
if (pci_read_config_dword(pdev, offset, &magic))
continue;
...
}
Reading arbitrary PCIe configuration registers on baremetal hardware can
trigger read-to-clear side effects, unsupported request (UR) errors, or
Advanced Error Reporting (AER) faults.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261011074514.515894-1-jtornosm@redhat.com?part=7
next prev parent reply other threads:[~2026-10-11 8:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 7:45 [PATCH v2 0/7] Enable Qualcomm WiFi PCIe passthrough to VMs Jose Ignacio Tornos Martinez
2026-10-11 7:45 ` [PATCH v2 1/7] PCI: Add pci_find_free_ext_cap_offset() helper Jose Ignacio Tornos Martinez
2026-10-11 7:57 ` sashiko-bot
2026-10-11 7:45 ` [PATCH v2 2/7] vfio: Add qcom_vfio.h header for MSI cache protocol Jose Ignacio Tornos Martinez
2026-10-11 7:59 ` sashiko-bot
2026-10-11 7:45 ` [PATCH v2 3/7] vfio/pci: Add qcom-vfio-pci variant driver Jose Ignacio Tornos Martinez
2026-10-11 8:07 ` sashiko-bot
2026-10-11 7:45 ` [PATCH v2 4/7] ath11k: add PCIe link recovery retry Jose Ignacio Tornos Martinez
2026-10-11 7:59 ` sashiko-bot
2026-10-11 7:45 ` [PATCH v2 5/7] ath11k: Use VFIO MSI cache when available Jose Ignacio Tornos Martinez
2026-10-11 8:04 ` sashiko-bot
2026-10-11 7:45 ` [PATCH v2 6/7] ath12k: add PCIe link recovery retry Jose Ignacio Tornos Martinez
2026-10-11 8:05 ` sashiko-bot
2026-10-11 7:45 ` [PATCH v2 7/7] ath12k: Use VFIO MSI cache when available Jose Ignacio Tornos Martinez
2026-10-11 8:02 ` sashiko-bot [this message]
2026-10-11 18:22 ` [PATCH v2 0/7] Enable Qualcomm WiFi PCIe passthrough to VMs Jeff Johnson
2026-10-12 14:48 ` Jason Gunthorpe
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=sashiko-outbox-167115@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jtornosm@redhat.com \
--cc=kvm@vger.kernel.org \
--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.