qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v4 11/15] tests/qemu-iotests: Allow passing a -cpu option


From: Richard Henderson
Subject: Re: [RFC PATCH v4 11/15] tests/qemu-iotests: Allow passing a -cpu option in the QEMU cmdline
Date: Thu, 19 Jan 2023 09:09:42 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]