From: sashiko-bot@kernel.org
To: "Chengwen Feng" <fengchengwen@huawei.com>
Cc: kvm@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v22 06/13] PCI/TPH: Add helpers to check standard and extended TPH support
Date: Mon, 23 Nov 2026 02:47:24 +0000 [thread overview]
Message-ID: <sashiko-outbox-228563@kernel.org> (raw)
In-Reply-To: <20261123023628.7728-7-fengchengwen@huawei.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] PCI/TPH: pcie_std_tph_supported() ignores pci=notph
disablement
--
commit 27f6eee7fc0406491da1b19ccf2dc89f4e4551de
Author: Chengwen Feng <fengchengwen@huawei.com>
PCI/TPH: Add helpers to check standard and extended TPH support
This commit adds pcie_std_tph_supported() and pcie_ext_tph_supported()
helper functions to query standard and extended TPH requester support via
pdev->tph_max_type.
> diff --git a/include/linux/pci-tph.h b/include/linux/pci-tph.h
> index 04c93822ee6d6..5defe407ef75b 100644
> --- a/include/linux/pci-tph.h
> +++ b/include/linux/pci-tph.h
> @@ -23,6 +23,24 @@ enum tph_mem_type {
> };
>
> #ifdef CONFIG_PCIE_TPH
> +/**
> + * pcie_std_tph_supported - check standard TPH requester support
> + * @pdev: PCI device
> + */
> +static inline bool pcie_std_tph_supported(struct pci_dev *pdev)
> +{
> + return pdev->tph_max_type >= PCI_TPH_REQ_TPH_ONLY;
> +}
> +
> +/**
> + * pcie_ext_tph_supported - check extended TPH requester support
> + * @pdev: PCI device
> + */
> +static inline bool pcie_ext_tph_supported(struct pci_dev *pdev)
> +{
> + return pdev->tph_max_type == PCI_TPH_REQ_EXT_TPH;
> +}
[Severity: Medium]
Should pcie_std_tph_supported() and pcie_ext_tph_supported() return false
when the kernel is booted with pci=notph?
pci_tph_init() sets pdev->tph_max_type during enumeration without checking
pci_tph_disabled, while pcie_enable_tph_ext() rejects enabling TPH with
-EINVAL when pci_tph_disabled is true. When pci=notph is active, these
helpers still report TPH as supported, allowing the VFIO TPH feature in
the following patches to be enabled and exposed in virtual config space
even though guest writes to PCI_TPH_CTRL will fail in
pcie_enable_tph_ext().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123023628.7728-1-fengchengwen@huawei.com?part=6
next prev parent reply other threads:[~2026-11-23 2:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 2:36 [PATCH v22 00/13] vfio/pci: Add PCIe TPH support Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 01/13] PCI/TPH: Fix pcie_tph_get_st_table_loc() field extraction Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 02/13] PCI/TPH: Fix tph_enabled concurrent update race by bitfield packing Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 03/13] PCI/TPH: Cache negotiated max requester type at probe time Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 04/13] PCI/TPH: Refactor pcie_enable_tph and add requester variant Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 05/13] PCI/TPH: Refactor pcie_tph_get_cpu_st & " Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 06/13] PCI/TPH: Add helpers to check standard and extended TPH support Chengwen Feng
2026-11-23 2:47 ` sashiko-bot [this message]
2026-11-23 2:36 ` [PATCH v22 07/13] PCI/TPH: Add pcie_tph_set_st_entries() batch ST entry programming helper Chengwen Feng
2026-11-23 2:48 ` sashiko-bot
2026-11-23 2:36 ` [PATCH v22 08/13] PCI/TPH: Add pcie_tph_dsm_supported() helper to detect device TPH ST _DSM Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 09/13] vfio/pci: Reset PCIe TPH state on device open and close Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 10/13] vfio/pci: Add basic NO-ST TPH VFIO device feature support Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 11/13] vfio/pci: Add IV-ST TPH policy and TPH_PROGRAM batch programming support Chengwen Feng
2026-11-23 2:36 ` [PATCH v22 12/13] vfio/pci: Add DS-ST TPH policy and TPH_RESOLVE capability Chengwen Feng
2026-11-23 2:50 ` sashiko-bot
2026-11-23 2:36 ` [PATCH v22 13/13] vfio/pci: Expose per-device TPH state via debugfs Chengwen Feng
2026-11-23 2:52 ` [PATCH v22 00/13] vfio/pci: Add PCIe TPH support fengchengwen
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-228563@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=fengchengwen@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox