Skip to content

Commit 7ac1b26

Browse files
committed
microblaze/mm/highmem: Switch to generic kmap atomic
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Michal Simek <[email protected]> Cc: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5af627a commit 7ac1b26

File tree

6 files changed

+8
-88
lines changed

6 files changed

+8
-88
lines changed

arch/microblaze/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ config XILINX_UNCACHED_SHADOW
155155
config HIGHMEM
156156
bool "High memory support"
157157
depends on MMU
158+
select KMAP_LOCAL
158159
help
159160
The address space of Microblaze processors is only 4 Gigabytes large
160161
and it has to accommodate user address space, kernel address

arch/microblaze/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
#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
@@ -47,7 +47,7 @@ enum fixed_addresses {
4747
FIX_HOLE,
4848
#ifdef CONFIG_HIGHMEM
4949
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
50-
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * num_possible_cpus()) - 1,
50+
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
5151
#endif
5252
__end_of_fixed_addresses
5353
};

arch/microblaze/include/asm/highmem.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/uaccess.h>
2626
#include <asm/fixmap.h>
2727

28-
extern pte_t *kmap_pte;
2928
extern pte_t *pkmap_page_table;
3029

3130
/*
@@ -52,6 +51,11 @@ extern pte_t *pkmap_page_table;
5251

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

54+
#define arch_kmap_local_post_map(vaddr, pteval) \
55+
local_flush_tlb_page(NULL, vaddr);
56+
#define arch_kmap_local_post_unmap(vaddr) \
57+
local_flush_tlb_page(NULL, vaddr);
58+
5559
#endif /* __KERNEL__ */
5660

5761
#endif /* _ASM_HIGHMEM_H */

arch/microblaze/mm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
obj-y := consistent.o init.o
77

88
obj-$(CONFIG_MMU) += pgtable.o mmu_context.o fault.o
9-
obj-$(CONFIG_HIGHMEM) += highmem.o

arch/microblaze/mm/highmem.c

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

arch/microblaze/mm/init.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@ unsigned long lowmem_size;
4949
EXPORT_SYMBOL(min_low_pfn);
5050
EXPORT_SYMBOL(max_low_pfn);
5151

52-
#ifdef CONFIG_HIGHMEM
53-
pte_t *kmap_pte;
54-
EXPORT_SYMBOL(kmap_pte);
55-
5652
static void __init highmem_init(void)
5753
{
5854
pr_debug("%x\n", (u32)PKMAP_BASE);
5955
map_page(PKMAP_BASE, 0, 0); /* XXX gross */
6056
pkmap_page_table = virt_to_kpte(PKMAP_BASE);
61-
62-
kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN));
6357
}
6458

6559
static void highmem_setup(void)

0 commit comments

Comments
 (0)