Message ID | 20230119135424.5417-12-farosas@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | target/arm: Allow CONFIG_TCG=n builds | expand |
On 1/19/23 03:54, Fabiano Rosas wrote: > + cpu_map = ( > + ('aarch64', 'cortex-a57'), > + ) This isn't a map... > + for suffix, cpu in cpu_map: > + if self.qemu_prog.endswith(f'qemu-system-{suffix}'): > + self.qemu_options += f' -cpu {cpu}' ... which causes you to use a loop here, instead of a map lookup. Also, not keen on cortex-a57 vs max, again. You want something like cpu_map = { 'aarch64': 'max' } m = re.match('qemu-system-(.*)', self.qemu_prog) if m and m.group(1) in cpu_map: self.qemu_options += ' -cpu ' + cpu_map[m.group(1)] My python is rough, so take that with a lot of testing... r~
Richard Henderson <richard.henderson@linaro.org> writes: > On 1/19/23 03:54, Fabiano Rosas wrote: >> + cpu_map = ( >> + ('aarch64', 'cortex-a57'), >> + ) > > This isn't a map... Right, a dict would be more suitable here. I had just copied the code from machine_map a few lines above.
diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index a864c74b12..4bb80ea656 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -244,6 +244,13 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: str, if self.qemu_prog.endswith(f'qemu-system-{suffix}'): self.qemu_options += f' -machine {machine}' + cpu_map = ( + ('aarch64', 'cortex-a57'), + ) + for suffix, cpu in cpu_map: + if self.qemu_prog.endswith(f'qemu-system-{suffix}'): + self.qemu_options += f' -cpu {cpu}' + # QEMU_DEFAULT_MACHINE self.qemu_default_machine = get_default_machine(self.qemu_prog)
We're removing the default CPU from aarch64. Every QEMU invocation is expected to have an explicit -cpu value. Signed-off-by: Fabiano Rosas <farosas@suse.de> --- tests/qemu-iotests/testenv.py | 7 +++++++ 1 file changed, 7 insertions(+)