From: Robin Murphy <robin.murphy@arm.com>
To: Michael Kelley <mikelley@microsoft.com>,
sthemmin@microsoft.com, kys@microsoft.com,
haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
rafael@kernel.org, lenb@kernel.org, lorenzo.pieralisi@arm.com,
robh@kernel.org, kw@linux.com, bhelgaas@google.com, hch@lst.de,
m.szyprowski@samsung.com, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org
Subject: Re: [PATCH 3/4 RESEND] Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device
Date: Thu, 17 Mar 2022 16:52:37 +0000 [thread overview]
Message-ID: <e2ceb902-6fe2-bcb9-259a-f120901672b6@arm.com> (raw)
In-Reply-To: <1647534311-2349-4-git-send-email-mikelley@microsoft.com>
On 2022-03-17 16:25, Michael Kelley via iommu wrote:
> VMbus synthetic devices are not represented in the ACPI DSDT -- only
> the top level VMbus device is represented. As a result, on ARM64
> coherence information in the _CCA method is not specified for
> synthetic devices, so they default to not hardware coherent.
> Drivers for some of these synthetic devices have been recently
> updated to use the standard DMA APIs, and they are incurring extra
> overhead of unneeded software coherence management.
>
> Fix this by propagating coherence information from the VMbus node
> in ACPI to the individual synthetic devices. There's no effect on
> x86/x64 where devices are always hardware coherent.
>
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> ---
> drivers/hv/vmbus_drv.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 12a2b37..c0e993ad 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -904,6 +904,21 @@ static int vmbus_probe(struct device *child_device)
> drv_to_hv_drv(child_device->driver);
> struct hv_device *dev = device_to_hv_device(child_device);
> const struct hv_vmbus_device_id *dev_id;
> + enum dev_dma_attr coherent;
> +
> + /*
> + * On ARM64, propagate the DMA coherence setting from the top level
> + * VMbus ACPI device to the child VMbus device being added here.
> + * Older Hyper-V ARM64 versions don't set the _CCA method on the
> + * top level VMbus ACPI device as they should. Treat these cases
> + * as DMA coherent since that's the assumption made by Hyper-V.
> + *
> + * On x86/x64 these calls assume coherence and have no effect.
> + */
> + coherent = acpi_get_dma_attr(hv_acpi_dev);
> + if (coherent == DEV_DMA_NOT_SUPPORTED)
> + coherent = DEV_DMA_COHERENT;
> + acpi_dma_configure(child_device, coherent);
acpi_dma_configure is for devices represented in ACPI. The commit
message implies that these VMBus devices aren't represented in ACPI.
What gives?
Robin.
>
> dev_id = hv_vmbus_get_id(drv, dev);
> if (drv->probe) {
next prev parent reply other threads:[~2022-03-17 16:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 16:25 [PATCH 0/4 RESEND] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM Michael Kelley
2022-03-17 16:25 ` [PATCH 1/4 RESEND] ACPI: scan: Export acpi_get_dma_attr() Michael Kelley
2022-03-17 16:31 ` Robin Murphy
2022-03-17 18:56 ` Michael Kelley (LINUX)
2022-03-17 16:25 ` [PATCH 2/4 RESEND] dma-mapping: Add wrapper function to set dma_coherent Michael Kelley
2022-03-17 17:19 ` Robin Murphy
2022-03-17 19:13 ` Michael Kelley (LINUX)
2022-03-18 11:07 ` Robin Murphy
2022-03-18 20:37 ` Michael Kelley (LINUX)
2022-03-17 16:25 ` [PATCH 3/4 RESEND] Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device Michael Kelley
2022-03-17 16:52 ` Robin Murphy [this message]
2022-03-17 16:25 ` [PATCH 4/4 RESEND] PCI: hv: Propagate coherence from VMbus device to PCI device Michael Kelley
2022-03-17 17:15 ` Robin Murphy
2022-03-18 5:12 ` Michael Kelley (LINUX)
2022-03-18 10:57 ` Robin Murphy
2022-03-18 20:36 ` Michael Kelley (LINUX)
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=e2ceb902-6fe2-bcb9-259a-f120901672b6@arm.com \
--to=robin.murphy@arm.com \
--cc=bhelgaas@google.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=kw@linux.com \
--cc=kys@microsoft.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=m.szyprowski@samsung.com \
--cc=mikelley@microsoft.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=wei.liu@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).