From: Linus Torvalds Date: Wed, 16 Dec 2020 20:04:39 +0000 (-0800) Subject: Merge tag 'microblaze-v5.11' of git://git.monstr.eu/linux-2.6-microblaze X-Git-Url: https://repo.jachan.dev/J-linux.git/commitdiff_plain/66fc6a6254c7a138aef7806bd933c218e1aefcfc?hp=-c Merge tag 'microblaze-v5.11' of git://git.monstr.eu/linux-2.6-microblaze Pull microblaze updates from Michal Simek: "The biggest change is to remove support for noMMU configuration. FPGAs are bigger so people use Microblaze with MMU for a lot of years and there is likely no user of this code anymore. No one is updating libraries for this configuration either. - Remove noMMU support - Add support for TIF_NOTIFY_SIGNAL - Small header fix" * tag 'microblaze-v5.11' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Remove noMMU code microblaze: add support for TIF_NOTIFY_SIGNAL microblaze: Replace by --- 66fc6a6254c7a138aef7806bd933c218e1aefcfc diff --combined arch/microblaze/Kconfig index 93d459f016fc,32739ab2af25..f82795592ce5 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@@ -3,20 -3,19 +3,18 @@@ config MICROBLAZ def_bool y select ARCH_32BIT_OFF_T select ARCH_NO_SWAP - select ARCH_HAS_BINFMT_FLAT if !MMU select ARCH_HAS_DMA_PREP_COHERENT select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYNC_DMA_FOR_DEVICE - select ARCH_HAS_DMA_SET_UNCACHED if !MMU select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_WANT_IPC_PARSE_VERSION select BUILDTIME_TABLE_SORT select TIMER_OF select CLONE_BACKWARDS3 select COMMON_CLK - select DMA_DIRECT_REMAP if MMU + select DMA_DIRECT_REMAP select GENERIC_ATOMIC64 - select GENERIC_CLOCKEVENTS select GENERIC_CPU_DEVICES select GENERIC_IDLE_POLL_SETUP select GENERIC_IRQ_PROBE @@@ -44,7 -43,7 +42,7 @@@ select TRACING_SUPPORT select VIRT_TO_BUS select CPU_NO_EFFICIENT_FFS - select MMU_GATHER_NO_RANGE if MMU + select MMU_GATHER_NO_RANGE select SPARSE_IRQ select SET_FS @@@ -95,8 -94,7 +93,7 @@@ menu "Processor type and features source "kernel/Kconfig.hz" config MMU - bool "MMU support" - default n + def_bool y comment "Boot options" @@@ -142,19 -140,8 +139,9 @@@ config ADVANCED_OPTION comment "Default settings for advanced configuration options are used" depends on !ADVANCED_OPTIONS - config XILINX_UNCACHED_SHADOW - bool "Are you using uncached shadow for RAM ?" - depends on ADVANCED_OPTIONS && !MMU - default n - help - This is needed to be able to allocate uncachable memory regions. - The feature requires the design to define the RAM memory controller - window to be twice as large as the actual physical memory. - 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 @@@ -167,7 -154,7 +154,7 @@@ config LOWMEM_SIZE_BOOL bool "Set maximum low memory" - depends on ADVANCED_OPTIONS && MMU + depends on ADVANCED_OPTIONS help This option allows you to set the maximum amount of memory which will be used as "low memory", that is, memory which the kernel can @@@ -205,12 -192,11 +192,11 @@@ config KERNEL_START_BOO config KERNEL_START hex "Virtual address of kernel base" if KERNEL_START_BOOL - default "0xc0000000" if MMU - default KERNEL_BASE_ADDR if !MMU + default "0xc0000000" config TASK_SIZE_BOOL bool "Set custom user task size" - depends on ADVANCED_OPTIONS && MMU + depends on ADVANCED_OPTIONS help This option allows you to set the amount of virtual address space allocated to user tasks. This can be useful in optimizing the @@@ -222,33 -208,6 +208,6 @@@ config TASK_SIZ hex "Size of user task space" if TASK_SIZE_BOOL default "0x80000000" - choice - prompt "Page size" - default MICROBLAZE_4K_PAGES - depends on ADVANCED_OPTIONS && !MMU - help - Select the kernel logical page size. Increasing the page size - will reduce software overhead at each page boundary, allow - hardware prefetch mechanisms to be more effective, and allow - larger dma transfers increasing IO efficiency and reducing - overhead. However the utilization of memory will increase. - For example, each cached file will using a multiple of the - page size to hold its contents and the difference between the - end of file and the end of page is wasted. - - If unsure, choose 4K_PAGES. - - config MICROBLAZE_4K_PAGES - bool "4k page size" - - config MICROBLAZE_16K_PAGES - bool "16k page size" - - config MICROBLAZE_64K_PAGES - bool "64k page size" - - endchoice - endmenu menu "Bus Options" diff --combined arch/microblaze/include/asm/processor.h index 616211871a6e,f4f3048cde4c..06c6e493590a --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@@ -31,42 -31,6 +31,6 @@@ extern void ret_from_kernel_thread(void # endif /* __ASSEMBLY__ */ - # ifndef CONFIG_MMU - /* - * User space process size: memory size - * - * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both - * user processes and the kernel is on the same memory region. They - * both share the memory space and that is limited by the amount of - * physical memory. thus, we set TASK_SIZE == amount of total memory. - */ - # define TASK_SIZE (0x81000000 - 0x80000000) - - /* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. We won't be using it - */ - # define TASK_UNMAPPED_BASE 0 - - /* definition in include/linux/sched.h */ - struct task_struct; - - /* thread_struct is gone. use thread_info instead. */ - struct thread_struct { }; - # define INIT_THREAD { } - - /* Free all resources held by a thread. */ - static inline void release_thread(struct task_struct *dead_task) - { - } - - extern unsigned long get_wchan(struct task_struct *p); - - # define KSTK_EIP(tsk) (0) - # define KSTK_ESP(tsk) (0) - - # else /* CONFIG_MMU */ - /* * This is used to define STACK_TOP, and with MMU it must be below * kernel base to select the correct PGD when handling MMU exceptions. @@@ -122,6 -86,9 +86,6 @@@ unsigned long get_wchan(struct task_str # define KSTK_EIP(task) (task_pc(task)) # define KSTK_ESP(task) (task_sp(task)) -/* FIXME */ -# define deactivate_mm(tsk, mm) do { } while (0) - # define STACK_TOP TASK_SIZE # define STACK_TOP_MAX STACK_TOP @@@ -130,5 -97,4 +94,4 @@@ extern struct dentry *of_debugfs_root #endif # endif /* __ASSEMBLY__ */ - # endif /* CONFIG_MMU */ #endif /* _ASM_MICROBLAZE_PROCESSOR_H */ diff --combined arch/microblaze/kernel/process.c index f99860771ff4,3afda1823730..657c2beb665e --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c @@@ -69,9 -69,7 +69,7 @@@ int copy_thread(unsigned long clone_fla ti->cpu_context.r19 = (unsigned long)arg; childregs->pt_mode = 1; local_save_flags(childregs->msr); - #ifdef CONFIG_MMU ti->cpu_context.msr = childregs->msr & ~MSR_IE; - #endif ti->cpu_context.r15 = (unsigned long)ret_from_kernel_thread - 8; return 0; } @@@ -81,9 -79,6 +79,6 @@@ memset(&ti->cpu_context, 0, sizeof(struct cpu_context)); ti->cpu_context.r1 = (unsigned long)childregs; - #ifndef CONFIG_MMU - ti->cpu_context.msr = (unsigned long)childregs->msr; - #else childregs->msr |= MSR_UMS; /* we should consider the fact that childregs is a copy of the parent @@@ -105,7 -100,6 +100,6 @@@ ti->cpu_context.msr = (childregs->msr|MSR_VM); ti->cpu_context.msr &= ~MSR_UMS; /* switch_to to kernel mode */ ti->cpu_context.msr &= ~MSR_IE; - #endif ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8; /* @@@ -130,13 -124,10 +124,10 @@@ void start_thread(struct pt_regs *regs regs->pc = pc; regs->r1 = usp; regs->pt_mode = 0; - #ifdef CONFIG_MMU regs->msr |= MSR_UMS; regs->msr &= ~MSR_VM; - #endif } - #ifdef CONFIG_MMU #include /* * Set up a thread for executing a new program @@@ -145,9 -136,8 +136,8 @@@ int dump_fpu(struct pt_regs *regs, elf_ { return 0; /* MicroBlaze has no separate FPU registers */ } - #endif /* CONFIG_MMU */ void arch_cpu_idle(void) { - local_irq_enable(); + raw_local_irq_enable(); } diff --combined arch/microblaze/mm/Makefile index 8ced71100047,cd8a844bf29e..75edfc110d3e --- a/arch/microblaze/mm/Makefile +++ b/arch/microblaze/mm/Makefile @@@ -3,6 -3,7 +3,4 @@@ # Makefile # --obj-y := consistent.o init.o -- - obj-$(CONFIG_MMU) += pgtable.o mmu_context.o fault.o -obj-y += pgtable.o mmu_context.o fault.o -obj-$(CONFIG_HIGHMEM) += highmem.o ++obj-y := consistent.o init.o pgtable.o mmu_context.o fault.o diff --combined arch/microblaze/mm/init.c index a444778e59de,7129a20881ea..181e48782e6c --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@@ -29,11 -29,6 +29,6 @@@ /* Use for MMU and noMMU because of PCI generic code */ int mem_init_done; - #ifndef CONFIG_MMU - unsigned int __page_offset; - EXPORT_SYMBOL(__page_offset); - #endif /* CONFIG_MMU */ - char *klimit = _end; /* @@@ -50,11 -45,16 +45,11 @@@ 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) @@@ -77,13 -77,11 +72,11 @@@ static void __init paging_init(void) { unsigned long zones_size[MAX_NR_ZONES]; - #ifdef CONFIG_MMU int idx; /* Setup fixmaps */ for (idx = 0; idx < __end_of_fixed_addresses; idx++) clear_fixmap(idx); - #endif /* Clean every zones */ memset(zones_size, 0, sizeof(zones_size)); @@@ -103,40 -101,6 +96,6 @@@ void __init setup_memory(void) { - #ifndef CONFIG_MMU - u32 kernel_align_start, kernel_align_size; - phys_addr_t start, end; - u64 i; - - /* Find main memory where is the kernel */ - for_each_mem_range(i, &start, &end) { - memory_start = start; - lowmem_size = end - start; - if ((memory_start <= (u32)_text) && - ((u32)_text <= (memory_start + lowmem_size - 1))) { - memory_size = lowmem_size; - PAGE_OFFSET = memory_start; - pr_info("%s: Main mem: 0x%x, size 0x%08x\n", - __func__, (u32) memory_start, - (u32) memory_size); - break; - } - } - - if (!memory_start || !memory_size) { - panic("%s: Missing memory setting 0x%08x, size=0x%08x\n", - __func__, (u32) memory_start, (u32) memory_size); - } - - /* reservation of region where is the kernel */ - kernel_align_start = PAGE_DOWN((u32)_text); - /* ALIGN can be remove because _end in vmlinux.lds.S is align */ - kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start; - pr_info("%s: kernel addr:0x%08x-0x%08x size=0x%08x\n", - __func__, kernel_align_start, kernel_align_start - + kernel_align_size, kernel_align_size); - memblock_reserve(kernel_align_start, kernel_align_size); - #endif /* * Kernel: * start: base phys address of kernel - page align @@@ -176,12 -140,6 +135,6 @@@ void __init mem_init(void mem_init_done = 1; } - #ifndef CONFIG_MMU - int page_is_ram(unsigned long pfn) - { - return __range_ok(pfn, 0); - } - #else int page_is_ram(unsigned long pfn) { return pfn < max_low_pfn; @@@ -325,8 -283,6 +278,6 @@@ void __init *early_get_page(void NUMA_NO_NODE); } - #endif /* CONFIG_MMU */ - void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask) { void *p;