target/riscv/kvm: Fix the group bit setting of AIA
authorAndrew Jones <ajones@ventanamicro.com>
Wed, 21 Aug 2024 07:50:41 +0000 (09:50 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 2 Oct 2024 05:11:51 +0000 (15:11 +1000)
commite92ba091c147b0ab68e05fde031b97989fae469f
tree9a2777cf16709ac4a0538b75058cbeb19b8f00a4
parent06fb3bda6aadeb190be09a1513f1f0d31d119d16
target/riscv/kvm: Fix the group bit setting of AIA

Just as the hart bit setting of the AIA should be calculated as
ceil(log2(max_hart_id + 1)) the group bit setting should be
calculated as ceil(log2(max_group_id + 1)). The hart bits are
implemented by passing max_hart_id to find_last_bit() and adding
one to the result. Do the same for the group bit setting.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20240821075040.498945-2-ajones@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/kvm/kvm-cpu.c