15 Nov, 2020

3 commits

  • Steps on the way to 5.10-rc4

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: Id86ac2ef339902d7ea3689767ef52744c6fa0d9e

    Greg Kroah-Hartman
     
  • Limit the CPU number to num_possible_cpus(), because setting it to a
    value lower than INT_MAX but higher than NR_CPUS produces the following
    error on reboot and shutdown:

    BUG: unable to handle page fault for address: ffffffff90ab1bb0
    #PF: supervisor read access in kernel mode
    #PF: error_code(0x0000) - not-present page
    PGD 1c09067 P4D 1c09067 PUD 1c0a063 PMD 0
    Oops: 0000 [#1] SMP
    CPU: 1 PID: 1 Comm: systemd-shutdow Not tainted 5.9.0-rc8-kvm #110
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
    RIP: 0010:migrate_to_reboot_cpu+0xe/0x60
    Code: ea ea 00 48 89 fa 48 c7 c7 30 57 f1 81 e9 fa ef ff ff 66 2e 0f 1f 84 00 00 00 00 00 53 8b 1d d5 ea ea 00 e8 14 33 fe ff 89 da 0f a3 15 ea fc bd 00 48 89 d0 73 29 89 c2 c1 e8 06 65 48 8b 3c
    RSP: 0018:ffffc90000013e08 EFLAGS: 00010246
    RAX: ffff88801f0a0000 RBX: 0000000077359400 RCX: 0000000000000000
    RDX: 0000000077359400 RSI: 0000000000000002 RDI: ffffffff81c199e0
    RBP: ffffffff81c1e3c0 R08: ffff88801f41f000 R09: ffffffff81c1e348
    R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
    R13: 00007f32bedf8830 R14: 00000000fee1dead R15: 0000000000000000
    FS: 00007f32bedf8980(0000) GS:ffff88801f480000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: ffffffff90ab1bb0 CR3: 000000001d057000 CR4: 00000000000006a0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    __do_sys_reboot.cold+0x34/0x5b
    do_syscall_64+0x2d/0x40

    Fixes: 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic kernel")
    Signed-off-by: Matteo Croce
    Signed-off-by: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Fabian Frederick
    Cc: Greg Kroah-Hartman
    Cc: Guenter Roeck
    Cc: Kees Cook
    Cc: Mike Rapoport
    Cc: Pavel Tatashin
    Cc: Petr Mladek
    Cc: Robin Holt
    Cc:
    Link: https://lkml.kernel.org/r/20201103214025.116799-3-mcroce@linux.microsoft.com
    Signed-off-by: Linus Torvalds

    Matteo Croce
     
  • Patch series "fix parsing of reboot= cmdline", v3.

    The parsing of the reboot= cmdline has two major errors:

    - a missing bound check can crash the system on reboot

    - parsing of the cpu number only works if specified last

    Fix both.

    This patch (of 2):

    This reverts commit 616feab753972b97.

    kstrtoint() and simple_strtoul() have a subtle difference which makes
    them non interchangeable: if a non digit character is found amid the
    parsing, the former will return an error, while the latter will just
    stop parsing, e.g. simple_strtoul("123xyx") = 123.

    The kernel cmdline reboot= argument allows to specify the CPU used for
    rebooting, with the syntax `s####` among the other flags, e.g.
    "reboot=warm,s31,force", so if this flag is not the last given, it's
    silently ignored as well as the subsequent ones.

    Fixes: 616feab75397 ("kernel/reboot.c: convert simple_strtoul to kstrtoint")
    Signed-off-by: Matteo Croce
    Signed-off-by: Andrew Morton
    Cc: Guenter Roeck
    Cc: Petr Mladek
    Cc: Arnd Bergmann
    Cc: Mike Rapoport
    Cc: Kees Cook
    Cc: Pavel Tatashin
    Cc: Robin Holt
    Cc: Fabian Frederick
    Cc: Greg Kroah-Hartman
    Cc:
    Link: https://lkml.kernel.org/r/20201103214025.116799-2-mcroce@linux.microsoft.com
    Signed-off-by: Linus Torvalds

    Matteo Croce
     

07 Aug, 2020

1 commit


01 Jul, 2020

1 commit

  • The unicore32 port do not seem maintained for a long time now, there is no
    upstream toolchain that can create unicore32 binaries and all the links to
    prebuilt toolchains for unicore32 are dead. Even compilers that were
    available are not supported by the kernel anymore.

    Guenter Roeck says:

    I have stopped building unicore32 images since v4.19 since there is no
    available compiler that is still supported by the kernel. I am surprised
    that support for it has not been removed from the kernel.

    Remove unicore32 port.

    Signed-off-by: Mike Rapoport
    Acked-by: Arnd Bergmann
    Acked-by: Guenter Roeck

    Mike Rapoport
     

05 Jun, 2020

1 commit


31 May, 2020

1 commit

  • To turn the KMSG_DUMP_* reasons into a more ordered list, collapse
    the redundant KMSG_DUMP_(RESTART|HALT|POWEROFF) reasons into
    KMSG_DUMP_SHUTDOWN. The current users already don't meaningfully
    distinguish between them, so there's no need to, as discussed here:
    https://lore.kernel.org/lkml/CA+CK2bAPv5u1ih5y9t5FUnTyximtFCtDYXJCpuyjOyHNOkRdqw@mail.gmail.com/

    Link: https://lore.kernel.org/lkml/20200515184434.8470-2-keescook@chromium.org/
    Reviewed-by: Pavel Tatashin
    Reviewed-by: Petr Mladek
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Kees Cook

    Kees Cook
     

26 Nov, 2019

1 commit

  • Export reboot_mode to support kernel modules wishing to modify reboot_mode.

    Change-Id: I8d25aec75331a57fab85c12b8527a329e2a4f19d
    Bug: 143964928
    Link: https://lore.kernel.org/patchwork/patch/1151092/
    Signed-off-by: Elliot Berman
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Greg Kroah-Hartman

    Elliot Berman
     

21 May, 2019

1 commit

  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

15 May, 2019

1 commit

  • Allow specifying reboot_mode for panic only. This is needed on systems
    where ramoops is used to store panic logs, and user wants to use warm
    reset to preserve those, while still having cold reset on normal
    reboots.

    Link: http://lkml.kernel.org/r/20190322004735.27702-1-aaro.koskinen@iki.fi
    Signed-off-by: Aaro Koskinen
    Reviewed-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aaro Koskinen
     

11 Sep, 2018

1 commit


06 Aug, 2018

1 commit

  • At present, "systemctl suspend" and "shutdown" can run in parrallel. A
    system can suspend after devices_shutdown(), and resume. Then the shutdown
    task goes on to power off. This causes many devices are not really shut
    off. Hence replacing reboot_mutex with system_transition_mutex (renamed
    from pm_mutex) to achieve the exclusion. The renaming of pm_mutex as
    system_transition_mutex can be better to reflect the purpose of the mutex.

    Signed-off-by: Pingfan Liu
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Pingfan Liu
     

18 Nov, 2017

1 commit

  • Add devm_* wrapper around register_reboot_notifier to simplify device
    specific reboot notifier registration/unregistration.

    [akpm@linux-foundation.org: move `struct device' forward decl to top-of-file]
    Link: http://lkml.kernel.org/r/20170320171753.1705-1-andrew.smirnov@gmail.com
    Signed-off-by: Andrey Smirnov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Smirnov
     

11 Sep, 2015

1 commit

  • There are two kexec load syscalls, kexec_load another and kexec_file_load.
    kexec_file_load has been splited as kernel/kexec_file.c. In this patch I
    split kexec_load syscall code to kernel/kexec.c.

    And add a new kconfig option KEXEC_CORE, so we can disable kexec_load and
    use kexec_file_load only, or vice verse.

    The original requirement is from Ted Ts'o, he want kexec kernel signature
    being checked with CONFIG_KEXEC_VERIFY_SIG enabled. But kexec-tools use
    kexec_load syscall can bypass the checking.

    Vivek Goyal proposed to create a common kconfig option so user can compile
    in only one syscall for loading kexec kernel. KEXEC/KEXEC_FILE selects
    KEXEC_CORE so that old config files still work.

    Because there's general code need CONFIG_KEXEC_CORE, so I updated all the
    architecture Kconfig with a new option KEXEC_CORE, and let KEXEC selects
    KEXEC_CORE in arch Kconfig. Also updated general kernel code with to
    kexec_load syscall.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Dave Young
    Cc: Eric W. Biederman
    Cc: Vivek Goyal
    Cc: Petr Tesarik
    Cc: Theodore Ts'o
    Cc: Josh Boyer
    Cc: David Howells
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     

16 Apr, 2015

1 commit

  • The kernel has orderly_poweroff which allows the kernel to initiate a
    graceful shutdown of userspace, by running /sbin/poweroff. This adds
    orderly_reboot that will cause userspace to shut itself down by calling
    /sbin/reboot.

    This will be used for shutdown initiated by a system controller on
    platforms that do not use ACPI.

    orderly_reboot() should be used when the system wants to allow userspace
    to gracefully shut itself down. For cases where the system may imminently
    catch on fire, the existing emergency_restart() provides an immediate
    reboot without involving userspace.

    Signed-off-by: Joel Stanley
    Cc: Fabian Frederick
    Cc: Benjamin Herrenschmidt
    Cc: Michael Ellerman
    Cc: Rusty Russell
    Cc: Jeremy Kerr
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joel Stanley
     

26 Sep, 2014

1 commit

  • Various drivers implement architecture and/or device specific means to
    restart (reset) the system. Various mechanisms have been implemented to
    support those schemes. The best known mechanism is arm_pm_restart, which
    is a function pointer to be set either from platform specific code or from
    drivers. Another mechanism is to use hardware watchdogs to issue a reset;
    this mechanism is used if there is no other method available to reset a
    board or system. Two examples are alim7101_wdt, which currently uses the
    reboot notifier to trigger a reset, and moxart_wdt, which registers the
    arm_pm_restart function.

    The existing mechanisms have a number of drawbacks. Typically only one
    scheme to restart the system is supported (at least if arm_pm_restart is
    used). At least in theory there can be multiple means to restart the
    system, some of which may be less desirable (for example one mechanism may
    only reset the CPU, while another may reset the entire system). Using
    arm_pm_restart can also be racy if the function pointer is set from a
    driver, as the driver may be in the process of being unloaded when
    arm_pm_restart is called. Using the reboot notifier is always racy, as it
    is unknown if and when other functions using the reboot notifier have
    completed execution by the time the watchdog fires.

    Introduce a system restart handler call chain to solve the described
    problems. This call chain is expected to be executed from the
    architecture specific machine_restart() function. Drivers providing
    system restart functionality (such as the watchdog drivers mentioned
    above) are expected to register with this call chain. By using the
    priority field in the notifier block, callers can control restart handler
    execution sequence and thus ensure that the restart handler with the
    optimal restart capabilities for a given system is called first.

    Signed-off-by: Guenter Roeck
    Acked-by: Catalin Marinas
    Acked-by: Heiko Stuebner
    Cc: Russell King
    Cc: Wim Van Sebroeck
    Cc: Maxime Ripard
    Cc: Will Deacon
    Cc: Arnd Bergmann
    Cc: Jonas Jensen
    Cc: Randy Dunlap
    Cc: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Dmitry Eremin-Solenikov
    Cc: David Woodhouse
    Cc: Tomasz Figa
    Signed-off-by: Andrew Morton

    Guenter Roeck
     

05 Jun, 2014

1 commit


19 Dec, 2013

1 commit

  • Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic
    kernel") moved reboot= handling to generic code. In the process it also
    removed the code in native_machine_shutdown() which are moving reboot
    process to reboot_cpu/cpu0.

    I guess that thought must have been that all reboot paths are calling
    migrate_to_reboot_cpu(), so we don't need this special handling. But
    kexec reboot path (kernel_kexec()) is not calling
    migrate_to_reboot_cpu() so above change broke kexec. Now reboot can
    happen on non-boot cpu and when INIT is sent in second kerneo to bring
    up BP, it brings down the machine.

    So start calling migrate_to_reboot_cpu() in kexec reboot path to avoid
    this problem.

    Bisected by WANG Chao.

    Reported-by: Matthew Whitehead
    Reported-by: Dave Young
    Signed-off-by: Vivek Goyal
    Tested-by: Baoquan He
    Tested-by: WANG Chao
    Acked-by: H. Peter Anvin
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     

25 Sep, 2013

1 commit

  • Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic
    kernel") did some cleanup for reboot= command line, but it made the
    reboot_default inoperative.

    The default value of variable reboot_default should be 1, and if command
    line reboot= is not set, system will use the default reboot mode.

    [akpm@linux-foundation.org: fix comment layout]
    Signed-off-by: Li Fei
    Signed-off-by: liu chuansheng
    Acked-by: Robin Holt
    Cc: [3.11.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chuansheng Liu
     

10 Jul, 2013

3 commits