RE: [PATCH v4 0/2] PCI/P2PDMA: Allow P2PDMA on Intel Xeon server CPUs
From: Popov, Pavel E
Date: Tue Oct 20 2026 - 15:37:55 EST
Leon,
The #ifdef CONFIG_X86 in cpu_supports_p2pdma() came with the AMD check.
Would it work for you if I move the includes into that single #ifdef
block, next to the CPU check? Some multi-arch code does the same:
https://git.kernel.org/torvalds/c/c7be64355fcc (drivers/acpi/mipi-disco-img.c)
https://git.kernel.org/torvalds/c/7f3cfb7943d2 (drivers/cpufreq/cpufreq_ondemand.h)
Thanks,
Pavel
> -----Original Message-----
> From: Leon Romanovsky <leon@xxxxxxxxxx>
> Sent: Tuesday, October 20, 2026 11:40 AM
> To: Popov, Pavel E <pavel.e.popov@xxxxxxxxx>
> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>; Logan Gunthorpe
> <logang@xxxxxxxxxxxx>; Lukas Wunner <lukas@xxxxxxxxx>; Jim Chow
> <jim.chow@xxxxxxxxxxxx>; Radu Rugina <radu.rugina@xxxxxxxxxxxx>;
> Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx>; Wei Liu
> <wei.liu@xxxxxxxxxx>; Michael Kelley <mhklinux@xxxxxxxxxxx>; Nathan
> Ciobanu <nathan.d.ciobanu@xxxxxxxxxxxxxxx>; bcm-kernel-feedback-
> list@xxxxxxxxxxxx; virtualization@xxxxxxxxxxxxxxx; linux-
> hyperv@xxxxxxxxxxxxxxx; linux-pci@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 0/2] PCI/P2PDMA: Allow P2PDMA on Intel Xeon
> server CPUs
>
> On Tue, Oct 20, 2026 at 10:37:34AM -0700, Pavel Popov wrote:
> > VMware and Hyper-V expose passthrough devices to guest VMs without an
> > explicit host bridge device. Consequently, host_bridge_whitelist()
> > cannot automatically identify the underlying host bridge structure,
> > causing Peer-to-Peer DMA (P2PDMA) requests to be rejected unless the
> > device IDs are explicitly listed in pci_p2pdma_whitelist[]. To enable
> > P2PDMA on Intel hosts, this series extends cpu_supports_p2pdma(),
> > which so far covers AMD Zen and newer, with an explicit list of Intel
> > Xeon server generations.
> >
> > Patch 1 moves the CONFIG_X86 #ifdef out of cpu_supports_p2pdma().
> > Patch 2 is the v3 patch rebased on it, with Logan's Reviewed-by
> > carried over; the Xeon list and the check are unchanged.
> >
> > Changes in v4:
> > - Add 1/2, moving the CONFIG_X86 #ifdef out of cpu_supports_p2pdma()
> > (Logan Gunthorpe, Leon Romanovsky)
> > - Keep the #ifdef around the asm/ includes, as these headers exist
> > only on x86 (Bjorn Helgaas)
>
> I'm confident that this is wrong usage of asm headers.
>
> Thanks