OSDN Git Service

hw: intc: Use cpu_by_arch_id to fetch CPU state
authorMayuresh Chitale <mchitale@ventanamicro.com>
Fri, 3 Mar 2023 06:50:55 +0000 (12:20 +0530)
committerPalmer Dabbelt <palmer@rivosinc.com>
Sun, 5 Mar 2023 23:33:40 +0000 (15:33 -0800)
commit64452a09c5e37853b4f0a777805831fb87fb2c23
treea2dd0e10af8d99b5a5c49b769d7b2c8b62cb6e54
parentf1bd6f8ef6a47de7c10c8d94f526cc10b7d25c4d
hw: intc: Use cpu_by_arch_id to fetch CPU state

Qemu_get_cpu uses the logical CPU id assigned during init to fetch the
CPU state. However APLIC, IMSIC and ACLINT contain registers and states
which are specific to physical hart Ids. The hart Ids in any given system
might be sparse and hence calls to qemu_get_cpu need to be replaced by
cpu_by_arch_id which performs lookup based on the sparse physical hart IDs.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230303065055.915652-3-mchitale@ventanamicro.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
hw/intc/riscv_aclint.c
hw/intc/riscv_aplic.c
hw/intc/riscv_imsic.c