hw/intc/loongarch_extioi: Add extioi virt extension definition
commitdc6f37eb957b2888fea78bda9da0cf0840dd795f
authorSong Gao <gaosong@loongson.cn>
Tue, 28 May 2024 08:38:53 +0000 (28 16:38 +0800)
committerSong Gao <gaosong@loongson.cn>
Thu, 6 Jun 2024 03:56:45 +0000 (6 11:56 +0800)
tree21963ef18289310c7465d76d4ab39d6b72fe4aa7
parenta73f7a00eea15c75fe9cfbeeaff5228f5ee24b61
hw/intc/loongarch_extioi: Add extioi virt extension definition

On LoongArch, IRQs can be routed to four vcpus with hardware extended
IRQ model. This patch adds the virt extension definition so that
the IRQ can route to 256 vcpus.

    1.Extended IRQ model:
                                    |
    +-----------+     +-------------|--------+     +-----------+
    | IPI/Timer | --> | CPUINTC(0-3)|(4-255) | <-- | IPI/Timer |
    +-----------+     +-------------|--------+     +-----------+
                            ^       |
                            |
                       +---------+
                       | EIOINTC |
                       +---------+
                        ^       ^
                        |       |
                 +---------+ +---------+
                 | PCH-PIC | | PCH-MSI |
                 +---------+ +---------+
                   ^      ^          ^
                   |      |          |
            +--------+ +---------+ +---------+
            | UARTs  | | Devices | | Devices |
            +--------+ +---------+ +---------+

    2.Virt extended IRQ model:

      +-----+    +---------------+     +-------+
      | IPI |--> | CPUINTC(0-255)| <-- | Timer |
      +-----+    +---------------+     +-------+
                        ^
                        |
                  +-----------+
                  | V-EIOINTC |
                  +-----------+
                   ^         ^
                   |         |
            +---------+ +---------+
            | PCH-PIC | | PCH-MSI |
            +---------+ +---------+
              ^      ^          ^
              |      |          |
       +--------+ +---------+ +---------+
       | UARTs  | | Devices | | Devices |
       +--------+ +---------+ +---------+

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