Skip to contentSkip to conversation

ARM: LPAE: initialize cachepolicy correctly

PATCH In review Stefan Agner 2 participants 4 messages Sep 4, 2016 – Sep 5, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: LPAE: initialize cachepolicy correctly

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.

---
 arch/arm/mm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mm/mmu.c +1 -1
index 724d6be..241e5e2 100644
@@ -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) {
Signature · 1 line
2.9.0
#1 lore raw
Quoted 11 lines · Stefan Agner

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.

Signature · 3 lines
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.
#2 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 8 lines · Stefan Agner

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

Quoted 6 lines
Quoted 3 lines

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

#3 lore raw
Quoted 14 lines · Stefan Agner
Quoted 13 lines · Russell King - ARM Linux
Quoted 11 lines · Stefan Agner

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.

Quoted 7 lines
Quoted 2 lines

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.

Signature · 3 lines
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.