From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: tim@xen.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2] xen: arm: avoid reusing incorrect mappings when walking the p2m.
Date: Fri, 18 Jul 2014 21:29:29 +0100 [thread overview]
Message-ID: <53C983A9.5030103@linaro.org> (raw)
In-Reply-To: <1405690440-32211-1-git-send-email-ian.campbell@citrix.com>
Hi Ian,
On 18/07/14 14:33, Ian Campbell wrote:
> When we change which PT page we are mapping at a given level then we need to
> invalidate any cached mappings further down the tree, otherwise we risk using
> them because their offset might match but be based on a different offset
> further up the table.
>
> e.g. when remapping first then cur_first_offset and cur_second_offset (which
> indicate the currently mapped second and third tables respectively) both become
> invalid
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Regards,
> ---
> v2: Also invalidate cur_first_offset when changing cur_first_page.
> Corrected/clarified commit message, this issue isn't really specific to
> superpages, they just happen to expose it.
> ---
> xen/arch/arm/p2m.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 2f855b5..8ffddac 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -743,6 +743,8 @@ static int apply_p2m_changes(struct domain *d,
> goto out;
> }
> cur_first_page = p2m_first_level_index(addr);
> + /* Any mapping further down is now invalid */
> + cur_first_offset = cur_second_offset = ~0;
> }
>
> /* We only use a 3 level p2m at the moment, so no level 0,
> @@ -765,6 +767,8 @@ static int apply_p2m_changes(struct domain *d,
> if (second) unmap_domain_page(second);
> second = map_domain_page(first[first_table_offset(addr)].p2m.base);
> cur_first_offset = first_table_offset(addr);
> + /* Any mapping further down is now invalid */
> + cur_second_offset = ~0;
> }
> /* else: second already valid */
>
>
--
Julien Grall
next prev parent reply other threads:[~2014-07-18 20:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 13:33 [PATCH v2] xen: arm: avoid reusing incorrect mappings when walking the p2m Ian Campbell
2014-07-18 20:29 ` Julien Grall [this message]
2014-07-21 11:43 ` 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=53C983A9.5030103@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.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).