aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Dooley <conor.dooley@microchip.com>2023-04-04 18:33:34 +0100
committerAlistair Francis <alistair.francis@wdc.com>2023-05-05 10:49:50 +1000
commit48249c023d4fd7931f65cd13341cdef1c72bab45 (patch)
treefd7a4381f1e3d78729c8d888621d9e4521638e44
parent4f2493146d783d71c5dc6e72452f80b86641ba7f (diff)
downloadqemu-48249c023d4fd7931f65cd13341cdef1c72bab45.zip
qemu-48249c023d4fd7931f65cd13341cdef1c72bab45.tar.gz
qemu-48249c023d4fd7931f65cd13341cdef1c72bab45.tar.bz2
target/riscv: fix invalid riscv,event-to-mhpmcounters entry
dt-validate complains: > soc: pmu: {'riscv,event-to-mhpmcounters': > [[1, 1, 524281], [2, 2, 524284], [65561, 65561, 524280], > [65563, 65563, 524280], [65569, 65569, 524280], [0, 0, 0], [0, 0]], > pmu: riscv,event-to-mhpmcounters:6: [0, 0] is too short There are bogus 0 entries added at the end, of which one is of insufficient length. This happens because only 15 of fdt_event_ctr_map[]'s 20 elements are populated & qemu_fdt_setprop() is called using the size of the array. Reduce the array to 15 elements to make the error go away. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20230404173333.35179-1-conor@kernel.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
-rw-r--r--target/riscv/pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/riscv/pmu.c b/target/riscv/pmu.c
index 22e2283..96ce2db 100644
--- a/target/riscv/pmu.c
+++ b/target/riscv/pmu.c
@@ -35,7 +35,7 @@
*/
void riscv_pmu_generate_fdt_node(void *fdt, int num_ctrs, char *pmu_name)
{
- uint32_t fdt_event_ctr_map[20] = {};
+ uint32_t fdt_event_ctr_map[15] = {};
uint32_t cmask;
/* All the programmable counters can map to any event */