Commit 35b8310a authored by Antoine Kaufmann's avatar Antoine Kaufmann Committed by Antoine Kaufmann
Browse files

experiments: support appending to kcmdline from node config

parent 90cee729
...@@ -82,6 +82,8 @@ class NodeConfig(): ...@@ -82,6 +82,8 @@ class NodeConfig():
"""Do not make checkpoint in Gem5.""" """Do not make checkpoint in Gem5."""
self.app: tp.Optional[AppConfig] = None self.app: tp.Optional[AppConfig] = None
"""Application to run on simulated host.""" """Application to run on simulated host."""
self.kcmd_append = ''
"""String to be appended to kernel command line."""
def config_str(self) -> str: def config_str(self) -> str:
if self.sim == 'qemu': if self.sim == 'qemu':
......
...@@ -287,6 +287,11 @@ class QemuHost(HostSim): ...@@ -287,6 +287,11 @@ class QemuHost(HostSim):
def run_cmd(self, env): def run_cmd(self, env):
accel = ',accel=kvm:tcg' if not self.sync else '' accel = ',accel=kvm:tcg' if not self.sync else ''
if self.node_config.kcmd_append:
kcmd_append = ' ' + self.node_config.kcmd_append
else:
kcmd_append = ''
cmd = ( cmd = (
f'{env.qemu_path} -machine q35{accel} -serial mon:stdio ' f'{env.qemu_path} -machine q35{accel} -serial mon:stdio '
'-cpu Skylake-Server -display none -nic none ' '-cpu Skylake-Server -display none -nic none '
...@@ -295,7 +300,7 @@ class QemuHost(HostSim): ...@@ -295,7 +300,7 @@ class QemuHost(HostSim):
f'-drive file={env.cfgtar_path(self)},if=ide,index=1,media=disk,' f'-drive file={env.cfgtar_path(self)},if=ide,index=1,media=disk,'
'driver=raw ' 'driver=raw '
'-append "earlyprintk=ttyS0 console=ttyS0 root=/dev/sda1 ' '-append "earlyprintk=ttyS0 console=ttyS0 root=/dev/sda1 '
'init=/home/ubuntu/guestinit.sh rw" ' f'init=/home/ubuntu/guestinit.sh rw{kcmd_append}" '
f'-m {self.node_config.memory} -smp {self.node_config.cores} ' f'-m {self.node_config.memory} -smp {self.node_config.cores} '
) )
...@@ -371,6 +376,9 @@ class Gem5Host(HostSim): ...@@ -371,6 +376,9 @@ class Gem5Host(HostSim):
'--ddio-enabled --ddio-way-part=8 --mem-type=DDR4_2400_16x4 ' '--ddio-enabled --ddio-way-part=8 --mem-type=DDR4_2400_16x4 '
) )
if self.node_config.kcmd_append:
cmd += f'--command-line-append="{self.node_config.kcmd_append}" '
if env.create_cp: if env.create_cp:
cmd += '--max-checkpoints=1 ' cmd += '--max-checkpoints=1 '
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment