25 Aug, 2022

1 commit

  • commit 3c2bf173501652fced1d058834e9c983d295b126 upstream.

    When CAN_FLEXCAN=y and M5441x is not set/enabled, there are build
    errors in coldfire/device.c:

    ../arch/m68k/coldfire/device.c:595:26: error: 'MCFFLEXCAN_BASE0' undeclared here (not in a function); did you mean 'MCFDMA_BASE0'?
    595 | .start = MCFFLEXCAN_BASE0,
    ../arch/m68k/coldfire/device.c:596:43: error: 'MCFFLEXCAN_SIZE' undeclared here (not in a function)
    596 | .end = MCFFLEXCAN_BASE0 + MCFFLEXCAN_SIZE,
    ../arch/m68k/coldfire/device.c:600:26: error: 'MCF_IRQ_IFL0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'?
    600 | .start = MCF_IRQ_IFL0,
    ../arch/m68k/coldfire/device.c:605:26: error: 'MCF_IRQ_BOFF0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'?
    605 | .start = MCF_IRQ_BOFF0,
    ../arch/m68k/coldfire/device.c:610:26: error: 'MCF_IRQ_ERR0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'?
    610 | .start = MCF_IRQ_ERR0,

    Protect the FLEXCAN code blocks by checking if MCFFLEXCAN_SIZE
    is defined.

    Fixes: 35a9f9363a89 ("m68k: m5441x: add flexcan support")
    Signed-off-by: Randy Dunlap
    Cc: Greg Ungerer
    Cc: Geert Uytterhoeven
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: uclinux-dev@uclinux.org
    Cc: Angelo Dureghello
    Signed-off-by: Greg Ungerer
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

15 Jun, 2022

3 commits

  • [ Upstream commit 1300eec9e51f23c34c4487d2b06f58ca22e1ad3d ]

    Configuring for a nommu classic m68k target and enabling the generic rtc
    driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
    error:

    m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
    time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
    m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
    m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'

    There are no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
    nommu code paths. Move these definitions and the associated "mach_hwclk",
    so that they are around their use case in time.c. This means they will
    always be defined on the builds that require them, and not on those that
    cannot use them - such as ColdFire (both with and without MMU enabled).

    Reported-by: kernel test robot
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Geert Uytterhoeven
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Greg Ungerer
    Signed-off-by: Sasha Levin

    Greg Ungerer
     
  • [ Upstream commit a71b9e66fee47c59b3ec34e652b5c23bc6550794 ]

    When configuring a nommu classic m68k system enabling the uboot parameter
    passing support (CONFIG_UBOOT) will produce the following compile error:

    m68k-linux-ld: arch/m68k/kernel/uboot.o: in function `process_uboot_commandline':
    uboot.c:(.init.text+0x32): undefined reference to `_init_sp'

    The logic to support this option is only used on ColdFire based platforms
    (in its head.S startup code). So make the selection of this option
    depend on building for a ColdFire based platform.

    Reported-by: kernel test robot
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Greg Ungerer
    Signed-off-by: Sasha Levin

    Greg Ungerer
     
  • [ Upstream commit dc068f46217970d9516f16cd37972a01d50dc055 ]

    The non-MMU m68k pagetable ZERO_PAGE() macro is being set to the
    somewhat non-sensical value of "virt_to_page(0)". The zeroth page
    is not in any way guaranteed to be a page full of "0". So the result
    is that ZERO_PAGE() will almost certainly contain random values.

    We already allocate a real "empty_zero_page" in the mm setup code shared
    between MMU m68k and non-MMU m68k. It is just not hooked up to the
    ZERO_PAGE() macro for the non-MMU m68k case.

    Fix ZERO_PAGE() to use the allocated "empty_zero_page" pointer.

    I am not aware of any specific issues caused by the old code.

    Link: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#t
    Reported-by: Hugh Dickens
    Signed-off-by: Greg Ungerer
    Signed-off-by: Sasha Levin

    Greg Ungerer
     

09 Jun, 2022

