All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>,
	Andrii Anisov <andrii.anisov@globallogic.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: question about memory allocation for driver domain
Date: Mon, 09 Feb 2015 22:58:18 +0800	[thread overview]
Message-ID: <54D8CB0A.1000009@linaro.org> (raw)
In-Reply-To: <1423487312.23098.41.camel@citrix.com>

Hi Ian,

On 09/02/2015 21:08, Ian Campbell wrote:
> On Mon, 2015-02-09 at 19:16 +0800, Julien Grall wrote:
>>>> The last problem but not the least is, depending on which backend you
>>>> are running in the 1:1 domain (such blkback), grant won't be mapped 1:1
>>>> to the guest, so you will have to use swiotlb in order to use the right
>>>> DMA address. For instance, without swiotlb, guest won't be able to use a
>>>> disk partition via blkfront. This because the backend is giving directly
>>>> the grant address to the block driver. To solve this, we have to use
>>>> swiotlb and set specific DMA callback. For now, there are only used for
>>>> DOM0.
>>>
>>> Not much we can do here except extend the dom0 code here to
>>> conditionally enable itself for other domains.
>>
>> You mean in the guest kernel? Maybe we have to introduce a new feature
>> flags indicating is the domain is using 1:1 mapping or not?
>
> Something along those lines I would expect.
>
> I'm not sure it fits, but this has some similarities with the DTB
> bindings used to indicate to the guest that a device is protected (in
> the SMMU sense) which you did a while back. It's possible we could reuse
> or extend that interface -- after all 1:1 is somewhat like having an
> SMMU, at least to the extent that the things the guest is expected to do
> are the same.

1:1 domain and having SMMU is not the same, the former requires swiotlb 
while the latter not.

When the device is protected, we can avoid to use the Xen DMA ops (based 
on swiotlb). For this purpose, the patch was added a property in the 
device tree node of device protected by an SMMU.

In the case of the 1:1 mapping we definitely want to use swiotlb, for 
devices using DMA in 1:1 domain. This will be for the whole guest, so 
adding a property per device seems pointless.

Reusing the same property would mean that the common use case (device 
passthrough protected by an SMMU) will require an little extra work. It 
doesn't sounds right to me.

After all, a per-domain seems the best things to do. It would also helps 
on platform that doesn't require 1:1 mapping for DOM0 (I'm think about 
Cavium, and maybe Seattle?). This would increase performance in general.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-02-09 14:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 16:47 question about memory allocation for driver domain Oleksandr Tyshchenko
2015-02-05 13:12 ` Ian Campbell
2015-02-05 13:49   ` Oleksandr Tyshchenko
2015-02-05 15:24     ` Julien Grall
2015-02-05 16:36       ` Oleksandr Tyshchenko
2015-02-06 17:15         ` Oleksandr Tyshchenko
2015-02-09  8:31           ` Julien Grall
2015-02-09 10:53             ` Ian Campbell
2015-02-09 11:16               ` Julien Grall
2015-02-09 12:55                 ` Oleksandr Tyshchenko
2015-02-09 13:08                 ` Ian Campbell
2015-02-09 14:58                   ` Julien Grall [this message]
2015-02-09 12:29               ` Oleksandr Tyshchenko
2015-02-09 12:02             ` Oleksandr Tyshchenko
2015-02-10  1:31               ` Julien Grall

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=54D8CB0A.1000009@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=andrii.anisov@globallogic.com \
    --cc=ian.campbell@citrix.com \
    --cc=oleksandr.tyshchenko@globallogic.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.