Skip to content

Commit 47da42b

Browse files
committed
powerpc/mm/highmem: Switch to generic kmap atomic
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5f037ea commit 47da42b

File tree

7 files changed

+8
-92
lines changed

7 files changed

+8
-92
lines changed

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ menu "Kernel options"
409409
config HIGHMEM
410410
bool "High memory support"
411411
depends on PPC32
412+
select KMAP_LOCAL
412413

413414
source "kernel/Kconfig.hz"
414415

arch/powerpc/include/asm/fixmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <asm/page.h>
2121
#ifdef CONFIG_HIGHMEM
2222
#include <linux/threads.h>
23-
#include <asm/kmap_types.h>
23+
#include <asm/kmap_size.h>
2424
#endif
2525

2626
#ifdef CONFIG_KASAN
@@ -55,7 +55,7 @@ enum fixed_addresses {
5555
FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128K, PAGE_SIZE)/PAGE_SIZE)-1,
5656
#ifdef CONFIG_HIGHMEM
5757
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
58-
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
58+
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
5959
#endif
6060
#ifdef CONFIG_PPC_8xx
6161
/* For IMMR we need an aligned 512K area */

arch/powerpc/include/asm/highmem.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
#ifdef __KERNEL__
2525

2626
#include <linux/interrupt.h>
27-
#include <asm/kmap_types.h>
2827
#include <asm/cacheflush.h>
2928
#include <asm/page.h>
3029
#include <asm/fixmap.h>
3130

32-
extern pte_t *kmap_pte;
3331
extern pte_t *pkmap_page_table;
3432

3533
/*
@@ -60,6 +58,11 @@ extern pte_t *pkmap_page_table;
6058

6159
#define flush_cache_kmaps() flush_cache_all()
6260

61+
#define arch_kmap_local_post_map(vaddr, pteval) \
62+
local_flush_tlb_page(NULL, vaddr)
63+
#define arch_kmap_local_post_unmap(vaddr) \
64+
local_flush_tlb_page(NULL, vaddr)
65+
6366
#endif /* __KERNEL__ */
6467

6568
#endif /* _ASM_HIGHMEM_H */

arch/powerpc/include/asm/kmap_types.h

Lines changed: 0 additions & 13 deletions
This file was deleted.

arch/powerpc/mm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
1616
obj-$(CONFIG_PPC_MM_SLICES) += slice.o
1717
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
1818
obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
19-
obj-$(CONFIG_HIGHMEM) += highmem.o
2019
obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o
2120
obj-$(CONFIG_PPC_PTDUMP) += ptdump/
2221
obj-$(CONFIG_KASAN) += kasan/

arch/powerpc/mm/highmem.c

Lines changed: 0 additions & 67 deletions
This file was deleted.

arch/powerpc/mm/mem.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@
6161
unsigned long long memory_limit;
6262
bool init_mem_is_free;
6363

64-
#ifdef CONFIG_HIGHMEM
65-
pte_t *kmap_pte;
66-
EXPORT_SYMBOL(kmap_pte);
67-
#endif
68-
6964
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
7065
unsigned long size, pgprot_t vma_prot)
7166
{
@@ -235,8 +230,6 @@ void __init paging_init(void)
235230

236231
map_kernel_page(PKMAP_BASE, 0, __pgprot(0)); /* XXX gross */
237232
pkmap_page_table = virt_to_kpte(PKMAP_BASE);
238-
239-
kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN));
240233
#endif /* CONFIG_HIGHMEM */
241234

242235
printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n",

0 commit comments

Comments
 (0)