xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Xen Devel <xen-devel@lists.xen.org>
Subject: Re: Unshared IOMMU issues
Date: Thu, 16 Feb 2017 17:02:01 +0200	[thread overview]
Message-ID: <CAPD2p-n4eCE7AcG0EShQ6TQw4c9wiWChw2qTJdHbndVsLn3ziQ@mail.gmail.com> (raw)
In-Reply-To: <58A58091020000780013A93E@prv-mh.provo.novell.com>

Hi, Jan.

On Thu, Feb 16, 2017 at 11:36 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 15.02.17 at 18:43, <olekstysh@gmail.com> wrote:
>> 1.
>> I need:
>> Allow P2M core on ARM to update IOMMU mapping from the first "p2m_set_entry".
>> I do:
>> I explicitly set need_iommu flag for *every* guest domain during
>> iommu_domain_init() on ARM in case if page table is not shared.
>> At that moment I have no knowledge about will any device be assigned
>> to this domain or not. I am just want to receive all mapping updates
>> from P2M code. The P2M will update IOMMU mapping only when need_iommu
>> is set and page table is not shared.
>> I have doubts:
>> Is it correct to just force need_iommu flag?
>
> No, I don't think so. This is a waste of a measurable amount of
> resources when page tables aren't shared.
>
>> Or maybe another flag should be introduced?
>
> Not sure what you think of here. Where's the problem with building
> IOMMU page tables at the time the first device gets assigned, just
> like x86 does?
OK, I have already had a look at  arch_iommu_populate_page_table() for x86.
I don't know at the moment how this solution can help me.
There are a least two points the prevent me from doing the similar thing.
1. For create IOMMU mapping I need both mfn and gfn. (+ flags).
I am able to get mfn only. How can I find corresponding gfn?
2. The d->page_list seems only contains domain RAM (not 100% sure).
Where can I get other regions (mmios, etc)?

>
>> Or we don't need to check for need_iommu flag before updating IOMMU
>> mapping in P2M code, maybe iommu_enabled would be enough?
>
> No, afaict that would again mean maintaining IOMMU page tables
> regardless of whether they're needed.
>
>> 2.
>> I need:
>> Allow IOMMU driver to be ready to handle IOMMU mapping updates from
>> the first "p2m_set_entry".
>
> Why (see also the question above)?
I explained above.  Unfortunately, I don't see how can I get all
iova-to-pa mapping
that took place for this domain from the start on ARM.

>
>> I do:
>> I always allocate IOMMU page table during iommu_domain_init() for every
>> domain even this domain won't have any assigned devices in future. I
>> don't wait for iommu_construct.
>> I have doubts:
>> Is it correct? It might be just wasting memory and CPU time if domain
>> doesn't have any assigned devices in future.
>
> Indeed.
>
> Jan
>



-- 
Regards,

Oleksandr Tyshchenko

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-02-16 15:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 15:52 Unshared IOMMU issues Oleksandr Tyshchenko
2017-02-15 16:22 ` Jan Beulich
2017-02-15 17:43   ` Oleksandr Tyshchenko
2017-02-16  9:36     ` Jan Beulich
2017-02-16 15:02       ` Oleksandr Tyshchenko [this message]
2017-02-16 15:52         ` Jan Beulich
2017-02-16 16:11           ` Julien Grall
2017-02-16 16:34             ` Jan Beulich
2017-02-16 18:09               ` Julien Grall
2017-02-16 18:58                 ` Stefano Stabellini
2017-02-17  7:43                 ` Jan Beulich
2017-02-17 15:25                   ` Julien Grall
2017-02-17 20:20                     ` Oleksandr Tyshchenko
2017-02-20  8:31                       ` Julien Grall
2017-02-21 10:39                         ` Oleksandr Tyshchenko
2017-02-22 11:39                           ` Julien Grall
2017-02-22 11:59                             ` Oleksandr Tyshchenko

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=CAPD2p-n4eCE7AcG0EShQ6TQw4c9wiWChw2qTJdHbndVsLn3ziQ@mail.gmail.com \
    --to=olekstysh@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --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 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).