Skip to content

Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM

Michael Kelley linux-acpi linux-hyperv linux-iommu linux-pci lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 6 repliesSuperseded
  3. v1 posting 2/24 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 posting 1/24 patches0 repliesSuperseded

Changes in v3 from the cover letter

* Move coherence propagation for VMbus synthetic devices to a separate .dma_configure function instead of the .probe fucntion [Robin Murphy]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus devicedrivers/hv/hv_common.c drivers/hv/vmbus_drv.c include/asm-generic/mshyperv.h+43 -00 replies
2/2PCI: hv: Propagate coherence from VMbus device to PCI devicedrivers/pci/controller/pci-hyperv.c+9 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchRobin MurphyBoqun Feng
1/2A-b
2/2A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM

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.

Changes since v2:
* Move coherence propagation for VMbus synthetic devices to a separate .dma_configure function instead of the .probe fucntion [Robin Murphy]

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              | 31 +++++++++++++++++++++++++++++++
 drivers/pci/controller/pci-hyperv.c |  9 +++++++++
 include/asm-generic/mshyperv.h      |  1 +
 4 files changed, 52 insertions(+)
Signature · 1 line
1.8.3.1