1. 28 May, 2021 3 commits
  2. 27 May, 2021 13 commits
  3. 25 May, 2021 5 commits
    • Tiezhu Yang's avatar
      MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER · 78cf0eb9
      Tiezhu Yang authored
      When update the latest mainline kernel with the following three configs,
      the kernel hangs during startup:
      When update the latest mainline kernel with the above two configs (1)
      and (2), the kernel starts normally, but it still hangs when execute
      the following command:
      echo "function_graph" > /sys/kernel/debug/tracing/current_tracer
      Without CONFIG_PREEMPT_TRACER=y, the above two kinds of kernel hangs
      disappeared, so it seems that CONFIG_PREEMPT_TRACER has some influences
      with function_graph tracer at the first glance.
      I use ejtag to find out the epc address is related with preempt_enable()
      in the file arch/mips/lib/mips-atomic.c, because function tracing can
      trace the preempt_{enable,disable} calls that are traced, replace them
      with preempt_{enable,disable}_notrace to prevent function tracing from
      going into an infinite loop, and then it can fix the kernel hang issue.
      By the way, it seems that this commit is a complement and improvement of
      commit f93a1a00
       ("MIPS: Fix crash that occurs when function tracing
      is enabled").
      Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
    • Randy Dunlap's avatar
      MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c · fef532ea
      Randy Dunlap authored
      rt2880_wdt.c uses (well, attempts to use) rt_sysc_membase. However,
      when this watchdog driver is built as a loadable module, there is a
      build error since the rt_sysc_membase symbol is not exported.
      Export it to quell the build error.
      ERROR: modpost: "rt_sysc_membase" [drivers/watchdog/rt2880_wdt.ko] undefined!
      Fixes: 473cf939
       ("watchdog: add ralink watchdog driver")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Wim Van Sebroeck <wim@iguana.be>
      Cc: John Crispin <john@phrozen.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-watchdog@vger.kernel.org
      Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
    • Randy Dunlap's avatar
      MIPS: launch.h: add include guard to prevent build errors · 6855adc2
      Randy Dunlap authored
      arch/mips/include/asm/mips-boards/launch.h needs an include guard
      to prevent it from being #included more than once.
      Prevents these build errors:
      In file included from ../arch/mips/mti-malta/malta-amon.c:16:
      ../arch/mips/include/asm/mips-boards/launch.h:8:8: error: redefinition of 'struct cpulaunch'
          8 | struct cpulaunch {
            |        ^~~~~~~~~
      In file included from ../arch/mips/include/asm/mips-cps.h:13,
                       from ../arch/mips/include/asm/smp-ops.h:16,
                       from ../arch/mips/include/asm/smp.h:21,
                       from ../include/linux/smp.h:114,
                       from ../arch/mips/mti-malta/malta-amon.c:12:
      ../arch/mips/include/asm/mips-boards/launch.h:8:8: note: originally defined here
          8 | struct cpulaunch {
            |        ^~~~~~~~~
      make[3]: [../scripts/Makefile.build:273: arch/mips/mti-malta/malta-amon.o] Error 1 (ignored)
      Fixes: 6decd1aa
       ("MIPS: add support for buggy MT7621S core detection")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: linux-mips@vger.kernel.org
      Cc: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
      Reviewed-by: default avatarIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
    • Randy Dunlap's avatar
      MIPS: alchemy: xxs1500: add gpio-au1000.h header file · ff4cff96
      Randy Dunlap authored
      board-xxs1500.c references 2 functions without declaring them, so add
      the header file to placate the build.
      ../arch/mips/alchemy/board-xxs1500.c: In function 'board_setup':
      ../arch/mips/alchemy/board-xxs1500.c:56:2: error: implicit declaration of function 'alchemy_gpio1_input_enable' [-Werror=implicit-function-declaration]
         56 |  alchemy_gpio1_input_enable();
      ../arch/mips/alchemy/board-xxs1500.c:57:2: error: implicit declaration of function 'alchemy_gpio2_enable'; did you mean 'alchemy_uart_enable'? [-Werror=implicit-function-declaration]
         57 |  alchemy_gpio2_enable();
      Fixes: 8e026910
       ("MIPS: Alchemy: merge GPR/MTX-1/XXS1500 board code into single files")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: linux-mips@vger.kernel.org
      Cc: Manuel Lauss <manuel.lauss@googlemail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Acked-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
    • Jisheng Zhang's avatar
      arm64: mm: don't use CON and BLK mapping if KFENCE is enabled · e6901240
      Jisheng Zhang authored and Catalin Marinas's avatar Catalin Marinas committed
      When we added KFENCE support for arm64, we intended that it would
      force the entire linear map to be mapped at page granularity, but we
      only enforced this in arch_add_memory() and not in map_mem(), so
      memory mapped at boot time can be mapped at a larger granularity.
      When booting a kernel with KFENCE=y and RODATA_FULL=n, this results in
      the following WARNING at boot:
      [    0.000000] ------------[ cut here ]------------
      [    0.000000] WARNING: CPU: 0 PID: 0 at mm/memory.c:2462 apply_to_pmd_range+0xec/0x190
      [    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc1+ #10
      [    0.000000] Hardware name: linux,dummy-virt (DT)
      [    0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--)
      [    0.000000] pc : apply_to_pmd_range+0xec/0x190
      [    0.000000] lr : __apply_to_page_range+0x94/0x170
      [    0.000000] sp : ffffffc010573e20
      [    0.000000] x29: ffffffc010573e20 x28: ffffff801f400000 x27: ffffff801f401000
      [    0.000000] x26: 0000000000000001 x25: ffffff801f400fff x24: ffffffc010573f28
      [    0.000000] x23: ffffffc01002b710 x22: ffffffc0105fa450 x21: ffffffc010573ee4
      [    0.000000] x20: ffffff801fffb7d0 x19: ffffff801f401000 x18: 00000000fffffffe
      [    0.000000] x17: 000000000000003f x16: 000000000000000a x15: ffffffc01060b940
      [    0.000000] x14: 0000000000000000 x13: 0098968000000000 x12: 0000000098968000
      [    0.000000] x11: 0000000000000000 x10: 0000000098968000 x9 : 0000000000000001
      [    0.000000] x8 : 0000000000000000 x7 : ffffffc010573ee4 x6 : 0000000000000001
      [    0.000000] x5 : ffffffc010573f28 x4 : ffffffc01002b710 x3 : 0000000040000000
      [    0.000000] x2 : ffffff801f5fffff x1 : 0000000000000001 x0 : 007800005f400705
      [    0.000000] Call trace:
      [    0.000000]  apply_to_pmd_range+0xec/0x190
      [    0.000000]  __apply_to_page_range+0x94/0x170
      [    0.000000]  apply_to_page_range+0x10/0x20
      [    0.000000]  __change_memory_common+0x50/0xdc
      [    0.000000]  set_memory_valid+0x30/0x40
      [    0.000000]  kfence_init_pool+0x9c/0x16c
      [    0.000000]  kfence_init+0x20/0x98
      [    0.000000]  start_kernel+0x284/0x3f8
      Fixes: 840b2398
       ("arm64, kfence: enable KFENCE for ARM64")
      Cc: <stable@vger.kernel.org> # 5.12.x
      Signed-off-by: default avatarJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Acked-by: Mark Rutland's avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarMarco Elver <elver@google.com>
      Tested-by: default avatarMarco Elver <elver@google.com>
      Link: https://lore.kernel.org/r/20210525104551.2ec37f77@xhacker.debian
      Signed-off-by: Catalin Marinas's avatarCatalin Marinas <catalin.marinas@arm.com>
  4. 24 May, 2021 3 commits
  5. 23 May, 2021 4 commits
    • Jisheng Zhang's avatar
      riscv: kexec: Fix W=1 build warnings · bab0d47c
      Jisheng Zhang authored
      Fixes the following W=1 build warning(s):
      In file included from include/linux/kexec.h:28,
                       from arch/riscv/kernel/machine_kexec.c:7:
      arch/riscv/include/asm/kexec.h:45:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration]
         45 | const extern unsigned char riscv_kexec_relocate[];
            | ^~~~~
      arch/riscv/include/asm/kexec.h:46:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration]
         46 | const extern unsigned int riscv_kexec_relocate_size;
            | ^~~~~
      arch/riscv/kernel/machine_kexec.c:125:6: warning: no previous prototype for ‘machine_shutdown’ [-Wmissing-prototypes]
        125 | void machine_shutdown(void)
            |      ^~~~~~~~~~~~~~~~
      arch/riscv/kernel/machine_kexec.c:147:1: warning: no previous prototype for ‘machine_crash_shutdown’ [-Wmissing-prototypes]
        147 | machine_crash_shutdown(struct pt_regs *regs)
            | ^~~~~~~~~~~~~~~~~~~~~~
      arch/riscv/kernel/machine_kexec.c:23: warning: Function parameter or member 'image' not described in 'kexec_image_info'
      arch/riscv/kernel/machine_kexec.c:53: warning: Function parameter or member 'image' not described in 'machine_kexec_prepare'
      arch/riscv/kernel/machine_kexec.c:114: warning: Function parameter or member 'image' not described in 'machine_kexec_cleanup'
      arch/riscv/kernel/machine_kexec.c:148: warning: Function parameter or member 'regs' not described in 'machine_crash_shutdown'
      arch/riscv/kernel/machine_kexec.c:167: warning: Function parameter or member 'image' not described in 'machine_kexec'
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    • Jisheng Zhang's avatar
      riscv: kprobes: Fix build error when MMU=n · 02ccdeed
      Jisheng Zhang authored
      lkp reported a randconfig failure:
      arch/riscv/kernel/probes/kprobes.c:90:22: error: use of undeclared identifier 'PAGE_KERNEL_READ_EXEC'
      We implemented the alloc_insn_page() to allocate PAGE_KERNEL_READ_EXEC
      page for kprobes insn page for STRICT_MODULE_RWX. But if MMU=n, we
      should fall back to the generic weak alloc_insn_page() by generic
      kprobe subsystem.
      Fixes: cdd1b2bd
       ("riscv: kprobes: Implement alloc_insn_page()")
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    • Kefeng Wang's avatar
      riscv: Select ARCH_USE_MEMTEST · 97a03108
      Kefeng Wang authored
      As of commit dce44566
       ("mm/memtest: add ARCH_USE_MEMTEST"),
      architectures must select ARCH_USE_MEMTESET to enable CONFIG_MEMTEST.
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Fixes: f6e5aedf
       ("riscv: Add support for memtest")
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    • Chen Huang's avatar
      riscv: stacktrace: fix the riscv stacktrace when CONFIG_FRAME_POINTER enabled · eac2f305
      Chen Huang authored
      As [1] and [2] said, the arch_stack_walk should not to trace itself, or it will
      leave the trace unexpectedly when called. The example is when we do "cat
      /sys/kernel/debug/page_owner", all pages' stack is the same.
      So we use __builtin_frame_address(1) as the first frame to be walked. And mark
      the arch_stack_walk() noinline.
      We found that pr_cont will affact pages' stack whose task state is RUNNING when
      testing "echo t > /proc/sysrq-trigger". So move the place of pr_cont and mark
      the function dump_backtrace() noinline.
      Also we move the case when task == NULL into else branch, and test for it in
      "echo c > /proc/sysrq-trigger".
      [1] https://lore.kernel.org/lkml/20210319184106.5688-1-mark.rutland@arm.com/
      [2] https://lore.kernel.org/lkml/20210317142050.57712-1-chenjun102@huawei.com/
      Signed-off-by: default avatarChen Huang <chenhuang5@huawei.com>
      Fixes: 5d8544e2
       ("RISC-V: Generic library routines and assembly")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
  6. 21 May, 2021 1 commit
  7. 20 May, 2021 3 commits
  8. 19 May, 2021 4 commits
  9. 18 May, 2021 4 commits