mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/intc/riscv_aplic: add kvm_msicfgaddr for split mode aplic-imsic
The last step to enable KVM AIA aplic-imsic with irqchip in split mode is to deal with how MSIs are going to be sent. In our current design we don't allow an APLIC controller to send MSIs unless it's on m-mode. And we also do not allow Supervisor MSI address configuration via the 'smsiaddrcfg' and 'smsiaddrcfgh' registers unless it's also a m-mode APLIC controller. Add a new RISCVACPLICState attribute called 'kvm_msicfgaddr'. This attribute represents the base configuration address for MSIs, in our case the base addr of the IMSIC controller. This attribute is being set only when running irqchip_split() mode with aia=aplic-imsic. During riscv_aplic_msi_send() we'll check if the attribute was set to skip the check for a m-mode APLIC controller and to change the resulting MSI addr by adding kvm_msicfgaddr right before address_space_stl_le(). Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20241119191706.718860-7-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
b319ef15b8
commit
e0c87e3067
3 changed files with 44 additions and 10 deletions
|
@ -1300,7 +1300,7 @@ static DeviceState *virt_create_aia(RISCVVirtAIAType aia_type, int aia_guests,
|
|||
int base_hartid, int hart_count)
|
||||
{
|
||||
int i;
|
||||
hwaddr addr;
|
||||
hwaddr addr = 0;
|
||||
uint32_t guest_bits;
|
||||
DeviceState *aplic_s = NULL;
|
||||
DeviceState *aplic_m = NULL;
|
||||
|
@ -1350,6 +1350,10 @@ static DeviceState *virt_create_aia(RISCVVirtAIAType aia_type, int aia_guests,
|
|||
VIRT_IRQCHIP_NUM_PRIO_BITS,
|
||||
msimode, false, aplic_m);
|
||||
|
||||
if (kvm_enabled() && msimode) {
|
||||
riscv_aplic_set_kvm_msicfgaddr(RISCV_APLIC(aplic_s), addr);
|
||||
}
|
||||
|
||||
return kvm_enabled() ? aplic_s : aplic_m;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue