]> git.proxmox.com Git - mirror_qemu.git/commit - hw/riscv/sifive_clint.c
RISC-V: Fix CLINT timecmp low 32-bit writes
authorMichael Clark <mjc@sifive.com>
Fri, 14 Dec 2018 00:18:39 +0000 (00:18 +0000)
committerPalmer Dabbelt <palmer@sifive.com>
Thu, 20 Dec 2018 20:08:43 +0000 (12:08 -0800)
commitef9e41df680a494dec92fe8d166cb2bc531b29a4
treeeead798d0216809c942f854006fc22f1d10dd72b
parent9543fdaf223aac0313638752abfb3d6c2cf2169c
RISC-V: Fix CLINT timecmp low 32-bit writes

A missing shift made updates to the low order bits
of timecmp erroneously copy the old low order bits
into the high order bits of the 64-bit timecmp
register. Add the missing shift and rename timecmp
local variables to timecmp_hi and timecmp_lo.

This bug didn't show up as the low order bits are
usually written first followed by the high order
bits meaning the high order bits contained an invalid
value between the timecmp_lo and timecmp_hi update.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Co-Authored-by: Johannes Haring <johannes.haring@gmx.net>
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
hw/riscv/sifive_clint.c