aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/mm/init.c
diff options
context:
space:
mode:
authorPaul Burton <[email protected]>2016-04-19 09:25:05 +0100
committerRalf Baechle <[email protected]>2016-05-13 15:30:25 +0200
commit7b2cb64f91f25a7293b10054e20d1c0734ffab6f (patch)
tree6631b4d6dc4e3294bfecd1835000578ef374bd0f /arch/mips/mm/init.c
parent745f35587846249b392aa548b4c5f54cd69ed688 (diff)
MIPS: mm: Fix MIPS32 36b physical addressing (alchemy, netlogic)
There are 2 distinct cases in which a kernel for a MIPS32 CPU (CONFIG_CPU_MIPS32=y) may use 64 bit physical addresses (CONFIG_PHYS_ADDR_T_64BIT=y): - 36 bit physical addressing as used by RMI Alchemy & Netlogic XLP/XLR CPUs. - MIPS32r5 eXtended Physical Addressing (XPA). These 2 cases are distinct in that they require different behaviour from the kernel - the EntryLo registers have different formats. Until Linux v4.1 we only supported the first case, with code conditional upon the 2 aforementioned Kconfig variables being set. Commit c5b367835cfc ("MIPS: Add support for XPA.") added support for the second case, but did so by modifying the code that existed for the first case rather than treating the 2 cases as distinct. Since the EntryLo registers have different formats this breaks the 36 bit Alchemy/XLP/XLR case. Fix this by splitting the 2 cases, with XPA cases now being conditional upon CONFIG_XPA and the non-XPA case matching the code as it existed prior to commit c5b367835cfc ("MIPS: Add support for XPA."). Signed-off-by: Paul Burton <[email protected]> Reported-by: Manuel Lauss <[email protected]> Tested-by: Manuel Lauss <[email protected]> Fixes: c5b367835cfc ("MIPS: Add support for XPA.") Cc: James Hogan <[email protected]> Cc: David Daney <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Maciej W. Rozycki <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Alex Smith <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: [email protected] # v4.1+ Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/13119/ Signed-off-by: Ralf Baechle <[email protected]>
Diffstat (limited to 'arch/mips/mm/init.c')
-rw-r--r--arch/mips/mm/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 6c6a843b0d17..134c988bc61f 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -98,8 +98,10 @@ static void *__kmap_pgprot(struct page *page, unsigned long addr, pgprot_t prot)
idx += in_interrupt() ? FIX_N_COLOURS : 0;
vaddr = __fix_to_virt(FIX_CMAP_END - idx);
pte = mk_pte(page, prot);
-#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
+#if defined(CONFIG_XPA)
entrylo = pte_to_entrylo(pte.pte_high);
+#elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
+ entrylo = pte.pte_high;
#else
entrylo = pte_to_entrylo(pte_val(pte));
#endif