3 commits

  • [ Upstream commit ed6bc6bf0a7d75e80eb1df883c09975ebb74e590 ]

    If CONFIG_M54xx=y, CONFIG_MMU=y, and CONFIG_M68KFPU_EMU=y:

    {standard input}:272: Error: invalid instruction for this architecture; needs 68000 or higher (68000 [68ec000, 68hc000, 68hc001, 68008, 68302, 68306, 68307, 68322, 68356], 68010, 68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349, 68360], fidoa [fido]) -- statement `sub.b %d1,%d3' ignored
    {standard input}:609: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `bfextu 4(%a1){%d0,#8},%d0' ignored
    {standard input}:752: Error: operands mismatch -- statement `mulu.l 4(%a0),%d3:%d0' ignored
    {standard input}:1155: Error: operands mismatch -- statement `divu.l %d0,%d3:%d7' ignored

    The math emulation support code is intended for 68020 and higher, and
    uses several instructions or instruction modes not available on coldfire
    or 68000.

    Originally, the dependency of M68KFPU_EMU on MMU was fine, as MMU
    support was only available on 68020 or higher. But this assumption
    was broken by the introduction of MMU support for M547x and M548x.

    Drop the dependency on MMU, as the code should work fine on 68020 and up
    without MMU (which are not yet supported by Linux, though).
    Add dependencies on M68KCLASSIC (to rule out Coldfire) and FPU (kernel
    has some type of floating-point support --- be it hardware or software
    emulated, to rule out anything below 68020).

    Fixes: 1f7034b9616e6f14 ("m68k: allow ColdFire 547x and 548x CPUs to be built with MMU enabled")
    Reported-by: kernel test robot
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Greg Ungerer
    Link: https://lore.kernel.org/r/18c34695b7c95107f60ccca82a4ff252f3edf477.1652446117.git.geert@linux-m68k.org
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     
  • [ Upstream commit 78ed93d72ded679e3caf0758357209887bda885f ]

    With SIGTRAP on perf events, we have encountered termination of
    processes due to user space attempting to block delivery of SIGTRAP.
    Consider this case:


    ...
    sigset_t s;
    sigemptyset(&s);
    sigaddset(&s, SIGTRAP | );
    sigprocmask(SIG_BLOCK, &s, ...);
    ...

    When the perf event triggers, while SIGTRAP is blocked, force_sig_perf()
    will force the signal, but revert back to the default handler, thus
    terminating the task.

    This makes sense for error conditions, but not so much for explicitly
    requested monitoring. However, the expectation is still that signals
    generated by perf events are synchronous, which will no longer be the
    case if the signal is blocked and delivered later.

    To give user space the ability to clearly distinguish synchronous from
    asynchronous signals, introduce siginfo_t::si_perf_flags and
    TRAP_PERF_FLAG_ASYNC (opted for flags in case more binary information is
    required in future).

    The resolution to the problem is then to (a) no longer force the signal
    (avoiding the terminations), but (b) tell user space via si_perf_flags
    if the signal was synchronous or not, so that such signals can be
    handled differently (e.g. let user space decide to ignore or consider
    the data imprecise).

    The alternative of making the kernel ignore SIGTRAP on perf events if
    the signal is blocked may work for some usecases, but likely causes
    issues in others that then have to revert back to interception of
    sigprocmask() (which we want to avoid). [ A concrete example: when using
    breakpoint perf events to track data-flow, in a region of code where
    signals are blocked, data-flow can no longer be tracked accurately.
    When a relevant asynchronous signal is received after unblocking the
    signal, the data-flow tracking logic needs to know its state is
    imprecise. ]

    Fixes: 97ba62b27867 ("perf: Add support for SIGTRAP on perf events")
    Reported-by: Dmitry Vyukov
    Signed-off-by: Marco Elver
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Geert Uytterhoeven
    Tested-by: Dmitry Vyukov
    Link: https://lore.kernel.org/r/20220404111204.935357-1-elver@google.com
    Signed-off-by: Sasha Levin

    Marco Elver
     
  • [ Upstream commit 30b5e6ef4a32ea4985b99200e06d6660a69f9246 ]

    The macros implementing Atari ROM port I/O writes do not cast away their
    output, unlike similar implementations for other I/O buses.
    When they are combined using conditional expressions in the definitions of
    outb() and friends, this triggers sparse warnings like:

    drivers/net/appletalk/cops.c:382:17: error: incompatible types in conditional expression (different base types):
    drivers/net/appletalk/cops.c:382:17: unsigned char
    drivers/net/appletalk/cops.c:382:17: void

    Fix this by adding casts to "void".

    Reported-by: kernel test robot
    Reported-by: Guenter Roeck
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Guenter Roeck
    Reviewed-by: Michael Schmitz
    Link: https://lore.kernel.org/r/c15bedc83d90a14fffcd5b1b6bfb32b8a80282c5.1653057096.git.geert@linux-m68k.org
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     

30 May, 2022

1 commit

  • commit 0f392c95391f2d708b12971a07edaa7973f9eece upstream.

    In the event that random_get_entropy() can't access a cycle counter or
    similar, falling back to returning 0 is really not the best we can do.
    Instead, at least calling random_get_entropy_fallback() would be
    preferable, because that always needs to return _something_, even
    falling back to jiffies eventually. It's not as though
    random_get_entropy_fallback() is super high precision or guaranteed to
    be entropic, but basically anything that's not zero all the time is
    better than returning zero all the time.

    Cc: Thomas Gleixner
    Cc: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Jason A. Donenfeld
    Signed-off-by: Greg Kroah-Hartman

    Jason A. Donenfeld
     

08 Apr, 2022

1 commit

  • [ Upstream commit e6e1e7b19fa132d23d09c465942aab4c110d3da9 ]

    When CONFIG_MCF_EDMA is set (due to COMPILE_TEST, not due to
    CONFIG_M5441x), coldfire/device.c has compile errors due to
    missing MCFEDMA_* symbols. In the .config file that was provided,
    CONFIG_M5206=y, not CONFIG_M5441x, so is not
    included in coldfire/device.c.

    Only build the MCF_EDMA code in coldfire/device.c if the MCFEDMA_*
    hardware macros are defined.

    Fixes these build errors:

    ../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'?
    512 | .start = MCFEDMA_BASE,
    ../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function)
    513 | .end = MCFEDMA_BASE + MCFEDMA_SIZE - 1,
    ../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function)
    517 | .start = MCFEDMA_IRQ_INTR0,
    ../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function)
    523 | .start = MCFEDMA_IRQ_INTR16,
    ../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function)
    529 | .start = MCFEDMA_IRQ_INTR56,
    ../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function)
    535 | .start = MCFEDMA_IRQ_ERR,

    Fixes: d7e9d01ac292 ("m68k: add ColdFire mcf5441x eDMA platform support")
    Signed-off-by: Randy Dunlap
    Reported-by: kernel test robot
    Link: lore.kernel.org/r/202203030252.P752DK46-lkp@intel.com
    Cc: Angelo Dureghello
    Cc: Greg Ungerer
    Cc: Greg Ungerer
    Cc: Geert Uytterhoeven
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: uclinux-dev@uclinux.org
    Signed-off-by: Greg Ungerer
    Signed-off-by: Sasha Levin

    Randy Dunlap
     

