From 6f843a918b08c6f74054e5126f8dcf09adcfd319 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 5 Nov 2021 08:00:30 -0700 Subject: [PATCH] sim,configs: Default m5ops_base to 0 (disabled) on x86. This is already the default for other platforms. This is most important when using KVM, where this mechanism is the only way to trigger pseudo instructions, or in SE mode to also trigger system calls. Change-Id: I0094e6814898ba397c7425e0fe76d84853bb17ad Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52498 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- configs/common/FSConfig.py | 2 ++ configs/example/apu_se.py | 1 + configs/example/se.py | 1 + src/python/gem5/components/boards/x86_board.py | 2 ++ src/sim/System.py | 6 ++---- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py index 8b8fb4e649..a7ba815268 100644 --- a/configs/common/FSConfig.py +++ b/configs/common/FSConfig.py @@ -445,6 +445,8 @@ def connectX86RubySystem(x86_sys): def makeX86System(mem_mode, numCPUs=1, mdesc=None, workload=None, Ruby=False): self = System() + self.m5ops_base = 0xffff0000 + if workload is None: workload = X86FsWorkload() self.workload = workload diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py index 882d181062..532fb981f2 100644 --- a/configs/example/apu_se.py +++ b/configs/example/apu_se.py @@ -544,6 +544,7 @@ if fast_forward: have_kvm_support = 'BaseKvmCPU' in globals() if have_kvm_support and buildEnv['TARGET_ISA'] == "x86": system.vm = KvmVM() + system.m5ops_base = 0xffff0000 for i in range(len(host_cpu.workload)): host_cpu.workload[i].useArchPT = True host_cpu.workload[i].kvmInSE = True diff --git a/configs/example/se.py b/configs/example/se.py index a3b5cb9f30..3a8203da2e 100644 --- a/configs/example/se.py +++ b/configs/example/se.py @@ -200,6 +200,7 @@ for cpu in system.cpu: if ObjectList.is_kvm_cpu(CPUClass) or ObjectList.is_kvm_cpu(FutureClass): if buildEnv['TARGET_ISA'] == 'x86': system.kvm_vm = KvmVM() + system.m5ops_base = 0xffff0000 for process in multiprocesses: process.useArchPT = True process.kvmInSE = True diff --git a/src/python/gem5/components/boards/x86_board.py b/src/python/gem5/components/boards/x86_board.py index 6f53001eac..f777392390 100644 --- a/src/python/gem5/components/boards/x86_board.py +++ b/src/python/gem5/components/boards/x86_board.py @@ -99,6 +99,8 @@ class X86Board(AbstractBoard, KernelDiskWorkload): # Set up all of the I/O. self._setup_io_devices() + self.m5ops_base = 0xffff0000 + def _setup_io_devices(self): """ Sets up the x86 IO devices. diff --git a/src/sim/System.py b/src/sim/System.py index 596e25cc70..c5b7a8208b 100644 --- a/src/sim/System.py +++ b/src/sim/System.py @@ -124,10 +124,8 @@ class System(SimObject): # SE mode doesn't use the ISA System subclasses, and so we need to set an # ISA specific value in this class directly. - m5ops_base = Param.Addr( - 0xffff0000 if buildEnv['TARGET_ISA'] == 'x86' else 0, - "Base of the 64KiB PA range used for memory-mapped m5ops. Set to 0 " - "to disable.") + m5ops_base = Param.Addr(0, "Base of the 64KiB PA range used for " + "memory-mapped m5ops. Set to 0 to disable.") if buildEnv['USE_KVM']: kvm_vm = Param.KvmVM(NULL, 'KVM VM (i.e., shared memory domain)')