1.. _riscv-aia: 2 3RISC-V AIA support for RISC-V machines 4====================================== 5 6AIA (Advanced Interrupt Architecture) support is implemented in the ``virt`` 7RISC-V machine for TCG and KVM accelerators. 8 9The support consists of two main modes: 10 11- "aia=aplic": adds one or more APLIC (Advanced Platform Level Interrupt Controller) 12 devices 13- "aia=aplic-imsic": adds one or more APLIC device and an IMSIC (Incoming MSI 14 Controller) device for each CPU 15 16From an user standpoint, these modes will behave the same regardless of the accelerator 17used. From a developer standpoint the accelerator settings will change what it being 18emulated in userspace versus what is being emulated by an in-kernel irqchip. 19 20When running TCG, all controllers are emulated in userspace, including machine mode 21(m-mode) APLIC and IMSIC (when applicable). 22 23When running KVM: 24 25- no m-mode is provided, so there is no m-mode APLIC or IMSIC emulation regardless of 26 the AIA mode chosen 27- with "aia=aplic", s-mode APLIC will be emulated by userspace 28- with "aia=aplic-imsic" there are two possibilities. If no additional KVM option 29 is provided there will be no APLIC or IMSIC emulation in userspace, and the virtual 30 machine will use the provided in-kernel APLIC and IMSIC controllers. If the user 31 chooses to use the irqchip in split mode via "-accel kvm,kernel-irqchip=split", 32 s-mode APLIC will be emulated while using the s-mode IMSIC from the irqchip 33 34The following table summarizes how the AIA and accelerator options defines what 35we will emulate in userspace: 36 37 38.. list-table:: How AIA and accel options changes controller emulation 39 :widths: 25 25 25 25 25 25 25 40 :header-rows: 1 41 42 * - Accel 43 - Accel props 44 - AIA type 45 - APLIC m-mode 46 - IMSIC m-mode 47 - APLIC s-mode 48 - IMSIC s-mode 49 * - tcg 50 - --- 51 - aplic 52 - emul 53 - n/a 54 - emul 55 - n/a 56 * - tcg 57 - --- 58 - aplic-imsic 59 - emul 60 - emul 61 - emul 62 - emul 63 * - kvm 64 - --- 65 - aplic 66 - n/a 67 - n/a 68 - emul 69 - n/a 70 * - kvm 71 - none 72 - aplic-imsic 73 - n/a 74 - n/a 75 - in-kernel 76 - in-kernel 77 * - kvm 78 - irqchip=split 79 - aplic-imsic 80 - n/a 81 - n/a 82 - emul 83 - in-kernel 84