Skip to content

Commit 6a8b2ca

Browse files
kolerovvineetgarc
authored andcommitted
ARC: mm: PAE40: Fix crash at munmap
commit 1c3c909 broke PAE40. Macro pfn_pte(pfn, prot) creates paddr from pfn, but the page shift was getting truncated to 32 bits since we lost the proper cast to 64 bits (for PAE400 Instead of reverting that commit, use a better helper which is 32/64 bits safe just like ARM implementation. Fixes: 1c3c909 ("ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS") Cc: <stable@vger.kernel.org> ev3dev#4.4+ Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com> [vgupta: massaged changelog] Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 23cb1f6 commit 6a8b2ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arc/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
280280

281281
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
282282
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
283-
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
283+
#define pfn_pte(pfn, prot) __pte(__pfn_to_phys(pfn) | pgprot_val(prot))
284284

285285
/* Don't use virt_to_pfn for macros below: could cause truncations for PAE40*/
286286
#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)

0 commit comments

Comments
 (0)