From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 1/3] xen: arm: avoid reusing incorrect mappings when walking the p2m. Date: Mon, 14 Jul 2014 17:27:03 +0100 Message-ID: <1405355225-4623-1-git-send-email-ian.campbell@citrix.com> References: <1405355194.31863.2.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1405355194.31863.2.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org If we handle a change in a superpage then we need to invalidate any cached mappings further down, otherwise we risk using them because their offset might match but be based on a different offset further up the table. Signed-off-by: Ian Campbell --- 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 c0c011a..917baa3 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -719,6 +719,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_second_offset = ~0; } /* We only use a 3 level p2m at the moment, so no level 0, @@ -741,6 +743,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 */ -- 1.7.10.4