28 Mar, 2022

1 commit

  • commit 26509034bef198525d5936c116cbd0c3fa491c0b upstream.

    While most m68k platforms use separate address spaces for user
    and kernel space, at least coldfire does not, and the other
    ones have a TASK_SIZE that is less than the entire 4GB address
    range.

    Using the default implementation of __access_ok() stops coldfire
    user space from trivially accessing kernel memory.

    Reviewed-by: Christoph Hellwig
    Cc: stable@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

25 Nov, 2021

2 commits

  • commit fcb116bc43c8c37c052530ead79872f8b2615711 upstream.

    Recently to prevent issues with SECCOMP_RET_KILL and similar signals
    being changed before they are delivered SA_IMMUTABLE was added.

    Unfortunately this broke debuggers[1][2] which reasonably expect
    to be able to trap synchronous SIGTRAP and SIGSEGV even when
    the target process is not configured to handle those signals.

    Add force_exit_sig and use it instead of force_fatal_sig where
    historically the code has directly called do_exit. This has the
    implementation benefits of going through the signal exit path
    (including generating core dumps) without the danger of allowing
    userspace to ignore or change these signals.

    This avoids userspace regressions as older kernels exited with do_exit
    which debuggers also can not intercept.

    In the future is should be possible to improve the quality of
    implementation of the kernel by changing some of these force_exit_sig
    calls to force_fatal_sig. That can be done where it matters on
    a case-by-case basis with careful analysis.

    Reported-by: Kyle Huey
    Reported-by: kernel test robot
    [1] https://lkml.kernel.org/r/CAP045AoMY4xf8aC_4QU_-j7obuEPYgTcnQQP3Yxk=2X90jtpjw@mail.gmail.com
    [2] https://lkml.kernel.org/r/20211117150258.GB5403@xsang-OptiPlex-9020
    Fixes: 00b06da29cf9 ("signal: Add SA_IMMUTABLE to ensure forced siganls do not get changed")
    Fixes: a3616a3c0272 ("signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die")
    Fixes: 83a1f27ad773 ("signal/powerpc: On swapcontext failure force SIGSEGV")
    Fixes: 9bc508cf0791 ("signal/s390: Use force_sigsegv in default_trap_handler")
    Fixes: 086ec444f866 ("signal/sparc32: In setup_rt_frame and setup_fram use force_fatal_sig")
    Fixes: c317d306d550 ("signal/sparc32: Exit with a fatal signal when try_to_clear_window_buffer fails")
    Fixes: 695dd0d634df ("signal/x86: In emulate_vsyscall force a signal instead of calling do_exit")
    Fixes: 1fbd60df8a85 ("signal/vm86_32: Properly send SIGSEGV when the vm86 state cannot be saved.")
    Fixes: 941edc5bf174 ("exit/syscall_user_dispatch: Send ordinary signals on failure")
    Link: https://lkml.kernel.org/r/871r3dqfv8.fsf_-_@email.froward.int.ebiederm.org
    Reviewed-by: Kees Cook
    Tested-by: Kees Cook
    Tested-by: Kyle Huey
    Signed-off-by: "Eric W. Biederman"
    Cc: Thomas Backlund
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • commit e21294a7aaae32c5d7154b187113a04db5852e37 upstream.

    Now that force_fatal_sig exists it is unnecessary and a bit confusing
    to use force_sigsegv in cases where the simpler force_fatal_sig is
    wanted. So change every instance we can to make the code clearer.

    Acked-by: Geert Uytterhoeven
    Reviewed-by: Philippe Mathieu-Daudé
    Link: https://lkml.kernel.org/r/877de7jrev.fsf@disp2133
    Signed-off-by: "Eric W. Biederman"
    Cc: Thomas Backlund
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     

19 Nov, 2021

