From patchwork Sun Sep 4 05:33:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 9312375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8562E6075E for ; Sun, 4 Sep 2016 05:37:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 735AA289B5 for ; Sun, 4 Sep 2016 05:37:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64CA6289D2; Sun, 4 Sep 2016 05:37:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E257289B5 for ; Sun, 4 Sep 2016 05:37:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgQ4Q-0007Xe-V3; Sun, 04 Sep 2016 05:34:18 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgQ4L-0007BA-Om for linux-arm-kernel@lists.infradead.org; Sun, 04 Sep 2016 05:34:14 +0000 Received: from trochilidae.lan (unknown [IPv6:2601:602:8802:504f:3e97:eff:fe92:db3b]) by mail.kmu-office.ch (Postfix) with ESMTPSA id A7F875C0419; Sun, 4 Sep 2016 07:28:36 +0200 (CEST) From: Stefan Agner To: linux@armlinux.org.uk Subject: [PATCH] ARM: LPAE: initialize cachepolicy correctly Date: Sat, 3 Sep 2016 22:33:31 -0700 Message-Id: <20160904053331.7264-1-stefan@agner.ch> X-Mailer: git-send-email 2.9.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1472966918; bh=NpcIFVZZxnwDzT4yMYMvRzLGmbfJRp97/tScEBwobk4=; h=From:To:Cc:Subject:Date:Message-Id; b=gsfN1NN4z8Sb8WNpJPLhgZjgexi7gRGDKAJ/ZpiD0VZeBjDENGx5C0jPd58UQaSxwD/voHLDM9SP3egy5HSdHTGJw+o4GJ75TTTEVHyJgxJB6Xj5uo2bO4RZGc7gXjRJSxRPU1gzWoJOUUdcScoPTs1st+5o+keXzQjdjG/fkrM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160903_223414_020418_B861B739 X-CRM114-Status: UNSURE ( 7.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, arnd@arndb.de, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk, linux-kernel@vger.kernel.org, Stefan Agner , linux-arm-kernel@lists.infradead.org, kirill.shutemov@linux.intel.com, l.stach@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The cachepolicy variable gets initialized using a masked pmd So far, the pmd has been masked with flags valid for the 2-page table format. In the LPAE case, this lead to a wrong assumption of what the initial cachepolicy has been used. Later a check forces the cache policy to writealloc and prints the following warning: Forcing write-allocate cache policy for SMP This patch uses PMD_SECT_WBWA to mask all cache setting flags. The define represents the complete mask of the cache relevant flags for both page table formats. Signed-off-by: Stefan Agner --- arch/arm/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 724d6be..241e5e2 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -137,7 +137,7 @@ void __init init_default_cache_policy(unsigned long pmd) initial_pmd_value = pmd; - pmd &= PMD_SECT_TEX(1) | PMD_SECT_BUFFERABLE | PMD_SECT_CACHEABLE; + pmd &= PMD_SECT_WBWA; for (i = 0; i < ARRAY_SIZE(cache_policies); i++) if (cache_policies[i].pmd == pmd) {