From 6d678694d0cc59c27c30585ed6457f7f73701e74 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 29 Oct 2020 19:03:45 +0000 Subject: [PATCH] kvm, arm: Add parameter to force simulation of Gicv2 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 Change-Id: I7c7df798e07bfaddbc2f1e7dd981b6aff621a9d1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36795 Reviewed-by: Andreas Sandberg Reviewed-by: Hsuan Hsu Maintainer: Andreas Sandberg Tested-by: kokoro --- src/arch/arm/kvm/KvmGic.py | 3 +++ src/arch/arm/kvm/gic.cc | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/arch/arm/kvm/KvmGic.py b/src/arch/arm/kvm/KvmGic.py index 9796908dd..ce85ecb0b 100644 --- a/src/arch/arm/kvm/KvmGic.py +++ b/src/arch/arm/kvm/KvmGic.py @@ -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") diff --git a/src/arch/arm/kvm/gic.cc b/src/arch/arm/kvm/gic.cc index 676783352..feb764f8d 100644 --- a/src/arch/arm/kvm/gic.cc +++ b/src/arch/arm/kvm/gic.cc @@ -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); } -- 2.30.2