PCI: hv: Propagate coherence from VMbus device to PCI device
authorMichael Kelley <mikelley@microsoft.com>
Thu, 24 Mar 2022 16:14:52 +0000 (09:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:15 +0000 (09:34 +0200)
commit92a3499933c17b25b7c59658183bc7d23a581f5b
tree826a3c04a401ee930bd3b11769d6ca88b6efa2fa
parent1b576e81d31b56b248316b8ff816b1cc5c4407c7
PCI: hv: Propagate coherence from VMbus device to PCI device

[ Upstream commit 8d21732475c637c7efcdb91dc927a4c594e97898 ]

PCI pass-thru devices in a Hyper-V VM are represented as a VMBus
device and as a PCI device.  The coherence of the VMbus device is
set based on the VMbus node in ACPI, but the PCI device has no
ACPI node and defaults to not hardware coherent.  This results
in extra software coherence management overhead on ARM64 when
devices are hardware coherent.

Fix this by setting up the PCI host bus so that normal
PCI mechanisms will propagate the coherence of the VMbus
device to the PCI device. There's no effect on x86/x64 where
devices are always hardware coherent.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Acked-by: Boqun Feng <boqun.feng@gmail.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/1648138492-2191-3-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pci-hyperv.c