kvm, arm: Add parameter to force simulation of Gicv2
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 29 Oct 2020 19:03:45 +0000 (19:03 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 2 Nov 2020 08:50:36 +0000 (08:50 +0000)
By setting simulate_gic to True it will be possible to prevent
the simulation from using the host interrupt controller

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I7c7df798e07bfaddbc2f1e7dd981b6aff621a9d1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36795
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Hsuan Hsu <kugwa2000@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/kvm/KvmGic.py
src/arch/arm/kvm/gic.cc

index 9796908ddb80a73862f34dfda03c759a5e347b70..ce85ecb0bd3a78437f742d755ccfc8f032325743 100644 (file)
@@ -41,3 +41,6 @@ from m5.objects.Gic import GicV2
 class MuxingKvmGic(GicV2):
     type = 'MuxingKvmGic'
     cxx_header = "arch/arm/kvm/gic.hh"
+
+    simulate_gic = Param.Bool(False,
+        "Forcing the simulation to use the gem5 GIC instead of the host GIC")
index 67678335244666a7ad0703dfba8fc0c1928826aa..feb764f8d65852eb85a3ff8b95758dadd410f780 100644 (file)
@@ -170,7 +170,8 @@ MuxingKvmGic::MuxingKvmGic(const MuxingKvmGicParams &p)
       kernelGic(nullptr),
       usingKvm(false)
 {
-    if (auto vm = system.getKvmVM()) {
+    auto vm = system.getKvmVM();
+    if (vm && !p.simulate_gic) {
         kernelGic = new KvmKernelGicV2(*vm, p.cpu_addr, p.dist_addr,
                                        p.it_lines);
     }