From patchwork Mon Aug 6 10:33:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: R Sricharan X-Patchwork-Id: 1278031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 32BD63FD57 for ; Mon, 6 Aug 2012 10:36:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SyKdZ-0003xP-5r; Mon, 06 Aug 2012 10:34:13 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SyKdV-0003w0-0z for linux-arm-kernel@lists.infradead.org; Mon, 06 Aug 2012 10:34:10 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q76AY0Fc030535; Mon, 6 Aug 2012 05:34:01 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q76AXuto015709; Mon, 6 Aug 2012 16:03:57 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 6 Aug 2012 16:03:56 +0530 Received: from localhost.localdomain (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q76AXrK1031794; Mon, 6 Aug 2012 16:03:55 +0530 From: R Sricharan To: Subject: [RFC PATCH] ARM: LPAE: Fix alloc_init_section to flush all the pmd entries. Date: Mon, 6 Aug 2012 16:03:50 +0530 Message-ID: <1344249230-29835-1-git-send-email-r.sricharan@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: r.sricharan@ti.com, santosh.shilimkar@ti.com, catalin.marinas@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org flush_pmd_entry flushes one cache line by MVA. This is called by alloc_init_section to flush the mapped pmd entries. But this is called outside the loop and when LPAE is enabled the number of pmd entries to be flushed can be across multiple cache lines. So call this inside the loop so that all the mapped entries are flushed. This is going to result in additional cache line flushes. There might be other better way to handle this. Signed-off-by: R Sricharan Cc: Catalin Marinas Cc: Santosh Shilimkar --- arch/arm/mm/mmu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 0ed8808..02af3fe 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -619,7 +619,6 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr, * up one logical pointer to an L2 table. */ if (type->prot_sect && ((addr | end | phys) & ~SECTION_MASK) == 0) { - pmd_t *p = pmd; #ifndef CONFIG_ARM_LPAE if (addr & SECTION_SIZE) @@ -629,9 +628,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr, do { *pmd = __pmd(phys | type->prot_sect); phys += SECTION_SIZE; + flush_pmd_entry(pmd); } while (pmd++, addr += SECTION_SIZE, addr != end); - - flush_pmd_entry(p); } else { /* * No need to loop; pte's aren't interested in the