From: sashiko-bot@kernel.org
To: "Pavel Popov" <pavel.e.popov@intel.com>
Cc: linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI/P2PDMA: Allow P2PDMA in Hyper-V guests on Intel hosts
Date: Fri, 09 Oct 2026 15:47:57 +0000 [thread overview]
Message-ID: <sashiko-outbox-165797@kernel.org> (raw)
In-Reply-To: <20261009154034.82321-3-pavel.e.popov@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] pci/p2pdma: numerical x86_vfm comparison matches older unsupported CPUs
--
commit 8df450ad902e18b3a50517392110d5d4750ef685
Author: Pavel Popov <pavel.e.popov@intel.com>
PCI/P2PDMA: Allow P2PDMA in Hyper-V guests on Intel hosts
Peer-to-Peer DMA (P2PDMA) between two devices requires either a shared
upstream bridge or a host bridge matching pci_p2pdma_whitelist[]. In
Hyper-V guests, each passthrough device appears in a PCI domain of its
own without a host bridge device. Consequently, P2PDMA checks evaluate
endpoint Device IDs against the host bridge whitelist, causing P2PDMA
requests to fail regardless of host support.
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index d96f44d0738a8..76fadfbc1814a 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -544,7 +544,8 @@ static bool hypervisor_supports_p2pdma(void)
> /* Hypervisor hides host topology, allow p2pdma on Skylake and newer */
> if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
> boot_cpu_data.x86_vfm >= INTEL_SKYLAKE_X &&
[Severity: High]
Does this numerical comparison correctly filter out older, unsupported CPUs?
Since x86_vfm encodes the model number in the lower bits, older architectures
like Broadwell-D (model 0x56) or Atom Goldmont (model 0x5C) evaluate to being
numerically greater than INTEL_SKYLAKE_X (model 0x55).
Because Broadwell-generation CPUs do not support cross-host-bridge P2PDMA,
bypassing the check in the guest will allow transactions the host physical
hardware cannot route, which can result in PCIe Unsupported Requests and
potentially lead to AER panics or device aborts.
Is there a better way to check for supported architectures rather than a
strict numeric comparison of the VFM?
> - hypervisor_is_type(X86_HYPER_VMWARE))
> + (hypervisor_is_type(X86_HYPER_VMWARE) ||
> + hypervisor_is_type(X86_HYPER_MS_HYPERV)))
> return true;
> #endif
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261009154034.82321-1-pavel.e.popov@intel.com?part=2
next prev parent reply other threads:[~2026-10-09 15:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 15:40 [PATCH 0/2] PCI/P2PDMA: Allow P2PDMA in VMware and Hyper-V guests on Intel hosts Pavel Popov
2026-10-09 15:40 ` [PATCH 1/2] PCI/P2PDMA: Allow P2PDMA in VMware " Pavel Popov
2026-10-09 15:46 ` sashiko-bot
2026-10-09 16:12 ` Popov, Pavel E
2026-10-09 16:38 ` Logan Gunthorpe
2026-10-09 16:49 ` Popov, Pavel E
2026-10-09 15:40 ` [PATCH 2/2] PCI/P2PDMA: Allow P2PDMA in Hyper-V " Pavel Popov
2026-10-09 15:47 ` sashiko-bot [this message]
2026-10-09 16:15 ` Popov, Pavel E
2026-10-09 16:58 ` [PATCH 0/2] PCI/P2PDMA: Allow P2PDMA in VMware and " Bjorn Helgaas
2026-10-09 18:08 ` Leon Romanovsky
2026-10-09 18:21 ` Popov, Pavel E
2026-10-09 18:49 ` Leon Romanovsky
2026-10-09 19:13 ` Popov, Pavel E
2026-10-11 5:47 ` Leon Romanovsky
2026-10-09 19:12 ` Bjorn Helgaas
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-165797@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pavel.e.popov@intel.com \
--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