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 <[email protected]>
> Sent: Tuesday, October 20, 2026 11:40 AM
> To: Popov, Pavel E <[email protected]>
> Cc: Bjorn Helgaas <[email protected]>; Logan Gunthorpe
> <[email protected]>; Lukas Wunner <[email protected]>; Jim Chow
> <[email protected]>; Radu Rugina <[email protected]>;
> Alexey Makhalov <[email protected]>; Wei Liu
> <[email protected]>; Michael Kelley <[email protected]>; Nathan
> Ciobanu <[email protected]>; bcm-kernel-feedback-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]
> 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

Reply via email to