Re: [GIT PULL] RISC-V Fixes for 5.9

2020-10-09 Thread pr-tracker-bot
The pull request you sent on Fri, 09 Oct 2020 10:52:09 -0700 (PDT):

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

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

Thank you!

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


[GIT PULL] RISC-V Fixes for 5.9

2020-10-09 Thread Palmer Dabbelt
The following changes since commit 549738f15da0e5a00275977623be199fbbf7df50:

  Linux 5.9-rc8 (2020-10-04 16:04:34 -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

for you to fetch changes up to 84814460eef9af0fb56a4698341c9cb7996a6312:

  riscv: Fixup bootup failure with HARDENED_USERCOPY (2020-10-06 18:34:00 -0700)


RISC-V Fixes for 5.9

I have two fixes this week:

* A fix to actually reserve the device tree's memory.  Without this the device
  tree can be overwritten on systems that don't otherwise reserve it.  This
  issue should only manifest on !MMU systems.
* A workaround for a BUG() that triggers when the memory that originally
  contained initdata is freed and later repurposed.  This triggers a BUG() on
  builds that with HARDENED_USERCOPY enabled.


Atish Patra (1):
  RISC-V: Make sure memblock reserves the memory containing DT

Guo Ren (1):
  riscv: Fixup bootup failure with HARDENED_USERCOPY

 arch/riscv/kernel/vmlinux.lds.S | 5 +++--
 arch/riscv/mm/init.c| 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)


Re: [GIT PULL] RISC-V Fixes for 5.9

2020-10-05 Thread Palmer Dabbelt

On Mon, 05 Oct 2020 00:16:32 PDT (-0700), Christoph Hellwig wrote:

On Fri, Oct 02, 2020 at 09:07:27AM -0700, Palmer Dabbelt wrote:

* The addition of a symbol export for clint_time_val, which has been inlined
  into some timex functions and can be used by drivers.


Err, haven't we just agreed on that this is a bad idea and jitterentropy
should not call get_cycles()?


Sorry, I hadn't seen that when I'd posted the PR.  It looks like there's a
jitterentropy fix in the works, I'll drop the export when that lands.  Probably
best to talk on that thread, though, as there's more context over there.


Re: [GIT PULL] RISC-V Fixes for 5.9

2020-10-05 Thread Christoph Hellwig
On Fri, Oct 02, 2020 at 09:07:27AM -0700, Palmer Dabbelt wrote:
> * The addition of a symbol export for clint_time_val, which has been inlined
>   into some timex functions and can be used by drivers.

Err, haven't we just agreed on that this is a bad idea and jitterentropy
should not call get_cycles()?


Re: [GIT PULL] RISC-V Fixes for 5.9

2020-10-02 Thread pr-tracker-bot
The pull request you sent on Fri, 02 Oct 2020 09:07:27 -0700 (PDT):

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

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

Thank you!

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


[GIT PULL] RISC-V Fixes for 5.9

