linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Remoteproc: Translating between host and device addresses.
@ 2012-08-14 17:06 Sjur BRENDELAND
  2012-09-10 12:48 ` Ohad Ben-Cohen
  0 siblings, 1 reply; 4+ messages in thread
From: Sjur BRENDELAND @ 2012-08-14 17:06 UTC (permalink / raw)
  To: Ohad Ben-Cohen; +Cc: Linus Walleij, linux-kernel, Sjur Brændeland

Hi Ohad,

I have one question related to address translation between device
address and host-physical address referencing the data-buffer
transported in the virtio-rings.
The address used in the virtio-ring is the host-physical-address,
but the mapping between device-address and host-physical-address is
not necessarily known by the device. In my case.

One way for the device to figure out the translation between
host-physical and device-address is to peek into some CarveOut
resource entry and compute this translation. Because a CarveOut
resource entry contains both the host-physical-address and the
device address for the same memory location. But this feels
like a workaround, shouldn't we make a more explicit way of
communicating this mapping between host-physical and device
addresses?

Regards,
Sjur




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

* Re: Remoteproc: Translating between host and device addresses.
  2012-08-14 17:06 Remoteproc: Translating between host and device addresses Sjur BRENDELAND
@ 2012-09-10 12:48 ` Ohad Ben-Cohen
  2012-09-10 13:07   ` Sjur BRENDELAND
  0 siblings, 1 reply; 4+ messages in thread
From: Ohad Ben-Cohen @ 2012-09-10 12:48 UTC (permalink / raw)
  To: Sjur BRENDELAND; +Cc: Linus Walleij, linux-kernel, Sjur Brændeland

Hi Sjur,

On Tue, Aug 14, 2012 at 8:06 PM, Sjur BRENDELAND
<sjur.brandeland@stericsson.com> wrote:
> One way for the device to figure out the translation between
> host-physical and device-address is to peek into some CarveOut
> resource entry and compute this translation. Because a CarveOut
> resource entry contains both the host-physical-address and the
> device address for the same memory location. But this feels
> like a workaround, shouldn't we make a more explicit way of
> communicating this mapping between host-physical and device
> addresses?

Yes, we should. The plan is, when relevant, to switch to the
IOMMU-based DMA API to allocate device addresses (by programming the
IOMMUs automatically), and stop sending physical addresses remotely.

For OMAP, btw, we will still provide those device->physical
translation resource entries, because OMAP4 has a few remote
components that access the host-physical memory directly.

Thanks,
Ohad.

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

* RE: Remoteproc: Translating between host and device addresses.
  2012-09-10 12:48 ` Ohad Ben-Cohen
@ 2012-09-10 13:07   ` Sjur BRENDELAND
  2012-09-10 13:52     ` Ohad Ben-Cohen
  0 siblings, 1 reply; 4+ messages in thread
From: Sjur BRENDELAND @ 2012-09-10 13:07 UTC (permalink / raw)
  To: Ohad Ben-Cohen; +Cc: Linus Walleij, linux-kernel, Sjur Brændeland

Hi Ohad,

> > One way for the device to figure out the translation between
> > host-physical and device-address is to peek into some CarveOut
> > resource entry and compute this translation. Because a CarveOut
> > resource entry contains both the host-physical-address and the
> > device address for the same memory location. But this feels
> > like a workaround, shouldn't we make a more explicit way of
> > communicating this mapping between host-physical and device
> > addresses?
> 
> Yes, we should. The plan is, when relevant, to switch to the
> IOMMU-based DMA API to allocate device addresses (by programming the
> IOMMUs automatically), and stop sending physical addresses remotely.

But the vring descriptor table will still contain the host's physical address for the
buffers, right?
So how can the device then find the device-address of these buffers if we don't 
use an IOMMU and have no address translation from host-physical-address 
to device-address?

> For OMAP, btw, we will still provide those device->physical
> translation resource entries, because OMAP4 has a few remote
> components that access the host-physical memory directly.

Thanks,
Sjur

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

* Re: Remoteproc: Translating between host and device addresses.
  2012-09-10 13:07   ` Sjur BRENDELAND
@ 2012-09-10 13:52     ` Ohad Ben-Cohen
  0 siblings, 0 replies; 4+ messages in thread
From: Ohad Ben-Cohen @ 2012-09-10 13:52 UTC (permalink / raw)
  To: Sjur BRENDELAND; +Cc: Linus Walleij, linux-kernel, Sjur Brændeland

Hi Sjur,

On Mon, Sep 10, 2012 at 4:07 PM, Sjur BRENDELAND
<sjur.brandeland@stericsson.com> wrote:
> But the vring descriptor table will still contain the host's physical address for the
> buffers, right?
> So how can the device then find the device-address of these buffers if we don't
> use an IOMMU and have no address translation from host-physical-address
> to device-address?

Sorry, you're asking very specific questions about something no one
implemented nor really designed yet :)

Do you have a specific problem you're trying to address ?

I'd be happy to help.

Thanks,
Ohad.

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

end of thread, other threads:[~2012-09-10 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-14 17:06 Remoteproc: Translating between host and device addresses Sjur BRENDELAND
2012-09-10 12:48 ` Ohad Ben-Cohen
2012-09-10 13:07   ` Sjur BRENDELAND
2012-09-10 13:52     ` Ohad Ben-Cohen

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