[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v4 08/15] tests/qtest: Adjust test-hmp to always pass -cp
From: |
Fabiano Rosas |
Subject: |
Re: [RFC PATCH v4 08/15] tests/qtest: Adjust test-hmp to always pass -cpu option |
Date: |
Thu, 19 Jan 2023 11:39:10 -0300 |
"Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:
> * Fabiano Rosas (farosas@suse.de) wrote:
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> tests/qtest/test-hmp.c | 34 +++++++++++++++++++++++++++++++---
>> 1 file changed, 31 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
>> index f8b22abe4c..c367612d4a 100644
>> --- a/tests/qtest/test-hmp.c
>> +++ b/tests/qtest/test-hmp.c
>> @@ -121,21 +121,49 @@ static void test_info_commands(QTestState *qts)
>> g_free(info_buf);
>> }
>>
>> +static const char *arch_get_cpu(const char *machine)
>> +{
>> + const char *arch = qtest_get_arch();
>> +
>> + if (g_str_equal(arch, "aarch64")) {
>> + if (!strncmp(machine, "virt", 4)) {
>> + return "cortex-a57";
>
> Won't that break on a kvm host on a different CPU?
> Would -cpu max work on everything?
These tests run with -accel qtest only. No TCG or KVM. So this won't
break a KVM host with a different CPU. But we also cannot expect that
cpu to do anything useful. This is more to avoid initial configuration
code to break due to lack of cpu.
About -cpu max, before this series, it works because of a nuance of the
code which does:
aarch64_max_initfn:
if kvm || hvf
host
else
cortex-a57
extra_features that depend on TCG
After this series this becomes roughly (see patch 01):
aarch64_max_initfn:
if kvm || hvf
host
else if qtest
cortex-a57
#ifdef CONFIG_TCG
else if tcg
cortex-a57
extra_features that depend on TCG
#endif
The above routine causes us to have two different -cpu max depending on
whether TCG is built in or not, so I'm basically bypassing it and
hardcoding cortex-a57 to be consistent.
- [RFC PATCH v4 06/15] tests/qtest: Add qtest_get_machine_args, (continued)
- [RFC PATCH v4 07/15] tests/qtest: Adjust qom-test to always set a -cpu option, Fabiano Rosas, 2023/01/19
- [RFC PATCH v4 08/15] tests/qtest: Adjust test-hmp to always pass -cpu option, Fabiano Rosas, 2023/01/19
- [RFC PATCH v4 09/15] tests/qtest: Adjust device-introspect-test to always set a -cpu option, Fabiano Rosas, 2023/01/19
- [RFC PATCH v4 10/15] tests/qtest: aarch64: Set -cpu for numa-test, Fabiano Rosas, 2023/01/19
- [RFC PATCH v4 11/15] tests/qemu-iotests: Allow passing a -cpu option in the QEMU cmdline, Fabiano Rosas, 2023/01/19
- [RFC PATCH v4 12/15] tests/tcg: Do not build/run TCG tests if TCG is disabled, Fabiano Rosas, 2023/01/19
- [RFC PATCH v4 13/15] target/avocado: Pass parameters to migration test on aarch64, Fabiano Rosas, 2023/01/19