linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] RISC-V Fixes for 5.9-rc2
@ 2020-08-21 18:26 Palmer Dabbelt
  2020-08-21 19:35 ` Linus Torvalds
  2020-08-21 22:05 ` pr-tracker-bot
  0 siblings, 2 replies; 11+ messages in thread
From: Palmer Dabbelt @ 2020-08-21 18:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-riscv, linux-kernel

The following changes since commit 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5:

  Linux 5.9-rc1 (2020-08-16 13:04:57 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-5.9-rc2

for you to fetch changes up to fc26f5bbf19459930b7290c87b65a9ae6a274650:

  riscv: Add SiFive drivers to rv32_defconfig (2020-08-20 11:00:21 -0700)

----------------------------------------------------------------
RISC-V Fixes for 5.9-rc2

* The CLINT driver has been split in two: one to handle the M-mode CLINT
  (memory mapped and used on NOMMU systems) and one to handle the S-mode CLINT
  (via SBI).
* The addition of SiFive's drivers to rv32_defconfig

----------------------------------------------------------------
Anup Patel (4):
      RISC-V: Add mechanism to provide custom IPI operations
      clocksource/drivers: Add CLINT timer driver
      RISC-V: Remove CLINT related code from timer and arch
      dt-bindings: timer: Add CLINT bindings

Bin Meng (1):
      riscv: Add SiFive drivers to rv32_defconfig

 .../devicetree/bindings/timer/sifive,clint.yaml    |  60 ++++++
 arch/riscv/Kconfig                                 |   2 +-
 arch/riscv/Kconfig.socs                            |   2 +
 arch/riscv/configs/nommu_virt_defconfig            |   7 +-
 arch/riscv/configs/rv32_defconfig                  |   5 +
 arch/riscv/include/asm/clint.h                     |  39 ----
 arch/riscv/include/asm/smp.h                       |  19 ++
 arch/riscv/include/asm/timex.h                     |  28 +--
 arch/riscv/kernel/Makefile                         |   2 +-
 arch/riscv/kernel/clint.c                          |  44 ----
 arch/riscv/kernel/sbi.c                            |  14 ++
 arch/riscv/kernel/setup.c                          |   2 -
 arch/riscv/kernel/smp.c                            |  44 ++--
 arch/riscv/kernel/smpboot.c                        |   4 +-
 drivers/clocksource/Kconfig                        |  12 +-
 drivers/clocksource/Makefile                       |   1 +
 drivers/clocksource/timer-clint.c                  | 226 +++++++++++++++++++++
 drivers/clocksource/timer-riscv.c                  |  17 +-
 include/linux/cpuhotplug.h                         |   1 +
 19 files changed, 376 insertions(+), 153 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/sifive,clint.yaml
 delete mode 100644 arch/riscv/include/asm/clint.h
 delete mode 100644 arch/riscv/kernel/clint.c
 create mode 100644 drivers/clocksource/timer-clint.c

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-08-21 18:26 [GIT PULL] RISC-V Fixes for 5.9-rc2 Palmer Dabbelt
@ 2020-08-21 19:35 ` Linus Torvalds
  2020-09-04  8:31   ` Christoph Hellwig
  2020-08-21 22:05 ` pr-tracker-bot
  1 sibling, 1 reply; 11+ messages in thread
From: Linus Torvalds @ 2020-08-21 19:35 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: linux-riscv, Linux Kernel Mailing List

On Fri, Aug 21, 2020 at 11:26 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> * The CLINT driver has been split in two: one to handle the M-mode CLINT
>   (memory mapped and used on NOMMU systems) and one to handle the S-mode CLINT
>   (via SBI).

This looks more like development than fixes.

I guess I don't care deeply enough about it, but please don't do this.

            Linus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-08-21 18:26 [GIT PULL] RISC-V Fixes for 5.9-rc2 Palmer Dabbelt
  2020-08-21 19:35 ` Linus Torvalds
@ 2020-08-21 22:05 ` pr-tracker-bot
  1 sibling, 0 replies; 11+ messages in thread
From: pr-tracker-bot @ 2020-08-21 22:05 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: Linus Torvalds, linux-riscv, linux-kernel

The pull request you sent on Fri, 21 Aug 2020 11:26:44 -0700 (PDT):

> git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-5.9-rc2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/f22c5579a7d600fa03f8c1d150cf78188f8709b6

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-08-21 19:35 ` Linus Torvalds
@ 2020-09-04  8:31   ` Christoph Hellwig
  2020-09-04  9:42     ` Anup Patel
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2020-09-04  8:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Palmer Dabbelt, linux-riscv, Linux Kernel Mailing List

On Fri, Aug 21, 2020 at 12:35:20PM -0700, Linus Torvalds wrote:
> On Fri, Aug 21, 2020 at 11:26 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> >
> > * The CLINT driver has been split in two: one to handle the M-mode CLINT
> >   (memory mapped and used on NOMMU systems) and one to handle the S-mode CLINT
> >   (via SBI).
> 
> This looks more like development than fixes.
> 
> I guess I don't care deeply enough about it, but please don't do this.

Well, I care because this late pull requests completely breaks nommu
(nommu_virt_defconfig).   More specifically commit 2bc3fc877aa9
("RISC-V: Remove CLINT related code from timer and arch") leas to this
spew when booting under qemu:

[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@c000000: mapped 53 interrupts with 2 handlers for 4 contexts.
[    0.000000] Oops - illegal instruction [#1]
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.9.0-rc1-00003-g2bc3fc877aa9c4 #609
[    0.000000] epc: 000000008000de78 ra : 000000008000ddaa sp : 0000000080187f40
[    0.000000]  gp : 00000000801a3aa8 tp : 000000008018bd40 t0 : 0000000000000019
[    0.000000]  t1 : 0000000000000018 t2 : 0000000000000001 s0 : 0000000080187f80
[    0.000000]  s1 : 0000000000000200 a0 : 000000008019b738 a1 : 0000000000000000
[    0.000000]  a2 : ffffffff80187f50 a3 : 0000000000000000 a4 : 0000000000000000
[    0.000000]  a5 : 0000000080169018 a6 : 0000000000000000 a7 : 00000000000001e4
[    0.000000]  s2 : 00000000801a40a8 s3 : 00000000801a4068 s4 : 000000008fc7c040
[    0.000000]  s5 : 00000000801a4038 s6 : 00000000801a4030 s7 : 0000000080012da0
[    0.000000]  s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000000000000000
[    0.000000]  s11: 0000000000000000 t3 : 00000000801c40d8 t4 : 0000000000000068
[    0.000000]  t5 : 000000000000004c t6 : 0000000000000033
[    0.000000] status: 0000000000001800 badaddr: 0000000000000000 cause: 0000000000000002
[    0.000000] random: get_random_bytes called from 0x00000000800210c4 with crng_init=0
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-09-04  8:31   ` Christoph Hellwig
@ 2020-09-04  9:42     ` Anup Patel
  2020-09-04  9:46       ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Anup Patel @ 2020-09-04  9:42 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Linus Torvalds, Palmer Dabbelt, linux-riscv, Linux Kernel Mailing List

On Fri, Sep 4, 2020 at 2:01 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Fri, Aug 21, 2020 at 12:35:20PM -0700, Linus Torvalds wrote:
> > On Fri, Aug 21, 2020 at 11:26 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> > >
> > > * The CLINT driver has been split in two: one to handle the M-mode CLINT
> > >   (memory mapped and used on NOMMU systems) and one to handle the S-mode CLINT
> > >   (via SBI).
> >
> > This looks more like development than fixes.
> >
> > I guess I don't care deeply enough about it, but please don't do this.
>
> Well, I care because this late pull requests completely breaks nommu
> (nommu_virt_defconfig).   More specifically commit 2bc3fc877aa9
> ("RISC-V: Remove CLINT related code from timer and arch") leas to this
> spew when booting under qemu:
>
> [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
> [    0.000000] riscv-intc: 64 local interrupts mapped
> [    0.000000] plic: interrupt-controller@c000000: mapped 53 interrupts with 2 handlers for 4 contexts.
> [    0.000000] Oops - illegal instruction [#1]
> [    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.9.0-rc1-00003-g2bc3fc877aa9c4 #609
> [    0.000000] epc: 000000008000de78 ra : 000000008000ddaa sp : 0000000080187f40
> [    0.000000]  gp : 00000000801a3aa8 tp : 000000008018bd40 t0 : 0000000000000019
> [    0.000000]  t1 : 0000000000000018 t2 : 0000000000000001 s0 : 0000000080187f80
> [    0.000000]  s1 : 0000000000000200 a0 : 000000008019b738 a1 : 0000000000000000
> [    0.000000]  a2 : ffffffff80187f50 a3 : 0000000000000000 a4 : 0000000000000000
> [    0.000000]  a5 : 0000000080169018 a6 : 0000000000000000 a7 : 00000000000001e4
> [    0.000000]  s2 : 00000000801a40a8 s3 : 00000000801a4068 s4 : 000000008fc7c040
> [    0.000000]  s5 : 00000000801a4038 s6 : 00000000801a4030 s7 : 0000000080012da0
> [    0.000000]  s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000000000000000
> [    0.000000]  s11: 0000000000000000 t3 : 00000000801c40d8 t4 : 0000000000000068
> [    0.000000]  t5 : 000000000000004c t6 : 0000000000000033
> [    0.000000] status: 0000000000001800 badaddr: 0000000000000000 cause: 0000000000000002
> [    0.000000] random: get_random_bytes called from 0x00000000800210c4 with crng_init=0
> [    0.000000] ---[ end trace 0000000000000000 ]---
> [    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
> [    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

I tried Linux-5.9-rc3 using nommu_virt_defconfig at my end. I am not
able to reproduce
this issue. Is there additional Kconfig option required to reproduce
this issue ??

anup@anup-ubuntu64-vm:~/Work/riscv-test/nommu$ qemu-system-riscv64 -M
virt -m 8M -display none -nographic -kernel
./build-riscv64/arch/riscv/boot/loader -append "root=/dev/ram rw
console=ttyS0" -smp 4
qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware.
qemu-system-riscv64: warning: This default will change in a future
QEMU release. Please use the -bios option to avoid breakages when this
happens.
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details.
[    0.000000] Linux version 5.9.0-rc3 (anup@anup-ubuntu64-vm)
(riscv64-unknown-linux-gnu-gcc (GCC) 9.2.0, GNU ld (GNU Binutils)
2.34) #1 SMP Fri Sep 4 15:02:31 IST 2020
[    0.000000] earlycon: uart8250 at MMIO 0x0000000010000000 (options
'115200n8')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] riscv: ISA extensions acdfimsu
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: max_distance=0x30000 too large for vmalloc space 0x0
[    0.000000] percpu: Embedded 12 pages/cpu s18592 r0 d30560 u49152
[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
[    0.000000] Kernel command line: root=/dev/vda rw
earlycon=uart8250,mmio,0x10000000,115200n8 console=ttyS0
[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192
bytes, linear)
[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096
bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 6016K/8192K available (1283K kernel code, 138K
rwdata, 200K rodata, 106K init, 133K bss, 2176K reserved, 0K
cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay
is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: plic@c000000: mapped 53 interrupts with 4
handlers for 8 contexts.
[    0.000000] random: get_random_bytes called from 0x00000000800019b4
with crng_init=0
[    0.000000] clint: clint@2000000: timer running at 10000000 Hz
[    0.000000] clocksource: clint_clocksource: mask:
0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120
ns
[    0.000212] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps
every 4398046511100ns
[    0.016835] Console: colour dummy device 80x25
[    0.034899] Calibrating delay loop (skipped), value calculated
using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[    0.050107] pid_max: default: 4096 minimum: 301
[    0.051951] Mount-cache hash table entries: 512 (order: 0, 4096
bytes, linear)
[    0.052711] Mountpoint-cache hash table entries: 512 (order: 0,
4096 bytes, linear)
[    0.151318] rcu: Hierarchical SRCU implementation.
[    0.158697] smp: Bringing up secondary CPUs ...
[    0.213140] smp: Brought up 1 node, 4 CPUs
[    0.245903] devtmpfs: initialized
[    0.262757] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.264822] futex hash table entries: 16 (order: -2, 1024 bytes, linear)
[    0.413555] clocksource: Switched to clocksource clint_clocksource
[    0.580364] workingset: timestamp_bits=62 max_order=11 bucket_order=0
[    0.589640] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.604478] printk: console [ttyS0] disabled
[    0.611025] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 2,
base_baud = 230400) is a 16550A
[    0.621897] printk: console [ttyS0] enabled
[    0.621897] printk: console [ttyS0] enabled
[    0.622997] printk: bootconsole [uart8250] disabled
[    0.622997] printk: bootconsole [uart8250] disabled
[    0.646964] syscon-poweroff soc:poweroff: pm_power_off already
claimed (____ptrval____)
[    0.648264] syscon-poweroff: probe of soc:poweroff failed with error -16
[    0.677403] VFS: Cannot open root device "vda" or
unknown-block(0,0): error -6
[    0.679474] Please append a correct "root=" boot option; here are
the available partitions:
[    0.682862] Kernel panic - not syncing: VFS: Unable to mount root
fs on unknown-block(0,0)

Regards,
Anup

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-09-04  9:42     ` Anup Patel
@ 2020-09-04  9:46       ` Christoph Hellwig
  2020-09-04 10:04         ` Anup Patel
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2020-09-04  9:46 UTC (permalink / raw)
  To: Anup Patel
  Cc: Christoph Hellwig, Linus Torvalds, Palmer Dabbelt, linux-riscv,
	Linux Kernel Mailing List

On Fri, Sep 04, 2020 at 03:12:18PM +0530, Anup Patel wrote:
> I tried Linux-5.9-rc3 using nommu_virt_defconfig at my end. I am not
> able to reproduce
> this issue. Is there additional Kconfig option required to reproduce
> this issue ??

export CROSS_COMPILE=/usr/bin/riscv64-linux-gnu-
make ARCH=riscv nommu_virt_defconfig
make ARCH=riscv -j4 loader

/opt/qemu-riscv/bin/qemu-system-riscv64 \
        -smp 2 \
        -m 256 \
        -machine virt \
        -nographic \
        -kernel arch/riscv/boot/loader \
        -drive file=rootfs.ext2,format=raw,id=hd0 \
        -device virtio-blk-device,drive=hd0

> 
> anup@anup-ubuntu64-vm:~/Work/riscv-test/nommu$ qemu-system-riscv64 -M
> virt -m 8M -display none -nographic -kernel
> ./build-riscv64/arch/riscv/boot/loader -append "root=/dev/ram rw
> console=ttyS0" -smp 4
> qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware.
> qemu-system-riscv64: warning: This default will change in a future
> QEMU release. Please use the -bios option to avoid breakages when this
> happens.
> qemu-system-riscv64: warning: See QEMU's deprecation documentation for details.
> [    0.000000] Linux version 5.9.0-rc3 (anup@anup-ubuntu64-vm)
> (riscv64-unknown-linux-gnu-gcc (GCC) 9.2.0, GNU ld (GNU Binutils)
> 2.34) #1 SMP Fri Sep 4 15:02:31 IST 2020
> [    0.000000] earlycon: uart8250 at MMIO 0x0000000010000000 (options
> '115200n8')
> [    0.000000] printk: bootconsole [uart8250] enabled
> [    0.000000] Zone ranges:
> [    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
> [    0.000000]   Normal   empty
> [    0.000000] Movable zone start for each node
> [    0.000000] Early memory node ranges
> [    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
> [    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
> [    0.000000] riscv: ISA extensions acdfimsu
> [    0.000000] riscv: ELF capabilities acdfim
> [    0.000000] percpu: max_distance=0x30000 too large for vmalloc space 0x0
> [    0.000000] percpu: Embedded 12 pages/cpu s18592 r0 d30560 u49152
> [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
> [    0.000000] Kernel command line: root=/dev/vda rw
> earlycon=uart8250,mmio,0x10000000,115200n8 console=ttyS0
> [    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192
> bytes, linear)
> [    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096
> bytes, linear)
> [    0.000000] Sorting __ex_table...
> [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
> [    0.000000] Memory: 6016K/8192K available (1283K kernel code, 138K
> rwdata, 200K rodata, 106K init, 133K bss, 2176K reserved, 0K
> cma-reserved)
> [    0.000000] rcu: Hierarchical RCU implementation.
> [    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
> [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay
> is 25 jiffies.
> [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
> [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
> [    0.000000] riscv-intc: 64 local interrupts mapped
> [    0.000000] plic: plic@c000000: mapped 53 interrupts with 4
> handlers for 8 contexts.
> [    0.000000] random: get_random_bytes called from 0x00000000800019b4
> with crng_init=0
> [    0.000000] clint: clint@2000000: timer running at 10000000 Hz
> [    0.000000] clocksource: clint_clocksource: mask:
> 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120
> ns
> [    0.000212] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps
> every 4398046511100ns
> [    0.016835] Console: colour dummy device 80x25
> [    0.034899] Calibrating delay loop (skipped), value calculated
> using timer frequency.. 20.00 BogoMIPS (lpj=40000)
> [    0.050107] pid_max: default: 4096 minimum: 301
> [    0.051951] Mount-cache hash table entries: 512 (order: 0, 4096
> bytes, linear)
> [    0.052711] Mountpoint-cache hash table entries: 512 (order: 0,
> 4096 bytes, linear)
> [    0.151318] rcu: Hierarchical SRCU implementation.
> [    0.158697] smp: Bringing up secondary CPUs ...
> [    0.213140] smp: Brought up 1 node, 4 CPUs
> [    0.245903] devtmpfs: initialized
> [    0.262757] clocksource: jiffies: mask: 0xffffffff max_cycles:
> 0xffffffff, max_idle_ns: 7645041785100000 ns
> [    0.264822] futex hash table entries: 16 (order: -2, 1024 bytes, linear)
> [    0.413555] clocksource: Switched to clocksource clint_clocksource
> [    0.580364] workingset: timestamp_bits=62 max_order=11 bucket_order=0
> [    0.589640] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
> [    0.604478] printk: console [ttyS0] disabled
> [    0.611025] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 2,
> base_baud = 230400) is a 16550A
> [    0.621897] printk: console [ttyS0] enabled
> [    0.621897] printk: console [ttyS0] enabled
> [    0.622997] printk: bootconsole [uart8250] disabled
> [    0.622997] printk: bootconsole [uart8250] disabled
> [    0.646964] syscon-poweroff soc:poweroff: pm_power_off already
> claimed (____ptrval____)
> [    0.648264] syscon-poweroff: probe of soc:poweroff failed with error -16
> [    0.677403] VFS: Cannot open root device "vda" or
> unknown-block(0,0): error -6
> [    0.679474] Please append a correct "root=" boot option; here are
> the available partitions:
> [    0.682862] Kernel panic - not syncing: VFS: Unable to mount root
> fs on unknown-block(0,0)
> 
> Regards,
> Anup
---end quoted text---

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-09-04  9:46       ` Christoph Hellwig
@ 2020-09-04 10:04         ` Anup Patel
       [not found]           ` <f1be6ee1-0802-82ca-ffdb-4c294925cd9a@kylinos.com.cn>
  0 siblings, 1 reply; 11+ messages in thread
From: Anup Patel @ 2020-09-04 10:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Linus Torvalds, Palmer Dabbelt, linux-riscv, Linux Kernel Mailing List

On Fri, Sep 4, 2020 at 3:16 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Fri, Sep 04, 2020 at 03:12:18PM +0530, Anup Patel wrote:
> > I tried Linux-5.9-rc3 using nommu_virt_defconfig at my end. I am not
> > able to reproduce
> > this issue. Is there additional Kconfig option required to reproduce
> > this issue ??
>
> export CROSS_COMPILE=/usr/bin/riscv64-linux-gnu-
> make ARCH=riscv nommu_virt_defconfig
> make ARCH=riscv -j4 loader
>
> /opt/qemu-riscv/bin/qemu-system-riscv64 \
>         -smp 2 \
>         -m 256 \
>         -machine virt \
>         -nographic \
>         -kernel arch/riscv/boot/loader \
>         -drive file=rootfs.ext2,format=raw,id=hd0 \
>         -device virtio-blk-device,drive=hd0
>

I tried your suggested QEMU command line with Linux-5.0-rc3 NoMMU
kernel and it reaches till user-space for me but I don't have NoMMU rootfs
so it is not able to start init process.

anup@anup-ubuntu64-vm:~/Work/riscv-test/nommu$ qemu-system-riscv64
-smp 2 -m 256 -machine virt -nographic -kernel
./build-riscv64/arch/riscv/boot/loader -drive
file=../rootfs_riscv64.ext2,format=raw,id=hd0 -device
virtio-blk-device,drive=hd0
qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware.
qemu-system-riscv64: warning: This default will change in a future
QEMU release. Please use the -bios option to avoid breakages when this
happens.
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details.
[    0.000000] Linux version 5.9.0-rc3 (anup@anup-ubuntu64-vm)
(riscv64-unknown-linux-gnu-gcc (GCC) 9.2.0, GNU ld (GNU Binutils)
2.34) #1 SMP Fri Sep 4 15:02:31 IST 2020
[    0.000000] earlycon: uart8250 at MMIO 0x0000000010000000 (options
'115200n8')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000] riscv: ISA extensions acdfimsu
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
[    0.000000] percpu: Embedded 12 pages/cpu s18592 r0 d30560 u49152
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64640
[    0.000000] Kernel command line: root=/dev/vda rw
earlycon=uart8250,mmio,0x10000000,115200n8 console=ttyS0
[    0.000000] Dentry cache hash table entries: 32768 (order: 6,
262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072
bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 256224K/262144K available (1283K kernel code,
138K rwdata, 200K rodata, 106K init, 133K bss, 5920K reserved, 0K
cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay
is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: plic@c000000: mapped 53 interrupts with 2
handlers for 4 contexts.
[    0.000000] random: get_random_bytes called from 0x00000000800019b4
with crng_init=0
[    0.000000] clint: clint@2000000: timer running at 10000000 Hz
[    0.000000] clocksource: clint_clocksource: mask:
0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120
ns
[    0.000206] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps
every 4398046511100ns
[    0.007108] Console: colour dummy device 80x25
[    0.027252] Calibrating delay loop (skipped), value calculated
using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[    0.044401] pid_max: default: 4096 minimum: 301
[    0.050023] Mount-cache hash table entries: 512 (order: 0, 4096
bytes, linear)
[    0.051126] Mountpoint-cache hash table entries: 512 (order: 0,
4096 bytes, linear)
[    0.108000] rcu: Hierarchical SRCU implementation.
[    0.112062] smp: Bringing up secondary CPUs ...
[    0.137273] smp: Brought up 1 node, 2 CPUs
[    0.156765] devtmpfs: initialized
[    0.179774] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.180920] futex hash table entries: 16 (order: -2, 1024 bytes, linear)
[    0.243189] clocksource: Switched to clocksource clint_clocksource
[    0.337332] workingset: timestamp_bits=62 max_order=16 bucket_order=0
[    0.359428] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.368316] printk: console [ttyS0] disabled
[    0.371915] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 2,
base_baud = 230400) is a 16550A
[    0.381511] printk: console [ttyS0] enabled
[    0.381511] printk: console [ttyS0] enabled
[    0.383556] printk: bootconsole [uart8250] disabled
[    0.383556] printk: bootconsole [uart8250] disabled
[    0.422472] virtio_blk virtio0: [vda] 65536 512-byte logical blocks
(33.6 MB/32.0 MiB)
[    0.423634] vda: detected capacity change from 0 to 33554432
[    0.442785] syscon-poweroff soc:poweroff: pm_power_off already
claimed (____ptrval____)
[    0.444267] syscon-poweroff: probe of soc:poweroff failed with error -16
[    0.476602] VFS: Mounted root (ext2 filesystem) on device 254:0.
[    0.484743] devtmpfs: mounted
[    0.509267] Freeing unused kernel memory: 104K
[    0.509818] This architecture does not have kernel memory protection.
[    0.510888] Run /sbin/init as init process
[    0.532914] Starting init: /sbin/init exists but couldn't execute
it (error -8)
[    0.534654] Run /etc/init as init process
[    0.567910] Run /bin/init as init process
[    0.568801] Run /bin/sh as init process
[    0.570511] Starting init: /bin/sh exists but couldn't execute it (error -8)
[    0.573827] Kernel panic - not syncing: No working init found.  Try
passing init= option to kernel. See Linux
Documentation/admin-guide/init.rst for guidance.
[    0.577228] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc3 #1
[    0.578884] Call Trace:
[    0.579903] [<000000008001da90>] 0x000000008001da90
[    0.580994] [<000000008001dc00>] 0x000000008001dc00
[    0.581820] [<000000008013e79c>] 0x000000008013e79c
[    0.582699] [<000000008002154c>] 0x000000008002154c
[    0.585067] [<000000008014face>] 0x000000008014face
[    0.588753] [<000000008001c932>] 0x000000008001c932
[    0.591942] SMP: stopping secondary CPUs
[    0.593858] ---[ end Kernel panic - not syncing: No working init
found.  Try passing init= option to kernel. See Linux
Documentation/admin-guide/init.rst for guidance. ]---

Regards,
Anup

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
       [not found]           ` <f1be6ee1-0802-82ca-ffdb-4c294925cd9a@kylinos.com.cn>
@ 2020-09-04 13:00             ` Christoph Hellwig
  2020-09-04 13:56               ` Anup Patel
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2020-09-04 13:00 UTC (permalink / raw)
  To: Qiu Wenbo
  Cc: Anup Patel, Christoph Hellwig, Palmer Dabbelt, linux-riscv,
	Linus Torvalds, Linux Kernel Mailing List

On Fri, Sep 04, 2020 at 08:58:25PM +0800, Qiu Wenbo wrote:
> I can confirm this patch also breaks K210 support. It seems that
> csr_read(CSR_TIME) will trigger an illegal instruction exception on K210.

CSR_TIME is trapped by just about every implementation I know (which is
explicitly allowed by the spec).  That is why we should never use it
from common M-mode code.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-09-04 13:00             ` Christoph Hellwig
@ 2020-09-04 13:56               ` Anup Patel
  2020-09-04 16:03                 ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Anup Patel @ 2020-09-04 13:56 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Qiu Wenbo, Palmer Dabbelt, linux-riscv, Linus Torvalds,
	Linux Kernel Mailing List

On Fri, Sep 4, 2020 at 6:30 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Fri, Sep 04, 2020 at 08:58:25PM +0800, Qiu Wenbo wrote:
> > I can confirm this patch also breaks K210 support. It seems that
> > csr_read(CSR_TIME) will trigger an illegal instruction exception on K210.
>
> CSR_TIME is trapped by just about every implementation I know (which is
> explicitly allowed by the spec).  That is why we should never use it
> from common M-mode code.

Finally, I was able to replicate this issue by manually hacking QEMU to
not emulatie TIME CSR for virt machine.

It seems this issue is only seen on older QEMU and Kendrtye K210.

I am working on a fix for this issue.

Thanks for reporting.

Regards,
Anup

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-09-04 13:56               ` Anup Patel
@ 2020-09-04 16:03                 ` Christoph Hellwig
  2020-09-04 16:14                   ` Anup Patel
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2020-09-04 16:03 UTC (permalink / raw)
  To: Anup Patel
  Cc: Christoph Hellwig, Qiu Wenbo, Palmer Dabbelt, linux-riscv,
	Linus Torvalds, Linux Kernel Mailing List

On Fri, Sep 04, 2020 at 07:26:41PM +0530, Anup Patel wrote:
> On Fri, Sep 4, 2020 at 6:30 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Fri, Sep 04, 2020 at 08:58:25PM +0800, Qiu Wenbo wrote:
> > > I can confirm this patch also breaks K210 support. It seems that
> > > csr_read(CSR_TIME) will trigger an illegal instruction exception on K210.
> >
> > CSR_TIME is trapped by just about every implementation I know (which is
> > explicitly allowed by the spec).  That is why we should never use it
> > from common M-mode code.
> 
> Finally, I was able to replicate this issue by manually hacking QEMU to
> not emulatie TIME CSR for virt machine.
> 
> It seems this issue is only seen on older QEMU and Kendrtye K210.

You'd also see it when running nommu on Sifivie or just about any
hardware.  Whoever implement the TIME CSR for qemu made a mistake IMHO
as it doesn't match how most real hardware behaves.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [GIT PULL] RISC-V Fixes for 5.9-rc2
  2020-09-04 16:03                 ` Christoph Hellwig
@ 2020-09-04 16:14                   ` Anup Patel
  0 siblings, 0 replies; 11+ messages in thread
From: Anup Patel @ 2020-09-04 16:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Qiu Wenbo, Palmer Dabbelt, linux-riscv, Linus Torvalds,
	Linux Kernel Mailing List

On Fri, Sep 4, 2020 at 9:33 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Fri, Sep 04, 2020 at 07:26:41PM +0530, Anup Patel wrote:
> > On Fri, Sep 4, 2020 at 6:30 PM Christoph Hellwig <hch@infradead.org> wrote:
> > >
> > > On Fri, Sep 04, 2020 at 08:58:25PM +0800, Qiu Wenbo wrote:
> > > > I can confirm this patch also breaks K210 support. It seems that
> > > > csr_read(CSR_TIME) will trigger an illegal instruction exception on K210.
> > >
> > > CSR_TIME is trapped by just about every implementation I know (which is
> > > explicitly allowed by the spec).  That is why we should never use it
> > > from common M-mode code.
> >
> > Finally, I was able to replicate this issue by manually hacking QEMU to
> > not emulatie TIME CSR for virt machine.
> >
> > It seems this issue is only seen on older QEMU and Kendrtye K210.
>
> You'd also see it when running nommu on Sifivie or just about any
> hardware.  Whoever implement the TIME CSR for qemu made a mistake IMHO
> as it doesn't match how most real hardware behaves.

There are quite a few RISCV systems who implement TIME CSR in
hardware due to performance gains (10+ %).

The QEMU virt machine does not represent real-world HW so we
should emulate all possible HW optimizations in QEMU virt machine.

On other hand, the QEMU sifive_u machine correctly matches the
real-world SiFive Unleashed in-context of TIME CSR and other HW
features.

IMHO, we need nommu defconfig for SiFive Unleashed so that we
can try NoMMU kernel on both QEMU virt and QEMU sifive_u machine.

Regards,
Anup

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-04 16:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 18:26 [GIT PULL] RISC-V Fixes for 5.9-rc2 Palmer Dabbelt
2020-08-21 19:35 ` Linus Torvalds
2020-09-04  8:31   ` Christoph Hellwig
2020-09-04  9:42     ` Anup Patel
2020-09-04  9:46       ` Christoph Hellwig
2020-09-04 10:04         ` Anup Patel
     [not found]           ` <f1be6ee1-0802-82ca-ffdb-4c294925cd9a@kylinos.com.cn>
2020-09-04 13:00             ` Christoph Hellwig
2020-09-04 13:56               ` Anup Patel
2020-09-04 16:03                 ` Christoph Hellwig
2020-09-04 16:14                   ` Anup Patel
2020-08-21 22:05 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).