From: Peter Maydell <peter.maydell@linaro.org>
To: KONRAD Frederic <frederic.konrad@adacore.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Alistair Francis <alistair.francis@xilinx.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.10] xlnx-qspi: add a property for mmio-execution
Date: Thu, 10 Aug 2017 14:20:16 +0100 [thread overview]
Message-ID: <CAFEAcA_k_aVsiNxivagGzAh8XCyN-FYVO03A8jKUQx5OpWCMxg@mail.gmail.com> (raw)
In-Reply-To: <432cdd39-1016-c38e-ebaa-ecaabf51076d@adacore.com>
On 10 August 2017 at 14:08, KONRAD Frederic <frederic.konrad@adacore.com> wrote:
>
>
> On 08/10/2017 02:43 PM, Peter Maydell wrote:
>>
>> On 10 August 2017 at 13:21, KONRAD Frederic <frederic.konrad@adacore.com>
>> wrote:
>>>
>> Looking at the implementation it seems like this will work in
>> practice (because the invalidate code in memory.c checks that
>> the MR it's about to drop really is an MMIO_INTERFACE), but
>> if so we should document this. However, I'm not totally convinced
>> that it really will work in complicated cases like where you
>> have device A part of whose memory range is a container which
>> holds a device B which is also using the mmio_pointer API:
>> in that case if device A calls invalidate_mmio_ptr with an
>> address that's in the part of A's memory region that is the
>> device B container it could end up invalidating an mmio-interface
>> that's actually inside device B. So it would be safer to say
>> "the caller may only invalidate pointers it's actually told
>> the memory system about".
>>
>
> I see what you mean but I'm not sure this will happen because the
> mmio-interface is mapped on @mr which is passed to invalidate.
>
> So if device A doesn't have any mmio-interface mapped it can't
> find the device B mmio-interface as we pass device A
> MemoryRegion.
I think what you're saying is (1) you can't create an mmio-ptr
for a container region (2) when you call invalidate_mmio_ptr
you have to pass exactly the MR that has the memory-region-ops
that the have the request_ptr set. This isn't entirely clear
from the docs, but OTOH it seems reasonable and I agree that
in that case you can't get the situation I suggested above.
> But I agree the doc is a little confusing about that.
>
>> (Conversely if we're convinced that passing bogus pointers
>> to memory_region_invalidate_mmio_ptr() is fine then we
>> don't need to add the q->mmio_execution_enabled flag check.)
>
>
> True but this will trigger an async_safe_work with all the
> overhead.
If we care about that then we should have a "have we used the
cached region as an mmio_ptr" flag separately anyway, so that
we don't trigger async_safe_work for the case of "not executing
from the memory, but we had to call lqspi_load_cache() because
the guest did a read from some address that was outside the
cached section".
thanks
-- PMM
prev parent reply other threads:[~2017-08-10 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 12:21 [Qemu-devel] [PATCH for-2.10] xlnx-qspi: add a property for mmio-execution KONRAD Frederic
2017-08-10 12:43 ` Peter Maydell
2017-08-10 13:08 ` KONRAD Frederic
2017-08-10 13:20 ` Peter Maydell [this message]
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=CAFEAcA_k_aVsiNxivagGzAh8XCyN-FYVO03A8jKUQx5OpWCMxg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alistair.francis@xilinx.com \
--cc=dgilbert@redhat.com \
--cc=edgar.iglesias@gmail.com \
--cc=frederic.konrad@adacore.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).