linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM
@ 2022-03-17 16:12 Michael Kelley
  2022-03-17 16:12 ` [PATCH 1/4] ACPI: scan: Export acpi_get_dma_attr() Michael Kelley
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael Kelley @ 2022-03-17 16:12 UTC (permalink / raw)
  To: sthemmin, kys, haiyangz, wei.liu, decui, rafael, lenb,
	lorenzo.pieralisi, robh, kw, bhelgass, hch, m.szyprowski,
	robin.murphy, linux-acpi, linux-kernel, linux-hyperv, linux-pci,
	iommu
  Cc: mikelley

Hyper-V VMs have VMbus synthetic devices and PCI pass-thru devices that are added
dynamically via the VMbus protocol and are not represented in the ACPI DSDT. Only
the top level VMbus node exists in the DSDT. As such, on ARM64 these devices don't
pick up coherence information and default to not hardware coherent.  This results
in extra software coherence management overhead since the synthetic devices are
always hardware coherent. PCI pass-thru devices are also hardware coherent in all
current usage scenarios.

Fix this by propagating coherence information from the top level VMbus node in
the DSDT to all VMbus synthetic devices and PCI pass-thru devices. While smaller
granularity of control would be better, basing on the VMbus node in the DSDT
gives as escape path if a future scenario arises with devices that are not
hardware coherent.

The first two patches are prep to allow manipulating device coherence from a
module (since the VMbus driver can be built as a module) and from architecture
independent code without having a bunch of #ifdef's.

The third patch propagates the VMbus node coherence to VMbus synthetic devices.

The fourth patch propagates the coherence to PCI pass-thru devices.

Michael Kelley (4):
  ACPI: scan: Export acpi_get_dma_attr()
  dma-mapping: Add wrapper function to set dma_coherent
  Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device
  PCI: hv: Propagate coherence from VMbus device to PCI device

 drivers/acpi/scan.c                 |  1 +
 drivers/hv/vmbus_drv.c              | 15 +++++++++++++++
 drivers/pci/controller/pci-hyperv.c | 17 +++++++++++++----
 include/linux/dma-map-ops.h         |  9 +++++++++
 4 files changed, 38 insertions(+), 4 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-17 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17 16:12 [PATCH 0/4] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM Michael Kelley
2022-03-17 16:12 ` [PATCH 1/4] ACPI: scan: Export acpi_get_dma_attr() Michael Kelley
2022-03-17 16:12 ` [PATCH 2/4] dma-mapping: Add wrapper function to set dma_coherent Michael Kelley
2022-03-17 16:12 ` [PATCH 3/4] Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device Michael Kelley
2022-03-17 16:12 ` [PATCH 4/4] PCI: hv: Propagate coherence from VMbus device to PCI device Michael Kelley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).