Re: [Qemu-devel] [PATCH] target/riscv/pmp.c: pmpcfg_csr_read returns bogus value on RV64

2018-10-29 Thread Palmer Dabbelt
On Sat, 27 Oct 2018 01:42:02 PDT (-0700), alistai...@gmail.com wrote: On Fri, Oct 26, 2018 at 7:14 PM Dayeol Lee wrote: Hi, I submitted the patch, but just found this has been already fixed by Michael Clark and pushed to riscv/riscv-qemu https://github.com/riscv/riscv-qemu/pull/166 but not

Re: [Qemu-devel] [PATCH] target/riscv/pmp.c: pmpcfg_csr_read returns bogus value on RV64

2018-10-27 Thread Alistair Francis
On Fri, Oct 26, 2018 at 7:14 PM Dayeol Lee wrote: > > Hi, > > I submitted the patch, but just found this has been already fixed by > Michael Clark > and pushed to riscv/riscv-qemu https://github.com/riscv/riscv-qemu/pull/166 > but not in the upstream. > > Do we still need this patch? Yeah, this

Re: [Qemu-devel] [PATCH] target/riscv/pmp.c: pmpcfg_csr_read returns bogus value on RV64

2018-10-26 Thread Dayeol Lee
Hi, I submitted the patch, but just found this has been already fixed by Michael Clark and pushed to riscv/riscv-qemu https://github.com/riscv/riscv-qemu/pull/166 but not in the upstream. Do we still need this patch? Thanks, Dayeol On Fri, Oct 26, 2018 at 11:04 AM Dayeol Lee wrote: >

[Qemu-devel] [PATCH] target/riscv/pmp.c: pmpcfg_csr_read returns bogus value on RV64

2018-10-26 Thread Dayeol Lee
pmp_read_cfg() returns 8-bit value, which is combined together to form a single pmpcfg CSR. The default promotion rules will result in an integer here ("i*8" is integer, which flows through) resulting in a 32-bit signed value on most hosts. That's bogus on RV64I, with the high bits of the CSR