hw/intc/loongarch_extioi: Add dynamic cpu number support
commit10a8f7d25a26e7b3b2886d2552738118d1adf371
authorBibo Mao <maobibo@loongson.cn>
Fri, 15 Dec 2023 03:07:36 +0000 (15 11:07 +0800)
committerSong Gao <gaosong@loongson.cn>
Thu, 11 Jan 2024 11:22:47 +0000 (11 19:22 +0800)
tree7e57d73afd3fed5b6984cc50a7ec4d0c2e92cfbf
parent5e90b8db382418165a4295fbe4ae9cc45b22d6ea
hw/intc/loongarch_extioi: Add dynamic cpu number support

On LoongArch physical machine, one extioi interrupt controller only
supports 4 cpus. With processor more than 4 cpus, there are multiple
extioi interrupt controllers; if interrupts need to be routed to
other cpus, they are forwarded from extioi node0 to other extioi nodes.

On virt machine model, there is simple extioi interrupt device model.
All cpus can access register of extioi interrupt controller, however
interrupt can only be route to 4 vcpu for compatible with old kernel.

This patch adds dynamic cpu number support about extioi interrupt.
With old kernel legacy extioi model is used, however kernel can detect
and choose new route method in future, so that interrupt can be routed to
all vcpus.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20231215100333.3933632-4-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
hw/intc/loongarch_extioi.c
hw/loongarch/virt.c
include/hw/intc/loongarch_extioi.h