Skip to content

Commit 35ab408

Browse files
committed
gem5: set kvm cpu type for arm
1 parent d6905e2 commit 35ab408

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

run

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ def main(args, extra_args=None):
185185
cmd.extend(['--cpu-type', 'X86KvmCPU', common.Newline])
186186
cmd.extend(['--command-line', 'earlyprintk={} lpj=7999923 root=/dev/sda {}'.format(console, kernel_cli), common.Newline])
187187
elif common.is_arm:
188+
if args.kvm:
189+
cmd.extend(['--cpu-type', 'ArmV8KvmCPU', common.Newline])
188190
# TODO why is it mandatory to pass mem= here? Not true for QEMU.
189191
# Anything smaller than physical blows up as expected, but why can't it auto-detect the right value?
190192
cmd.extend([
@@ -202,13 +204,17 @@ def main(args, extra_args=None):
202204
cmd.extend(['--param', 'system.highest_el_is_64 = True', common.Newline])
203205
cmd.extend(['--param', 'system.auto_reset_addr = True', common.Newline])
204206
elif args.gem5_script == 'biglittle':
207+
if args.kvm:
208+
cpu_type = 'kvm'
209+
else:
210+
cpu_type = 'atomic'
205211
if args.gem5_restore is not None:
206212
cpt_dir = common.gem_list_checkpoint_dirs()[-args.gem5_restore]
207213
extra_emulator_args.extend(['--restore-from', os.path.join(common.m5out_dir, cpt_dir)])
208214
cmd.extend([
209215
os.path.join(common.gem5_src_dir, 'configs', 'example', 'arm', 'fs_bigLITTLE.py'), common.Newline,
210216
'--big-cpus', '2', common.Newline,
211-
'--cpu-type', 'atomic', common.Newline,
217+
'--cpu-type', cpu_type, common.Newline,
212218
'--disk', common.disk_image, common.Newline,
213219
'--dtb', os.path.join(common.gem5_system_dir, 'arm', 'dt', 'armv8_gem5_v1_big_little_2_2.dtb'), common.Newline,
214220
'--kernel', common.image, common.Newline,

0 commit comments

Comments
 (0)