1 commit

  • [ Upstream commit 1aaa557b2db95c9506ed0981bc34505c32d6b62b ]

    'make randconfig' can produce a .config file with
    "CONFIG_MEMORY_RESERVE=" (no value) since it has no default.
    When a subsequent 'make all' is done, kconfig restarts the config
    and prompts for a value for MEMORY_RESERVE. This breaks
    scripting/automation where there is no interactive user input.

    Add a default value for MEMORY_RESERVE. (Any integer value will
    work here for kconfig.)

    Fixes a kconfig warning:

    .config:214:warning: symbol value '' invalid for MEMORY_RESERVE
    * Restart config...
    Memory reservation (MiB) (MEMORY_RESERVE) [] (NEW)

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") # from beginning of git history
    Signed-off-by: Randy Dunlap
    Reviewed-by: Geert Uytterhoeven
    Cc: Greg Ungerer
    Cc: linux-m68k@lists.linux-m68k.org
    Signed-off-by: Greg Ungerer
    Signed-off-by: Sasha Levin

    Randy Dunlap
     

24 Sep, 2021

9 commits

  • Add a m68k-only set_fc helper to set the SFC and DFC registers for the
    few places that need to override it for special MM operations, but
    disconnect that from the deprecated kernel-wide set_fs() API.

    Note that the SFC/DFC registers are context switched, so there is no need
    to disable preemption.

    Partially based on an earlier patch from
    Linus Torvalds .

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Michael Schmitz
    Tested-by: Michael Schmitz
    Link: https://lore.kernel.org/r/20210916070405.52750-7-hch@lst.de
    Signed-off-by: Geert Uytterhoeven

    Christoph Hellwig
     
  • Allow non-faulting access to kernel addresses without overriding the
    address space. Implemented by passing the instruction name to the
    low-level assembly macros as an argument, and force the use of the
    normal move instructions for kernel access.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Michael Schmitz
    Tested-by: Michael Schmitz
    Link: https://lore.kernel.org/r/20210916070405.52750-6-hch@lst.de
    Signed-off-by: Geert Uytterhoeven

    Christoph Hellwig
     
  • Add new helpers for doing the grunt work of the 8-byte {get,put}_user
    routines to allow for better reuse.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Michael Schmitz
    Tested-by: Michael Schmitz
    Link: https://lore.kernel.org/r/20210916070405.52750-5-hch@lst.de
    Signed-off-by: Geert Uytterhoeven

    Christoph Hellwig
     
  • Simplify the handling a bit by using the common helper instead of
    referencing undefined symbols.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Michael Schmitz
    Tested-by: Michael Schmitz
    Link: https://lore.kernel.org/r/20210916070405.52750-4-hch@lst.de
    Signed-off-by: Geert Uytterhoeven

    Christoph Hellwig
     
  • The 030 case in virt_to_phys_slow can't ever be reached, so remove it.

    Suggested-by: Michael Schmitz
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Michael Schmitz
    Tested-by: Michael Schmitz
    Link: https://lore.kernel.org/r/20210916070405.52750-3-hch@lst.de
    Signed-off-by: Geert Uytterhoeven

    Christoph Hellwig
     
  • Document that access_ok is completely broken for coldfire and friends at
    the moment.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Michael Schmitz
    Tested-by: Michael Schmitz
    Link: https://lore.kernel.org/r/20210916070405.52750-2-hch@lst.de
    Signed-off-by: Geert Uytterhoeven

    Christoph Hellwig
     
  • sigreturn has to deal with an unpleasant problem - exception stack frames
    have different sizes, depending upon the exception (and processor model, as
    well) and variable-sized part of exception frame may contain information
    needed for instruction restart. So when signal handler terminates and calls
    sigreturn to resume the execution at the place where we'd been when we caught
    the signal, it has to rearrange the frame at the bottom of kernel stack.
    Worse, it might need to open a gap in the kernel stack, shifting pt_regs
    towards lower addresses.

    Doing that from C is insane - we'd need to shift stack frames (return addresses,
    local variables, etc.) of C call chain, right under the nose of compiler and
    hope it won't fall apart horribly. What had been actually done is only slightly
    less insane - an inline asm in mangle_kernel_stack() moved the stuff around,
    then reset stack pointer and jumped to label in asm glue.

    However, we can avoid all that mess if the asm wrapper we have to use anyway
    would reserve some space on the stack between switch_stack and the C stack
    frame of do_{rt_,}sigreturn(). Then C part can simply memmove() pt_regs +
    switch_stack, memcpy() the variable part of exception frame into the opened
    gap - all of that without inline asm, buggering C call chain, magical jumps
    to asm labels, etc.

    Asm wrapper would need to know where the moved switch_stack has ended up -
    it might have been shifted into the gap we'd reserved before do_rt_sigreturn()
    call. That's where it needs to set the stack pointer to. So let the C part
    return just that and be done with that.

    While we are at it, the call of berr_040cleanup() we need to do when
    returning via 68040 bus error exception frame can be moved into C part
    as well.

    Signed-off-by: Al Viro
    Tested-by: Michael Schmitz
    Reviewed-by: Michael Schmitz
    Tested-by: Finn Thain
    Link: https://lore.kernel.org/r/YP2dTQPm1wGPWFgD@zeniv-ca.linux.org.uk
    Signed-off-by: Geert Uytterhoeven

    Al Viro
     
  • We get there when sigreturn has performed obscene acts on kernel stack;
    in particular, the location of pt_regs has shifted. We are about to call
    syscall_trace(), which might stop for tracer. If that happens, we'd better
    have task_pt_regs() returning correct result...

    Fucked-up-by: Al Viro
    Fixes: bd6f56a75bb2 ("m68k: Missing syscall_trace() on sigreturn")
    Signed-off-by: Al Viro
    Tested-by: Michael Schmitz
    Reviewed-by: Michael Schmitz
    Tested-by: Finn Thain
    Link: https://lore.kernel.org/r/YP2dMWeV1LkHiOpr@zeniv-ca.linux.org.uk
    Signed-off-by: Geert Uytterhoeven

    Al Viro
     
  • When we have several pending signals, have entered with the kernel
    with large exception frame *and* have already built at least one
    sigframe, regs->stkadj is going to be non-zero and regs->format/sr/pc
    are going to be junk - the real values are in shifted exception stack
    frame we'd built when putting together the first sigframe.

    If that happens, subsequent sigframes are going to be garbage.
    Not hard to fix - just need to find the "adjusted" frame first
    and look for format/vector/sr/pc in it.

    Signed-off-by: Al Viro
    Tested-by: Michael Schmitz
    Reviewed-by: Michael Schmitz
    Tested-by: Finn Thain
    Link: https://lore.kernel.org/r/YP2dBIAPTaVvHiZ6@zeniv-ca.linux.org.uk
    Signed-off-by: Geert Uytterhoeven

    Al Viro
     

