linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM
@ 2022-03-23 20:31 Michael Kelley
  2022-03-23 20:31 ` [PATCH v2 1/2] Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device Michael Kelley
  2022-03-23 20:31 ` [PATCH v2 2/2] PCI: hv: Propagate coherence from VMbus device to PCI device Michael Kelley
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Kelley @ 2022-03-23 20:31 UTC (permalink / raw)
  To: sthemmin, kys, haiyangz, wei.liu, decui, rafael, lenb,
	lorenzo.pieralisi, robh, kw, bhelgaas, 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.

Robin Murphy -- I'm not ignoring your feedback about pci_dma_configure(), but
I wanted to try this alternate approach where pci_dma_configure() works as is.
If reviewers prefer modifying pci_dma_configure() to handle the Hyper-V
specifics, I can go back to that.

Changes since v1:
* Use device_get_dma_attr() instead of acpi_get_dma_attr(), eliminating the
  need to export acpi_get_dma_attr() [Robin Murphy]
* Use arch_setup_dma_ops() to set device coherence [Robin Murphy]
* Move handling of missing _CCA to vmbus_acpi_add() so it is only done once
* Rework handling of PCI devices so existing code in pci_dma_configure()
  just works

Michael Kelley (2):
  Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device
  PCI: hv: Propagate coherence from VMbus device to PCI device

 drivers/hv/hv_common.c              | 11 +++++++++++
 drivers/hv/vmbus_drv.c              | 23 +++++++++++++++++++++++
 drivers/pci/controller/pci-hyperv.c |  9 +++++++++
 include/asm-generic/mshyperv.h      |  1 +
 4 files changed, 44 insertions(+)

-- 
1.8.3.1


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

end of thread, other threads:[~2022-03-24 14:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 20:31 [PATCH v2 0/2] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM Michael Kelley
2022-03-23 20:31 ` [PATCH v2 1/2] Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device Michael Kelley
2022-03-24 11:59   ` Robin Murphy
2022-03-24 13:18     ` Michael Kelley (LINUX)
2022-03-24 14:41       ` Robin Murphy
2022-03-23 20:31 ` [PATCH v2 2/2] PCI: hv: Propagate coherence from VMbus device to PCI device Michael Kelley
2022-03-24  1:09   ` Boqun Feng
2022-03-24 12:23   ` Robin Murphy
2022-03-24 12:35     ` Robin Murphy

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).