2020-10-02 Thread Palmer Dabbelt
The following changes since commit a1b8638ba1320e6684aa98233c15255eb803fac7:

  Linux 5.9-rc7 (2020-09-27 14:38:10 -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-rc8

for you to fetch changes up to aa9887608e77b835d51f05a54940380391cd4e21:

  RISC-V: Check clint_time_val before use (2020-09-30 11:05:14 -0700)


RISC-V Fixes for 5.9

I have two fixes for this week:

* The addition of a symbol export for clint_time_val, which has been inlined
  into some timex functions and can be used by drivers.
* A fix to avoid calling get_cycles() before the timers have been probed.

These both only effect !MMU systems.


Anup Patel (1):
  RISC-V: Check clint_time_val before use

Palmer Dabbelt (1):
  clocksource: clint: Export clint_time_val for modules

 arch/riscv/include/asm/stackprotector.h |  4 
 arch/riscv/include/asm/timex.h  | 13 +
 drivers/clocksource/timer-clint.c   |  1 +
 3 files changed, 14 insertions(+), 4 deletions(-)


Re: [GIT PULL] RISC-V Fixes for 5.9-rc6 (or shortly after)

2020-09-20 Thread pr-tracker-bot
The pull request you sent on Sun, 20 Sep 2020 10:26:34 -0700 (PDT):

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

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

Thank you!

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


[GIT PULL] RISC-V Fixes for 5.9-rc6 (or shortly after)

2020-09-20 Thread Palmer Dabbelt
The following changes since commit d012a7190fc1fd72ed48911e77ca97ba4521bccd:

  Linux 5.9-rc2 (2020-08-23 14:08:43 -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-rc6

for you to fetch changes up to d5be89a8d118a8e8d09cd74a921a808f17fbdd09:

  RISC-V: Resurrect the MMIO timer implementation for M-mode systems 
(2020-09-19 13:21:11 -0700)


RISC-V Fixes for 5.9-rc6 (or shortly after)

* A fix for a lockdep issue to avoid an asserting triggering during early boot.
  There shouldn't be any incorrect behavior as the system isn't concurrent at
  the time.
* The addition of a missing fence when installing early fixmap mappings.
* A corretion to the K210 device tree's interrupt map.
* A fix for M-mode timer handling on the K210.

I know it's a it of an odd time, so if these don't make rc6 it's not a big
deal, but I thought I'd just send it out now rather that waiting as these are
ready to go.


Damien Le Moal (1):
  riscv: Fix Kendryte K210 device tree

Greentime Hu (1):
  riscv: Add sfence.vma after early page table changes

Palmer Dabbelt (2):
  RISC-V: Take text_mutex in ftrace_init_nop()
  RISC-V: Resurrect the MMIO timer implementation for M-mode systems

 arch/riscv/Kconfig |  1 +
 arch/riscv/boot/dts/kendryte/k210.dtsi |  6 --
 arch/riscv/include/asm/clint.h | 26 ++
 arch/riscv/include/asm/ftrace.h|  7 +++
 arch/riscv/include/asm/timex.h | 27 +++
 arch/riscv/kernel/ftrace.c | 19 +++
 arch/riscv/mm/init.c   |  7 +++
 drivers/clocksource/timer-clint.c  | 17 +
 8 files changed, 104 insertions(+), 6 deletions(-)
 create mode 100644 arch/riscv/include/asm/clint.h


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Anup Patel
On Fri, Sep 4, 2020 at 9:33 PM Christoph Hellwig  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  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


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Christoph Hellwig
On Fri, Sep 04, 2020 at 07:26:41PM +0530, Anup Patel wrote:
> On Fri, Sep 4, 2020 at 6:30 PM Christoph Hellwig  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.


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Anup Patel
On Fri, Sep 4, 2020 at 6:30 PM Christoph Hellwig  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


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Christoph Hellwig
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.


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Anup Patel
On Fri, Sep 4, 2020 at 3:16 PM Christoph Hellwig  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.00] 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.00] earlycon: uart8250 at MMIO 0x1000 (options
'115200n8')
[0.00] printk: bootconsole [uart8250] enabled
[0.00] Zone ranges:
[0.00]   DMA32[mem 0x8000-0x8fff]
[0.00]   Normal   empty
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x8000-0x8fff]
[0.00] Initmem setup node 0 [mem 0x8000-0x8fff]
[0.00] riscv: ISA extensions acdfimsu
[0.00] riscv: ELF capabilities acdfim
[0.00] percpu: max_distance=0x18000 too large for vmalloc space 0x0
[0.00] percpu: Embedded 12 pages/cpu s18592 r0 d30560 u49152
[0.00] Built 1 zonelists, mobility grouping on.  Total pages: 64640
[0.00] Kernel command line: root=/dev/vda rw
earlycon=uart8250,mmio,0x1000,115200n8 console=ttyS0
[0.00] Dentry cache hash table entries: 32768 (order: 6,
262144 bytes, linear)
[0.00] Inode-cache hash table entries: 16384 (order: 5, 131072
bytes, linear)
[0.00] Sorting __ex_table...
[0.00] mem auto-init: stack:off, heap alloc:off, heap free:off
[0.00] Memory: 256224K/262144K available (1283K kernel code,
138K rwdata, 200K rodata, 106K init, 133K bss, 5920K reserved, 0K
cma-reserved)
[0.00] rcu: Hierarchical RCU implementation.
[0.00] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
[0.00] rcu: RCU calculated value of scheduler-enlistment delay
is 25 jiffies.
[0.00] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[0.00] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[0.00] riscv-intc: 64 local interrupts mapped
[0.00] plic: plic@c00: mapped 53 interrupts with 2
handlers for 4 contexts.
[0.00] random: get_random_bytes called from 0x800019b4
with crng_init=0
[0.00] clint: clint@200: timer running at 1000 Hz
[0.00] clocksource: clint_clocksource: mask:
0x 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=4)
[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: 0x max_cycles:
0x, max_idle_ns: 764504178510 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] 1000.uart: ttyS0 at MMIO 0x1000 (irq = 2,
base_baud = 230400) is a 16550A
[0.381511] printk: console [ttyS0] 

Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Christoph Hellwig
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.00] 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.00] earlycon: uart8250 at MMIO 0x1000 (options
> '115200n8')
> [0.00] printk: bootconsole [uart8250] enabled
> [0.00] Zone ranges:
> [0.00]   DMA32[mem 0x8000-0x807f]
> [0.00]   Normal   empty
> [0.00] Movable zone start for each node
> [0.00] Early memory node ranges
> [0.00]   node   0: [mem 0x8000-0x807f]
> [0.00] Initmem setup node 0 [mem 
> 0x8000-0x807f]
> [0.00] riscv: ISA extensions acdfimsu
> [0.00] riscv: ELF capabilities acdfim
> [0.00] percpu: max_distance=0x3 too large for vmalloc space 0x0
> [0.00] percpu: Embedded 12 pages/cpu s18592 r0 d30560 u49152
> [0.00] Built 1 zonelists, mobility grouping off.  Total pages: 2020
> [0.00] Kernel command line: root=/dev/vda rw
> earlycon=uart8250,mmio,0x1000,115200n8 console=ttyS0
> [0.00] Dentry cache hash table entries: 1024 (order: 1, 8192
> bytes, linear)
> [0.00] Inode-cache hash table entries: 512 (order: 0, 4096
> bytes, linear)
> [0.00] Sorting __ex_table...
> [0.00] mem auto-init: stack:off, heap alloc:off, heap free:off
> [0.00] Memory: 6016K/8192K available (1283K kernel code, 138K
> rwdata, 200K rodata, 106K init, 133K bss, 2176K reserved, 0K
> cma-reserved)
> [0.00] rcu: Hierarchical RCU implementation.
> [0.00] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
> [0.00] rcu: RCU calculated value of scheduler-enlistment delay
> is 25 jiffies.
> [0.00] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
> [0.00] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
> [0.00] riscv-intc: 64 local interrupts mapped
> [0.00] plic: plic@c00: mapped 53 interrupts with 4
> handlers for 8 contexts.
> [0.00] random: get_random_bytes called from 0x800019b4
> with crng_init=0
> [0.00] clint: clint@200: timer running at 1000 Hz
> [0.00] clocksource: clint_clocksource: mask:
> 0x 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=4)
> [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: 0x max_cycles:
> 0x, max_idle_ns: 764504178510 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] 1000.uart: ttyS0 at MMIO 0x1000 (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] 

Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Anup Patel
On Fri, Sep 4, 2020 at 2:01 PM Christoph Hellwig  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  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.00] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
> [0.00] riscv-intc: 64 local interrupts mapped
> [0.00] plic: interrupt-controller@c00: mapped 53 interrupts with 
> 2 handlers for 4 contexts.
> [0.00] Oops - illegal instruction [#1]
> [0.00] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 
> 5.9.0-rc1-3-g2bc3fc877aa9c4 #609
> [0.00] epc: 8000de78 ra : 8000ddaa sp : 
> 80187f40
> [0.00]  gp : 801a3aa8 tp : 8018bd40 t0 : 
> 0019
> [0.00]  t1 : 0018 t2 : 0001 s0 : 
> 80187f80
> [0.00]  s1 : 0200 a0 : 8019b738 a1 : 
> 
> [0.00]  a2 : 80187f50 a3 :  a4 : 
> 
> [0.00]  a5 : 80169018 a6 :  a7 : 
> 01e4
> [0.00]  s2 : 801a40a8 s3 : 801a4068 s4 : 
> 8fc7c040
> [0.00]  s5 : 801a4038 s6 : 801a4030 s7 : 
> 80012da0
> [0.00]  s8 :  s9 :  s10: 
> 
> [0.00]  s11:  t3 : 801c40d8 t4 : 
> 0068
> [0.00]  t5 : 004c t6 : 0033
> [0.00] status: 1800 badaddr:  cause: 
> 0002
> [0.00] random: get_random_bytes called from 0x800210c4 with 
> crng_init=0
> [0.00] ---[ end trace  ]---
> [0.00] Kernel panic - not syncing: Attempted to kill the idle task!
> [0.00] ---[ 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.00] 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.00] earlycon: uart8250 at MMIO 0x1000 (options
'115200n8')
[0.00] printk: bootconsole [uart8250] enabled
[0.00] Zone ranges:
[0.00]   DMA32[mem 0x8000-0x807f]
[0.00]   Normal   empty
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x8000-0x807f]
[0.00] Initmem setup node 0 [mem 0x8000-0x807f]
[0.00] riscv: ISA extensions acdfimsu
[0.00] riscv: ELF capabilities acdfim
[0.00] percpu: max_distance=0x3 too large for vmalloc space 0x0
[0.00] percpu: Embedded 12 pages/cpu s18592 r0 d30560 u49152
[0.00] Built 1 zonelists, mobility grouping off.  Total pages: 2020
[0.00] Kernel command line: root=/dev/vda rw
earlycon=uart8250,mmio,0x1000,115200n8 console=ttyS0
[0.00] Dentry cache hash table entries: 1024 (order: 1, 8192
bytes, linear)
[0.00] Inode-cache hash table entries: 512 (order: 0, 4096
bytes, linear)
[0.00] Sorting __ex_table...
[0.00] mem auto-init: stack:off, heap alloc:off, heap free:off
[0.00] Memory: 6016K/8192K available (1283K kernel code, 138K
rwdata, 200K rodata, 106K init, 133K bss, 2176K reserved, 0K
cma-reserved)
[0.00] rcu: Hierarchical RCU implementation.
[0.00] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[0.00] rcu: RCU calculated value of scheduler-enlistment delay
is 25 jiffies.
[0.00] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[0.00] NR_IRQS: 

Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-09-04 Thread Christoph Hellwig
On Fri, Aug 21, 2020 at 12:35:20PM -0700, Linus Torvalds wrote:
> On Fri, Aug 21, 2020 at 11:26 AM Palmer Dabbelt  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.00] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[0.00] riscv-intc: 64 local interrupts mapped
[0.00] plic: interrupt-controller@c00: mapped 53 interrupts with 2 
handlers for 4 contexts.
[0.00] Oops - illegal instruction [#1]
[0.00] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 
5.9.0-rc1-3-g2bc3fc877aa9c4 #609
[0.00] epc: 8000de78 ra : 8000ddaa sp : 80187f40
[0.00]  gp : 801a3aa8 tp : 8018bd40 t0 : 
0019
[0.00]  t1 : 0018 t2 : 0001 s0 : 
80187f80
[0.00]  s1 : 0200 a0 : 8019b738 a1 : 

[0.00]  a2 : 80187f50 a3 :  a4 : 

[0.00]  a5 : 80169018 a6 :  a7 : 
01e4
[0.00]  s2 : 801a40a8 s3 : 801a4068 s4 : 
8fc7c040
[0.00]  s5 : 801a4038 s6 : 801a4030 s7 : 
80012da0
[0.00]  s8 :  s9 :  s10: 

[0.00]  s11:  t3 : 801c40d8 t4 : 
0068
[0.00]  t5 : 004c t6 : 0033
[0.00] status: 1800 badaddr:  cause: 
0002
[0.00] random: get_random_bytes called from 0x800210c4 with 
crng_init=0
[0.00] ---[ end trace  ]---
[0.00] Kernel panic - not syncing: Attempted to kill the idle task!
[0.00] ---[ end Kernel panic - not syncing: Attempted to kill the idle 
task! ]---


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-08-21 Thread pr-tracker-bot
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


Re: [GIT PULL] RISC-V Fixes for 5.9-rc2

2020-08-21 Thread Linus Torvalds
On Fri, Aug 21, 2020 at 11:26 AM Palmer Dabbelt  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


[GIT PULL] RISC-V Fixes for 5.9-rc2

2020-08-21 Thread Palmer Dabbelt
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