qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	Richard Henderson <rth@twiddle.net>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Greg Bellows <greg.bellows@linaro.org>
Subject: Re: [Qemu-devel] Supporting multiple CPU AddressSpaces and memory transaction attributes
Date: Wed, 13 May 2015 21:21:05 +1000	[thread overview]
Message-ID: <20150513112104.GC13061@toto> (raw)
In-Reply-To: <55531946.9080501@redhat.com>

On Wed, May 13, 2015 at 11:28:38AM +0200, Paolo Bonzini wrote:
> 
> 
> On 13/05/2015 08:41, Edgar E. Iglesias wrote:
> > I think it would be nice if address_space_translate_for_iotlb
> > was allowed to modify the attributes so that an IOMMU in front
> > of a CPU could for example down-grade a secure to a non-secure accesse
> > (once we add IOMMU support in front of CPUs). If I understood correctly
> > the memattrs would stay as a separate field in the iotlb, so this
> > would be easy to implement?
> 
> Yes, it should.
> 
> > The naive implementation I have keeps pointers to AS and the memattrs
> > in the iotlb.  address_space_translate_for_iotlb walks any IOMMU
> > translate() fns, if it hits a RAM it returns the host addr as usual.
> 
> How is the TLB invalidated on IOMMU changes?

Hi Paolo,

I have a hack in the iommu model that triggers an AS change and
makes the CPU flush it's TLB:

        memory_region_notify_iommu(&s->masters[i].iommu, entry);
        /* Temporary hack.  */
        memory_region_transaction_begin();
        memory_region_set_readonly(&s->masters[i].iommu, false);
        memory_region_set_readonly(&s->masters[i].iommu, true);
        memory_region_transaction_commit();

It was not clear to me if CPUs should hook into the iommu notification
system or if we should make the iommu notification code signal changes
through AS change notifications.

The latter would be easy to get right I guess but we wouldn't be
able to have any granularity in the flushing so performance could
be better if the CPU somehow knows what parts have changed.

Cheers,
Edgar


> 
> Paolo
> 
> > If it hits MMIO behind IOMMUs it returns the first memsection, i.e
> > the one pointing to the iommu-ops and lets the IO access helpers
> > deal with the access via address_space_rw (for every IO access, slow).
> 

  reply	other threads:[~2015-05-13 11:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 17:47 [Qemu-devel] Supporting multiple CPU AddressSpaces and memory transaction attributes Peter Maydell
2014-09-06  0:26 ` Peter Crosthwaite
2014-09-06 10:30   ` Peter Maydell
2014-09-07  1:47 ` Edgar E. Iglesias
2014-09-08 11:53   ` Peter Maydell
2014-09-09  1:09     ` Edgar E. Iglesias
2015-05-12 14:47     ` Peter Maydell
2015-05-13  6:41       ` Edgar E. Iglesias
2015-05-13  9:28         ` Paolo Bonzini
2015-05-13 11:21           ` Edgar E. Iglesias [this message]
2015-05-13 11:36             ` Paolo Bonzini

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=20150513112104.GC13061@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=greg.bellows@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).