Skip to content

Commit

Permalink
powerpc/mm/highmem: Switch to generic kmap atomic
Browse files Browse the repository at this point in the history
No reason having the same code in every architecture

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20201103095858.087635810@linutronix.de
  • Loading branch information
Thomas Gleixner committed Nov 6, 2020
1 parent 5f037ea commit 47da42b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 92 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ menu "Kernel options"
config HIGHMEM
bool "High memory support"
depends on PPC32
select KMAP_LOCAL

source "kernel/Kconfig.hz"

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/fixmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <asm/page.h>
#ifdef CONFIG_HIGHMEM
#include <linux/threads.h>
#include <asm/kmap_types.h>
#include <asm/kmap_size.h>
#endif

#ifdef CONFIG_KASAN
Expand Down Expand Up @@ -55,7 +55,7 @@ enum fixed_addresses {
FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128K, PAGE_SIZE)/PAGE_SIZE)-1,
#ifdef CONFIG_HIGHMEM
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
#endif
#ifdef CONFIG_PPC_8xx
/* For IMMR we need an aligned 512K area */
Expand Down
7 changes: 5 additions & 2 deletions arch/powerpc/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
#ifdef __KERNEL__

#include <linux/interrupt.h>
#include <asm/kmap_types.h>
#include <asm/cacheflush.h>
#include <asm/page.h>
#include <asm/fixmap.h>

extern pte_t *kmap_pte;
extern pte_t *pkmap_page_table;

/*
Expand Down Expand Up @@ -60,6 +58,11 @@ extern pte_t *pkmap_page_table;

#define flush_cache_kmaps() flush_cache_all()

#define arch_kmap_local_post_map(vaddr, pteval) \
local_flush_tlb_page(NULL, vaddr)
#define arch_kmap_local_post_unmap(vaddr) \
local_flush_tlb_page(NULL, vaddr)

#endif /* __KERNEL__ */

#endif /* _ASM_HIGHMEM_H */
13 changes: 0 additions & 13 deletions arch/powerpc/include/asm/kmap_types.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/powerpc/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
obj-$(CONFIG_PPC_MM_SLICES) += slice.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
obj-$(CONFIG_HIGHMEM) += highmem.o
obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o
obj-$(CONFIG_PPC_PTDUMP) += ptdump/
obj-$(CONFIG_KASAN) += kasan/
67 changes: 0 additions & 67 deletions arch/powerpc/mm/highmem.c

This file was deleted.

7 changes: 0 additions & 7 deletions arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
unsigned long long memory_limit;
bool init_mem_is_free;

#ifdef CONFIG_HIGHMEM
pte_t *kmap_pte;
EXPORT_SYMBOL(kmap_pte);
#endif

pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot)
{
Expand Down Expand Up @@ -235,8 +230,6 @@ void __init paging_init(void)

map_kernel_page(PKMAP_BASE, 0, __pgprot(0)); /* XXX gross */
pkmap_page_table = virt_to_kpte(PKMAP_BASE);

kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN));
#endif /* CONFIG_HIGHMEM */

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

0 comments on commit 47da42b

Please sign in to comment.