Skip to content

Commit

Permalink
microblaze/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: Michal Simek <monstr@monstr.eu>
Cc: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20201103095857.777445435@linutronix.de
  • Loading branch information
Thomas Gleixner committed Nov 6, 2020
1 parent 5af627a commit 7ac1b26
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 88 deletions.
1 change: 1 addition & 0 deletions arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ config XILINX_UNCACHED_SHADOW
config HIGHMEM
bool "High memory support"
depends on MMU
select KMAP_LOCAL
help
The address space of Microblaze processors is only 4 Gigabytes large
and it has to accommodate user address space, kernel address
Expand Down
4 changes: 2 additions & 2 deletions arch/microblaze/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

#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
Expand All @@ -47,7 +47,7 @@ enum fixed_addresses {
FIX_HOLE,
#ifdef CONFIG_HIGHMEM
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * num_possible_cpus()) - 1,
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
#endif
__end_of_fixed_addresses
};
Expand Down
6 changes: 5 additions & 1 deletion arch/microblaze/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/uaccess.h>
#include <asm/fixmap.h>

extern pte_t *kmap_pte;
extern pte_t *pkmap_page_table;

/*
Expand All @@ -52,6 +51,11 @@ extern pte_t *pkmap_page_table;

#define flush_cache_kmaps() { flush_icache(); flush_dcache(); }

#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 */
1 change: 0 additions & 1 deletion arch/microblaze/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
obj-y := consistent.o init.o

obj-$(CONFIG_MMU) += pgtable.o mmu_context.o fault.o
obj-$(CONFIG_HIGHMEM) += highmem.o
78 changes: 0 additions & 78 deletions arch/microblaze/mm/highmem.c

This file was deleted.

6 changes: 0 additions & 6 deletions arch/microblaze/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,11 @@ unsigned long lowmem_size;
EXPORT_SYMBOL(min_low_pfn);
EXPORT_SYMBOL(max_low_pfn);

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

static void __init highmem_init(void)
{
pr_debug("%x\n", (u32)PKMAP_BASE);
map_page(PKMAP_BASE, 0, 0); /* XXX gross */
pkmap_page_table = virt_to_kpte(PKMAP_BASE);

kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN));
}

static void highmem_setup(void)
Expand Down

0 comments on commit 7ac1b26

Please sign in to comment.