* [RFC PATCH-for-10.0] hw/vmapple: Allow running QTest framework on macOS
@ 2025-04-01 9:06 Philippe Mathieu-Daudé
2025-04-01 13:20 ` Fabiano Rosas
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-01 9:06 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Fabiano Rosas, Laurent Vivier, Alexander Graf,
Paolo Bonzini, Phil Dennis-Jordan, Philippe Mathieu-Daudé
First, the VMapple machine only works with the ARM 'host' CPU
type, which isn't accepted for QTest:
$ qemu-system-aarch64 -M vmapple -accel qtest
qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
Second, the QTest framework expects machines to be createable
without specifying optional arguments, however the VMapple
machine requires few of them:
$ qemu-system-aarch64 -M vmapple -accel qtest
qemu-system-aarch64: No firmware specified
$ qemu-system-aarch64 -M vmapple -accel qtest -bios /dev/null
qemu-system-aarch64: No AUX device. Please specify one as pflash drive.
Restrict some code path to QTest so we can at least run check-qtest,
otherwise we get:
$ make check-qtest-aarch64
qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
Broken pipe
../tests/qtest/libqtest.c:199: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
...
7/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/test-hmp ERROR 24.71s killed by signal 6 SIGABRT
2/26 qemu:qtest+qtest-aarch64 / qtest-aarch64/qom-test ERROR 71.23s killed by signal 6 SIGABRT
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/vmapple/vmapple.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/vmapple/vmapple.c b/hw/vmapple/vmapple.c
index fa117bf1511..e16c0c72fe5 100644
--- a/hw/vmapple/vmapple.c
+++ b/hw/vmapple/vmapple.c
@@ -48,6 +48,7 @@
#include "qobject/qlist.h"
#include "standard-headers/linux/input.h"
#include "system/hvf.h"
+#include "system/qtest.h"
#include "system/reset.h"
#include "system/runstate.h"
#include "system/system.h"
@@ -494,7 +495,9 @@ static void mach_vmapple_init(MachineState *machine)
machine->ram);
create_gic(vms, sysmem);
- create_bdif(vms, sysmem);
+ if (!qtest_enabled()) {
+ create_bdif(vms, sysmem);
+ }
create_pvpanic(vms, sysmem);
create_aes(vms, sysmem);
create_gfx(vms, sysmem);
@@ -504,7 +507,9 @@ static void mach_vmapple_init(MachineState *machine)
create_gpio_devices(vms, VMAPPLE_GPIO, sysmem);
- vmapple_firmware_init(vms, sysmem);
+ if (!qtest_enabled()) {
+ vmapple_firmware_init(vms, sysmem);
+ }
create_cfg(vms, sysmem, &error_fatal);
/* connect powerdown request */
@@ -541,17 +546,19 @@ static const CPUArchIdList *vmapple_possible_cpu_arch_ids(MachineState *ms)
{
int n;
unsigned int max_cpus = ms->smp.max_cpus;
+ const char *cpu_type;
if (ms->possible_cpus) {
assert(ms->possible_cpus->len == max_cpus);
return ms->possible_cpus;
}
+ cpu_type = qtest_enabled() ? ARM_CPU_TYPE_NAME("max") : ms->cpu_type;
ms->possible_cpus = g_malloc0(sizeof(CPUArchIdList) +
sizeof(CPUArchId) * max_cpus);
ms->possible_cpus->len = max_cpus;
for (n = 0; n < ms->possible_cpus->len; n++) {
- ms->possible_cpus->cpus[n].type = ms->cpu_type;
+ ms->possible_cpus->cpus[n].type = cpu_type;
ms->possible_cpus->cpus[n].arch_id =
arm_build_mp_affinity(n, GICV3_TARGETLIST_BITS);
ms->possible_cpus->cpus[n].props.has_thread_id = true;
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH-for-10.0] hw/vmapple: Allow running QTest framework on macOS
2025-04-01 9:06 [RFC PATCH-for-10.0] hw/vmapple: Allow running QTest framework on macOS Philippe Mathieu-Daudé
@ 2025-04-01 13:20 ` Fabiano Rosas
2025-04-03 12:44 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 3+ messages in thread
From: Fabiano Rosas @ 2025-04-01 13:20 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Thomas Huth, Laurent Vivier, Alexander Graf, Paolo Bonzini,
Phil Dennis-Jordan, Philippe Mathieu-Daudé
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> First, the VMapple machine only works with the ARM 'host' CPU
> type, which isn't accepted for QTest:
>
> $ qemu-system-aarch64 -M vmapple -accel qtest
> qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
>
> Second, the QTest framework expects machines to be createable
> without specifying optional arguments, however the VMapple
> machine requires few of them:
>
> $ qemu-system-aarch64 -M vmapple -accel qtest
> qemu-system-aarch64: No firmware specified
>
> $ qemu-system-aarch64 -M vmapple -accel qtest -bios /dev/null
> qemu-system-aarch64: No AUX device. Please specify one as pflash drive.
>
> Restrict some code path to QTest so we can at least run check-qtest,
> otherwise we get:
Or add vmapple as an exception in qtest_cb_for_every_machine():
for (i = 0; machines[i].name != NULL; i++) {
/* Ignore machines that cannot be used for qtests */
if (!strncmp("xenfv", machines[i].name, 5) ||
g_str_equal("xenpv", machines[i].name) ||
g_str_equal("xenpvh", machines[i].name) ||
g_str_equal("nitro-enclave", machines[i].name)) {
continue;
}
...
}
Anyway:
Acked-by: Fabiano Rosas <farosas@suse.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH-for-10.0] hw/vmapple: Allow running QTest framework on macOS
2025-04-01 13:20 ` Fabiano Rosas
@ 2025-04-03 12:44 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-03 12:44 UTC (permalink / raw)
To: Fabiano Rosas, qemu-devel
Cc: Thomas Huth, Laurent Vivier, Alexander Graf, Paolo Bonzini,
Phil Dennis-Jordan
On 1/4/25 15:20, Fabiano Rosas wrote:
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
>> First, the VMapple machine only works with the ARM 'host' CPU
>> type, which isn't accepted for QTest:
>>
>> $ qemu-system-aarch64 -M vmapple -accel qtest
>> qemu-system-aarch64: The 'host' CPU type can only be used with KVM or HVF
>>
>> Second, the QTest framework expects machines to be createable
>> without specifying optional arguments, however the VMapple
>> machine requires few of them:
>>
>> $ qemu-system-aarch64 -M vmapple -accel qtest
>> qemu-system-aarch64: No firmware specified
>>
>> $ qemu-system-aarch64 -M vmapple -accel qtest -bios /dev/null
>> qemu-system-aarch64: No AUX device. Please specify one as pflash drive.
>>
>> Restrict some code path to QTest so we can at least run check-qtest,
>> otherwise we get:
>
> Or add vmapple as an exception in qtest_cb_for_every_machine():
>
> for (i = 0; machines[i].name != NULL; i++) {
> /* Ignore machines that cannot be used for qtests */
> if (!strncmp("xenfv", machines[i].name, 5) ||
> g_str_equal("xenpv", machines[i].name) ||
> g_str_equal("xenpvh", machines[i].name) ||
> g_str_equal("nitro-enclave", machines[i].name)) {
> continue;
> }
> ...
> }
Oh, I was not aware of qtest_cb_for_every_machine(), thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-03 12:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 9:06 [RFC PATCH-for-10.0] hw/vmapple: Allow running QTest framework on macOS Philippe Mathieu-Daudé
2025-04-01 13:20 ` Fabiano Rosas
2025-04-03 12:44 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).