From: Pavel Popov <pavel.e.popov@intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Logan Gunthorpe <logang@deltatee.com>
Cc: Pavel Popov <pavel.e.popov@intel.com>,
Leon Romanovsky <leon@kernel.org>, Lukas Wunner <lukas@wunner.de>,
Jim Chow <jim.chow@broadcom.com>,
Radu Rugina <radu.rugina@broadcom.com>,
Alexey Makhalov <alexey.makhalov@broadcom.com>,
Wei Liu <wei.liu@kernel.org>,
Michael Kelley <mhklinux@outlook.com>,
Nathan Ciobanu <nathan.d.ciobanu@linux.intel.com>,
bcm-kernel-feedback-list@broadcom.com,
virtualization@lists.linux.dev, linux-hyperv@vger.kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 1/2] PCI/P2PDMA: Move CONFIG_X86 #ifdef out of cpu_supports_p2pdma()
Date: Tue, 20 Oct 2026 10:37:35 -0700 [thread overview]
Message-ID: <20261020173736.81755-2-pavel.e.popov@intel.com> (raw)
In-Reply-To: <20261020173736.81755-1-pavel.e.popov@intel.com>
cpu_supports_p2pdma() has an #ifdef CONFIG_X86 block inside the
function body. Put the whole function under #ifdef CONFIG_X86 instead,
with a stub returning false for !CONFIG_X86.
No functional change.
Suggested-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
---
drivers/pci/p2pdma.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 9334eb314663..6b4f0843b404 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -519,18 +519,23 @@ static void seq_buf_print_bus_devfn(struct seq_buf *buf, struct pci_dev *pdev)
seq_buf_printf(buf, "%s;", pci_name(pdev));
}
+#ifdef CONFIG_X86
static bool cpu_supports_p2pdma(void)
{
-#ifdef CONFIG_X86
struct cpuinfo_x86 *c = &cpu_data(0);
/* Any AMD CPU whose family ID is Zen or newer supports p2pdma */
if (c->x86_vendor == X86_VENDOR_AMD && c->x86 >= 0x17)
return true;
-#endif
return false;
}
+#else /* !CONFIG_X86 */
+static bool cpu_supports_p2pdma(void)
+{
+ return false;
+}
+#endif /* CONFIG_X86 */
static const struct pci_p2pdma_whitelist_entry {
unsigned short vendor;
--
2.53.0
next prev parent reply other threads:[~2026-10-20 17:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 17:37 [PATCH v4 0/2] PCI/P2PDMA: Allow P2PDMA on Intel Xeon server CPUs Pavel Popov
2026-10-20 17:37 ` Pavel Popov [this message]
2026-10-20 17:37 ` [PATCH v4 2/2] " Pavel Popov
2026-10-20 18:40 ` [PATCH v4 0/2] " Leon Romanovsky
2026-10-20 19:37 ` Popov, Pavel E
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=20261020173736.81755-2-pavel.e.popov@intel.com \
--to=pavel.e.popov@intel.com \
--cc=alexey.makhalov@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=jim.chow@broadcom.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=lukas@wunner.de \
--cc=mhklinux@outlook.com \
--cc=nathan.d.ciobanu@linux.intel.com \
--cc=radu.rugina@broadcom.com \
--cc=virtualization@lists.linux.dev \
--cc=wei.liu@kernel.org \
/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
all inboxes | Powered by JetHome®