mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: linux@armlinux.org.uk
Cc: ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk,
	kirill.shutemov@linux.intel.com, l.stach@pengutronix.de,
	arnd@arndb.de, nicolas.pitre@linaro.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Stefan Agner <stefan@agner.ch>
Subject: [PATCH] ARM: LPAE: initialize cachepolicy correctly
Date: Sat,  3 Sep 2016 22:33:31 -0700	[thread overview]
Message-ID: <20160904053331.7264-1-stefan@agner.ch> (raw)

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 <stefan@agner.ch>
---
 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) {
-- 
2.9.0

             reply	other threads:[~2016-09-04  5:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04  5:33 Stefan Agner [this message]
2016-09-04 22:09 ` Russell King - ARM Linux
2016-09-04 23:31   ` Stefan Agner
2016-09-05 16:22     ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160904053331.7264-1-stefan@agner.ch \
    --to=stefan@agner.ch \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=matt@codeblueprint.co.uk \
    --cc=nicolas.pitre@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®