Re: [Qemu-devel] [PATCH] hw/riscv/sifive_clint.c: avoid integer overflow in timecmp write

2019-02-13 Thread Palmer Dabbelt
On Fri, 08 Feb 2019 10:41:17 PST (-0800), alistai...@gmail.com wrote: On Thu, Feb 7, 2019 at 2:08 AM Fabien Chouteau wrote: Hello Alistair, On 07/02/2019 01:42, Alistair Francis wrote:> > Can you describe what this fixes? > I encountered this problem when I tried to write 0x

Re: [Qemu-devel] [PATCH] hw/riscv/sifive_clint.c: avoid integer overflow in timecmp write

2019-02-08 Thread Alistair Francis
On Thu, Feb 7, 2019 at 2:08 AM Fabien Chouteau wrote: > > Hello Alistair, > > On 07/02/2019 01:42, Alistair Francis wrote:> > > Can you describe what this fixes? > > > > I encountered this problem when I tried to write 0x in > timecmp. > > With the integer overflow in QEMU, writin

Re: [Qemu-devel] [PATCH] hw/riscv/sifive_clint.c: avoid integer overflow in timecmp write

2019-02-07 Thread Fabien Chouteau
Hello Alistair, On 07/02/2019 01:42, Alistair Francis wrote:> > Can you describe what this fixes? > I encountered this problem when I tried to write 0x in timecmp. With the integer overflow in QEMU, writing this value means that the QEMU timer will be set in the past. > Won't

Re: [Qemu-devel] [PATCH] hw/riscv/sifive_clint.c: avoid integer overflow in timecmp write

2019-02-06 Thread Alistair Francis
On Wed, Jan 30, 2019 at 10:53 AM Fabien Chouteau wrote: > > Writing a high value in timecmp leads to an integer overflow. This patch > modifies the code to detect such case, and use the maximum integer value > as the next trigger for the timer. > > Signed-off-by: Fabien Chouteau > --- > hw/riscv

[Qemu-devel] [PATCH] hw/riscv/sifive_clint.c: avoid integer overflow in timecmp write

2019-01-30 Thread Fabien Chouteau
Writing a high value in timecmp leads to an integer overflow. This patch modifies the code to detect such case, and use the maximum integer value as the next trigger for the timer. Signed-off-by: Fabien Chouteau --- hw/riscv/sifive_clint.c | 31 ++- 1 file changed, 26