aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2015-02-24 18:35:34 -0500
committerRalf Baechle <ralf@linux-mips.org>2015-04-01 11:21:59 -0400
commit5ae03b1220ac22b823d8414997329806db16020c (patch)
treec82b4fbb8edf5593ab2deddc057fbd6561eb680f
parent80aaaa8b93d860f828e2cf883f307894640765f0 (diff)
MIPS: Expand __swp_offset() to carry 40 significant bits for 64-bit kernel.
With CONFIG_MIGRATION, the PFN of the migrating pages is stored in __swp_offset(), so we must have enough bits to store the largest possible PFN. OCTEON NUMA systems have 41 bits of physical address space, so with 4K pages (12-bits), we need at least 29 bits to store the PFN. The current width of 24-bits is too narrow, so expand it all the way out to 40-bits. This leaves the low order 16 bits as zero which does not interfere with any of the PTE bits. Signed-off-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9315/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/pgtable-64.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
index 1659bb91ae21..cf661a2fb141 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -279,14 +279,14 @@ extern void pgd_init(unsigned long page);
279extern void pmd_init(unsigned long page, unsigned long pagetable); 279extern void pmd_init(unsigned long page, unsigned long pagetable);
280 280
281/* 281/*
282 * Non-present pages: high 24 bits are offset, next 8 bits type, 282 * Non-present pages: high 40 bits are offset, next 8 bits type,
283 * low 32 bits zero. 283 * low 16 bits zero.
284 */ 284 */
285static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) 285static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
286{ pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; } 286{ pte_t pte; pte_val(pte) = (type << 16) | (offset << 24); return pte; }
287 287
288#define __swp_type(x) (((x).val >> 32) & 0xff) 288#define __swp_type(x) (((x).val >> 16) & 0xff)
289#define __swp_offset(x) ((x).val >> 40) 289#define __swp_offset(x) ((x).val >> 24)
290#define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) }) 290#define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) })
291#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 291#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
292#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 292#define __swp_entry_to_pte(x) ((pte_t) { (x).val })