Skip to content

Commit a1dce7f

Browse files
KAGA-KOKOtorvalds
authored andcommitted
mm/highmem: prepare for overriding set_pte_at()
The generic kmap_local() map function uses set_pte_at(), but MIPS requires set_pte() and PowerPC wants __set_pte_at(). Provide arch_kmap_local_set_pte() and default it to set_pte_at(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]> Cc: Andreas Larsson <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Paul Cercueil <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f99e023 commit a1dce7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mm/highmem.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ static inline void *arch_kmap_local_high_get(struct page *page)
473473
}
474474
#endif
475475

476+
#ifndef arch_kmap_local_set_pte
477+
#define arch_kmap_local_set_pte(mm, vaddr, ptep, ptev) \
478+
set_pte_at(mm, vaddr, ptep, ptev)
479+
#endif
480+
476481
/* Unmap a local mapping which was obtained by kmap_high_get() */
477482
static inline bool kmap_high_unmap_local(unsigned long vaddr)
478483
{
@@ -515,7 +520,7 @@ void *__kmap_local_pfn_prot(unsigned long pfn, pgprot_t prot)
515520
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
516521
BUG_ON(!pte_none(*(kmap_pte - idx)));
517522
pteval = pfn_pte(pfn, prot);
518-
set_pte_at(&init_mm, vaddr, kmap_pte - idx, pteval);
523+
arch_kmap_local_set_pte(&init_mm, vaddr, kmap_pte - idx, pteval);
519524
arch_kmap_local_post_map(vaddr, pteval);
520525
current->kmap_ctrl.pteval[kmap_local_idx()] = pteval;
521526
preempt_enable();

0 commit comments

Comments
 (0)