From: Linus Torvalds Date: Mon, 30 May 2022 17:56:18 +0000 (-0700) Subject: Merge tag 'm68knommu-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v5.19-rc1~99 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/2d2da475ac0eebfbf40e5c5ca8c0409d62d23424?hp=-c Merge tag 'm68knommu-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "A collection of changes to add elf-fdpic loader support for m68k. Also a collection of various fixes. They include typo corrections, undefined symbol compilation fixes, removal of the ISA_DMA_API support and removal of unused code. Summary: - correctly set up ZERO_PAGE pointer - drop ISA_DMA_API support - fix comment typos - fixes for undefined symbols - remove unused code and variables - elf-fdpic loader support for m68k" * tag 'm68knommu-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: fix 68000 CPU link with no platform selected m68k: removed unused "mach_get_ss" m68knommu: fix undefined reference to `mach_get_rtc_pll' m68knommu: fix undefined reference to `_init_sp' m68knommu: allow elf_fdpic loader to be selected m68knommu: add definitions to support elf_fdpic program loader m68knommu: implement minimal regset support m68knommu: use asm-generic/mmu.h for nommu setups m68k: fix typos in comments m68k: coldfire: drop ISA_DMA_API support m68knommu: set ZERO_PAGE() to the allocated zeroed page --- 2d2da475ac0eebfbf40e5c5ca8c0409d62d23424 diff --combined arch/m68k/Kconfig.cpu index 3d5da25c73b5,ed719a855e6a..f3aa44156969 --- a/arch/m68k/Kconfig.cpu +++ b/arch/m68k/Kconfig.cpu @@@ -37,7 -37,7 +37,7 @@@ endchoic if M68KCLASSIC config M68000 - bool + def_bool y depends on !MMU select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_CAS @@@ -327,7 -327,7 +327,7 @@@ comment "Processor Specific Options config M68KFPU_EMU bool "Math emulation support" - depends on MMU + depends on M68KCLASSIC && FPU help At some point in the future, this will cause floating-point math instructions to be emulated by the kernel on machines that lack a diff --combined arch/m68k/Kconfig.machine index 188a8f8a0104,946853a08502..a1042568b9ad --- a/arch/m68k/Kconfig.machine +++ b/arch/m68k/Kconfig.machine @@@ -149,23 -149,6 +149,23 @@@ config SUN If you don't want to compile a kernel exclusively for a Sun 3, say N. +config VIRT + bool "Virtual M68k Machine support" + depends on MMU + select GENERIC_CLOCKEVENTS + select GOLDFISH + select GOLDFISH_TIMER + select GOLDFISH_TTY + select M68040 + select MMU_MOTOROLA if MMU + select RTC_CLASS + select RTC_DRV_GOLDFISH + select TTY + select VIRTIO_MMIO + help + This options enable a pure virtual machine based on m68k, + VIRTIO MMIO devices and GOLDFISH interfaces (TTY, RTC, PIC) + config PILOT bool @@@ -352,6 -335,7 +352,7 @@@ comment "Machine Options config UBOOT bool "Support for U-Boot command line parameters" + depends on COLDFIRE help If you say Y here kernel will try to collect command line parameters from the initial u-boot stack. diff --combined arch/m68k/kernel/ptrace.c index daebccdd2c09,4349b9c4dd68..0a4184a37461 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c @@@ -19,6 -19,8 +19,8 @@@ #include #include #include + #include + #include #include #include @@@ -270,6 -272,12 +272,6 @@@ out_eio return -EIO; } -asmlinkage void syscall_trace(void) -{ - ptrace_report_syscall(0); -} - -#if defined(CONFIG_COLDFIRE) || !defined(CONFIG_MMU) asmlinkage int syscall_trace_enter(void) { int ret = 0; @@@ -284,3 -292,60 +286,59 @@@ asmlinkage void syscall_trace_leave(voi if (test_thread_flag(TIF_SYSCALL_TRACE)) ptrace_report_syscall_exit(task_pt_regs(current), 0); } -#endif /* CONFIG_COLDFIRE */ + + #if defined(CONFIG_BINFMT_ELF_FDPIC) && defined(CONFIG_ELF_CORE) + /* + * Currently the only thing that needs to use regsets for m68k is the + * coredump support of the elf_fdpic loader. Implement the minimum + * definitions required for that. + */ + static int m68k_regset_get(struct task_struct *target, + const struct user_regset *regset, + struct membuf to) + { + struct pt_regs *ptregs = task_pt_regs(target); + u32 uregs[ELF_NGREG]; + + ELF_CORE_COPY_REGS(uregs, ptregs); + return membuf_write(&to, uregs, sizeof(uregs)); + } + + enum m68k_regset { + REGSET_GPR, + #ifdef CONFIG_FPU + REGSET_FPU, + #endif + }; + + static const struct user_regset m68k_user_regsets[] = { + [REGSET_GPR] = { + .core_note_type = NT_PRSTATUS, + .n = ELF_NGREG, + .size = sizeof(u32), + .align = sizeof(u16), + .regset_get = m68k_regset_get, + }, + #ifdef CONFIG_FPU + [REGSET_FPU] = { + .core_note_type = NT_PRFPREG, + .n = sizeof(struct user_m68kfp_struct) / sizeof(u32), + .size = sizeof(u32), + .align = sizeof(u32), + } + #endif /* CONFIG_FPU */ + }; + + static const struct user_regset_view user_m68k_view = { + .name = "m68k", + .e_machine = EM_68K, + .ei_osabi = ELF_OSABI, + .regsets = m68k_user_regsets, + .n = ARRAY_SIZE(m68k_user_regsets) + }; + + const struct user_regset_view *task_user_regset_view(struct task_struct *task) + { + return &user_m68k_view; + } + #endif /* CONFIG_BINFMT_ELF_FDPIC && CONFIG_ELF_CORE */ diff --combined arch/m68k/kernel/setup_mm.c index 78ab562beb31,0593bf345b34..656841defd2a --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@@ -87,15 -87,6 +87,6 @@@ void (*mach_sched_init) (void) __initda void (*mach_init_IRQ) (void) __initdata = NULL; void (*mach_get_model) (char *model); void (*mach_get_hardware_list) (struct seq_file *m); - /* machine dependent timer functions */ - int (*mach_hwclk) (int, struct rtc_time*); - EXPORT_SYMBOL(mach_hwclk); - unsigned int (*mach_get_ss)(void); - int (*mach_get_rtc_pll)(struct rtc_pll_info *); - int (*mach_set_rtc_pll)(struct rtc_pll_info *); - EXPORT_SYMBOL(mach_get_ss); - EXPORT_SYMBOL(mach_get_rtc_pll); - EXPORT_SYMBOL(mach_set_rtc_pll); void (*mach_reset)( void ); void (*mach_halt)( void ); void (*mach_power_off)( void ); @@@ -181,8 -172,6 +172,8 @@@ static void __init m68k_parse_bootinfo( unknown = hp300_parse_bootinfo(record); else if (MACH_IS_APOLLO) unknown = apollo_parse_bootinfo(record); + else if (MACH_IS_VIRT) + unknown = virt_parse_bootinfo(record); else unknown = 1; } @@@ -313,11 -302,6 +304,11 @@@ void __init setup_arch(char **cmdline_p cf_mmu_context_init(); config_BSP(NULL, 0); break; +#endif +#ifdef CONFIG_VIRT + case MACH_VIRT: + config_virt(); + break; #endif default: panic("No configuration setup"); diff --combined fs/Kconfig.binfmt index 32dff7ba3dda,fb325b3aa4b0..21e154516bf2 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@@ -58,7 -58,7 +58,7 @@@ config ARCH_USE_GNU_PROPERT config BINFMT_ELF_FDPIC bool "Kernel support for FDPIC ELF binaries" default y if !BINFMT_ELF - depends on (ARM || (SUPERH && !MMU)) + depends on ARM || ((M68K || SUPERH) && !MMU) select ELFCORE help ELF FDPIC binaries are based on ELF, but allow the individual load @@@ -142,6 -142,12 +142,6 @@@ config BINFMT_ZFLA help Support FLAT format compressed binaries -config BINFMT_SHARED_FLAT - bool "Enable shared FLAT support" - depends on BINFMT_FLAT - help - Support FLAT shared libraries - config HAVE_AOUT def_bool n