"Dr. David Alan Gilbert" <[email protected]> writes:
> * Fabiano Rosas ([email protected]) wrote:
>> Signed-off-by: Fabiano Rosas <[email protected]>
>> ---
>> 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.