[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only test
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests |
Date: |
Fri, 5 Feb 2021 16:30:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 2/5/21 4:20 PM, Claudio Fontana wrote:
> On 2/5/21 3:43 PM, Philippe Mathieu-Daudé wrote:
>> Some tests explicitly request the TCG accelerator. As these
>> tests will obviously fails if TCG is not present, disable
>> them in such case.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> Cc: Roman Bolshakov <r.bolshakov@yadro.com>
>> Cc: Claudio Fontana <cfontana@suse.de>
>>
>> RFC because of the TODO.
>>
>> Roman posted a series to have a QMP command to query enabled
>> accelerators.
>> ---
>> tests/qtest/arm-cpu-features.c | 33 +++++++++++++++++++++++++++++----
>> 1 file changed, 29 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
>> index c59c3cb002b..c6e86282b66 100644
>> --- a/tests/qtest/arm-cpu-features.c
>> +++ b/tests/qtest/arm-cpu-features.c
>> @@ -20,7 +20,7 @@
>> */
>> #define SVE_MAX_VQ 16
>>
>> -#define MACHINE "-machine virt,gic-version=max -accel tcg "
>> +#define MACHINE_TCG "-machine virt,gic-version=max -accel tcg "
>> #define MACHINE_KVM "-machine virt,gic-version=max -accel kvm -accel tcg "
>> #define QUERY_HEAD "{ 'execute': 'query-cpu-model-expansion', " \
>> " 'arguments': { 'type': 'full', "
>> @@ -41,6 +41,16 @@ static bool kvm_enabled(QTestState *qts)
>> return enabled;
>> }
>>
>> +static bool tcg_enabled(QTestState *qts)
>> +{
>> + /* TODO: Implement QMP query-accel? */
>> +#ifdef CONFIG_TCG
>> + return true;
>> +#else
>> + return false;
>> +#endif /* CONFIG_TCG */
>
>
> I would not use the same name as the existing tcg_enabled(), which has
> different semantics, even in test code;
>
> what you mean here is tcg_available() right?
No, I meant static tcg_enabled as the kvm_enabled() earlier method:
static bool kvm_enabled(QTestState *qts)
{
QDict *resp, *qdict;
bool enabled;
resp = qtest_qmp(qts, "{ 'execute': 'query-kvm' }");
g_assert(qdict_haskey(resp, "return"));
qdict = qdict_get_qdict(resp, "return");
g_assert(qdict_haskey(qdict, "enabled"));
enabled = qdict_get_bool(qdict, "enabled");
qobject_unref(resp);
return enabled;
}
This should be moved to something generic to QTest IMO,
and we need some runtime qtest_is_accelerator_enabled().
- Re: [PATCH 5/9] hw/arm/virt: Improve CPU name in help message, (continued)
- [PATCH 6/9] hw/arm/virt: Display list of valid CPUs for the Virt machine, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 7/9] hw/arm/virt: Do not include 64-bit CPUs in 32-bit build, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 8/9] hw/arm/virt: Restrict 32-bit CPUs to TCG, Philippe Mathieu-Daudé, 2021/02/05
- [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests, Philippe Mathieu-Daudé, 2021/02/05
- Re: [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests, Andrew Jones, 2021/02/05
- Re: [PATCH 0/9] hw/arm/virt: Improve CPU help and fix testing under KVM, Philippe Mathieu-Daudé, 2021/02/05