linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: LPAE: initialize cachepolicy correctly
@ 2016-09-04  5:33 Stefan Agner
  2016-09-04 22:09 ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Agner @ 2016-09-04  5:33 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: LPAE: initialize cachepolicy correctly
  2016-09-04  5:33 [PATCH] ARM: LPAE: initialize cachepolicy correctly Stefan Agner
@ 2016-09-04 22:09 ` Russell King - ARM Linux
  2016-09-04 23:31   ` Stefan Agner
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2016-09-04 22:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Sep 03, 2016 at 10:33:31PM -0700, Stefan Agner wrote:
> 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.

PMD_SECT_WBWA is just one possible combination, it's not a bit-mask.
We need a new definition.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: LPAE: initialize cachepolicy correctly
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Agner @ 2016-09-04 23:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 2016-09-04 15:09, Russell King - ARM Linux wrote:
> On Sat, Sep 03, 2016 at 10:33:31PM -0700, Stefan Agner wrote:
>> 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.
> 
> PMD_SECT_WBWA is just one possible combination, it's not a bit-mask.
> We need a new definition.

Agreed, it just happens to be the same as the bit-mask in both
page-table layouts.

Does PMD_SECT_CACHE_MASK sounds like a reasonable identifier for it?

--
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: LPAE: initialize cachepolicy correctly
  2016-09-04 23:31   ` Stefan Agner
@ 2016-09-05 16:22     ` Russell King - ARM Linux
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2016-09-05 16:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Sep 04, 2016 at 04:31:40PM -0700, Stefan Agner wrote:
> On 2016-09-04 15:09, Russell King - ARM Linux wrote:
> > On Sat, Sep 03, 2016 at 10:33:31PM -0700, Stefan Agner wrote:
> >> 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.
> > 
> > PMD_SECT_WBWA is just one possible combination, it's not a bit-mask.
> > We need a new definition.
> 
> Agreed, it just happens to be the same as the bit-mask in both
> page-table layouts.
> 
> Does PMD_SECT_CACHE_MASK sounds like a reasonable identifier for it?

Yep, thanks.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-05 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04  5:33 [PATCH] ARM: LPAE: initialize cachepolicy correctly Stefan Agner
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).