linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: Robin Murphy <robin.murphy@arm.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"wei.liu@kernel.org" <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"kw@linux.com" <kw@linux.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"hch@lst.de" <hch@lst.de>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>
Subject: RE: [PATCH 2/4 RESEND] dma-mapping: Add wrapper function to set dma_coherent
Date: Fri, 18 Mar 2022 20:37:37 +0000	[thread overview]
Message-ID: <BY3PR21MB3033AE8398AEDD0FA510D9B4D7139@BY3PR21MB3033.namprd21.prod.outlook.com> (raw)
In-Reply-To: <249e5876-f8c6-0236-16fa-a611a9f9e0b2@arm.com>

From: Robin Murphy <robin.murphy@arm.com> Sent: Friday, March 18, 2022 4:08 AM
> 
> On 2022-03-17 19:13, Michael Kelley (LINUX) wrote:
> > From: Robin Murphy <robin.murphy@arm.com> Sent: Thursday, March 17, 2022
> 10:20 AM
> >>
> >> On 2022-03-17 16:25, Michael Kelley via iommu wrote:
> >>> Add a wrapper function to set dma_coherent, avoiding the need for
> >>> complex #ifdef's when setting it in architecture independent code.
> >>
> >> No. It might happen to work out on the architectures you're looking at,
> >> but if Hyper-V were ever to support, say, AArch32 VMs you might see the
> >> problem. arch_setup_dma_ops() is the tool for this job.
> >>
> >
> > OK.   There's currently no vIOMMU in a Hyper-V guest, so presumably the
> > code would call arch_setup_dma_ops() with the dma_base, size, and iommu
> > parameters set to 0 and NULL.  This call can then be used in Patch 3 instead
> > of acpi_dma_configure(), and in the Patch 4 hv_dma_configure() function
> > as you suggested.  arch_setup_dma_ops() is not exported, so I'd need to
> > wrap it in a Hyper-V specific function in built-in code that is exported.
> >
> > But at some point in the future if there's a vIOMMU in Hyper-V guests,
> > this approach will need some rework.
> >
> > Does that make sense?  Thanks for your input and suggestions ...
> 
> Yes, that's essentially what I had in mind. If you did present a vIOMMU
> to the guest, presumably you'd either have to construct a regular
> IORT/VIOT, and thus end up adding the root complex to the ACPI namespace
> too so it can be referenced, at which point it would all get picked up
> by the standard machinery, or come up with some magic VMBus mechanism
> that would need a whole load of work to wire up in all the relevant
> places anyway.
> 
> (But please lean extremely heavily towards the former option!)

Agreed!

> 
> Thanks,
> Robin.

  reply	other threads:[~2022-03-18 20:37 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) [this message]
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
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=BY3PR21MB3033AE8398AEDD0FA510D9B4D7139@BY3PR21MB3033.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.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=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --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).