1. 17 9月, 2022 1 次提交
  2. 13 9月, 2022 1 次提交
  3. 31 8月, 2022 1 次提交
  4. 24 8月, 2022 4 次提交
    • C
      riscv: dts: microchip: mpfs: remove pci axi address translation property · e4009c5f
      Conor Dooley 提交于
      An AXI master address translation table property was inadvertently
      added to the device tree & this was not caught by dtbs_check at the
      time. Remove the property - it should not be in mpfs.dtsi anyway as
      it would be more suitable in -fabric.dtsi nor does it actually apply
      to the version of the reference design we are using for upstream.
      
      Link: https://www.microsemi.com/document-portal/doc_download/1245812-polarfire-fpga-and-polarfire-soc-fpga-pci-express-user-guide # Section 1.3.3
      Fixes: 528a5b1f ("riscv: dts: microchip: add new peripherals to icicle kit device tree")
      Signed-off-by: NConor Dooley <conor.dooley@microchip.com>
      e4009c5f
    • C
      riscv: dts: microchip: mpfs: remove bogus card-detect-delay · 2b55915d
      Conor Dooley 提交于
      Recent versions of dt-schema warn about a previously undetected
      undocumented property:
      arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: mmc@20008000: Unevaluated properties are not allowed ('card-detect-delay' was unexpected)
              From schema: Documentation/devicetree/bindings/mmc/cdns,sdhci.yaml
      
      There are no GPIOs connected to MSSIO6B4 pin K3 so adding the common
      cd-debounce-delay-ms property makes no sense. The Cadence IP has a
      register that sets the card detect delay as "DP * tclk". On MPFS, this
      clock frequency is not configurable (it must be 200 MHz) & the FPGA
      comes out of reset with this register already set.
      
      Fixes: bc47b221 ("riscv: dts: microchip: add the sundance polarberry")
      Fixes: 0fa6107e ("RISC-V: Initial DTS for Microchip ICICLE board")
      Signed-off-by: NConor Dooley <conor.dooley@microchip.com>
      2b55915d
    • C
      riscv: dts: microchip: mpfs: remove ti,fifo-depth property · 72a05748
      Conor Dooley 提交于
      Recent versions of dt-schema warn about a previously undetected
      undocument property on the icicle & polarberry devicetrees:
      
      arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: ethernet@20112000: ethernet-phy@8: Unevaluated properties are not allowed ('ti,fifo-depth' was unexpected)
              From schema: Documentation/devicetree/bindings/net/cdns,macb.yaml
      
      I know what you're thinking, the binding doesn't look to be the problem
      and I agree. I am not sure why a TI vendor property was ever actually
      added since it has no meaning... just get rid of it.
      
      Fixes: bc47b221 ("riscv: dts: microchip: add the sundance polarberry")
      Fixes: 0fa6107e ("RISC-V: Initial DTS for Microchip ICICLE board")
      Signed-off-by: NConor Dooley <conor.dooley@microchip.com>
      72a05748
    • C
      riscv: dts: microchip: mpfs: fix incorrect pcie child node name · 3f67e699
      Conor Dooley 提交于
      Recent versions of dt-schema complain about the PCIe controller's child
      node name:
      arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dtb: pcie@2000000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'legacy-interrupt-controller', 'microchip,axi-m-atr0' were unexpected)
                  From schema: Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml
      Make the dts match the correct property name in the dts.
      
      Fixes: 528a5b1f ("riscv: dts: microchip: add new peripherals to icicle kit device tree")
      Signed-off-by: NConor Dooley <conor.dooley@microchip.com>
      3f67e699
  5. 19 8月, 2022 2 次提交
  6. 18 8月, 2022 1 次提交
    • H
      riscv: dts: microchip: correct L2 cache interrupts · 34fc9cc3
      Heinrich Schuchardt 提交于
      The "PolarFire SoC MSS Technical Reference Manual" documents the
      following PLIC interrupts:
      
      1 - L2 Cache Controller Signals when a metadata correction event occurs
      2 - L2 Cache Controller Signals when an uncorrectable metadata event occurs
      3 - L2 Cache Controller Signals when a data correction event occurs
      4 - L2 Cache Controller Signals when an uncorrectable data event occurs
      
      This differs from the SiFive FU540 which only has three L2 cache related
      interrupts.
      
      The sequence in the device tree is defined by an enum:
      
          enum {
                  DIR_CORR = 0,
                  DATA_CORR,
                  DATA_UNCORR,
                  DIR_UNCORR,
          };
      
      So the correct sequence of the L2 cache interrupts is
      
          interrupts = <1>, <3>, <4>, <2>;
      
      [Conor]
      This manifests as an unusable system if the l2-cache driver is enabled,
      as the wrong interrupt gets cleared & the handler prints errors to the
      console ad infinitum.
      
      Fixes: 0fa6107e ("RISC-V: Initial DTS for Microchip ICICLE board")
      CC: stable@vger.kernel.org # 5.15: e35b07a7: riscv: dts: microchip: mpfs: Group tuples in interrupt properties
      Signed-off-by: NHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      Signed-off-by: NConor Dooley <conor.dooley@microchip.com>
      34fc9cc3
  7. 17 8月, 2022 1 次提交
  8. 12 8月, 2022 13 次提交
  9. 11 8月, 2022 7 次提交
    • X
      RISC-V: Add modules to virtual kernel memory layout dump · f9293ad4
      Xianting Tian 提交于
      Modules always live before the kernel, MODULES_END is fixed but
      MODULES_VADDR isn't fixed, it depends on the kernel size.
      Let's add it to virtual kernel memory layout dump.
      
      As MODULES is only defined for CONFIG_64BIT, so we dump it when
      CONFIG_64BIT=y.
      
      eg,
      MODULES_VADDR - MODULES_END
      0xffffffff01133000 - 0xffffffff80000000
      Reviewed-by: NGuo Ren <guoren@kernel.org>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NXianting Tian <xianting.tian@linux.alibaba.com>
      Link: https://lore.kernel.org/r/20220811074150.3020189-5-xianting.tian@linux.alibaba.com
      Cc: stable@vger.kernel.org
      Fixes: 2bfc6cd8 ("riscv: Move kernel mapping outside of linear mapping")
      Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
      f9293ad4
    • K
    • X
      RISC-V: Fixup schedule out issue in machine_crash_shutdown() · ad943893
      Xianting Tian 提交于
      Current task of executing crash kexec will be schedule out when panic is
      triggered by RCU Stall, as it needs to wait rcu completion. It lead to
      inability to enter the crash system.
      
      The implementation of machine_crash_shutdown() is non-standard for RISC-V
      according to other Arch's implementation(eg, x86, arm64), we need to send
      IPI to stop secondary harts.
      
      [224521.877268] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
      [224521.883471] rcu: 	0-...0: (3 GPs behind) idle=cfa/0/0x1 softirq=3968793/3968793 fqs=2495
      [224521.891742] 	(detected by 2, t=5255 jiffies, g=60855593, q=328)
      [224521.897754] Task dump for CPU 0:
      [224521.901074] task:swapper/0     state:R  running task   stack:  0 pid:  0 ppid:   0 flags:0x00000008
      [224521.911090] Call Trace:
      [224521.913638] [<ffffffe000c432de>] __schedule+0x208/0x5ea
      [224521.918957] Kernel panic - not syncing: RCU Stall
      [224521.923773] bad: scheduling from the idle thread!
      [224521.928571] CPU: 2 PID: 0 Comm: swapper/2 Kdump: loaded Tainted: G   O  5.10.113-yocto-standard #1
      [224521.938658] Call Trace:
      [224521.941200] [<ffffffe00020395c>] walk_stackframe+0x0/0xaa
      [224521.946689] [<ffffffe000c34f8e>] show_stack+0x32/0x3e
      [224521.951830] [<ffffffe000c39020>] dump_stack_lvl+0x7e/0xa2
      [224521.957317] [<ffffffe000c39058>] dump_stack+0x14/0x1c
      [224521.962459] [<ffffffe000243884>] dequeue_task_idle+0x2c/0x40
      [224521.968207] [<ffffffe000c434f4>] __schedule+0x41e/0x5ea
      [224521.973520] [<ffffffe000c43826>] schedule+0x34/0xe4
      [224521.978487] [<ffffffe000c46cae>] schedule_timeout+0xc6/0x170
      [224521.984234] [<ffffffe000c4491e>] wait_for_completion+0x98/0xf2
      [224521.990157] [<ffffffe00026d9e2>] __wait_rcu_gp+0x148/0x14a
      [224521.995733] [<ffffffe0002761c4>] synchronize_rcu+0x5c/0x66
      [224522.001307] [<ffffffe00026f1a6>] rcu_sync_enter+0x54/0xe6
      [224522.006795] [<ffffffe00025a436>] percpu_down_write+0x32/0x11c
      [224522.012629] [<ffffffe000c4266a>] _cpu_down+0x92/0x21a
      [224522.017771] [<ffffffe000219a0a>] smp_shutdown_nonboot_cpus+0x90/0x118
      [224522.024299] [<ffffffe00020701e>] machine_crash_shutdown+0x30/0x4a
      [224522.030483] [<ffffffe00029a3f8>] __crash_kexec+0x62/0xa6
      [224522.035884] [<ffffffe000c3515e>] panic+0xfa/0x2b6
      [224522.040678] [<ffffffe0002772be>] rcu_sched_clock_irq+0xc26/0xcb8
      [224522.046774] [<ffffffe00027fc7a>] update_process_times+0x62/0x8a
      [224522.052785] [<ffffffe00028d522>] tick_sched_timer+0x9e/0x102
      [224522.058533] [<ffffffe000280c3a>] __hrtimer_run_queues+0x16a/0x318
      [224522.064716] [<ffffffe0002812ec>] hrtimer_interrupt+0xd4/0x228
      [224522.070551] [<ffffffe0009a69b6>] riscv_timer_interrupt+0x3c/0x48
      [224522.076646] [<ffffffe000268f8c>] handle_percpu_devid_irq+0xb0/0x24c
      [224522.083004] [<ffffffe00026428e>] __handle_domain_irq+0xa8/0x122
      [224522.089014] [<ffffffe00062f954>] riscv_intc_irq+0x38/0x60
      [224522.094501] [<ffffffe000201bd4>] ret_from_exception+0x0/0xc
      [224522.100161] [<ffffffe000c42146>] rcu_eqs_enter.constprop.0+0x8c/0xb8
      
      With the patch, it can enter crash system when RCU Stall occur.
      
      Fixes: e53d2818 ("RISC-V: Add kdump support")
      Signed-off-by: NXianting Tian <xianting.tian@linux.alibaba.com>
      Link: https://lore.kernel.org/r/20220811074150.3020189-4-xianting.tian@linux.alibaba.com
      Cc: stable@vger.kernel.org
      Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
      ad943893
    • X
      RISC-V: Fixup get incorrect user mode PC for kernel mode regs · 59c026c3
      Xianting Tian 提交于
      When use 'echo c > /proc/sysrq-trigger' to trigger kdump, riscv_crash_save_regs()
      will be called to save regs for vmcore, we found "epc" value 00ffffffa5537400
      is not a valid kernel virtual address, but is a user virtual address. Other
      regs(eg, ra, sp, gp...) are correct kernel virtual address.
      Actually 0x00ffffffb0dd9400 is the user mode PC of 'PID: 113 Comm: sh', which
      is saved in the task's stack.
      
      [   21.201701] CPU: 0 PID: 113 Comm: sh Kdump: loaded Not tainted 5.18.9 #45
      [   21.201979] Hardware name: riscv-virtio,qemu (DT)
      [   21.202160] epc : 00ffffffa5537400 ra : ffffffff80088640 sp : ff20000010333b90
      [   21.202435]  gp : ffffffff810dde38 tp : ff6000000226c200 t0 : ffffffff8032be7c
      [   21.202707]  t1 : 0720072007200720 t2 : 30203a7375746174 s0 : ff20000010333cf0
      [   21.202973]  s1 : 0000000000000000 a0 : ff20000010333b98 a1 : 0000000000000001
      [   21.203243]  a2 : 0000000000000010 a3 : 0000000000000000 a4 : 28c8f0aeffea4e00
      [   21.203519]  a5 : 28c8f0aeffea4e00 a6 : 0000000000000009 a7 : ffffffff8035c9b8
      [   21.203794]  s2 : ffffffff810df0a8 s3 : ffffffff810df718 s4 : ff20000010333b98
      [   21.204062]  s5 : 0000000000000000 s6 : 0000000000000007 s7 : ffffffff80c4a468
      [   21.204331]  s8 : 00ffffffef451410 s9 : 0000000000000007 s10: 00aaaaaac0510700
      [   21.204606]  s11: 0000000000000001 t3 : ff60000001218f00 t4 : ff60000001218f00
      [   21.204876]  t5 : ff60000001218000 t6 : ff200000103338b8
      [   21.205079] status: 0000000200000020 badaddr: 0000000000000000 cause: 0000000000000008
      
      With the incorrect PC, the backtrace showed by crash tool as below, the first
      stack frame is abnormal,
      
      crash> bt
      PID: 113      TASK: ff60000002269600  CPU: 0    COMMAND: "sh"
       #0 [ff2000001039bb90] __efistub_.Ldebug_info0 at 00ffffffa5537400 <-- Abnormal
       #1 [ff2000001039bcf0] panic at ffffffff806578ba
       #2 [ff2000001039bd50] sysrq_reset_seq_param_set at ffffffff8038c030
       #3 [ff2000001039bda0] __handle_sysrq at ffffffff8038c5f8
       #4 [ff2000001039be00] write_sysrq_trigger at ffffffff8038cad8
       #5 [ff2000001039be20] proc_reg_write at ffffffff801b7edc
       #6 [ff2000001039be40] vfs_write at ffffffff80152ba6
       #7 [ff2000001039be80] ksys_write at ffffffff80152ece
       #8 [ff2000001039bed0] sys_write at ffffffff80152f46
      
      With the patch, we can get current kernel mode PC, the output as below,
      
      [   17.607658] CPU: 0 PID: 113 Comm: sh Kdump: loaded Not tainted 5.18.9 #42
      [   17.607937] Hardware name: riscv-virtio,qemu (DT)
      [   17.608150] epc : ffffffff800078f8 ra : ffffffff8008862c sp : ff20000010333b90
      [   17.608441]  gp : ffffffff810dde38 tp : ff6000000226c200 t0 : ffffffff8032be68
      [   17.608741]  t1 : 0720072007200720 t2 : 666666666666663c s0 : ff20000010333cf0
      [   17.609025]  s1 : 0000000000000000 a0 : ff20000010333b98 a1 : 0000000000000001
      [   17.609320]  a2 : 0000000000000010 a3 : 0000000000000000 a4 : 0000000000000000
      [   17.609601]  a5 : ff60000001c78000 a6 : 000000000000003c a7 : ffffffff8035c9a4
      [   17.609894]  s2 : ffffffff810df0a8 s3 : ffffffff810df718 s4 : ff20000010333b98
      [   17.610186]  s5 : 0000000000000000 s6 : 0000000000000007 s7 : ffffffff80c4a468
      [   17.610469]  s8 : 00ffffffca281410 s9 : 0000000000000007 s10: 00aaaaaab5bb6700
      [   17.610755]  s11: 0000000000000001 t3 : ff60000001218f00 t4 : ff60000001218f00
      [   17.611041]  t5 : ff60000001218000 t6 : ff20000010333988
      [   17.611255] status: 0000000200000020 badaddr: 0000000000000000 cause: 0000000000000008
      
      With the correct PC, the backtrace showed by crash tool as below,
      
      crash> bt
      PID: 113      TASK: ff6000000226c200  CPU: 0    COMMAND: "sh"
       #0 [ff20000010333b90] riscv_crash_save_regs at ffffffff800078f8 <--- Normal
       #1 [ff20000010333cf0] panic at ffffffff806578c6
       #2 [ff20000010333d50] sysrq_reset_seq_param_set at ffffffff8038c03c
       #3 [ff20000010333da0] __handle_sysrq at ffffffff8038c604
       #4 [ff20000010333e00] write_sysrq_trigger at ffffffff8038cae4
       #5 [ff20000010333e20] proc_reg_write at ffffffff801b7ee8
       #6 [ff20000010333e40] vfs_write at ffffffff80152bb2
       #7 [ff20000010333e80] ksys_write at ffffffff80152eda
       #8 [ff20000010333ed0] sys_write at ffffffff80152f52
      
      Fixes: e53d2818 ("RISC-V: Add kdump support")
      Co-developed-by: NGuo Ren <guoren@kernel.org>
      Signed-off-by: NXianting Tian <xianting.tian@linux.alibaba.com>
      Link: https://lore.kernel.org/r/20220811074150.3020189-3-xianting.tian@linux.alibaba.com
      Cc: stable@vger.kernel.org
      Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
      59c026c3
    • X
      RISC-V: kexec: Fixup use of smp_processor_id() in preemptible context · 357628e6
      Xianting Tian 提交于
      Use __smp_processor_id() to avoid check the preemption context when
      CONFIG_DEBUG_PREEMPT enabled, as we will enter crash kernel and no
      return.
      
      Without the patch,
      [  103.781044] sysrq: Trigger a crash
      [  103.784625] Kernel panic - not syncing: sysrq triggered crash
      [  103.837634] CPU1: off
      [  103.889668] CPU2: off
      [  103.933479] CPU3: off
      [  103.939424] Starting crashdump kernel...
      [  103.943442] BUG: using smp_processor_id() in preemptible [00000000] code: sh/346
      [  103.950884] caller is debug_smp_processor_id+0x1c/0x26
      [  103.956051] CPU: 0 PID: 346 Comm: sh Kdump: loaded Not tainted 5.10.113-00002-gce03f03bf4ec-dirty #149
      [  103.965355] Call Trace:
      [  103.967805] [<ffffffe00020372a>] walk_stackframe+0x0/0xa2
      [  103.973206] [<ffffffe000bcf1f4>] show_stack+0x32/0x3e
      [  103.978258] [<ffffffe000bd382a>] dump_stack_lvl+0x72/0x8e
      [  103.983655] [<ffffffe000bd385a>] dump_stack+0x14/0x1c
      [  103.988705] [<ffffffe000bdc8fe>] check_preemption_disabled+0x9e/0xaa
      [  103.995057] [<ffffffe000bdc926>] debug_smp_processor_id+0x1c/0x26
      [  104.001150] [<ffffffe000206c64>] machine_kexec+0x22/0xd0
      [  104.006463] [<ffffffe000291a7e>] __crash_kexec+0x6a/0xa4
      [  104.011774] [<ffffffe000bcf3fa>] panic+0xfc/0x2b0
      [  104.016480] [<ffffffe000656ca4>] sysrq_reset_seq_param_set+0x0/0x70
      [  104.022745] [<ffffffe000657310>] __handle_sysrq+0x8c/0x154
      [  104.028229] [<ffffffe0006577e8>] write_sysrq_trigger+0x5a/0x6a
      [  104.034061] [<ffffffe0003d90e0>] proc_reg_write+0x58/0xd4
      [  104.039459] [<ffffffe00036cff4>] vfs_write+0x7e/0x254
      [  104.044509] [<ffffffe00036d2f6>] ksys_write+0x58/0xbe
      [  104.049558] [<ffffffe00036d36a>] sys_write+0xe/0x16
      [  104.054434] [<ffffffe000201b9a>] ret_from_syscall+0x0/0x2
      [  104.067863] Will call new kernel at ecc00000 from hart id 0
      [  104.074939] FDT image at fc5ee000
      [  104.079523] Bye...
      
      With the patch we can got clear output,
      [   67.740553] sysrq: Trigger a crash
      [   67.744166] Kernel panic - not syncing: sysrq triggered crash
      [   67.809123] CPU1: off
      [   67.865210] CPU2: off
      [   67.909075] CPU3: off
      [   67.919123] Starting crashdump kernel...
      [   67.924900] Will call new kernel at ecc00000 from hart id 0
      [   67.932045] FDT image at fc5ee000
      [   67.935560] Bye...
      
      Fixes: 0e105f1d ("riscv: use hart id instead of cpu id on machine_kexec")
      Reviewed-by: NGuo Ren <guoren@kernel.org>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: NAtish Patra <atishp@rivosinc.com>
      Signed-off-by: NXianting Tian <xianting.tian@linux.alibaba.com>
      Link: https://lore.kernel.org/r/20220811074150.3020189-2-xianting.tian@linux.alibaba.com
      Cc: stable@vger.kernel.org
      Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
      357628e6
    • D
      arch/riscv: add Zihintpause support · 8eb060e1
      Dao Lu 提交于
      Implement support for the ZiHintPause extension.
      
      The PAUSE instruction is a HINT that indicates the current hart’s rate
      of instruction retirement should be temporarily reduced or paused.
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NDao Lu <daolu@rivosinc.com>
      [Palmer: Some minor merge conflicts.]
      Link: https://lore.kernel.org/all/20220620201530.3929352-1-daolu@rivosinc.com/
      Link: https://lore.kernel.org/all/20220811053356.17375-1-palmer@rivosinc.com/Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
      8eb060e1
    • C
      riscv: lib: uaccess: fix CSR_STATUS SR_SUM bit · c08b4848
      Chen Lifu 提交于
      Since commit 5d8544e2 ("RISC-V: Generic library routines and assembly")
      and commit ebcbd75e ("riscv: Fix the bug in memory access fixup code"),
      if __clear_user and __copy_user return from an fixup branch,
      CSR_STATUS SR_SUM bit will be set, it is a vulnerability, so that
      S-mode memory accesses to pages that are accessible by U-mode will success.
      Disable S-mode access to U-mode memory should clear SR_SUM bit.
      
      Fixes: 5d8544e2 ("RISC-V: Generic library routines and assembly")
      Fixes: ebcbd75e ("riscv: Fix the bug in memory access fixup code")
      Signed-off-by: NChen Lifu <chenlifu@huawei.com>
      Reviewed-by: NBen Dooks <ben.dooks@codethink.co.uk>
      Link: https://lore.kernel.org/r/20220615014714.1650349-1-chenlifu@huawei.com
      Cc: stable@vger.kernel.org
      Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
      c08b4848
  10. 04 8月, 2022 1 次提交
  11. 30 7月, 2022 1 次提交
  12. 29 7月, 2022 7 次提交