From patchwork Mon Jul 14 16:27:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 33616 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A116920CAD for ; Mon, 14 Jul 2014 16:28:33 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id v10sf17074564qac.0 for ; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=4AMHE86I/ICfoSbAOyhUk0ti2eYMCj7o9T+7C4pMAEk=; b=laa5p+yQ0QVGfmufnhPgnZo0VnIqavgr+8cIlnz9YL8mFjUSS57qT9kIHvAtfuAA7D 7L9S5cj0F2fxNmu21lF7CqYLboEUj4eck7tCoWp5Dy/WO9IG9bpvDi8Ri8u9+PZa+Uv8 GlhE7JJoA42/aDT7D6lCGaNUGg8pLzbq39Rp/IG5mhk+Lcq5jdV75IsvCqKo/lHXWWAN o2f8hqLqFD5ptKpp+BySqLXKJGAb+MTrhzWkCTTFh3RIiukZnw6q7DFdz7Jc2TDlcvR3 CfKwblWw1aibypVOohGiYFgo2oRstFizf2UljRbkAN4r3T5XKzhRDuNsPACZc/xNB+6W rvcw== X-Gm-Message-State: ALoCoQlxczTMLrg/Kr8iBKi4JJQP9J/bwgGVkiM1ceFEoD7p97e3MlTJd1qItlHw4pGw0qfmYNRM X-Received: by 10.52.165.227 with SMTP id zb3mr7149809vdb.1.1405355313494; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.165 with SMTP id t34ls1108998qgd.93.gmail; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) X-Received: by 10.52.157.41 with SMTP id wj9mr13979791vdb.1.1405355313411; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id nk1si5552273veb.25.2014.07.14.09.28.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 09:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hq11so7939002vcb.27 for ; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) X-Received: by 10.58.207.84 with SMTP id lu20mr16675653vec.9.1405355313341; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp147828vcb; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) X-Received: by 10.58.72.165 with SMTP id e5mr1056592vev.59.1405355313022; Mon, 14 Jul 2014 09:28:33 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id t6si5527488vcr.86.2014.07.14.09.28.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 14 Jul 2014 09:28:33 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X6j6K-0006IU-I8; Mon, 14 Jul 2014 16:27:40 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X6j6J-0006I4-0j for xen-devel@lists.xen.org; Mon, 14 Jul 2014 16:27:39 +0000 Received: from [85.158.139.211:13572] by server-5.bemta-5.messagelabs.com id DF/BC-09027-AF404C35; Mon, 14 Jul 2014 16:27:38 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1405355256!10161150!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5853 invoked from network); 14 Jul 2014 16:27:37 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 14 Jul 2014 16:27:37 -0000 X-IronPort-AV: E=Sophos;i="5.01,659,1400025600"; d="scan'208";a="152689288" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 14 Jul 2014 16:27:07 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Mon, 14 Jul 2014 12:27:06 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1X6j5l-0008Fn-Vg; Mon, 14 Jul 2014 17:27:06 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Mon, 14 Jul 2014 17:27:05 +0100 From: Ian Campbell To: Date: Mon, 14 Jul 2014 17:27:03 +0100 Message-ID: <1405355225-4623-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405355194.31863.2.camel@kazak.uk.xensource.com> References: <1405355194.31863.2.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 1/3] xen: arm: avoid reusing incorrect mappings when walking the p2m. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 */