diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2016-05-05 11:23:48 +0200 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2016-05-05 13:05:45 +0200 |
commit | 2519d753676bdf2460fbbcde276d5b6ba8d6b695 (patch) | |
tree | 4db307eac2f8efbfe9699b6c0bb449d346d6ad10 /arch/arc/include/asm/page.h | |
parent | ARC: Add missing io barriers to io{read,write}{16,32}be() (diff) | |
download | linux-2519d753676bdf2460fbbcde276d5b6ba8d6b695.tar.xz linux-2519d753676bdf2460fbbcde276d5b6ba8d6b695.zip |
ARC: Fix PAE40 boot failures due to PTE truncation
So a benign looking cleanup which macro'ized PAGE_SHIFT shifts turned
out to be bad (since it was done non-sensically across the board).
It caused boot failures with PAE40 as forced cast to (unsigned long)
from newly introduced virt_to_pfn() was causing truncatiion of the
(long long) pte/paddr values.
It is OK to use this in accessors dealing with kernel virtual address,
pointers etc, but not for PTE values themelves.
Fixes: cJ2ff5cf2735c ("ARC: mm: Use virt_to_pfn() for addr >> PAGE_SHIFT pattern)
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/include/asm/page.h')
-rw-r--r-- | arch/arc/include/asm/page.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h index 36da89e2c853..533e5a0c6ba5 100644 --- a/arch/arc/include/asm/page.h +++ b/arch/arc/include/asm/page.h @@ -72,6 +72,13 @@ typedef unsigned long pgprot_t; typedef pte_t * pgtable_t; +/* + * Use virt_to_pfn with caution: + * If used in pte or paddr related macros, it could cause truncation + * in PAE40 builds + * As a rule of thumb, only use it in helpers starting with virt_ + * You have been warned ! + */ #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) #define ARCH_PFN_OFFSET virt_to_pfn(CONFIG_LINUX_LINK_BASE) @@ -85,7 +92,7 @@ typedef pte_t * pgtable_t; * virt here means link-address/program-address as embedded in object code. * And for ARC, link-addr = physical address */ -#define __pa(vaddr) ((unsigned long)vaddr) +#define __pa(vaddr) ((unsigned long)(vaddr)) #define __va(paddr) ((void *)((unsigned long)(paddr))) #define virt_to_page(kaddr) \ |