From: Julien Grall <julien.grall@linaro.org>
To: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
Cc: Tim Deegan <tim@xen.org>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH] xen: arm: invalidate caches after map_domain_page done
Date: Fri, 01 Aug 2014 18:49:51 +0100 [thread overview]
Message-ID: <53DBD33F.6000808@linaro.org> (raw)
In-Reply-To: <CAH_mUMNgduo0x8og3Ru=qQyv7d4ycV7-trhLMsYDTLX1acGXHg@mail.gmail.com>
On 01/08/14 16:06, Andrii Tseglytskyi wrote:
> Looks like I see where is the issue:
> After mapping done kernel driver calls flush_tlb_all() function, which
> just invalidates cache, it does the similar command, as the following
flush_tlb_all doesn't invalidate the cache but the TLB.
> Xen macros:
>
> #define DTLBIALL p15,0,c8,c6,0 /* Invalidate data TLB */
>
> Then after mapping done, remoteproc_iommu starts translation, calls
> map_domain_page() -> flush_xen_data_tlb_range_va_local(),
> which is described with following macros:
>
> #define TLBIMVAH p15,4,c8,c7,1 /* Invalidate Unified Hyp. TLB by MVA */
>
> So, I got 2 invalidates and no cleans. And when I started using
> clean_and_invalidate_xen_dcache_va_range() I got both:
>
> #define DCCIMVAC p15,0,c7,c14,1 /* Data cache clean and
> invalidate by MVA */
>
> I need both - clean and invalidate. If I don't have clean - data may
> still present in cache and not flushed to RAM - I will see invalid
> data after map_domain_page() call
You seem to mix TLB and cache in your mail. If the page has been mapped
with cache attribute (should be done by kmalloc), then it should not
have any issue in Xen.
Your patch is removing the TLB flush and you are very lucky that Xen is
still working correctly...
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-08-01 17:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 7:25 [PATCH] xen: arm: invalidate caches after map_domain_page done Andrii Tseglytskyi
2014-08-01 9:23 ` Julien Grall
2014-08-01 10:01 ` Andrii Tseglytskyi
2014-08-01 10:28 ` Julien Grall
2014-08-01 10:50 ` Andrii Tseglytskyi
2014-08-01 10:58 ` Julien Grall
2014-08-01 11:37 ` Andrii Tseglytskyi
2014-08-01 14:01 ` Julien Grall
2014-08-01 15:06 ` Andrii Tseglytskyi
2014-08-01 17:49 ` Julien Grall [this message]
2014-08-01 18:54 ` Andrii Tseglytskyi
2014-08-05 14:33 ` Ian Campbell
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=53DBD33F.6000808@linaro.org \
--to=julien.grall@linaro.org \
--cc=andrii.tseglytskyi@globallogic.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.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).