[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] target/riscv: select KVM AIA in riscv virt machine
From: |
Yong-Xuan Wang |
Subject: |
[PATCH 6/6] target/riscv: select KVM AIA in riscv virt machine |
Date: |
Mon, 24 Apr 2023 09:07:08 +0000 |
Select KVM AIA when the host kernel has in-kernel AIA chip support.
Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Reviewed-by: Jim Shu <jim.shu@sifive.com>
---
hw/riscv/virt.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 18aede7b23..908b304991 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -35,6 +35,7 @@
#include "hw/riscv/virt.h"
#include "hw/riscv/boot.h"
#include "hw/riscv/numa.h"
+#include "kvm_riscv.h"
#include "hw/intc/riscv_aclint.h"
#include "hw/intc/riscv_aplic.h"
#include "hw/intc/riscv_imsic.h"
@@ -1215,6 +1216,15 @@ static DeviceState *virt_create_aia(RISCVVirtAIAType
aia_type, int aia_guests,
msimode, false, aplic_m);
}
+ if (kvm_irqchip_in_kernel()) {
+ kvm_riscv_aia_create(
+ aplic_s, msimode, socket,
+ VIRT_IRQCHIP_NUM_SOURCES,
+ hart_count,
+ memmap[VIRT_APLIC_S].base + socket * memmap[VIRT_APLIC_S].size,
+ memmap[VIRT_IMSIC_S].base + socket * VIRT_IMSIC_GROUP_MAX_SIZE);
+ }
+
return kvm_enabled() ? aplic_s : aplic_m;
}
--
2.17.1
- [PATCH 0/6] Add RISC-V KVM AIA Support, Yong-Xuan Wang, 2023/04/24
- [PATCH 1/6] update-linux-headers: sync-up header with Linux for KVM AIA support, Yong-Xuan Wang, 2023/04/24
- [PATCH 2/6] target/riscv: support the AIA device emulateion with KVM enabled, Yong-Xuan Wang, 2023/04/24
- [PATCH 3/6] target/riscv: check the in-kernel irqchip support, Yong-Xuan Wang, 2023/04/24
- [PATCH 4/6] target/riscv: Create an KVM AIA irqchip, Yong-Xuan Wang, 2023/04/24
- [PATCH 5/6] target/riscv: update APLIC and IMSIC to support KVM AIA, Yong-Xuan Wang, 2023/04/24
- [PATCH 6/6] target/riscv: select KVM AIA in riscv virt machine,
Yong-Xuan Wang <=
- Re: [PATCH 0/6] Add RISC-V KVM AIA Support, Daniel Henrique Barboza, 2023/04/27