From patchwork Mon May 14 17:54:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Andrianov X-Patchwork-Id: 8603 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A73B623E28 for ; Mon, 14 May 2012 17:55:26 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 59225A185E6 for ; Mon, 14 May 2012 17:55:26 +0000 (UTC) Received: by yhpp61 with SMTP id p61so5704997yhp.11 for ; Mon, 14 May 2012 10:55:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :date:message-id:x-mailer:mime-version:cc:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=I0LM6Sz30uT1pfiAv/D4HYs7sy/Sze7zFyrj40SyImg=; b=AhnD4+HNfsQNB2/rVI3oASnvHTpwLBC9ABNnGx7YNapJYkM4lP+rjgnOqXTNcJR2kM 1UZ2mE4wzB6d1K3S9FNIEeU9qPjnJPw1tWXM9B59OB9KPYA2ocB5hgwVQZKXALsnfgJV vkYuLW00okPZC3PJsbwpYD00LmNUguKF0n9LiYNQCscD0fhswsTgoM4nid6jWuexdjf9 b5MOJ0FNQhKMEVoBnU+WyVR7RNThXefRGNSNjK31w957mE6uTQG60Wm8Nkai2mfCvfLh KBnEEY42ZiwBjktZ6lMAPmFZ8gzSWnEivG5OQ9GzuqJ8SKkaPyw9dsGhwdH1Vj0U9voj SutQ== Received: by 10.50.85.163 with SMTP id i3mr4762515igz.57.1337018125663; Mon, 14 May 2012 10:55:25 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp361792ibd; Mon, 14 May 2012 10:55:24 -0700 (PDT) Received: by 10.204.149.208 with SMTP id u16mr3471749bkv.81.1337018124275; Mon, 14 May 2012 10:55:24 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id hi7si13707006bkc.75.2012.05.14.10.55.23; Mon, 14 May 2012 10:55:24 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1STzUP-0005BZ-Co; Mon, 14 May 2012 17:55:21 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1STzUN-0005Ab-QN for linaro-mm-sig@lists.linaro.org; Mon, 14 May 2012 17:55:20 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q4EHt6uB005968; Mon, 14 May 2012 12:55:06 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q4EHt6XU028887; Mon, 14 May 2012 12:55:06 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Mon, 14 May 2012 12:55:06 -0500 Received: from uda0794637 (uda0794637.am.dhcp.ti.com [158.218.103.61]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q4EHt5ZT026140; Mon, 14 May 2012 12:55:06 -0500 Received: from a0794637local by uda0794637 with local (Exim 4.76) (envelope-from ) id 1STzU9-000773-OX; Mon, 14 May 2012 13:55:05 -0400 From: Vitaly Andrianov To: Date: Mon, 14 May 2012 13:54:57 -0400 Message-ID: <1337018097-27308-1-git-send-email-vitalya@ti.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 Cc: linaro-mm-sig@lists.linaro.org, catalin.marinas@arm.com, cyril.ti.com@uda0794637, Vitaly Andrianov , linux-arm-kernel@lists.infradead.org Subject: [Linaro-mm-sig] [PATCH] ARM: LPAE: fix access flag setup in mem_type_table X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQn399ym3xNyFbmyeberWcqU8QVmQX4zWzmCFqBL9HyOonEhm7QdisiUJk6sdlGnBSNWsm6E A zero value for prot_sect in the memory types table implies that section mappings should never be created for the memory type in question. This is checked for in alloc_init_section(). With LPAE, we set a bit to mask access flag faults for kernel mappings. This breaks the aforementioned (!prot_sect) check in alloc_init_section(). This patch fixes this bug by first checking for a non-zero prot_sect before setting the PMD_SECT_AF flag. Signed-off-by: Vitaly Andrianov Acked-by: Catalin Marinas --- arch/arm/mm/mmu.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index b9fbec2..1e16b20 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -494,7 +494,8 @@ static void __init build_mem_type_table(void) */ for (i = 0; i < ARRAY_SIZE(mem_types); i++) { mem_types[i].prot_pte |= PTE_EXT_AF; - mem_types[i].prot_sect |= PMD_SECT_AF; + if (mem_types[i].prot_sect) + mem_types[i].prot_sect |= PMD_SECT_AF; } kern_pgprot |= PTE_EXT_AF; vecs_pgprot |= PTE_EXT_AF;