13 Sep, 2021

2 commits

  • The warnings were introduced when converting the MVME147 and MVME16x
    RTC handling from gettod to hwclk. Replace the #warning by a comment,
    and return an error to inform the upper layer that writing to the RTC is
    not yet supported.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Guenter Roeck
    Link: https://lore.kernel.org/r/20210907124511.2723414-1-geert@linux-m68k.org

    Geert Uytterhoeven
     
  • m68k builds fail widely with errors such as

    arch/m68k/include/asm/raw_io.h:20:19: error:
    cast to pointer from integer of different size
    arch/m68k/include/asm/raw_io.h:30:32: error:
    cast to pointer from integer of different size [-Werror=int-to-p

    On m68k, io functions are defined as macros. The problem is seen if the
    macro parameter variable size differs from the size of a pointer. Cast
    the parameter of all io macros to unsigned long before casting it to
    a pointer to fix the problem.

    Signed-off-by: Guenter Roeck
    Link: https://lore.kernel.org/r/20210907060729.2391992-1-linux@roeck-us.net
    Signed-off-by: Geert Uytterhoeven

    Guenter Roeck
     

04 Sep, 2021

2 commits

  • Merge misc updates from Andrew Morton:
    "173 patches.

    Subsystems affected by this series: ia64, ocfs2, block, and mm (debug,
    pagecache, gup, swap, shmem, memcg, selftests, pagemap, mremap,
    bootmem, sparsemem, vmalloc, kasan, pagealloc, memory-failure,
    hugetlb, userfaultfd, vmscan, compaction, mempolicy, memblock,
    oom-kill, migration, ksm, percpu, vmstat, and madvise)"

    * emailed patches from Andrew Morton : (173 commits)
    mm/madvise: add MADV_WILLNEED to process_madvise()
    mm/vmstat: remove unneeded return value
    mm/vmstat: simplify the array size calculation
    mm/vmstat: correct some wrong comments
    mm/percpu,c: remove obsolete comments of pcpu_chunk_populated()
    selftests: vm: add COW time test for KSM pages
    selftests: vm: add KSM merging time test
    mm: KSM: fix data type
    selftests: vm: add KSM merging across nodes test
    selftests: vm: add KSM zero page merging test
    selftests: vm: add KSM unmerge test
    selftests: vm: add KSM merge test
    mm/migrate: correct kernel-doc notation
    mm: wire up syscall process_mrelease
    mm: introduce process_mrelease system call
    memblock: make memblock_find_in_range method private
    mm/mempolicy.c: use in_task() in mempolicy_slab_node()
    mm/mempolicy: unify the create() func for bind/interleave/prefer-many policies
    mm/mempolicy: advertise new MPOL_PREFERRED_MANY
    mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY
    ...

    Linus Torvalds
     
  • Split off from prev patch in the series that implements the syscall.

    Link: https://lkml.kernel.org/r/20210809185259.405936-2-surenb@google.com
    Signed-off-by: Suren Baghdasaryan
    Acked-by: Geert Uytterhoeven
    Cc: Andy Lutomirski
    Cc: Christian Brauner
    Cc: Christoph Hellwig
    Cc: David Hildenbrand
    Cc: David Rientjes
    Cc: Florian Weimer
    Cc: Jan Engelhardt
    Cc: Jann Horn
    Cc: Johannes Weiner
    Cc: Matthew Wilcox (Oracle)
    Cc: Michal Hocko
    Cc: Minchan Kim
    Cc: Oleg Nesterov
    Cc: Rik van Riel
    Cc: Roman Gushchin
    Cc: Shakeel Butt
    Cc: Tim Murray
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Suren Baghdasaryan
     

02 Sep, 2021

4 commits

  • Pull m68knommu updates from Greg Ungerer:
    "A collection of fixes:

    - flexcan platform support (for m5441x)

    - fix CONFIG_ROMKERNEL linking

    - fix compilation when CONFIG_ISA_DMA_API is set

    - fix local ColdFire clk_enable() for NULL clk"

    * tag 'm68knommu-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
    m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch
    m68k: coldfire: return success for clk_enable(NULL)
    m68k: m5441x: add flexcan support
    m68k: stmark2: update board setup
    m68k/nommu: prevent setting ROMKERNEL when ROM is not set

    Linus Torvalds
     
  • Pull asm-generic updates from Arnd Bergmann:
    "The main content for 5.15 is a series that cleans up the handling of
    strncpy_from_user() and strnlen_user(), removing a lot of slightly
    incorrect versions of these in favor of the lib/strn*.c helpers that
    implement these correctly and more efficiently.

    The only architectures that retain a private version now are mips,
    ia64, um and parisc. I had offered to convert those at all, but Thomas
    Bogendoerfer wanted to keep the mips version for the moment until he
    had a chance to do regression testing.

    The branch also contains two patches for bitops and for ffs()"

    * tag 'asm-generic-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    bitops/non-atomic: make @nr unsigned to avoid any DIV
    asm-generic: ffs: Drop bogus reference to ffz location
    asm-generic: reverse GENERIC_{STRNCPY_FROM,STRNLEN}_USER symbols
    asm-generic: remove extra strn{cpy_from,len}_user declarations
    asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user
    s390: use generic strncpy/strnlen from_user
    microblaze: use generic strncpy/strnlen from_user
    csky: use generic strncpy/strnlen from_user
    arc: use generic strncpy/strnlen from_user
    hexagon: use generic strncpy/strnlen from_user
    h8300: remove stale strncpy_from_user
    asm-generic/uaccess.h: remove __strncpy_from_user/__strnlen_user

    Linus Torvalds
     
  • …nel/git/ebiederm/user-namespace

    Pull exit cleanups from Eric Biederman:
    "In preparation of doing something about PTRACE_EVENT_EXIT I have
    started cleaning up various pieces of code related to do_exit. Most of
    that code I did not manage to get tested and reviewed before the merge
    window opened but a handful of very useful cleanups are ready to be
    merged.

    The first change is simply the removal of the bdflush system call. The
    code has now been disabled long enough that even the oldest userspace
    working userspace setups anyone can find to test are fine with the
    bdflush system call being removed.

    Changing m68k fsp040_die to use force_sigsegv(SIGSEGV) instead of
    calling do_exit directly is interesting only in that it is nearly the
    most difficult of the incorrect uses of do_exit to remove.

    The change to the seccomp code to simply send a signal instead of
    calling do_coredump directly is a very nice little cleanup made
    possible by realizing the existing signal sending helpers were missing
    a little bit of functionality that is easy to provide"

    * 'exit-cleanups-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    signal/seccomp: Dump core when there is only one live thread
    signal/seccomp: Refactor seccomp signal and coredump generation
    signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die
    exit/bdflush: Remove the deprecated bdflush system call

    Linus Torvalds
     
  • Pull tty / serial updates from Greg KH:
    "Here is the "big" set of tty/serial driver patches for 5.15-rc1

    Nothing major in here at all, just some driver updates and more
    cleanups on old tty apis and code that needed it that includes:

    - tty.h cleanup of things that didn't belong in it

    - other tty cleanups by Jiri

    - driver cleanups

    - rs485 support added to amba-pl011 driver

    - dts updates

    - stm32 serial driver updates

    - other minor fixes and driver updates

    All have been in linux-next for a while with no reported problems"

    * tag 'tty-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (83 commits)
    tty: serial: uartlite: Use read_poll_timeout for a polling loop
    tty: serial: uartlite: Use constants in early_uartlite_putc
    tty: Fix data race between tiocsti() and flush_to_ldisc()
    serial: vt8500: Use of_device_get_match_data
    serial: tegra: Use of_device_get_match_data
    serial: 8250_ingenic: Use of_device_get_match_data
    tty: serial: linflexuart: Remove redundant check to simplify the code
    tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp
    tty: serial: fsl_lpuart: enable two stop bits for lpuart32
    tty: serial: fsl_lpuart: fix the wrong mapbase value
    mxser: use semi-colons instead of commas
    tty: moxa: use semi-colons instead of commas
    tty: serial: fsl_lpuart: check dma_tx_in_progress in tx dma callback
    tty: replace in_irq() with in_hardirq()
    serial: sh-sci: fix break handling for sysrq
    serial: stm32: use devm_platform_get_and_ioremap_resource()
    serial: stm32: use the defined variable to simplify code
    Revert "arm pl011 serial: support multi-irq request"
    tty: serial: samsung: Add Exynos850 SoC data
    tty: serial: samsung: Fix driver data macros style
    ...

    Linus Torvalds
     

31 Aug, 2021

2 commits

  • Pull block updates from Jens Axboe:
    "Nothing major in here - lots of good cleanups and tech debt handling,
    which is also evident in the diffstats. In particular:

    - Add disk sequence numbers (Matteo)

    - Discard merge fix (Ming)

    - Relax disk zoned reporting restrictions (Niklas)

    - Bio error handling zoned leak fix (Pavel)

    - Start of proper add_disk() error handling (Luis, Christoph)

    - blk crypto fix (Eric)

    - Non-standard GPT location support (Dmitry)

    - IO priority improvements and cleanups (Damien)o

    - blk-throtl improvements (Chunguang)

    - diskstats_show() stack reduction (Abd-Alrhman)

    - Loop scheduler selection (Bart)

    - Switch block layer to use kmap_local_page() (Christoph)

    - Remove obsolete disk_name helper (Christoph)

    - block_device refcounting improvements (Christoph)

    - Ensure gendisk always has a request queue reference (Christoph)

    - Misc fixes/cleanups (Shaokun, Oliver, Guoqing)"

    * tag 'for-5.15/block-2021-08-30' of git://git.kernel.dk/linux-block: (129 commits)
    sg: pass the device name to blk_trace_setup
    block, bfq: cleanup the repeated declaration
    blk-crypto: fix check for too-large dun_bytes
    blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN
    blk-zoned: allow zone management send operations without CAP_SYS_ADMIN
    block: mark blkdev_fsync static
    block: refine the disk_live check in del_gendisk
    mmc: sdhci-tegra: Enable MMC_CAP2_ALT_GPT_TEGRA
    mmc: block: Support alternative_gpt_sector() operation
    partitions/efi: Support non-standard GPT location
    block: Add alternative_gpt_sector() operation
    bio: fix page leak bio_add_hw_page failure
    block: remove CONFIG_DEBUG_BLOCK_EXT_DEVT
    block: remove a pointless call to MINOR() in device_add_disk
    null_blk: add error handling support for add_disk()
    virtio_blk: add error handling support for add_disk()
    block: add error handling for device_add_disk / add_disk
    block: return errors from disk_alloc_events
    block: return errors from blk_integrity_add
    block: call blk_register_queue earlier in device_add_disk
    ...

    Linus Torvalds
     
  • Pull m68k updates from Geert Uytterhoeven:

    - miscellaneous fixes

    - defconfig updates

    * tag 'm68k-for-v5.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
    m68k: Fix asm register constraints for atomic ops
    m68k: Fix invalid RMW_INSNS on CPUs that lack CAS
    m68k: defconfig: Update defconfigs for v5.14-rc1
    m68k: emu: Fix invalid free in nfeth_cleanup()

    Linus Torvalds
     

26 Aug, 2021

1 commit

  • In the fpsp040 code when copyin or copyout fails call
    force_sigsegv(SIGSEGV) instead of do_exit(SIGSEGV).

    This solves a couple of problems. Because do_exit embeds the ptrace
    stop PTRACE_EVENT_EXIT a complete stack frame needs to be present for
    that to work correctly. There is always the information needed for a
    ptrace stop where get_signal is called. So exiting with a signal
    solves the ptrace issue.

    Further exiting with a signal ensures that all of the threads in a
    process are killed not just the thread that malfunctioned. Which
    avoids confusing userspace.

    To make force_sigsegv(SIGSEGV) work in fpsp040_die modify the code to
    save all of the registers and jump to ret_from_exception (which
    ultimately calls get_signal) after fpsp040_die returns.

    v2: Updated the branches to use gas's pseudo ops that automatically
    calculate the best branch instruction to use for the purpose.

    v1: https://lkml.kernel.org/r/87a6m8kgtx.fsf_-_@disp2133
    Link: https://lkml.kernel.org/r/87tukghjfs.fsf_-_@disp2133
    Acked-by: Geert Uytterhoeven
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

23 Aug, 2021

6 commits

  • Depending on register assignment by the compiler:

    {standard input}:3084: Error: operands mismatch -- statement `andl %a1,%d1' ignored
    {standard input}:3145: Error: operands mismatch -- statement `orl %a1,%d1' ignored
    {standard input}:3195: Error: operands mismatch -- statement `eorl %a1,%d1' ignored

    Indeed, the first operand must not be an address register. However, it
    can be an immediate value. Fix this by adjusting the register
    constraint from "g" (general purpose register) to "di" (data register or
    immediate).

    Fixes: e39d88ea3ce4a471 ("locking/atomic, arch/m68k: Implement atomic_fetch_{add,sub,and,or,xor}()")
    Fixes: d839bae4269aea46 ("locking,arch,m68k: Fold atomic_ops")
    Fixes: 1da177e4c3f41524 ("Linux-2.6.12-rc2")
    Reported-by: kernel test robot
    Reported-by: Arnd Bergmann
    Reported-by: Alexander Viro
    Signed-off-by: Geert Uytterhoeven
    Tested-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20210809112903.3898660-1-geert@linux-m68k.org

    Geert Uytterhoeven
     
  • > Hi Arnd,
    >
    > First bad commit (maybe != root cause):
    >
    > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
    > head: 2f73937c9aa561e2082839bc1a8efaac75d6e244
    > commit: 47fd22f2b84765a2f7e3f150282497b902624547 [4771/5318] cs89x0: rework driver configuration
    > config: m68k-randconfig-c003-20210804 (attached as .config)
    > compiler: m68k-linux-gcc (GCC) 10.3.0
    > reproduce (this is a W=1 build):
    > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
    > chmod +x ~/bin/make.cross
    > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=47fd22f2b84765a2f7e3f150282497b902624547
    > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
    > git fetch --no-tags linux-next master
    > git checkout 47fd22f2b84765a2f7e3f150282497b902624547
    > # save the attached .config to linux build tree
    > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=m68k
    >
    > If you fix the issue, kindly add following tag as appropriate
    > Reported-by: kernel test robot
    >
    > All errors (new ones prefixed by >>):
    >
    > In file included from include/linux/kernel.h:19,
    > from include/linux/list.h:9,
    > from include/linux/module.h:12,
    > from drivers/net/ethernet/cirrus/cs89x0.c:51:
    > drivers/net/ethernet/cirrus/cs89x0.c: In function 'net_open':
    > drivers/net/ethernet/cirrus/cs89x0.c:897:20: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration]
    > 897 | (unsigned long)isa_virt_to_bus(lp->dma_buff));
    > | ^~~~~~~~~~~~~~~
    > include/linux/printk.h:141:17: note: in definition of macro 'no_printk'
    > 141 | printk(fmt, ##__VA_ARGS__); \
    > | ^~~~~~~~~~~
    > drivers/net/ethernet/cirrus/cs89x0.c:86:3: note: in expansion of macro 'pr_debug'
    > 86 | pr_##level(fmt, ##__VA_ARGS__); \
    > | ^~~
    > drivers/net/ethernet/cirrus/cs89x0.c:894:3: note: in expansion of macro 'cs89_dbg'
    > 894 | cs89_dbg(1, debug, "%s: dma %lx %lx\n",
    > | ^~~~~~~~
    > >> drivers/net/ethernet/cirrus/cs89x0.c:914:3: error: implicit declaration of function 'disable_dma'; did you mean 'disable_irq'? [-Werror=implicit-function-declaration]

    As far as I can tell, this is a bug with the m68kmmu architecture, not
    with my driver:
    The CONFIG_ISA_DMA_API option is provided for coldfire, which implements it,
    but dragonball also sets the option as a side-effect, without actually
    implementing
    the interfaces. The patch below should fix it.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Ungerer

    Arnd Bergmann
     
  • The clk_enable is supposed work when CONFIG_HAVE_CLK is false, but it
    returns -EINVAL. That means some drivers fail during probe.

    [ 1.680000] flexcan: probe of flexcan.0 failed with error -22

    Fixes: c1fb1bf64bb6 ("m68k: let clk_enable() return immediately if clk is NULL")
    Fixes: bea8bcb12da0 ("m68knommu: Add support for the Coldfire m5441x.")
    Signed-off-by: Dan Carpenter
    Acked-by: Marc Kleine-Budde
    Signed-off-by: Greg Ungerer

    Dan Carpenter
     
  • Add flexcan support.

    Signed-off-by: Angelo Dureghello

    Made the flexcan resource inclusion conditional based on the enablement
    of the flexcan driver. This commit is no longer dependant on the
    presence of the updated driver in mainline.

    Signed-off-by: Greg Ungerer

    Angelo Dureghello
     
  • Add configuration for flexcan pads.

    Signed-off-by: Angelo Dureghello
    Signed-off-by: Greg Ungerer

    Angelo Dureghello
     
  • When CONFIG_ROMKERNEL is set but CONFIG_ROM is not set, the linker
    complains:
    m68k-linux-ld:./arch/m68k/kernel/vmlinux.lds:5: undefined symbol `CONFIG_ROMSTART' referenced in expression

    # CONFIG_ROM is not set
    # CONFIG_RAMKERNEL is not set
    CONFIG_ROMKERNEL=y

    Since ROMSTART depends on ROM, make ROMKERNEL also depend on ROM.

    Signed-off-by: Randy Dunlap
    Cc: Greg Ungerer
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: uclinux-dev@uclinux.org
    Signed-off-by: Greg Ungerer

    Randy Dunlap
     

09 Aug, 2021

1 commit

  • When enabling CONFIG_RMW_INSNS in e.g. a Coldfire build:

    {standard input}:3068: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d4,%d0,(%a6)' ignored

    Fix this by (a) adding a new config symbol to track if support for any
    CPU that lacks the CAS instruction is enabled, and (b) making
    CONFIG_RMW_INSNS depend on the new symbol not being set.

    Fixes: 0e152d80507b75c0 ("m68k: reorganize Kconfig options to improve mmu/non-mmu selections")
    Reported-by: kernel test robot
    Reported-by: Arnd Bergmann
    Signed-off-by: Geert Uytterhoeven
    Acked-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20210725104413.318932-1-geert@linux-m68k.org

    Geert Uytterhoeven